@worldcoin/mini-apps-ui-kit-react 1.0.0-canary.22 → 1.0.0-canary.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -35
- package/dist/components/Button/Button.js +4 -4
- package/dist/components/CountryDrawer/CountryDrawer.js +3 -1
- package/dist/components/Flag/constants.d.ts +22 -0
- package/dist/components/Flag/constants.js +234 -1
- package/dist/components/Icons/Clock.js +4 -4
- package/dist/components/Icons/Warning.js +2 -2
- package/dist/components/NumberPad/Delete.js +1 -0
- package/dist/components/PhoneField/constants.d.ts +0 -2
- package/dist/components/PhoneField/constants.js +1 -25
- package/dist/components/PhoneField/utils.js +4 -4
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/lib/haptics.d.ts +5 -5
- package/dist/lib/haptics.js +14 -14
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.js +35 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18_ecf5vqfgocrxupsewlhf3pl374/node_modules/@radix-ui/react-primitive/dist/index.js +38 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js +88 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.1.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types_re_cidkwodbmpmiwtvvmizcw56fem/node_modules/@radix-ui/react-visually-hidden/dist/index.js +33 -0
- package/package.json +16 -15
- package/dist/node_modules/.pnpm/countries-list@3.1.1/node_modules/countries-list/mjs/index.js +0 -10
- package/public/flags/AD.svg +0 -35
- package/public/flags/AE.svg +0 -30
- package/public/flags/AF.svg +0 -34
- package/public/flags/AG.svg +0 -38
- package/public/flags/AI.svg +0 -54
- package/public/flags/AL.svg +0 -22
- package/public/flags/AM.svg +0 -26
- package/public/flags/AO.svg +0 -34
- package/public/flags/AR.svg +0 -30
- package/public/flags/AS.svg +0 -38
- package/public/flags/AT.svg +0 -26
- package/public/flags/AU.svg +0 -59
- package/public/flags/AW.svg +0 -38
- package/public/flags/AX.svg +0 -38
- package/public/flags/AZ.svg +0 -34
- package/public/flags/BA.svg +0 -30
- package/public/flags/BB.svg +0 -30
- package/public/flags/BD.svg +0 -22
- package/public/flags/BE.svg +0 -26
- package/public/flags/BF.svg +0 -31
- package/public/flags/BG.svg +0 -26
- package/public/flags/BH.svg +0 -22
- package/public/flags/BI.svg +0 -50
- package/public/flags/BJ.svg +0 -26
- package/public/flags/BL.svg +0 -44
- package/public/flags/BM.svg +0 -52
- package/public/flags/BN.svg +0 -42
- package/public/flags/BO.svg +0 -26
- package/public/flags/BQ.svg +0 -34
- package/public/flags/BR.svg +0 -34
- package/public/flags/BS.svg +0 -30
- package/public/flags/BT.svg +0 -30
- package/public/flags/BW.svg +0 -30
- package/public/flags/BY.svg +0 -50
- package/public/flags/BZ.svg +0 -43
- package/public/flags/CA.svg +0 -30
- package/public/flags/CC.svg +0 -54
- package/public/flags/CD.svg +0 -34
- package/public/flags/CF.svg +0 -52
- package/public/flags/CG.svg +0 -26
- package/public/flags/CH.svg +0 -22
- package/public/flags/CI.svg +0 -26
- package/public/flags/CK.svg +0 -66
- package/public/flags/CL.svg +0 -30
- package/public/flags/CM.svg +0 -30
- package/public/flags/CN.svg +0 -38
- package/public/flags/CO.svg +0 -26
- package/public/flags/CR.svg +0 -30
- package/public/flags/CU.svg +0 -39
- package/public/flags/CV.svg +0 -70
- package/public/flags/CW.svg +0 -34
- package/public/flags/CY.svg +0 -26
- package/public/flags/CZ.svg +0 -26
- package/public/flags/DE.svg +0 -26
- package/public/flags/DJ.svg +0 -30
- package/public/flags/DK.svg +0 -34
- package/public/flags/DM.svg +0 -114
- package/public/flags/DO.svg +0 -46
- package/public/flags/DZ.svg +0 -30
- package/public/flags/EC.svg +0 -38
- package/public/flags/EE.svg +0 -26
- package/public/flags/EG.svg +0 -30
- package/public/flags/ER.svg +0 -30
- package/public/flags/ES.svg +0 -26
- package/public/flags/ET.svg +0 -38
- package/public/flags/EU.svg +0 -50
- package/public/flags/FI.svg +0 -22
- package/public/flags/FJ.svg +0 -47
- package/public/flags/FK.svg +0 -50
- package/public/flags/FM.svg +0 -34
- package/public/flags/FO.svg +0 -26
- package/public/flags/FR.svg +0 -26
- package/public/flags/GA.svg +0 -26
- package/public/flags/GB.svg +0 -70
- package/public/flags/GD.svg +0 -83
- package/public/flags/GE.svg +0 -38
- package/public/flags/GG.svg +0 -26
- package/public/flags/GH.svg +0 -30
- package/public/flags/GI.svg +0 -30
- package/public/flags/GL.svg +0 -30
- package/public/flags/GM.svg +0 -30
- package/public/flags/GN.svg +0 -26
- package/public/flags/GP.svg +0 -26
- package/public/flags/GQ.svg +0 -39
- package/public/flags/GR.svg +0 -38
- package/public/flags/GT.svg +0 -34
- package/public/flags/GU.svg +0 -44
- package/public/flags/GW.svg +0 -34
- package/public/flags/GY.svg +0 -38
- package/public/flags/HK.svg +0 -38
- package/public/flags/HN.svg +0 -46
- package/public/flags/HR.svg +0 -69
- package/public/flags/HT.svg +0 -40
- package/public/flags/HU.svg +0 -26
- package/public/flags/ID.svg +0 -22
- package/public/flags/IE.svg +0 -26
- package/public/flags/IL.svg +0 -30
- package/public/flags/IM.svg +0 -22
- package/public/flags/IN.svg +0 -38
- package/public/flags/IO.svg +0 -82
- package/public/flags/IQ.svg +0 -38
- package/public/flags/IR.svg +0 -30
- package/public/flags/IS.svg +0 -38
- package/public/flags/IT.svg +0 -26
- package/public/flags/JE.svg +0 -30
- package/public/flags/JM.svg +0 -34
- package/public/flags/JO.svg +0 -34
- package/public/flags/JP.svg +0 -22
- package/public/flags/KE.svg +0 -54
- package/public/flags/KG.svg +0 -42
- package/public/flags/KH.svg +0 -30
- package/public/flags/KI.svg +0 -46
- package/public/flags/KM.svg +0 -54
- package/public/flags/KP.svg +0 -38
- package/public/flags/KR.svg +0 -98
- package/public/flags/KW.svg +0 -30
- package/public/flags/KY.svg +0 -55
- package/public/flags/KZ.svg +0 -30
- package/public/flags/LA.svg +0 -30
- package/public/flags/LB.svg +0 -30
- package/public/flags/LC.svg +0 -21
- package/public/flags/LI.svg +0 -26
- package/public/flags/LK.svg +0 -32
- package/public/flags/LR.svg +0 -70
- package/public/flags/LS.svg +0 -30
- package/public/flags/LT.svg +0 -26
- package/public/flags/LU.svg +0 -26
- package/public/flags/LV.svg +0 -26
- package/public/flags/LY.svg +0 -34
- package/public/flags/MA.svg +0 -22
- package/public/flags/MC.svg +0 -22
- package/public/flags/MD.svg +0 -35
- package/public/flags/ME.svg +0 -35
- package/public/flags/MG.svg +0 -26
- package/public/flags/MH.svg +0 -30
- package/public/flags/MK.svg +0 -58
- package/public/flags/ML.svg +0 -26
- package/public/flags/MM.svg +0 -30
- package/public/flags/MN.svg +0 -42
- package/public/flags/MO.svg +0 -50
- package/public/flags/MP.svg +0 -34
- package/public/flags/MQ.svg +0 -50
- package/public/flags/MR.svg +0 -26
- package/public/flags/MS.svg +0 -46
- package/public/flags/MT.svg +0 -26
- package/public/flags/MU.svg +0 -30
- package/public/flags/MV.svg +0 -23
- package/public/flags/MW.svg +0 -30
- package/public/flags/MX.svg +0 -34
- package/public/flags/MY.svg +0 -46
- package/public/flags/MZ.svg +0 -43
- package/public/flags/NA.svg +0 -34
- package/public/flags/NE.svg +0 -30
- package/public/flags/NF.svg +0 -30
- package/public/flags/NG.svg +0 -26
- package/public/flags/NI.svg +0 -39
- package/public/flags/NL.svg +0 -26
- package/public/flags/NO.svg +0 -38
- package/public/flags/NP.svg +0 -39
- package/public/flags/NR.svg +0 -34
- package/public/flags/NU.svg +0 -55
- package/public/flags/NZ.svg +0 -50
- package/public/flags/OM.svg +0 -38
- package/public/flags/PA.svg +0 -34
- package/public/flags/PE.svg +0 -26
- package/public/flags/PF.svg +0 -37
- package/public/flags/PG.svg +0 -46
- package/public/flags/PH.svg +0 -42
- package/public/flags/PK.svg +0 -34
- package/public/flags/PL.svg +0 -22
- package/public/flags/PN.svg +0 -50
- package/public/flags/PR.svg +0 -38
- package/public/flags/PS.svg +0 -30
- package/public/flags/PT.svg +0 -34
- package/public/flags/PW.svg +0 -22
- package/public/flags/PY.svg +0 -34
- package/public/flags/QA.svg +0 -22
- package/public/flags/RO.svg +0 -26
- package/public/flags/RS.svg +0 -42
- package/public/flags/RU.svg +0 -26
- package/public/flags/RW.svg +0 -30
- package/public/flags/SA.svg +0 -36
- package/public/flags/SB.svg +0 -46
- package/public/flags/SC.svg +0 -34
- package/public/flags/SD.svg +0 -30
- package/public/flags/SE.svg +0 -39
- package/public/flags/SG.svg +0 -46
- package/public/flags/SI.svg +0 -30
- package/public/flags/SK.svg +0 -42
- package/public/flags/SL.svg +0 -26
- package/public/flags/SM.svg +0 -42
- package/public/flags/SN.svg +0 -30
- package/public/flags/SO.svg +0 -22
- package/public/flags/SR.svg +0 -34
- package/public/flags/SS.svg +0 -38
- package/public/flags/ST.svg +0 -38
- package/public/flags/SV.svg +0 -35
- package/public/flags/SX.svg +0 -46
- package/public/flags/SY.svg +0 -34
- package/public/flags/SZ.svg +0 -50
- package/public/flags/TC.svg +0 -54
- package/public/flags/TD.svg +0 -26
- package/public/flags/TG.svg +0 -38
- package/public/flags/TH.svg +0 -30
- package/public/flags/TJ.svg +0 -58
- package/public/flags/TK.svg +0 -38
- package/public/flags/TL.svg +0 -30
- package/public/flags/TM.svg +0 -95
- package/public/flags/TN.svg +0 -30
- package/public/flags/TO.svg +0 -26
- package/public/flags/TR.svg +0 -26
- package/public/flags/TT.svg +0 -30
- package/public/flags/TV.svg +0 -72
- package/public/flags/TW.svg +0 -34
- package/public/flags/TZ.svg +0 -30
- package/public/flags/UA.svg +0 -22
- package/public/flags/UG.svg +0 -42
- package/public/flags/US.svg +0 -38
- package/public/flags/UY.svg +0 -42
- package/public/flags/UZ.svg +0 -86
- package/public/flags/VA.svg +0 -30
- package/public/flags/VC.svg +0 -43
- package/public/flags/VE.svg +0 -58
- package/public/flags/VG.svg +0 -53
- package/public/flags/VN.svg +0 -22
- package/public/flags/VU.svg +0 -111
- package/public/flags/WS.svg +0 -42
- package/public/flags/XK.svg +0 -46
- package/public/flags/YE.svg +0 -26
- package/public/flags/ZA.svg +0 -38
- package/public/flags/ZM.svg +0 -34
- package/public/flags/ZW.svg +0 -58
- package/public/fonts/TWKLausanne-350.woff +0 -0
- package/public/fonts/TWKLausanne-350Italic.woff +0 -0
- package/public/fonts/TWKLausanne-500.woff +0 -0
- package/public/fonts/TWKLausanne-500Italic.woff +0 -0
- package/public/fonts/TWKLausanne-600.woff +0 -0
- package/public/fonts/TWKLausanne-600Italic.woff +0 -0
- package/public/globals.css +0 -3
- package/public/images/marbles/marble1.png +0 -0
- package/public/images/marbles/marble2.png +0 -0
- package/public/images/marbles/marble3.svg +0 -36
package/README.md
CHANGED
@@ -57,21 +57,12 @@ export default tseslint.config({
|
|
57
57
|
});
|
58
58
|
```
|
59
59
|
|
60
|
-
## Font
|
60
|
+
## Font
|
61
61
|
|
62
62
|
The library uses the following font **[TWK Lausanne](https://weltkern.com/typefaces/lausanne)** as the sans-serif font for all text `(--font-sans)`.
|
63
63
|
|
64
64
|
> **⚠️ License Notice**: TWK Lausanne is a commercial font that requires a license. Make sure you have obtained the appropriate license from [Weltkern](https://weltkern.com/typefaces/lausanne) before using it in your project.
|
65
65
|
|
66
|
-
By default, the library sets `--font-sans` to **TWK Lausanne**, but you can override this CSS variable to use any other font of your choice:
|
67
|
-
|
68
|
-
```css
|
69
|
-
:root {
|
70
|
-
--font-sans: 'Your Font Name', sans-serif;
|
71
|
-
}
|
72
|
-
```
|
73
|
-
|
74
|
-
You must import the font in your application before using it. The library does not include the font files - you need to handle the font loading yourself according to your license agreement.
|
75
66
|
|
76
67
|
## Importing Styles
|
77
68
|
|
@@ -81,33 +72,11 @@ To use the UI Kit components with their proper styling, you need to import the s
|
|
81
72
|
import "@worldcoin/mini-apps-ui-kit-react/styles.css";
|
82
73
|
```
|
83
74
|
|
84
|
-
## Import Methods
|
85
|
-
|
86
|
-
The library supports two different import methods:
|
87
|
-
|
88
|
-
### Default Import
|
89
|
-
|
90
|
-
Import components from the main entry point:
|
91
|
-
|
92
|
-
```typescript
|
93
|
-
import { Button } from "@worldcoin/mini-apps-ui-kit-react";
|
94
|
-
```
|
95
|
-
|
96
|
-
This method is simpler but includes all components in your bundle, even if you're not using them.
|
97
|
-
|
98
|
-
### Component-Level Import
|
99
|
-
|
100
|
-
Import components directly from their individual modules:
|
101
|
-
|
102
|
-
```typescript
|
103
|
-
import { Button } from "@worldcoin/mini-apps-ui-kit-react/Button";
|
104
|
-
```
|
105
|
-
|
106
|
-
This method enables tree-shaking and reduces your final bundle size by only including the components you actually use. Recommended for production applications where bundle size is a concern.
|
107
|
-
|
108
75
|
## Icons
|
109
76
|
|
110
|
-
The library uses [Iconoir](https://iconoir.com/)
|
77
|
+
The library uses a custom set of icons built on top of [Iconoir](https://iconoir.com/). While we provide our own custom set, we highly recommend using Iconoir directly for your miniapps as it offers a comprehensive and well-maintained icon system.
|
78
|
+
|
79
|
+
To use Iconoir in your project, you'll need to install the [React package](https://www.npmjs.com/package/iconoir-react):
|
111
80
|
|
112
81
|
```bash
|
113
82
|
npm install iconoir-react
|
@@ -11,9 +11,9 @@ const buttonVariants = cva(
|
|
11
11
|
{
|
12
12
|
variants: {
|
13
13
|
variant: {
|
14
|
-
primary: "bg-gray-900 text-gray-0
|
15
|
-
secondary: "bg-transparent text-gray-900 border border-gray-200
|
16
|
-
tertiary: "bg-gray-100 text-gray-900
|
14
|
+
primary: "bg-gray-900 text-gray-0 disabled:bg-gray-100 disabled:text-gray-300",
|
15
|
+
secondary: "bg-transparent text-gray-900 border border-gray-200 disabled:text-gray-300 disabled:border-gray-100",
|
16
|
+
tertiary: "bg-gray-100 text-gray-900 disabled:text-gray-300 disabled:bg-gray-50"
|
17
17
|
},
|
18
18
|
size: {
|
19
19
|
sm: "h-10 min-w-10 px-4",
|
@@ -52,7 +52,7 @@ const Button = forwardRef(
|
|
52
52
|
}),
|
53
53
|
props.className
|
54
54
|
),
|
55
|
-
onClick: withHaptics(onClick, () => haptics.impact(
|
55
|
+
onClick: withHaptics(onClick, () => haptics.impact("light")),
|
56
56
|
children
|
57
57
|
}
|
58
58
|
);
|
@@ -1,11 +1,12 @@
|
|
1
1
|
"use client";
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
3
|
+
import { VisuallyHidden } from "../../node_modules/.pnpm/@radix-ui_react-visually-hidden@1.1.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types_re_cidkwodbmpmiwtvvmizcw56fem/node_modules/@radix-ui/react-visually-hidden/dist/index.js";
|
3
4
|
import { useState, useRef } from "react";
|
4
5
|
import { XMark } from "../Icons/XMark.js";
|
5
6
|
import { GroupedCountryList } from "../PhoneField/GroupedCountryList.js";
|
6
7
|
import { useCountryFiltering } from "./useCountryFiltering.js";
|
7
8
|
import { useCountryGrouping } from "./useCountryGrouping.js";
|
8
|
-
import { Drawer, DrawerTrigger, DrawerContent, DrawerClose } from "../Drawer/Drawer.js";
|
9
|
+
import { Drawer, DrawerTrigger, DrawerContent, DrawerTitle, DrawerClose } from "../Drawer/Drawer.js";
|
9
10
|
import { TopBar } from "../TopBar/TopBar.js";
|
10
11
|
import { Button } from "../Button/Button.js";
|
11
12
|
import { SearchField } from "../SearchField/SearchField.js";
|
@@ -42,6 +43,7 @@ function CountryDrawer({
|
|
42
43
|
return /* @__PURE__ */ jsxs(Drawer, { open, onOpenChange: setOpen, onAnimationEnd, height: "full", children: [
|
43
44
|
/* @__PURE__ */ jsx(DrawerTrigger, { asChild: true, className: "outline-none", disabled, children }),
|
44
45
|
/* @__PURE__ */ jsxs(DrawerContent, { children: [
|
46
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(DrawerTitle, { children: title }) }),
|
45
47
|
/* @__PURE__ */ jsx(
|
46
48
|
TopBar,
|
47
49
|
{
|
@@ -1 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* Unsupported countries:
|
3
|
+
* - Antarctica (AQ)
|
4
|
+
* - Bouvet Island (BV)
|
5
|
+
* - Christmas Island (CX)
|
6
|
+
* - Western Sahara (EH)
|
7
|
+
* - French Guiana (GF)
|
8
|
+
* - South Georgia and the South Sandwich Islands (GS)
|
9
|
+
* - Heard Island and McDonald Islands (HM)
|
10
|
+
* - Saint Kitts and Nevis (KN)
|
11
|
+
* - Saint Martin (MF)
|
12
|
+
* - New Caledonia (NC)
|
13
|
+
* - Saint Pierre and Miquelon (PM)
|
14
|
+
* - Reunion (RE)
|
15
|
+
* - Saint Helena (SH)
|
16
|
+
* - Svalbard and Jan Mayen (SJ)
|
17
|
+
* - French Southern Territories (TF)
|
18
|
+
* - U.S. Minor Outlying Islands (UM)
|
19
|
+
* - U.S. Virgin Islands (VI)
|
20
|
+
* - Wallis and Futuna (WF)
|
21
|
+
* - Mayotte (YT)
|
22
|
+
*/
|
1
23
|
export declare const countryCodes: readonly ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "ER", "ES", "ET", "EU", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SI", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WS", "XK", "YE", "ZA", "ZM", "ZW"];
|
@@ -1,4 +1,237 @@
|
|
1
|
-
const countryCodes = [
|
1
|
+
const countryCodes = [
|
2
|
+
"AD",
|
3
|
+
"AE",
|
4
|
+
"AF",
|
5
|
+
"AG",
|
6
|
+
"AI",
|
7
|
+
"AL",
|
8
|
+
"AM",
|
9
|
+
"AO",
|
10
|
+
"AR",
|
11
|
+
"AS",
|
12
|
+
"AT",
|
13
|
+
"AU",
|
14
|
+
"AW",
|
15
|
+
"AX",
|
16
|
+
"AZ",
|
17
|
+
"BA",
|
18
|
+
"BB",
|
19
|
+
"BD",
|
20
|
+
"BE",
|
21
|
+
"BF",
|
22
|
+
"BG",
|
23
|
+
"BH",
|
24
|
+
"BI",
|
25
|
+
"BJ",
|
26
|
+
"BL",
|
27
|
+
"BM",
|
28
|
+
"BN",
|
29
|
+
"BO",
|
30
|
+
"BQ",
|
31
|
+
"BR",
|
32
|
+
"BS",
|
33
|
+
"BT",
|
34
|
+
"BW",
|
35
|
+
"BY",
|
36
|
+
"BZ",
|
37
|
+
"CA",
|
38
|
+
"CC",
|
39
|
+
"CD",
|
40
|
+
"CF",
|
41
|
+
"CG",
|
42
|
+
"CH",
|
43
|
+
"CI",
|
44
|
+
"CK",
|
45
|
+
"CL",
|
46
|
+
"CM",
|
47
|
+
"CN",
|
48
|
+
"CO",
|
49
|
+
"CR",
|
50
|
+
"CU",
|
51
|
+
"CV",
|
52
|
+
"CW",
|
53
|
+
"CY",
|
54
|
+
"CZ",
|
55
|
+
"DE",
|
56
|
+
"DJ",
|
57
|
+
"DK",
|
58
|
+
"DM",
|
59
|
+
"DO",
|
60
|
+
"DZ",
|
61
|
+
"EC",
|
62
|
+
"EE",
|
63
|
+
"EG",
|
64
|
+
"ER",
|
65
|
+
"ES",
|
66
|
+
"ET",
|
67
|
+
"EU",
|
68
|
+
"FI",
|
69
|
+
"FJ",
|
70
|
+
"FK",
|
71
|
+
"FM",
|
72
|
+
"FO",
|
73
|
+
"FR",
|
74
|
+
"GA",
|
75
|
+
"GB",
|
76
|
+
"GD",
|
77
|
+
"GE",
|
78
|
+
"GG",
|
79
|
+
"GH",
|
80
|
+
"GI",
|
81
|
+
"GL",
|
82
|
+
"GM",
|
83
|
+
"GN",
|
84
|
+
"GP",
|
85
|
+
"GQ",
|
86
|
+
"GR",
|
87
|
+
"GT",
|
88
|
+
"GU",
|
89
|
+
"GW",
|
90
|
+
"GY",
|
91
|
+
"HK",
|
92
|
+
"HN",
|
93
|
+
"HR",
|
94
|
+
"HT",
|
95
|
+
"HU",
|
96
|
+
"ID",
|
97
|
+
"IE",
|
98
|
+
"IL",
|
99
|
+
"IM",
|
100
|
+
"IN",
|
101
|
+
"IO",
|
102
|
+
"IQ",
|
103
|
+
"IR",
|
104
|
+
"IS",
|
105
|
+
"IT",
|
106
|
+
"JE",
|
107
|
+
"JM",
|
108
|
+
"JO",
|
109
|
+
"JP",
|
110
|
+
"KE",
|
111
|
+
"KG",
|
112
|
+
"KH",
|
113
|
+
"KI",
|
114
|
+
"KM",
|
115
|
+
"KP",
|
116
|
+
"KR",
|
117
|
+
"KW",
|
118
|
+
"KY",
|
119
|
+
"KZ",
|
120
|
+
"LA",
|
121
|
+
"LB",
|
122
|
+
"LC",
|
123
|
+
"LI",
|
124
|
+
"LK",
|
125
|
+
"LR",
|
126
|
+
"LS",
|
127
|
+
"LT",
|
128
|
+
"LU",
|
129
|
+
"LV",
|
130
|
+
"LY",
|
131
|
+
"MA",
|
132
|
+
"MC",
|
133
|
+
"MD",
|
134
|
+
"ME",
|
135
|
+
"MG",
|
136
|
+
"MH",
|
137
|
+
"MK",
|
138
|
+
"ML",
|
139
|
+
"MM",
|
140
|
+
"MN",
|
141
|
+
"MO",
|
142
|
+
"MP",
|
143
|
+
"MQ",
|
144
|
+
"MR",
|
145
|
+
"MS",
|
146
|
+
"MT",
|
147
|
+
"MU",
|
148
|
+
"MV",
|
149
|
+
"MW",
|
150
|
+
"MX",
|
151
|
+
"MY",
|
152
|
+
"MZ",
|
153
|
+
"NA",
|
154
|
+
"NE",
|
155
|
+
"NF",
|
156
|
+
"NG",
|
157
|
+
"NI",
|
158
|
+
"NL",
|
159
|
+
"NO",
|
160
|
+
"NP",
|
161
|
+
"NR",
|
162
|
+
"NU",
|
163
|
+
"NZ",
|
164
|
+
"OM",
|
165
|
+
"PA",
|
166
|
+
"PE",
|
167
|
+
"PF",
|
168
|
+
"PG",
|
169
|
+
"PH",
|
170
|
+
"PK",
|
171
|
+
"PL",
|
172
|
+
"PN",
|
173
|
+
"PR",
|
174
|
+
"PS",
|
175
|
+
"PT",
|
176
|
+
"PW",
|
177
|
+
"PY",
|
178
|
+
"QA",
|
179
|
+
"RO",
|
180
|
+
"RS",
|
181
|
+
"RU",
|
182
|
+
"RW",
|
183
|
+
"SA",
|
184
|
+
"SB",
|
185
|
+
"SC",
|
186
|
+
"SD",
|
187
|
+
"SE",
|
188
|
+
"SG",
|
189
|
+
"SI",
|
190
|
+
"SK",
|
191
|
+
"SL",
|
192
|
+
"SM",
|
193
|
+
"SN",
|
194
|
+
"SO",
|
195
|
+
"SR",
|
196
|
+
"SS",
|
197
|
+
"ST",
|
198
|
+
"SV",
|
199
|
+
"SX",
|
200
|
+
"SY",
|
201
|
+
"SZ",
|
202
|
+
"TC",
|
203
|
+
"TD",
|
204
|
+
"TG",
|
205
|
+
"TH",
|
206
|
+
"TJ",
|
207
|
+
"TK",
|
208
|
+
"TL",
|
209
|
+
"TM",
|
210
|
+
"TN",
|
211
|
+
"TO",
|
212
|
+
"TR",
|
213
|
+
"TT",
|
214
|
+
"TV",
|
215
|
+
"TW",
|
216
|
+
"TZ",
|
217
|
+
"UA",
|
218
|
+
"UG",
|
219
|
+
"US",
|
220
|
+
"UY",
|
221
|
+
"UZ",
|
222
|
+
"VA",
|
223
|
+
"VC",
|
224
|
+
"VE",
|
225
|
+
"VG",
|
226
|
+
"VN",
|
227
|
+
"VU",
|
228
|
+
"WS",
|
229
|
+
"XK",
|
230
|
+
"YE",
|
231
|
+
"ZA",
|
232
|
+
"ZM",
|
233
|
+
"ZW"
|
234
|
+
];
|
2
235
|
export {
|
3
236
|
countryCodes
|
4
237
|
};
|
@@ -10,15 +10,15 @@ function Clock(props) {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
11
11
|
...props,
|
12
12
|
children: [
|
13
|
-
/* @__PURE__ */ jsx("path", { d: "M24 12L24 24L36 24", stroke: "white",
|
13
|
+
/* @__PURE__ */ jsx("path", { d: "M24 12L24 24L36 24", stroke: "white", strokeWidth: "3" }),
|
14
14
|
/* @__PURE__ */ jsx(
|
15
15
|
"path",
|
16
16
|
{
|
17
17
|
d: "M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",
|
18
18
|
stroke: "white",
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
strokeWidth: "3",
|
20
|
+
strokeLinecap: "round",
|
21
|
+
strokeLinejoin: "round"
|
22
22
|
}
|
23
23
|
)
|
24
24
|
]
|
@@ -12,8 +12,8 @@ function Warning(props) {
|
|
12
12
|
children: /* @__PURE__ */ jsx(
|
13
13
|
"path",
|
14
14
|
{
|
15
|
-
|
16
|
-
|
15
|
+
fillRule: "evenodd",
|
16
|
+
clipRule: "evenodd",
|
17
17
|
d: "M22 0.835449L42.6702 38.0417H1.32983L22 0.835449ZM23.375 15.125V25.2083H20.625V15.125H23.375ZM20.6213 32.5505L23.3987 32.5499L23.3981 29.7999L20.6207 29.8005L20.6213 32.5505Z",
|
18
18
|
fill: "white"
|
19
19
|
}
|
@@ -1,28 +1,4 @@
|
|
1
|
-
import { countries as a } from "../../node_modules/.pnpm/countries-list@3.1.1/node_modules/countries-list/mjs/index.js";
|
2
|
-
import { defaultCountries as R, parseCountry as M } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
|
3
|
-
import { countryCodes } from "../Flag/constants.js";
|
4
|
-
const supportedCountryCodesSet = new Set(
|
5
|
-
countryCodes.map((c) => c.toLowerCase())
|
6
|
-
);
|
7
|
-
const supportedDefaultCountryCodes = R.filter(
|
8
|
-
(defaultCountry) => supportedCountryCodesSet.has(M(defaultCountry).iso2)
|
9
|
-
);
|
10
|
-
const defaultCountryCodesSet = new Set(R.map((c) => M(c).iso2));
|
11
|
-
const unsupportedCountryCodes = Array.from(supportedCountryCodesSet).filter(
|
12
|
-
(iso2) => !defaultCountryCodesSet.has(iso2)
|
13
|
-
);
|
14
|
-
const customCountries = Object.entries(a).filter(([iso2]) => unsupportedCountryCodes.includes(iso2.toLowerCase())).map(([iso2, country]) => {
|
15
|
-
const { name, phone } = country;
|
16
|
-
const dialCode = phone[0].toString();
|
17
|
-
const iso2Lower = iso2.toLowerCase();
|
18
|
-
return [name, iso2Lower, dialCode];
|
19
|
-
});
|
20
|
-
const extendedCountryDataList = [
|
21
|
-
...supportedDefaultCountryCodes,
|
22
|
-
...customCountries
|
23
|
-
].sort((a2, b) => a2[0].localeCompare(b[0]));
|
24
1
|
const DIAL_CODE_PREFIX = "+";
|
25
2
|
export {
|
26
|
-
DIAL_CODE_PREFIX
|
27
|
-
extendedCountryDataList
|
3
|
+
DIAL_CODE_PREFIX
|
28
4
|
};
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { parseCountry as M } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
|
1
|
+
import { defaultCountries as R, parseCountry as M } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
|
2
2
|
import { isSupportedCountryCode } from "../Flag/utils.js";
|
3
|
-
import {
|
3
|
+
import { DIAL_CODE_PREFIX } from "./constants.js";
|
4
4
|
const getValidatedCountryCode = (code, defaultCountryCode) => {
|
5
5
|
const upperCaseCode = code.toUpperCase();
|
6
6
|
return isSupportedCountryCode(upperCaseCode) ? upperCaseCode : defaultCountryCode;
|
7
7
|
};
|
8
8
|
const getCountryDataListByCodes = (countryCodes) => {
|
9
9
|
if (!(countryCodes == null ? void 0 : countryCodes.length)) {
|
10
|
-
return
|
10
|
+
return R;
|
11
11
|
}
|
12
12
|
const countryCodeSet = new Set(countryCodes);
|
13
|
-
return
|
13
|
+
return R.filter((country) => {
|
14
14
|
const countryCode = M(country).iso2.toUpperCase();
|
15
15
|
return countryCodeSet.has(countryCode);
|
16
16
|
});
|
@@ -21,7 +21,7 @@ const Progress = ({ value, asChild, max, getValueLabel, className }) => {
|
|
21
21
|
children: /* @__PURE__ */ jsx(
|
22
22
|
Indicator,
|
23
23
|
{
|
24
|
-
className: "ease-[cubic-bezier(0.65, 0, 0.35, 1)] size-full bg-current transition-transform duration-
|
24
|
+
className: "ease-[cubic-bezier(0.65, 0, 0.35, 1)] size-full bg-current transition-transform duration-700",
|
25
25
|
style: { transform: `translateX(-${100 - Math.min(value, 100)}%)` }
|
26
26
|
}
|
27
27
|
)
|
package/dist/lib/haptics.d.ts
CHANGED
@@ -13,6 +13,11 @@ declare global {
|
|
13
13
|
};
|
14
14
|
}
|
15
15
|
}
|
16
|
+
declare const haptics: {
|
17
|
+
notification: (type: NotificationType) => void;
|
18
|
+
selection: () => void;
|
19
|
+
impact: (style: ImpactStyle) => void;
|
20
|
+
};
|
16
21
|
/**
|
17
22
|
* Wraps a function with haptic feedback
|
18
23
|
* @param fn The function to wrap (can be undefined)
|
@@ -20,9 +25,4 @@ declare global {
|
|
20
25
|
* @returns A new function that triggers haptic feedback and calls the original function if provided
|
21
26
|
*/
|
22
27
|
export declare function withHaptics<T extends (...args: any[]) => any>(fn: T | undefined, hapticFn?: () => void): T;
|
23
|
-
declare const haptics: {
|
24
|
-
notification: (type: NotificationType) => void;
|
25
|
-
selection: () => void;
|
26
|
-
impact: (style: ImpactStyle) => void;
|
27
|
-
};
|
28
28
|
export default haptics;
|
package/dist/lib/haptics.js
CHANGED
@@ -6,20 +6,6 @@ const sendHapticFeedback = (params) => {
|
|
6
6
|
console.warn("Haptic feedback not supported:", error);
|
7
7
|
}
|
8
8
|
};
|
9
|
-
function withHaptics(fn, hapticFn = haptics.selection) {
|
10
|
-
return (...args) => {
|
11
|
-
if (!fn) {
|
12
|
-
hapticFn();
|
13
|
-
return void 0;
|
14
|
-
}
|
15
|
-
const result = fn(...args);
|
16
|
-
if (result instanceof Promise) {
|
17
|
-
return result.finally(() => hapticFn());
|
18
|
-
}
|
19
|
-
hapticFn();
|
20
|
-
return result;
|
21
|
-
};
|
22
|
-
}
|
23
9
|
const haptics = {
|
24
10
|
notification: (type) => {
|
25
11
|
sendHapticFeedback({
|
@@ -39,6 +25,20 @@ const haptics = {
|
|
39
25
|
});
|
40
26
|
}
|
41
27
|
};
|
28
|
+
function withHaptics(fn, hapticFn = haptics.selection) {
|
29
|
+
return (...args) => {
|
30
|
+
if (!fn) {
|
31
|
+
hapticFn();
|
32
|
+
return void 0;
|
33
|
+
}
|
34
|
+
const result = fn(...args);
|
35
|
+
if (result instanceof Promise) {
|
36
|
+
return result.finally(() => hapticFn());
|
37
|
+
}
|
38
|
+
hapticFn();
|
39
|
+
return result;
|
40
|
+
};
|
41
|
+
}
|
42
42
|
export {
|
43
43
|
haptics as default,
|
44
44
|
withHaptics
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import "react";
|
2
|
+
function setRef(ref, value) {
|
3
|
+
if (typeof ref === "function") {
|
4
|
+
return ref(value);
|
5
|
+
} else if (ref !== null && ref !== void 0) {
|
6
|
+
ref.current = value;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
function composeRefs(...refs) {
|
10
|
+
return (node) => {
|
11
|
+
let hasCleanup = false;
|
12
|
+
const cleanups = refs.map((ref) => {
|
13
|
+
const cleanup = setRef(ref, node);
|
14
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
15
|
+
hasCleanup = true;
|
16
|
+
}
|
17
|
+
return cleanup;
|
18
|
+
});
|
19
|
+
if (hasCleanup) {
|
20
|
+
return () => {
|
21
|
+
for (let i = 0; i < cleanups.length; i++) {
|
22
|
+
const cleanup = cleanups[i];
|
23
|
+
if (typeof cleanup == "function") {
|
24
|
+
cleanup();
|
25
|
+
} else {
|
26
|
+
setRef(refs[i], null);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
};
|
30
|
+
}
|
31
|
+
};
|
32
|
+
}
|
33
|
+
export {
|
34
|
+
composeRefs
|
35
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import "react-dom";
|
3
|
+
import { createSlot } from "../../../../../@radix-ui_react-slot@1.2.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js";
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
5
|
+
var NODES = [
|
6
|
+
"a",
|
7
|
+
"button",
|
8
|
+
"div",
|
9
|
+
"form",
|
10
|
+
"h2",
|
11
|
+
"h3",
|
12
|
+
"img",
|
13
|
+
"input",
|
14
|
+
"label",
|
15
|
+
"li",
|
16
|
+
"nav",
|
17
|
+
"ol",
|
18
|
+
"p",
|
19
|
+
"span",
|
20
|
+
"svg",
|
21
|
+
"ul"
|
22
|
+
];
|
23
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
24
|
+
const Slot = createSlot(`Primitive.${node}`);
|
25
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
26
|
+
const { asChild, ...primitiveProps } = props;
|
27
|
+
const Comp = asChild ? Slot : node;
|
28
|
+
if (typeof window !== "undefined") {
|
29
|
+
window[Symbol.for("radix-ui")] = true;
|
30
|
+
}
|
31
|
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
32
|
+
});
|
33
|
+
Node.displayName = `Primitive.${node}`;
|
34
|
+
return { ...primitive, [node]: Node };
|
35
|
+
}, {});
|
36
|
+
export {
|
37
|
+
Primitive
|
38
|
+
};
|