@worldcoin/mini-apps-ui-kit-react 0.0.8 → 1.0.0-canary.0
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 +8 -17
- package/dist/components/AlertDialog/AlertDialog.js +94 -0
- package/dist/components/AlertDialog/index.d.ts +1 -0
- package/dist/components/AlertDialog/index.js +13 -0
- package/dist/components/AlertDialog/types.d.ts +172 -0
- package/dist/components/AlertDialog/types.js +1 -0
- package/dist/components/AlertDialog/use-alert-dialog.d.ts +6 -0
- package/dist/components/AlertDialog/use-alert-dialog.js +11 -0
- package/dist/components/BottomBar/BottomBar.d.ts +13 -0
- package/dist/components/BottomBar/BottomBar.js +21 -0
- package/dist/components/BottomBar/index.d.ts +1 -0
- package/dist/components/BottomBar/index.js +4 -0
- package/dist/components/BulletList/BulletList.d.ts +10 -0
- package/dist/components/BulletList/BulletList.js +11 -0
- package/dist/components/BulletList/index.d.ts +1 -0
- package/dist/components/BulletList/index.js +4 -0
- package/dist/components/BulletListItem/BulletListItem.d.ts +7 -0
- package/dist/components/BulletListItem/BulletListItem.js +23 -0
- package/dist/components/BulletListItem/index.d.ts +1 -0
- package/dist/components/BulletListItem/index.js +4 -0
- package/dist/components/BulletPoint/BulletPoint.d.ts +6 -0
- package/dist/components/BulletPoint/BulletPoint.js +22 -0
- package/dist/components/BulletPoint/index.d.ts +1 -0
- package/dist/components/BulletPoint/index.js +1 -0
- package/dist/components/Button/Button.d.ts +10 -22
- package/dist/components/Button/Button.js +40 -72
- package/dist/components/Checkbox/Checkbox.d.ts +24 -4
- package/dist/components/Checkbox/Checkbox.js +5 -5
- package/dist/components/Chip/Chip.d.ts +2 -1
- package/dist/components/Chip/Chip.js +14 -8
- package/dist/components/ClearButton/Clear.js +14 -14
- package/dist/components/ClearButton/ClearButton.js +11 -11
- package/dist/components/ColorPicker/ColorPicker.js +14 -14
- package/dist/components/CountryDrawer/CountryDrawer.d.ts +12 -0
- package/dist/components/CountryDrawer/CountryDrawer.js +63 -0
- package/dist/components/CountryDrawer/index.d.ts +1 -0
- package/dist/components/CountryDrawer/index.js +4 -0
- package/dist/components/CountryDrawer/useCountryFiltering.d.ts +7 -0
- package/dist/components/CountryDrawer/useCountryFiltering.js +9 -0
- package/dist/components/CountryDrawer/useCountryGrouping.d.ts +13 -0
- package/dist/components/CountryDrawer/useCountryGrouping.js +17 -0
- package/dist/components/Drawer/Drawer.d.ts +28 -6
- package/dist/components/Drawer/Drawer.js +67 -28
- package/dist/components/Drawer/index.js +6 -4
- package/dist/components/Drawer/types.d.ts +167 -0
- package/dist/components/Drawer/types.js +1 -0
- package/dist/components/Drawer/use-drawer.d.ts +8 -0
- package/dist/components/Drawer/use-drawer.js +11 -0
- package/dist/components/Flag/LazyFlag.js +1 -1
- package/dist/components/Flag/flag-components/eu.d.ts +3 -0
- package/dist/components/Flag/flag-components/eu.js +83 -0
- package/dist/components/Flag/flag-components/index.d.ts +1 -0
- package/dist/components/Flag/flag-components/index.js +56 -54
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Icons/ArrowDown.js +26 -0
- package/dist/components/Icons/Eye.d.ts +8 -0
- package/dist/components/Icons/Eye.js +40 -0
- package/dist/components/Icons/EyeClosed.d.ts +8 -0
- package/dist/components/Icons/EyeClosed.js +60 -0
- package/dist/components/Icons/Fail.d.ts +8 -0
- package/dist/components/Icons/Fail.js +82 -0
- package/dist/components/Icons/MagicWand.d.ts +8 -0
- package/dist/components/Icons/MagicWand.js +60 -0
- package/dist/components/Icons/Magnifier.d.ts +1 -1
- package/dist/components/Icons/Magnifier.js +20 -11
- package/dist/components/Icons/Success.d.ts +8 -0
- package/dist/components/Icons/Success.js +82 -0
- package/dist/components/Icons/Tick.js +6 -7
- package/dist/components/Icons/XMark.d.ts +8 -0
- package/dist/components/Icons/XMark.js +27 -0
- package/dist/components/Input/Input.d.ts +26 -2
- package/dist/components/Input/Input.js +116 -51
- package/dist/components/ListItem/ListItem.d.ts +17 -6
- package/dist/components/ListItem/ListItem.js +29 -22
- package/dist/components/Marble/Marble.d.ts +2 -0
- package/dist/components/Marble/Marble.js +23 -0
- package/dist/components/Marble/index.d.ts +1 -0
- package/dist/components/Marble/index.js +4 -0
- package/dist/components/NumberPad/Delete.d.ts +1 -8
- package/dist/components/NumberPad/Delete.js +9 -10
- package/dist/components/NumberPad/NumberPad.js +30 -24
- package/dist/components/OTPField/OTPField.js +8 -8
- package/dist/components/PasswordField/PasswordField.d.ts +13 -0
- package/dist/components/PasswordField/PasswordField.js +45 -0
- package/dist/components/PasswordField/index.d.ts +1 -0
- package/dist/components/PasswordField/index.js +4 -0
- package/dist/components/PasteButton/PasteButton.d.ts +1 -1
- package/dist/components/PasteButton/PasteButton.js +21 -17
- package/dist/components/PhoneField/CountryListItem.d.ts +3 -4
- package/dist/components/PhoneField/CountryListItem.js +21 -25
- package/dist/components/PhoneField/CountrySelectorButton.d.ts +3 -4
- package/dist/components/PhoneField/CountrySelectorButton.js +17 -17
- package/dist/components/PhoneField/GroupedCountryList.d.ts +14 -0
- package/dist/components/PhoneField/GroupedCountryList.js +30 -0
- package/dist/components/PhoneField/PhoneField.d.ts +3 -14
- package/dist/components/PhoneField/PhoneField.js +71 -197
- package/dist/components/PhoneField/constants.js +4 -4
- package/dist/components/Pill/Pill.js +7 -7
- package/dist/components/Progress/Progress.d.ts +14 -0
- package/dist/components/Progress/Progress.js +31 -0
- package/dist/components/Progress/index.d.ts +1 -0
- package/dist/components/Progress/index.js +4 -0
- package/dist/components/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/components/SearchField/SearchField.d.ts +6 -1
- package/dist/components/SearchField/SearchField.js +39 -35
- package/dist/components/Select/Select.js +46 -76
- package/dist/components/{Button → Spinner}/Spinner.d.ts +2 -2
- package/dist/components/Spinner/Spinner.js +36 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Spinner/index.js +4 -0
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Tabs/Tabs.d.ts +11 -0
- package/dist/components/Tabs/Tabs.js +58 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +5 -0
- package/dist/components/Tabs/types.d.ts +53 -0
- package/dist/components/Tabs/types.js +1 -0
- package/dist/components/TextArea/TextArea.d.ts +25 -0
- package/dist/components/TextArea/TextArea.js +54 -0
- package/dist/components/TextArea/index.d.ts +1 -0
- package/dist/components/TextArea/index.js +4 -0
- package/dist/components/Toast/Toast.d.ts +9 -0
- package/dist/components/Toast/Toast.js +51 -0
- package/dist/components/Toast/Toaster.d.ts +3 -0
- package/dist/components/Toast/Toaster.js +14 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/index.js +12 -0
- package/dist/components/Toast/use-toast.d.ts +51 -0
- package/dist/components/Toast/use-toast.js +101 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +5 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +28 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -0
- package/dist/components/ToggleGroup/index.js +5 -0
- package/dist/components/ToggleGroup/types.d.ts +101 -0
- package/dist/components/ToggleGroup/types.js +1 -0
- package/dist/components/Token/Token.d.ts +4 -0
- package/dist/components/Token/Token.js +12 -7
- package/dist/components/Token/icons/btc.d.ts +2 -2
- package/dist/components/Token/icons/btc.js +13 -58
- package/dist/components/Token/icons/dai.d.ts +3 -0
- package/dist/components/Token/icons/dai.js +27 -0
- package/dist/components/Token/icons/eth.d.ts +2 -2
- package/dist/components/Token/icons/eth.js +11 -58
- package/dist/components/Token/icons/index.d.ts +2 -0
- package/dist/components/Token/icons/index.js +8 -4
- package/dist/components/Token/icons/types.d.ts +7 -0
- package/dist/components/Token/icons/types.js +1 -0
- package/dist/components/Token/icons/usdc.d.ts +2 -2
- package/dist/components/Token/icons/usdc.js +16 -56
- package/dist/components/Token/icons/usdt.d.ts +3 -0
- package/dist/components/Token/icons/usdt.js +27 -0
- package/dist/components/Token/icons/utils.d.ts +9 -0
- package/dist/components/Token/icons/utils.js +11 -0
- package/dist/components/Token/icons/wld.d.ts +2 -2
- package/dist/components/Token/icons/wld.js +10 -41
- package/dist/components/TopBar/TopBar.d.ts +11 -0
- package/dist/components/TopBar/TopBar.js +23 -0
- package/dist/components/TopBar/index.d.ts +1 -0
- package/dist/components/TopBar/index.js +4 -0
- package/dist/components/Typography/Typography.d.ts +12 -8
- package/dist/components/Typography/Typography.js +72 -60
- package/dist/components/WalletAddressField/WalletAddressField.d.ts +23 -0
- package/dist/components/WalletAddressField/WalletAddressField.js +81 -0
- package/dist/components/WalletAddressField/index.d.ts +1 -0
- package/dist/components/WalletAddressField/index.js +4 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +91 -45
- package/dist/lib/constants/dropdownStyles.d.ts +1 -1
- package/dist/lib/constants/dropdownStyles.js +2 -2
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@1_tagbd57u5fsqga6qdjecsll7fm/node_modules/@radix-ui/react-collection/dist/index.js +49 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.5_@types_react-dom@18.3.5_@types_react@18.3.18__@types__nitdfoqpcbroetgllwgz3is5ai/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +131 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._ulc3jfxcmrz2rfz7bui53djdtu/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18_sejcxqoscaweil2bvgwwavaoha/node_modules/@radix-ui/react-primitive/dist/index.js +35 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-progress@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18._wpsg2ubedou6txnsnvgmus4txq/node_modules/@radix-ui/react-progress/dist/index.js +86 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react_ki7uy4u3diz5446cqygvbjwuge/node_modules/@radix-ui/react-roving-focus/dist/index.js +181 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.2_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js +44 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-toast@1.2.6_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3.1_mux33mveszkw5z6iia6acnivvy/node_modules/@radix-ui/react-toast/dist/index.js +448 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react_3smwloudr6a3igss4kifyxcwju/node_modules/@radix-ui/react-toggle-group/dist/index.js +137 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._yiv2ptaqcv244n5f7zfldmgupm/node_modules/@radix-ui/react-toggle/dist/index.js +31 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_re_omyrydx3gc2oidaiqb4gsovieq/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -0
- package/dist/tailwind/index.d.ts +41 -25
- package/dist/tailwind/index.js +128 -85
- package/package.json +73 -1
- 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 +1 -1
- package/public/images/marbles/marble1.png +0 -0
- package/public/images/marbles/marble2.png +0 -0
- package/public/images/marbles/marble3.svg +36 -0
- package/dist/components/Button/Spinner.js +0 -36
- package/dist/components/PhoneField/ArrowDown.js +0 -27
- package/dist/components/Select/ArrowDown.d.ts +0 -2
- package/dist/components/Select/ArrowDown.js +0 -27
- /package/dist/components/{PhoneField → Icons}/ArrowDown.d.ts +0 -0
@@ -1,32 +1,28 @@
|
|
1
1
|
"use client";
|
2
|
-
import { jsxs as
|
3
|
-
import {
|
4
|
-
import {
|
2
|
+
import { jsxs as g, jsx as a } from "react/jsx-runtime";
|
3
|
+
import { cn as d } from "../../lib/utils.js";
|
4
|
+
import { Slot as b } from "../../node_modules/.pnpm/@radix-ui_react-slot@1.1.1_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js";
|
5
|
+
import { cva as m } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
5
6
|
import { forwardRef as p } from "react";
|
6
|
-
import
|
7
|
-
|
8
|
-
|
7
|
+
import { Fail as f } from "../Icons/Fail.js";
|
8
|
+
import { Success as y } from "../Icons/Success.js";
|
9
|
+
import { Spinner as c } from "../Spinner/Spinner.js";
|
10
|
+
import { typographyVariants as u } from "../Typography/Typography.js";
|
11
|
+
const v = m(
|
12
|
+
"flex items-center justify-center rounded-full gap-2 font-display leading-[1.2] tracking-normal transition-colors",
|
9
13
|
{
|
10
14
|
variants: {
|
11
15
|
variant: {
|
12
|
-
primary: "bg-gray-900 text-gray-0 hover:bg-gray-700 active:bg-gray-
|
13
|
-
secondary: "bg-
|
14
|
-
tertiary: "
|
15
|
-
ghost: "bg-transparent text-gray-500 hover:bg-gray-100 active:bg-gray-200 disabled:text-gray-300"
|
16
|
+
primary: "bg-gray-900 text-gray-0 hover:bg-gray-700 active:bg-gray-700 disabled:bg-gray-100 disabled:text-gray-300",
|
17
|
+
secondary: "bg-transparent text-gray-900 border border-gray-200 hover:bg-gray-50 active:bg-gray-50 disabled:text-gray-300 disabled:border-gray-100",
|
18
|
+
tertiary: "bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-200 disabled:text-gray-300 disabled:bg-gray-50"
|
16
19
|
},
|
17
20
|
size: {
|
18
|
-
sm: "h-10 min-w-10 px-
|
19
|
-
|
20
|
-
|
21
|
+
sm: "h-10 min-w-10 px-4",
|
22
|
+
lg: "h-14 min-w-14 px-4",
|
23
|
+
icon: "size-10"
|
21
24
|
},
|
22
|
-
|
23
|
-
none: "rounded-none",
|
24
|
-
sm: "rounded",
|
25
|
-
md: "rounded-xl",
|
26
|
-
lg: "rounded-2xl",
|
27
|
-
full: "rounded-full"
|
28
|
-
},
|
29
|
-
isLoading: {
|
25
|
+
stateful: {
|
30
26
|
true: "border-none bg-transparent fill-transparent text-transparent hover:bg-transparent active:bg-transparent disabled:bg-transparent disabled:text-transparent",
|
31
27
|
false: ""
|
32
28
|
},
|
@@ -38,66 +34,38 @@ const f = y(
|
|
38
34
|
defaultVariants: {
|
39
35
|
variant: "primary",
|
40
36
|
size: "lg",
|
41
|
-
radius: "md",
|
42
37
|
fullWidth: !1
|
43
38
|
}
|
44
39
|
}
|
45
|
-
), x =
|
46
|
-
|
47
|
-
|
48
|
-
height: "1rem"
|
49
|
-
},
|
50
|
-
md: {
|
51
|
-
width: "1.25rem",
|
52
|
-
height: "1.25rem"
|
53
|
-
},
|
54
|
-
lg: {
|
55
|
-
width: "1.5rem",
|
56
|
-
height: "1.5rem"
|
57
|
-
}
|
58
|
-
}, c = p(
|
59
|
-
({
|
60
|
-
variant: i,
|
61
|
-
size: a = "lg",
|
62
|
-
radius: g,
|
63
|
-
className: h,
|
64
|
-
isLoading: t,
|
65
|
-
children: e,
|
66
|
-
icon: n,
|
67
|
-
fullWidth: o,
|
68
|
-
asChild: d,
|
69
|
-
...l
|
70
|
-
}, m) => /* @__PURE__ */ b(
|
71
|
-
d ? s : "button",
|
40
|
+
), x = p(
|
41
|
+
({ variant: e, size: t = "lg", fullWidth: s, asChild: i, state: r, children: n, ...l }, o) => /* @__PURE__ */ g(
|
42
|
+
i ? b : "button",
|
72
43
|
{
|
73
|
-
ref:
|
74
|
-
className:
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
44
|
+
ref: o,
|
45
|
+
className: d(
|
46
|
+
v({
|
47
|
+
variant: e,
|
48
|
+
size: t,
|
49
|
+
stateful: !!r,
|
50
|
+
fullWidth: s
|
51
|
+
}),
|
52
|
+
u({
|
53
|
+
variant: "label",
|
54
|
+
level: t === "lg" ? 1 : 2
|
55
|
+
})
|
56
|
+
),
|
81
57
|
...l,
|
82
58
|
children: [
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
...x[a],
|
88
|
-
opacity: t ? 0 : 1
|
89
|
-
},
|
90
|
-
children: n
|
91
|
-
}
|
92
|
-
),
|
93
|
-
e && /* @__PURE__ */ r("span", { children: e }),
|
94
|
-
t && /* @__PURE__ */ r(u, { className: "absolute" })
|
59
|
+
!r && n,
|
60
|
+
r === "pending" && /* @__PURE__ */ a(c, { className: "absolute size-6" }),
|
61
|
+
r === "success" && /* @__PURE__ */ a(y, { className: "absolute size-6" }),
|
62
|
+
r === "failed" && /* @__PURE__ */ a(f, { className: "absolute size-6" })
|
95
63
|
]
|
96
64
|
}
|
97
65
|
)
|
98
66
|
);
|
99
|
-
|
67
|
+
x.displayName = "Button";
|
100
68
|
export {
|
101
|
-
|
102
|
-
|
69
|
+
x as Button,
|
70
|
+
x as default
|
103
71
|
};
|
@@ -1,19 +1,39 @@
|
|
1
1
|
import { CheckboxProps as RadixCheckboxProps } from '@radix-ui/react-checkbox';
|
2
2
|
export interface CheckboxProps extends Omit<RadixCheckboxProps, "onCheckedChange" | "onChange" | "className"> {
|
3
3
|
/**
|
4
|
-
*
|
4
|
+
* Whether to forward the root element
|
5
5
|
* @default false
|
6
6
|
*/
|
7
|
+
asChild?: boolean;
|
8
|
+
/**
|
9
|
+
* The initial checked state when the checkbox is uncontrolled
|
10
|
+
*/
|
11
|
+
defaultChecked?: boolean;
|
12
|
+
/**
|
13
|
+
* The controlled checked state of the checkbox
|
14
|
+
*/
|
7
15
|
checked?: boolean;
|
8
16
|
/**
|
9
|
-
*
|
17
|
+
* Event handler called when the checked state changes
|
10
18
|
*/
|
11
19
|
onChange?: (checked: boolean) => void;
|
12
20
|
/**
|
13
|
-
*
|
14
|
-
* @default false
|
21
|
+
* Whether the checkbox is disabled
|
15
22
|
*/
|
16
23
|
disabled?: boolean;
|
24
|
+
/**
|
25
|
+
* Whether the checkbox is required
|
26
|
+
*/
|
27
|
+
required?: boolean;
|
28
|
+
/**
|
29
|
+
* The name of the checkbox
|
30
|
+
*/
|
31
|
+
name?: string;
|
32
|
+
/**
|
33
|
+
* The value of the checkbox
|
34
|
+
* @default ""
|
35
|
+
*/
|
36
|
+
value?: string;
|
17
37
|
}
|
18
38
|
export declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLButtonElement>>;
|
19
39
|
export default Checkbox;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
2
|
import { Root as c, Indicator as s } from "../../node_modules/.pnpm/@radix-ui_react-checkbox@1.1.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18._5vtvszwgvdmnkk62ia2dob365m/node_modules/@radix-ui/react-checkbox/dist/index.js";
|
3
|
-
import { forwardRef as
|
4
|
-
import { Tick as
|
5
|
-
const l =
|
3
|
+
import { forwardRef as i } from "react";
|
4
|
+
import { Tick as n } from "../Icons/Tick.js";
|
5
|
+
const l = i(
|
6
6
|
({ checked: a, onChange: r, disabled: t = !1, ...o }, d) => /* @__PURE__ */ e(
|
7
7
|
c,
|
8
8
|
{
|
@@ -10,9 +10,9 @@ const l = n(
|
|
10
10
|
checked: a,
|
11
11
|
onCheckedChange: r,
|
12
12
|
disabled: t,
|
13
|
-
className: "flex
|
13
|
+
className: "flex size-6 items-center justify-center rounded-md border-[0.09375rem] transition-all data-[state=checked]:border-gray-900 data-[state=checked]:bg-gray-900 data-[state=unchecked]:border-gray-200 data-[state=unchecked]:bg-transparent disabled:cursor-not-allowed disabled:opacity-20",
|
14
14
|
...o,
|
15
|
-
children: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
|
15
|
+
children: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(n, { className: "text-gray-0" }) })
|
16
16
|
}
|
17
17
|
)
|
18
18
|
);
|
@@ -20,6 +20,7 @@ export interface ChipProps {
|
|
20
20
|
className?: string;
|
21
21
|
}
|
22
22
|
export declare const Chip: import('react').ForwardRefExoticComponent<ChipProps & VariantProps<(props?: ({
|
23
|
-
variant?: "
|
23
|
+
variant?: "error" | "success" | "default" | "warning" | "important" | null | undefined;
|
24
|
+
isIcon?: boolean | null | undefined;
|
24
25
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & import('react').RefAttributes<HTMLDivElement>>;
|
25
26
|
export default Chip;
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
2
2
|
import { Slot as o } from "../../node_modules/.pnpm/@radix-ui_react-slot@1.1.1_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js";
|
3
|
-
import { cva as
|
4
|
-
import { forwardRef as
|
5
|
-
|
6
|
-
|
3
|
+
import { cva as l } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
4
|
+
import { forwardRef as f } from "react";
|
5
|
+
import { Typography as m } from "../Typography/Typography.js";
|
6
|
+
const c = l(
|
7
|
+
"inline-flex h-7 items-center gap-2 rounded-full px-4 font-sans text-sm font-medium leading-none",
|
7
8
|
{
|
8
9
|
variants: {
|
9
10
|
variant: {
|
@@ -12,16 +13,21 @@ const m = f(
|
|
12
13
|
warning: "bg-warning-100 text-warning-700",
|
13
14
|
error: "bg-error-100 text-error-700",
|
14
15
|
important: "bg-info-100 text-info-700"
|
16
|
+
},
|
17
|
+
isIcon: {
|
18
|
+
true: "pl-3",
|
19
|
+
false: ""
|
15
20
|
}
|
16
21
|
},
|
17
22
|
defaultVariants: {
|
18
|
-
variant: "default"
|
23
|
+
variant: "default",
|
24
|
+
isIcon: !1
|
19
25
|
}
|
20
26
|
}
|
21
|
-
), d =
|
22
|
-
({ className: e = "", icon: r, label: a, variant:
|
27
|
+
), d = f(
|
28
|
+
({ className: e = "", icon: r, label: a, variant: i = "default" }, n) => /* @__PURE__ */ s("div", { ref: n, className: c({ variant: i, className: e, isIcon: !!r }), children: [
|
23
29
|
r && /* @__PURE__ */ t(o, { style: { width: "1rem", height: "1rem" }, children: r }),
|
24
|
-
/* @__PURE__ */ t("
|
30
|
+
/* @__PURE__ */ t(m, { variant: "subtitle", level: 4, children: a })
|
25
31
|
] })
|
26
32
|
);
|
27
33
|
d.displayName = "Chip";
|
@@ -1,27 +1,27 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { cn as
|
3
|
-
function
|
4
|
-
return /* @__PURE__ */
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
2
|
+
import { cn as t } from "../../lib/utils.js";
|
3
|
+
function s({ className: e }) {
|
4
|
+
return /* @__PURE__ */ r(
|
5
5
|
"svg",
|
6
6
|
{
|
7
|
-
width: "
|
8
|
-
height: "
|
9
|
-
viewBox: "0 0
|
7
|
+
width: "24",
|
8
|
+
height: "24",
|
9
|
+
viewBox: "0 0 24 24",
|
10
10
|
fill: "none",
|
11
11
|
xmlns: "http://www.w3.org/2000/svg",
|
12
|
-
className:
|
13
|
-
children: /* @__PURE__ */
|
12
|
+
className: t("size-6", e),
|
13
|
+
children: /* @__PURE__ */ r(
|
14
14
|
"path",
|
15
15
|
{
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
d: "M6.75729 17.2426L11.9999 12M17.2426 6.75736L11.9999 12M11.9999 12L6.75729 6.75736M11.9999 12L17.2426 17.2426",
|
17
|
+
stroke: "currentColor",
|
18
|
+
strokeWidth: "1.5",
|
19
|
+
strokeLinecap: "square"
|
20
20
|
}
|
21
21
|
)
|
22
22
|
}
|
23
23
|
);
|
24
24
|
}
|
25
25
|
export {
|
26
|
-
|
26
|
+
s as Clear
|
27
27
|
};
|
@@ -1,27 +1,27 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
2
|
import * as m from "react";
|
3
|
-
import { cn as
|
4
|
-
import { Clear as
|
5
|
-
const
|
6
|
-
({ children: p, inputRef: t, className: a, onClear: r, ...
|
7
|
-
const
|
3
|
+
import { cn as u } from "../../lib/utils.js";
|
4
|
+
import { Clear as l } from "./Clear.js";
|
5
|
+
const B = 1.25, i = m.forwardRef(
|
6
|
+
({ children: p, inputRef: t, className: a, onClear: r, ...n }, c) => {
|
7
|
+
const s = (o) => {
|
8
8
|
o.preventDefault(), o.stopPropagation(), t && "current" in t && t.current && (t.current.value = "", r == null || r());
|
9
9
|
};
|
10
10
|
return /* @__PURE__ */ e(
|
11
11
|
"button",
|
12
12
|
{
|
13
13
|
type: "button",
|
14
|
-
ref:
|
15
|
-
className:
|
16
|
-
onMouseDown:
|
17
|
-
...
|
18
|
-
children: /* @__PURE__ */ e(
|
14
|
+
ref: c,
|
15
|
+
className: u(a),
|
16
|
+
onMouseDown: s,
|
17
|
+
...n,
|
18
|
+
children: /* @__PURE__ */ e(l, {})
|
19
19
|
}
|
20
20
|
);
|
21
21
|
}
|
22
22
|
);
|
23
23
|
i.displayName = "ClearButton";
|
24
24
|
export {
|
25
|
-
|
25
|
+
B as CLEAR_BUTTON_WIDTH,
|
26
26
|
i as default
|
27
27
|
};
|
@@ -1,36 +1,36 @@
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
2
|
-
import { Item as
|
2
|
+
import { Item as n, Indicator as i, Root as c } from "../../node_modules/.pnpm/@radix-ui_react-radio-group@1.2.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@_2u6lfd2xt65wmbxn7lgvaxqbmy/node_modules/@radix-ui/react-radio-group/dist/index.js";
|
3
3
|
import { forwardRef as s } from "react";
|
4
4
|
const f = s(
|
5
|
-
({ value: e, ...
|
6
|
-
|
5
|
+
({ value: e, ...r }, o) => /* @__PURE__ */ t(
|
6
|
+
n,
|
7
7
|
{
|
8
|
-
ref:
|
8
|
+
ref: o,
|
9
9
|
value: e,
|
10
|
-
className: "size-[
|
10
|
+
className: "size-[2.5rem] cursor-default rounded-full outline-none flex items-center justify-center relative disabled:opacity-90 disabled:cursor-not-allowed",
|
11
11
|
style: {
|
12
12
|
background: e
|
13
13
|
},
|
14
|
-
...
|
14
|
+
...r,
|
15
15
|
children: /* @__PURE__ */ t(
|
16
|
-
|
16
|
+
i,
|
17
17
|
{
|
18
|
-
className: "absolute flex size-[
|
19
|
-
style: { boxShadow: `0px 0px 0px
|
18
|
+
className: "absolute flex size-[2.75rem] items-center rounded-full justify-center",
|
19
|
+
style: { boxShadow: `0px 0px 0px 4px ${e}` }
|
20
20
|
}
|
21
21
|
)
|
22
22
|
}
|
23
23
|
)
|
24
24
|
), p = s(
|
25
|
-
({ value: e, onChange:
|
25
|
+
({ value: e, onChange: r, children: o, ...l }, a) => /* @__PURE__ */ t(
|
26
26
|
c,
|
27
27
|
{
|
28
|
-
ref:
|
28
|
+
ref: a,
|
29
29
|
value: e,
|
30
|
-
onValueChange:
|
30
|
+
onValueChange: r,
|
31
31
|
className: "flex gap-4 items-center",
|
32
|
-
...
|
33
|
-
children:
|
32
|
+
...l,
|
33
|
+
children: o
|
34
34
|
}
|
35
35
|
)
|
36
36
|
);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { CountryCode } from '../Flag';
|
2
|
+
interface CountryDrawerProps {
|
3
|
+
value: CountryCode;
|
4
|
+
countries?: CountryCode[];
|
5
|
+
disabled?: boolean;
|
6
|
+
defaultValue?: CountryCode;
|
7
|
+
children: React.ReactNode;
|
8
|
+
onChange: (countryCode: string) => void;
|
9
|
+
onAnimationEnd?: (open: boolean) => void;
|
10
|
+
}
|
11
|
+
export declare function CountryDrawer({ onChange, value, countries, onAnimationEnd, disabled, children, defaultValue, }: CountryDrawerProps): import("react/jsx-runtime").JSX.Element;
|
12
|
+
export {};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { useState as i, useRef as S } from "react";
|
3
|
+
import { Button as w } from "../Button/Button.js";
|
4
|
+
import { Drawer as v, DrawerTrigger as x, DrawerContent as D, DrawerClose as T } from "../Drawer/Drawer.js";
|
5
|
+
import { XMark as F } from "../Icons/XMark.js";
|
6
|
+
import { GroupedCountryList as N } from "../PhoneField/GroupedCountryList.js";
|
7
|
+
import { SearchField as j } from "../SearchField/SearchField.js";
|
8
|
+
import { TopBar as B } from "../TopBar/TopBar.js";
|
9
|
+
import { useCountryFiltering as G } from "./useCountryFiltering.js";
|
10
|
+
import { useCountryGrouping as O } from "./useCountryGrouping.js";
|
11
|
+
function H({
|
12
|
+
onChange: s,
|
13
|
+
value: u,
|
14
|
+
countries: c,
|
15
|
+
onAnimationEnd: m,
|
16
|
+
disabled: f = !1,
|
17
|
+
children: h,
|
18
|
+
defaultValue: p = "US"
|
19
|
+
}) {
|
20
|
+
const [t, o] = i(""), [n, a] = i(!1), d = S(null), C = (r) => {
|
21
|
+
o(r.target.value);
|
22
|
+
}, g = G({
|
23
|
+
countries: c,
|
24
|
+
searchText: t
|
25
|
+
}), y = O({
|
26
|
+
countries: g,
|
27
|
+
defaultValue: p
|
28
|
+
});
|
29
|
+
return /* @__PURE__ */ l(v, { open: n, onOpenChange: a, onAnimationEnd: m, height: "full", children: [
|
30
|
+
/* @__PURE__ */ e(x, { asChild: !0, className: "outline-none", disabled: f, children: h }),
|
31
|
+
/* @__PURE__ */ l(D, { children: [
|
32
|
+
/* @__PURE__ */ e(
|
33
|
+
B,
|
34
|
+
{
|
35
|
+
title: "Country",
|
36
|
+
startAdornment: /* @__PURE__ */ e(T, { asChild: !0, children: /* @__PURE__ */ e(w, { variant: "tertiary", size: "icon", children: /* @__PURE__ */ e(F, {}) }) })
|
37
|
+
}
|
38
|
+
),
|
39
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: /* @__PURE__ */ e(
|
40
|
+
j,
|
41
|
+
{
|
42
|
+
ref: d,
|
43
|
+
value: t,
|
44
|
+
onChange: C,
|
45
|
+
autoFocus: n
|
46
|
+
}
|
47
|
+
) }),
|
48
|
+
/* @__PURE__ */ e("div", { className: "no-scrollbar w-full overflow-auto px-6 h-full", children: /* @__PURE__ */ e(
|
49
|
+
N,
|
50
|
+
{
|
51
|
+
groupedCountries: y,
|
52
|
+
onSelect: (r) => {
|
53
|
+
s(r), o(""), a(!1);
|
54
|
+
},
|
55
|
+
value: u
|
56
|
+
}
|
57
|
+
) })
|
58
|
+
] })
|
59
|
+
] });
|
60
|
+
}
|
61
|
+
export {
|
62
|
+
H as CountryDrawer
|
63
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './CountryDrawer';
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { CountryCode } from '../Flag';
|
2
|
+
interface UseCountryFilteringProps {
|
3
|
+
countries?: CountryCode[];
|
4
|
+
searchText: string;
|
5
|
+
}
|
6
|
+
export declare function useCountryFiltering({ countries, searchText }: UseCountryFilteringProps): import('react-international-phone').CountryData[];
|
7
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { defaultCountries as o } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
|
2
|
+
import { getCountryDataListByCodes as i, filterCountries as n } from "../PhoneField/utils.js";
|
3
|
+
function f({ countries: t, searchText: r }) {
|
4
|
+
const e = t ? i(t) : o;
|
5
|
+
return n(e, r);
|
6
|
+
}
|
7
|
+
export {
|
8
|
+
f as useCountryFiltering
|
9
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { CountryCode } from '../Flag';
|
2
|
+
interface GroupedCountries {
|
3
|
+
[key: string]: {
|
4
|
+
countryCode: CountryCode;
|
5
|
+
name: string;
|
6
|
+
}[];
|
7
|
+
}
|
8
|
+
interface UseCountryGroupingProps {
|
9
|
+
countries: any[];
|
10
|
+
defaultValue?: CountryCode;
|
11
|
+
}
|
12
|
+
export declare function useCountryGrouping({ countries, defaultValue, }: UseCountryGroupingProps): GroupedCountries;
|
13
|
+
export {};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { parseCountry as s } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
|
2
|
+
import { getValidatedCountryCode as p } from "../PhoneField/utils.js";
|
3
|
+
function a({
|
4
|
+
countries: t,
|
5
|
+
defaultValue: n = "US"
|
6
|
+
}) {
|
7
|
+
return t.reduce((r, u) => {
|
8
|
+
const e = s(u), o = e.name.charAt(0).toUpperCase();
|
9
|
+
return r[o] || (r[o] = []), r[o].push({
|
10
|
+
countryCode: p(e.iso2, n),
|
11
|
+
name: e.name
|
12
|
+
}), r;
|
13
|
+
}, {});
|
14
|
+
}
|
15
|
+
export {
|
16
|
+
a as useCountryGrouping
|
17
|
+
};
|
@@ -1,6 +1,28 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import { DrawerCloseProps, DrawerContentProps, DrawerHeaderProps, DrawerProps, DrawerTitleProps, DrawerTriggerProps } from './types';
|
2
|
+
import * as React from "react";
|
3
|
+
/**
|
4
|
+
* A drawer component that slides up from the bottom of the screen
|
5
|
+
* @param props DrawerProps
|
6
|
+
*/
|
7
|
+
declare const Drawer: {
|
8
|
+
({ dismissible, height, modal, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
9
|
+
displayName: string;
|
10
|
+
};
|
11
|
+
declare const DrawerTrigger: React.ForwardRefExoticComponent<DrawerTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
12
|
+
declare const DrawerClose: React.ForwardRefExoticComponent<DrawerCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
13
|
+
/**
|
14
|
+
* The content container of the drawer
|
15
|
+
*/
|
16
|
+
declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
|
17
|
+
/**
|
18
|
+
* The header section of the drawer
|
19
|
+
*/
|
20
|
+
declare const DrawerHeader: {
|
21
|
+
({ icon, children, ...props }: DrawerHeaderProps): import("react/jsx-runtime").JSX.Element;
|
22
|
+
displayName: string;
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* The title component of the drawer
|
26
|
+
*/
|
27
|
+
declare const DrawerTitle: React.ForwardRefExoticComponent<DrawerTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
28
|
+
export { Drawer, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerTitle };
|