@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.
Files changed (198) hide show
  1. package/README.md +8 -17
  2. package/dist/components/AlertDialog/AlertDialog.js +94 -0
  3. package/dist/components/AlertDialog/index.d.ts +1 -0
  4. package/dist/components/AlertDialog/index.js +13 -0
  5. package/dist/components/AlertDialog/types.d.ts +172 -0
  6. package/dist/components/AlertDialog/types.js +1 -0
  7. package/dist/components/AlertDialog/use-alert-dialog.d.ts +6 -0
  8. package/dist/components/AlertDialog/use-alert-dialog.js +11 -0
  9. package/dist/components/BottomBar/BottomBar.d.ts +13 -0
  10. package/dist/components/BottomBar/BottomBar.js +21 -0
  11. package/dist/components/BottomBar/index.d.ts +1 -0
  12. package/dist/components/BottomBar/index.js +4 -0
  13. package/dist/components/BulletList/BulletList.d.ts +10 -0
  14. package/dist/components/BulletList/BulletList.js +11 -0
  15. package/dist/components/BulletList/index.d.ts +1 -0
  16. package/dist/components/BulletList/index.js +4 -0
  17. package/dist/components/BulletListItem/BulletListItem.d.ts +7 -0
  18. package/dist/components/BulletListItem/BulletListItem.js +23 -0
  19. package/dist/components/BulletListItem/index.d.ts +1 -0
  20. package/dist/components/BulletListItem/index.js +4 -0
  21. package/dist/components/BulletPoint/BulletPoint.d.ts +6 -0
  22. package/dist/components/BulletPoint/BulletPoint.js +22 -0
  23. package/dist/components/BulletPoint/index.d.ts +1 -0
  24. package/dist/components/BulletPoint/index.js +1 -0
  25. package/dist/components/Button/Button.d.ts +10 -22
  26. package/dist/components/Button/Button.js +40 -72
  27. package/dist/components/Checkbox/Checkbox.d.ts +24 -4
  28. package/dist/components/Checkbox/Checkbox.js +5 -5
  29. package/dist/components/Chip/Chip.d.ts +2 -1
  30. package/dist/components/Chip/Chip.js +14 -8
  31. package/dist/components/ClearButton/Clear.js +14 -14
  32. package/dist/components/ClearButton/ClearButton.js +11 -11
  33. package/dist/components/ColorPicker/ColorPicker.js +14 -14
  34. package/dist/components/CountryDrawer/CountryDrawer.d.ts +12 -0
  35. package/dist/components/CountryDrawer/CountryDrawer.js +63 -0
  36. package/dist/components/CountryDrawer/index.d.ts +1 -0
  37. package/dist/components/CountryDrawer/index.js +4 -0
  38. package/dist/components/CountryDrawer/useCountryFiltering.d.ts +7 -0
  39. package/dist/components/CountryDrawer/useCountryFiltering.js +9 -0
  40. package/dist/components/CountryDrawer/useCountryGrouping.d.ts +13 -0
  41. package/dist/components/CountryDrawer/useCountryGrouping.js +17 -0
  42. package/dist/components/Drawer/Drawer.d.ts +28 -6
  43. package/dist/components/Drawer/Drawer.js +67 -28
  44. package/dist/components/Drawer/index.js +6 -4
  45. package/dist/components/Drawer/types.d.ts +167 -0
  46. package/dist/components/Drawer/types.js +1 -0
  47. package/dist/components/Drawer/use-drawer.d.ts +8 -0
  48. package/dist/components/Drawer/use-drawer.js +11 -0
  49. package/dist/components/Flag/LazyFlag.js +1 -1
  50. package/dist/components/Flag/flag-components/eu.d.ts +3 -0
  51. package/dist/components/Flag/flag-components/eu.js +83 -0
  52. package/dist/components/Flag/flag-components/index.d.ts +1 -0
  53. package/dist/components/Flag/flag-components/index.js +56 -54
  54. package/dist/components/Form/Form.js +2 -2
  55. package/dist/components/Icons/ArrowDown.js +26 -0
  56. package/dist/components/Icons/Eye.d.ts +8 -0
  57. package/dist/components/Icons/Eye.js +40 -0
  58. package/dist/components/Icons/EyeClosed.d.ts +8 -0
  59. package/dist/components/Icons/EyeClosed.js +60 -0
  60. package/dist/components/Icons/Fail.d.ts +8 -0
  61. package/dist/components/Icons/Fail.js +82 -0
  62. package/dist/components/Icons/MagicWand.d.ts +8 -0
  63. package/dist/components/Icons/MagicWand.js +60 -0
  64. package/dist/components/Icons/Magnifier.d.ts +1 -1
  65. package/dist/components/Icons/Magnifier.js +20 -11
  66. package/dist/components/Icons/Success.d.ts +8 -0
  67. package/dist/components/Icons/Success.js +82 -0
  68. package/dist/components/Icons/Tick.js +6 -7
  69. package/dist/components/Icons/XMark.d.ts +8 -0
  70. package/dist/components/Icons/XMark.js +27 -0
  71. package/dist/components/Input/Input.d.ts +26 -2
  72. package/dist/components/Input/Input.js +116 -51
  73. package/dist/components/ListItem/ListItem.d.ts +17 -6
  74. package/dist/components/ListItem/ListItem.js +29 -22
  75. package/dist/components/Marble/Marble.d.ts +2 -0
  76. package/dist/components/Marble/Marble.js +23 -0
  77. package/dist/components/Marble/index.d.ts +1 -0
  78. package/dist/components/Marble/index.js +4 -0
  79. package/dist/components/NumberPad/Delete.d.ts +1 -8
  80. package/dist/components/NumberPad/Delete.js +9 -10
  81. package/dist/components/NumberPad/NumberPad.js +30 -24
  82. package/dist/components/OTPField/OTPField.js +8 -8
  83. package/dist/components/PasswordField/PasswordField.d.ts +13 -0
  84. package/dist/components/PasswordField/PasswordField.js +45 -0
  85. package/dist/components/PasswordField/index.d.ts +1 -0
  86. package/dist/components/PasswordField/index.js +4 -0
  87. package/dist/components/PasteButton/PasteButton.d.ts +1 -1
  88. package/dist/components/PasteButton/PasteButton.js +21 -17
  89. package/dist/components/PhoneField/CountryListItem.d.ts +3 -4
  90. package/dist/components/PhoneField/CountryListItem.js +21 -25
  91. package/dist/components/PhoneField/CountrySelectorButton.d.ts +3 -4
  92. package/dist/components/PhoneField/CountrySelectorButton.js +17 -17
  93. package/dist/components/PhoneField/GroupedCountryList.d.ts +14 -0
  94. package/dist/components/PhoneField/GroupedCountryList.js +30 -0
  95. package/dist/components/PhoneField/PhoneField.d.ts +3 -14
  96. package/dist/components/PhoneField/PhoneField.js +71 -197
  97. package/dist/components/PhoneField/constants.js +4 -4
  98. package/dist/components/Pill/Pill.js +7 -7
  99. package/dist/components/Progress/Progress.d.ts +14 -0
  100. package/dist/components/Progress/Progress.js +31 -0
  101. package/dist/components/Progress/index.d.ts +1 -0
  102. package/dist/components/Progress/index.js +4 -0
  103. package/dist/components/RadioGroup/RadioGroupItem.js +1 -1
  104. package/dist/components/SearchField/SearchField.d.ts +6 -1
  105. package/dist/components/SearchField/SearchField.js +39 -35
  106. package/dist/components/Select/Select.js +46 -76
  107. package/dist/components/{Button → Spinner}/Spinner.d.ts +2 -2
  108. package/dist/components/Spinner/Spinner.js +36 -0
  109. package/dist/components/Spinner/index.d.ts +1 -0
  110. package/dist/components/Spinner/index.js +4 -0
  111. package/dist/components/Switch/Switch.js +1 -1
  112. package/dist/components/Tabs/Tabs.d.ts +11 -0
  113. package/dist/components/Tabs/Tabs.js +58 -0
  114. package/dist/components/Tabs/index.d.ts +2 -0
  115. package/dist/components/Tabs/index.js +5 -0
  116. package/dist/components/Tabs/types.d.ts +53 -0
  117. package/dist/components/Tabs/types.js +1 -0
  118. package/dist/components/TextArea/TextArea.d.ts +25 -0
  119. package/dist/components/TextArea/TextArea.js +54 -0
  120. package/dist/components/TextArea/index.d.ts +1 -0
  121. package/dist/components/TextArea/index.js +4 -0
  122. package/dist/components/Toast/Toast.d.ts +9 -0
  123. package/dist/components/Toast/Toast.js +51 -0
  124. package/dist/components/Toast/Toaster.d.ts +3 -0
  125. package/dist/components/Toast/Toaster.js +14 -0
  126. package/dist/components/Toast/index.d.ts +3 -0
  127. package/dist/components/Toast/index.js +12 -0
  128. package/dist/components/Toast/use-toast.d.ts +51 -0
  129. package/dist/components/Toast/use-toast.js +101 -0
  130. package/dist/components/ToggleGroup/ToggleGroup.d.ts +5 -0
  131. package/dist/components/ToggleGroup/ToggleGroup.js +28 -0
  132. package/dist/components/ToggleGroup/index.d.ts +1 -0
  133. package/dist/components/ToggleGroup/index.js +5 -0
  134. package/dist/components/ToggleGroup/types.d.ts +101 -0
  135. package/dist/components/ToggleGroup/types.js +1 -0
  136. package/dist/components/Token/Token.d.ts +4 -0
  137. package/dist/components/Token/Token.js +12 -7
  138. package/dist/components/Token/icons/btc.d.ts +2 -2
  139. package/dist/components/Token/icons/btc.js +13 -58
  140. package/dist/components/Token/icons/dai.d.ts +3 -0
  141. package/dist/components/Token/icons/dai.js +27 -0
  142. package/dist/components/Token/icons/eth.d.ts +2 -2
  143. package/dist/components/Token/icons/eth.js +11 -58
  144. package/dist/components/Token/icons/index.d.ts +2 -0
  145. package/dist/components/Token/icons/index.js +8 -4
  146. package/dist/components/Token/icons/types.d.ts +7 -0
  147. package/dist/components/Token/icons/types.js +1 -0
  148. package/dist/components/Token/icons/usdc.d.ts +2 -2
  149. package/dist/components/Token/icons/usdc.js +16 -56
  150. package/dist/components/Token/icons/usdt.d.ts +3 -0
  151. package/dist/components/Token/icons/usdt.js +27 -0
  152. package/dist/components/Token/icons/utils.d.ts +9 -0
  153. package/dist/components/Token/icons/utils.js +11 -0
  154. package/dist/components/Token/icons/wld.d.ts +2 -2
  155. package/dist/components/Token/icons/wld.js +10 -41
  156. package/dist/components/TopBar/TopBar.d.ts +11 -0
  157. package/dist/components/TopBar/TopBar.js +23 -0
  158. package/dist/components/TopBar/index.d.ts +1 -0
  159. package/dist/components/TopBar/index.js +4 -0
  160. package/dist/components/Typography/Typography.d.ts +12 -8
  161. package/dist/components/Typography/Typography.js +72 -60
  162. package/dist/components/WalletAddressField/WalletAddressField.d.ts +23 -0
  163. package/dist/components/WalletAddressField/WalletAddressField.js +81 -0
  164. package/dist/components/WalletAddressField/index.d.ts +1 -0
  165. package/dist/components/WalletAddressField/index.js +4 -0
  166. package/dist/index.d.ts +15 -0
  167. package/dist/index.js +91 -45
  168. package/dist/lib/constants/dropdownStyles.d.ts +1 -1
  169. package/dist/lib/constants/dropdownStyles.js +2 -2
  170. 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
  171. 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
  172. 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
  173. 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
  174. 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
  175. 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
  176. 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
  177. 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
  178. 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
  179. 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
  180. 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
  181. package/dist/tailwind/index.d.ts +41 -25
  182. package/dist/tailwind/index.js +128 -85
  183. package/package.json +73 -1
  184. package/public/fonts/TWKLausanne-350.woff +0 -0
  185. package/public/fonts/TWKLausanne-350Italic.woff +0 -0
  186. package/public/fonts/TWKLausanne-500.woff +0 -0
  187. package/public/fonts/TWKLausanne-500Italic.woff +0 -0
  188. package/public/fonts/TWKLausanne-600.woff +0 -0
  189. package/public/fonts/TWKLausanne-600Italic.woff +0 -0
  190. package/public/globals.css +1 -1
  191. package/public/images/marbles/marble1.png +0 -0
  192. package/public/images/marbles/marble2.png +0 -0
  193. package/public/images/marbles/marble3.svg +36 -0
  194. package/dist/components/Button/Spinner.js +0 -36
  195. package/dist/components/PhoneField/ArrowDown.js +0 -27
  196. package/dist/components/Select/ArrowDown.d.ts +0 -2
  197. package/dist/components/Select/ArrowDown.js +0 -27
  198. /package/dist/components/{PhoneField → Icons}/ArrowDown.d.ts +0 -0
