@spark-ui/components 17.2.2 → 17.2.3-beta.1

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 (528) hide show
  1. package/dist/carousel/index.js.map +1 -1
  2. package/dist/carousel/index.mjs.map +1 -1
  3. package/dist/checkbox/index.js.map +1 -1
  4. package/dist/checkbox/index.mjs.map +1 -1
  5. package/dist/src/accordion/Accordion.d.ts +27 -0
  6. package/dist/src/accordion/AccordionItem.d.ts +12 -0
  7. package/dist/src/accordion/AccordionItemContent.d.ts +12 -0
  8. package/dist/src/accordion/AccordionItemHeader.d.ts +9 -0
  9. package/dist/src/accordion/AccordionItemTrigger.d.ts +12 -0
  10. package/dist/src/accordion/index.d.mts +15 -0
  11. package/dist/src/accordion/index.d.ts +15 -0
  12. package/dist/src/accordion/useRenderSlot.d.ts +3 -0
  13. package/dist/src/alert-dialog/AlertDialog.d.ts +29 -0
  14. package/dist/src/alert-dialog/AlertDialogAction.d.ts +13 -0
  15. package/dist/src/alert-dialog/AlertDialogBody.d.ts +12 -0
  16. package/dist/src/alert-dialog/AlertDialogCancel.d.ts +13 -0
  17. package/dist/src/alert-dialog/AlertDialogContent.d.ts +9 -0
  18. package/dist/src/alert-dialog/AlertDialogContext.d.ts +12 -0
  19. package/dist/src/alert-dialog/AlertDialogDescription.d.ts +9 -0
  20. package/dist/src/alert-dialog/AlertDialogFooter.d.ts +10 -0
  21. package/dist/src/alert-dialog/AlertDialogHeader.d.ts +10 -0
  22. package/dist/src/alert-dialog/AlertDialogOverlay.d.ts +9 -0
  23. package/dist/src/alert-dialog/AlertDialogPortal.d.ts +7 -0
  24. package/dist/src/alert-dialog/AlertDialogTitle.d.ts +9 -0
  25. package/dist/src/alert-dialog/AlertDialogTrigger.d.ts +13 -0
  26. package/dist/src/alert-dialog/index.d.mts +38 -0
  27. package/dist/src/alert-dialog/index.d.ts +38 -0
  28. package/dist/src/alert-dialog/useRenderSlot.d.ts +3 -0
  29. package/dist/src/avatar/Avatar.d.ts +3 -0
  30. package/dist/src/avatar/AvatarAction.d.ts +9 -0
  31. package/dist/src/avatar/AvatarImage.d.ts +7 -0
  32. package/dist/src/avatar/AvatarOnlineBadge.d.ts +9 -0
  33. package/dist/src/avatar/AvatarPlaceholder.d.ts +8 -0
  34. package/dist/src/avatar/AvatarUser.d.ts +7 -0
  35. package/dist/src/avatar/context.d.ts +5 -0
  36. package/dist/src/avatar/index.d.mts +15 -0
  37. package/dist/src/avatar/index.d.ts +15 -0
  38. package/dist/src/avatar/types.d.ts +24 -0
  39. package/dist/src/badge/Badge.d.ts +9 -0
  40. package/dist/src/badge/BadgeItem.d.ts +31 -0
  41. package/dist/src/badge/BadgeItem.styles.d.ts +7 -0
  42. package/dist/src/badge/index.d.mts +1 -0
  43. package/dist/src/badge/index.d.ts +1 -0
  44. package/dist/src/breadcrumb/Breadcrumb.d.ts +10 -0
  45. package/dist/src/breadcrumb/Breadcrumb.styles.d.ts +0 -0
  46. package/dist/src/breadcrumb/BreadcrumbCurrentPage.d.ts +11 -0
  47. package/dist/src/breadcrumb/BreadcrumbItem.d.ts +9 -0
  48. package/dist/src/breadcrumb/BreadcrumbLink.d.ts +12 -0
  49. package/dist/src/breadcrumb/BreadcrumbSeparator.d.ts +10 -0
  50. package/dist/src/breadcrumb/index.d.mts +12 -0
  51. package/dist/src/breadcrumb/index.d.ts +12 -0
  52. package/dist/src/button/Button.d.ts +26 -0
  53. package/dist/src/button/Button.styles.d.ts +10 -0
  54. package/dist/src/button/index.d.mts +1 -0
  55. package/dist/src/button/index.d.ts +1 -0
  56. package/dist/src/button/variants/contrast.d.ts +41 -0
  57. package/dist/src/button/variants/filled.d.ts +41 -0
  58. package/dist/src/button/variants/ghost.d.ts +41 -0
  59. package/dist/src/button/variants/index.d.mts +5 -0
  60. package/dist/src/button/variants/index.d.ts +5 -0
  61. package/dist/src/button/variants/outlined.d.ts +41 -0
  62. package/dist/src/button/variants/tinted.d.ts +41 -0
  63. package/dist/src/card/Backdrop.d.ts +14 -0
  64. package/dist/src/card/Card.d.ts +16 -0
  65. package/dist/src/card/Card.styles.d.ts +7 -0
  66. package/dist/src/card/Content.d.ts +15 -0
  67. package/dist/src/card/Content.styles.d.ts +8 -0
  68. package/dist/src/card/context.d.ts +11 -0
  69. package/dist/src/card/index.d.mts +8 -0
  70. package/dist/src/card/index.d.ts +8 -0
  71. package/dist/src/card/utils.d.ts +3 -0
  72. package/dist/src/carousel/Carousel.d.ts +12 -0
  73. package/dist/src/carousel/CarouselControls.d.ts +9 -0
  74. package/dist/src/carousel/CarouselNextButton.d.ts +5 -0
  75. package/dist/src/carousel/CarouselPageIndicator.d.ts +14 -0
  76. package/dist/src/carousel/CarouselPagePicker.d.ts +14 -0
  77. package/dist/src/carousel/CarouselPrevButton.d.ts +5 -0
  78. package/dist/src/carousel/CarouselSlide.d.ts +12 -0
  79. package/dist/src/carousel/CarouselSlides.d.ts +10 -0
  80. package/dist/src/carousel/CarouselViewport.d.ts +9 -0
  81. package/dist/src/carousel/index.d.mts +19 -0
  82. package/dist/src/carousel/index.d.ts +19 -0
  83. package/dist/src/carousel/types.d.ts +165 -0
  84. package/dist/src/carousel/useCarousel.d.ts +2 -0
  85. package/dist/src/carousel/useCarouselVisibility.d.ts +13 -0
  86. package/dist/src/carousel/useEvent.d.ts +7 -0
  87. package/dist/src/carousel/useIsMounted.d.ts +1 -0
  88. package/dist/src/carousel/useIsVisible.d.ts +6 -0
  89. package/dist/src/carousel/useResizeObserver.d.ts +2 -0
  90. package/dist/src/carousel/useScrollEnd.d.ts +3 -0
  91. package/dist/src/carousel/useSnapPoints.d.ts +10 -0
  92. package/dist/src/carousel/utils.d.ts +24 -0
  93. package/dist/src/checkbox/Checkbox.d.ts +10 -0
  94. package/dist/src/checkbox/CheckboxGroup.d.ts +18 -0
  95. package/dist/src/checkbox/CheckboxGroup.styles.d.ts +5 -0
  96. package/dist/src/checkbox/CheckboxGroupContext.d.ts +41 -0
  97. package/dist/src/checkbox/CheckboxIndicator.d.ts +9 -0
  98. package/dist/src/checkbox/CheckboxInput.d.ts +47 -0
  99. package/dist/src/checkbox/CheckboxInput.styles.d.ts +5 -0
  100. package/dist/src/checkbox/CheckboxLabel.d.ts +12 -0
  101. package/dist/src/checkbox/CheckboxLabel.styles.d.ts +5 -0
  102. package/dist/src/checkbox/index.d.mts +2 -0
  103. package/dist/src/checkbox/index.d.ts +2 -0
  104. package/dist/src/chip/Chip.d.ts +34 -0
  105. package/dist/src/chip/Chip.styles.d.ts +8 -0
  106. package/dist/src/chip/ChipClearButton.d.ts +10 -0
  107. package/dist/src/chip/ChipClearButton.styles.d.ts +10 -0
  108. package/dist/src/chip/ChipContent.d.ts +8 -0
  109. package/dist/src/chip/ChipIcon.d.ts +8 -0
  110. package/dist/src/chip/ChipLeadingIcon.d.ts +9 -0
  111. package/dist/src/chip/ChipTrailingIcon.d.ts +9 -0
  112. package/dist/src/chip/index.d.mts +15 -0
  113. package/dist/src/chip/index.d.ts +15 -0
  114. package/dist/src/chip/useChipContext.d.ts +4 -0
  115. package/dist/src/chip/useChipElement.d.ts +41 -0
  116. package/dist/src/chip/variants/dashed.d.ts +45 -0
  117. package/dist/src/chip/variants/index.d.mts +3 -0
  118. package/dist/src/chip/variants/index.d.ts +3 -0
  119. package/dist/src/chip/variants/outlined.d.ts +45 -0
  120. package/dist/src/chip/variants/tinted.d.ts +45 -0
  121. package/dist/src/circular-meter/CircularMeter.d.ts +34 -0
  122. package/dist/src/circular-meter/CircularMeter.styles.d.ts +5 -0
  123. package/dist/src/circular-meter/CircularMeterContent.d.ts +6 -0
  124. package/dist/src/circular-meter/CircularMeterContext.d.ts +36 -0
  125. package/dist/src/circular-meter/CircularMeterLabel.d.ts +7 -0
  126. package/dist/src/circular-meter/CircularMeterTrack.d.ts +8 -0
  127. package/dist/src/circular-meter/CircularMeterValue.d.ts +7 -0
  128. package/dist/src/circular-meter/index.d.mts +16 -0
  129. package/dist/src/circular-meter/index.d.ts +16 -0
  130. package/dist/src/circular-meter/useIntersectionAnimation.d.ts +26 -0
  131. package/dist/src/collapsible/Content.d.ts +12 -0
  132. package/dist/src/collapsible/Root.d.ts +12 -0
  133. package/dist/src/collapsible/Trigger.d.ts +11 -0
  134. package/dist/src/collapsible/index.d.mts +7 -0
  135. package/dist/src/collapsible/index.d.ts +7 -0
  136. package/dist/src/collapsible/useRenderSlot.d.ts +3 -0
  137. package/dist/src/combobox/Combobox.d.ts +6 -0
  138. package/dist/src/combobox/ComboboxClearButton.d.ts +9 -0
  139. package/dist/src/combobox/ComboboxContext.d.ts +108 -0
  140. package/dist/src/combobox/ComboboxDisclosure.d.ts +13 -0
  141. package/dist/src/combobox/ComboboxEmpty.d.ts +11 -0
  142. package/dist/src/combobox/ComboboxGroup.d.ts +11 -0
  143. package/dist/src/combobox/ComboboxInput.d.ts +15 -0
  144. package/dist/src/combobox/ComboboxItem.d.ts +12 -0
  145. package/dist/src/combobox/ComboboxItemContext.d.ts +17 -0
  146. package/dist/src/combobox/ComboboxItemIndicator.d.ts +11 -0
  147. package/dist/src/combobox/ComboboxItemText.d.ts +10 -0
  148. package/dist/src/combobox/ComboboxItems.d.ts +11 -0
  149. package/dist/src/combobox/ComboboxItemsGroupContext.d.ts +8 -0
  150. package/dist/src/combobox/ComboboxLabel.d.ts +11 -0
  151. package/dist/src/combobox/ComboboxLeadingIcon.d.ts +7 -0
  152. package/dist/src/combobox/ComboboxPopover.d.ts +10 -0
  153. package/dist/src/combobox/ComboboxPortal.d.ts +2 -0
  154. package/dist/src/combobox/ComboboxSelectedItems.d.ts +4 -0
  155. package/dist/src/combobox/ComboboxTrigger.d.ts +11 -0
  156. package/dist/src/combobox/ComboboxTrigger.styles.d.ts +6 -0
  157. package/dist/src/combobox/index.d.mts +35 -0
  158. package/dist/src/combobox/index.d.ts +35 -0
  159. package/dist/src/combobox/tests/test-utils.d.ts +8 -0
  160. package/dist/src/combobox/types.d.ts +8 -0
  161. package/dist/src/combobox/useCombobox/multipleSelectionReducer.d.ts +13 -0
  162. package/dist/src/combobox/useCombobox/singleSelectionReducer.d.ts +8 -0
  163. package/dist/src/combobox/utils/index.d.mts +14 -0
  164. package/dist/src/combobox/utils/index.d.ts +14 -0
  165. package/dist/src/combobox/utils/useWidthIncreaseCallback.d.ts +2 -0
  166. package/dist/src/dialog/Dialog.d.ts +33 -0
  167. package/dist/src/dialog/DialogBody.d.ts +12 -0
  168. package/dist/src/dialog/DialogClose.d.ts +10 -0
  169. package/dist/src/dialog/DialogCloseButton.d.ts +9 -0
  170. package/dist/src/dialog/DialogContent.d.ts +14 -0
  171. package/dist/src/dialog/DialogContent.styles.d.ts +6 -0
  172. package/dist/src/dialog/DialogContext.d.ts +11 -0
  173. package/dist/src/dialog/DialogDescription.d.ts +9 -0
  174. package/dist/src/dialog/DialogFooter.d.ts +10 -0
  175. package/dist/src/dialog/DialogHeader.d.ts +10 -0
  176. package/dist/src/dialog/DialogOverlay.d.ts +9 -0
  177. package/dist/src/dialog/DialogPortal.d.ts +7 -0
  178. package/dist/src/dialog/DialogTitle.d.ts +9 -0
  179. package/dist/src/dialog/DialogTrigger.d.ts +13 -0
  180. package/dist/src/dialog/index.d.mts +37 -0
  181. package/dist/src/dialog/index.d.ts +37 -0
  182. package/dist/src/divider/Divider.d.ts +30 -0
  183. package/dist/src/divider/Divider.styles.d.ts +9 -0
  184. package/dist/src/divider/DividerContent.d.ts +13 -0
  185. package/dist/src/divider/index.d.mts +6 -0
  186. package/dist/src/divider/index.d.ts +6 -0
  187. package/dist/src/divider/variants/intents.d.ts +17 -0
  188. package/dist/src/drawer/Drawer.d.ts +32 -0
  189. package/dist/src/drawer/DrawerBody.d.ts +11 -0
  190. package/dist/src/drawer/DrawerBody.styles.d.ts +5 -0
  191. package/dist/src/drawer/DrawerClose.d.ts +13 -0
  192. package/dist/src/drawer/DrawerCloseButton.d.ts +7 -0
  193. package/dist/src/drawer/DrawerContent.d.ts +10 -0
  194. package/dist/src/drawer/DrawerContent.styles.d.ts +6 -0
  195. package/dist/src/drawer/DrawerContext.d.ts +9 -0
  196. package/dist/src/drawer/DrawerDescription.d.ts +9 -0
  197. package/dist/src/drawer/DrawerFooter.d.ts +8 -0
  198. package/dist/src/drawer/DrawerHeader.d.ts +10 -0
  199. package/dist/src/drawer/DrawerOverlay.d.ts +9 -0
  200. package/dist/src/drawer/DrawerPortal.d.ts +7 -0
  201. package/dist/src/drawer/DrawerTitle.d.ts +9 -0
  202. package/dist/src/drawer/DrawerTrigger.d.ts +13 -0
  203. package/dist/src/drawer/index.d.mts +37 -0
  204. package/dist/src/drawer/index.d.ts +37 -0
  205. package/dist/src/drawer/useRenderSlot.d.ts +3 -0
  206. package/dist/src/dropdown/Dropdown.d.ts +6 -0
  207. package/dist/src/dropdown/DropdownContext.d.ts +81 -0
  208. package/dist/src/dropdown/DropdownDivider.d.ts +10 -0
  209. package/dist/src/dropdown/DropdownGroup.d.ts +11 -0
  210. package/dist/src/dropdown/DropdownItem.d.ts +12 -0
  211. package/dist/src/dropdown/DropdownItemContext.d.ts +17 -0
  212. package/dist/src/dropdown/DropdownItemIndicator.d.ts +11 -0
  213. package/dist/src/dropdown/DropdownItemText.d.ts +9 -0
  214. package/dist/src/dropdown/DropdownItems.d.ts +21 -0
  215. package/dist/src/dropdown/DropdownItemsGroupContext.d.ts +8 -0
  216. package/dist/src/dropdown/DropdownLabel.d.ts +11 -0
  217. package/dist/src/dropdown/DropdownLeadingIcon.d.ts +7 -0
  218. package/dist/src/dropdown/DropdownPopover.d.ts +6 -0
  219. package/dist/src/dropdown/DropdownPortal.d.ts +2 -0
  220. package/dist/src/dropdown/DropdownTrigger.d.ts +12 -0
  221. package/dist/src/dropdown/DropdownTrigger.styles.d.ts +5 -0
  222. package/dist/src/dropdown/DropdownValue.d.ts +11 -0
  223. package/dist/src/dropdown/index.d.mts +29 -0
  224. package/dist/src/dropdown/index.d.ts +29 -0
  225. package/dist/src/dropdown/types.d.ts +8 -0
  226. package/dist/src/dropdown/useDropdown.d.ts +41 -0
  227. package/dist/src/dropdown/utils.d.ts +13 -0
  228. package/dist/src/file-upload/FileUpload.d.ts +130 -0
  229. package/dist/src/file-upload/FileUploadAcceptedFile.d.ts +25 -0
  230. package/dist/src/file-upload/FileUploadContext.d.ts +17 -0
  231. package/dist/src/file-upload/FileUploadDropzone.d.ts +10 -0
  232. package/dist/src/file-upload/FileUploadItemDeleteTrigger.d.ts +11 -0
  233. package/dist/src/file-upload/FileUploadPreviewImage.d.ts +17 -0
  234. package/dist/src/file-upload/FileUploadRejectedFile.d.ts +24 -0
  235. package/dist/src/file-upload/FileUploadRejectedFileDeleteTrigger.d.ts +12 -0
  236. package/dist/src/file-upload/FileUploadTrigger.d.ts +12 -0
  237. package/dist/src/file-upload/constants.d.ts +29 -0
  238. package/dist/src/file-upload/index.d.mts +22 -0
  239. package/dist/src/file-upload/index.d.ts +22 -0
  240. package/dist/src/file-upload/test-utils.d.ts +9 -0
  241. package/dist/src/file-upload/useFileUploadState.d.ts +88 -0
  242. package/dist/src/file-upload/utils.d.ts +40 -0
  243. package/dist/src/form-field/FormField.d.ts +21 -0
  244. package/dist/src/form-field/FormFieldAlertMessage.d.ts +9 -0
  245. package/dist/src/form-field/FormFieldCharactersCount.d.ts +26 -0
  246. package/dist/src/form-field/FormFieldContext.d.ts +49 -0
  247. package/dist/src/form-field/FormFieldControl.d.ts +12 -0
  248. package/dist/src/form-field/FormFieldErrorMessage.d.ts +9 -0
  249. package/dist/src/form-field/FormFieldHelperMessage.d.ts +9 -0
  250. package/dist/src/form-field/FormFieldLabel.d.ts +13 -0
  251. package/dist/src/form-field/FormFieldMessage.d.ts +8 -0
  252. package/dist/src/form-field/FormFieldProvider.d.ts +9 -0
  253. package/dist/src/form-field/FormFieldRequiredIndicator.d.ts +9 -0
  254. package/dist/src/form-field/FormFieldStateMessage.d.ts +10 -0
  255. package/dist/src/form-field/FormFieldSuccessMessage.d.ts +9 -0
  256. package/dist/src/form-field/index.d.mts +31 -0
  257. package/dist/src/form-field/index.d.ts +31 -0
  258. package/dist/src/icon/Icon.d.ts +17 -0
  259. package/dist/src/icon/Icon.styles.d.ts +6 -0
  260. package/dist/src/icon/index.d.mts +1 -0
  261. package/dist/src/icon/index.d.ts +1 -0
  262. package/dist/src/icon-button/IconButton.d.ts +10 -0
  263. package/dist/src/icon-button/IconButton.styles.d.ts +5 -0
  264. package/dist/src/icon-button/index.d.mts +1 -0
  265. package/dist/src/icon-button/index.d.ts +1 -0
  266. package/dist/src/input/Input.d.ts +14 -0
  267. package/dist/src/input/Input.styles.d.ts +11 -0
  268. package/dist/src/input/InputAddon.d.ts +9 -0
  269. package/dist/src/input/InputAddon.styles.d.ts +9 -0
  270. package/dist/src/input/InputClearButton.d.ts +12 -0
  271. package/dist/src/input/InputGroup.d.ts +17 -0
  272. package/dist/src/input/InputGroup.styles.d.ts +6 -0
  273. package/dist/src/input/InputGroupContext.d.ts +14 -0
  274. package/dist/src/input/InputIcon.d.ts +6 -0
  275. package/dist/src/input/InputLeadingAddon.d.ts +11 -0
  276. package/dist/src/input/InputLeadingIcon.d.ts +7 -0
  277. package/dist/src/input/InputTrailingAddon.d.ts +11 -0
  278. package/dist/src/input/InputTrailingIcon.d.ts +7 -0
  279. package/dist/src/input/index.d.mts +21 -0
  280. package/dist/src/input/index.d.ts +21 -0
  281. package/dist/src/input-otp/InputOTP.d.ts +90 -0
  282. package/dist/src/input-otp/InputOTP.styles.d.ts +10 -0
  283. package/dist/src/input-otp/InputOTPContext.d.ts +17 -0
  284. package/dist/src/input-otp/InputOTPGroup.d.ts +7 -0
  285. package/dist/src/input-otp/InputOTPSeparator.d.ts +7 -0
  286. package/dist/src/input-otp/InputOTPSlot.d.ts +12 -0
  287. package/dist/src/input-otp/index.d.mts +14 -0
  288. package/dist/src/input-otp/index.d.ts +14 -0
  289. package/dist/src/input-otp/useInputOTP.d.ts +48 -0
  290. package/dist/src/kbd/Kbd.d.ts +5 -0
  291. package/dist/src/kbd/index.d.mts +1 -0
  292. package/dist/src/kbd/index.d.ts +1 -0
  293. package/dist/src/label/Label.d.ts +9 -0
  294. package/dist/src/label/LabelRequiredIndicator.d.ts +6 -0
  295. package/dist/src/label/index.d.mts +7 -0
  296. package/dist/src/label/index.d.ts +7 -0
  297. package/dist/src/link-box/LinkBox.d.ts +8 -0
  298. package/dist/src/link-box/LinkBoxLink.d.ts +8 -0
  299. package/dist/src/link-box/LinkBoxRaised.d.ts +9 -0
  300. package/dist/src/link-box/index.d.mts +9 -0
  301. package/dist/src/link-box/index.d.ts +9 -0
  302. package/dist/src/meter/Meter.d.ts +18 -0
  303. package/dist/src/meter/MeterContext.d.ts +12 -0
  304. package/dist/src/meter/MeterLabel.d.ts +7 -0
  305. package/dist/src/meter/MeterTrack.d.ts +7 -0
  306. package/dist/src/meter/MeterTrack.styles.d.ts +8 -0
  307. package/dist/src/meter/MeterValue.d.ts +9 -0
  308. package/dist/src/meter/index.d.mts +13 -0
  309. package/dist/src/meter/index.d.ts +13 -0
  310. package/dist/src/meter/useIntersectionAnimation.d.ts +26 -0
  311. package/dist/src/pagination/Pagination.d.ts +8 -0
  312. package/dist/src/pagination/PaginationContext.d.ts +43 -0
  313. package/dist/src/pagination/PaginationEllipsis.d.ts +9 -0
  314. package/dist/src/pagination/PaginationFirstPageTrigger.d.ts +22 -0
  315. package/dist/src/pagination/PaginationItem.d.ts +31 -0
  316. package/dist/src/pagination/PaginationLastPageTrigger.d.ts +22 -0
  317. package/dist/src/pagination/PaginationNextTrigger.d.ts +22 -0
  318. package/dist/src/pagination/PaginationPages.d.ts +16 -0
  319. package/dist/src/pagination/PaginationPrevTrigger.d.ts +22 -0
  320. package/dist/src/pagination/index.d.mts +18 -0
  321. package/dist/src/pagination/index.d.ts +18 -0
  322. package/dist/src/pagination/utils.d.ts +1 -0
  323. package/dist/src/popover/Popover.d.ts +9 -0
  324. package/dist/src/popover/PopoverAnchor.d.ts +9 -0
  325. package/dist/src/popover/PopoverArrow.d.ts +9 -0
  326. package/dist/src/popover/PopoverCloseButton.d.ts +10 -0
  327. package/dist/src/popover/PopoverContent.d.ts +10 -0
  328. package/dist/src/popover/PopoverContent.styles.d.ts +9 -0
  329. package/dist/src/popover/PopoverContext.d.ts +15 -0
  330. package/dist/src/popover/PopoverHeader.d.ts +10 -0
  331. package/dist/src/popover/PopoverPortal.d.ts +7 -0
  332. package/dist/src/popover/PopoverTrigger.d.ts +9 -0
  333. package/dist/src/popover/index.d.mts +17 -0
  334. package/dist/src/popover/index.d.ts +17 -0
  335. package/dist/src/portal/Portal.d.ts +10 -0
  336. package/dist/src/portal/index.d.mts +1 -0
  337. package/dist/src/portal/index.d.ts +1 -0
  338. package/dist/src/progress/Progress.d.ts +24 -0
  339. package/dist/src/progress/ProgressContext.d.ts +13 -0
  340. package/dist/src/progress/ProgressIndicator.d.ts +13 -0
  341. package/dist/src/progress/ProgressLabel.d.ts +7 -0
  342. package/dist/src/progress/ProgressTrack.d.ts +7 -0
  343. package/dist/src/progress/ProgressValue.d.ts +7 -0
  344. package/dist/src/progress/index.d.mts +13 -0
  345. package/dist/src/progress/index.d.ts +13 -0
  346. package/dist/src/progress-tracker/ProgressTracker.d.ts +27 -0
  347. package/dist/src/progress-tracker/ProgressTracker.styles.d.ts +1 -0
  348. package/dist/src/progress-tracker/ProgressTrackerContext.d.ts +15 -0
  349. package/dist/src/progress-tracker/ProgressTrackerStep.d.ts +12 -0
  350. package/dist/src/progress-tracker/ProgressTrackerStep.styles.d.ts +10 -0
  351. package/dist/src/progress-tracker/ProgressTrackerStepIndicator.d.ts +15 -0
  352. package/dist/src/progress-tracker/ProgressTrackerStepIndicator.styles.d.ts +7 -0
  353. package/dist/src/progress-tracker/ProgressTrackerStepLabel.d.ts +9 -0
  354. package/dist/src/progress-tracker/index.d.mts +10 -0
  355. package/dist/src/progress-tracker/index.d.ts +10 -0
  356. package/dist/src/radio-group/Radio.d.ts +9 -0
  357. package/dist/src/radio-group/RadioGroup.d.ts +54 -0
  358. package/dist/src/radio-group/RadioGroup.styles.d.ts +5 -0
  359. package/dist/src/radio-group/RadioGroupContext.d.ts +5 -0
  360. package/dist/src/radio-group/RadioGroupProvider.d.ts +7 -0
  361. package/dist/src/radio-group/RadioIndicator.d.ts +18 -0
  362. package/dist/src/radio-group/RadioIndicator.styles.d.ts +5 -0
  363. package/dist/src/radio-group/RadioInput.d.ts +25 -0
  364. package/dist/src/radio-group/RadioInput.styles.d.ts +5 -0
  365. package/dist/src/radio-group/RadioLabel.d.ts +20 -0
  366. package/dist/src/radio-group/RadioLabel.styles.d.ts +5 -0
  367. package/dist/src/radio-group/index.d.mts +7 -0
  368. package/dist/src/radio-group/index.d.ts +7 -0
  369. package/dist/src/rating/Rating.d.ts +57 -0
  370. package/dist/src/rating/RatingStar.d.ts +19 -0
  371. package/dist/src/rating/RatingStar.styles.d.ts +14 -0
  372. package/dist/src/rating/index.d.mts +1 -0
  373. package/dist/src/rating/index.d.ts +1 -0
  374. package/dist/src/rating/types.d.ts +2 -0
  375. package/dist/src/rating/utils.d.ts +7 -0
  376. package/dist/src/rating-display/RatingDisplay.d.ts +31 -0
  377. package/dist/src/rating-display/RatingDisplayContext.d.ts +12 -0
  378. package/dist/src/rating-display/RatingDisplayCount.d.ts +12 -0
  379. package/dist/src/rating-display/RatingDisplayStar.d.ts +16 -0
  380. package/dist/src/rating-display/RatingDisplayStars.d.ts +22 -0
  381. package/dist/src/rating-display/RatingDisplayValue.d.ts +13 -0
  382. package/dist/src/rating-display/index.d.mts +14 -0
  383. package/dist/src/rating-display/index.d.ts +14 -0
  384. package/dist/src/rating-display/types.d.ts +1 -0
  385. package/dist/src/rating-display/utils.d.ts +10 -0
  386. package/dist/src/scrolling-list/ScrollingList.d.ts +57 -0
  387. package/dist/src/scrolling-list/ScrollingListControls.d.ts +18 -0
  388. package/dist/src/scrolling-list/ScrollingListItem.d.ts +17 -0
  389. package/dist/src/scrolling-list/ScrollingListItems.d.ts +11 -0
  390. package/dist/src/scrolling-list/ScrollingListNextButton.d.ts +5 -0
  391. package/dist/src/scrolling-list/ScrollingListPrevButton.d.ts +5 -0
  392. package/dist/src/scrolling-list/ScrollingListSkipButton.d.ts +9 -0
  393. package/dist/src/scrolling-list/index.d.mts +15 -0
  394. package/dist/src/scrolling-list/index.d.ts +15 -0
  395. package/dist/src/scrolling-list/useFocusWithinScroll.d.ts +3 -0
  396. package/dist/src/segmented-control/SegmentedControl.d.ts +22 -0
  397. package/dist/src/segmented-control/SegmentedControl.styles.d.ts +5 -0
  398. package/dist/src/segmented-control/SegmentedControlContext.d.ts +7 -0
  399. package/dist/src/segmented-control/SegmentedControlIndicator.d.ts +8 -0
  400. package/dist/src/segmented-control/SegmentedControlItem.d.ts +18 -0
  401. package/dist/src/segmented-control/index.d.mts +10 -0
  402. package/dist/src/segmented-control/index.d.ts +10 -0
  403. package/dist/src/segmented-gauge/SegmentedGauge.d.ts +66 -0
  404. package/dist/src/segmented-gauge/SegmentedGaugeContext.d.ts +14 -0
  405. package/dist/src/segmented-gauge/SegmentedGaugeLabel.d.ts +9 -0
  406. package/dist/src/segmented-gauge/SegmentedGaugeSegment.d.ts +12 -0
  407. package/dist/src/segmented-gauge/SegmentedGaugeTrack.d.ts +8 -0
  408. package/dist/src/segmented-gauge/index.d.mts +13 -0
  409. package/dist/src/segmented-gauge/index.d.ts +13 -0
  410. package/dist/src/select/Select.d.ts +6 -0
  411. package/dist/src/select/SelectContext.d.ts +59 -0
  412. package/dist/src/select/SelectGroup.d.ts +11 -0
  413. package/dist/src/select/SelectItem.d.ts +11 -0
  414. package/dist/src/select/SelectItems.d.ts +10 -0
  415. package/dist/src/select/SelectItemsGroupContext.d.ts +9 -0
  416. package/dist/src/select/SelectLabel.d.ts +8 -0
  417. package/dist/src/select/SelectLeadingIcon.d.ts +7 -0
  418. package/dist/src/select/SelectPlaceholder.d.ts +10 -0
  419. package/dist/src/select/SelectTrigger.d.ts +16 -0
  420. package/dist/src/select/SelectTrigger.styles.d.ts +5 -0
  421. package/dist/src/select/SelectValue.d.ts +15 -0
  422. package/dist/src/select/index.d.mts +21 -0
  423. package/dist/src/select/index.d.ts +21 -0
  424. package/dist/src/select/types.d.ts +6 -0
  425. package/dist/src/select/utils.d.ts +4 -0
  426. package/dist/src/skeleton/Skeleton.d.ts +17 -0
  427. package/dist/src/skeleton/Skeleton.styles.d.ts +5 -0
  428. package/dist/src/skeleton/SkeletonItem.d.ts +31 -0
  429. package/dist/src/skeleton/SkeletonItem.styles.d.ts +8 -0
  430. package/dist/src/skeleton/index.d.mts +8 -0
  431. package/dist/src/skeleton/index.d.ts +8 -0
  432. package/dist/src/slider/Slider.d.ts +55 -0
  433. package/dist/src/slider/Slider.styles.d.ts +1 -0
  434. package/dist/src/slider/SliderContext.d.ts +13 -0
  435. package/dist/src/slider/SliderControl.d.ts +7 -0
  436. package/dist/src/slider/SliderIndicator.d.ts +7 -0
  437. package/dist/src/slider/SliderLabel.d.ts +13 -0
  438. package/dist/src/slider/SliderMaxValue.d.ts +6 -0
  439. package/dist/src/slider/SliderMinValue.d.ts +6 -0
  440. package/dist/src/slider/SliderThumb.d.ts +7 -0
  441. package/dist/src/slider/SliderThumb.styles.d.ts +5 -0
  442. package/dist/src/slider/SliderThumbContext.d.ts +5 -0
  443. package/dist/src/slider/SliderTrack.d.ts +7 -0
  444. package/dist/src/slider/SliderTrack.styles.d.ts +6 -0
  445. package/dist/src/slider/SliderValue.d.ts +12 -0
  446. package/dist/src/slider/index.d.mts +20 -0
  447. package/dist/src/slider/index.d.ts +20 -0
  448. package/dist/src/slider/useSliderValueBoundaries.d.ts +12 -0
  449. package/dist/src/slot/Slot.d.ts +12 -0
  450. package/dist/src/slot/index.d.mts +1 -0
  451. package/dist/src/slot/index.d.ts +1 -0
  452. package/dist/src/snackbar/Snackbar.d.ts +29 -0
  453. package/dist/src/snackbar/SnackbarItem.d.ts +49 -0
  454. package/dist/src/snackbar/SnackbarItem.styles.d.ts +10 -0
  455. package/dist/src/snackbar/SnackbarItemAction.d.ts +10 -0
  456. package/dist/src/snackbar/SnackbarItemClose.d.ts +9 -0
  457. package/dist/src/snackbar/SnackbarItemContext.d.ts +8 -0
  458. package/dist/src/snackbar/SnackbarItemIcon.d.ts +7 -0
  459. package/dist/src/snackbar/SnackbarRegion.d.ts +30 -0
  460. package/dist/src/snackbar/SnackbarRegion.styles.d.ts +5 -0
  461. package/dist/src/snackbar/index.d.mts +13 -0
  462. package/dist/src/snackbar/index.d.ts +13 -0
  463. package/dist/src/snackbar/snackbarVariants.d.ts +74 -0
  464. package/dist/src/snackbar/useSnackbarGlobalStore.d.ts +18 -0
  465. package/dist/src/snackbar/useSwipe.d.ts +15 -0
  466. package/dist/src/spinner/Spinner.d.ts +9 -0
  467. package/dist/src/spinner/Spinner.styles.d.ts +7 -0
  468. package/dist/src/spinner/index.d.mts +1 -0
  469. package/dist/src/spinner/index.d.ts +1 -0
  470. package/dist/src/stepper/Stepper.d.ts +9 -0
  471. package/dist/src/stepper/StepperButton.d.ts +14 -0
  472. package/dist/src/stepper/StepperInput.d.ts +7 -0
  473. package/dist/src/stepper/index.d.mts +9 -0
  474. package/dist/src/stepper/index.d.ts +9 -0
  475. package/dist/src/stepper/types.d.ts +46 -0
  476. package/dist/src/stepper/useStepper.d.ts +2 -0
  477. package/dist/src/switch/Switch.d.ts +6 -0
  478. package/dist/src/switch/SwitchInput.d.ts +53 -0
  479. package/dist/src/switch/SwitchInput.styles.d.ts +16 -0
  480. package/dist/src/switch/SwitchLabel.d.ts +17 -0
  481. package/dist/src/switch/SwitchLabel.styles.d.ts +5 -0
  482. package/dist/src/switch/index.d.mts +1 -0
  483. package/dist/src/switch/index.d.ts +1 -0
  484. package/dist/src/tabs/Tabs.d.ts +24 -0
  485. package/dist/src/tabs/TabsContent.d.ts +22 -0
  486. package/dist/src/tabs/TabsContent.styles.d.ts +3 -0
  487. package/dist/src/tabs/TabsContext.d.ts +7 -0
  488. package/dist/src/tabs/TabsList.d.ts +20 -0
  489. package/dist/src/tabs/TabsList.styles.d.ts +3 -0
  490. package/dist/src/tabs/TabsPopover.d.ts +29 -0
  491. package/dist/src/tabs/TabsPopoverAbstraction.d.ts +27 -0
  492. package/dist/src/tabs/TabsRoot.styles.d.ts +1 -0
  493. package/dist/src/tabs/TabsTrigger.d.ts +41 -0
  494. package/dist/src/tabs/TabsTrigger.styles.d.ts +8 -0
  495. package/dist/src/tabs/index.d.mts +13 -0
  496. package/dist/src/tabs/index.d.ts +13 -0
  497. package/dist/src/tabs/useRenderSlot.d.ts +1 -0
  498. package/dist/src/tabs/useResizeObserver.d.ts +8 -0
  499. package/dist/src/tag/Tag.d.ts +17 -0
  500. package/dist/src/tag/Tag.styles.d.ts +8 -0
  501. package/dist/src/tag/index.d.mts +1 -0
  502. package/dist/src/tag/index.d.ts +1 -0
  503. package/dist/src/tag/variants/filled.d.ts +37 -0
  504. package/dist/src/tag/variants/index.d.mts +3 -0
  505. package/dist/src/tag/variants/index.d.ts +3 -0
  506. package/dist/src/tag/variants/outlined.d.ts +33 -0
  507. package/dist/src/tag/variants/tinted.d.ts +33 -0
  508. package/dist/src/text-link/TextLink.d.ts +16 -0
  509. package/dist/src/text-link/index.d.mts +1 -0
  510. package/dist/src/text-link/index.d.ts +1 -0
  511. package/dist/src/textarea/Textarea.d.ts +14 -0
  512. package/dist/src/textarea/TextareaClearButton.d.ts +10 -0
  513. package/dist/src/textarea/TextareaGroup.d.ts +6 -0
  514. package/dist/src/textarea/TextareaLeadingIcon.d.ts +7 -0
  515. package/dist/src/textarea/TextareaTrailingIcon.d.ts +7 -0
  516. package/dist/src/textarea/index.d.mts +14 -0
  517. package/dist/src/textarea/index.d.ts +14 -0
  518. package/dist/src/toast/Toast.d.ts +4 -0
  519. package/dist/src/toast/Toast.styles.d.ts +10 -0
  520. package/dist/src/toast/index.d.mts +20 -0
  521. package/dist/src/toast/index.d.ts +20 -0
  522. package/dist/src/toast/types.d.ts +44 -0
  523. package/dist/src/toast/useRenderSlot.d.ts +3 -0
  524. package/dist/src/toast/useToastManager.d.ts +2 -0
  525. package/dist/src/visually-hidden/VisuallyHidden.d.ts +12 -0
  526. package/dist/src/visually-hidden/index.d.mts +1 -0
  527. package/dist/src/visually-hidden/index.d.ts +1 -0
  528. package/package.json +7 -7
