@spark-ui/components 13.1.4 → 13.2.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 (731) hide show
  1. package/dist/Button-B6rA3-e5.js +2 -0
  2. package/dist/Button-B6rA3-e5.js.map +1 -0
  3. package/dist/{chunk-2YM6GKWW.mjs → Button-C3C0aixy.mjs} +130 -173
  4. package/dist/Button-C3C0aixy.mjs.map +1 -0
  5. package/dist/DialogContent.styles-B5pR8ECK.js +2 -0
  6. package/dist/DialogContent.styles-B5pR8ECK.js.map +1 -0
  7. package/dist/{chunk-XZ47F6TP.mjs → DialogContent.styles-_lRDsl8c.mjs} +6 -8
  8. package/dist/DialogContent.styles-_lRDsl8c.mjs.map +1 -0
  9. package/dist/Icon-CF0W0LKr.js +2 -0
  10. package/dist/Icon-CF0W0LKr.js.map +1 -0
  11. package/dist/Icon-Ck-dhfLd.mjs +58 -0
  12. package/dist/Icon-Ck-dhfLd.mjs.map +1 -0
  13. package/dist/IconButton-C62-axzv.mjs +43 -0
  14. package/dist/IconButton-C62-axzv.mjs.map +1 -0
  15. package/dist/IconButton-D3g86WpZ.js +2 -0
  16. package/dist/IconButton-D3g86WpZ.js.map +1 -0
  17. package/dist/Slot-D2Bbf8Gw.mjs +14 -0
  18. package/dist/Slot-D2Bbf8Gw.mjs.map +1 -0
  19. package/dist/Slot-DQ8z2zsy.js +2 -0
  20. package/dist/Slot-DQ8z2zsy.js.map +1 -0
  21. package/dist/Spinner-_Kffli3B.js +2 -0
  22. package/dist/Spinner-_Kffli3B.js.map +1 -0
  23. package/dist/{chunk-GAK4SC2F.mjs → Spinner-jF3-zoh_.mjs} +29 -40
  24. package/dist/Spinner-jF3-zoh_.mjs.map +1 -0
  25. package/dist/{chunk-RKPP7ZOK.mjs → TextLink-BuzFRWO6.mjs} +27 -36
  26. package/dist/TextLink-BuzFRWO6.mjs.map +1 -0
  27. package/dist/TextLink-C3xDLsbC.js +2 -0
  28. package/dist/TextLink-C3xDLsbC.js.map +1 -0
  29. package/dist/VisuallyHidden-CB6Nx76j.js +2 -0
  30. package/dist/VisuallyHidden-CB6Nx76j.js.map +1 -0
  31. package/dist/VisuallyHidden-KH1biLx-.mjs +28 -0
  32. package/dist/VisuallyHidden-KH1biLx-.mjs.map +1 -0
  33. package/dist/accordion/Accordion.d.ts +27 -0
  34. package/dist/accordion/AccordionItem.d.ts +12 -0
  35. package/dist/accordion/AccordionItemContent.d.ts +12 -0
  36. package/dist/accordion/AccordionItemHeader.d.ts +9 -0
  37. package/dist/accordion/AccordionItemTrigger.d.ts +12 -0
  38. package/dist/accordion/index.d.mts +10 -68
  39. package/dist/accordion/index.d.ts +10 -68
  40. package/dist/accordion/index.js +2 -325
  41. package/dist/accordion/index.js.map +1 -1
  42. package/dist/accordion/index.mjs +114 -154
  43. package/dist/accordion/index.mjs.map +1 -1
  44. package/dist/accordion/useRenderSlot.d.ts +3 -0
  45. package/dist/alert-dialog/AlertDialog.d.ts +29 -0
  46. package/dist/alert-dialog/AlertDialogAction.d.ts +13 -0
  47. package/dist/alert-dialog/AlertDialogBody.d.ts +12 -0
  48. package/dist/alert-dialog/AlertDialogCancel.d.ts +13 -0
  49. package/dist/alert-dialog/AlertDialogContent.d.ts +9 -0
  50. package/dist/alert-dialog/AlertDialogContext.d.ts +12 -0
  51. package/dist/alert-dialog/AlertDialogDescription.d.ts +9 -0
  52. package/dist/alert-dialog/AlertDialogFooter.d.ts +10 -0
  53. package/dist/alert-dialog/AlertDialogHeader.d.ts +10 -0
  54. package/dist/alert-dialog/AlertDialogOverlay.d.ts +9 -0
  55. package/dist/alert-dialog/AlertDialogPortal.d.ts +7 -0
  56. package/dist/alert-dialog/AlertDialogTitle.d.ts +9 -0
  57. package/dist/alert-dialog/AlertDialogTrigger.d.ts +13 -0
  58. package/dist/alert-dialog/index.d.mts +26 -147
  59. package/dist/alert-dialog/index.d.ts +26 -147
  60. package/dist/alert-dialog/index.js +2 -405
  61. package/dist/alert-dialog/index.js.map +1 -1
  62. package/dist/alert-dialog/index.mjs +172 -260
  63. package/dist/alert-dialog/index.mjs.map +1 -1
  64. package/dist/alert-dialog/useRenderSlot.d.ts +3 -0
  65. package/dist/avatar/Avatar.d.ts +3 -0
  66. package/dist/avatar/AvatarAction.d.ts +9 -0
  67. package/dist/avatar/AvatarImage.d.ts +7 -0
  68. package/dist/avatar/AvatarOnlineBadge.d.ts +9 -0
  69. package/dist/avatar/AvatarPlaceholder.d.ts +8 -0
  70. package/dist/avatar/AvatarUser.d.ts +7 -0
  71. package/dist/avatar/context.d.ts +5 -0
  72. package/dist/avatar/index.d.mts +8 -59
  73. package/dist/avatar/index.d.ts +8 -59
  74. package/dist/avatar/index.js +2 -1323
  75. package/dist/avatar/index.js.map +1 -1
  76. package/dist/avatar/index.mjs +149 -207
  77. package/dist/avatar/index.mjs.map +1 -1
  78. package/dist/avatar/types.d.ts +24 -0
  79. package/dist/badge/Badge.d.ts +9 -0
  80. package/dist/badge/BadgeItem.d.ts +31 -0
  81. package/dist/badge/BadgeItem.styles.d.ts +7 -0
  82. package/dist/badge/index.d.mts +1 -47
  83. package/dist/badge/index.d.ts +1 -47
  84. package/dist/badge/index.js +2 -122
  85. package/dist/badge/index.js.map +1 -1
  86. package/dist/badge/index.mjs +32 -44
  87. package/dist/badge/index.mjs.map +1 -1
  88. package/dist/breadcrumb/Breadcrumb.d.ts +10 -0
  89. package/dist/breadcrumb/Breadcrumb.styles.d.ts +0 -0
  90. package/dist/breadcrumb/BreadcrumbCurrentPage.d.ts +11 -0
  91. package/dist/breadcrumb/BreadcrumbItem.d.ts +9 -0
  92. package/dist/breadcrumb/BreadcrumbLink.d.ts +12 -0
  93. package/dist/breadcrumb/BreadcrumbSeparator.d.ts +10 -0
  94. package/dist/breadcrumb/index.d.mts +7 -59
  95. package/dist/breadcrumb/index.d.ts +7 -59
  96. package/dist/breadcrumb/index.js +2 -327
  97. package/dist/breadcrumb/index.js.map +1 -1
  98. package/dist/breadcrumb/index.mjs +106 -146
  99. package/dist/breadcrumb/index.mjs.map +1 -1
  100. package/dist/button/Button.d.ts +26 -0
  101. package/dist/button/Button.styles.d.ts +10 -0
  102. package/dist/button/index.d.mts +1 -41
  103. package/dist/button/index.d.ts +1 -41
  104. package/dist/button/index.js +2 -935
  105. package/dist/button/index.js.map +1 -1
  106. package/dist/button/index.mjs +3 -8
  107. package/dist/button/index.mjs.map +1 -1
  108. package/dist/button/variants/contrast.d.ts +45 -0
  109. package/dist/button/variants/filled.d.ts +45 -0
  110. package/dist/button/variants/ghost.d.ts +45 -0
  111. package/dist/button/variants/index.d.mts +5 -0
  112. package/dist/button/variants/index.d.ts +5 -0
  113. package/dist/button/variants/outlined.d.ts +45 -0
  114. package/dist/button/variants/tinted.d.ts +45 -0
  115. package/dist/card/Backdrop.d.ts +14 -0
  116. package/dist/card/Card.d.ts +16 -0
  117. package/dist/card/Card.styles.d.ts +7 -0
  118. package/dist/card/Content.d.ts +15 -0
  119. package/dist/card/Content.styles.d.ts +8 -0
  120. package/dist/card/context.d.ts +11 -0
  121. package/dist/card/index.d.mts +5 -58
  122. package/dist/card/index.d.ts +5 -58
  123. package/dist/card/index.js +2 -502
  124. package/dist/card/index.js.map +1 -1
  125. package/dist/card/index.mjs +125 -178
  126. package/dist/card/index.mjs.map +1 -1
  127. package/dist/card/utils.d.ts +3 -0
  128. package/dist/carousel/Carousel.d.ts +12 -0
  129. package/dist/carousel/CarouselControls.d.ts +9 -0
  130. package/dist/carousel/CarouselNextButton.d.ts +5 -0
  131. package/dist/carousel/CarouselPageIndicator.d.ts +14 -0
  132. package/dist/carousel/CarouselPagePicker.d.ts +14 -0
  133. package/dist/carousel/CarouselPrevButton.d.ts +5 -0
  134. package/dist/carousel/CarouselSlide.d.ts +12 -0
  135. package/dist/carousel/CarouselSlides.d.ts +10 -0
  136. package/dist/carousel/CarouselViewport.d.ts +9 -0
  137. package/dist/carousel/index.d.mts +18 -263
  138. package/dist/carousel/index.d.ts +18 -263
  139. package/dist/carousel/index.js +2 -1882
  140. package/dist/carousel/index.js.map +1 -1
  141. package/dist/carousel/index.mjs +428 -650
  142. package/dist/carousel/index.mjs.map +1 -1
  143. package/dist/carousel/types.d.ts +165 -0
  144. package/dist/carousel/useCarousel.d.ts +2 -0
  145. package/dist/carousel/useCarouselVisibility.d.ts +13 -0
  146. package/dist/carousel/useEvent.d.ts +7 -0
  147. package/dist/carousel/useIsMounted.d.ts +1 -0
  148. package/dist/carousel/useIsVisible.d.ts +6 -0
  149. package/dist/carousel/useResizeObserver.d.ts +2 -0
  150. package/dist/carousel/useScrollEnd.d.ts +3 -0
  151. package/dist/carousel/useSnapPoints.d.ts +10 -0
  152. package/dist/carousel/utils.d.ts +24 -0
  153. package/dist/checkbox/Checkbox.d.ts +10 -0
  154. package/dist/checkbox/CheckboxGroup.d.ts +18 -0
  155. package/dist/checkbox/CheckboxGroup.styles.d.ts +5 -0
  156. package/dist/checkbox/CheckboxGroupContext.d.ts +41 -0
  157. package/dist/checkbox/CheckboxIndicator.d.ts +9 -0
  158. package/dist/checkbox/CheckboxInput.d.ts +47 -0
  159. package/dist/checkbox/CheckboxInput.styles.d.ts +5 -0
  160. package/dist/checkbox/CheckboxLabel.d.ts +12 -0
  161. package/dist/checkbox/CheckboxLabel.styles.d.ts +5 -0
  162. package/dist/checkbox/index.d.mts +2 -120
  163. package/dist/checkbox/index.d.ts +2 -120
  164. package/dist/checkbox/index.js +2 -511
  165. package/dist/checkbox/index.js.map +1 -1
  166. package/dist/checkbox/index.mjs +135 -226
  167. package/dist/checkbox/index.mjs.map +1 -1
  168. package/dist/chip/Chip.d.ts +34 -0
  169. package/dist/chip/Chip.styles.d.ts +8 -0
  170. package/dist/chip/ChipClearButton.d.ts +10 -0
  171. package/dist/chip/ChipClearButton.styles.d.ts +10 -0
  172. package/dist/chip/ChipContent.d.ts +8 -0
  173. package/dist/chip/ChipIcon.d.ts +8 -0
  174. package/dist/chip/ChipLeadingIcon.d.ts +9 -0
  175. package/dist/chip/ChipTrailingIcon.d.ts +9 -0
  176. package/dist/chip/index.d.mts +10 -92
  177. package/dist/chip/index.d.ts +10 -92
  178. package/dist/chip/index.js +2 -908
  179. package/dist/chip/index.js.map +1 -1
  180. package/dist/chip/index.mjs +218 -324
  181. package/dist/chip/index.mjs.map +1 -1
  182. package/dist/chip/useChipContext.d.ts +4 -0
  183. package/dist/chip/useChipElement.d.ts +41 -0
  184. package/dist/chip/variants/dashed.d.ts +49 -0
  185. package/dist/chip/variants/index.d.mts +3 -0
  186. package/dist/chip/variants/index.d.ts +3 -0
  187. package/dist/chip/variants/outlined.d.ts +49 -0
  188. package/dist/chip/variants/tinted.d.ts +49 -0
  189. package/dist/collapsible/Content.d.ts +12 -0
  190. package/dist/collapsible/Root.d.ts +12 -0
  191. package/dist/collapsible/Trigger.d.ts +11 -0
  192. package/dist/collapsible/index.d.mts +4 -40
  193. package/dist/collapsible/index.d.ts +4 -40
  194. package/dist/collapsible/index.js +2 -109
  195. package/dist/collapsible/index.js.map +1 -1
  196. package/dist/collapsible/index.mjs +39 -58
  197. package/dist/collapsible/index.mjs.map +1 -1
  198. package/dist/collapsible/useRenderSlot.d.ts +3 -0
  199. package/dist/combobox/Combobox.d.ts +6 -0
  200. package/dist/combobox/ComboboxClearButton.d.ts +9 -0
  201. package/dist/combobox/ComboboxContext.d.ts +108 -0
  202. package/dist/combobox/ComboboxDisclosure.d.ts +13 -0
  203. package/dist/combobox/ComboboxEmpty.d.ts +11 -0
  204. package/dist/combobox/ComboboxGroup.d.ts +11 -0
  205. package/dist/combobox/ComboboxInput.d.ts +15 -0
  206. package/dist/combobox/ComboboxItem.d.ts +12 -0
  207. package/dist/combobox/ComboboxItemContext.d.ts +17 -0
  208. package/dist/combobox/ComboboxItemIndicator.d.ts +11 -0
  209. package/dist/combobox/ComboboxItemText.d.ts +10 -0
  210. package/dist/combobox/ComboboxItems.d.ts +11 -0
  211. package/dist/combobox/ComboboxItemsGroupContext.d.ts +8 -0
  212. package/dist/combobox/ComboboxLabel.d.ts +11 -0
  213. package/dist/combobox/ComboboxLeadingIcon.d.ts +7 -0
  214. package/dist/combobox/ComboboxPopover.d.ts +10 -0
  215. package/dist/combobox/ComboboxPortal.d.ts +2 -0
  216. package/dist/combobox/ComboboxSelectedItems.d.ts +4 -0
  217. package/dist/combobox/ComboboxTrigger.d.ts +11 -0
  218. package/dist/combobox/ComboboxTrigger.styles.d.ts +6 -0
  219. package/dist/combobox/index.d.mts +19 -271
  220. package/dist/combobox/index.d.ts +19 -271
  221. package/dist/combobox/index.js +2 -2588
  222. package/dist/combobox/index.js.map +1 -1
  223. package/dist/combobox/index.mjs +623 -1017
  224. package/dist/combobox/index.mjs.map +1 -1
  225. package/dist/combobox/tests/test-utils.d.ts +8 -0
  226. package/dist/combobox/types.d.ts +8 -0
  227. package/dist/combobox/useCombobox/multipleSelectionReducer.d.ts +13 -0
  228. package/dist/combobox/useCombobox/singleSelectionReducer.d.ts +8 -0
  229. package/dist/combobox/utils/index.d.mts +14 -0
  230. package/dist/combobox/utils/index.d.ts +14 -0
  231. package/dist/combobox/utils/useWidthIncreaseCallback.d.ts +2 -0
  232. package/dist/dialog/Dialog.d.ts +32 -0
  233. package/dist/dialog/DialogBody.d.ts +12 -0
  234. package/dist/dialog/DialogClose.d.ts +9 -0
  235. package/dist/dialog/DialogCloseButton.d.ts +9 -0
  236. package/dist/dialog/DialogContent.d.ts +14 -0
  237. package/dist/dialog/DialogContent.styles.d.ts +6 -0
  238. package/dist/dialog/DialogContext.d.ts +11 -0
  239. package/dist/dialog/DialogDescription.d.ts +9 -0
  240. package/dist/dialog/DialogFooter.d.ts +10 -0
  241. package/dist/dialog/DialogHeader.d.ts +10 -0
  242. package/dist/dialog/DialogOverlay.d.ts +9 -0
  243. package/dist/dialog/DialogPortal.d.ts +7 -0
  244. package/dist/dialog/DialogTitle.d.ts +9 -0
  245. package/dist/dialog/DialogTrigger.d.ts +17 -0
  246. package/dist/dialog/index.d.mts +25 -154
  247. package/dist/dialog/index.d.ts +25 -154
  248. package/dist/dialog/index.js +2 -1389
  249. package/dist/dialog/index.js.map +1 -1
  250. package/dist/dialog/index.mjs +163 -258
  251. package/dist/dialog/index.mjs.map +1 -1
  252. package/dist/divider/Divider.d.ts +30 -0
  253. package/dist/divider/Divider.styles.d.ts +9 -0
  254. package/dist/divider/DividerContent.d.ts +13 -0
  255. package/dist/divider/index.d.mts +4 -59
  256. package/dist/divider/index.d.ts +4 -59
  257. package/dist/divider/index.js +2 -224
  258. package/dist/divider/index.js.map +1 -1
  259. package/dist/divider/index.mjs +79 -100
  260. package/dist/divider/index.mjs.map +1 -1
  261. package/dist/divider/variants/intents.d.ts +17 -0
  262. package/dist/drawer/Drawer.d.ts +39 -0
  263. package/dist/drawer/DrawerBody.d.ts +11 -0
  264. package/dist/drawer/DrawerBody.styles.d.ts +5 -0
  265. package/dist/drawer/DrawerClose.d.ts +9 -0
  266. package/dist/drawer/DrawerCloseButton.d.ts +7 -0
  267. package/dist/drawer/DrawerContent.d.ts +10 -0
  268. package/dist/drawer/DrawerContent.styles.d.ts +6 -0
  269. package/dist/drawer/DrawerContext.d.ts +9 -0
  270. package/dist/drawer/DrawerDescription.d.ts +9 -0
  271. package/dist/drawer/DrawerFooter.d.ts +8 -0
  272. package/dist/drawer/DrawerHeader.d.ts +10 -0
  273. package/dist/drawer/DrawerOverlay.d.ts +9 -0
  274. package/dist/drawer/DrawerPortal.d.ts +7 -0
  275. package/dist/drawer/DrawerTitle.d.ts +9 -0
  276. package/dist/drawer/DrawerTrigger.d.ts +13 -0
  277. package/dist/drawer/index.d.mts +24 -141
  278. package/dist/drawer/index.d.ts +24 -141
  279. package/dist/drawer/index.js +2 -1400
  280. package/dist/drawer/index.js.map +1 -1
  281. package/dist/drawer/index.mjs +141 -230
  282. package/dist/drawer/index.mjs.map +1 -1
  283. package/dist/dropdown/Dropdown.d.ts +6 -0
  284. package/dist/dropdown/DropdownContext.d.ts +81 -0
  285. package/dist/dropdown/DropdownDivider.d.ts +10 -0
  286. package/dist/dropdown/DropdownGroup.d.ts +11 -0
  287. package/dist/dropdown/DropdownItem.d.ts +12 -0
  288. package/dist/dropdown/DropdownItemContext.d.ts +17 -0
  289. package/dist/dropdown/DropdownItemIndicator.d.ts +11 -0
  290. package/dist/dropdown/DropdownItemText.d.ts +9 -0
  291. package/dist/dropdown/DropdownItems.d.ts +21 -0
  292. package/dist/dropdown/DropdownItemsGroupContext.d.ts +8 -0
  293. package/dist/dropdown/DropdownLabel.d.ts +11 -0
  294. package/dist/dropdown/DropdownLeadingIcon.d.ts +7 -0
  295. package/dist/dropdown/DropdownPopover.d.ts +6 -0
  296. package/dist/dropdown/DropdownPortal.d.ts +2 -0
  297. package/dist/dropdown/DropdownTrigger.d.ts +12 -0
  298. package/dist/dropdown/DropdownTrigger.styles.d.ts +5 -0
  299. package/dist/dropdown/DropdownValue.d.ts +11 -0
  300. package/dist/dropdown/index.d.mts +16 -220
  301. package/dist/dropdown/index.d.ts +16 -220
  302. package/dist/dropdown/index.js +2 -2051
  303. package/dist/dropdown/index.js.map +1 -1
  304. package/dist/dropdown/index.mjs +352 -584
  305. package/dist/dropdown/index.mjs.map +1 -1
  306. package/dist/dropdown/types.d.ts +8 -0
  307. package/dist/dropdown/useDropdown.d.ts +41 -0
  308. package/dist/dropdown/utils.d.ts +13 -0
  309. package/dist/file-upload/FileUpload.d.ts +130 -0
  310. package/dist/file-upload/FileUploadAcceptedFile.d.ts +25 -0
  311. package/dist/file-upload/FileUploadContext.d.ts +17 -0
  312. package/dist/file-upload/FileUploadDropzone.d.ts +10 -0
  313. package/dist/file-upload/FileUploadItemDeleteTrigger.d.ts +11 -0
  314. package/dist/file-upload/FileUploadPreviewImage.d.ts +17 -0
  315. package/dist/file-upload/FileUploadRejectedFile.d.ts +24 -0
  316. package/dist/file-upload/FileUploadRejectedFileDeleteTrigger.d.ts +12 -0
  317. package/dist/file-upload/FileUploadTrigger.d.ts +12 -0
  318. package/dist/file-upload/constants.d.ts +29 -0
  319. package/dist/file-upload/index.d.mts +14 -262
  320. package/dist/file-upload/index.d.ts +14 -262
  321. package/dist/file-upload/index.js +2 -2255
  322. package/dist/file-upload/index.js.map +1 -1
  323. package/dist/file-upload/index.mjs +506 -834
  324. package/dist/file-upload/index.mjs.map +1 -1
  325. package/dist/file-upload/test-utils.d.ts +9 -0
  326. package/dist/file-upload/useFileUploadState.d.ts +88 -0
  327. package/dist/file-upload/utils.d.ts +40 -0
  328. package/dist/form-field/FormField.d.ts +21 -0
  329. package/dist/form-field/FormFieldAlertMessage.d.ts +9 -0
  330. package/dist/form-field/FormFieldCharactersCount.d.ts +26 -0
  331. package/dist/form-field/FormFieldContext.d.ts +49 -0
  332. package/dist/form-field/FormFieldControl.d.ts +12 -0
  333. package/dist/form-field/FormFieldErrorMessage.d.ts +9 -0
  334. package/dist/form-field/FormFieldHelperMessage.d.ts +9 -0
  335. package/dist/form-field/FormFieldLabel.d.ts +13 -0
  336. package/dist/form-field/FormFieldMessage.d.ts +8 -0
  337. package/dist/form-field/FormFieldProvider.d.ts +9 -0
  338. package/dist/form-field/FormFieldRequiredIndicator.d.ts +9 -0
  339. package/dist/form-field/FormFieldStateMessage.d.ts +10 -0
  340. package/dist/form-field/FormFieldSuccessMessage.d.ts +9 -0
  341. package/dist/form-field/index.d.mts +21 -176
  342. package/dist/form-field/index.d.ts +21 -176
  343. package/dist/form-field/index.js +2 -553
  344. package/dist/form-field/index.js.map +1 -1
  345. package/dist/form-field/index.mjs +246 -349
  346. package/dist/form-field/index.mjs.map +1 -1
  347. package/dist/icon/Icon.d.ts +17 -0
  348. package/dist/icon/Icon.styles.d.ts +6 -0
  349. package/dist/icon/index.d.mts +1 -28
  350. package/dist/icon/index.d.ts +1 -28
  351. package/dist/icon/index.js +2 -127
  352. package/dist/icon/index.js.map +1 -1
  353. package/dist/icon/index.mjs +3 -7
  354. package/dist/icon/index.mjs.map +1 -1
  355. package/dist/icon-button/IconButton.d.ts +10 -0
  356. package/dist/icon-button/IconButton.styles.d.ts +5 -0
  357. package/dist/icon-button/index.d.mts +1 -16
  358. package/dist/icon-button/index.d.ts +1 -16
  359. package/dist/icon-button/index.js +2 -980
  360. package/dist/icon-button/index.js.map +1 -1
  361. package/dist/icon-button/index.mjs +3 -9
  362. package/dist/icon-button/index.mjs.map +1 -1
  363. package/dist/input/Input.d.ts +14 -0
  364. package/dist/input/Input.styles.d.ts +11 -0
  365. package/dist/input/InputAddon.d.ts +9 -0
  366. package/dist/input/InputAddon.styles.d.ts +9 -0
  367. package/dist/input/InputClearButton.d.ts +12 -0
  368. package/dist/input/InputGroup.d.ts +17 -0
  369. package/dist/input/InputGroup.styles.d.ts +6 -0
  370. package/dist/input/InputGroupContext.d.ts +14 -0
  371. package/dist/input/InputIcon.d.ts +6 -0
  372. package/dist/input/InputLeadingAddon.d.ts +11 -0
  373. package/dist/input/InputLeadingIcon.d.ts +7 -0
  374. package/dist/input/InputTrailingAddon.d.ts +11 -0
  375. package/dist/input/InputTrailingIcon.d.ts +7 -0
  376. package/dist/input/index.d.mts +15 -72
  377. package/dist/input/index.d.ts +15 -72
  378. package/dist/input/index.js +2 -724
  379. package/dist/input/index.js.map +1 -1
  380. package/dist/input/index.mjs +453 -12
  381. package/dist/input/index.mjs.map +1 -1
  382. package/dist/input-otp/InputOTP.d.ts +85 -0
  383. package/dist/input-otp/InputOTP.styles.d.ts +10 -0
  384. package/dist/input-otp/InputOTPContext.d.ts +16 -0
  385. package/dist/input-otp/InputOTPGroup.d.ts +7 -0
  386. package/dist/input-otp/InputOTPSeparator.d.ts +7 -0
  387. package/dist/input-otp/InputOTPSlot.d.ts +12 -0
  388. package/dist/input-otp/index.d.mts +10 -128
  389. package/dist/input-otp/index.d.ts +10 -128
  390. package/dist/input-otp/index.js +2 -668
  391. package/dist/input-otp/index.js.map +1 -1
  392. package/dist/input-otp/index.mjs +295 -462
  393. package/dist/input-otp/index.mjs.map +1 -1
  394. package/dist/input-otp/useInputOTP.d.ts +45 -0
  395. package/dist/kbd/Kbd.d.ts +5 -0
  396. package/dist/kbd/index.d.mts +1 -9
  397. package/dist/kbd/index.d.ts +1 -9
  398. package/dist/kbd/index.js +2 -47
  399. package/dist/kbd/index.js.map +1 -1
  400. package/dist/kbd/index.mjs +15 -18
  401. package/dist/kbd/index.mjs.map +1 -1
  402. package/dist/label/Label.d.ts +9 -0
  403. package/dist/label/LabelRequiredIndicator.d.ts +6 -0
  404. package/dist/label/index.d.mts +5 -9
  405. package/dist/label/index.d.ts +5 -9
  406. package/dist/label/index.js +2 -78
  407. package/dist/label/index.js.map +1 -1
  408. package/dist/label/index.mjs +38 -5
  409. package/dist/label/index.mjs.map +1 -1
  410. package/dist/link-box/LinkBox.d.ts +8 -0
  411. package/dist/link-box/LinkBoxLink.d.ts +8 -0
  412. package/dist/link-box/LinkBoxRaised.d.ts +9 -0
  413. package/dist/link-box/index.d.mts +6 -31
  414. package/dist/link-box/index.d.ts +6 -31
  415. package/dist/link-box/index.js +2 -92
  416. package/dist/link-box/index.js.map +1 -1
  417. package/dist/link-box/index.mjs +34 -56
  418. package/dist/link-box/index.mjs.map +1 -1
  419. package/dist/pagination/Pagination.d.ts +8 -0
  420. package/dist/pagination/PaginationContext.d.ts +43 -0
  421. package/dist/pagination/PaginationEllipsis.d.ts +9 -0
  422. package/dist/pagination/PaginationFirstPageTrigger.d.ts +16 -0
  423. package/dist/pagination/PaginationItem.d.ts +17 -0
  424. package/dist/pagination/PaginationLastPageTrigger.d.ts +16 -0
  425. package/dist/pagination/PaginationNextTrigger.d.ts +16 -0
  426. package/dist/pagination/PaginationPages.d.ts +16 -0
  427. package/dist/pagination/PaginationPrevTrigger.d.ts +16 -0
  428. package/dist/pagination/index.d.mts +10 -135
  429. package/dist/pagination/index.d.ts +10 -135
  430. package/dist/pagination/index.js +2 -1353
  431. package/dist/pagination/index.js.map +1 -1
  432. package/dist/pagination/index.mjs +176 -269
  433. package/dist/pagination/index.mjs.map +1 -1
  434. package/dist/pagination/utils.d.ts +1 -0
  435. package/dist/popover/Popover.d.ts +9 -0
  436. package/dist/popover/PopoverAnchor.d.ts +9 -0
  437. package/dist/popover/PopoverArrow.d.ts +9 -0
  438. package/dist/popover/PopoverCloseButton.d.ts +10 -0
  439. package/dist/popover/PopoverContent.d.ts +10 -0
  440. package/dist/popover/PopoverContent.styles.d.ts +9 -0
  441. package/dist/popover/PopoverContext.d.ts +15 -0
  442. package/dist/popover/PopoverHeader.d.ts +10 -0
  443. package/dist/popover/PopoverPortal.d.ts +7 -0
  444. package/dist/popover/PopoverTrigger.d.ts +9 -0
  445. package/dist/popover/index.d.mts +17 -6
  446. package/dist/popover/index.d.ts +17 -6
  447. package/dist/popover/index.js +2 -1339
  448. package/dist/popover/index.js.map +1 -1
  449. package/dist/popover/index.mjs +239 -11
  450. package/dist/popover/index.mjs.map +1 -1
  451. package/dist/portal/Portal.d.ts +10 -0
  452. package/dist/portal/index.d.mts +1 -13
  453. package/dist/portal/index.d.ts +1 -13
  454. package/dist/portal/index.js +2 -37
  455. package/dist/portal/index.js.map +1 -1
  456. package/dist/portal/index.mjs +5 -8
  457. package/dist/portal/index.mjs.map +1 -1
  458. package/dist/progress/Progress.d.ts +16 -0
  459. package/dist/progress/ProgressBar.d.ts +6 -0
  460. package/dist/progress/ProgressBar.styles.d.ts +5 -0
  461. package/dist/progress/ProgressContext.d.ts +13 -0
  462. package/dist/progress/ProgressIndicator.d.ts +6 -0
  463. package/dist/progress/ProgressIndicator.styles.d.ts +7 -0
  464. package/dist/progress/ProgressLabel.d.ts +6 -0
  465. package/dist/progress/index.d.mts +9 -48
  466. package/dist/progress/index.d.ts +9 -48
  467. package/dist/progress/index.js +2 -240
  468. package/dist/progress/index.js.map +1 -1
  469. package/dist/progress/index.mjs +166 -5
  470. package/dist/progress/index.mjs.map +1 -1
  471. package/dist/progress-tracker/ProgressTracker.d.ts +27 -0
  472. package/dist/progress-tracker/ProgressTracker.styles.d.ts +1 -0
  473. package/dist/progress-tracker/ProgressTrackerContext.d.ts +15 -0
  474. package/dist/progress-tracker/ProgressTrackerStep.d.ts +12 -0
  475. package/dist/progress-tracker/ProgressTrackerStep.styles.d.ts +10 -0
  476. package/dist/progress-tracker/ProgressTrackerStepIndicator.d.ts +15 -0
  477. package/dist/progress-tracker/ProgressTrackerStepIndicator.styles.d.ts +7 -0
  478. package/dist/progress-tracker/ProgressTrackerStepLabel.d.ts +9 -0
  479. package/dist/progress-tracker/index.d.mts +10 -80
  480. package/dist/progress-tracker/index.d.ts +10 -80
  481. package/dist/progress-tracker/index.js +2 -571
  482. package/dist/progress-tracker/index.js.map +1 -1
  483. package/dist/progress-tracker/index.mjs +115 -183
  484. package/dist/progress-tracker/index.mjs.map +1 -1
  485. package/dist/radio-group/Radio.d.ts +9 -0
  486. package/dist/radio-group/RadioGroup.d.ts +54 -0
  487. package/dist/radio-group/RadioGroup.styles.d.ts +5 -0
  488. package/dist/radio-group/RadioGroupContext.d.ts +5 -0
  489. package/dist/radio-group/RadioGroupProvider.d.ts +7 -0
  490. package/dist/radio-group/RadioIndicator.d.ts +18 -0
  491. package/dist/radio-group/RadioIndicator.styles.d.ts +5 -0
  492. package/dist/radio-group/RadioInput.d.ts +25 -0
  493. package/dist/radio-group/RadioInput.styles.d.ts +5 -0
  494. package/dist/radio-group/RadioLabel.d.ts +20 -0
  495. package/dist/radio-group/RadioLabel.styles.d.ts +5 -0
  496. package/dist/radio-group/index.d.mts +5 -98
  497. package/dist/radio-group/index.d.ts +5 -98
  498. package/dist/radio-group/index.js +2 -318
  499. package/dist/radio-group/index.js.map +1 -1
  500. package/dist/radio-group/index.mjs +105 -174
  501. package/dist/radio-group/index.mjs.map +1 -1
  502. package/dist/rating/Rating.d.ts +52 -0
  503. package/dist/rating/RatingStar.d.ts +10 -0
  504. package/dist/rating/RatingStar.styles.d.ts +14 -0
  505. package/dist/rating/index.d.mts +1 -78
  506. package/dist/rating/index.d.ts +1 -78
  507. package/dist/rating/index.js +2 -363
  508. package/dist/rating/index.js.map +1 -1
  509. package/dist/rating/index.mjs +125 -170
  510. package/dist/rating/index.mjs.map +1 -1
  511. package/dist/rating/types.d.ts +1 -0
  512. package/dist/rating/utils.d.ts +8 -0
  513. package/dist/scrolling-list/ScrollingList.d.ts +57 -0
  514. package/dist/scrolling-list/ScrollingListControls.d.ts +18 -0
  515. package/dist/scrolling-list/ScrollingListItem.d.ts +17 -0
  516. package/dist/scrolling-list/ScrollingListItems.d.ts +11 -0
  517. package/dist/scrolling-list/ScrollingListNextButton.d.ts +5 -0
  518. package/dist/scrolling-list/ScrollingListPrevButton.d.ts +5 -0
  519. package/dist/scrolling-list/ScrollingListSkipButton.d.ts +9 -0
  520. package/dist/scrolling-list/index.d.mts +14 -117
  521. package/dist/scrolling-list/index.d.ts +14 -117
  522. package/dist/scrolling-list/index.js +2 -1428
  523. package/dist/scrolling-list/index.js.map +1 -1
  524. package/dist/scrolling-list/index.mjs +193 -325
  525. package/dist/scrolling-list/index.mjs.map +1 -1
  526. package/dist/scrolling-list/useFocusWithinScroll.d.ts +3 -0
  527. package/dist/segmented-gauge/SegmentedGauge.d.ts +66 -0
  528. package/dist/segmented-gauge/SegmentedGaugeContext.d.ts +14 -0
  529. package/dist/segmented-gauge/SegmentedGaugeLabel.d.ts +9 -0
  530. package/dist/segmented-gauge/SegmentedGaugeSegment.d.ts +12 -0
  531. package/dist/segmented-gauge/SegmentedGaugeTrack.d.ts +8 -0
  532. package/dist/segmented-gauge/index.d.mts +9 -101
  533. package/dist/segmented-gauge/index.d.ts +9 -101
  534. package/dist/segmented-gauge/index.js +2 -274
  535. package/dist/segmented-gauge/index.js.map +1 -1
  536. package/dist/segmented-gauge/index.mjs +132 -178
  537. package/dist/segmented-gauge/index.mjs.map +1 -1
  538. package/dist/select/Select.d.ts +6 -0
  539. package/dist/select/SelectContext.d.ts +59 -0
  540. package/dist/select/SelectGroup.d.ts +11 -0
  541. package/dist/select/SelectItem.d.ts +11 -0
  542. package/dist/select/SelectItems.d.ts +10 -0
  543. package/dist/select/SelectItemsGroupContext.d.ts +9 -0
  544. package/dist/select/SelectLabel.d.ts +8 -0
  545. package/dist/select/SelectLeadingIcon.d.ts +7 -0
  546. package/dist/select/SelectPlaceholder.d.ts +10 -0
  547. package/dist/select/SelectTrigger.d.ts +16 -0
  548. package/dist/select/SelectTrigger.styles.d.ts +5 -0
  549. package/dist/select/SelectValue.d.ts +15 -0
  550. package/dist/select/index.d.mts +12 -158
  551. package/dist/select/index.d.ts +12 -158
  552. package/dist/select/index.js +2 -581
  553. package/dist/select/index.js.map +1 -1
  554. package/dist/select/index.mjs +207 -339
  555. package/dist/select/index.mjs.map +1 -1
  556. package/dist/select/types.d.ts +6 -0
  557. package/dist/select/utils.d.ts +4 -0
  558. package/dist/skeleton/Skeleton.d.ts +17 -0
  559. package/dist/skeleton/Skeleton.styles.d.ts +5 -0
  560. package/dist/skeleton/SkeletonItem.d.ts +31 -0
  561. package/dist/skeleton/SkeletonItem.styles.d.ts +8 -0
  562. package/dist/skeleton/index.d.mts +8 -67
  563. package/dist/skeleton/index.d.ts +8 -67
  564. package/dist/skeleton/index.js +2 -206
  565. package/dist/skeleton/index.js.map +1 -1
  566. package/dist/skeleton/index.mjs +64 -96
  567. package/dist/skeleton/index.mjs.map +1 -1
  568. package/dist/slider/Slider.d.ts +60 -0
  569. package/dist/slider/Slider.styles.d.ts +1 -0
  570. package/dist/slider/SliderContext.d.ts +7 -0
  571. package/dist/slider/SliderThumb.d.ts +14 -0
  572. package/dist/slider/SliderThumb.styles.d.ts +5 -0
  573. package/dist/slider/SliderTrack.d.ts +14 -0
  574. package/dist/slider/SliderTrack.styles.d.ts +9 -0
  575. package/dist/slider/index.d.mts +8 -97
  576. package/dist/slider/index.d.ts +8 -97
  577. package/dist/slider/index.js +2 -220
  578. package/dist/slider/index.js.map +1 -1
  579. package/dist/slider/index.mjs +94 -111
  580. package/dist/slider/index.mjs.map +1 -1
  581. package/dist/slot/Slot.d.ts +12 -0
  582. package/dist/slot/index.d.mts +1 -16
  583. package/dist/slot/index.d.ts +1 -16
  584. package/dist/slot/index.js +2 -51
  585. package/dist/slot/index.js.map +1 -1
  586. package/dist/slot/index.mjs +5 -9
  587. package/dist/slot/index.mjs.map +1 -1
  588. package/dist/snackbar/Snackbar.d.ts +29 -0
  589. package/dist/snackbar/SnackbarItem.d.ts +49 -0
  590. package/dist/snackbar/SnackbarItem.styles.d.ts +10 -0
  591. package/dist/snackbar/SnackbarItemAction.d.ts +10 -0
  592. package/dist/snackbar/SnackbarItemClose.d.ts +9 -0
  593. package/dist/snackbar/SnackbarItemContext.d.ts +8 -0
  594. package/dist/snackbar/SnackbarItemIcon.d.ts +7 -0
  595. package/dist/snackbar/SnackbarRegion.d.ts +30 -0
  596. package/dist/snackbar/SnackbarRegion.styles.d.ts +5 -0
  597. package/dist/snackbar/index.d.mts +13 -158
  598. package/dist/snackbar/index.d.ts +13 -158
  599. package/dist/snackbar/index.js +2 -1756
  600. package/dist/snackbar/index.js.map +1 -1
  601. package/dist/snackbar/index.mjs +237 -429
  602. package/dist/snackbar/index.mjs.map +1 -1
  603. package/dist/snackbar/snackbarVariants.d.ts +82 -0
  604. package/dist/snackbar/useSnackbarGlobalStore.d.ts +18 -0
  605. package/dist/snackbar/useSwipe.d.ts +15 -0
  606. package/dist/spinner/Spinner.d.ts +9 -0
  607. package/dist/spinner/Spinner.styles.d.ts +7 -0
  608. package/dist/spinner/index.d.mts +1 -21
  609. package/dist/spinner/index.d.ts +1 -21
  610. package/dist/spinner/index.js +2 -139
  611. package/dist/spinner/index.js.map +1 -1
  612. package/dist/spinner/index.mjs +3 -7
  613. package/dist/spinner/index.mjs.map +1 -1
  614. package/dist/stepper/Stepper.d.ts +9 -0
  615. package/dist/stepper/StepperButton.d.ts +14 -0
  616. package/dist/stepper/StepperInput.d.ts +7 -0
  617. package/dist/stepper/index.d.mts +9 -81
  618. package/dist/stepper/index.d.ts +9 -81
  619. package/dist/stepper/index.js +2 -1847
  620. package/dist/stepper/index.js.map +1 -1
  621. package/dist/stepper/index.mjs +143 -195
  622. package/dist/stepper/index.mjs.map +1 -1
  623. package/dist/stepper/types.d.ts +46 -0
  624. package/dist/stepper/useStepper.d.ts +2 -0
  625. package/dist/switch/Switch.d.ts +6 -0
  626. package/dist/switch/SwitchInput.d.ts +51 -0
  627. package/dist/switch/SwitchInput.styles.d.ts +16 -0
  628. package/dist/switch/SwitchLabel.d.ts +17 -0
  629. package/dist/switch/SwitchLabel.styles.d.ts +5 -0
  630. package/dist/switch/index.d.mts +1 -64
  631. package/dist/switch/index.d.ts +1 -64
  632. package/dist/switch/index.js +2 -327
  633. package/dist/switch/index.js.map +1 -1
  634. package/dist/switch/index.mjs +90 -130
  635. package/dist/switch/index.mjs.map +1 -1
  636. package/dist/tabs/Tabs.d.ts +24 -0
  637. package/dist/tabs/TabsContent.d.ts +22 -0
  638. package/dist/tabs/TabsContent.styles.d.ts +3 -0
  639. package/dist/tabs/TabsContext.d.ts +7 -0
  640. package/dist/tabs/TabsList.d.ts +20 -0
  641. package/dist/tabs/TabsList.styles.d.ts +3 -0
  642. package/dist/tabs/TabsPopover.d.ts +29 -0
  643. package/dist/tabs/TabsPopoverAbstraction.d.ts +27 -0
  644. package/dist/tabs/TabsRoot.styles.d.ts +1 -0
  645. package/dist/tabs/TabsTrigger.d.ts +41 -0
  646. package/dist/tabs/TabsTrigger.styles.d.ts +8 -0
  647. package/dist/tabs/index.d.mts +13 -137
  648. package/dist/tabs/index.d.ts +13 -137
  649. package/dist/tabs/index.js +2 -1830
  650. package/dist/tabs/index.js.map +1 -1
  651. package/dist/tabs/index.mjs +224 -350
  652. package/dist/tabs/index.mjs.map +1 -1
  653. package/dist/tabs/useResizeObserver.d.ts +8 -0
  654. package/dist/tag/Tag.d.ts +17 -0
  655. package/dist/tag/Tag.styles.d.ts +8 -0
  656. package/dist/tag/index.d.mts +1 -29
  657. package/dist/tag/index.d.ts +1 -29
  658. package/dist/tag/index.js +2 -283
  659. package/dist/tag/index.js.map +1 -1
  660. package/dist/tag/index.mjs +66 -90
  661. package/dist/tag/index.mjs.map +1 -1
  662. package/dist/tag/variants/filled.d.ts +41 -0
  663. package/dist/tag/variants/index.d.mts +3 -0
  664. package/dist/tag/variants/index.d.ts +3 -0
  665. package/dist/tag/variants/outlined.d.ts +37 -0
  666. package/dist/tag/variants/tinted.d.ts +37 -0
  667. package/dist/text-link/TextLink.d.ts +16 -0
  668. package/dist/text-link/index.d.mts +1 -20
  669. package/dist/text-link/index.d.ts +1 -20
  670. package/dist/text-link/index.js +2 -100
  671. package/dist/text-link/index.js.map +1 -1
  672. package/dist/text-link/index.mjs +3 -6
  673. package/dist/text-link/index.mjs.map +1 -1
  674. package/dist/textarea/Textarea.d.ts +14 -0
  675. package/dist/textarea/TextareaClearButton.d.ts +10 -0
  676. package/dist/textarea/TextareaGroup.d.ts +6 -0
  677. package/dist/textarea/TextareaLeadingIcon.d.ts +7 -0
  678. package/dist/textarea/TextareaTrailingIcon.d.ts +7 -0
  679. package/dist/textarea/index.d.mts +10 -53
  680. package/dist/textarea/index.d.ts +10 -53
  681. package/dist/textarea/index.js +2 -797
  682. package/dist/textarea/index.js.map +1 -1
  683. package/dist/textarea/index.mjs +50 -83
  684. package/dist/textarea/index.mjs.map +1 -1
  685. package/dist/toast/Toast.d.ts +4 -0
  686. package/dist/toast/Toast.styles.d.ts +10 -0
  687. package/dist/toast/index.d.mts +10 -53
  688. package/dist/toast/index.d.ts +10 -53
  689. package/dist/toast/index.js +2 -1454
  690. package/dist/toast/index.js.map +1 -1
  691. package/dist/toast/index.mjs +126 -180
  692. package/dist/toast/index.mjs.map +1 -1
  693. package/dist/toast/types.d.ts +41 -0
  694. package/dist/toast/useRenderSlot.d.ts +3 -0
  695. package/dist/toast/useToastManager.d.ts +2 -0
  696. package/dist/visually-hidden/VisuallyHidden.d.ts +12 -0
  697. package/dist/visually-hidden/index.d.mts +1 -16
  698. package/dist/visually-hidden/index.d.ts +1 -16
  699. package/dist/visually-hidden/index.js +2 -67
  700. package/dist/visually-hidden/index.js.map +1 -1
  701. package/dist/visually-hidden/index.mjs +3 -6
  702. package/dist/visually-hidden/index.mjs.map +1 -1
  703. package/package.json +6 -6
  704. package/dist/Input-N8AWWSmt.d.mts +0 -41
  705. package/dist/Input-N8AWWSmt.d.ts +0 -41
  706. package/dist/InputTrailingIcon-BBp7sE6D.d.mts +0 -20
  707. package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +0 -20
  708. package/dist/LabelRequiredIndicator-DRnCzHMU.d.mts +0 -19
  709. package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +0 -19
  710. package/dist/chunk-2YM6GKWW.mjs.map +0 -1
  711. package/dist/chunk-6QCEPQ3U.mjs +0 -26
  712. package/dist/chunk-6QCEPQ3U.mjs.map +0 -1
  713. package/dist/chunk-7EWSMIZU.mjs +0 -214
  714. package/dist/chunk-7EWSMIZU.mjs.map +0 -1
  715. package/dist/chunk-DCXWGQVZ.mjs +0 -53
  716. package/dist/chunk-DCXWGQVZ.mjs.map +0 -1
  717. package/dist/chunk-GAK4SC2F.mjs.map +0 -1
  718. package/dist/chunk-GPJMLIHC.mjs +0 -308
  719. package/dist/chunk-GPJMLIHC.mjs.map +0 -1
  720. package/dist/chunk-HLXYG643.mjs +0 -52
  721. package/dist/chunk-HLXYG643.mjs.map +0 -1
  722. package/dist/chunk-KEGAAGJW.mjs +0 -36
  723. package/dist/chunk-KEGAAGJW.mjs.map +0 -1
  724. package/dist/chunk-RKPP7ZOK.mjs.map +0 -1
  725. package/dist/chunk-UMUMFMFB.mjs +0 -68
  726. package/dist/chunk-UMUMFMFB.mjs.map +0 -1
  727. package/dist/chunk-VBX7BTNU.mjs +0 -614
  728. package/dist/chunk-VBX7BTNU.mjs.map +0 -1
  729. package/dist/chunk-XZ47F6TP.mjs.map +0 -1
  730. package/dist/index-Cno_GFuW.d.mts +0 -93
  731. package/dist/index-Cno_GFuW.d.ts +0 -93
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form-field/FormField.tsx","../../src/form-field/FormFieldContext.tsx","../../src/form-field/FormFieldProvider.tsx","../../src/form-field/FormFieldStateMessage.tsx","../../src/form-field/FormFieldMessage.tsx","../../src/form-field/FormFieldAlertMessage.tsx","../../src/form-field/FormFieldCharactersCount.tsx","../../src/form-field/FormFieldControl.tsx","../../src/form-field/FormFieldErrorMessage.tsx","../../src/form-field/FormFieldHelperMessage.tsx","../../src/form-field/FormFieldLabel.tsx","../../src/form-field/FormFieldRequiredIndicator.tsx","../../src/form-field/FormFieldSuccessMessage.tsx","../../src/form-field/index.ts"],"sourcesContent":["import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useId } from 'react'\n\nimport { Slot } from '../slot'\nimport { FormFieldContextState, ID_PREFIX } from './FormFieldContext'\nimport { FormFieldProvider } from './FormFieldProvider'\n\nexport interface FormFieldProps\n extends ComponentPropsWithoutRef<'div'>,\n Pick<FormFieldContextState, 'name' | 'state' | 'isRequired'> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n */\n asChild?: boolean\n /**\n * When `true`, prevents the user from interacting.\n */\n disabled?: boolean\n /**\n * Sets the component as interactive or not.\n */\n readOnly?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const FormField = ({\n className,\n disabled = false,\n readOnly = false,\n name,\n state,\n isRequired = false,\n asChild = false,\n ref,\n ...others\n}: FormFieldProps) => {\n const id = `${ID_PREFIX}-${useId()}`\n const Component = asChild ? Slot : 'div'\n\n return (\n <FormFieldProvider\n id={id}\n name={name}\n isRequired={isRequired}\n disabled={disabled}\n readOnly={readOnly}\n state={state}\n >\n <Component\n ref={ref}\n data-spark-component=\"form-field\"\n className={cx(className, 'gap-sm flex flex-col')}\n {...others}\n />\n </FormFieldProvider>\n )\n}\n\nFormField.displayName = 'FormField'\n","import { createContext, useContext } from 'react'\n\nexport interface FormFieldContextState {\n /**\n * Generated id for the input component.\n */\n id: string\n /**\n * Generated id for the label component.\n */\n labelId?: string\n /**\n * The name of the input. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * A set of ids separated by a space used to describe the input component given by a set of messages.\n */\n description?: string\n /**\n * Disables the field and its associated input\n */\n disabled?: boolean\n /**\n * Marks the field and its associated input as read only\n */\n readOnly?: boolean\n /**\n * The validation state of the input.\n */\n state?: 'error' | 'success' | 'alert'\n /**\n * If true, the form field will be invalid.\n */\n isInvalid?: boolean\n /**\n * If true, the form field will be required.\n */\n isRequired?: boolean\n /**\n * Callback used to store a descriptive message.\n */\n onMessageIdAdd: (id: string) => void\n /**\n * Callback used to remove a descriptive message.\n */\n onMessageIdRemove: (id: string) => void\n}\n\nexport const FormFieldContext = createContext<FormFieldContextState | null>(null)\n\nexport const ID_PREFIX = ':form-field'\n\nexport const useFormField = () => {\n const context = useContext(FormFieldContext)\n\n if (!context) {\n throw Error('useFormField must be used within a FormField provider')\n }\n\n return context\n}\n","import { ReactNode, useCallback, useId, useMemo, useState } from 'react'\n\nimport { FormFieldContext, FormFieldContextState, ID_PREFIX } from './FormFieldContext'\n\nexport interface FormFieldProviderProps\n extends Pick<\n FormFieldContextState,\n 'id' | 'name' | 'disabled' | 'readOnly' | 'state' | 'isRequired'\n > {\n children: ReactNode\n}\n\nexport const FormFieldProvider = ({\n id,\n name,\n disabled = false,\n readOnly = false,\n state,\n isRequired,\n children,\n}: FormFieldProviderProps) => {\n const labelId = `${ID_PREFIX}-label-${useId()}`\n const [messageIds, setMessageIds] = useState<string[]>([])\n const description = messageIds.length > 0 ? messageIds.join(' ') : undefined\n\n const handleMessageIdAdd = useCallback((msgId: string) => {\n setMessageIds(ids => [...ids, msgId])\n }, [])\n\n const handleMessageIdRemove = useCallback((msgId: string) => {\n setMessageIds(ids => ids.filter(current => current !== msgId))\n }, [])\n\n const value = useMemo(() => {\n const isInvalid = state === 'error'\n\n return {\n id,\n labelId,\n name,\n disabled,\n readOnly,\n state,\n isRequired,\n isInvalid,\n description,\n onMessageIdAdd: handleMessageIdAdd,\n onMessageIdRemove: handleMessageIdRemove,\n }\n }, [\n id,\n labelId,\n name,\n disabled,\n readOnly,\n description,\n state,\n isRequired,\n handleMessageIdAdd,\n handleMessageIdRemove,\n ])\n\n return <FormFieldContext.Provider value={value}>{children}</FormFieldContext.Provider>\n}\n\nFormFieldProvider.displayName = 'FormFieldProvider'\n","import { AlertOutline } from '@spark-ui/icons/AlertOutline'\nimport { Check } from '@spark-ui/icons/Check'\nimport { WarningOutline } from '@spark-ui/icons/WarningOutline'\nimport { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { useFormField } from './FormFieldContext'\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport interface FormFieldStateMessageProps extends FormFieldMessageProps {\n state: 'error' | 'alert' | 'success'\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldStateMessage = ({\n className,\n state,\n children,\n ref,\n ...others\n}: FormFieldStateMessageProps) => {\n const field = useFormField()\n\n if (field.state !== state) {\n return null\n }\n\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-state-message\"\n className={cx(\n 'gap-sm flex items-center',\n state === 'error' ? 'text-error' : 'text-on-surface/dim-1',\n className\n )}\n {...others}\n >\n {state === 'alert' && (\n <Icon size=\"sm\">\n <WarningOutline />\n </Icon>\n )}\n {state === 'error' && (\n <Icon size=\"sm\" intent=\"error\">\n <AlertOutline />\n </Icon>\n )}\n {state === 'success' && (\n <Icon size=\"sm\">\n <Check />\n </Icon>\n )}\n\n {children}\n </FormFieldMessage>\n )\n}\n\nFormFieldStateMessage.displayName = 'FormField.StateMessage'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useId } from 'react'\n\nimport { ID_PREFIX, useFormField } from './FormFieldContext'\n\nexport type FormFieldMessageProps = ComponentPropsWithoutRef<'span'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldMessage = ({\n id: idProp,\n className,\n ref,\n ...others\n}: FormFieldMessageProps) => {\n const { onMessageIdAdd, onMessageIdRemove } = useFormField()\n const currentId = `${ID_PREFIX}-message-${useId()}`\n const id = idProp || currentId\n\n useEffect(() => {\n onMessageIdAdd(id)\n\n return () => {\n onMessageIdRemove(id)\n }\n }, [id, onMessageIdAdd, onMessageIdRemove])\n\n return (\n <span\n ref={ref}\n id={id}\n data-spark-component=\"form-field-message\"\n className={cx(className, 'text-caption')}\n {...others}\n />\n )\n}\n\nFormFieldMessage.displayName = 'FormField.Message'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldAlertMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldAlertMessage = ({ ref, ...props }: FormFieldAlertMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-alert-message\"\n state=\"alert\"\n {...props}\n />\n )\n}\n\nFormFieldAlertMessage.displayName = 'FormField.AlertMessage'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useState } from 'react'\n\nimport { FormFieldMessage } from './FormFieldMessage'\n\nexport type FormFieldCharactersCountProps = ComponentPropsWithoutRef<'span'> & {\n /**\n * This description is for the screen reader, read when the input is focused.\n */\n description?: string\n /**\n * The live announcement is for the screen read after a delay once the input value changes.\n */\n liveAnnouncement?: ({ remainingChars }: { remainingChars: number }) => string\n /**\n * Current value for the input this component belongs to.\n */\n value?: string\n /**\n * Maximum numeric value to be displayed.\n */\n maxLength: number\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldCharactersCount = ({\n className,\n value = '',\n maxLength,\n description,\n liveAnnouncement,\n ref,\n ...others\n}: FormFieldCharactersCountProps) => {\n const [throttledValue, setThrottledValue] = useState(value)\n\n /**\n * The value is throttled to avoid spamming the aria-live region (and consequently the screen reader).\n */\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n setThrottledValue(value)\n }, 1000)\n\n return () => clearTimeout(timeoutId)\n }, [value])\n\n return (\n <span className=\"ml-auto self-start\">\n {description && (\n <FormFieldMessage className=\"default:sr-only\">{description}</FormFieldMessage>\n )}\n <span\n ref={ref}\n aria-hidden\n data-spark-component=\"form-field-characters-count\"\n className={cx(className, 'text-caption', 'text-neutral')}\n {...others}\n >\n {`${value.length}/${maxLength}`}\n </span>\n\n {liveAnnouncement && (\n <span className=\"sr-only\" aria-live=\"polite\">\n {liveAnnouncement({ remainingChars: maxLength - throttledValue.length })}\n </span>\n )}\n </span>\n )\n}\n\nFormFieldCharactersCount.displayName = 'FormField.CharactersCount'\n","import { ReactNode, useContext } from 'react'\n\nimport { FormFieldContext, FormFieldContextState } from './FormFieldContext'\n\ntype State = Partial<\n Pick<\n FormFieldContextState,\n | 'id'\n | 'name'\n | 'description'\n | 'labelId'\n | 'disabled'\n | 'readOnly'\n | 'state'\n | 'isInvalid'\n | 'isRequired'\n >\n>\n\nexport interface FormFieldControlProps {\n children: (state: State) => ReactNode\n}\n\nexport const useFormFieldControl = () => {\n const { id, name, description, disabled, readOnly, state, labelId, isInvalid, isRequired } =\n useContext(FormFieldContext) || {}\n\n return {\n id,\n name,\n description,\n disabled,\n readOnly,\n state,\n labelId,\n isInvalid,\n isRequired,\n } as State\n}\n\nexport const FormFieldControl = ({ children }: FormFieldControlProps) => {\n const props = useFormFieldControl()\n\n return <>{children(props)}</>\n}\n\nFormFieldControl.displayName = 'FormField.Control'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldErrorMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldErrorMessage = ({ ref, ...props }: FormFieldErrorMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-error-message\"\n state=\"error\"\n {...props}\n />\n )\n}\n\nFormFieldErrorMessage.displayName = 'FormField.ErrorMessage'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport type FormFieldHelperMessageProps = FormFieldMessageProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldHelperMessage = ({\n className,\n ref,\n ...others\n}: FormFieldHelperMessageProps) => {\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-helper-message\"\n className={cx('text-on-surface/dim-1', className)}\n {...others}\n />\n )\n}\n\nFormFieldHelperMessage.displayName = 'FormField.HelperMessage'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode, Ref } from 'react'\n\nimport { Label, LabelProps } from '../label'\nimport { Slottable } from '../slot'\nimport { useFormField } from './FormFieldContext'\nimport { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'\n\nexport interface FormFieldLabelProps extends LabelProps {\n /**\n * Element shown when the input is required inside the label.\n */\n requiredIndicator?: ReactNode\n ref?: Ref<HTMLLabelElement>\n}\n\nexport const FormFieldLabel = ({\n htmlFor: htmlForProp,\n className,\n children,\n requiredIndicator = <FormFieldRequiredIndicator />,\n asChild,\n ref,\n ...others\n}: FormFieldLabelProps) => {\n const control = useFormField()\n\n const { disabled, labelId, isRequired } = control\n const htmlFor = asChild ? undefined : htmlForProp || control.id\n\n return (\n <Label\n ref={ref}\n id={labelId}\n data-spark-component=\"form-field-label\"\n htmlFor={htmlFor}\n className={cx(className, disabled ? 'text-on-surface/dim-3 pointer-events-none' : undefined)}\n asChild={asChild}\n {...others}\n >\n <>\n <Slottable>{children}</Slottable>\n {isRequired && requiredIndicator}\n </>\n </Label>\n )\n}\n\nFormFieldLabel.displayName = 'FormField.Label'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Label, LabelRequiredIndicatorProps } from '../label'\n\nexport type FormFieldRequiredIndicatorProps = LabelRequiredIndicatorProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldRequiredIndicator = ({\n className,\n ref,\n ...props\n}: FormFieldRequiredIndicatorProps) => {\n return <Label.RequiredIndicator ref={ref} className={cx('ml-sm', className)} {...props} />\n}\n\nFormFieldRequiredIndicator.displayName = 'FormField.RequiredIndicator'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldSuccessMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldSuccessMessage = ({ ref, ...props }: FormFieldSuccessMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-success-message\"\n state=\"success\"\n {...props}\n />\n )\n}\n\nFormFieldSuccessMessage.displayName = 'FormField.SuccessMessage'\n","import { FormField as Root } from './FormField'\nimport { FormFieldAlertMessage } from './FormFieldAlertMessage'\nimport { FormFieldCharactersCount } from './FormFieldCharactersCount'\nimport { FormFieldControl } from './FormFieldControl'\nimport { FormFieldErrorMessage } from './FormFieldErrorMessage'\nimport { FormFieldHelperMessage } from './FormFieldHelperMessage'\nimport { FormFieldLabel } from './FormFieldLabel'\nimport { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'\nimport { FormFieldStateMessage } from './FormFieldStateMessage'\nimport { FormFieldSuccessMessage } from './FormFieldSuccessMessage'\n\nexport const FormField: typeof Root & {\n Label: typeof FormFieldLabel\n Control: typeof FormFieldControl\n StateMessage: typeof FormFieldStateMessage\n SuccessMessage: typeof FormFieldSuccessMessage\n AlertMessage: typeof FormFieldAlertMessage\n ErrorMessage: typeof FormFieldErrorMessage\n HelperMessage: typeof FormFieldHelperMessage\n RequiredIndicator: typeof FormFieldRequiredIndicator\n CharactersCount: typeof FormFieldCharactersCount\n} = Object.assign(Root, {\n Label: FormFieldLabel,\n Control: FormFieldControl,\n StateMessage: FormFieldStateMessage,\n SuccessMessage: FormFieldSuccessMessage,\n AlertMessage: FormFieldAlertMessage,\n ErrorMessage: FormFieldErrorMessage,\n HelperMessage: FormFieldHelperMessage,\n RequiredIndicator: FormFieldRequiredIndicator,\n CharactersCount: FormFieldCharactersCount,\n})\n\nFormField.displayName = 'FormField'\nFormFieldLabel.displayName = 'FormField.Label'\nFormFieldControl.displayName = 'FormField.Control'\nFormFieldStateMessage.displayName = 'FormField.StateMessage'\nFormFieldSuccessMessage.displayName = 'FormField.SuccessMessage'\nFormFieldAlertMessage.displayName = 'FormField.AlertMessage'\nFormFieldErrorMessage.displayName = 'FormField.ErrorMessage'\nFormFieldHelperMessage.displayName = 'FormField.HelperMessage'\nFormFieldRequiredIndicator.displayName = 'FormField.RequiredIndicator'\nFormFieldCharactersCount.displayName = 'FormField.CharactersCount'\n\nexport { type FormFieldProps } from './FormField'\nexport { type FormFieldStateMessageProps } from './FormFieldStateMessage'\nexport { type FormFieldControl, useFormFieldControl } from './FormFieldControl'\nexport { type FormFieldHelperMessageProps } from './FormFieldHelperMessage'\nexport { type FormFieldSuccessMessageProps } from './FormFieldSuccessMessage'\nexport { type FormFieldAlertMessageProps } from './FormFieldAlertMessage'\nexport { type FormFieldErrorMessageProps } from './FormFieldErrorMessage'\nexport { type FormFieldLabelProps } from './FormFieldLabel'\nexport { type FormFieldRequiredIndicatorProps } from './FormFieldRequiredIndicator'\nexport { type FormFieldCharactersCountProps } from './FormFieldCharactersCount'\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,UAAU;AACnB,SAAwC,SAAAA,cAAa;;;ACDrD,SAAS,eAAe,kBAAkB;AAiDnC,IAAM,mBAAmB,cAA4C,IAAI;AAEzE,IAAM,YAAY;AAElB,IAAM,eAAe,MAAM;AAChC,QAAM,UAAU,WAAW,gBAAgB;AAE3C,MAAI,CAAC,SAAS;AACZ,UAAM,MAAM,uDAAuD;AAAA,EACrE;AAEA,SAAO;AACT;;;AC7DA,SAAoB,aAAa,OAAO,SAAS,gBAAgB;AA8DxD;AAlDF,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAA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;AAAA,MACL,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,wBAAwB,cAAc;;;ACR/B,IAAMC,aAUT,OAAO,OAAO,WAAM;AAAA,EACtB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,iBAAiB;AACnB,CAAC;AAEDA,WAAU,cAAc;AACxB,eAAe,cAAc;AAC7B,iBAAiB,cAAc;AAC/B,sBAAsB,cAAc;AACpC,wBAAwB,cAAc;AACtC,sBAAsB,cAAc;AACpC,sBAAsB,cAAc;AACpC,uBAAuB,cAAc;AACrC,2BAA2B,cAAc;AACzC,yBAAyB,cAAc;","names":["useId","jsx","useId","cx","cx","useId","jsx","useId","cx","jsx","cx","jsx","cx","useEffect","useState","jsx","jsxs","useState","useEffect","cx","useContext","jsx","useContext","jsx","cx","jsx","cx","cx","cx","jsx","cx","Fragment","jsx","jsxs","cx","jsx","FormField"]}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/form-field/FormFieldContext.tsx","../../src/form-field/FormFieldProvider.tsx","../../src/form-field/FormField.tsx","../../src/form-field/FormFieldMessage.tsx","../../src/form-field/FormFieldStateMessage.tsx","../../src/form-field/FormFieldAlertMessage.tsx","../../src/form-field/FormFieldCharactersCount.tsx","../../src/form-field/FormFieldControl.tsx","../../src/form-field/FormFieldErrorMessage.tsx","../../src/form-field/FormFieldHelperMessage.tsx","../../src/form-field/FormFieldRequiredIndicator.tsx","../../src/form-field/FormFieldLabel.tsx","../../src/form-field/FormFieldSuccessMessage.tsx","../../src/form-field/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nexport interface FormFieldContextState {\n /**\n * Generated id for the input component.\n */\n id: string\n /**\n * Generated id for the label component.\n */\n labelId?: string\n /**\n * The name of the input. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * A set of ids separated by a space used to describe the input component given by a set of messages.\n */\n description?: string\n /**\n * Disables the field and its associated input\n */\n disabled?: boolean\n /**\n * Marks the field and its associated input as read only\n */\n readOnly?: boolean\n /**\n * The validation state of the input.\n */\n state?: 'error' | 'success' | 'alert'\n /**\n * If true, the form field will be invalid.\n */\n isInvalid?: boolean\n /**\n * If true, the form field will be required.\n */\n isRequired?: boolean\n /**\n * Callback used to store a descriptive message.\n */\n onMessageIdAdd: (id: string) => void\n /**\n * Callback used to remove a descriptive message.\n */\n onMessageIdRemove: (id: string) => void\n}\n\nexport const FormFieldContext = createContext<FormFieldContextState | null>(null)\n\nexport const ID_PREFIX = ':form-field'\n\nexport const useFormField = () => {\n const context = useContext(FormFieldContext)\n\n if (!context) {\n throw Error('useFormField must be used within a FormField provider')\n }\n\n return context\n}\n","import { ReactNode, useCallback, useId, useMemo, useState } from 'react'\n\nimport { FormFieldContext, FormFieldContextState, ID_PREFIX } from './FormFieldContext'\n\nexport interface FormFieldProviderProps\n extends Pick<\n FormFieldContextState,\n 'id' | 'name' | 'disabled' | 'readOnly' | 'state' | 'isRequired'\n > {\n children: ReactNode\n}\n\nexport const FormFieldProvider = ({\n id,\n name,\n disabled = false,\n readOnly = false,\n state,\n isRequired,\n children,\n}: FormFieldProviderProps) => {\n const labelId = `${ID_PREFIX}-label-${useId()}`\n const [messageIds, setMessageIds] = useState<string[]>([])\n const description = messageIds.length > 0 ? messageIds.join(' ') : undefined\n\n const handleMessageIdAdd = useCallback((msgId: string) => {\n setMessageIds(ids => [...ids, msgId])\n }, [])\n\n const handleMessageIdRemove = useCallback((msgId: string) => {\n setMessageIds(ids => ids.filter(current => current !== msgId))\n }, [])\n\n const value = useMemo(() => {\n const isInvalid = state === 'error'\n\n return {\n id,\n labelId,\n name,\n disabled,\n readOnly,\n state,\n isRequired,\n isInvalid,\n description,\n onMessageIdAdd: handleMessageIdAdd,\n onMessageIdRemove: handleMessageIdRemove,\n }\n }, [\n id,\n labelId,\n name,\n disabled,\n readOnly,\n description,\n state,\n isRequired,\n handleMessageIdAdd,\n handleMessageIdRemove,\n ])\n\n return <FormFieldContext.Provider value={value}>{children}</FormFieldContext.Provider>\n}\n\nFormFieldProvider.displayName = 'FormFieldProvider'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useId } from 'react'\n\nimport { Slot } from '../slot'\nimport { FormFieldContextState, ID_PREFIX } from './FormFieldContext'\nimport { FormFieldProvider } from './FormFieldProvider'\n\nexport interface FormFieldProps\n extends ComponentPropsWithoutRef<'div'>,\n Pick<FormFieldContextState, 'name' | 'state' | 'isRequired'> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n */\n asChild?: boolean\n /**\n * When `true`, prevents the user from interacting.\n */\n disabled?: boolean\n /**\n * Sets the component as interactive or not.\n */\n readOnly?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const FormField = ({\n className,\n disabled = false,\n readOnly = false,\n name,\n state,\n isRequired = false,\n asChild = false,\n ref,\n ...others\n}: FormFieldProps) => {\n const id = `${ID_PREFIX}-${useId()}`\n const Component = asChild ? Slot : 'div'\n\n return (\n <FormFieldProvider\n id={id}\n name={name}\n isRequired={isRequired}\n disabled={disabled}\n readOnly={readOnly}\n state={state}\n >\n <Component\n ref={ref}\n data-spark-component=\"form-field\"\n className={cx(className, 'gap-sm flex flex-col')}\n {...others}\n />\n </FormFieldProvider>\n )\n}\n\nFormField.displayName = 'FormField'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useId } from 'react'\n\nimport { ID_PREFIX, useFormField } from './FormFieldContext'\n\nexport type FormFieldMessageProps = ComponentPropsWithoutRef<'span'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldMessage = ({\n id: idProp,\n className,\n ref,\n ...others\n}: FormFieldMessageProps) => {\n const { onMessageIdAdd, onMessageIdRemove } = useFormField()\n const currentId = `${ID_PREFIX}-message-${useId()}`\n const id = idProp || currentId\n\n useEffect(() => {\n onMessageIdAdd(id)\n\n return () => {\n onMessageIdRemove(id)\n }\n }, [id, onMessageIdAdd, onMessageIdRemove])\n\n return (\n <span\n ref={ref}\n id={id}\n data-spark-component=\"form-field-message\"\n className={cx(className, 'text-caption')}\n {...others}\n />\n )\n}\n\nFormFieldMessage.displayName = 'FormField.Message'\n","import { AlertOutline } from '@spark-ui/icons/AlertOutline'\nimport { Check } from '@spark-ui/icons/Check'\nimport { WarningOutline } from '@spark-ui/icons/WarningOutline'\nimport { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { useFormField } from './FormFieldContext'\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport interface FormFieldStateMessageProps extends FormFieldMessageProps {\n state: 'error' | 'alert' | 'success'\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldStateMessage = ({\n className,\n state,\n children,\n ref,\n ...others\n}: FormFieldStateMessageProps) => {\n const field = useFormField()\n\n if (field.state !== state) {\n return null\n }\n\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-state-message\"\n className={cx(\n 'gap-sm flex items-center',\n state === 'error' ? 'text-error' : 'text-on-surface/dim-1',\n className\n )}\n {...others}\n >\n {state === 'alert' && (\n <Icon size=\"sm\">\n <WarningOutline />\n </Icon>\n )}\n {state === 'error' && (\n <Icon size=\"sm\" intent=\"error\">\n <AlertOutline />\n </Icon>\n )}\n {state === 'success' && (\n <Icon size=\"sm\">\n <Check />\n </Icon>\n )}\n\n {children}\n </FormFieldMessage>\n )\n}\n\nFormFieldStateMessage.displayName = 'FormField.StateMessage'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldAlertMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldAlertMessage = ({ ref, ...props }: FormFieldAlertMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-alert-message\"\n state=\"alert\"\n {...props}\n />\n )\n}\n\nFormFieldAlertMessage.displayName = 'FormField.AlertMessage'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useState } from 'react'\n\nimport { FormFieldMessage } from './FormFieldMessage'\n\nexport type FormFieldCharactersCountProps = ComponentPropsWithoutRef<'span'> & {\n /**\n * This description is for the screen reader, read when the input is focused.\n */\n description?: string\n /**\n * The live announcement is for the screen read after a delay once the input value changes.\n */\n liveAnnouncement?: ({ remainingChars }: { remainingChars: number }) => string\n /**\n * Current value for the input this component belongs to.\n */\n value?: string\n /**\n * Maximum numeric value to be displayed.\n */\n maxLength: number\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldCharactersCount = ({\n className,\n value = '',\n maxLength,\n description,\n liveAnnouncement,\n ref,\n ...others\n}: FormFieldCharactersCountProps) => {\n const [throttledValue, setThrottledValue] = useState(value)\n\n /**\n * The value is throttled to avoid spamming the aria-live region (and consequently the screen reader).\n */\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n setThrottledValue(value)\n }, 1000)\n\n return () => clearTimeout(timeoutId)\n }, [value])\n\n return (\n <span className=\"ml-auto self-start\">\n {description && (\n <FormFieldMessage className=\"default:sr-only\">{description}</FormFieldMessage>\n )}\n <span\n ref={ref}\n aria-hidden\n data-spark-component=\"form-field-characters-count\"\n className={cx(className, 'text-caption', 'text-neutral')}\n {...others}\n >\n {`${value.length}/${maxLength}`}\n </span>\n\n {liveAnnouncement && (\n <span className=\"sr-only\" aria-live=\"polite\">\n {liveAnnouncement({ remainingChars: maxLength - throttledValue.length })}\n </span>\n )}\n </span>\n )\n}\n\nFormFieldCharactersCount.displayName = 'FormField.CharactersCount'\n","import { ReactNode, useContext } from 'react'\n\nimport { FormFieldContext, FormFieldContextState } from './FormFieldContext'\n\ntype State = Partial<\n Pick<\n FormFieldContextState,\n | 'id'\n | 'name'\n | 'description'\n | 'labelId'\n | 'disabled'\n | 'readOnly'\n | 'state'\n | 'isInvalid'\n | 'isRequired'\n >\n>\n\nexport interface FormFieldControlProps {\n children: (state: State) => ReactNode\n}\n\nexport const useFormFieldControl = () => {\n const { id, name, description, disabled, readOnly, state, labelId, isInvalid, isRequired } =\n useContext(FormFieldContext) || {}\n\n return {\n id,\n name,\n description,\n disabled,\n readOnly,\n state,\n labelId,\n isInvalid,\n isRequired,\n } as State\n}\n\nexport const FormFieldControl = ({ children }: FormFieldControlProps) => {\n const props = useFormFieldControl()\n\n return <>{children(props)}</>\n}\n\nFormFieldControl.displayName = 'FormField.Control'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldErrorMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldErrorMessage = ({ ref, ...props }: FormFieldErrorMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-error-message\"\n state=\"error\"\n {...props}\n />\n )\n}\n\nFormFieldErrorMessage.displayName = 'FormField.ErrorMessage'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport type FormFieldHelperMessageProps = FormFieldMessageProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldHelperMessage = ({\n className,\n ref,\n ...others\n}: FormFieldHelperMessageProps) => {\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-helper-message\"\n className={cx('text-on-surface/dim-1', className)}\n {...others}\n />\n )\n}\n\nFormFieldHelperMessage.displayName = 'FormField.HelperMessage'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Label, LabelRequiredIndicatorProps } from '../label'\n\nexport type FormFieldRequiredIndicatorProps = LabelRequiredIndicatorProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldRequiredIndicator = ({\n className,\n ref,\n ...props\n}: FormFieldRequiredIndicatorProps) => {\n return <Label.RequiredIndicator ref={ref} className={cx('ml-sm', className)} {...props} />\n}\n\nFormFieldRequiredIndicator.displayName = 'FormField.RequiredIndicator'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode, Ref } from 'react'\n\nimport { Label, LabelProps } from '../label'\nimport { Slottable } from '../slot'\nimport { useFormField } from './FormFieldContext'\nimport { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'\n\nexport interface FormFieldLabelProps extends LabelProps {\n /**\n * Element shown when the input is required inside the label.\n */\n requiredIndicator?: ReactNode\n ref?: Ref<HTMLLabelElement>\n}\n\nexport const FormFieldLabel = ({\n htmlFor: htmlForProp,\n className,\n children,\n requiredIndicator = <FormFieldRequiredIndicator />,\n asChild,\n ref,\n ...others\n}: FormFieldLabelProps) => {\n const control = useFormField()\n\n const { disabled, labelId, isRequired } = control\n const htmlFor = asChild ? undefined : htmlForProp || control.id\n\n return (\n <Label\n ref={ref}\n id={labelId}\n data-spark-component=\"form-field-label\"\n htmlFor={htmlFor}\n className={cx(className, disabled ? 'text-on-surface/dim-3 pointer-events-none' : undefined)}\n asChild={asChild}\n {...others}\n >\n <>\n <Slottable>{children}</Slottable>\n {isRequired && requiredIndicator}\n </>\n </Label>\n )\n}\n\nFormFieldLabel.displayName = 'FormField.Label'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldSuccessMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldSuccessMessage = ({ ref, ...props }: FormFieldSuccessMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-success-message\"\n state=\"success\"\n {...props}\n />\n )\n}\n\nFormFieldSuccessMessage.displayName = 'FormField.SuccessMessage'\n","import { FormField as Root } from './FormField'\nimport { FormFieldAlertMessage } from './FormFieldAlertMessage'\nimport { FormFieldCharactersCount } from './FormFieldCharactersCount'\nimport { FormFieldControl } from './FormFieldControl'\nimport { FormFieldErrorMessage } from './FormFieldErrorMessage'\nimport { FormFieldHelperMessage } from './FormFieldHelperMessage'\nimport { FormFieldLabel } from './FormFieldLabel'\nimport { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'\nimport { FormFieldStateMessage } from './FormFieldStateMessage'\nimport { FormFieldSuccessMessage } from './FormFieldSuccessMessage'\n\nexport const FormField: typeof Root & {\n Label: typeof FormFieldLabel\n Control: typeof FormFieldControl\n StateMessage: typeof FormFieldStateMessage\n SuccessMessage: typeof FormFieldSuccessMessage\n AlertMessage: typeof FormFieldAlertMessage\n ErrorMessage: typeof FormFieldErrorMessage\n HelperMessage: typeof FormFieldHelperMessage\n RequiredIndicator: typeof FormFieldRequiredIndicator\n CharactersCount: typeof FormFieldCharactersCount\n} = Object.assign(Root, {\n Label: FormFieldLabel,\n Control: FormFieldControl,\n StateMessage: FormFieldStateMessage,\n SuccessMessage: FormFieldSuccessMessage,\n AlertMessage: FormFieldAlertMessage,\n ErrorMessage: FormFieldErrorMessage,\n HelperMessage: FormFieldHelperMessage,\n RequiredIndicator: FormFieldRequiredIndicator,\n CharactersCount: FormFieldCharactersCount,\n})\n\nFormField.displayName = 'FormField'\nFormFieldLabel.displayName = 'FormField.Label'\nFormFieldControl.displayName = 'FormField.Control'\nFormFieldStateMessage.displayName = 'FormField.StateMessage'\nFormFieldSuccessMessage.displayName = 'FormField.SuccessMessage'\nFormFieldAlertMessage.displayName = 'FormField.AlertMessage'\nFormFieldErrorMessage.displayName = 'FormField.ErrorMessage'\nFormFieldHelperMessage.displayName = 'FormField.HelperMessage'\nFormFieldRequiredIndicator.displayName = 'FormField.RequiredIndicator'\nFormFieldCharactersCount.displayName = 'FormField.CharactersCount'\n\nexport { type FormFieldProps } from './FormField'\nexport { type FormFieldStateMessageProps } from './FormFieldStateMessage'\nexport { type FormFieldControl, useFormFieldControl } from './FormFieldControl'\nexport { type FormFieldHelperMessageProps } from './FormFieldHelperMessage'\nexport { type FormFieldSuccessMessageProps } from './FormFieldSuccessMessage'\nexport { type FormFieldAlertMessageProps } from './FormFieldAlertMessage'\nexport { type FormFieldErrorMessageProps } from './FormFieldErrorMessage'\nexport { type FormFieldLabelProps } from './FormFieldLabel'\nexport { type FormFieldRequiredIndicatorProps } from './FormFieldRequiredIndicator'\nexport { type FormFieldCharactersCountProps } from './FormFieldCharactersCount'\n"],"names":["FormFieldContext","createContext","ID_PREFIX","useFormField","context","useContext","FormFieldProvider","id","name","disabled","readOnly","state","isRequired","children","labelId","useId","messageIds","setMessageIds","useState","description","handleMessageIdAdd","useCallback","msgId","ids","handleMessageIdRemove","current","value","useMemo","jsx","FormField","className","asChild","ref","others","Slot","cx","FormFieldMessage","idProp","onMessageIdAdd","onMessageIdRemove","currentId","useEffect","FormFieldStateMessage","jsxs","Icon","WarningOutline","AlertOutline","Check","FormFieldAlertMessage","props","FormFieldCharactersCount","maxLength","liveAnnouncement","throttledValue","setThrottledValue","timeoutId","useFormFieldControl","isInvalid","FormFieldControl","Fragment","FormFieldErrorMessage","FormFieldHelperMessage","FormFieldRequiredIndicator","Label","FormFieldLabel","htmlForProp","requiredIndicator","control","htmlFor","Slottable","FormFieldSuccessMessage","Root"],"mappings":";;;;;;;;;AAiDO,MAAMA,IAAmBC,EAA4C,IAAI,GAEnEC,IAAY,eAEZC,IAAe,MAAM;AAChC,QAAMC,IAAUC,EAAWL,CAAgB;AAE3C,MAAI,CAACI;AACH,UAAM,MAAM,uDAAuD;AAGrE,SAAOA;AACT,GCjDaE,IAAoB,CAAC;AAAA,EAChC,IAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AACF,MAA8B;AAC5B,QAAMC,IAAU,GAAGZ,CAAS,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AC,EAAE,KAAAtC,GAAK,GAAGiB,QAE9C,gBAAArB;AAAA,EAACc;AAAA,EAAA;AAAA,IACC,KAAAV;AAAA,IACA,wBAAqB;AAAA,IACrB,OAAM;AAAA,IACL,GAAGiB;AAAA,EAAA;AAAA;AAKVqB,EAAwB,cAAc;ACR/B,MAAMzC,IAUT,OAAO,OAAO0C,GAAM;AAAA,EACtB,OAAOP;AAAA,EACP,SAASN;AAAA,EACT,cAAchB;AAAA,EACd,gBAAgB4B;AAAA,EAChB,cAActB;AAAA,EACd,cAAcY;AAAA,EACd,eAAeC;AAAA,EACf,mBAAmBC;AAAA,EACnB,iBAAiBZ;AACnB,CAAC;AAEDrB,EAAU,cAAc;AACxBmC,EAAe,cAAc;AAC7BN,EAAiB,cAAc;AAC/BhB,EAAsB,cAAc;AACpC4B,EAAwB,cAAc;AACtCtB,EAAsB,cAAc;AACpCY,EAAsB,cAAc;AACpCC,EAAuB,cAAc;AACrCC,EAA2B,cAAc;AACzCZ,EAAyB,cAAc;"}
@@ -0,0 +1,17 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { IconVariantsProps } from './Icon.styles';
3
+ export interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {
4
+ /**
5
+ * The svg icon that will be wrapped
6
+ */
7
+ children: ReactNode;
8
+ /**
9
+ * The accessible label for the icon. This label will be visually hidden but announced to screen
10
+ * reader users, similar to `alt` text for `img` tags.
11
+ */
12
+ label?: string;
13
+ }
14
+ export declare const Icon: {
15
+ ({ label, className, size, intent, children, ...others }: IconProps): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
@@ -0,0 +1,6 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export declare const iconStyles: (props?: ({
3
+ intent?: "main" | "current" | "alert" | "error" | "support" | "accent" | "basic" | "success" | "info" | "neutral" | null | undefined;
4
+ size?: "current" | "sm" | "md" | "lg" | "xl" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ export type IconVariantsProps = VariantProps<typeof iconStyles>;
@@ -1,28 +1 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentPropsWithoutRef, ReactNode } from 'react';
3
- import * as class_variance_authority_types from 'class-variance-authority/types';
4
- import { VariantProps } from 'class-variance-authority';
5
-
6
- declare const iconStyles: (props?: ({
7
- intent?: "main" | "current" | "alert" | "error" | "support" | "accent" | "basic" | "success" | "info" | "neutral" | null | undefined;
8
- size?: "current" | "sm" | "md" | "lg" | "xl" | null | undefined;
9
- } & class_variance_authority_types.ClassProp) | undefined) => string;
10
- type IconVariantsProps = VariantProps<typeof iconStyles>;
11
-
12
- interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {
13
- /**
14
- * The svg icon that will be wrapped
15
- */
16
- children: ReactNode;
17
- /**
18
- * The accessible label for the icon. This label will be visually hidden but announced to screen
19
- * reader users, similar to `alt` text for `img` tags.
20
- */
21
- label?: string;
22
- }
23
- declare const Icon: {
24
- ({ label, className, size, intent, children, ...others }: IconProps): react_jsx_runtime.JSX.Element;
25
- displayName: string;
26
- };
27
-
28
- export { Icon, type IconProps };
1
+ export * from './Icon';
@@ -1,28 +1 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentPropsWithoutRef, ReactNode } from 'react';
3
- import * as class_variance_authority_types from 'class-variance-authority/types';
4
- import { VariantProps } from 'class-variance-authority';
5
-
6
- declare const iconStyles: (props?: ({
7
- intent?: "main" | "current" | "alert" | "error" | "support" | "accent" | "basic" | "success" | "info" | "neutral" | null | undefined;
8
- size?: "current" | "sm" | "md" | "lg" | "xl" | null | undefined;
9
- } & class_variance_authority_types.ClassProp) | undefined) => string;
10
- type IconVariantsProps = VariantProps<typeof iconStyles>;
11
-
12
- interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {
13
- /**
14
- * The svg icon that will be wrapped
15
- */
16
- children: ReactNode;
17
- /**
18
- * The accessible label for the icon. This label will be visually hidden but announced to screen
19
- * reader users, similar to `alt` text for `img` tags.
20
- */
21
- label?: string;
22
- }
23
- declare const Icon: {
24
- ({ label, className, size, intent, children, ...others }: IconProps): react_jsx_runtime.JSX.Element;
25
- displayName: string;
26
- };
27
-
28
- export { Icon, type IconProps };
1
+ export * from './Icon';
@@ -1,127 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/icon/index.ts
21
- var icon_exports = {};
22
- __export(icon_exports, {
23
- Icon: () => Icon
24
- });
25
- module.exports = __toCommonJS(icon_exports);
26
-
27
- // src/icon/Icon.tsx
28
- var import_react2 = require("react");
29
-
30
- // src/slot/Slot.tsx
31
- var import_radix_ui = require("radix-ui");
32
- var import_react = require("react");
33
- var import_jsx_runtime = require("react/jsx-runtime");
34
- var Slottable = import_radix_ui.Slot.Slottable;
35
- var Slot = ({ ref, ...props }) => {
36
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
37
- };
38
-
39
- // src/visually-hidden/VisuallyHidden.tsx
40
- var import_jsx_runtime2 = require("react/jsx-runtime");
41
- var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
42
- const Component = asChild ? Slot : "span";
43
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
44
- Component,
45
- {
46
- ...props,
47
- ref,
48
- style: {
49
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
50
- position: "absolute",
51
- border: 0,
52
- width: 1,
53
- height: 1,
54
- padding: 0,
55
- margin: -1,
56
- overflow: "hidden",
57
- clip: "rect(0, 0, 0, 0)",
58
- whiteSpace: "nowrap",
59
- wordWrap: "normal",
60
- ...props.style
61
- }
62
- }
63
- );
64
- };
65
- VisuallyHidden.displayName = "VisuallyHidden";
66
-
67
- // src/icon/Icon.styles.tsx
68
- var import_internal_utils = require("@spark-ui/internal-utils");
69
- var import_class_variance_authority = require("class-variance-authority");
70
- var iconStyles = (0, import_class_variance_authority.cva)(["fill-current shrink-0"], {
71
- variants: {
72
- /**
73
- * Color scheme of the icon.
74
- */
75
- intent: (0, import_internal_utils.makeVariants)({
76
- current: ["text-current"],
77
- main: ["text-main"],
78
- support: ["text-support"],
79
- accent: ["text-accent"],
80
- basic: ["text-basic"],
81
- success: ["text-success"],
82
- alert: ["text-alert"],
83
- error: ["text-error"],
84
- info: ["text-info"],
85
- neutral: ["text-neutral"]
86
- }),
87
- /**
88
- * Sets the size of the icon.
89
- */
90
- size: (0, import_internal_utils.makeVariants)({
91
- current: ["u-current-font-size"],
92
- sm: ["w-sz-16", "h-sz-16"],
93
- md: ["w-sz-24", "h-sz-24"],
94
- lg: ["w-sz-32", "h-sz-32"],
95
- xl: ["w-sz-40", "h-sz-40"]
96
- })
97
- }
98
- });
99
-
100
- // src/icon/Icon.tsx
101
- var import_jsx_runtime3 = require("react/jsx-runtime");
102
- var Icon = ({
103
- label,
104
- className,
105
- size = "current",
106
- intent = "current",
107
- children,
108
- ...others
109
- }) => {
110
- const child = import_react2.Children.only(children);
111
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
112
- (0, import_react2.cloneElement)(child, {
113
- className: iconStyles({ className, size, intent }),
114
- "data-spark-component": "icon",
115
- "aria-hidden": "true",
116
- focusable: "false",
117
- ...others
118
- }),
119
- label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VisuallyHidden, { children: label })
120
- ] });
121
- };
122
- Icon.displayName = "Icon";
123
- // Annotate the CommonJS export names for ESM import in node:
124
- 0 && (module.exports = {
125
- Icon
126
- });
127
- //# sourceMappingURL=index.js.map
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Icon-CF0W0LKr.js");exports.Icon=e.Icon;
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/icon/index.ts","../../src/icon/Icon.tsx","../../src/slot/Slot.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx"],"sourcesContent":["export * from './Icon'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA0F;;;ACA1F,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAC,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,MAAiB;AACpD,SAAO,4CAAC,gBAAAA,KAAU,MAAV,EAAe,KAAW,GAAG,OAAO;AAC9C;;;ACFI,IAAAC,sBAAA;AAJG,IAAM,iBAAiB,CAAC,EAAE,UAAU,OAAO,KAAK,GAAG,MAAM,MAA2B;AACzF,QAAM,YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,OAAO;AAAA;AAAA,QAEL,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,GAAG,MAAM;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;AAEA,eAAe,cAAc;;;ACrC7B,4BAA6B;AAC7B,sCAAkC;AAE3B,IAAM,iBAAa,qCAAI,CAAC,uBAAuB,GAAG;AAAA,EACvD,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,YAAQ,oCAcN;AAAA,MACA,SAAS,CAAC,cAAc;AAAA,MACxB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,CAAC,cAAc;AAAA,MACxB,QAAQ,CAAC,aAAa;AAAA,MACtB,OAAO,CAAC,YAAY;AAAA,MACpB,SAAS,CAAC,cAAc;AAAA,MACxB,OAAO,CAAC,YAAY;AAAA,MACpB,OAAO,CAAC,YAAY;AAAA,MACpB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,CAAC,cAAc;AAAA,IAC1B,CAAC;AAAA;AAAA;AAAA;AAAA,IAID,UAAM,oCAA0D;AAAA,MAC9D,SAAS,CAAC,qBAAqB;AAAA,MAC/B,IAAI,CAAC,WAAW,SAAS;AAAA,MACzB,IAAI,CAAC,WAAW,SAAS;AAAA,MACzB,IAAI,CAAC,WAAW,SAAS;AAAA,MACzB,IAAI,CAAC,WAAW,SAAS;AAAA,IAC3B,CAAC;AAAA,EACH;AACF,CAAC;;;AHjBG,IAAAC,sBAAA;AAXG,IAAM,OAAO,CAAC;AAAA,EACnB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT;AAAA,EACA,GAAG;AACL,MAAiB;AACf,QAAM,QAAQ,uBAAS,KAAK,QAAQ;AAEpC,SACE,8EACG;AAAA,oCAAa,OAA4C;AAAA,MACxD,WAAW,WAAW,EAAE,WAAW,MAAM,OAAO,CAAC;AAAA,MACjD,wBAAwB;AAAA,MACxB,eAAe;AAAA,MACf,WAAW;AAAA,MACX,GAAG;AAAA,IACL,CAAC;AAAA,IAEA,SAAS,6CAAC,kBAAgB,iBAAM;AAAA,KACnC;AAEJ;AAEA,KAAK,cAAc;","names":["import_react","RadixSlot","import_jsx_runtime","import_jsx_runtime"]}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,9 +1,5 @@
1
- import {
2
- Icon
3
- } from "../chunk-UMUMFMFB.mjs";
4
- import "../chunk-KEGAAGJW.mjs";
5
- import "../chunk-6QCEPQ3U.mjs";
1
+ import { I } from "../Icon-Ck-dhfLd.mjs";
6
2
  export {
7
- Icon
3
+ I as Icon
8
4
  };
