-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(input-phone): implement the input phone component
- Loading branch information
1 parent
a2148dc
commit 3e10556
Showing
76 changed files
with
1,456 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+55.7 KB
.yarn/cache/@radix-ui-react-scroll-area-npm-1.0.4-8a22706f83-f959006a73.zip
Binary file not shown.
Binary file added
BIN
+24 KB
.yarn/cache/@simbathesailor-use-what-changed-npm-2.0.0-07bf7c0a7f-a90e5b7388.zip
Binary file not shown.
Binary file renamed
BIN
+20.7 KB
...a11y-npm-7.0.26-334e8aa532-f855746f50.zip → ...a11y-npm-7.0.27-3a6262ec73-f7b377fe80.zip
Binary file not shown.
Binary file renamed
BIN
+18.9 KB
...ions-npm-7.0.26-0ea6955119-9d0ab3c3fa.zip → ...ions-npm-7.0.27-b261aecf81-8439c34880.zip
Binary file not shown.
Binary file renamed
BIN
+12.9 KB
...unds-npm-7.0.26-b0821fc0b7-980a88e515.zip → ...unds-npm-7.0.27-793dd3a2a9-321995ba20.zip
Binary file not shown.
Binary file renamed
BIN
+8.82 KB
...rols-npm-7.0.26-afc3e51fd0-965dc67d31.zip → ...rols-npm-7.0.27-c6fb3daa84-52b40da823.zip
Binary file not shown.
Binary file renamed
BIN
+36.4 KB
...docs-npm-7.0.26-ddbec8fea5-cb3e6b458e.zip → ...docs-npm-7.0.27-8fae13f144-d31ab2ebfb.zip
Binary file not shown.
Binary file renamed
BIN
+23.7 KB
...ials-npm-7.0.26-816717adcf-f1acf6c0f7.zip → ...ials-npm-7.0.27-e131f80442-a4d006a2f7.zip
Binary file not shown.
Binary file renamed
BIN
+6.8 KB
...ight-npm-7.0.26-d5443ba150-99f38257c5.zip → ...ight-npm-7.0.27-3208a0d43b-02f1e908e9.zip
Binary file not shown.
Binary file renamed
BIN
+39.8 KB
...ions-npm-7.0.26-ba31e98c42-a05ae9a34c.zip → ...ions-npm-7.0.27-533b16913c-c8b99e119b.zip
Binary file not shown.
Binary file renamed
BIN
+14.7 KB
...inks-npm-7.0.26-7c007d34dc-4c8f8f6cc2.zip → ...inks-npm-7.0.27-a81f66c4a4-c58a80ef3f.zip
Binary file not shown.
Binary file renamed
BIN
+14.8 KB
...sure-npm-7.0.26-22228b5950-e8e11886f2.zip → ...sure-npm-7.0.27-65cbf374ce-1fbc19e233.zip
Binary file not shown.
Binary file renamed
BIN
+10.5 KB
...line-npm-7.0.26-082b203dea-01cb4d4bbf.zip → ...line-npm-7.0.27-72bf5ed8fd-e70547052d.zip
Binary file not shown.
Binary file renamed
BIN
+8.88 KB
...bars-npm-7.0.26-ee75a76ef0-ac33482e24.zip → ...bars-npm-7.0.27-eeaf67a68d-f18c10f7b9.zip
Binary file not shown.
Binary file renamed
BIN
+14.9 KB
...port-npm-7.0.26-2afac67ba5-72c26084ce.zip → ...port-npm-7.0.27-d28416e78c-7b3d25d1c9.zip
Binary file not shown.
Binary file renamed
BIN
+3.41 KB
...dons-npm-7.0.26-e5fa3b72c0-c07b7bbcac.zip → ...dons-npm-7.0.27-60317ca6d2-96cb7edfd0.zip
Binary file not shown.
Binary file renamed
BIN
+77.6 KB
...ocks-npm-7.0.26-38b0b4f33c-db6e07d04b.zip → ...ocks-npm-7.0.27-a4931ab819-9c1628ad8e.zip
Binary file not shown.
Binary file renamed
BIN
+18.8 KB
...ager-npm-7.0.26-80120b2d77-e4f9832f3f.zip → ...ager-npm-7.0.27-2c9611b347-55ea479a75.zip
Binary file not shown.
Binary file renamed
BIN
+23.8 KB
...vite-npm-7.0.26-86a965577c-d066c99149.zip → ...vite-npm-7.0.27-6cc30ff004-8ccc8ce006.zip
Binary file not shown.
Binary file renamed
BIN
+7.37 KB
...sage-npm-7.0.26-455eabf491-bc050b3f9a.zip → ...sage-npm-7.0.27-572509173c-f5d10bec68.zip
Binary file not shown.
Binary file renamed
BIN
+4.87 KB
...cket-npm-7.0.26-5459e69b97-196e1b158a.zip → ...cket-npm-7.0.27-4449aae23d-98eb0e2151.zip
Binary file not shown.
Binary file renamed
BIN
+4.51 KB
...nels-npm-7.0.26-bab1d5b194-2b72a790e7.zip → ...nels-npm-7.0.27-2cfed21b58-a6d10ccc93.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+4.68 KB
...gger-npm-7.0.26-774877daa6-80ad3f1709.zip → ...gger-npm-7.0.27-1f9a1997e4-ee611ffd34.zip
Binary file not shown.
Binary file renamed
BIN
+224 KB
...emod-npm-7.0.26-da0634d3bc-bf868e038c.zip → ...emod-npm-7.0.27-304b995d66-8eabbcaa18.zip
Binary file not shown.
Binary file renamed
BIN
+1.46 MB
...ents-npm-7.0.26-946db4ba32-7e42daad24.zip → ...ents-npm-7.0.27-4297ce24e2-2e345fd5a6.zip
Binary file not shown.
Binary file renamed
BIN
+4.39 KB
...ient-npm-7.0.26-7df9b0f4c0-82342d0955.zip → ...ient-npm-7.0.27-897a9359a4-0dc63b63a6.zip
Binary file not shown.
Binary file renamed
BIN
+25.7 KB
...mmon-npm-7.0.26-7894e99946-43d110d591.zip → ...mmon-npm-7.0.27-f3b9371dbe-456b5d1035.zip
Binary file not shown.
Binary file renamed
BIN
+5.41 KB
...ents-npm-7.0.26-af5d90b282-168029e6a8.zip → ...ents-npm-7.0.27-a120140f76-ca5fe8e791.zip
Binary file not shown.
Binary file renamed
BIN
+70.5 KB
...rver-npm-7.0.26-0589c8b6a6-5fea5e8ae2.zip → ...rver-npm-7.0.27-5edfc31644-88ff03f45d.zip
Binary file not shown.
Binary file renamed
BIN
+4.16 KB
...ugin-npm-7.0.26-0646e11882-6d7ced3ca3.zip → ...ugin-npm-7.0.27-7054c3dbd1-09ea73d002.zip
Binary file not shown.
Binary file renamed
BIN
+11.4 KB
...ools-npm-7.0.26-543f007ebc-834a2add58.zip → ...ools-npm-7.0.27-3faa4c996f-4e7fe8c93e.zip
Binary file not shown.
Binary file renamed
BIN
+16.1 KB
...ools-npm-7.0.26-ada30ecb36-d4617365c0.zip → ...ools-npm-7.0.27-3d0b60c62f-5f431b028f.zip
Binary file not shown.
Binary file renamed
BIN
+15.1 KB
...nter-npm-7.0.26-71a0421278-2b257c40a5.zip → ...nter-npm-7.0.27-ff5380a42d-7314ef6214.zip
Binary file not shown.
Binary file renamed
BIN
+45.5 KB
...-api-npm-7.0.26-bfbc8123f8-98fd61b023.zip → ...-api-npm-7.0.27-13ac7bb40b-18b4e74f4d.zip
Binary file not shown.
Binary file renamed
BIN
+833 KB
...ager-npm-7.0.26-ce3e1a67d5-4912726b5d.zip → ...ager-npm-7.0.27-8327b8bac3-ad4e53b59b.zip
Binary file not shown.
Binary file renamed
BIN
+4.21 KB
...gger-npm-7.0.26-8ebc6e6675-c448230516.zip → ...gger-npm-7.0.27-a9eefd8f72-d055dd00c6.zip
Binary file not shown.
Binary file renamed
BIN
+7.62 KB
...tall-npm-7.0.26-1aeecb6b4a-100fe5f9da.zip → ...tall-npm-7.0.27-015ac4ba9d-e4a84de078.zip
Binary file not shown.
Binary file renamed
BIN
+222 KB
...-api-npm-7.0.26-3d3b4cb982-137c3730e0.zip → ...-api-npm-7.0.27-1622dcf38d-f82f22f2c4.zip
Binary file not shown.
Binary file renamed
BIN
+90.9 KB
...view-npm-7.0.26-07b83cda3b-46a30d74e7.zip → ...view-npm-7.0.27-c95fd729fb-581c6a2920.zip
Binary file not shown.
Binary file renamed
BIN
+14 KB
...shim-npm-7.0.26-09c6979316-7294fe9063.zip → ...shim-npm-7.0.27-d29851c2ce-ea74b77438.zip
Binary file not shown.
Binary file renamed
BIN
+156 KB
...eact-npm-7.0.26-4f89c2fc45-c48527eb38.zip → ...eact-npm-7.0.27-0103346c98-4d448ae216.zip
Binary file not shown.
Binary file renamed
BIN
+15.2 KB
...vite-npm-7.0.26-a76b769438-87ff37dd41.zip → ...vite-npm-7.0.27-a730788117-081f50f4ea.zip
Binary file not shown.
Binary file renamed
BIN
+27.4 KB
...uter-npm-7.0.26-47d484ab00-1bb84aabe3.zip → ...uter-npm-7.0.27-6650e6f22f-2ab89f268c.zip
Binary file not shown.
Binary file renamed
BIN
+20.5 KB
...etry-npm-7.0.26-dc9df0d931-9c34c4277d.zip → ...etry-npm-7.0.27-447899bdf8-375ffaa77f.zip
Binary file not shown.
Binary file renamed
BIN
+148 KB
...ming-npm-7.0.26-6a60121b78-2a77bbce44.zip → ...ming-npm-7.0.27-7851401597-48b128595c.zip
Binary file not shown.
Binary file renamed
BIN
+24.1 KB
...ypes-npm-7.0.26-4620e8296f-e5e28c3534.zip → ...ypes-npm-7.0.27-4939c20fbf-ca7588554a.zip
Binary file not shown.
Binary file renamed
BIN
+737 KB
...node-npm-20.4.1-16fae4d18f-22cbcc792f.zip → ...node-npm-20.4.2-0b33863e43-99e544ea75.zip
Binary file not shown.
Binary file renamed
BIN
+11.4 KB
...-dom-npm-18.2.6-7f191ee628-b56e42efab.zip → ...-dom-npm-18.2.7-a20ba684a5-e02ea90828.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+1.65 KB
...book-npm-7.0.26-0c0afa7237-4a6a9241ad.zip → ...book-npm-7.0.27-88e8627de0-a02c5a21e8.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/fractal/src/components/InputPhone/InputPhone.constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import getUnicodeFlagIcon from 'country-flag-icons/unicode' | ||
import { getCountries, getCountryCallingCode } from 'libphonenumber-js/max' | ||
|
||
import { CountryDetails } from './InputPhone.types' | ||
|
||
export const DEFAULT_COUNTRY_CODE = 'FR' | ||
|
||
export const countryByCountryCode: Record<string, CountryDetails> = {} | ||
export const supportedCountries = getCountries().map((countryCode) => { | ||
const countryDetails: CountryDetails = { | ||
countryCode, | ||
countryName: | ||
new Intl.DisplayNames(undefined, { type: 'region' }).of(countryCode) || | ||
'Unknown', | ||
flag: getUnicodeFlagIcon(countryCode), | ||
prefix: getCountryCallingCode(countryCode), | ||
} | ||
|
||
countryByCountryCode[countryDetails.countryCode] = countryDetails | ||
|
||
return countryDetails | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { | ||
ArgTypes, | ||
Controls, | ||
Description, | ||
Meta, | ||
Primary, | ||
Subtitle, | ||
Title, | ||
} from '@storybook/blocks' | ||
|
||
import * as InputPhoneStories from './InputPhone.stories' | ||
|
||
<Meta of={InputPhoneStories} /> | ||
|
||
<Title /> | ||
|
||
<Subtitle /> | ||
|
||
<Description /> | ||
|
||
--- | ||
|
||
## Props | ||
|
||
The component accepts the following props: | ||
|
||
<ArgTypes /> | ||
|
||
## Playground | ||
|
||
<Primary /> | ||
|
||
<Controls /> |
Oops, something went wrong.