@@ -1,32 +1,28 @@
1
1
  "use client";
2
- import { jsxs as b, jsx as r } from "react/jsx-runtime";
3
- import { Slot as s } 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";
4
- import { cva as y } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
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 u from "./Spinner.js";
7
- const f = y(
8
- "flex items-center justify-center gap-1 font-display font-semibold leading-[1.2] tracking-normal transition-colors",
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-500 disabled:bg-gray-100 disabled:text-gray-300",
13
- secondary: "bg-gray-200 text-gray-900 hover:bg-gray-300 active:bg-gray-400 disabled:bg-gray-100 disabled:text-gray-300",
14
- tertiary: "border border-gray-200 bg-transparent text-gray-500 hover:bg-gray-100 active:bg-gray-200 disabled:text-gray-300",
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-2 text-sm",
19
- md: "h-12 min-w-12 px-3 text-base",
20
- lg: "h-14 min-w-14 px-4 text-base"
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
- radius: {
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
- sm: {
47
- width: "1rem",
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: m,
74
- className: f({
75
- variant: i,
76
- size: a,
77
- radius: g,
78
- isLoading: t,
79
- fullWidth: o
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
- n && /* @__PURE__ */ r(
84
- s,
85
- {
86
- style: {
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
- c.displayName = "Button";
67
+ x.displayName = "Button";
100
68
  export {
101
- c as Button,
102
- c as default
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
- * The checked state of the checkbox.
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
- * Callback function that is triggered when the checked state changes.
17
+ * Event handler called when the checked state changes
10
18
  */
11
19
  onChange?: (checked: boolean) => void;
12
20
  /**
13
- * The disabled state of the checkbox.
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 n } from "react";
4
- import { Tick as i } from "../Icons/Tick.js";
5
- const l = n(
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 h-6 w-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-400 data-[state=unchecked]:bg-transparent disabled:cursor-not-allowed disabled:opacity-20",
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(i, { className: "text-gray-0" }) })
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?: "default" | "success" | "warning" | "error" | "important" | null | undefined;
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 f } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { forwardRef as l } from "react";
5
- const m = f(
6
- "inline-flex h-7 items-center gap-2 rounded-full px-2 font-sans text-sm font-medium leading-none",
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 = l(
22
- ({ className: e = "", icon: r, label: a, variant: n = "default" }, i) => /* @__PURE__ */ s("div", { ref: i, className: m({ variant: n, className: e }), children: [
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("span", { children: a })
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 e } from "react/jsx-runtime";
2
- import { cn as C } from "../../lib/utils.js";
3
- function i({ className: l }) {
4
- return /* @__PURE__ */ e(
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: "20",
8
- height: "20",
9
- viewBox: "0 0 20 20",
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: C("h-4 w-4", l),
13
- children: /* @__PURE__ */ e(
12
+ className: t("size-6", e),
13
+ children: /* @__PURE__ */ r(
14
14
  "path",
15
15
  {
16
- fillRule: "evenodd",
17
- clipRule: "evenodd",
18
- d: "M18.3333 9.99999C18.3333 14.6024 14.6024 18.3333 9.99999 18.3333C5.39762 18.3333 1.66666 14.6024 1.66666 9.99999C1.66666 5.39762 5.39762 1.66666 9.99999 1.66666C14.6024 1.66666 18.3333 5.39762 18.3333 9.99999ZM12.799 12.7989C12.5549 13.043 12.1592 13.043 11.9151 12.7989L10 10.8838L8.08491 12.7989C7.84083 13.043 7.4451 13.043 7.20102 12.7989C6.95695 12.5548 6.95695 12.1591 7.20102 11.915L9.11611 9.99994L7.20104 8.08486C6.95696 7.84078 6.95696 7.44506 7.20104 7.20098C7.44511 6.9569 7.84084 6.9569 8.08492 7.20098L10 9.11606L11.9151 7.20098C12.1591 6.95691 12.5549 6.95691 12.799 7.20098C13.043 7.44506 13.043 7.84079 12.799 8.08487L10.8839 9.99994L12.799 11.915C13.043 12.1591 13.043 12.5548 12.799 12.7989Z",
19
- fill: "currentColor"
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
- i as Clear
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 l } from "../../lib/utils.js";
4
- import { Clear as u } from "./Clear.js";
5
- const h = 1.25, i = m.forwardRef(
6
- ({ children: p, inputRef: t, className: a, onClear: r, ...s }, n) => {
7
- const c = (o) => {
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: n,
15
- className: l(a),
16
- onMouseDown: c,
17
- ...s,
18
- children: /* @__PURE__ */ e(u, { className: "text-gray-400 size-5" })
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
- h as CLEAR_BUTTON_WIDTH,
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 i, Indicator as n, 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";
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, ...o }, r) => /* @__PURE__ */ t(
6
- i,
5
+ ({ value: e, ...r }, o) => /* @__PURE__ */ t(
6
+ n,
7
7
  {
8
- ref: r,
8
+ ref: o,
9
9
  value: e,
10
- className: "size-[3.25rem] cursor-default rounded-full outline-none flex items-center justify-center relative disabled:opacity-90 disabled:cursor-not-allowed",
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
- ...o,
14
+ ...r,
15
15
  children: /* @__PURE__ */ t(
16
- n,
16
+ i,
17
17
  {
18
- className: "absolute flex size-[3.5rem] items-center rounded-full justify-center opacity-25",
19
- style: { boxShadow: `0px 0px 0px 2px ${e}` }
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: o, children: r, ...a }, l) => /* @__PURE__ */ t(
25
+ ({ value: e, onChange: r, children: o, ...l }, a) => /* @__PURE__ */ t(
26
26
  c,
27
27
  {
28
- ref: l,
28
+ ref: a,
29
29
  value: e,
30
- onValueChange: o,
30
+ onValueChange: r,
31
31
  className: "flex gap-4 items-center",
32
- ...a,
33
- children: r
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,4 @@
1
+ import { CountryDrawer as e } from "./CountryDrawer.js";
2
+ export {
3
+ e as CountryDrawer
4
+ };
@@ -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 { Drawer as DrawerPrimitive } from 'vaul';
2
- declare const Drawer: typeof import('vaul').Root;
3
- declare const DrawerTrigger: typeof DrawerPrimitive.Trigger;
4
- declare const DrawerClose: typeof DrawerPrimitive.Close;
5
- declare const DrawerContent: typeof DrawerPrimitive.Content;
6
- export { Drawer, DrawerTrigger, DrawerClose, DrawerContent };
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 };