@@ -0,0 +1,8 @@
1
+ import { UseMultipleSelectionReturnValue, UseSelectReturnValue } from 'downshift';
2
+ export interface DropdownItem {
3
+ disabled: boolean;
4
+ value: string;
5
+ text: string;
6
+ }
7
+ export type ItemsMap = Map<string, DropdownItem>;
8
+ export type DownshiftState = UseSelectReturnValue<DropdownItem> & UseMultipleSelectionReturnValue<DropdownItem>;
@@ -0,0 +1,41 @@
1
+ import { DropdownItem, ItemsMap } from './types';
2
+ export interface DownshiftProps {
3
+ itemsMap: ItemsMap;
4
+ value: string | string[] | undefined;
5
+ defaultValue: string | string[] | undefined;
6
+ onValueChange: ((value: string) => void) | ((value: string[]) => void) | undefined;
7
+ open: boolean | undefined;
8
+ onOpenChange: ((isOpen: boolean) => void) | undefined;
9
+ defaultOpen: boolean | undefined;
10
+ multiple: boolean | undefined;
11
+ id: string;
12
+ labelId: string;
13
+ }
14
+ /**
15
+ * This hook abstract the complexity of using downshift with both single and multiple selection.
16
+ */
17
+ export declare const useDropdown: ({ itemsMap, defaultValue, value, onValueChange, open, onOpenChange, defaultOpen, multiple, id, labelId, }: DownshiftProps) => {
18
+ /** There is a Downshift bug in React 19, it duplicates some selectedItems */
19
+ selectedItems: DropdownItem[];
20
+ activeIndex: number;
21
+ getDropdownProps: <Options>(options?: import('downshift').UseMultipleSelectionGetDropdownPropsOptions & Options, extraOptions?: import('downshift').GetPropsCommonOptions) => Omit<import('downshift').Overwrite<import('downshift').UseMultipleSelectionGetDropdownReturnValue, Options>, "preventKeyAction">;
22
+ getSelectedItemProps: <Options>(options: import('downshift').UseMultipleSelectionGetSelectedItemPropsOptions<DropdownItem> & Options) => Omit<import('downshift').Overwrite<import('downshift').UseMultipleSelectionGetSelectedItemReturnValue, Options>, "index" | "selectedItem">;
23
+ reset: () => void;
24
+ addSelectedItem: (item: DropdownItem) => void;
25
+ removeSelectedItem: (item: DropdownItem) => void;
26
+ setSelectedItems: (items: DropdownItem[]) => void;
27
+ setActiveIndex: (index: number) => void;
28
+ highlightedIndex: number;
29
+ selectedItem: DropdownItem | null;
30
+ isOpen: boolean;
31
+ inputValue: string;
32
+ getToggleButtonProps: <Options>(options?: import('downshift').UseSelectGetToggleButtonPropsOptions & Options, otherOptions?: import('downshift').GetPropsCommonOptions) => import('downshift').Overwrite<import('downshift').UseSelectGetToggleButtonReturnValue, Options>;
33
+ getLabelProps: <Options>(options?: import('downshift').UseSelectGetLabelPropsOptions & Options) => import('downshift').Overwrite<import('downshift').UseSelectGetLabelPropsReturnValue, Options>;
34
+ getMenuProps: <Options>(options?: import('downshift').UseSelectGetMenuPropsOptions & Options, otherOptions?: import('downshift').GetPropsCommonOptions) => import('downshift').Overwrite<import('downshift').UseSelectGetMenuReturnValue, Options>;
35
+ getItemProps: <Options>(options: import('downshift').UseSelectGetItemPropsOptions<DropdownItem> & Options) => Omit<import('downshift').Overwrite<import('downshift').UseSelectGetItemPropsReturnValue, Options>, "item" | "index">;
36
+ openMenu: () => void;
37
+ closeMenu: () => void;
38
+ toggleMenu: () => void;
39
+ selectItem: (item: DropdownItem | null) => void;
40
+ setHighlightedIndex: (index: number) => void;
41
+ };
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { DropdownItem, ItemsMap } from './types';
3
+ export declare function getIndexByKey(map: ItemsMap, targetKey: string): number;
4
+ export declare const getElementByIndex: (map: ItemsMap, index: number) => DropdownItem | undefined;
5
+ export declare const getOrderedItems: (children: ReactNode, result?: DropdownItem[]) => DropdownItem[];
6
+ /**
7
+ * If Dropdown.Item children:
8
+ * - is a string, then the string is used.
9
+ * - is JSX markup, then we look for Dropdown.ItemText to get its string value.
10
+ */
11
+ export declare const getItemText: (children: ReactNode, itemText?: string) => string;
12
+ export declare const getItemsFromChildren: (children: ReactNode) => ItemsMap;
13
+ export declare const hasChildComponent: (children: ReactNode, displayName: string) => boolean;
@@ -0,0 +1,130 @@
1
+ import { ReactNode, Ref } from 'react';
2
+ import { FileAcceptDetails, FileChangeDetails, FileRejectDetails, FileUploadFileError, RejectedFile } from './useFileUploadState';
3
+ export type { FileAcceptDetails, FileChangeDetails, FileRejectDetails, FileUploadFileError, RejectedFile, };
4
+ export interface FileUploadProps {
5
+ /**
6
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
7
+ */
8
+ asChild?: boolean;
9
+ ref?: Ref<HTMLDivElement>;
10
+ children: ReactNode;
11
+ className?: string;
12
+ /**
13
+ * Initial files to display when the component mounts (uncontrolled mode)
14
+ */
15
+ defaultValue?: File[];
16
+ /**
17
+ * Controlled files value (controlled mode)
18
+ * When provided, the component becomes controlled
19
+ */
20
+ value?: File[];
21
+ /**
22
+ * Callback when files are accepted
23
+ * @param details - Details about the accepted files
24
+ */
25
+ onFileAccept?: (details: FileAcceptDetails) => void;
26
+ /**
27
+ * Callback when files are rejected
28
+ * @param details - Details about the rejected files and their errors
29
+ */
30
+ onFileReject?: (details: FileRejectDetails) => void;
31
+ /**
32
+ * Callback when files change (both accepted and rejected)
33
+ * For controlled mode, use this to update the value prop by extracting details.acceptedFiles
34
+ * @param details - Details about both accepted and rejected files
35
+ */
36
+ onFileChange?: (details: FileChangeDetails) => void;
37
+ /**
38
+ * Whether multiple files can be selected
39
+ * @default true
40
+ */
41
+ multiple?: boolean;
42
+ /**
43
+ * Comma-separated list of accepted file types
44
+ * Supports MIME types (e.g., "image/*", "image/png", "application/pdf")
45
+ * and file extensions (e.g., ".pdf", ".doc", ".jpg")
46
+ * @example "image/*"
47
+ * @example ".pdf,.doc"
48
+ * @example "image/png,image/jpeg,.pdf"
49
+ */
50
+ accept?: string;
51
+ /**
52
+ * Maximum number of files that can be uploaded
53
+ * Files beyond this limit will be rejected
54
+ */
55
+ maxFiles?: number;
56
+ /**
57
+ * Maximum file size in bytes
58
+ * Files larger than this will be rejected
59
+ */
60
+ maxFileSize?: number;
61
+ /**
62
+ * Minimum file size in bytes
63
+ * Files smaller than this will be rejected
64
+ */
65
+ minFileSize?: number;
66
+ /**
67
+ * When `true`, prevents the user from interacting with the file upload
68
+ */
69
+ disabled?: boolean;
70
+ /**
71
+ * When `true`, sets the file upload to read-only mode
72
+ */
73
+ readOnly?: boolean;
74
+ /**
75
+ * The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale.
76
+ * Used for formatting file sizes and error messages.
77
+ * @default Browser locale or 'en' if not available
78
+ */
79
+ locale?: string;
80
+ }
81
+ export declare const FileUploadContext: import('react').Context<{
82
+ inputRef: React.RefObject<HTMLInputElement | null>;
83
+ files: File[];
84
+ rejectedFiles: RejectedFile[];
85
+ addFiles: (files: File[]) => void;
86
+ removeFile: (index: number) => void;
87
+ removeRejectedFile: (index: number) => void;
88
+ clearFiles: () => void;
89
+ clearRejectedFiles: () => void;
90
+ triggerRef: React.RefObject<HTMLElement | null>;
91
+ dropzoneRef: React.RefObject<HTMLElement | null>;
92
+ deleteButtonRefs: React.MutableRefObject<HTMLButtonElement[]>;
93
+ rejectedFileDeleteButtonRefs: React.MutableRefObject<HTMLButtonElement[]>;
94
+ multiple: boolean;
95
+ maxFiles?: number;
96
+ maxFilesReached: boolean;
97
+ disabled: boolean;
98
+ readOnly: boolean;
99
+ locale: string;
100
+ description?: string;
101
+ isInvalid?: boolean;
102
+ isRequired?: boolean;
103
+ } | null>;
104
+ export declare const FileUpload: {
105
+ ({ asChild: _asChild, children, defaultValue, value: controlledValue, onFileAccept, onFileReject, onFileChange, multiple, accept, maxFiles, maxFileSize, minFileSize, disabled: disabledProp, readOnly: readOnlyProp, locale, }: FileUploadProps): import("react/jsx-runtime").JSX.Element;
106
+ displayName: string;
107
+ };
108
+ export declare const useFileUploadContext: () => {
109
+ inputRef: React.RefObject<HTMLInputElement | null>;
110
+ files: File[];
111
+ rejectedFiles: RejectedFile[];
112
+ addFiles: (files: File[]) => void;
113
+ removeFile: (index: number) => void;
114
+ removeRejectedFile: (index: number) => void;
115
+ clearFiles: () => void;
116
+ clearRejectedFiles: () => void;
117
+ triggerRef: React.RefObject<HTMLElement | null>;
118
+ dropzoneRef: React.RefObject<HTMLElement | null>;
119
+ deleteButtonRefs: React.MutableRefObject<HTMLButtonElement[]>;
120
+ rejectedFileDeleteButtonRefs: React.MutableRefObject<HTMLButtonElement[]>;
121
+ multiple: boolean;
122
+ maxFiles?: number;
123
+ maxFilesReached: boolean;
124
+ disabled: boolean;
125
+ readOnly: boolean;
126
+ locale: string;
127
+ description?: string;
128
+ isInvalid?: boolean;
129
+ isRequired?: boolean;
130
+ };
@@ -0,0 +1,25 @@
1
+ import { ComponentPropsWithoutRef, Ref } from 'react';
2
+ export interface FileUploadAcceptedFileProps extends ComponentPropsWithoutRef<'li'> {
3
+ ref?: Ref<HTMLLIElement>;
4
+ /**
5
+ * The file to display
6
+ */
7
+ file: File;
8
+ /**
9
+ * Upload progress value (0-100). When provided, displays a progress bar at the bottom of the file item.
10
+ */
11
+ uploadProgress?: number;
12
+ /**
13
+ * Accessible label for the delete button
14
+ */
15
+ deleteButtonAriaLabel: string;
16
+ /**
17
+ * Accessible label for the progress bar. Required when uploadProgress is provided.
18
+ */
19
+ progressAriaLabel?: string;
20
+ className?: string;
21
+ }
22
+ export declare const AcceptedFile: {
23
+ ({ className, file, uploadProgress, deleteButtonAriaLabel, progressAriaLabel, ...props }: FileUploadAcceptedFileProps): import("react/jsx-runtime").JSX.Element;
24
+ displayName: string;
25
+ };
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { RejectedFile } from './FileUpload';
3
+ export interface FileUploadContextProps {
4
+ /**
5
+ * Render prop that receives acceptedFiles, rejectedFiles, formatFileSize, and locale
6
+ */
7
+ children: (props: {
8
+ acceptedFiles: File[];
9
+ rejectedFiles: RejectedFile[];
10
+ formatFileSize: (bytes: number, locale?: string) => string;
11
+ locale?: string;
12
+ }) => ReactNode;
13
+ }
14
+ export declare const Context: {
15
+ ({ children }: FileUploadContextProps): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
@@ -0,0 +1,10 @@
1
+ export declare const DropzoneContext: import('react').Context<boolean>;
2
+ export declare const useDropzoneContext: () => boolean;
3
+ export declare function Dropzone({ children, className, unstyled, }: {
4
+ children?: React.ReactNode;
5
+ className?: string;
6
+ unstyled?: boolean;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export declare namespace Dropzone {
9
+ var displayName: string;
10
+ }
@@ -0,0 +1,11 @@
1
+ import { IconButton } from '../icon-button';
2
+ export interface FileUploadItemDeleteTriggerProps extends React.ComponentProps<typeof IconButton> {
3
+ /**
4
+ * The file to delete
5
+ */
6
+ file: File;
7
+ }
8
+ export declare const ItemDeleteTrigger: {
9
+ ({ className, file, onClick, ...props }: FileUploadItemDeleteTriggerProps): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
@@ -0,0 +1,17 @@
1
+ import { ComponentPropsWithoutRef, Ref } from 'react';
2
+ export interface FileUploadPreviewImageProps extends ComponentPropsWithoutRef<'div'> {
3
+ ref?: Ref<HTMLDivElement>;
4
+ className?: string;
5
+ /**
6
+ * The file to preview
7
+ */
8
+ file: File;
9
+ /**
10
+ * Fallback content when file is not an image or preview fails
11
+ */
12
+ fallback?: React.ReactNode;
13
+ }
14
+ export declare const PreviewImage: {
15
+ ({ className, file, fallback, ...props }: FileUploadPreviewImageProps): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
@@ -0,0 +1,24 @@
1
+ import { ComponentPropsWithoutRef, Ref } from 'react';
2
+ import { FileUploadFileError, RejectedFile as RejectedFileType } from './FileUpload';
3
+ export interface FileUploadRejectedFileProps extends ComponentPropsWithoutRef<'li'> {
4
+ ref?: Ref<HTMLLIElement>;
5
+ /**
6
+ * The rejected file to display
7
+ */
8
+ rejectedFile: RejectedFileType;
9
+ /**
10
+ * Function to render the error message for each error code
11
+ * @param error - The error code
12
+ * @returns The error message to display
13
+ */
14
+ renderError: (error: FileUploadFileError) => string;
15
+ /**
16
+ * Accessible label for the delete button
17
+ */
18
+ deleteButtonAriaLabel: string;
19
+ className?: string;
20
+ }
21
+ export declare const RejectedFile: {
22
+ ({ className, rejectedFile, renderError, deleteButtonAriaLabel, ...props }: FileUploadRejectedFileProps): import("react/jsx-runtime").JSX.Element;
23
+ displayName: string;
24
+ };
@@ -0,0 +1,12 @@
1
+ import { IconButton } from '../icon-button';
2
+ import { RejectedFile as RejectedFileType } from './FileUpload';
3
+ export interface FileUploadRejectedFileDeleteTriggerProps extends React.ComponentProps<typeof IconButton> {
4
+ /**
5
+ * The rejected file to remove
6
+ */
7
+ rejectedFile: RejectedFileType;
8
+ }
9
+ export declare const RejectedFileDeleteTrigger: {
10
+ ({ className, rejectedFile, onClick, ...props }: FileUploadRejectedFileDeleteTriggerProps): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
@@ -0,0 +1,12 @@
1
+ import { ReactNode, Ref } from 'react';
2
+ import { ButtonProps } from '../button';
3
+ export interface FileUploadTriggerProps extends Omit<ButtonProps, 'children' | 'disabled'> {
4
+ ref?: Ref<HTMLButtonElement>;
5
+ className?: string;
6
+ children: ReactNode;
7
+ unstyled?: boolean;
8
+ }
9
+ export declare const Trigger: {
10
+ ({ className, children, asChild, unstyled, design, intent, size, shape, ref, ...props }: FileUploadTriggerProps): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * File upload error codes
3
+ */
4
+ export declare const FILE_UPLOAD_ERRORS: {
5
+ /**
6
+ * Exceeds the maxFiles limit
7
+ */
8
+ readonly TOO_MANY_FILES: "TOO_MANY_FILES";
9
+ /**
10
+ * File type not in the accept list
11
+ */
12
+ readonly FILE_INVALID_TYPE: "FILE_INVALID_TYPE";
13
+ /**
14
+ * File size exceeds maxFileSize
15
+ */
16
+ readonly FILE_TOO_LARGE: "FILE_TOO_LARGE";
17
+ /**
18
+ * File size below minFileSize
19
+ */
20
+ readonly FILE_TOO_SMALL: "FILE_TOO_SMALL";
21
+ /**
22
+ * Generic validation failure
23
+ */
24
+ readonly FILE_INVALID: "FILE_INVALID";
25
+ /**
26
+ * Duplicate file detected
27
+ */
28
+ readonly FILE_EXISTS: "FILE_EXISTS";
29
+ };
@@ -0,0 +1,22 @@
1
+ import { FileAcceptDetails, FileChangeDetails, FileRejectDetails, FileUpload as Root, FileUploadFileError, RejectedFile } from './FileUpload';
2
+ import { AcceptedFile } from './FileUploadAcceptedFile';
3
+ import { Context } from './FileUploadContext';
4
+ import { FILE_UPLOAD_ERRORS } from './constants';
5
+ import { Dropzone } from './FileUploadDropzone';
6
+ import { ItemDeleteTrigger } from './FileUploadItemDeleteTrigger';
7
+ import { PreviewImage } from './FileUploadPreviewImage';
8
+ import { RejectedFile as RejectedFileComponent } from './FileUploadRejectedFile';
9
+ import { RejectedFileDeleteTrigger } from './FileUploadRejectedFileDeleteTrigger';
10
+ import { Trigger } from './FileUploadTrigger';
11
+ export type { FileAcceptDetails, FileChangeDetails, FileRejectDetails, RejectedFile, FileUploadFileError, };
12
+ export { FILE_UPLOAD_ERRORS };
13
+ export declare const FileUpload: typeof Root & {
14
+ Trigger: typeof Trigger;
15
+ Dropzone: typeof Dropzone;
16
+ Context: typeof Context;
17
+ ItemDeleteTrigger: typeof ItemDeleteTrigger;
18
+ PreviewImage: typeof PreviewImage;
19
+ AcceptedFile: typeof AcceptedFile;
20
+ RejectedFile: typeof RejectedFileComponent;
21
+ RejectedFileDeleteTrigger: typeof RejectedFileDeleteTrigger;
22
+ };
@@ -0,0 +1,22 @@
1
+ import { FileAcceptDetails, FileChangeDetails, FileRejectDetails, FileUpload as Root, FileUploadFileError, RejectedFile } from './FileUpload';
2
+ import { AcceptedFile } from './FileUploadAcceptedFile';
3
+ import { Context } from './FileUploadContext';
4
+ import { FILE_UPLOAD_ERRORS } from './constants';
5
+ import { Dropzone } from './FileUploadDropzone';
6
+ import { ItemDeleteTrigger } from './FileUploadItemDeleteTrigger';
7
+ import { PreviewImage } from './FileUploadPreviewImage';
8
+ import { RejectedFile as RejectedFileComponent } from './FileUploadRejectedFile';
9
+ import { RejectedFileDeleteTrigger } from './FileUploadRejectedFileDeleteTrigger';
10
+ import { Trigger } from './FileUploadTrigger';
11
+ export type { FileAcceptDetails, FileChangeDetails, FileRejectDetails, RejectedFile, FileUploadFileError, };
12
+ export { FILE_UPLOAD_ERRORS };
13
+ export declare const FileUpload: typeof Root & {
14
+ Trigger: typeof Trigger;
15
+ Dropzone: typeof Dropzone;
16
+ Context: typeof Context;
17
+ ItemDeleteTrigger: typeof ItemDeleteTrigger;
18
+ PreviewImage: typeof PreviewImage;
19
+ AcceptedFile: typeof AcceptedFile;
20
+ RejectedFile: typeof RejectedFileComponent;
21
+ RejectedFileDeleteTrigger: typeof RejectedFileDeleteTrigger;
22
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Helper function to simulate file upload in tests.
3
+ * Use this instead of userEvent.upload for file inputs, as userEvent.upload
4
+ * doesn't work correctly in this test environment.
5
+ *
6
+ * @param input - The file input element
7
+ * @param files - Single file or array of files to upload
8
+ */
9
+ export declare const uploadFiles: (input: HTMLInputElement, files: File | File[]) => void;
@@ -0,0 +1,88 @@
1
+ import { FILE_UPLOAD_ERRORS } from './constants';
2
+ export type FileUploadFileError = typeof FILE_UPLOAD_ERRORS.TOO_MANY_FILES | typeof FILE_UPLOAD_ERRORS.FILE_INVALID_TYPE | typeof FILE_UPLOAD_ERRORS.FILE_TOO_LARGE | typeof FILE_UPLOAD_ERRORS.FILE_TOO_SMALL | typeof FILE_UPLOAD_ERRORS.FILE_INVALID | typeof FILE_UPLOAD_ERRORS.FILE_EXISTS;
3
+ export interface RejectedFile {
4
+ file: File;
5
+ errors: FileUploadFileError[];
6
+ }
7
+ export interface FileAcceptDetails {
8
+ files: File[];
9
+ }
10
+ export interface FileRejectDetails {
11
+ files: RejectedFile[];
12
+ }
13
+ export interface FileChangeDetails {
14
+ acceptedFiles: File[];
15
+ rejectedFiles: RejectedFile[];
16
+ }
17
+ export interface UseFileUploadStateProps {
18
+ /**
19
+ * Initial files to display when the component mounts (uncontrolled mode)
20
+ */
21
+ defaultValue?: File[];
22
+ /**
23
+ * Controlled files value (controlled mode)
24
+ * When provided, the component becomes controlled
25
+ */
26
+ value?: File[];
27
+ /**
28
+ * Callback when files are accepted
29
+ */
30
+ onFileAccept?: (details: FileAcceptDetails) => void;
31
+ /**
32
+ * Callback when files are rejected
33
+ */
34
+ onFileReject?: (details: FileRejectDetails) => void;
35
+ /**
36
+ * Callback when files change (both accepted and rejected)
37
+ * For controlled mode, use this to update the value prop by extracting details.acceptedFiles
38
+ */
39
+ onFileChange?: (details: FileChangeDetails) => void;
40
+ /**
41
+ * Whether multiple files can be selected
42
+ * @default true
43
+ */
44
+ multiple?: boolean;
45
+ /**
46
+ * Comma-separated list of accepted file types
47
+ */
48
+ accept?: string;
49
+ /**
50
+ * Maximum number of files that can be uploaded
51
+ */
52
+ maxFiles?: number;
53
+ /**
54
+ * Maximum file size in bytes
55
+ */
56
+ maxFileSize?: number;
57
+ /**
58
+ * Minimum file size in bytes
59
+ */
60
+ minFileSize?: number;
61
+ /**
62
+ * When `true`, prevents the user from interacting with the file upload
63
+ */
64
+ disabled?: boolean;
65
+ /**
66
+ * When `true`, sets the file upload to read-only mode
67
+ */
68
+ readOnly?: boolean;
69
+ /**
70
+ * The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale.
71
+ * Used for formatting file sizes and error messages.
72
+ */
73
+ locale?: string;
74
+ }
75
+ export interface UseFileUploadStateReturn {
76
+ files: File[];
77
+ rejectedFiles: RejectedFile[];
78
+ addFiles: (files: File[]) => void;
79
+ removeFile: (index: number) => void;
80
+ removeRejectedFile: (index: number) => void;
81
+ clearFiles: () => void;
82
+ clearRejectedFiles: () => void;
83
+ maxFilesReached: boolean;
84
+ }
85
+ /**
86
+ * Hook that manages file upload state, validation, and file operations
87
+ */
88
+ export declare function useFileUploadState({ defaultValue, value: controlledValue, onFileAccept, onFileReject, onFileChange, multiple, accept, maxFiles, maxFileSize, minFileSize, disabled, readOnly, locale, }: UseFileUploadStateProps): UseFileUploadStateReturn;
@@ -0,0 +1,40 @@
1
+ import { ReactElement, RefObject } from 'react';
2
+ /**
3
+ * Validates if a file matches the accept patterns
4
+ * Supports MIME types (e.g., "image/*", "image/png", "application/pdf")
5
+ * and file extensions (e.g., ".pdf", ".doc", ".jpg")
6
+ */
7
+ export declare function validateFileAccept(file: File, accept: string): boolean;
8
+ /**
9
+ * Validates if a file size is within the allowed range
10
+ * @param file - The file to validate
11
+ * @param minFileSize - Minimum file size in bytes
12
+ * @param maxFileSize - Maximum file size in bytes
13
+ * @param locale - Locale code for error messages. Defaults to browser locale or 'en'
14
+ * @returns Object with validation result and error message if invalid
15
+ */
16
+ export declare function validateFileSize(file: File, minFileSize?: number, maxFileSize?: number, locale?: string): {
17
+ valid: boolean;
18
+ error?: string;
19
+ };
20
+ /**
21
+ * Formats file size in bytes to human-readable format
22
+ * @param bytes - File size in bytes
23
+ * @param locale - Locale code (e.g., 'en', 'fr'). Defaults to browser locale or 'en'
24
+ * @returns Formatted file size string with appropriate unit
25
+ */
26
+ export declare function formatFileSize(bytes: number, locale?: string): string;
27
+ /**
28
+ * Returns the appropriate icon component based on the file type
29
+ * @param file - The file to get the icon for
30
+ * @returns React element representing the icon component
31
+ */
32
+ export declare function getFileIcon(file: File): ReactElement;
33
+ /**
34
+ * Finds the first focusable element from a list of candidates
35
+ * Falls back to inputRef if no other element is focusable
36
+ * @param candidates - Array of candidate elements to check
37
+ * @param inputRef - Input element to use as last resort
38
+ * @returns The first focusable element, or null if none found
39
+ */
40
+ export declare function findFocusableElement(candidates: (HTMLElement | null)[], inputRef: RefObject<HTMLInputElement | null>): HTMLElement | null;
@@ -0,0 +1,21 @@
1
+ import { ComponentPropsWithoutRef, Ref } from 'react';
2
+ import { FormFieldContextState } from './FormFieldContext';
3
+ export interface FormFieldProps extends ComponentPropsWithoutRef<'div'>, Pick<FormFieldContextState, 'name' | 'state' | 'isRequired'> {
4
+ /**
5
+ * 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.
6
+ */
7
+ asChild?: boolean;
8
+ /**
9
+ * When `true`, prevents the user from interacting.
10
+ */
11
+ disabled?: boolean;
12
+ /**
13
+ * Sets the component as interactive or not.
14
+ */
15
+ readOnly?: boolean;
16
+ ref?: Ref<HTMLDivElement>;
17
+ }
18
+ export declare const FormField: {
19
+ ({ className, disabled, readOnly, name, state, isRequired, asChild, ref, ...others }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
20
+ displayName: string;
21
+ };
@@ -0,0 +1,9 @@
1
+ import { Ref } from 'react';
2
+ import { FormFieldStateMessageProps } from './FormFieldStateMessage';
3
+ export type FormFieldAlertMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {
4
+ ref?: Ref<HTMLSpanElement>;
5
+ };
6
+ export declare const FormFieldAlertMessage: {
7
+ ({ ref, ...props }: FormFieldAlertMessageProps): import("react/jsx-runtime").JSX.Element;
8
+ displayName: string;
9
+ };
@@ -0,0 +1,26 @@
1
+ import { ComponentPropsWithoutRef, Ref } from 'react';
2
+ export type FormFieldCharactersCountProps = ComponentPropsWithoutRef<'span'> & {
3
+ /**
4
+ * This description is for the screen reader, read when the input is focused.
5
+ */
6
+ description?: string;
7
+ /**
8
+ * The live announcement is for the screen read after a delay once the input value changes.
9
+ */
10
+ liveAnnouncement?: ({ remainingChars }: {
11
+ remainingChars: number;
12
+ }) => string;
13
+ /**
14
+ * Current value for the input this component belongs to.
15
+ */
16
+ value?: string;
17
+ /**
18
+ * Maximum numeric value to be displayed.
19
+ */
20
+ maxLength: number;
21
+ ref?: Ref<HTMLSpanElement>;
22
+ };
23
+ export declare const FormFieldCharactersCount: {
24
+ ({ className, value, maxLength, description, liveAnnouncement, ref, ...others }: FormFieldCharactersCountProps): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ };
@@ -0,0 +1,49 @@
1
+ export interface FormFieldContextState {
2
+ /**
3
+ * Generated id for the input component.
4
+ */
5
+ id: string;
6
+ /**
7
+ * Generated id for the label component.
8
+ */
9
+ labelId?: string;
10
+ /**
11
+ * The name of the input. Submitted with its owning form as part of a name/value pair.
12
+ */
13
+ name?: string;
14
+ /**
15
+ * A set of ids separated by a space used to describe the input component given by a set of messages.
16
+ */
17
+ description?: string;
18
+ /**
19
+ * Disables the field and its associated input
20
+ */
21
+ disabled?: boolean;
22
+ /**
23
+ * Marks the field and its associated input as read only
24
+ */
25
+ readOnly?: boolean;
26
+ /**
27
+ * The validation state of the input.
28
+ */
29
+ state?: 'error' | 'success' | 'alert';
30
+ /**
31
+ * If true, the form field will be invalid.
32
+ */
33
+ isInvalid?: boolean;
34
+ /**
35
+ * If true, the form field will be required.
36
+ */
37
+ isRequired?: boolean;
38
+ /**
39
+ * Callback used to store a descriptive message.
40
+ */
41
+ onMessageIdAdd: (id: string) => void;
42
+ /**
43
+ * Callback used to remove a descriptive message.
44
+ */
45
+ onMessageIdRemove: (id: string) => void;
46
+ }
47
+ export declare const FormFieldContext: import('react').Context<FormFieldContextState | null>;
48
+ export declare const ID_PREFIX = ":form-field";
49
+ export declare const useFormField: () => FormFieldContextState;