@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,8 +1,10 @@
1
1
  "use client";
2
- import { jsx as s } from "react/jsx-runtime";
2
+ import { jsx as l } from "react/jsx-runtime";
3
+ import { cn as c } from "../../lib/utils.js";
3
4
  import { useLongPress as d } from "../../node_modules/.pnpm/@uidotdev_usehooks@2.4.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@uidotdev/usehooks/index.js";
4
- import { Delete as c } from "./Delete.js";
5
- const m = [
5
+ import { typographyVariants as m } from "../Typography/Typography.js";
6
+ import { Delete as v } from "./Delete.js";
7
+ const f = [
6
8
  { value: "1" },
7
9
  { value: "2" },
8
10
  { value: "3" },
@@ -14,45 +16,49 @@ const m = [
14
16
  { value: "9" },
15
17
  { value: "." },
16
18
  { value: "0" },
17
- { value: "del", label: /* @__PURE__ */ s(c, { className: "size-6" }) }
18
- ], N = ({
19
- value: l = "",
20
- onChange: r,
19
+ { value: "del", label: /* @__PURE__ */ l(v, { className: "size-6" }) }
20
+ ], h = ({
21
+ value: r = "",
22
+ onChange: s,
21
23
  disabled: a = !1,
22
- onLongDeletePress: i = () => {
24
+ onLongDeletePress: t = () => {
23
25
  },
24
- longPressOptions: o = {
26
+ longPressOptions: n = {
25
27
  threshold: 1500
26
28
  }
27
29
  }) => {
28
- l !== "" && isNaN(Number(l)) && console.error("NumberPad value must be a valid number or empty string");
29
- const u = (e) => {
30
- if (!(!r || a))
30
+ r !== "" && isNaN(Number(r)) && console.error("NumberPad value must be a valid number or empty string");
31
+ const o = (e) => {
32
+ if (!(!s || a))
31
33
  if (e === "del")
32
- r(l.slice(0, -1));
34
+ s(r.slice(0, -1));
33
35
  else {
34
- if (e === "." && l.includes("."))
36
+ if (e === "." && r.includes("."))
35
37
  return;
36
38
  {
37
- const t = l + e;
38
- isNaN(Number(t)) || r(t);
39
+ const i = r + e;
40
+ (e === "." || !isNaN(Number(i))) && s(i);
39
41
  }
40
42
  }
41
- }, n = d(i, o);
42
- return /* @__PURE__ */ s("div", { className: "grid grid-cols-3 grid-rows-4 gap-1 w-full", children: m.map((e) => /* @__PURE__ */ s(
43
+ }, u = d(t, n);
44
+ return /* @__PURE__ */ l("div", { className: "grid grid-cols-3 grid-rows-4 gap-1 w-full", children: f.map((e) => /* @__PURE__ */ l(
43
45
  "button",
44
46
  {
45
47
  type: "button",
46
- onClick: () => u(e.value),
48
+ onClick: () => o(e.value),
47
49
  disabled: a,
48
- className: "h-12 min-w-28 flex items-center justify-center text-[1.625rem] font-semibold font-display rounded-md transition-colors duration-200 active:bg-gray-50 select-none disabled:text-gray-300 disabled:cursor-not-allowed disabled:active:bg-transparent",
49
- ...e.value === "del" ? n : {},
50
- children: e.label || e.value
50
+ className: c(
51
+ m({ variant: "heading", level: 3 }),
52
+ "h-12 min-w-28 flex items-center justify-center select-none group",
53
+ "disabled:text-gray-300 disabled:cursor-not-allowed disabled:active:bg-transparent"
54
+ ),
55
+ ...e.value === "del" ? u : {},
56
+ children: /* @__PURE__ */ l("span", { className: "duration-200 transition-colors size-12 flex items-center justify-center rounded-full group-active:bg-gray-50", children: e.label || e.value })
51
57
  },
52
58
  e.value
53
59
  )) });
54
60
  };
55
61
  export {
56
- N as NumberPad,
57
- N as default
62
+ h as NumberPad,
63
+ h as default
58
64
  };
@@ -14,25 +14,25 @@ const R = {
14
14
  chars: "text",
15
15
  digitsAndChars: "text"
16
16
  }, O = x.forwardRef(
17
- ({ maxLength: i = 6, error: a, children: N, mode: r = "digits", pattern: s, ...n }, e) => /* @__PURE__ */ t(
17
+ ({ maxLength: a = 6, error: r, children: N, mode: i = "digits", pattern: n, ...s }, e) => /* @__PURE__ */ t(
18
18
  f,
19
19
  {
20
20
  ref: e,
21
- ...n,
22
- maxLength: i,
23
- inputMode: E[r],
24
- pattern: s || R[r],
25
- containerClassName: "flex items-center gap-1 has-[:disabled]:opacity-50",
21
+ ...s,
22
+ maxLength: a,
23
+ inputMode: E[i],
24
+ pattern: n || R[i],
25
+ containerClassName: "flex items-center gap-2 has-[:disabled]:opacity-50",
26
26
  render: ({ slots: o }) => /* @__PURE__ */ t(p, { children: o.map(({ isActive: d, char: c }, m) => /* @__PURE__ */ t(
27
27
  "div",
28
28
  {
29
29
  ref: e,
30
30
  role: "textbox",
31
31
  className: l(
32
- y({ error: a }),
32
+ y({ error: r }),
33
33
  _({ variant: "body", level: 2 }),
34
34
  "w-12 h-[4.25rem] rounded-lg flex items-center justify-center",
35
- d && "z-10 bg-gray-0 shadow-card"
35
+ (d || r) && "z-10 bg-gray-0"
36
36
  ),
37
37
  children: c
38
38
  },
@@ -0,0 +1,13 @@
1
+ import { InputProps } from '../Input';
2
+ export interface PasswordFieldProps extends Omit<InputProps, "startAdornment" | "startAdornmentWidth"> {
3
+ /**
4
+ * If true, the input will display in an error state with error styling
5
+ */
6
+ error?: boolean;
7
+ /**
8
+ * If true, the input will display in a valid state with success styling
9
+ */
10
+ isValid?: boolean;
11
+ }
12
+ export declare const PasswordField: import('react').ForwardRefExoticComponent<PasswordFieldProps & import('react').RefAttributes<HTMLInputElement>>;
13
+ export default PasswordField;
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx as o } from "react/jsx-runtime";
3
+ import { forwardRef as l, useState as w } from "react";
4
+ import { Eye as u } from "../Icons/Eye.js";
5
+ import { EyeClosed as c } from "../Icons/EyeClosed.js";
6
+ import { Input as h } from "../Input/Input.js";
7
+ const y = l(
8
+ ({
9
+ isValid: t,
10
+ disabled: r,
11
+ type: A = "password",
12
+ autoComplete: d = "current-password",
13
+ spellCheck: n = "false",
14
+ inputMode: s = "text",
15
+ autoCapitalize: m = "off",
16
+ autoCorrect: p = "off",
17
+ endAdornment: P,
18
+ endAdornmentWidth: x,
19
+ ...a
20
+ }, f) => {
21
+ const [e, i] = w(!1);
22
+ return /* @__PURE__ */ o(
23
+ h,
24
+ {
25
+ ...a,
26
+ ref: f,
27
+ isValid: t,
28
+ disabled: r,
29
+ endAdornmentWidth: 2.4,
30
+ endAdornment: /* @__PURE__ */ o("button", { type: "button", onClick: () => i(!e), children: e ? /* @__PURE__ */ o(c, {}) : /* @__PURE__ */ o(u, {}) }),
31
+ type: e ? "text" : "password",
32
+ autoComplete: d,
33
+ spellCheck: n,
34
+ inputMode: s,
35
+ autoCapitalize: m,
36
+ autoCorrect: p
37
+ }
38
+ );
39
+ }
40
+ );
41
+ y.displayName = "PasswordField";
42
+ export {
43
+ y as PasswordField,
44
+ y as default
45
+ };
@@ -0,0 +1 @@
1
+ export * from './PasswordField';
@@ -0,0 +1,4 @@
1
+ import { PasswordField as d } from "./PasswordField.js";
2
+ export {
3
+ d as PasswordField
4
+ };
@@ -15,6 +15,6 @@ interface PasteButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
15
15
  */
16
16
  onPaste?: (value: string) => void;
17
17
  }
18
- export declare const PASTE_BUTTON_WIDTH = 3.875;
18
+ export declare const PASTE_BUTTON_WIDTH = 5;
19
19
  declare const PasteButton: React.ForwardRefExoticComponent<PasteButtonProps & React.RefAttributes<HTMLButtonElement>>;
20
20
  export default PasteButton;
@@ -1,37 +1,41 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { cn as d } from "../../lib/utils.js";
4
- import { Typography as u } from "../Typography/Typography.js";
5
- const b = 3.875, m = s.forwardRef(
6
- ({ children: p, inputRef: r, label: o = "Paste", className: c, onPaste: e, ...l }, n) => {
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
+ import * as d from "react";
3
+ import { cn as m } from "../../lib/utils.js";
4
+ import { MagicWand as u } from "../Icons/MagicWand.js";
5
+ import { Typography as p } from "../Typography/Typography.js";
6
+ const T = 5, f = d.forwardRef(
7
+ ({ children: x, inputRef: r, label: o = "Paste", className: n, onPaste: a, ...c }, l) => {
7
8
  const i = async () => {
8
9
  try {
9
10
  if (r && "current" in r && r.current) {
10
11
  const t = await navigator.clipboard.readText();
11
- r.current.value = t, e == null || e(t);
12
+ r.current.value = t, a == null || a(t);
12
13
  }
13
14
  } catch (t) {
14
15
  console.error("Failed to read clipboard:", t);
15
16
  }
16
17
  };
17
- return /* @__PURE__ */ a(
18
+ return /* @__PURE__ */ s(
18
19
  "button",
19
20
  {
20
21
  type: "button",
21
- ref: n,
22
- className: d(
23
- c,
24
- "flex h-full w-full items-center justify-center rounded-lg px-4 text-base font-medium text-gray-500 transition duration-300 bg-gray-0 group-focus-within:bg-gray-100 disabled:cursor-not-allowed"
22
+ ref: l,
23
+ className: m(
24
+ n,
25
+ "flex h-full w-full items-center justify-center px-4 gap-1 text-gray-900 transition duration-300 bg-transparent disabled:cursor-not-allowed"
25
26
  ),
26
27
  onClick: i,
27
- ...l,
28
- children: /* @__PURE__ */ a(u, { variant: "subtitle", level: 4, className: "uppercase text-gray-900", children: o })
28
+ ...c,
29
+ children: [
30
+ /* @__PURE__ */ e(p, { variant: "subtitle", level: 3, children: o }),
31
+ /* @__PURE__ */ e(u, {})
32
+ ]
29
33
  }
30
34
  );
31
35
  }
32
36
  );
33
- m.displayName = "PasteButton";
37
+ f.displayName = "PasteButton";
34
38
  export {
35
- b as PASTE_BUTTON_WIDTH,
36
- m as default
39
+ T as PASTE_BUTTON_WIDTH,
40
+ f as default
37
41
  };
@@ -2,12 +2,11 @@ import { CountryCode } from '../Flag';
2
2
  interface CountryListItemProps {
3
3
  countryCode: CountryCode;
4
4
  countryName: string;
5
- dialCode: string;
6
- isSelected: boolean;
7
- onClick?: () => void;
5
+ isSelected?: boolean;
6
+ onClick?: (value: CountryCode) => void;
8
7
  }
9
8
  declare const CountryListItem: {
10
- ({ countryCode, countryName, dialCode, isSelected, onClick, }: CountryListItemProps): import("react/jsx-runtime").JSX.Element;
9
+ ({ countryCode, countryName, onClick, isSelected, }: CountryListItemProps): import("react/jsx-runtime").JSX.Element;
11
10
  displayName: string;
12
11
  };
13
12
  export default CountryListItem;
@@ -1,35 +1,31 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { cn as m } from "../../lib/utils.js";
3
- import { Flag as n } from "../Flag/Flag.js";
4
- import "../Flag/LazyFlag.js";
5
- import { Typography as a } from "../Typography/Typography.js";
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
+ import "../Flag/Flag.js";
3
+ import { LazyFlag as m } from "../Flag/LazyFlag.js";
4
+ import { Typography as l } from "../Typography/Typography.js";
6
5
  const p = ({
7
- countryCode: r,
8
- countryName: t,
9
- dialCode: o,
10
- isSelected: s,
11
- onClick: i
12
- }) => /* @__PURE__ */ l(
13
- "div",
6
+ countryCode: t,
7
+ countryName: a,
8
+ onClick: e,
9
+ isSelected: s
10
+ }) => /* @__PURE__ */ i(
11
+ "button",
14
12
  {
15
- "data-country": r,
16
- className: m(
17
- "flex items-center w-full cursor-pointer rounded-md p-2 hover:bg-gray-100",
18
- s && "bg-gray-200"
19
- ),
20
- onClick: i,
13
+ type: "button",
14
+ "data-country": t,
15
+ className: "h-[3.75rem] flex items-center w-full gap-2 cursor-pointer",
16
+ onClick: () => e == null ? void 0 : e(t),
17
+ ...s && { "data-selected": !0 },
21
18
  children: [
22
- /* @__PURE__ */ e("span", { className: "w-6 h-6", children: /* @__PURE__ */ e(n, { countryCode: r, size: 24 }) }),
23
- /* @__PURE__ */ e(
24
- a,
19
+ /* @__PURE__ */ r(m, { countryCode: t, size: 32 }),
20
+ /* @__PURE__ */ r(
21
+ l,
25
22
  {
26
- variant: "body",
23
+ variant: "subtitle",
27
24
  level: 2,
28
25
  className: "mx-2 overflow-hidden text-ellipsis whitespace-nowrap",
29
- children: t
26
+ children: a
30
27
  }
31
- ),
32
- /* @__PURE__ */ e(a, { variant: "body", level: 2, className: "ml-auto", children: o })
28
+ )
33
29
  ]
34
30
  }
35
31
  );
@@ -1,9 +1,8 @@
1
1
  import { CountryCode } from '../Flag';
2
2
  interface CountrySelectorButtonProps extends React.HTMLAttributes<HTMLDivElement> {
3
- disabled: boolean;
4
- countryCode: CountryCode;
5
- hideDialCode: boolean;
6
- dialCode: string;
3
+ disabled?: boolean;
4
+ value: CountryCode;
5
+ label: string;
7
6
  }
8
7
  declare const CountrySelectorButton: import('react').ForwardRefExoticComponent<CountrySelectorButtonProps & import('react').RefAttributes<HTMLDivElement>>;
9
8
  export default CountrySelectorButton;
@@ -1,13 +1,13 @@
1
- import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
- import { cn as m } from "../../lib/utils.js";
3
- import { cva as c } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { forwardRef as d } from "react";
5
- import { Flag as p } from "../Flag/Flag.js";
1
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
+ import { cn as l } from "../../lib/utils.js";
3
+ import { cva as m } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { forwardRef as c } from "react";
5
+ import { Flag as d } from "../Flag/Flag.js";
6
6
  import "../Flag/LazyFlag.js";
7
+ import { ArrowDown as u } from "../Icons/ArrowDown.js";
7
8
  import { Typography as f } from "../Typography/Typography.js";
8
- import { ArrowDown as u } from "./ArrowDown.js";
9
- const y = c(
10
- "flex items-center bg-transparent border-none focus:outline-none cursor-pointer",
9
+ const p = m(
10
+ "flex items-center bg-transparent focus:outline-none cursor-pointer text-gray-900",
11
11
  {
12
12
  variants: {
13
13
  disabled: {
@@ -19,23 +19,23 @@ const y = c(
19
19
  disabled: !1
20
20
  }
21
21
  }
22
- ), g = d(
23
- ({ disabled: t, className: e, countryCode: o, hideDialCode: a, dialCode: s, ...n }, i) => /* @__PURE__ */ l(
22
+ ), y = c(
23
+ ({ disabled: t, className: o, value: e, label: a, ...s }, i) => /* @__PURE__ */ n(
24
24
  "div",
25
25
  {
26
26
  ref: i,
27
- ...n,
28
- className: m(y({ disabled: t, className: e })),
27
+ ...s,
28
+ className: l(p({ disabled: t, className: o })),
29
29
  "data-testid": "country-selector-button",
30
30
  children: [
31
- /* @__PURE__ */ r("div", { className: "w-6 h-6 mr-2", children: /* @__PURE__ */ r(p, { countryCode: o, size: 24 }) }),
32
- !a && /* @__PURE__ */ r(f, { variant: "subtitle", level: 2, className: "mr-2 text-gray-900", children: s }),
33
- /* @__PURE__ */ r("span", { className: "w-2.5 h-1.5", children: /* @__PURE__ */ r(u, { className: "text-gray-400" }) })
31
+ /* @__PURE__ */ r("div", { className: "mr-2", children: /* @__PURE__ */ r(d, { countryCode: e, size: 24 }) }),
32
+ /* @__PURE__ */ r(f, { variant: "subtitle", level: 3, className: "mr-2", children: a }),
33
+ /* @__PURE__ */ r(u, {})
34
34
  ]
35
35
  }
36
36
  )
37
37
  );
38
- g.displayName = "CountrySelectorButton";
38
+ y.displayName = "CountrySelectorButton";
39
39
  export {
40
- g as default
40
+ y as default
41
41
  };
@@ -0,0 +1,14 @@
1
+ import { CountryCode } from '../Flag';
2
+ interface GroupedCountries {
3
+ [key: string]: {
4
+ countryCode: CountryCode;
5
+ name: string;
6
+ }[];
7
+ }
8
+ interface GroupedCountryListProps {
9
+ groupedCountries: GroupedCountries;
10
+ value: CountryCode;
11
+ onSelect: (countryCode: CountryCode) => void;
12
+ }
13
+ export declare function GroupedCountryList({ groupedCountries, onSelect, value, }: GroupedCountryListProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,30 @@
1
+ import { jsxs as i, jsx as e, Fragment as n } from "react/jsx-runtime";
2
+ import { DrawerClose as c } from "../Drawer/Drawer.js";
3
+ import { Magnifier as d } from "../Icons/Magnifier.js";
4
+ import { Typography as l } from "../Typography/Typography.js";
5
+ import p from "./CountryListItem.js";
6
+ function C({
7
+ groupedCountries: o,
8
+ onSelect: s,
9
+ value: m
10
+ }) {
11
+ return Object.keys(o).length === 0 ? /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center grow text-gray-400 gap-2 h-full", children: [
12
+ /* @__PURE__ */ e(d, { className: "size-8" }),
13
+ /* @__PURE__ */ e(l, { variant: "body", level: 3, children: "No search results" })
14
+ ] }) : /* @__PURE__ */ e(n, { children: Object.entries(o).sort(([r], [a]) => r.localeCompare(a)).map(([r, a]) => /* @__PURE__ */ i("div", { className: "group", children: [
15
+ /* @__PURE__ */ e(l, { variant: "subtitle", level: 3, className: "text-gray-400 mb-2", children: r }),
16
+ a.map((t) => /* @__PURE__ */ e(c, { asChild: !0, children: /* @__PURE__ */ e(
17
+ p,
18
+ {
19
+ countryCode: t.countryCode,
20
+ countryName: t.name,
21
+ onClick: s,
22
+ isSelected: m === t.countryCode
23
+ }
24
+ ) }, t.countryCode)),
25
+ /* @__PURE__ */ e("div", { className: "h-[1px] bg-gray-200 my-4 group-last:hidden" })
26
+ ] }, r)) });
27
+ }
28
+ export {
29
+ C as GroupedCountryList
30
+ };
@@ -1,6 +1,6 @@
1
1
  import { CountryCode } from '../Flag/Flag';
2
2
  import { InputProps } from '../Input';
3
- export interface PhoneFieldProps extends Omit<InputProps, "onChange" | "startAdornment" | "startAdornmentWidth"> {
3
+ export interface PhoneFieldProps extends Omit<InputProps, "onChange" | "startAdornment" | "startAdornmentWidth" | "placeholder"> {
4
4
  /**
5
5
  * Current phone number value.
6
6
  */
@@ -14,12 +14,6 @@ export interface PhoneFieldProps extends Omit<InputProps, "onChange" | "startAdo
14
14
  * If not provided, all countries will be displayed.
15
15
  */
16
16
  countries?: CountryCode[];
17
- /**
18
- * If true, the dial code will be hidden.
19
- * The dial code is still displayed at the start of the input and in the dropdown.
20
- * @default false
21
- */
22
- hideDialCode?: boolean;
23
17
  /**
24
18
  * Disable dial code prefill on initialization.
25
19
  * Dial code prefill works only when empty phone value have been provided.
@@ -35,9 +29,9 @@ export interface PhoneFieldProps extends Omit<InputProps, "onChange" | "startAdo
35
29
  */
36
30
  isValid?: boolean;
37
31
  /**
38
- * The placeholder text to display when no value is selected.
32
+ * The label text to display
39
33
  */
40
- placeholder?: string;
34
+ label?: string;
41
35
  /**
42
36
  * When true, prevents the user from interacting with phone field.
43
37
  * @default false
@@ -59,11 +53,6 @@ export interface PhoneFieldProps extends Omit<InputProps, "onChange" | "startAdo
59
53
  * @default 1.25
60
54
  */
61
55
  endAdornmentWidth?: number;
62
- /**
63
- * Display mode for the country selector: "dropdown" for desktop or "drawer" for mobile.
64
- * @default "dropdown"
65
- */
66
- countrySelectorMode?: "dropdown" | "drawer";
67
56
  }
68
57
  export declare const PhoneField: import('react').ForwardRefExoticComponent<PhoneFieldProps & import('react').RefAttributes<HTMLDivElement>>;
69
58
  export default PhoneField;