@wow-two-beta/ui 0.0.6 → 0.0.8

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 (307) hide show
  1. package/dist/actions/button/Button.variants.d.ts +2 -2
  2. package/dist/actions/buttonGroup/ButtonGroup.d.ts +14 -0
  3. package/dist/actions/buttonGroup/ButtonGroup.d.ts.map +1 -0
  4. package/dist/actions/buttonGroup/index.d.ts +2 -0
  5. package/dist/actions/buttonGroup/index.d.ts.map +1 -0
  6. package/dist/actions/copyButton/CopyButton.d.ts +20 -0
  7. package/dist/actions/copyButton/CopyButton.d.ts.map +1 -0
  8. package/dist/actions/copyButton/index.d.ts +2 -0
  9. package/dist/actions/copyButton/index.d.ts.map +1 -0
  10. package/dist/actions/disclosureButton/DisclosureButton.d.ts +20 -0
  11. package/dist/actions/disclosureButton/DisclosureButton.d.ts.map +1 -0
  12. package/dist/actions/disclosureButton/index.d.ts +2 -0
  13. package/dist/actions/disclosureButton/index.d.ts.map +1 -0
  14. package/dist/actions/fab/FAB.d.ts +13 -0
  15. package/dist/actions/fab/FAB.d.ts.map +1 -0
  16. package/dist/actions/fab/FAB.variants.d.ts +130 -0
  17. package/dist/actions/fab/FAB.variants.d.ts.map +1 -0
  18. package/dist/actions/fab/index.d.ts +3 -0
  19. package/dist/actions/fab/index.d.ts.map +1 -0
  20. package/dist/actions/iconButton/IconButton.variants.d.ts +2 -2
  21. package/dist/actions/index.d.ts +8 -0
  22. package/dist/actions/index.d.ts.map +1 -1
  23. package/dist/actions/index.js +4 -1
  24. package/dist/actions/link/Link.variants.d.ts +2 -2
  25. package/dist/actions/overlayButton/OverlayButton.d.ts +16 -0
  26. package/dist/actions/overlayButton/OverlayButton.d.ts.map +1 -0
  27. package/dist/actions/overlayButton/OverlayButton.variants.d.ts +123 -0
  28. package/dist/actions/overlayButton/OverlayButton.variants.d.ts.map +1 -0
  29. package/dist/actions/overlayButton/index.d.ts +3 -0
  30. package/dist/actions/overlayButton/index.d.ts.map +1 -0
  31. package/dist/actions/segmentedControl/SegmentedControl.d.ts +9 -0
  32. package/dist/actions/segmentedControl/SegmentedControl.d.ts.map +1 -0
  33. package/dist/actions/segmentedControl/index.d.ts +2 -0
  34. package/dist/actions/segmentedControl/index.d.ts.map +1 -0
  35. package/dist/actions/toggleButton/ToggleButton.d.ts +16 -0
  36. package/dist/actions/toggleButton/ToggleButton.d.ts.map +1 -0
  37. package/dist/actions/toggleButton/ToggleButton.variants.d.ts +81 -0
  38. package/dist/actions/toggleButton/ToggleButton.variants.d.ts.map +1 -0
  39. package/dist/actions/toggleButton/index.d.ts +3 -0
  40. package/dist/actions/toggleButton/index.d.ts.map +1 -0
  41. package/dist/actions/toggleButtonGroup/ToggleButtonGroup.d.ts +25 -0
  42. package/dist/actions/toggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -0
  43. package/dist/actions/toggleButtonGroup/index.d.ts +2 -0
  44. package/dist/actions/toggleButtonGroup/index.d.ts.map +1 -0
  45. package/dist/{chunk-6NYTRHP7.js → chunk-4P2TFUVW.js} +39 -5
  46. package/dist/chunk-4P2TFUVW.js.map +1 -0
  47. package/dist/chunk-7SGLT2LM.js +774 -0
  48. package/dist/chunk-7SGLT2LM.js.map +1 -0
  49. package/dist/chunk-D5CHR6RX.js +423 -0
  50. package/dist/chunk-D5CHR6RX.js.map +1 -0
  51. package/dist/{chunk-77WSI427.js → chunk-KDXJQNB6.js} +9 -5
  52. package/dist/chunk-KDXJQNB6.js.map +1 -0
  53. package/dist/chunk-L32PXXQL.js +126 -0
  54. package/dist/chunk-L32PXXQL.js.map +1 -0
  55. package/dist/{chunk-SYG6ZE42.js → chunk-NKGNOOXJ.js} +116 -4
  56. package/dist/chunk-NKGNOOXJ.js.map +1 -0
  57. package/dist/chunk-RIW2V3N4.js +596 -0
  58. package/dist/chunk-RIW2V3N4.js.map +1 -0
  59. package/dist/{chunk-JCMV6IT4.js → chunk-SL5YJADS.js} +4 -4
  60. package/dist/{chunk-JCMV6IT4.js.map → chunk-SL5YJADS.js.map} +1 -1
  61. package/dist/{chunk-Q27NAHVB.js → chunk-WEM32VIJ.js} +3 -3
  62. package/dist/{chunk-Q27NAHVB.js.map → chunk-WEM32VIJ.js.map} +1 -1
  63. package/dist/chunk-X2LTOZ7F.js +1119 -0
  64. package/dist/chunk-X2LTOZ7F.js.map +1 -0
  65. package/dist/display/avatar/Avatar.variants.d.ts +2 -2
  66. package/dist/display/avatarGroup/AvatarGroup.d.ts +16 -0
  67. package/dist/display/avatarGroup/AvatarGroup.d.ts.map +1 -0
  68. package/dist/display/avatarGroup/index.d.ts +2 -0
  69. package/dist/display/avatarGroup/index.d.ts.map +1 -0
  70. package/dist/display/badgeOverlay/BadgeOverlay.d.ts +18 -0
  71. package/dist/display/badgeOverlay/BadgeOverlay.d.ts.map +1 -0
  72. package/dist/display/badgeOverlay/index.d.ts +2 -0
  73. package/dist/display/badgeOverlay/index.d.ts.map +1 -0
  74. package/dist/display/card/Card.d.ts +20 -0
  75. package/dist/display/card/Card.d.ts.map +1 -0
  76. package/dist/display/card/index.d.ts +2 -0
  77. package/dist/display/card/index.d.ts.map +1 -0
  78. package/dist/display/countBadge/CountBadge.d.ts +18 -0
  79. package/dist/display/countBadge/CountBadge.d.ts.map +1 -0
  80. package/dist/display/countBadge/index.d.ts +2 -0
  81. package/dist/display/countBadge/index.d.ts.map +1 -0
  82. package/dist/display/descriptionList/DescriptionList.d.ts +18 -0
  83. package/dist/display/descriptionList/DescriptionList.d.ts.map +1 -0
  84. package/dist/display/descriptionList/index.d.ts +2 -0
  85. package/dist/display/descriptionList/index.d.ts.map +1 -0
  86. package/dist/display/emptyState/EmptyState.d.ts +19 -0
  87. package/dist/display/emptyState/EmptyState.d.ts.map +1 -0
  88. package/dist/display/emptyState/index.d.ts +2 -0
  89. package/dist/display/emptyState/index.d.ts.map +1 -0
  90. package/dist/display/heading/Heading.variants.d.ts +2 -2
  91. package/dist/display/highlight/Highlight.d.ts +16 -0
  92. package/dist/display/highlight/Highlight.d.ts.map +1 -0
  93. package/dist/display/highlight/index.d.ts +2 -0
  94. package/dist/display/highlight/index.d.ts.map +1 -0
  95. package/dist/display/index.d.ts +15 -0
  96. package/dist/display/index.d.ts.map +1 -1
  97. package/dist/display/index.js +7 -2
  98. package/dist/display/infoRow/InfoRow.d.ts +16 -0
  99. package/dist/display/infoRow/InfoRow.d.ts.map +1 -0
  100. package/dist/display/infoRow/index.d.ts +2 -0
  101. package/dist/display/infoRow/index.d.ts.map +1 -0
  102. package/dist/display/keyboardShortcut/KeyboardShortcut.d.ts +13 -0
  103. package/dist/display/keyboardShortcut/KeyboardShortcut.d.ts.map +1 -0
  104. package/dist/display/keyboardShortcut/index.d.ts +2 -0
  105. package/dist/display/keyboardShortcut/index.d.ts.map +1 -0
  106. package/dist/display/notificationDot/NotificationDot.d.ts +15 -0
  107. package/dist/display/notificationDot/NotificationDot.d.ts.map +1 -0
  108. package/dist/display/notificationDot/index.d.ts +2 -0
  109. package/dist/display/notificationDot/index.d.ts.map +1 -0
  110. package/dist/display/sectionHeader/SectionHeader.d.ts +21 -0
  111. package/dist/display/sectionHeader/SectionHeader.d.ts.map +1 -0
  112. package/dist/display/sectionHeader/index.d.ts +2 -0
  113. package/dist/display/sectionHeader/index.d.ts.map +1 -0
  114. package/dist/display/snippet/Snippet.d.ts +15 -0
  115. package/dist/display/snippet/Snippet.d.ts.map +1 -0
  116. package/dist/display/snippet/index.d.ts +2 -0
  117. package/dist/display/snippet/index.d.ts.map +1 -0
  118. package/dist/display/stat/Stat.d.ts +22 -0
  119. package/dist/display/stat/Stat.d.ts.map +1 -0
  120. package/dist/display/stat/index.d.ts +2 -0
  121. package/dist/display/stat/index.d.ts.map +1 -0
  122. package/dist/display/status/Status.d.ts +14 -0
  123. package/dist/display/status/Status.d.ts.map +1 -0
  124. package/dist/display/status/index.d.ts +2 -0
  125. package/dist/display/status/index.d.ts.map +1 -0
  126. package/dist/display/tag/Tag.variants.d.ts +2 -2
  127. package/dist/display/tooltip/Tooltip.d.ts +25 -0
  128. package/dist/display/tooltip/Tooltip.d.ts.map +1 -0
  129. package/dist/display/tooltip/index.d.ts +2 -0
  130. package/dist/display/tooltip/index.d.ts.map +1 -0
  131. package/dist/feedback/alert/Alert.d.ts +22 -0
  132. package/dist/feedback/alert/Alert.d.ts.map +1 -0
  133. package/dist/feedback/alert/index.d.ts +2 -0
  134. package/dist/feedback/alert/index.d.ts.map +1 -0
  135. package/dist/feedback/banner/Banner.d.ts +16 -0
  136. package/dist/feedback/banner/Banner.d.ts.map +1 -0
  137. package/dist/feedback/banner/index.d.ts +2 -0
  138. package/dist/feedback/banner/index.d.ts.map +1 -0
  139. package/dist/feedback/callout/Callout.d.ts +13 -0
  140. package/dist/feedback/callout/Callout.d.ts.map +1 -0
  141. package/dist/feedback/callout/index.d.ts +2 -0
  142. package/dist/feedback/callout/index.d.ts.map +1 -0
  143. package/dist/feedback/index.d.ts +10 -0
  144. package/dist/feedback/index.d.ts.map +1 -1
  145. package/dist/feedback/index.js +2 -1
  146. package/dist/feedback/inlineSpinner/InlineSpinner.d.ts +14 -0
  147. package/dist/feedback/inlineSpinner/InlineSpinner.d.ts.map +1 -0
  148. package/dist/feedback/inlineSpinner/index.d.ts +2 -0
  149. package/dist/feedback/inlineSpinner/index.d.ts.map +1 -0
  150. package/dist/feedback/loadingState/LoadingState.d.ts +15 -0
  151. package/dist/feedback/loadingState/LoadingState.d.ts.map +1 -0
  152. package/dist/feedback/loadingState/index.d.ts +2 -0
  153. package/dist/feedback/loadingState/index.d.ts.map +1 -0
  154. package/dist/feedback/meterBar/MeterBar.d.ts +18 -0
  155. package/dist/feedback/meterBar/MeterBar.d.ts.map +1 -0
  156. package/dist/feedback/meterBar/index.d.ts +2 -0
  157. package/dist/feedback/meterBar/index.d.ts.map +1 -0
  158. package/dist/feedback/progressBar/ProgressBar.variants.d.ts +2 -2
  159. package/dist/feedback/progressSteps/ProgressSteps.d.ts +16 -0
  160. package/dist/feedback/progressSteps/ProgressSteps.d.ts.map +1 -0
  161. package/dist/feedback/progressSteps/index.d.ts +2 -0
  162. package/dist/feedback/progressSteps/index.d.ts.map +1 -0
  163. package/dist/feedback/skeleton/Skeleton.variants.d.ts +2 -2
  164. package/dist/feedback/statusIndicator/StatusIndicator.d.ts +17 -0
  165. package/dist/feedback/statusIndicator/StatusIndicator.d.ts.map +1 -0
  166. package/dist/feedback/statusIndicator/index.d.ts +2 -0
  167. package/dist/feedback/statusIndicator/index.d.ts.map +1 -0
  168. package/dist/feedback/toast/Toast.d.ts +16 -0
  169. package/dist/feedback/toast/Toast.d.ts.map +1 -0
  170. package/dist/feedback/toast/index.d.ts +2 -0
  171. package/dist/feedback/toast/index.d.ts.map +1 -0
  172. package/dist/feedback/toastSimple/ToastSimple.variants.d.ts +2 -2
  173. package/dist/feedback/trendIndicator/TrendIndicator.d.ts +18 -0
  174. package/dist/feedback/trendIndicator/TrendIndicator.d.ts.map +1 -0
  175. package/dist/feedback/trendIndicator/index.d.ts +2 -0
  176. package/dist/feedback/trendIndicator/index.d.ts.map +1 -0
  177. package/dist/forms/_styles.d.ts +2 -2
  178. package/dist/forms/characterCount/CharacterCount.d.ts +15 -0
  179. package/dist/forms/characterCount/CharacterCount.d.ts.map +1 -0
  180. package/dist/forms/characterCount/index.d.ts +2 -0
  181. package/dist/forms/characterCount/index.d.ts.map +1 -0
  182. package/dist/forms/checkboxField/CheckboxField.d.ts +16 -0
  183. package/dist/forms/checkboxField/CheckboxField.d.ts.map +1 -0
  184. package/dist/forms/checkboxField/index.d.ts +2 -0
  185. package/dist/forms/checkboxField/index.d.ts.map +1 -0
  186. package/dist/forms/checkboxGroup/CheckboxGroup.d.ts +24 -0
  187. package/dist/forms/checkboxGroup/CheckboxGroup.d.ts.map +1 -0
  188. package/dist/forms/checkboxGroup/index.d.ts +2 -0
  189. package/dist/forms/checkboxGroup/index.d.ts.map +1 -0
  190. package/dist/forms/choiceCard/ChoiceCard.d.ts +17 -0
  191. package/dist/forms/choiceCard/ChoiceCard.d.ts.map +1 -0
  192. package/dist/forms/choiceCard/index.d.ts +2 -0
  193. package/dist/forms/choiceCard/index.d.ts.map +1 -0
  194. package/dist/forms/currencyInput/CurrencyInput.d.ts +11 -0
  195. package/dist/forms/currencyInput/CurrencyInput.d.ts.map +1 -0
  196. package/dist/forms/currencyInput/index.d.ts +2 -0
  197. package/dist/forms/currencyInput/index.d.ts.map +1 -0
  198. package/dist/forms/filePicker/FilePicker.d.ts +18 -0
  199. package/dist/forms/filePicker/FilePicker.d.ts.map +1 -0
  200. package/dist/forms/filePicker/index.d.ts +2 -0
  201. package/dist/forms/filePicker/index.d.ts.map +1 -0
  202. package/dist/forms/formField/FormField.d.ts +24 -0
  203. package/dist/forms/formField/FormField.d.ts.map +1 -0
  204. package/dist/forms/formField/index.d.ts +2 -0
  205. package/dist/forms/formField/index.d.ts.map +1 -0
  206. package/dist/forms/index.d.ts +17 -0
  207. package/dist/forms/index.d.ts.map +1 -1
  208. package/dist/forms/index.js +5 -4
  209. package/dist/forms/inputAddon/InputAddon.d.ts +16 -0
  210. package/dist/forms/inputAddon/InputAddon.d.ts.map +1 -0
  211. package/dist/forms/inputAddon/index.d.ts +2 -0
  212. package/dist/forms/inputAddon/index.d.ts.map +1 -0
  213. package/dist/forms/inputGroup/InputGroup.d.ts +11 -0
  214. package/dist/forms/inputGroup/InputGroup.d.ts.map +1 -0
  215. package/dist/forms/inputGroup/index.d.ts +2 -0
  216. package/dist/forms/inputGroup/index.d.ts.map +1 -0
  217. package/dist/forms/labeledInput/LabeledInput.d.ts +17 -0
  218. package/dist/forms/labeledInput/LabeledInput.d.ts.map +1 -0
  219. package/dist/forms/labeledInput/index.d.ts +2 -0
  220. package/dist/forms/labeledInput/index.d.ts.map +1 -0
  221. package/dist/forms/maskedInput/MaskedInput.d.ts +17 -0
  222. package/dist/forms/maskedInput/MaskedInput.d.ts.map +1 -0
  223. package/dist/forms/maskedInput/index.d.ts +2 -0
  224. package/dist/forms/maskedInput/index.d.ts.map +1 -0
  225. package/dist/forms/passwordStrength/PasswordStrength.d.ts +15 -0
  226. package/dist/forms/passwordStrength/PasswordStrength.d.ts.map +1 -0
  227. package/dist/forms/passwordStrength/index.d.ts +2 -0
  228. package/dist/forms/passwordStrength/index.d.ts.map +1 -0
  229. package/dist/forms/percentInput/PercentInput.d.ts +8 -0
  230. package/dist/forms/percentInput/PercentInput.d.ts.map +1 -0
  231. package/dist/forms/percentInput/index.d.ts +2 -0
  232. package/dist/forms/percentInput/index.d.ts.map +1 -0
  233. package/dist/forms/pinInput/PinInput.d.ts +26 -0
  234. package/dist/forms/pinInput/PinInput.d.ts.map +1 -0
  235. package/dist/forms/pinInput/index.d.ts +2 -0
  236. package/dist/forms/pinInput/index.d.ts.map +1 -0
  237. package/dist/forms/radioField/RadioField.d.ts +12 -0
  238. package/dist/forms/radioField/RadioField.d.ts.map +1 -0
  239. package/dist/forms/radioField/index.d.ts +2 -0
  240. package/dist/forms/radioField/index.d.ts.map +1 -0
  241. package/dist/forms/radioGroup/RadioGroup.d.ts +19 -0
  242. package/dist/forms/radioGroup/RadioGroup.d.ts.map +1 -0
  243. package/dist/forms/radioGroup/index.d.ts +2 -0
  244. package/dist/forms/radioGroup/index.d.ts.map +1 -0
  245. package/dist/forms/switchField/SwitchField.d.ts +15 -0
  246. package/dist/forms/switchField/SwitchField.d.ts.map +1 -0
  247. package/dist/forms/switchField/index.d.ts +2 -0
  248. package/dist/forms/switchField/index.d.ts.map +1 -0
  249. package/dist/hooks/index.d.ts +1 -0
  250. package/dist/hooks/index.d.ts.map +1 -1
  251. package/dist/hooks/index.js +2 -3
  252. package/dist/hooks/useClipboard.d.ts +21 -0
  253. package/dist/hooks/useClipboard.d.ts.map +1 -0
  254. package/dist/index.css +112 -5
  255. package/dist/index.d.ts +1 -0
  256. package/dist/index.d.ts.map +1 -1
  257. package/dist/index.js +11 -11
  258. package/dist/layout/cluster/Cluster.d.ts +13 -0
  259. package/dist/layout/cluster/Cluster.d.ts.map +1 -0
  260. package/dist/layout/cluster/index.d.ts +2 -0
  261. package/dist/layout/cluster/index.d.ts.map +1 -0
  262. package/dist/layout/frame/Frame.d.ts +17 -0
  263. package/dist/layout/frame/Frame.d.ts.map +1 -0
  264. package/dist/layout/frame/index.d.ts +2 -0
  265. package/dist/layout/frame/index.d.ts.map +1 -0
  266. package/dist/layout/index.d.ts +4 -0
  267. package/dist/layout/index.d.ts.map +1 -1
  268. package/dist/layout/index.js +1 -1
  269. package/dist/layout/inline/Inline.d.ts +13 -0
  270. package/dist/layout/inline/Inline.d.ts.map +1 -0
  271. package/dist/layout/inline/index.d.ts +2 -0
  272. package/dist/layout/inline/index.d.ts.map +1 -0
  273. package/dist/layout/twoColumn/TwoColumn.d.ts +19 -0
  274. package/dist/layout/twoColumn/TwoColumn.d.ts.map +1 -0
  275. package/dist/layout/twoColumn/index.d.ts +2 -0
  276. package/dist/layout/twoColumn/index.d.ts.map +1 -0
  277. package/dist/nav/breadcrumb/Breadcrumb.d.ts +18 -0
  278. package/dist/nav/breadcrumb/Breadcrumb.d.ts.map +1 -0
  279. package/dist/nav/breadcrumb/index.d.ts +2 -0
  280. package/dist/nav/breadcrumb/index.d.ts.map +1 -0
  281. package/dist/nav/index.d.ts +4 -0
  282. package/dist/nav/index.d.ts.map +1 -0
  283. package/dist/nav/index.js +12 -0
  284. package/dist/nav/index.js.map +1 -0
  285. package/dist/nav/navItem/NavItem.d.ts +22 -0
  286. package/dist/nav/navItem/NavItem.d.ts.map +1 -0
  287. package/dist/nav/navItem/index.d.ts +2 -0
  288. package/dist/nav/navItem/index.d.ts.map +1 -0
  289. package/dist/nav/pagination/Pagination.d.ts +19 -0
  290. package/dist/nav/pagination/Pagination.d.ts.map +1 -0
  291. package/dist/nav/pagination/index.d.ts +2 -0
  292. package/dist/nav/pagination/index.d.ts.map +1 -0
  293. package/dist/primitives/index.js +3 -4
  294. package/package.json +5 -1
  295. package/dist/chunk-6NYTRHP7.js.map +0 -1
  296. package/dist/chunk-77WSI427.js.map +0 -1
  297. package/dist/chunk-JTJEI6MF.js +0 -11
  298. package/dist/chunk-JTJEI6MF.js.map +0 -1
  299. package/dist/chunk-L2RYQWZZ.js +0 -120
  300. package/dist/chunk-L2RYQWZZ.js.map +0 -1
  301. package/dist/chunk-MP4OTUFA.js +0 -318
  302. package/dist/chunk-MP4OTUFA.js.map +0 -1
  303. package/dist/chunk-NJZS7RIH.js +0 -604
  304. package/dist/chunk-NJZS7RIH.js.map +0 -1
  305. package/dist/chunk-SYG6ZE42.js.map +0 -1
  306. package/dist/chunk-YLN7VMYU.js +0 -275
  307. package/dist/chunk-YLN7VMYU.js.map +0 -1