9
- //# sourceMappingURL=index.mjs.map
5
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'react';
2
+ import { ButtonProps } from '../button';
3
+ export interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {
4
+ 'aria-label': string;
5
+ ref?: Ref<HTMLButtonElement>;
6
+ }
7
+ export declare const IconButton: {
8
+ ({ design, disabled, intent, shape, size, className, ref, ...others }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
9
+ displayName: string;
10
+ };
@@ -0,0 +1,5 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export declare const iconButtonStyles: (props?: ({
3
+ size?: "sm" | "md" | "lg" | null | undefined;
4
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
+ export type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>;
@@ -1,16 +1 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Ref } from 'react';
3
- import { ButtonProps } from '../button/index.mjs';
4
- import 'class-variance-authority/types';
5
- import 'class-variance-authority';
6
-
7
- interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {
8
- 'aria-label': string;
9
- ref?: Ref<HTMLButtonElement>;
10
- }
11
- declare const IconButton: {
12
- ({ design, disabled, intent, shape, size, className, ref, ...others }: IconButtonProps): react_jsx_runtime.JSX.Element;
13
- displayName: string;
14
- };
15
-
16
- export { IconButton, type IconButtonProps };
1
+ export * from './IconButton';
@@ -1,16 +1 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Ref } from 'react';
3
- import { ButtonProps } from '../button/index.js';
4
- import 'class-variance-authority/types';
5
- import 'class-variance-authority';
6
-
7
- interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {
8
- 'aria-label': string;
9
- ref?: Ref<HTMLButtonElement>;
10
- }
11
- declare const IconButton: {
12
- ({ design, disabled, intent, shape, size, className, ref, ...others }: IconButtonProps): react_jsx_runtime.JSX.Element;
13
- displayName: string;
14
- };
15
-
16
- export { IconButton, type IconButtonProps };
1
+ export * from './IconButton';