@@ -0,0 +1,1119 @@
1
+ import { useFormControl, FormControlProvider } from './chunk-WEM32VIJ.js';
2
+ import { useControlled } from './chunk-4P2TFUVW.js';
3
+ import { useId } from './chunk-KDXJQNB6.js';
4
+ import { tv } from './chunk-BMBIZLO4.js';
5
+ import { Icon } from './chunk-TDX22OWF.js';
6
+ import { cn } from './chunk-KZ4VFY2T.js';
7
+ import * as React from 'react';
8
+ import { forwardRef, useRef, useImperativeHandle, useState, Children, isValidElement, cloneElement, useId as useId$1 } from 'react';
9
+ import { jsxs, jsx } from 'react/jsx-runtime';
10
+ import { Minus, Plus, EyeOff, Eye, Search, X, Check, Upload } from 'lucide-react';
11
+
12
+ var Label = forwardRef(
13
+ ({ className, required, htmlFor, id, children, ...props }, ref) => {
14
+ const ctx = useFormControl();
15
+ const isRequired = required ?? ctx?.isRequired ?? false;
16
+ return /* @__PURE__ */ jsxs(
17
+ "label",
18
+ {
19
+ ref,
20
+ htmlFor: htmlFor ?? ctx?.id,
21
+ id: id ?? ctx?.labelId,
22
+ className: cn(
23
+ "text-sm font-medium text-foreground",
24
+ ctx?.isDisabled && "opacity-60",
25
+ className
26
+ ),
27
+ ...props,
28
+ children: [
29
+ children,
30
+ isRequired && /* @__PURE__ */ jsx("span", { className: "ml-0.5 text-destructive", "aria-hidden": "true", children: "*" })
31
+ ]
32
+ }
33
+ );
34
+ }
35
+ );
36
+ Label.displayName = "Label";
37
+ var FormHelperText = forwardRef(
38
+ ({ className, id, ...props }, ref) => {
39
+ const ctx = useFormControl();
40
+ return /* @__PURE__ */ jsx(
41
+ "p",
42
+ {
43
+ ref,
44
+ id: id ?? ctx?.helperId,
45
+ className: cn("text-sm text-muted-foreground", className),
46
+ ...props
47
+ }
48
+ );
49
+ }
50
+ );
51
+ FormHelperText.displayName = "FormHelperText";
52
+ var FormErrorMessage = forwardRef(
53
+ ({ className, id, ...props }, ref) => {
54
+ const ctx = useFormControl();
55
+ if (ctx && !ctx.isInvalid) return null;
56
+ return /* @__PURE__ */ jsx(
57
+ "p",
58
+ {
59
+ ref,
60
+ id: id ?? ctx?.errorId,
61
+ role: "alert",
62
+ className: cn("text-sm text-destructive", className),
63
+ ...props
64
+ }
65
+ );
66
+ }
67
+ );
68
+ FormErrorMessage.displayName = "FormErrorMessage";
69
+ var Fieldset = forwardRef(
70
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
71
+ "fieldset",
72
+ {
73
+ ref,
74
+ className: cn("m-0 min-w-0 border-0 p-0", className),
75
+ ...props
76
+ }
77
+ )
78
+ );
79
+ Fieldset.displayName = "Fieldset";
80
+ var Legend = forwardRef(
81
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
82
+ "legend",
83
+ {
84
+ ref,
85
+ className: cn("mb-2 text-sm font-medium text-foreground", className),
86
+ ...props
87
+ }
88
+ )
89
+ );
90
+ Legend.displayName = "Legend";
91
+
92
+ // src/forms/_styles.ts
93
+ var inputBaseVariants = tv({
94
+ base: "flex w-full rounded-md border bg-background text-foreground placeholder:text-subtle-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60 read-only:bg-muted",
95
+ variants: {
96
+ size: {
97
+ sm: "h-8 px-2.5 text-sm",
98
+ md: "h-10 px-3 text-sm",
99
+ lg: "h-12 px-4 text-base"
100
+ },
101
+ state: {
102
+ default: "border-input hover:border-border-strong",
103
+ invalid: "border-destructive focus-visible:ring-destructive"
104
+ }
105
+ },
106
+ defaultVariants: {
107
+ size: "md",
108
+ state: "default"
109
+ }
110
+ });
111
+ var TextInput = forwardRef(
112
+ ({ className, size, state, id, disabled, required, readOnly, ...props }, ref) => {
113
+ const ctx = useFormControl();
114
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
115
+ return /* @__PURE__ */ jsx(
116
+ "input",
117
+ {
118
+ ref,
119
+ type: "text",
120
+ id: id ?? ctx?.id,
121
+ disabled: disabled ?? ctx?.isDisabled,
122
+ required: required ?? ctx?.isRequired,
123
+ readOnly: readOnly ?? ctx?.isReadOnly,
124
+ "aria-invalid": ctx?.isInvalid || void 0,
125
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
126
+ className: cn(inputBaseVariants({ size, state: finalState }), className),
127
+ ...props
128
+ }
129
+ );
130
+ }
131
+ );
132
+ TextInput.displayName = "TextInput";
133
+ var EmailInput = forwardRef(
134
+ ({ className, size, state, id, disabled, required, readOnly, ...props }, ref) => {
135
+ const ctx = useFormControl();
136
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
137
+ return /* @__PURE__ */ jsx(
138
+ "input",
139
+ {
140
+ ref,
141
+ type: "email",
142
+ autoComplete: "email",
143
+ inputMode: "email",
144
+ spellCheck: false,
145
+ id: id ?? ctx?.id,
146
+ disabled: disabled ?? ctx?.isDisabled,
147
+ required: required ?? ctx?.isRequired,
148
+ readOnly: readOnly ?? ctx?.isReadOnly,
149
+ "aria-invalid": ctx?.isInvalid || void 0,
150
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
151
+ className: cn(inputBaseVariants({ size, state: finalState }), className),
152
+ ...props
153
+ }
154
+ );
155
+ }
156
+ );
157
+ EmailInput.displayName = "EmailInput";
158
+ var TelInput = forwardRef(
159
+ ({ className, size, state, id, disabled, required, readOnly, ...props }, ref) => {
160
+ const ctx = useFormControl();
161
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
162
+ return /* @__PURE__ */ jsx(
163
+ "input",
164
+ {
165
+ ref,
166
+ type: "tel",
167
+ autoComplete: "tel",
168
+ inputMode: "tel",
169
+ id: id ?? ctx?.id,
170
+ disabled: disabled ?? ctx?.isDisabled,
171
+ required: required ?? ctx?.isRequired,
172
+ readOnly: readOnly ?? ctx?.isReadOnly,
173
+ "aria-invalid": ctx?.isInvalid || void 0,
174
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
175
+ className: cn(inputBaseVariants({ size, state: finalState }), className),
176
+ ...props
177
+ }
178
+ );
179
+ }
180
+ );
181
+ TelInput.displayName = "TelInput";
182
+ var UrlInput = forwardRef(
183
+ ({ className, size, state, id, disabled, required, readOnly, ...props }, ref) => {
184
+ const ctx = useFormControl();
185
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
186
+ return /* @__PURE__ */ jsx(
187
+ "input",
188
+ {
189
+ ref,
190
+ type: "url",
191
+ autoComplete: "url",
192
+ inputMode: "url",
193
+ spellCheck: false,
194
+ id: id ?? ctx?.id,
195
+ disabled: disabled ?? ctx?.isDisabled,
196
+ required: required ?? ctx?.isRequired,
197
+ readOnly: readOnly ?? ctx?.isReadOnly,
198
+ "aria-invalid": ctx?.isInvalid || void 0,
199
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
200
+ className: cn(inputBaseVariants({ size, state: finalState }), className),
201
+ ...props
202
+ }
203
+ );
204
+ }
205
+ );
206
+ UrlInput.displayName = "UrlInput";
207
+ var NumberInput = forwardRef(
208
+ ({ className, size, state, id, disabled, required, readOnly, step = 1, ...props }, forwardedRef) => {
209
+ const ctx = useFormControl();
210
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
211
+ const inputRef = useRef(null);
212
+ useImperativeHandle(forwardedRef, () => inputRef.current);
213
+ const adjust = (direction) => {
214
+ const el = inputRef.current;
215
+ if (!el || typeof el.stepUp !== "function") return;
216
+ if (direction === 1) el.stepUp(step);
217
+ else el.stepDown(step);
218
+ el.dispatchEvent(new Event("input", { bubbles: true }));
219
+ el.dispatchEvent(new Event("change", { bubbles: true }));
220
+ };
221
+ const isDisabled = disabled ?? ctx?.isDisabled ?? false;
222
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
223
+ /* @__PURE__ */ jsx(
224
+ "input",
225
+ {
226
+ ref: inputRef,
227
+ type: "number",
228
+ inputMode: "decimal",
229
+ step,
230
+ id: id ?? ctx?.id,
231
+ disabled: isDisabled,
232
+ required: required ?? ctx?.isRequired,
233
+ readOnly: readOnly ?? ctx?.isReadOnly,
234
+ "aria-invalid": ctx?.isInvalid || void 0,
235
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
236
+ className: cn(inputBaseVariants({ size, state: finalState }), "pr-12 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"),
237
+ ...props
238
+ }
239
+ ),
240
+ /* @__PURE__ */ jsxs("div", { className: "absolute right-1 top-1/2 flex -translate-y-1/2 items-center", children: [
241
+ /* @__PURE__ */ jsx(
242
+ "button",
243
+ {
244
+ type: "button",
245
+ disabled: isDisabled,
246
+ onClick: () => adjust(-1),
247
+ "aria-label": "Decrement",
248
+ className: "grid h-7 w-6 place-items-center rounded text-muted-foreground hover:bg-muted disabled:opacity-50",
249
+ children: /* @__PURE__ */ jsx(Icon, { icon: Minus, size: 14 })
250
+ }
251
+ ),
252
+ /* @__PURE__ */ jsx(
253
+ "button",
254
+ {
255
+ type: "button",
256
+ disabled: isDisabled,
257
+ onClick: () => adjust(1),
258
+ "aria-label": "Increment",
259
+ className: "grid h-7 w-6 place-items-center rounded text-muted-foreground hover:bg-muted disabled:opacity-50",
260
+ children: /* @__PURE__ */ jsx(Icon, { icon: Plus, size: 14 })
261
+ }
262
+ )
263
+ ] })
264
+ ] });
265
+ }
266
+ );
267
+ NumberInput.displayName = "NumberInput";
268
+ var PasswordInput = forwardRef(
269
+ ({
270
+ className,
271
+ size,
272
+ state,
273
+ id,
274
+ disabled,
275
+ required,
276
+ readOnly,
277
+ toggleable = true,
278
+ autoComplete = "current-password",
279
+ ...props
280
+ }, ref) => {
281
+ const [visible, setVisible] = useState(false);
282
+ const ctx = useFormControl();
283
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
284
+ const isDisabled = disabled ?? ctx?.isDisabled ?? false;
285
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
286
+ /* @__PURE__ */ jsx(
287
+ "input",
288
+ {
289
+ ref,
290
+ type: visible ? "text" : "password",
291
+ autoComplete,
292
+ spellCheck: false,
293
+ id: id ?? ctx?.id,
294
+ disabled: isDisabled,
295
+ required: required ?? ctx?.isRequired,
296
+ readOnly: readOnly ?? ctx?.isReadOnly,
297
+ "aria-invalid": ctx?.isInvalid || void 0,
298
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
299
+ className: cn(inputBaseVariants({ size, state: finalState }), toggleable && "pr-10"),
300
+ ...props
301
+ }
302
+ ),
303
+ toggleable && /* @__PURE__ */ jsx(
304
+ "button",
305
+ {
306
+ type: "button",
307
+ disabled: isDisabled,
308
+ onClick: () => setVisible((v) => !v),
309
+ "aria-label": visible ? "Hide password" : "Show password",
310
+ "aria-pressed": visible,
311
+ className: "absolute right-1 top-1/2 grid h-8 w-8 -translate-y-1/2 place-items-center rounded text-muted-foreground hover:bg-muted disabled:opacity-50",
312
+ children: /* @__PURE__ */ jsx(Icon, { icon: visible ? EyeOff : Eye, size: 16 })
313
+ }
314
+ )
315
+ ] });
316
+ }
317
+ );
318
+ PasswordInput.displayName = "PasswordInput";
319
+ var SearchInput = forwardRef(
320
+ ({
321
+ className,
322
+ size,
323
+ state,
324
+ id,
325
+ disabled,
326
+ required,
327
+ readOnly,
328
+ clearable = true,
329
+ onClear,
330
+ onChange,
331
+ defaultValue,
332
+ value,
333
+ ...props
334
+ }, forwardedRef) => {
335
+ const ctx = useFormControl();
336
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
337
+ const isDisabled = disabled ?? ctx?.isDisabled ?? false;
338
+ const inputRef = useRef(null);
339
+ useImperativeHandle(forwardedRef, () => inputRef.current);
340
+ const isControlled = value !== void 0;
341
+ const [uncontrolled, setUncontrolled] = useState(defaultValue ?? "");
342
+ const currentValue = isControlled ? value : uncontrolled;
343
+ const showClear = clearable && String(currentValue ?? "").length > 0;
344
+ const handleClear = () => {
345
+ const el = inputRef.current;
346
+ if (el) {
347
+ const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
348
+ setter?.call(el, "");
349
+ el.dispatchEvent(new Event("input", { bubbles: true }));
350
+ el.focus();
351
+ }
352
+ if (!isControlled) setUncontrolled("");
353
+ onClear?.();
354
+ };
355
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
356
+ /* @__PURE__ */ jsx(
357
+ Icon,
358
+ {
359
+ icon: Search,
360
+ size: 16,
361
+ className: "absolute left-3 top-1/2 -translate-y-1/2 text-subtle-foreground"
362
+ }
363
+ ),
364
+ /* @__PURE__ */ jsx(
365
+ "input",
366
+ {
367
+ ref: inputRef,
368
+ type: "search",
369
+ id: id ?? ctx?.id,
370
+ value: isControlled ? value : void 0,
371
+ defaultValue: !isControlled ? defaultValue : void 0,
372
+ onChange: (e) => {
373
+ if (!isControlled) setUncontrolled(e.target.value);
374
+ onChange?.(e);
375
+ },
376
+ disabled: isDisabled,
377
+ required: required ?? ctx?.isRequired,
378
+ readOnly: readOnly ?? ctx?.isReadOnly,
379
+ "aria-invalid": ctx?.isInvalid || void 0,
380
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
381
+ className: cn(
382
+ inputBaseVariants({ size, state: finalState }),
383
+ "pl-9",
384
+ showClear && "pr-9",
385
+ "[&::-webkit-search-cancel-button]:appearance-none"
386
+ ),
387
+ ...props
388
+ }
389
+ ),
390
+ showClear && /* @__PURE__ */ jsx(
391
+ "button",
392
+ {
393
+ type: "button",
394
+ disabled: isDisabled,
395
+ onClick: handleClear,
396
+ "aria-label": "Clear search",
397
+ className: "absolute right-1 top-1/2 grid h-8 w-8 -translate-y-1/2 place-items-center rounded text-subtle-foreground hover:bg-muted hover:text-muted-foreground",
398
+ children: /* @__PURE__ */ jsx(Icon, { icon: X, size: 14 })
399
+ }
400
+ )
401
+ ] });
402
+ }
403
+ );
404
+ SearchInput.displayName = "SearchInput";
405
+ var Textarea = forwardRef(
406
+ ({ className, size, state, id, disabled, required, readOnly, rows = 3, ...props }, ref) => {
407
+ const ctx = useFormControl();
408
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
409
+ return /* @__PURE__ */ jsx(
410
+ "textarea",
411
+ {
412
+ ref,
413
+ rows,
414
+ id: id ?? ctx?.id,
415
+ disabled: disabled ?? ctx?.isDisabled,
416
+ required: required ?? ctx?.isRequired,
417
+ readOnly: readOnly ?? ctx?.isReadOnly,
418
+ "aria-invalid": ctx?.isInvalid || void 0,
419
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
420
+ className: cn(
421
+ inputBaseVariants({ size, state: finalState }),
422
+ "h-auto resize-y py-2",
423
+ className
424
+ ),
425
+ ...props
426
+ }
427
+ );
428
+ }
429
+ );
430
+ Textarea.displayName = "Textarea";
431
+ var SIZE_CLASS = {
432
+ sm: "h-4 w-4",
433
+ md: "h-5 w-5",
434
+ lg: "h-6 w-6"
435
+ };
436
+ var Checkbox = forwardRef(
437
+ ({ className, size = "md", indeterminate, id, disabled, required, checked, ...props }, ref) => {
438
+ const ctx = useFormControl();
439
+ const isDisabled = disabled ?? ctx?.isDisabled;
440
+ return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex shrink-0", SIZE_CLASS[size], className), children: [
441
+ /* @__PURE__ */ jsx(
442
+ "input",
443
+ {
444
+ ref,
445
+ type: "checkbox",
446
+ id: id ?? ctx?.id,
447
+ disabled: isDisabled,
448
+ required: required ?? ctx?.isRequired,
449
+ checked,
450
+ "aria-invalid": ctx?.isInvalid || void 0,
451
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
452
+ className: "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
453
+ ...props
454
+ }
455
+ ),
456
+ /* @__PURE__ */ jsx(
457
+ "span",
458
+ {
459
+ "aria-hidden": "true",
460
+ className: cn(
461
+ "pointer-events-none grid h-full w-full place-items-center rounded-sm border border-input bg-background text-primary-foreground transition-colors",
462
+ "peer-checked:border-primary peer-checked:bg-primary",
463
+ "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-1",
464
+ "peer-disabled:opacity-50",
465
+ indeterminate && "border-primary bg-primary"
466
+ ),
467
+ children: indeterminate ? /* @__PURE__ */ jsx(Minus, { size: Math.round(SIZE_CLASS[size].length * 1.4), className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 opacity-0 peer-checked:opacity-100" })
468
+ }
469
+ )
470
+ ] });
471
+ }
472
+ );
473
+ Checkbox.displayName = "Checkbox";
474
+ var SIZE_CLASS2 = {
475
+ sm: "h-4 w-4",
476
+ md: "h-5 w-5",
477
+ lg: "h-6 w-6"
478
+ };
479
+ var Radio = forwardRef(
480
+ ({ className, size = "md", id, disabled, required, ...props }, ref) => {
481
+ const ctx = useFormControl();
482
+ return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex shrink-0", SIZE_CLASS2[size], className), children: [
483
+ /* @__PURE__ */ jsx(
484
+ "input",
485
+ {
486
+ ref,
487
+ type: "radio",
488
+ id: id ?? ctx?.id,
489
+ disabled: disabled ?? ctx?.isDisabled,
490
+ required: required ?? ctx?.isRequired,
491
+ "aria-invalid": ctx?.isInvalid || void 0,
492
+ className: "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
493
+ ...props
494
+ }
495
+ ),
496
+ /* @__PURE__ */ jsx(
497
+ "span",
498
+ {
499
+ "aria-hidden": "true",
500
+ className: cn(
501
+ "pointer-events-none grid h-full w-full place-items-center rounded-full border border-input bg-background transition-colors",
502
+ "peer-checked:border-primary",
503
+ "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-1",
504
+ "peer-disabled:opacity-50"
505
+ ),
506
+ children: /* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-primary opacity-0 peer-checked:opacity-100" })
507
+ }
508
+ )
509
+ ] });
510
+ }
511
+ );
512
+ Radio.displayName = "Radio";
513
+ var TRACK_CLASS = {
514
+ sm: "h-4 w-7",
515
+ md: "h-5 w-9",
516
+ lg: "h-6 w-11"
517
+ };
518
+ var THUMB_CLASS = {
519
+ sm: "h-3 w-3 peer-checked:translate-x-3",
520
+ md: "h-4 w-4 peer-checked:translate-x-4",
521
+ lg: "h-5 w-5 peer-checked:translate-x-5"
522
+ };
523
+ var Switch = forwardRef(
524
+ ({ className, size = "md", id, disabled, required, ...props }, ref) => {
525
+ const ctx = useFormControl();
526
+ return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex shrink-0", TRACK_CLASS[size], className), children: [
527
+ /* @__PURE__ */ jsx(
528
+ "input",
529
+ {
530
+ ref,
531
+ type: "checkbox",
532
+ role: "switch",
533
+ id: id ?? ctx?.id,
534
+ disabled: disabled ?? ctx?.isDisabled,
535
+ required: required ?? ctx?.isRequired,
536
+ "aria-invalid": ctx?.isInvalid || void 0,
537
+ className: "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
538
+ ...props
539
+ }
540
+ ),
541
+ /* @__PURE__ */ jsx(
542
+ "span",
543
+ {
544
+ "aria-hidden": "true",
545
+ className: cn(
546
+ "pointer-events-none flex h-full w-full items-center rounded-full bg-input px-0.5 transition-colors",
547
+ "peer-checked:bg-primary",
548
+ "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-1",
549
+ "peer-disabled:opacity-50"
550
+ ),
551
+ children: /* @__PURE__ */ jsx(
552
+ "span",
553
+ {
554
+ className: cn(
555
+ "rounded-full bg-background shadow-sm transition-transform duration-150",
556
+ THUMB_CLASS[size]
557
+ )
558
+ }
559
+ )
560
+ }
561
+ )
562
+ ] });
563
+ }
564
+ );
565
+ Switch.displayName = "Switch";
566
+ var TRACK_CLASS2 = {
567
+ sm: "h-1",
568
+ md: "h-1.5",
569
+ lg: "h-2"
570
+ };
571
+ var Slider = forwardRef(
572
+ ({ className, size = "md", id, disabled, required, min = 0, max = 100, ...props }, ref) => {
573
+ const ctx = useFormControl();
574
+ return /* @__PURE__ */ jsx(
575
+ "input",
576
+ {
577
+ ref,
578
+ type: "range",
579
+ id: id ?? ctx?.id,
580
+ disabled: disabled ?? ctx?.isDisabled,
581
+ required: required ?? ctx?.isRequired,
582
+ min,
583
+ max,
584
+ "aria-invalid": ctx?.isInvalid || void 0,
585
+ className: cn(
586
+ "w-full appearance-none bg-transparent disabled:cursor-not-allowed disabled:opacity-50",
587
+ // WebKit
588
+ "[&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-muted",
589
+ `[&::-webkit-slider-runnable-track]:${TRACK_CLASS2[size]}`,
590
+ "[&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background",
591
+ // Firefox
592
+ `[&::-moz-range-track]:${TRACK_CLASS2[size]}`,
593
+ "[&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-muted",
594
+ "[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary [&::-moz-range-thumb]:bg-background",
595
+ "focus-visible:outline-none focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-ring",
596
+ className
597
+ ),
598
+ ...props
599
+ }
600
+ );
601
+ }
602
+ );
603
+ Slider.displayName = "Slider";
604
+ var FormField = forwardRef(
605
+ ({ label, helper, error, isRequired, isDisabled, isReadOnly, children, className, ...props }, ref) => /* @__PURE__ */ jsx(
606
+ FormControlProvider,
607
+ {
608
+ isInvalid: Boolean(error),
609
+ isRequired,
610
+ isDisabled,
611
+ isReadOnly,
612
+ children: /* @__PURE__ */ jsxs(
613
+ "div",
614
+ {
615
+ ref,
616
+ className: cn("flex flex-col gap-1.5", className),
617
+ ...props,
618
+ children: [
619
+ label && /* @__PURE__ */ jsx(Label, { children: label }),
620
+ children,
621
+ error ? /* @__PURE__ */ jsx(FormErrorMessage, { children: error }) : helper && /* @__PURE__ */ jsx(FormHelperText, { children: helper })
622
+ ]
623
+ }
624
+ )
625
+ }
626
+ )
627
+ );
628
+ FormField.displayName = "FormField";
629
+ var CheckboxField = forwardRef(
630
+ ({ label, description, id, wrapperClassName, className, ...props }, ref) => {
631
+ const generated = useId();
632
+ const inputId = id ?? generated;
633
+ return /* @__PURE__ */ jsxs(
634
+ "label",
635
+ {
636
+ htmlFor: inputId,
637
+ className: cn("flex items-start gap-2.5 cursor-pointer", wrapperClassName),
638
+ children: [
639
+ /* @__PURE__ */ jsx(Checkbox, { ref, id: inputId, className, ...props }),
640
+ /* @__PURE__ */ jsxs("span", { className: "flex flex-col gap-0.5 text-sm", children: [
641
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: label }),
642
+ description && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: description })
643
+ ] })
644
+ ]
645
+ }
646
+ );
647
+ }
648
+ );
649
+ CheckboxField.displayName = "CheckboxField";
650
+ var RadioField = forwardRef(
651
+ ({ label, description, id, wrapperClassName, className, ...props }, ref) => {
652
+ const generated = useId();
653
+ const inputId = id ?? generated;
654
+ return /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: cn("flex items-start gap-2.5 cursor-pointer", wrapperClassName), children: [
655
+ /* @__PURE__ */ jsx(Radio, { ref, id: inputId, className, ...props }),
656
+ /* @__PURE__ */ jsxs("span", { className: "flex flex-col gap-0.5 text-sm", children: [
657
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: label }),
658
+ description && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: description })
659
+ ] })
660
+ ] });
661
+ }
662
+ );
663
+ RadioField.displayName = "RadioField";
664
+ var SwitchField = forwardRef(
665
+ ({ label, description, side = "left", id, wrapperClassName, className, ...props }, ref) => {
666
+ const generated = useId();
667
+ const inputId = id ?? generated;
668
+ const text = /* @__PURE__ */ jsxs("span", { className: "flex flex-col gap-0.5 text-sm", children: [
669
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: label }),
670
+ description && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: description })
671
+ ] });
672
+ return /* @__PURE__ */ jsxs(
673
+ "label",
674
+ {
675
+ htmlFor: inputId,
676
+ className: cn(
677
+ "flex cursor-pointer items-start gap-3",
678
+ side === "right" && "flex-row-reverse justify-between",
679
+ wrapperClassName
680
+ ),
681
+ children: [
682
+ /* @__PURE__ */ jsx(Switch, { ref, id: inputId, className, ...props }),
683
+ text
684
+ ]
685
+ }
686
+ );
687
+ }
688
+ );
689
+ SwitchField.displayName = "SwitchField";
690
+ var CheckboxGroup = forwardRef(
691
+ ({
692
+ legend,
693
+ value,
694
+ defaultValue,
695
+ onValueChange,
696
+ isDisabled,
697
+ orientation = "vertical",
698
+ className,
699
+ children,
700
+ ...props
701
+ }, ref) => {
702
+ const [selected, setSelected] = useControlled({
703
+ controlled: value,
704
+ default: defaultValue ?? [],
705
+ onChange: onValueChange
706
+ });
707
+ const toggle = (v) => {
708
+ if (v === void 0) return;
709
+ setSelected(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);
710
+ };
711
+ return /* @__PURE__ */ jsxs(Fieldset, { ref, disabled: isDisabled, className: cn(className), ...props, children: [
712
+ legend && /* @__PURE__ */ jsx(Legend, { children: legend }),
713
+ /* @__PURE__ */ jsx("div", { className: cn("flex gap-3", orientation === "vertical" ? "flex-col" : "flex-row flex-wrap"), children: Children.map(children, (child) => {
714
+ if (!isValidElement(child)) return child;
715
+ const c = child;
716
+ const v = c.props.value;
717
+ return cloneElement(c, {
718
+ checked: v !== void 0 && selected.includes(v),
719
+ onChange: () => toggle(v)
720
+ });
721
+ }) })
722
+ ] });
723
+ }
724
+ );
725
+ CheckboxGroup.displayName = "CheckboxGroup";
726
+ var RadioGroup = forwardRef(
727
+ ({
728
+ legend,
729
+ name,
730
+ value,
731
+ defaultValue,
732
+ onValueChange,
733
+ isDisabled,
734
+ orientation = "vertical",
735
+ className,
736
+ children,
737
+ ...props
738
+ }, ref) => {
739
+ const generatedName = useId$1();
740
+ const groupName = name ?? generatedName;
741
+ const [selected, setSelected] = useControlled({
742
+ controlled: value,
743
+ default: defaultValue ?? null,
744
+ onChange: onValueChange
745
+ });
746
+ return /* @__PURE__ */ jsxs(Fieldset, { ref, disabled: isDisabled, className: cn(className), ...props, children: [
747
+ legend && /* @__PURE__ */ jsx(Legend, { children: legend }),
748
+ /* @__PURE__ */ jsx("div", { className: cn("flex gap-3", orientation === "vertical" ? "flex-col" : "flex-row flex-wrap"), children: Children.map(children, (child) => {
749
+ if (!isValidElement(child)) return child;
750
+ const c = child;
751
+ const v = c.props.value;
752
+ return cloneElement(c, {
753
+ name: groupName,
754
+ checked: v !== void 0 && selected === v,
755
+ onChange: () => setSelected(v ?? null)
756
+ });
757
+ }) })
758
+ ] });
759
+ }
760
+ );
761
+ RadioGroup.displayName = "RadioGroup";
762
+ var SIZE = {
763
+ sm: "h-9 w-9 text-base",
764
+ md: "h-11 w-11 text-lg",
765
+ lg: "h-14 w-14 text-xl"
766
+ };
767
+ var PinInput = forwardRef(
768
+ ({
769
+ length = 6,
770
+ value,
771
+ defaultValue,
772
+ onValueChange,
773
+ onComplete,
774
+ type = "numeric",
775
+ size = "md",
776
+ mask,
777
+ isDisabled,
778
+ className,
779
+ ...props
780
+ }, ref) => {
781
+ const [val, setVal] = useControlled({
782
+ controlled: value,
783
+ default: defaultValue ?? "",
784
+ onChange: onValueChange
785
+ });
786
+ const cells = Array.from({ length }, (_, i) => val[i] ?? "");
787
+ const inputs = useRef([]);
788
+ const wrapperRef = useRef(null);
789
+ useImperativeHandle(ref, () => wrapperRef.current);
790
+ const isAllowed = (ch) => type === "numeric" ? /^[0-9]$/.test(ch) : /^[A-Za-z0-9]$/.test(ch);
791
+ const update = (next) => {
792
+ const trimmed = next.slice(0, length);
793
+ setVal(trimmed);
794
+ if (trimmed.length === length) onComplete?.(trimmed);
795
+ };
796
+ const handleChange = (i, raw) => {
797
+ const ch = raw.slice(-1);
798
+ if (ch && !isAllowed(ch)) return;
799
+ const arr = cells.slice();
800
+ arr[i] = ch;
801
+ const next = arr.join("").slice(0, length);
802
+ update(next);
803
+ if (ch && i < length - 1) inputs.current[i + 1]?.focus();
804
+ };
805
+ const handleKeyDown = (i, e) => {
806
+ if (e.key === "Backspace" && !cells[i] && i > 0) {
807
+ inputs.current[i - 1]?.focus();
808
+ } else if (e.key === "ArrowLeft" && i > 0) {
809
+ e.preventDefault();
810
+ inputs.current[i - 1]?.focus();
811
+ } else if (e.key === "ArrowRight" && i < length - 1) {
812
+ e.preventDefault();
813
+ inputs.current[i + 1]?.focus();
814
+ }
815
+ };
816
+ const handlePaste = (e) => {
817
+ const pasted = e.clipboardData.getData("text").replace(/\s+/g, "");
818
+ const filtered = pasted.split("").filter(isAllowed).join("");
819
+ if (filtered) {
820
+ e.preventDefault();
821
+ update(filtered);
822
+ const focusIdx = Math.min(filtered.length, length - 1);
823
+ inputs.current[focusIdx]?.focus();
824
+ }
825
+ };
826
+ return /* @__PURE__ */ jsx("div", { ref: wrapperRef, className: cn("inline-flex gap-2", className), ...props, children: cells.map((ch, i) => /* @__PURE__ */ jsx(
827
+ "input",
828
+ {
829
+ ref: (el) => {
830
+ inputs.current[i] = el;
831
+ },
832
+ type: mask ? "password" : "text",
833
+ inputMode: type === "numeric" ? "numeric" : "text",
834
+ autoComplete: "one-time-code",
835
+ maxLength: 1,
836
+ disabled: isDisabled,
837
+ value: ch,
838
+ onChange: (e) => handleChange(i, e.target.value),
839
+ onKeyDown: (e) => handleKeyDown(i, e),
840
+ onPaste: handlePaste,
841
+ className: cn(
842
+ inputBaseVariants({ state: "default" }),
843
+ "text-center font-medium",
844
+ SIZE[size]
845
+ )
846
+ },
847
+ i
848
+ )) });
849
+ }
850
+ );
851
+ PinInput.displayName = "PinInput";
852
+ function applyMask(raw, mask) {
853
+ let out = "";
854
+ let r = 0;
855
+ for (let m = 0; m < mask.length && r < raw.length; m++) {
856
+ const tok = mask[m];
857
+ const ch = raw[r];
858
+ if (!tok || !ch) break;
859
+ if (tok === "#") {
860
+ if (/[0-9]/.test(ch)) {
861
+ out += ch;
862
+ r++;
863
+ } else {
864
+ r++;
865
+ m--;
866
+ }
867
+ } else if (tok === "A") {
868
+ if (/[A-Za-z]/.test(ch)) {
869
+ out += ch;
870
+ r++;
871
+ } else {
872
+ r++;
873
+ m--;
874
+ }
875
+ } else if (tok === "*") {
876
+ if (/[A-Za-z0-9]/.test(ch)) {
877
+ out += ch;
878
+ r++;
879
+ } else {
880
+ r++;
881
+ m--;
882
+ }
883
+ } else {
884
+ out += tok;
885
+ if (ch === tok) r++;
886
+ }
887
+ }
888
+ return out;
889
+ }
890
+ var MaskedInput = forwardRef(
891
+ ({ className, size, state, mask, value, defaultValue, onValueChange, id, disabled, required, readOnly, ...props }, ref) => {
892
+ const ctx = useFormControl();
893
+ const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
894
+ const [val, setVal] = useControlled({
895
+ controlled: value,
896
+ default: defaultValue ?? "",
897
+ onChange: onValueChange
898
+ });
899
+ return /* @__PURE__ */ jsx(
900
+ "input",
901
+ {
902
+ ref,
903
+ type: "text",
904
+ value: val,
905
+ onChange: (e) => setVal(applyMask(e.target.value, mask)),
906
+ id: id ?? ctx?.id,
907
+ disabled: disabled ?? ctx?.isDisabled,
908
+ required: required ?? ctx?.isRequired,
909
+ readOnly: readOnly ?? ctx?.isReadOnly,
910
+ "aria-invalid": ctx?.isInvalid || void 0,
911
+ "aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
912
+ className: cn(inputBaseVariants({ size, state: finalState }), className),
913
+ ...props
914
+ }
915
+ );
916
+ }
917
+ );
918
+ MaskedInput.displayName = "MaskedInput";
919
+ var CurrencyInput = forwardRef(
920
+ ({ symbol = "$", className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
921
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground", children: symbol }),
922
+ /* @__PURE__ */ jsx(NumberInput, { ref, ...props, className: "pl-7" })
923
+ ] })
924
+ );
925
+ CurrencyInput.displayName = "CurrencyInput";
926
+ var PercentInput = forwardRef(
927
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
928
+ /* @__PURE__ */ jsx(NumberInput, { ref, ...props, className: "pr-16" }),
929
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-12 top-1/2 -translate-y-1/2 text-sm text-muted-foreground", children: "%" })
930
+ ] })
931
+ );
932
+ PercentInput.displayName = "PercentInput";
933
+ var CharacterCount = forwardRef(
934
+ ({ value, max, showMax = true, className, ...props }, ref) => {
935
+ const over = value > max;
936
+ return /* @__PURE__ */ jsxs(
937
+ "div",
938
+ {
939
+ ref,
940
+ "aria-live": "polite",
941
+ className: cn(
942
+ "text-right text-xs",
943
+ over ? "text-destructive" : "text-muted-foreground",
944
+ className
945
+ ),
946
+ ...props,
947
+ children: [
948
+ value,
949
+ showMax && ` / ${max}`
950
+ ]
951
+ }
952
+ );
953
+ }
954
+ );
955
+ CharacterCount.displayName = "CharacterCount";
956
+ var InputAddon = forwardRef(
957
+ ({ leading, trailing, children, className, ...props }, ref) => /* @__PURE__ */ jsxs(
958
+ "div",
959
+ {
960
+ ref,
961
+ className: cn(
962
+ "inline-flex w-full items-stretch [&>*]:rounded-none",
963
+ "[&>*:first-child]:rounded-l-md [&>*:last-child]:rounded-r-md",
964
+ "[&>*:not(:first-child)]:-ml-px",
965
+ className
966
+ ),
967
+ ...props,
968
+ children: [
969
+ leading && /* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0 items-center border border-input bg-muted px-3 text-sm text-muted-foreground", children: leading }),
970
+ children,
971
+ trailing && /* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0 items-center border border-input bg-muted px-3 text-sm text-muted-foreground", children: trailing })
972
+ ]
973
+ }
974
+ )
975
+ );
976
+ InputAddon.displayName = "InputAddon";
977
+ var InputGroup = forwardRef(
978
+ ({ orientation = "horizontal", className, ...props }, ref) => /* @__PURE__ */ jsx(
979
+ "div",
980
+ {
981
+ ref,
982
+ className: cn(
983
+ "inline-flex w-full",
984
+ orientation === "horizontal" ? "flex-row" : "flex-col",
985
+ orientation === "horizontal" ? "[&>*]:rounded-none [&>*:first-child]:rounded-l-md [&>*:last-child]:rounded-r-md [&>*:not(:first-child)]:-ml-px" : "[&>*]:rounded-none [&>*:first-child]:rounded-t-md [&>*:last-child]:rounded-b-md [&>*:not(:first-child)]:-mt-px",
986
+ className
987
+ ),
988
+ ...props
989
+ }
990
+ )
991
+ );
992
+ InputGroup.displayName = "InputGroup";
993
+ var LabeledInput = forwardRef(
994
+ ({ label, children, trailing, className, ...props }, ref) => {
995
+ const generated = useId();
996
+ const id = children.props.id ?? generated;
997
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1.5", className), ...props, children: [
998
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
999
+ /* @__PURE__ */ jsx(Label, { htmlFor: id, children: label }),
1000
+ trailing && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: trailing })
1001
+ ] }),
1002
+ React.cloneElement(children, { id })
1003
+ ] });
1004
+ }
1005
+ );
1006
+ LabeledInput.displayName = "LabeledInput";
1007
+ var SIZE2 = {
1008
+ sm: "p-3 text-xs",
1009
+ md: "p-4 text-sm",
1010
+ lg: "p-5 text-base"
1011
+ };
1012
+ var ChoiceCard = forwardRef(
1013
+ ({ label, description, icon, size = "md", id, className, ...props }, ref) => {
1014
+ const generated = useId();
1015
+ const inputId = id ?? generated;
1016
+ return /* @__PURE__ */ jsxs(
1017
+ "label",
1018
+ {
1019
+ htmlFor: inputId,
1020
+ className: cn(
1021
+ "group relative block cursor-pointer rounded-lg border border-input bg-card text-card-foreground transition-colors",
1022
+ "hover:border-border-strong has-[:checked]:border-primary has-[:checked]:bg-primary-soft/30",
1023
+ "has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring",
1024
+ SIZE2[size],
1025
+ className
1026
+ ),
1027
+ children: [
1028
+ /* @__PURE__ */ jsx(Radio, { ref, id: inputId, className: "absolute right-3 top-3", ...props }),
1029
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 pr-7", children: [
1030
+ icon && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: icon }),
1031
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
1032
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-foreground", children: label }),
1033
+ description && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-muted-foreground", children: description })
1034
+ ] })
1035
+ ] })
1036
+ ]
1037
+ }
1038
+ );
1039
+ }
1040
+ );
1041
+ ChoiceCard.displayName = "ChoiceCard";
1042
+ var LABELS = ["Too weak", "Weak", "Fair", "Strong", "Excellent"];
1043
+ var TONE = ["bg-destructive", "bg-destructive", "bg-warning", "bg-success", "bg-success"];
1044
+ function scorePassword(pw) {
1045
+ let score = 0;
1046
+ if (pw.length >= 8) score++;
1047
+ if (pw.length >= 12) score++;
1048
+ if (/[a-z]/.test(pw) && /[A-Z]/.test(pw)) score++;
1049
+ if (/\d/.test(pw)) score++;
1050
+ if (/[^A-Za-z0-9]/.test(pw)) score++;
1051
+ return Math.min(4, score);
1052
+ }
1053
+ var PasswordStrength = forwardRef(
1054
+ ({ value, score, hideLabel, className, ...props }, ref) => {
1055
+ const s = score ?? (value.length === 0 ? 0 : scorePassword(value));
1056
+ const label = LABELS[s] ?? "";
1057
+ const tone = TONE[s] ?? "bg-destructive";
1058
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
1059
+ /* @__PURE__ */ jsx("div", { className: "flex gap-1", "aria-hidden": "true", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx(
1060
+ "div",
1061
+ {
1062
+ className: cn(
1063
+ "h-1 flex-1 rounded-full bg-muted transition-colors",
1064
+ i < s && tone
1065
+ )
1066
+ },
1067
+ i
1068
+ )) }),
1069
+ !hideLabel && value && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: label })
1070
+ ] });
1071
+ }
1072
+ );
1073
+ PasswordStrength.displayName = "PasswordStrength";
1074
+ var SIZE3 = {
1075
+ sm: "h-8 px-3 text-sm",
1076
+ md: "h-10 px-4 text-sm",
1077
+ lg: "h-12 px-6 text-base"
1078
+ };
1079
+ var FilePicker = forwardRef(
1080
+ ({ label = "Choose file", onFilesChange, preview, size = "md", className, disabled, ...props }, ref) => {
1081
+ const inputRef = useRef(null);
1082
+ useImperativeHandle(ref, () => inputRef.current);
1083
+ return /* @__PURE__ */ jsxs("div", { className: cn("inline-flex items-center gap-3", className), children: [
1084
+ /* @__PURE__ */ jsxs(
1085
+ "button",
1086
+ {
1087
+ type: "button",
1088
+ disabled,
1089
+ onClick: () => inputRef.current?.click(),
1090
+ className: cn(
1091
+ "inline-flex items-center gap-2 rounded-md border border-input bg-background font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1092
+ SIZE3[size]
1093
+ ),
1094
+ children: [
1095
+ /* @__PURE__ */ jsx(Icon, { icon: Upload, size: 16 }),
1096
+ label
1097
+ ]
1098
+ }
1099
+ ),
1100
+ /* @__PURE__ */ jsx(
1101
+ "input",
1102
+ {
1103
+ ref: inputRef,
1104
+ type: "file",
1105
+ disabled,
1106
+ className: "sr-only",
1107
+ onChange: (e) => onFilesChange?.(e.target.files),
1108
+ ...props
1109
+ }
1110
+ ),
1111
+ preview && /* @__PURE__ */ jsx("span", { className: "truncate text-sm text-muted-foreground", children: preview })
1112
+ ] });
1113
+ }
1114
+ );
1115
+ FilePicker.displayName = "FilePicker";
1116
+
1117
+ export { CharacterCount, Checkbox, CheckboxField, CheckboxGroup, ChoiceCard, CurrencyInput, EmailInput, Fieldset, FilePicker, FormErrorMessage, FormField, FormHelperText, InputAddon, InputGroup, Label, LabeledInput, Legend, MaskedInput, NumberInput, PasswordInput, PasswordStrength, PercentInput, PinInput, Radio, RadioField, RadioGroup, SearchInput, Slider, Switch, SwitchField, TelInput, TextInput, Textarea, UrlInput };
1118
+ //# sourceMappingURL=chunk-X2LTOZ7F.js.map
1119
+ //# sourceMappingURL=chunk-X2LTOZ7F.js.map