@react-md/core 1.0.0-next.13 → 1.0.0-next.15

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 (1595) hide show
  1. package/.eslintrc.cjs +8 -0
  2. package/.turbo/turbo-build.log +22 -22
  3. package/.turbo/turbo-lint.log +12 -0
  4. package/.turbo/turbo-test.log +5516 -0
  5. package/.turbo/turbo-typecheck.log +4 -0
  6. package/CHANGELOG.md +40 -0
  7. package/coverage/clover.xml +725 -141
  8. package/coverage/coverage-final.json +5 -4
  9. package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +876 -171
  10. package/coverage/lcov-report/{src/layout/LayoutCloseNavigationButton.tsx.html → autocomplete/AutocompleteClearButton.tsx.html} +54 -57
  11. package/coverage/lcov-report/{menu/MenuVisibilityProvider.tsx.html → autocomplete/FilterAutocompleteOptions.tsx.html} +147 -153
  12. package/coverage/lcov-report/autocomplete/index.html +35 -110
  13. package/coverage/lcov-report/button/Button.tsx.html +84 -84
  14. package/coverage/lcov-report/button/index.html +10 -10
  15. package/coverage/lcov-report/card/Card.tsx.html +5 -5
  16. package/coverage/lcov-report/{dialog/DialogTitle.tsx.html → card/CardSubtitle.tsx.html} +57 -48
  17. package/coverage/lcov-report/card/index.html +39 -9
  18. package/coverage/lcov-report/card/styles.ts.html +21 -33
  19. package/coverage/lcov-report/{src/positioning/createHorizontalPosition.ts.html → createHorizontalPosition.ts.html} +137 -137
  20. package/coverage/lcov-report/{src/positioning/createVerticalPosition.ts.html → createVerticalPosition.ts.html} +77 -77
  21. package/coverage/lcov-report/form/Option.tsx.html +141 -141
  22. package/coverage/lcov-report/form/index.html +28 -43
  23. package/coverage/lcov-report/form/useListboxProvider.ts.html +135 -96
  24. package/coverage/lcov-report/index.html +37 -22
  25. package/coverage/lcov-report/searching/fuzzy.ts.html +80 -83
  26. package/coverage/lcov-report/searching/index.html +13 -43
  27. package/coverage/lcov-report/src/card/Card.tsx.html +5 -5
  28. package/coverage/lcov-report/src/card/CardSubtitle.tsx.html +33 -6
  29. package/coverage/lcov-report/src/card/index.html +9 -84
  30. package/coverage/lcov-report/src/card/styles.ts.html +21 -33
  31. package/coverage/lcov-report/src/cssUtils.ts.html +65 -65
  32. package/coverage/lcov-report/src/index.html +21 -21
  33. package/coverage/lcov-report/src/transition/index.html +11 -311
  34. package/coverage/lcov-report/src/transition/useCSSTransition.ts.html +81 -81
  35. package/coverage/lcov-report/transition/index.html +12 -12
  36. package/coverage/lcov-report/{useCSSTransition.ts.html → transition/useCSSTransition.ts.html} +169 -166
  37. package/coverage/lcov-report/typography/SrOnly.tsx.html +52 -79
  38. package/coverage/lcov-report/typography/index.html +18 -18
  39. package/coverage/lcov-report/utils.ts.html +940 -97
  40. package/coverage/lcov.info +831 -181
  41. package/dist/CoreProviders.js.map +1 -1
  42. package/dist/NoSsr.js.map +1 -1
  43. package/dist/RootHtml.js.map +1 -1
  44. package/dist/SsrProvider.js.map +1 -1
  45. package/dist/_box-shadows.scss +7 -4
  46. package/dist/_core.scss +5 -1
  47. package/dist/_utils.scss +3 -3
  48. package/dist/app-bar/AppBar.js.map +1 -1
  49. package/dist/app-bar/AppBarTitle.d.ts +8 -4
  50. package/dist/app-bar/AppBarTitle.js +3 -2
  51. package/dist/app-bar/AppBarTitle.js.map +1 -1
  52. package/dist/autocomplete/Autocomplete.d.ts +85 -0
  53. package/dist/autocomplete/Autocomplete.js +138 -0
  54. package/dist/autocomplete/Autocomplete.js.map +1 -0
  55. package/dist/autocomplete/AutocompleteCircularProgress.d.ts +16 -0
  56. package/dist/autocomplete/AutocompleteCircularProgress.js +15 -0
  57. package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -0
  58. package/dist/autocomplete/AutocompleteDropdownButton.d.ts +32 -0
  59. package/dist/autocomplete/AutocompleteDropdownButton.js +29 -0
  60. package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -0
  61. package/dist/autocomplete/FilterAutocompleteOptions.d.ts +8 -0
  62. package/dist/autocomplete/FilterAutocompleteOptions.js +57 -0
  63. package/dist/autocomplete/FilterAutocompleteOptions.js.map +1 -0
  64. package/dist/autocomplete/_autocomplete.scss +75 -0
  65. package/dist/autocomplete/autocompleteStyles.d.ts +32 -0
  66. package/dist/autocomplete/autocompleteStyles.js +34 -0
  67. package/dist/autocomplete/autocompleteStyles.js.map +1 -0
  68. package/dist/autocomplete/defaults.d.ts +21 -0
  69. package/dist/autocomplete/defaults.js +52 -0
  70. package/dist/autocomplete/defaults.js.map +1 -0
  71. package/dist/autocomplete/types.d.ts +103 -0
  72. package/dist/autocomplete/types.js +5 -0
  73. package/dist/autocomplete/types.js.map +1 -0
  74. package/dist/avatar/Avatar.d.ts +1 -2
  75. package/dist/avatar/Avatar.js +1 -2
  76. package/dist/avatar/Avatar.js.map +1 -1
  77. package/dist/avatar/_avatar.scss +4 -3
  78. package/dist/avatar/styles.js.map +1 -1
  79. package/dist/badge/Badge.js.map +1 -1
  80. package/dist/box/Box.js.map +1 -1
  81. package/dist/box/styles.js.map +1 -1
  82. package/dist/button/AsyncButton.js +2 -2
  83. package/dist/button/AsyncButton.js.map +1 -1
  84. package/dist/button/Button.js.map +1 -1
  85. package/dist/button/ButtonUnstyled.js.map +1 -1
  86. package/dist/button/FloatingActionButton.js.map +1 -1
  87. package/dist/button/TooltippedButton.js.map +1 -1
  88. package/dist/button/buttonStyles.js.map +1 -1
  89. package/dist/button/buttonUnstyledStyles.js.map +1 -1
  90. package/dist/card/Card.d.ts +2 -1
  91. package/dist/card/Card.js.map +1 -1
  92. package/dist/card/CardContent.js.map +1 -1
  93. package/dist/card/CardFooter.js.map +1 -1
  94. package/dist/card/CardHeader.js.map +1 -1
  95. package/dist/card/CardSubtitle.d.ts +6 -0
  96. package/dist/card/CardSubtitle.js +2 -1
  97. package/dist/card/CardSubtitle.js.map +1 -1
  98. package/dist/card/CardTitle.js.map +1 -1
  99. package/dist/card/ClickableCard.js.map +1 -1
  100. package/dist/card/styles.js +2 -4
  101. package/dist/card/styles.js.map +1 -1
  102. package/dist/chip/Chip.js.map +1 -1
  103. package/dist/chip/styles.js.map +1 -1
  104. package/dist/cssUtils.d.ts +1 -1
  105. package/dist/cssUtils.js.map +1 -1
  106. package/dist/delegateEvent.js.map +1 -1
  107. package/dist/dialog/Dialog.js.map +1 -1
  108. package/dist/dialog/DialogContainer.js.map +1 -1
  109. package/dist/dialog/DialogContent.js.map +1 -1
  110. package/dist/dialog/DialogFooter.js.map +1 -1
  111. package/dist/dialog/DialogHeader.js.map +1 -1
  112. package/dist/dialog/DialogTitle.js.map +1 -1
  113. package/dist/dialog/FixedDialog.js.map +1 -1
  114. package/dist/dialog/NestedDialogProvider.js.map +1 -1
  115. package/dist/dialog/styles.js.map +1 -1
  116. package/dist/divider/Divider.js.map +1 -1
  117. package/dist/divider/styles.js.map +1 -1
  118. package/dist/draggable/useDraggable.js +2 -13
  119. package/dist/draggable/useDraggable.js.map +1 -1
  120. package/dist/draggable/utils.js.map +1 -1
  121. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  122. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  123. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  124. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  125. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  126. package/dist/focus/useFocusContainer.js.map +1 -1
  127. package/dist/focus/utils.js.map +1 -1
  128. package/dist/form/Checkbox.js.map +1 -1
  129. package/dist/form/Fieldset.js.map +1 -1
  130. package/dist/form/FileInput.js.map +1 -1
  131. package/dist/form/Form.js.map +1 -1
  132. package/dist/form/FormMessage.js.map +1 -1
  133. package/dist/form/FormMessageContainer.js.map +1 -1
  134. package/dist/form/FormMessageCounter.js.map +1 -1
  135. package/dist/form/InputToggle.js.map +1 -1
  136. package/dist/form/InputToggleIcon.js.map +1 -1
  137. package/dist/form/Label.js.map +1 -1
  138. package/dist/form/Legend.js.map +1 -1
  139. package/dist/form/MenuItemCheckbox.js.map +1 -1
  140. package/dist/form/MenuItemFileInput.js.map +1 -1
  141. package/dist/form/MenuItemInputToggle.js.map +1 -1
  142. package/dist/form/MenuItemRadio.js.map +1 -1
  143. package/dist/form/MenuItemSwitch.js.map +1 -1
  144. package/dist/form/MenuItemTextField.js.map +1 -1
  145. package/dist/form/NativeSelect.js.map +1 -1
  146. package/dist/form/OptGroup.js.map +1 -1
  147. package/dist/form/Option.js.map +1 -1
  148. package/dist/form/Password.js.map +1 -1
  149. package/dist/form/Radio.js.map +1 -1
  150. package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
  151. package/dist/form/Select.js.map +1 -1
  152. package/dist/form/SelectedOption.js.map +1 -1
  153. package/dist/form/Slider.js.map +1 -1
  154. package/dist/form/SliderContainer.js.map +1 -1
  155. package/dist/form/SliderMark.js.map +1 -1
  156. package/dist/form/SliderMarkLabel.js.map +1 -1
  157. package/dist/form/SliderThumb.js.map +1 -1
  158. package/dist/form/SliderTrack.js.map +1 -1
  159. package/dist/form/SliderValueMarks.js.map +1 -1
  160. package/dist/form/SliderValueTooltip.js.map +1 -1
  161. package/dist/form/Switch.js.map +1 -1
  162. package/dist/form/SwitchTrack.js.map +1 -1
  163. package/dist/form/TextArea.js.map +1 -1
  164. package/dist/form/TextField.d.ts +1 -10
  165. package/dist/form/TextField.js +1 -2
  166. package/dist/form/TextField.js.map +1 -1
  167. package/dist/form/TextFieldAddon.js +5 -2
  168. package/dist/form/TextFieldAddon.js.map +1 -1
  169. package/dist/form/TextFieldContainer.js.map +1 -1
  170. package/dist/form/_form.scss +81 -40
  171. package/dist/form/fileUtils.js.map +1 -1
  172. package/dist/form/formConfig.js.map +1 -1
  173. package/dist/form/formMessageStyles.js.map +1 -1
  174. package/dist/form/inputToggleStyles.js.map +1 -1
  175. package/dist/form/menuItemInputToggleStyles.js.map +1 -1
  176. package/dist/form/nativeSelectStyles.js.map +1 -1
  177. package/dist/form/optionStyles.js.map +1 -1
  178. package/dist/form/passwordStyles.js.map +1 -1
  179. package/dist/form/selectStyles.js.map +1 -1
  180. package/dist/form/selectUtils.js.map +1 -1
  181. package/dist/form/sliderUtils.js.map +1 -1
  182. package/dist/form/switchStyles.js.map +1 -1
  183. package/dist/form/textAreaStyles.js.map +1 -1
  184. package/dist/form/textFieldContainerStyles.js.map +1 -1
  185. package/dist/form/textFieldStyles.js.map +1 -1
  186. package/dist/form/types.js.map +1 -1
  187. package/dist/form/useCheckboxGroup.js.map +1 -1
  188. package/dist/form/useCombobox.d.ts +6 -6
  189. package/dist/form/useCombobox.js +1 -1
  190. package/dist/form/useCombobox.js.map +1 -1
  191. package/dist/form/useEditableCombobox.js +3 -0
  192. package/dist/form/useEditableCombobox.js.map +1 -1
  193. package/dist/form/useFileUpload.js.map +1 -1
  194. package/dist/form/useFormReset.js.map +1 -1
  195. package/dist/form/useListboxProvider.js.map +1 -1
  196. package/dist/form/useNumberField.js.map +1 -1
  197. package/dist/form/useRadioGroup.js.map +1 -1
  198. package/dist/form/useRangeSlider.js.map +1 -1
  199. package/dist/form/useResizingTextArea.js.map +1 -1
  200. package/dist/form/useSelectCombobox.js.map +1 -1
  201. package/dist/form/useSlider.js.map +1 -1
  202. package/dist/form/useTextField.js.map +1 -1
  203. package/dist/form/useTextFieldContainerAddons.d.ts +88 -0
  204. package/dist/form/useTextFieldContainerAddons.js +85 -0
  205. package/dist/form/useTextFieldContainerAddons.js.map +1 -0
  206. package/dist/form/utils.js.map +1 -1
  207. package/dist/form/validation.js.map +1 -1
  208. package/dist/hoverMode/useHoverMode.js.map +1 -1
  209. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  210. package/dist/icon/FontIcon.d.ts +10 -6
  211. package/dist/icon/FontIcon.js +1 -5
  212. package/dist/icon/FontIcon.js.map +1 -1
  213. package/dist/icon/IconRotator.js.map +1 -1
  214. package/dist/icon/MaterialIcon.d.ts +19 -2
  215. package/dist/icon/MaterialIcon.js +14 -2
  216. package/dist/icon/MaterialIcon.js.map +1 -1
  217. package/dist/icon/MaterialSymbol.js.map +1 -1
  218. package/dist/icon/SVGIcon.d.ts +3 -0
  219. package/dist/icon/SVGIcon.js.map +1 -1
  220. package/dist/icon/TextIconSpacing.js.map +1 -1
  221. package/dist/icon/iconConfig.d.ts +8 -0
  222. package/dist/icon/iconConfig.js +4 -0
  223. package/dist/icon/iconConfig.js.map +1 -1
  224. package/dist/icon/material.d.ts +1 -1
  225. package/dist/icon/material.js.map +1 -1
  226. package/dist/icon/materialConfig.js.map +1 -1
  227. package/dist/icon/styles.js.map +1 -1
  228. package/dist/interaction/Ripple.js.map +1 -1
  229. package/dist/interaction/RippleContainer.js.map +1 -1
  230. package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
  231. package/dist/interaction/config.js.map +1 -1
  232. package/dist/interaction/types.js.map +1 -1
  233. package/dist/interaction/useElementInteraction.js.map +1 -1
  234. package/dist/interaction/useHigherContrastChildren.js.map +1 -1
  235. package/dist/interaction/utils.js.map +1 -1
  236. package/dist/layout/LayoutAppBar.js.map +1 -1
  237. package/dist/layout/LayoutNav.js.map +1 -1
  238. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  239. package/dist/layout/Main.js.map +1 -1
  240. package/dist/layout/layoutNavStyles.js.map +1 -1
  241. package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
  242. package/dist/layout/mainStyles.js.map +1 -1
  243. package/dist/layout/useExpandableLayout.js.map +1 -1
  244. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  245. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  246. package/dist/layout/useLayoutTree.js.map +1 -1
  247. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  248. package/dist/layout/useMainTabIndex.js.map +1 -1
  249. package/dist/layout/useResizableLayout.js.map +1 -1
  250. package/dist/layout/useTemporaryLayout.js.map +1 -1
  251. package/dist/link/Link.d.ts +2 -4
  252. package/dist/link/Link.js +1 -2
  253. package/dist/link/Link.js.map +1 -1
  254. package/dist/link/SkipToMainContent.d.ts +10 -3
  255. package/dist/link/SkipToMainContent.js +4 -1
  256. package/dist/link/SkipToMainContent.js.map +1 -1
  257. package/dist/link/styles.d.ts +2 -2
  258. package/dist/link/styles.js.map +1 -1
  259. package/dist/list/List.js.map +1 -1
  260. package/dist/list/ListItem.js.map +1 -1
  261. package/dist/list/ListItemAddon.js.map +1 -1
  262. package/dist/list/ListItemChildren.js.map +1 -1
  263. package/dist/list/ListItemLink.js.map +1 -1
  264. package/dist/list/ListItemText.js.map +1 -1
  265. package/dist/list/ListSubheader.js.map +1 -1
  266. package/dist/list/getListItemHeight.js.map +1 -1
  267. package/dist/list/listItemStyles.js.map +1 -1
  268. package/dist/list/types.js.map +1 -1
  269. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  270. package/dist/media-queries/appSize.js.map +1 -1
  271. package/dist/media-queries/useMediaQuery.js.map +1 -1
  272. package/dist/menu/DropdownMenu.js.map +1 -1
  273. package/dist/menu/Menu.js.map +1 -1
  274. package/dist/menu/MenuBar.js.map +1 -1
  275. package/dist/menu/MenuButton.js.map +1 -1
  276. package/dist/menu/MenuConfigurationProvider.js.map +1 -1
  277. package/dist/menu/MenuItem.js.map +1 -1
  278. package/dist/menu/MenuItemButton.js.map +1 -1
  279. package/dist/menu/MenuItemCircularProgress.d.ts +2 -2
  280. package/dist/menu/MenuItemCircularProgress.js +2 -2
  281. package/dist/menu/MenuItemCircularProgress.js.map +1 -1
  282. package/dist/menu/MenuItemGroup.js.map +1 -1
  283. package/dist/menu/MenuItemSeparator.js.map +1 -1
  284. package/dist/menu/MenuSheet.js.map +1 -1
  285. package/dist/menu/MenuVisibilityProvider.js.map +1 -1
  286. package/dist/menu/MenuWidget.js.map +1 -1
  287. package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
  288. package/dist/menu/useContextMenu.js.map +1 -1
  289. package/dist/menu/useMenuBarProvider.js.map +1 -1
  290. package/dist/menu/utils.js.map +1 -1
  291. package/dist/movement/constants.js.map +1 -1
  292. package/dist/movement/findMatchIndex.js.map +1 -1
  293. package/dist/movement/types.js.map +1 -1
  294. package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
  295. package/dist/movement/utils.js.map +1 -1
  296. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  297. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
  298. package/dist/navigation/NavGroup.js.map +1 -1
  299. package/dist/navigation/NavItem.js.map +1 -1
  300. package/dist/navigation/NavItemButton.js.map +1 -1
  301. package/dist/navigation/NavItemLink.js.map +1 -1
  302. package/dist/navigation/NavSubheader.js.map +1 -1
  303. package/dist/navigation/Navigation.js.map +1 -1
  304. package/dist/navigation/getHrefFromParents.js.map +1 -1
  305. package/dist/navigation/navGroupStyles.js.map +1 -1
  306. package/dist/navigation/navItemStyles.js.map +1 -1
  307. package/dist/navigation/types.js.map +1 -1
  308. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  309. package/dist/overlay/Overlay.d.ts +1 -0
  310. package/dist/overlay/Overlay.js.map +1 -1
  311. package/dist/overlay/overlayStyles.js.map +1 -1
  312. package/dist/portal/Portal.d.ts +4 -0
  313. package/dist/portal/Portal.js.map +1 -1
  314. package/dist/portal/PortalContainerProvider.d.ts +8 -3
  315. package/dist/portal/PortalContainerProvider.js +1 -0
  316. package/dist/portal/PortalContainerProvider.js.map +1 -1
  317. package/dist/positioning/constants.d.ts +1 -1
  318. package/dist/positioning/constants.js.map +1 -1
  319. package/dist/positioning/createHorizontalPosition.d.ts +2 -2
  320. package/dist/positioning/createHorizontalPosition.js.map +1 -1
  321. package/dist/positioning/createVerticalPosition.d.ts +3 -3
  322. package/dist/positioning/createVerticalPosition.js.map +1 -1
  323. package/dist/positioning/getFixedPosition.d.ts +1 -1
  324. package/dist/positioning/getFixedPosition.js.map +1 -1
  325. package/dist/positioning/types.d.ts +1 -1
  326. package/dist/positioning/types.js.map +1 -1
  327. package/dist/positioning/useFixedPositioning.d.ts +3 -3
  328. package/dist/positioning/useFixedPositioning.js.map +1 -1
  329. package/dist/positioning/utils.d.ts +1 -1
  330. package/dist/positioning/utils.js.map +1 -1
  331. package/dist/progress/CircularProgress.d.ts +5 -4
  332. package/dist/progress/CircularProgress.js.map +1 -1
  333. package/dist/progress/LinearProgress.js.map +1 -1
  334. package/dist/progress/getProgressA11y.js.map +1 -1
  335. package/dist/progress/types.js.map +1 -1
  336. package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
  337. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  338. package/dist/responsive-item/_responsive-item.scss +4 -1
  339. package/dist/responsive-item/styles.js.map +1 -1
  340. package/dist/scroll/ScrollLock.js.map +1 -1
  341. package/dist/scroll/getScrollbarWidth.js.map +1 -1
  342. package/dist/scroll/useScrollLock.js.map +1 -1
  343. package/dist/searching/caseInsensitive.js.map +1 -1
  344. package/dist/searching/fuzzy.js.map +1 -1
  345. package/dist/searching/toSearchQuery.js.map +1 -1
  346. package/dist/searching/types.js.map +1 -1
  347. package/dist/searching/useFuzzyMatch.js.map +1 -1
  348. package/dist/searching/utils.js.map +1 -1
  349. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  350. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  351. package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
  352. package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
  353. package/dist/sheet/Sheet.js.map +1 -1
  354. package/dist/sheet/styles.js.map +1 -1
  355. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  356. package/dist/snackbar/Snackbar.js.map +1 -1
  357. package/dist/snackbar/Toast.js.map +1 -1
  358. package/dist/snackbar/ToastActionButton.js.map +1 -1
  359. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  360. package/dist/snackbar/ToastContent.js.map +1 -1
  361. package/dist/snackbar/ToastManager.js.map +1 -1
  362. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  363. package/dist/snackbar/snackbarStyles.js.map +1 -1
  364. package/dist/snackbar/toastContentStyles.js.map +1 -1
  365. package/dist/snackbar/toastStyles.js.map +1 -1
  366. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  367. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  368. package/dist/suspense/NullSuspense.js.map +1 -1
  369. package/dist/table/StickyTableSection.d.ts +23 -0
  370. package/dist/table/StickyTableSection.js +56 -0
  371. package/dist/table/StickyTableSection.js.map +1 -0
  372. package/dist/table/Table.d.ts +1 -1
  373. package/dist/table/Table.js.map +1 -1
  374. package/dist/table/TableBody.d.ts +1 -1
  375. package/dist/table/TableBody.js.map +1 -1
  376. package/dist/table/TableCell.d.ts +3 -2
  377. package/dist/table/TableCell.js.map +1 -1
  378. package/dist/table/TableCellContent.d.ts +1 -2
  379. package/dist/table/TableCellContent.js.map +1 -1
  380. package/dist/table/TableCheckbox.js.map +1 -1
  381. package/dist/table/TableConfigurationProvider.d.ts +1 -73
  382. package/dist/table/TableConfigurationProvider.js.map +1 -1
  383. package/dist/table/TableContainer.js.map +1 -1
  384. package/dist/table/TableContainerProvider.js.map +1 -1
  385. package/dist/table/TableFooter.d.ts +8 -17
  386. package/dist/table/TableFooter.js +17 -80
  387. package/dist/table/TableFooter.js.map +1 -1
  388. package/dist/table/TableHeader.d.ts +8 -17
  389. package/dist/table/TableHeader.js +20 -87
  390. package/dist/table/TableHeader.js.map +1 -1
  391. package/dist/table/TableRadio.js.map +1 -1
  392. package/dist/table/TableRow.d.ts +1 -1
  393. package/dist/table/TableRow.js.map +1 -1
  394. package/dist/table/tableCellStyles.d.ts +1 -1
  395. package/dist/table/tableCellStyles.js.map +1 -1
  396. package/dist/table/tableContainerStyles.js.map +1 -1
  397. package/dist/table/tableFooterStyles.js.map +1 -1
  398. package/dist/table/tableHeaderStyles.js.map +1 -1
  399. package/dist/table/tableRowStyles.js.map +1 -1
  400. package/dist/table/tableStyles.js.map +1 -1
  401. package/dist/table/types.d.ts +89 -9
  402. package/dist/table/types.js.map +1 -1
  403. package/dist/table/useStickyTableSection.d.ts +27 -0
  404. package/dist/table/useStickyTableSection.js +84 -0
  405. package/dist/table/useStickyTableSection.js.map +1 -0
  406. package/dist/table/useTableSectionConfig.d.ts +13 -0
  407. package/dist/table/useTableSectionConfig.js +33 -0
  408. package/dist/table/useTableSectionConfig.js.map +1 -0
  409. package/dist/tabs/Tab.js.map +1 -1
  410. package/dist/tabs/TabList.js.map +1 -1
  411. package/dist/tabs/TabListScrollButton.js.map +1 -1
  412. package/dist/tabs/tabIndicatorStyles.js.map +1 -1
  413. package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
  414. package/dist/tabs/tabListStyles.js.map +1 -1
  415. package/dist/tabs/tabStyles.js.map +1 -1
  416. package/dist/tabs/useTabList.js.map +1 -1
  417. package/dist/tabs/useTabs.js.map +1 -1
  418. package/dist/tabs/utils.js.map +1 -1
  419. package/dist/test-utils/IntersectionObserver.js.map +1 -1
  420. package/dist/test-utils/ResizeObserver.js.map +1 -1
  421. package/dist/test-utils/data-testid.js.map +1 -1
  422. package/dist/test-utils/index.js.map +1 -1
  423. package/dist/test-utils/jest-setup.js.map +1 -1
  424. package/dist/test-utils/matchMedia.js.map +1 -1
  425. package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
  426. package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
  427. package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
  428. package/dist/test-utils/polyfills/TextEncoder.js.map +1 -1
  429. package/dist/test-utils/polyfills/index.js.map +1 -1
  430. package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
  431. package/dist/test-utils/polyfills/offsetParent.js.map +1 -1
  432. package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -1
  433. package/dist/test-utils/render.js.map +1 -1
  434. package/dist/test-utils/timers.js.map +1 -1
  435. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  436. package/dist/theme/ThemeProvider.js.map +1 -1
  437. package/dist/theme/_theme.scss +6 -5
  438. package/dist/theme/colors.js.map +1 -1
  439. package/dist/theme/cssVars.js.map +1 -1
  440. package/dist/theme/types.js.map +1 -1
  441. package/dist/theme/useCSSVariables.js.map +1 -1
  442. package/dist/theme/useColorScheme.js.map +1 -1
  443. package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
  444. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  445. package/dist/theme/usePrefersColorScheme.js.map +1 -1
  446. package/dist/theme/utils.js.map +1 -1
  447. package/dist/tooltip/Tooltip.d.ts +20 -9
  448. package/dist/tooltip/Tooltip.js.map +1 -1
  449. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  450. package/dist/tooltip/constants.js.map +1 -1
  451. package/dist/tooltip/tooltipStyles.js.map +1 -1
  452. package/dist/tooltip/useTooltip.d.ts +30 -16
  453. package/dist/tooltip/useTooltip.js.map +1 -1
  454. package/dist/tooltip/useTooltipPosition.d.ts +2 -4
  455. package/dist/tooltip/useTooltipPosition.js.map +1 -1
  456. package/dist/tooltip/utils.js.map +1 -1
  457. package/dist/transition/CSSTransition.js.map +1 -1
  458. package/dist/transition/Collapse.js.map +1 -1
  459. package/dist/transition/CrossFade.js +2 -3
  460. package/dist/transition/CrossFade.js.map +1 -1
  461. package/dist/transition/ScaleTransition.js.map +1 -1
  462. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  463. package/dist/transition/Slide.js.map +1 -1
  464. package/dist/transition/SlideContainer.js.map +1 -1
  465. package/dist/transition/collapseStyles.js.map +1 -1
  466. package/dist/transition/config.js.map +1 -1
  467. package/dist/transition/maxWidthTransition.js.map +1 -1
  468. package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
  469. package/dist/transition/types.d.ts +19 -24
  470. package/dist/transition/types.js.map +1 -1
  471. package/dist/transition/useCSSTransition.js.map +1 -1
  472. package/dist/transition/useCarousel.js.map +1 -1
  473. package/dist/transition/useCollapseTransition.js.map +1 -1
  474. package/dist/transition/useCrossFadeTransition.js +2 -1
  475. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  476. package/dist/transition/useMaxWidthTransition.js.map +1 -1
  477. package/dist/transition/useScaleTransition.js +2 -1
  478. package/dist/transition/useScaleTransition.js.map +1 -1
  479. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  480. package/dist/transition/useSlideTransition.js.map +1 -1
  481. package/dist/transition/useTransition.d.ts +1 -0
  482. package/dist/transition/useTransition.js +1 -0
  483. package/dist/transition/useTransition.js.map +1 -1
  484. package/dist/transition/utils.js.map +1 -1
  485. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  486. package/dist/tree/Tree.js.map +1 -1
  487. package/dist/tree/TreeGroup.js.map +1 -1
  488. package/dist/tree/TreeItem.js.map +1 -1
  489. package/dist/tree/TreeItemExpander.js.map +1 -1
  490. package/dist/tree/TreeProvider.js.map +1 -1
  491. package/dist/tree/styles.js.map +1 -1
  492. package/dist/tree/types.js.map +1 -1
  493. package/dist/tree/useTree.d.ts +3 -3
  494. package/dist/tree/useTree.js.map +1 -1
  495. package/dist/tree/useTreeExpansion.js.map +1 -1
  496. package/dist/tree/useTreeItems.js.map +1 -1
  497. package/dist/tree/useTreeMovement.js.map +1 -1
  498. package/dist/tree/useTreeSelection.js.map +1 -1
  499. package/dist/tree/utils.js.map +1 -1
  500. package/dist/types.js.map +1 -1
  501. package/dist/typography/SrOnly.js.map +1 -1
  502. package/dist/typography/TextContainer.d.ts +4 -0
  503. package/dist/typography/TextContainer.js +2 -0
  504. package/dist/typography/TextContainer.js.map +1 -1
  505. package/dist/typography/Typography.d.ts +10 -0
  506. package/dist/typography/Typography.js +3 -0
  507. package/dist/typography/Typography.js.map +1 -1
  508. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  509. package/dist/typography/textContainerStyles.js.map +1 -1
  510. package/dist/typography/typographyStyles.js.map +1 -1
  511. package/dist/{useAsyncAction.d.ts → useAsyncFunction.d.ts} +10 -10
  512. package/dist/{useAsyncAction.js → useAsyncFunction.js} +6 -6
  513. package/dist/useAsyncFunction.js.map +1 -0
  514. package/dist/useDebouncedFunction.js.map +1 -1
  515. package/dist/useDropzone.js.map +1 -1
  516. package/dist/useElementSize.js.map +1 -1
  517. package/dist/useEnsuredId.js.map +1 -1
  518. package/dist/useEnsuredRef.js.map +1 -1
  519. package/dist/useEnsuredState.js.map +1 -1
  520. package/dist/useHtmlClassName.js.map +1 -1
  521. package/dist/useIntersectionObserver.js.map +1 -1
  522. package/dist/useIsomorphicLayoutEffect.js.map +1 -1
  523. package/dist/useLocalStorage.js.map +1 -1
  524. package/dist/useMutationObserver.d.ts +52 -0
  525. package/dist/useMutationObserver.js +84 -0
  526. package/dist/useMutationObserver.js.map +1 -0
  527. package/dist/useOrientation.js.map +1 -1
  528. package/dist/usePageInactive.js.map +1 -1
  529. package/dist/useResizeListener.js.map +1 -1
  530. package/dist/useResizeObserver.js.map +1 -1
  531. package/dist/useThrottledFunction.js.map +1 -1
  532. package/dist/useToggle.js.map +1 -1
  533. package/dist/useUnmounted.js.map +1 -1
  534. package/dist/useWindowSize.js.map +1 -1
  535. package/dist/utils/RenderRecursively.js.map +1 -1
  536. package/dist/utils/alphaNumericSort.js.map +1 -1
  537. package/dist/utils/applyRef.js.map +1 -1
  538. package/dist/utils/bem.js.map +1 -1
  539. package/dist/utils/getClientPosition.js.map +1 -1
  540. package/dist/utils/getMiddleOfRange.js.map +1 -1
  541. package/dist/utils/getPercentage.js.map +1 -1
  542. package/dist/utils/getRangeDefaultValue.js.map +1 -1
  543. package/dist/utils/getRangeSteps.js.map +1 -1
  544. package/dist/utils/identity.js.map +1 -1
  545. package/dist/utils/isElementVisible.js.map +1 -1
  546. package/dist/utils/loop.js.map +1 -1
  547. package/dist/utils/nearest.js.map +1 -1
  548. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  549. package/dist/utils/randomInt.js.map +1 -1
  550. package/dist/utils/wait.js.map +1 -1
  551. package/dist/utils/withinRange.js.map +1 -1
  552. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  553. package/dist/window-splitter/useWindowSplitter.js.map +1 -1
  554. package/package.json +26 -25
  555. package/scripts/getExportMap.ts +66 -0
  556. package/scripts/tsconfig.json +1 -1
  557. package/src/__tests__/{useAsyncAction.tsx → useAsyncFunction.tsx} +3 -3
  558. package/src/__tests__/useWindowSize.tsx +1 -2
  559. package/src/_box-shadows.scss +7 -4
  560. package/src/_core.scss +5 -1
  561. package/src/_utils.scss +3 -3
  562. package/src/app-bar/AppBarTitle.tsx +8 -4
  563. package/src/autocomplete/Autocomplete.tsx +294 -0
  564. package/src/autocomplete/AutocompleteCircularProgress.tsx +41 -0
  565. package/src/autocomplete/AutocompleteDropdownButton.tsx +66 -0
  566. package/src/autocomplete/FilterAutocompleteOptions.tsx +86 -0
  567. package/src/autocomplete/__tests__/Autocomplete.tsx +458 -0
  568. package/src/autocomplete/__tests__/__snapshots__/Autocomplete.tsx.snap +144 -0
  569. package/src/autocomplete/_autocomplete.scss +75 -0
  570. package/src/autocomplete/autocompleteStyles.ts +78 -0
  571. package/src/autocomplete/defaults.ts +83 -0
  572. package/src/autocomplete/types.ts +122 -0
  573. package/src/avatar/Avatar.tsx +1 -2
  574. package/src/avatar/_avatar.scss +4 -3
  575. package/src/button/AsyncButton.tsx +2 -2
  576. package/src/card/Card.tsx +2 -1
  577. package/src/card/CardSubtitle.tsx +9 -0
  578. package/src/card/__tests__/__snapshots__/CardHeader.tsx.snap +1 -1
  579. package/src/card/__tests__/__snapshots__/CardSubtitle.tsx.snap +2 -2
  580. package/src/card/__tests__/__snapshots__/styles.ts.snap +1 -1
  581. package/src/card/styles.ts +2 -6
  582. package/src/cssUtils.ts +1 -1
  583. package/src/draggable/useDraggable.ts +6 -13
  584. package/src/form/TextField.tsx +0 -13
  585. package/src/form/TextFieldAddon.tsx +6 -4
  586. package/src/form/__tests__/__snapshots__/Select.tsx.snap +2 -2
  587. package/src/form/__tests__/__snapshots__/TextArea.tsx.snap +2 -2
  588. package/src/form/__tests__/__snapshots__/TextField.tsx.snap +2 -2
  589. package/src/form/__tests__/useFormReset.tsx +1 -2
  590. package/src/form/_form.scss +81 -40
  591. package/src/form/useCombobox.ts +9 -19
  592. package/src/form/useEditableCombobox.ts +3 -0
  593. package/src/form/useTextFieldContainerAddons.ts +195 -0
  594. package/src/icon/FontIcon.tsx +19 -9
  595. package/src/icon/MaterialIcon.tsx +23 -4
  596. package/src/icon/SVGIcon.tsx +3 -0
  597. package/src/icon/iconConfig.tsx +10 -0
  598. package/src/icon/material.ts +276 -19
  599. package/src/link/Link.tsx +2 -4
  600. package/src/link/SkipToMainContent.tsx +11 -4
  601. package/src/link/styles.ts +2 -2
  602. package/src/menu/MenuItemCircularProgress.tsx +2 -2
  603. package/src/overlay/Overlay.tsx +1 -0
  604. package/src/portal/Portal.tsx +5 -0
  605. package/src/portal/PortalContainerProvider.tsx +16 -7
  606. package/src/positioning/__tests__/createHorizontalPosition.ts +2 -4
  607. package/src/positioning/constants.ts +1 -1
  608. package/src/positioning/createHorizontalPosition.ts +2 -2
  609. package/src/positioning/createVerticalPosition.ts +3 -3
  610. package/src/positioning/getFixedPosition.ts +1 -1
  611. package/src/positioning/types.ts +1 -1
  612. package/src/positioning/useFixedPositioning.ts +12 -4
  613. package/src/positioning/utils.ts +1 -1
  614. package/src/progress/CircularProgress.tsx +5 -4
  615. package/src/responsive-item/_responsive-item.scss +4 -1
  616. package/src/suspense/__tests__/CircularProgressSuspense.tsx +4 -4
  617. package/src/table/StickyTableSection.tsx +91 -0
  618. package/src/table/Table.tsx +2 -5
  619. package/src/table/TableBody.tsx +1 -2
  620. package/src/table/TableCell.tsx +3 -5
  621. package/src/table/TableCellContent.tsx +1 -3
  622. package/src/table/TableConfigurationProvider.tsx +1 -86
  623. package/src/table/TableFooter.tsx +19 -116
  624. package/src/table/TableHeader.tsx +20 -118
  625. package/src/table/TableRow.tsx +2 -4
  626. package/src/table/__tests__/Table.tsx +9 -8
  627. package/src/table/tableCellStyles.ts +1 -1
  628. package/src/table/types.ts +105 -10
  629. package/src/table/useStickyTableSection.tsx +126 -0
  630. package/src/table/useTableSectionConfig.ts +45 -0
  631. package/src/theme/_theme.scss +6 -5
  632. package/src/tooltip/Tooltip.tsx +24 -8
  633. package/src/tooltip/useTooltip.ts +52 -27
  634. package/src/tooltip/useTooltipPosition.ts +2 -4
  635. package/src/transition/CrossFade.tsx +1 -8
  636. package/src/transition/types.ts +23 -27
  637. package/src/transition/useCrossFadeTransition.ts +2 -0
  638. package/src/transition/useScaleTransition.ts +2 -0
  639. package/src/transition/useTransition.ts +1 -0
  640. package/src/tree/useTree.ts +3 -5
  641. package/src/typography/TextContainer.tsx +4 -0
  642. package/src/typography/Typography.tsx +10 -0
  643. package/src/{useAsyncAction.ts → useAsyncFunction.ts} +15 -15
  644. package/src/useMutationObserver.ts +118 -0
  645. package/src/useResizeListener.ts +1 -1
  646. package/coverage/lcov-report/AppBar.tsx.html +0 -784
  647. package/coverage/lcov-report/AsyncButton.tsx.html +0 -649
  648. package/coverage/lcov-report/AutoComplete.tsx.html +0 -283
  649. package/coverage/lcov-report/Avatar.tsx.html +0 -472
  650. package/coverage/lcov-report/Badge.tsx.html +0 -253
  651. package/coverage/lcov-report/CircularProgress.tsx.html +0 -799
  652. package/coverage/lcov-report/Collapse.tsx.html +0 -340
  653. package/coverage/lcov-report/CoreProviders.tsx.html +0 -502
  654. package/coverage/lcov-report/DefaultNavigationRenderer.tsx.html +0 -298
  655. package/coverage/lcov-report/DefaultToastRenderer.tsx.html +0 -526
  656. package/coverage/lcov-report/Dialog.tsx.html +0 -1309
  657. package/coverage/lcov-report/DialogContent.tsx.html +0 -178
  658. package/coverage/lcov-report/DialogFooter.tsx.html +0 -169
  659. package/coverage/lcov-report/ExpansionList.tsx.html +0 -205
  660. package/coverage/lcov-report/ExpansionPanel.tsx.html +0 -934
  661. package/coverage/lcov-report/ExpansionPanelHeader.tsx.html +0 -622
  662. package/coverage/lcov-report/FileInput.tsx.html +0 -733
  663. package/coverage/lcov-report/FontIcon.tsx.html +0 -265
  664. package/coverage/lcov-report/IconRotator.tsx.html +0 -322
  665. package/coverage/lcov-report/InputToggle.tsx.html +0 -1117
  666. package/coverage/lcov-report/InputToggleIcon.tsx.html +0 -478
  667. package/coverage/lcov-report/LinearProgress.tsx.html +0 -658
  668. package/coverage/lcov-report/ListItem.tsx.html +0 -892
  669. package/coverage/lcov-report/ListItemLink.tsx.html +0 -616
  670. package/coverage/lcov-report/MaterialIcon.tsx.html +0 -235
  671. package/coverage/lcov-report/MaterialSymbol.tsx.html +0 -421
  672. package/coverage/lcov-report/MenuItemCheckbox.tsx.html +0 -223
  673. package/coverage/lcov-report/MenuItemInputToggle.tsx.html +0 -925
  674. package/coverage/lcov-report/MenuItemRadio.tsx.html +0 -436
  675. package/coverage/lcov-report/MenuItemSeparator.tsx.html +0 -223
  676. package/coverage/lcov-report/MenuItemTextField.tsx.html +0 -289
  677. package/coverage/lcov-report/NativeSelect.tsx.html +0 -763
  678. package/coverage/lcov-report/Navigation.tsx.html +0 -358
  679. package/coverage/lcov-report/Portal.tsx.html +0 -223
  680. package/coverage/lcov-report/PortalContainerProvider.tsx.html +0 -367
  681. package/coverage/lcov-report/RootHtml.tsx.html +0 -370
  682. package/coverage/lcov-report/SVGIcon.tsx.html +0 -445
  683. package/coverage/lcov-report/SegmentedButton.tsx.html +0 -628
  684. package/coverage/lcov-report/SegmentedButtonContainer.tsx.html +0 -277
  685. package/coverage/lcov-report/Select.tsx.html +0 -1411
  686. package/coverage/lcov-report/SkeletonPlaceholder.tsx.html +0 -613
  687. package/coverage/lcov-report/Snackbar.tsx.html +0 -610
  688. package/coverage/lcov-report/SrOnly.tsx.html +0 -328
  689. package/coverage/lcov-report/Switch.tsx.html +0 -535
  690. package/coverage/lcov-report/SwitchTrack.tsx.html +0 -262
  691. package/coverage/lcov-report/Tab.tsx.html +0 -622
  692. package/coverage/lcov-report/TabList.tsx.html +0 -757
  693. package/coverage/lcov-report/TabListScrollButton.tsx.html +0 -472
  694. package/coverage/lcov-report/Table.tsx.html +0 -457
  695. package/coverage/lcov-report/TableCell.tsx.html +0 -982
  696. package/coverage/lcov-report/TableCheckbox.tsx.html +0 -709
  697. package/coverage/lcov-report/TableContainer.tsx.html +0 -220
  698. package/coverage/lcov-report/TableFooter.tsx.html +0 -502
  699. package/coverage/lcov-report/TableHeader.tsx.html +0 -541
  700. package/coverage/lcov-report/TableRadio.tsx.html +0 -670
  701. package/coverage/lcov-report/TableRow.tsx.html +0 -289
  702. package/coverage/lcov-report/TextArea.tsx.html +0 -940
  703. package/coverage/lcov-report/TextField.tsx.html +0 -829
  704. package/coverage/lcov-report/TextFieldAddon.tsx.html +0 -382
  705. package/coverage/lcov-report/TextFieldContainer.tsx.html +0 -364
  706. package/coverage/lcov-report/Toast.tsx.html +0 -868
  707. package/coverage/lcov-report/ToastCloseButton.tsx.html +0 -340
  708. package/coverage/lcov-report/ToastManager.tsx.html +0 -1783
  709. package/coverage/lcov-report/ToastManagerProvider.tsx.html +0 -400
  710. package/coverage/lcov-report/Tooltip.tsx.html +0 -559
  711. package/coverage/lcov-report/TooltipHoverModeProvider.tsx.html +0 -253
  712. package/coverage/lcov-report/Tree.tsx.html +0 -1135
  713. package/coverage/lcov-report/TreeGroup.tsx.html +0 -313
  714. package/coverage/lcov-report/Typography.tsx.html +0 -1027
  715. package/coverage/lcov-report/app-bar/AppBar.tsx.html +0 -928
  716. package/coverage/lcov-report/app-bar/AppBarTitle.tsx.html +0 -430
  717. package/coverage/lcov-report/app-bar/index.html +0 -131
  718. package/coverage/lcov-report/autocomplete/AutoComplete.tsx.html +0 -283
  719. package/coverage/lcov-report/autocomplete/AutocompleteGeneric.tsx.html +0 -304
  720. package/coverage/lcov-report/autocomplete/useAutoComplete.ts.html +0 -775
  721. package/coverage/lcov-report/autocomplete/useAutocomplete.ts.html +0 -1039
  722. package/coverage/lcov-report/autocomplete/useAutocompleteAgain.ts.html +0 -829
  723. package/coverage/lcov-report/autocomplete/useAutocompletev2.ts.html +0 -715
  724. package/coverage/lcov-report/autocomplete/useInlineAutoComplete.ts.html +0 -340
  725. package/coverage/lcov-report/autocomplete/useInlineAutocomplete.ts.html +0 -454
  726. package/coverage/lcov-report/autocomplete/useInlineSelection.ts.html +0 -373
  727. package/coverage/lcov-report/autocomplete/utils.ts.html +0 -196
  728. package/coverage/lcov-report/avatar/Avatar.tsx.html +0 -535
  729. package/coverage/lcov-report/avatar/index.html +0 -116
  730. package/coverage/lcov-report/avatar/styles.ts.html +0 -268
  731. package/coverage/lcov-report/badge/Badge.tsx.html +0 -364
  732. package/coverage/lcov-report/badge/index.html +0 -116
  733. package/coverage/lcov-report/box/Box.tsx.html +0 -562
  734. package/coverage/lcov-report/box/index.html +0 -131
  735. package/coverage/lcov-report/box/styles.ts.html +0 -622
  736. package/coverage/lcov-report/button/AsyncButton.tsx.html +0 -1045
  737. package/coverage/lcov-report/button/ButtonUnstyled.tsx.html +0 -214
  738. package/coverage/lcov-report/button/FloatingActionButton.tsx.html +0 -427
  739. package/coverage/lcov-report/button/TooltippedButton.tsx.html +0 -433
  740. package/coverage/lcov-report/button/buttonStyles.ts.html +0 -607
  741. package/coverage/lcov-report/button/buttonUnstyledStyles.ts.html +0 -142
  742. package/coverage/lcov-report/card/CardContent.tsx.html +0 -223
  743. package/coverage/lcov-report/card/CardHeader.tsx.html +0 -322
  744. package/coverage/lcov-report/card/ClickableCard.tsx.html +0 -400
  745. package/coverage/lcov-report/chip/Chip.tsx.html +0 -1072
  746. package/coverage/lcov-report/chip/index.html +0 -116
  747. package/coverage/lcov-report/chip/styles.ts.html +0 -436
  748. package/coverage/lcov-report/collapseStyles.ts.html +0 -184
  749. package/coverage/lcov-report/config.ts.html +0 -151
  750. package/coverage/lcov-report/cssUtils.ts.html +0 -814
  751. package/coverage/lcov-report/dialog/Dialog.tsx.html +0 -1309
  752. package/coverage/lcov-report/dialog/DialogContent.tsx.html +0 -178
  753. package/coverage/lcov-report/dialog/DialogFooter.tsx.html +0 -169
  754. package/coverage/lcov-report/dialog/DialogHeader.tsx.html +0 -148
  755. package/coverage/lcov-report/dialog/FixedDialog.tsx.html +0 -583
  756. package/coverage/lcov-report/dialog/index.html +0 -131
  757. package/coverage/lcov-report/dialog/styles.ts.html +0 -439
  758. package/coverage/lcov-report/divider/Divider.tsx.html +0 -280
  759. package/coverage/lcov-report/divider/index.html +0 -116
  760. package/coverage/lcov-report/draggable/index.html +0 -116
  761. package/coverage/lcov-report/draggable/useControlledDraggable.ts.html +0 -2131
  762. package/coverage/lcov-report/draggable/useDraggable.ts.html +0 -2398
  763. package/coverage/lcov-report/draggable/useDraggableOrig.ts.html +0 -316
  764. package/coverage/lcov-report/draggable/useLocalStorageDraggable.ts.html +0 -361
  765. package/coverage/lcov-report/draggable/useLocalStorageDraggableControls.ts.html +0 -487
  766. package/coverage/lcov-report/draggable/useLocalStorageDraggableLatest.ts.html +0 -334
  767. package/coverage/lcov-report/draggable/utils.ts.html +0 -808
  768. package/coverage/lcov-report/expansion-panel/ExpansionList.tsx.html +0 -211
  769. package/coverage/lcov-report/expansion-panel/ExpansionPanel.tsx.html +0 -943
  770. package/coverage/lcov-report/expansion-panel/ExpansionPanelHeader.tsx.html +0 -649
  771. package/coverage/lcov-report/expansion-panel/index.html +0 -146
  772. package/coverage/lcov-report/expansion-panel/useExpansionPanels.ts.html +0 -928
  773. package/coverage/lcov-report/filters.ts.html +0 -1045
  774. package/coverage/lcov-report/findMatchIndex.ts.html +0 -385
  775. package/coverage/lcov-report/form/AutoComplete.tsx.html +0 -283
  776. package/coverage/lcov-report/form/FileInput.tsx.html +0 -739
  777. package/coverage/lcov-report/form/Form.tsx.html +0 -238
  778. package/coverage/lcov-report/form/FormMessage.tsx.html +0 -322
  779. package/coverage/lcov-report/form/FormMessageContainer.tsx.html +0 -229
  780. package/coverage/lcov-report/form/InputToggle.tsx.html +0 -1108
  781. package/coverage/lcov-report/form/InputToggleIcon.tsx.html +0 -478
  782. package/coverage/lcov-report/form/Label.tsx.html +0 -442
  783. package/coverage/lcov-report/form/MenuItemInputToggle.tsx.html +0 -979
  784. package/coverage/lcov-report/form/MenuItemTextField.tsx.html +0 -289
  785. package/coverage/lcov-report/form/NativeSelect.tsx.html +0 -826
  786. package/coverage/lcov-report/form/OptGroup.tsx.html +0 -343
  787. package/coverage/lcov-report/form/Password.tsx.html +0 -721
  788. package/coverage/lcov-report/form/Radio.tsx.html +0 -169
  789. package/coverage/lcov-report/form/ResizingTextArea.tsx.html +0 -442
  790. package/coverage/lcov-report/form/ResizingTextAreaWrapper.tsx.html +0 -310
  791. package/coverage/lcov-report/form/Select.tsx.html +0 -1456
  792. package/coverage/lcov-report/form/SelectOriginal.tsx.html +0 -1630
  793. package/coverage/lcov-report/form/SelectV2.tsx.html +0 -1024
  794. package/coverage/lcov-report/form/SelectedOption.tsx.html +0 -250
  795. package/coverage/lcov-report/form/SimpleTextArea.tsx.html +0 -727
  796. package/coverage/lcov-report/form/Slider.tsx.html +0 -2014
  797. package/coverage/lcov-report/form/SliderThumb.tsx.html +0 -1030
  798. package/coverage/lcov-report/form/SliderValueTooltip.tsx.html +0 -319
  799. package/coverage/lcov-report/form/Switch.tsx.html +0 -535
  800. package/coverage/lcov-report/form/SwitchTrack.tsx.html +0 -262
  801. package/coverage/lcov-report/form/TextArea.tsx.html +0 -964
  802. package/coverage/lcov-report/form/TextArea2.tsx.html +0 -985
  803. package/coverage/lcov-report/form/TextAreaBackup.tsx.html +0 -1006
  804. package/coverage/lcov-report/form/TextField.tsx.html +0 -829
  805. package/coverage/lcov-report/form/fileUtils.ts.html +0 -2155
  806. package/coverage/lcov-report/form/formMessageStyles.ts.html +0 -238
  807. package/coverage/lcov-report/form/inputToggleStyles.ts.html +0 -316
  808. package/coverage/lcov-report/form/selectUtils.ts.html +0 -397
  809. package/coverage/lcov-report/form/switchStyles.ts.html +0 -172
  810. package/coverage/lcov-report/form/textAreaStyles.ts.html +0 -382
  811. package/coverage/lcov-report/form/useAutoComplete.ts.html +0 -787
  812. package/coverage/lcov-report/form/useCheckboxGroup.ts.html +0 -1087
  813. package/coverage/lcov-report/form/useCombobox-6-13.ts.html +0 -1054
  814. package/coverage/lcov-report/form/useCombobox-6-15.ts.html +0 -1048
  815. package/coverage/lcov-report/form/useCombobox.ts.html +0 -1045
  816. package/coverage/lcov-report/form/useComboboxBoth.ts.html +0 -85
  817. package/coverage/lcov-report/form/useComboboxDialog.ts.html +0 -85
  818. package/coverage/lcov-report/form/useComboboxList.ts.html +0 -418
  819. package/coverage/lcov-report/form/useComboboxOrig.ts.html +0 -781
  820. package/coverage/lcov-report/form/useFileUpload.ts.html +0 -1702
  821. package/coverage/lcov-report/form/useFormReset.ts.html +0 -229
  822. package/coverage/lcov-report/form/useInlineAutoComplete.ts.html +0 -379
  823. package/coverage/lcov-report/form/useNumberField.ts.html +0 -1561
  824. package/coverage/lcov-report/form/useRadioGroup.ts.html +0 -1009
  825. package/coverage/lcov-report/form/useRangeSlider.ts.html +0 -355
  826. package/coverage/lcov-report/form/useResizingTextArea.ts.html +0 -631
  827. package/coverage/lcov-report/form/useResizingTextArea2.ts.html +0 -631
  828. package/coverage/lcov-report/form/useSelectCombobox.ts.html +0 -499
  829. package/coverage/lcov-report/form/useSlider.ts.html +0 -421
  830. package/coverage/lcov-report/form/useTextField.ts.html +0 -2203
  831. package/coverage/lcov-report/form/utils.ts.html +0 -382
  832. package/coverage/lcov-report/form/validation.ts.html +0 -886
  833. package/coverage/lcov-report/getHrefFromParents.ts.html +0 -133
  834. package/coverage/lcov-report/getListItemHeight.ts.html +0 -298
  835. package/coverage/lcov-report/hoverMode/index.html +0 -116
  836. package/coverage/lcov-report/hoverMode/useHoverMode.ts.html +0 -676
  837. package/coverage/lcov-report/icon/FontIcon.tsx.html +0 -256
  838. package/coverage/lcov-report/icon/MaterialIcon.tsx.html +0 -235
  839. package/coverage/lcov-report/icon/index.html +0 -116
  840. package/coverage/lcov-report/icon/styles.ts.html +0 -586
  841. package/coverage/lcov-report/iconConfig.tsx.html +0 -973
  842. package/coverage/lcov-report/inputToggleStyles.ts.html +0 -316
  843. package/coverage/lcov-report/interaction/ElementInteractionProvider.tsx.html +0 -253
  844. package/coverage/lcov-report/interaction/UserInteractionModeProvider.tsx.html +0 -679
  845. package/coverage/lcov-report/interaction/config.ts.html +0 -181
  846. package/coverage/lcov-report/interaction/index.html +0 -131
  847. package/coverage/lcov-report/layout/LayoutAppBar.tsx.html +0 -358
  848. package/coverage/lcov-report/layout/LayoutNav.tsx.html +0 -682
  849. package/coverage/lcov-report/layout/LayoutWindowSplitter.tsx.html +0 -460
  850. package/coverage/lcov-report/layout/Main.tsx.html +0 -364
  851. package/coverage/lcov-report/layout/NavigationLink.tsx.html +0 -334
  852. package/coverage/lcov-report/layout/NavigationRail.tsx.html +0 -157
  853. package/coverage/lcov-report/layout/index.html +0 -161
  854. package/coverage/lcov-report/layout/layoutNavStyles.ts.html +0 -166
  855. package/coverage/lcov-report/layout/layoutWindowSplitterStyles.ts.html +0 -220
  856. package/coverage/lcov-report/layout/navigationLinkStyles.ts.html +0 -250
  857. package/coverage/lcov-report/layout/navigationRailStyles.ts.html +0 -148
  858. package/coverage/lcov-report/layout/useExpandableLayout.ts.html +0 -928
  859. package/coverage/lcov-report/layout/useExpandableLayoutAppBarTransition.ts.html +0 -199
  860. package/coverage/lcov-report/layout/useHorizontalLayoutTransition.ts.html +0 -349
  861. package/coverage/lcov-report/layout/useLayoutAppBarHeight.ts.html +0 -343
  862. package/coverage/lcov-report/layout/useLayoutNavigation.ts.html +0 -544
  863. package/coverage/lcov-report/layout/useLayoutTree.ts.html +0 -691
  864. package/coverage/lcov-report/layout/useLayoutWindowSplitter.ts.html +0 -517
  865. package/coverage/lcov-report/layout/useMainTabIndex.ts.html +0 -136
  866. package/coverage/lcov-report/layout/useResizableLayout.ts.html +0 -328
  867. package/coverage/lcov-report/layout/useTemporaryLayout.ts.html +0 -589
  868. package/coverage/lcov-report/link/Link.tsx.html +0 -358
  869. package/coverage/lcov-report/link/LinkProvider.tsx.html +0 -214
  870. package/coverage/lcov-report/link/SkipToMainContent.tsx.html +0 -448
  871. package/coverage/lcov-report/link/index.html +0 -116
  872. package/coverage/lcov-report/list/List.tsx.html +0 -490
  873. package/coverage/lcov-report/list/ListItem.tsx.html +0 -886
  874. package/coverage/lcov-report/list/ListItemAddon.tsx.html +0 -286
  875. package/coverage/lcov-report/list/ListItemChildren.tsx.html +0 -445
  876. package/coverage/lcov-report/list/ListItemLink.tsx.html +0 -616
  877. package/coverage/lcov-report/list/ListItemText.tsx.html +0 -280
  878. package/coverage/lcov-report/list/ListSubheader.tsx.html +0 -322
  879. package/coverage/lcov-report/list/index.html +0 -191
  880. package/coverage/lcov-report/list/listItemStyles.ts.html +0 -703
  881. package/coverage/lcov-report/materialConfig.ts.html +0 -703
  882. package/coverage/lcov-report/media-queries/AppSizeProvider.tsx.html +0 -499
  883. package/coverage/lcov-report/media-queries/appSize.ts.html +0 -445
  884. package/coverage/lcov-report/media-queries/index.html +0 -116
  885. package/coverage/lcov-report/media-queries/useMediaQuery.ts.html +0 -244
  886. package/coverage/lcov-report/media-queries/useMinWidthMediaQuery.ts.html +0 -115
  887. package/coverage/lcov-report/menu/DropdownMenu.tsx.html +0 -976
  888. package/coverage/lcov-report/menu/Menu.tsx.html +0 -1894
  889. package/coverage/lcov-report/menu/MenuConfigurationProvider.tsx.html +0 -637
  890. package/coverage/lcov-report/menu/MenuItem.tsx.html +0 -292
  891. package/coverage/lcov-report/menu/MenuItemCircularProgress.tsx.html +0 -433
  892. package/coverage/lcov-report/menu/MenuItemGroup.tsx.html +0 -382
  893. package/coverage/lcov-report/menu/MenuSheet.tsx.html +0 -502
  894. package/coverage/lcov-report/menu/MenuWidget.tsx.html +0 -634
  895. package/coverage/lcov-report/menu/index.html +0 -116
  896. package/coverage/lcov-report/menu/menuConfig.ts.html +0 -118
  897. package/coverage/lcov-report/menu/useContextMenu.ts.html +0 -490
  898. package/coverage/lcov-report/menuItemInputToggleStyles.ts.html +0 -319
  899. package/coverage/lcov-report/movement/index.html +0 -116
  900. package/coverage/lcov-report/movement/useKeyboardMovementProvider.ts.html +0 -1723
  901. package/coverage/lcov-report/navigation/CollapsibleNavGroup.tsx.html +0 -334
  902. package/coverage/lcov-report/navigation/DefaultNavigationRenderer.tsx.html +0 -298
  903. package/coverage/lcov-report/navigation/NavGroup.tsx.html +0 -193
  904. package/coverage/lcov-report/navigation/NavItem.tsx.html +0 -160
  905. package/coverage/lcov-report/navigation/NavItemButton.tsx.html +0 -397
  906. package/coverage/lcov-report/navigation/NavItemLink.tsx.html +0 -574
  907. package/coverage/lcov-report/navigation/NavSubheader.tsx.html +0 -184
  908. package/coverage/lcov-report/navigation/Navigation.tsx.html +0 -358
  909. package/coverage/lcov-report/navigation/getHrefFromParents.ts.html +0 -130
  910. package/coverage/lcov-report/navigation/index.html +0 -146
  911. package/coverage/lcov-report/navigation/navGroupStyles.ts.html +0 -148
  912. package/coverage/lcov-report/navigation/navItemStyles.ts.html +0 -298
  913. package/coverage/lcov-report/overlay/Overlay.tsx.html +0 -655
  914. package/coverage/lcov-report/overlay/index.html +0 -116
  915. package/coverage/lcov-report/positioning/constants.ts.html +0 -463
  916. package/coverage/lcov-report/positioning/createVerticalPosition.ts.html +0 -1009
  917. package/coverage/lcov-report/positioning/getFixedPosition.ts.html +0 -616
  918. package/coverage/lcov-report/positioning/index.html +0 -131
  919. package/coverage/lcov-report/positioning/useFixedPositioning.ts.html +0 -1321
  920. package/coverage/lcov-report/progress/CircularProgress.tsx.html +0 -799
  921. package/coverage/lcov-report/progress/LinearProgress.tsx.html +0 -658
  922. package/coverage/lcov-report/progress/index.html +0 -116
  923. package/coverage/lcov-report/searching/caseInsensitive.ts.html +0 -685
  924. package/coverage/lcov-report/searching/toSearchQuery.ts.html +0 -145
  925. package/coverage/lcov-report/searching/useFuzzyMatch.ts.html +0 -211
  926. package/coverage/lcov-report/searching/utils.ts.html +0 -244
  927. package/coverage/lcov-report/segmented-button/SegmentedButton.tsx.html +0 -628
  928. package/coverage/lcov-report/segmented-button/SegmentedButtonContainer.tsx.html +0 -259
  929. package/coverage/lcov-report/segmented-button/index.html +0 -161
  930. package/coverage/lcov-report/segmented-button/segmentedButtonContainerStyles.ts.html +0 -151
  931. package/coverage/lcov-report/segmented-button/segmentedButtonStyles.ts.html +0 -199
  932. package/coverage/lcov-report/segmentedButtonContainerStyles.ts.html +0 -160
  933. package/coverage/lcov-report/segmentedButtonStyles.ts.html +0 -199
  934. package/coverage/lcov-report/sheet/Sheet.tsx.html +0 -397
  935. package/coverage/lcov-report/sheet/index.html +0 -116
  936. package/coverage/lcov-report/sheet/styles.ts.html +0 -376
  937. package/coverage/lcov-report/skeletonPlaceholderUtils.ts.html +0 -400
  938. package/coverage/lcov-report/snackbar/DefaultToastRenderer.tsx.html +0 -529
  939. package/coverage/lcov-report/snackbar/Snackbar.tsx.html +0 -610
  940. package/coverage/lcov-report/snackbar/Toast.tsx.html +0 -868
  941. package/coverage/lcov-report/snackbar/ToastContent.tsx.html +0 -364
  942. package/coverage/lcov-report/snackbar/ToastManager.tsx.html +0 -1804
  943. package/coverage/lcov-report/snackbar/ToastManagerProvider.tsx.html +0 -400
  944. package/coverage/lcov-report/snackbar/index.html +0 -116
  945. package/coverage/lcov-report/snackbar/snackbarStyles.ts.html +0 -139
  946. package/coverage/lcov-report/snackbar/toastContentStyles.ts.html +0 -196
  947. package/coverage/lcov-report/snackbar/toastStyles.ts.html +0 -349
  948. package/coverage/lcov-report/snackbar/useCurrentToastActions.ts.html +0 -226
  949. package/coverage/lcov-report/snackbarStyles.ts.html +0 -139
  950. package/coverage/lcov-report/src/AppSize.tsx.html +0 -247
  951. package/coverage/lcov-report/src/AppSizeProvider.tsx.html +0 -787
  952. package/coverage/lcov-report/src/CoreProviders.tsx.html +0 -412
  953. package/coverage/lcov-report/src/NoSsr.tsx.html +0 -250
  954. package/coverage/lcov-report/src/NullSsrSuspense.tsx.html +0 -223
  955. package/coverage/lcov-report/src/RootHtml.tsx.html +0 -370
  956. package/coverage/lcov-report/src/SsrProvider.tsx.html +0 -211
  957. package/coverage/lcov-report/src/app-bar/AppBar.tsx.html +0 -937
  958. package/coverage/lcov-report/src/app-bar/AppBarTitle.tsx.html +0 -445
  959. package/coverage/lcov-report/src/app-bar/index.html +0 -131
  960. package/coverage/lcov-report/src/autocomplete/Autocomplete.tsx.html +0 -328
  961. package/coverage/lcov-report/src/autocomplete/AutocompleteGeneric.tsx.html +0 -304
  962. package/coverage/lcov-report/src/autocomplete/index.html +0 -221
  963. package/coverage/lcov-report/src/autocomplete/useAutocomplete.ts.html +0 -1039
  964. package/coverage/lcov-report/src/autocomplete/useAutocompleteAgain.ts.html +0 -829
  965. package/coverage/lcov-report/src/autocomplete/useAutocompletev2.ts.html +0 -715
  966. package/coverage/lcov-report/src/autocomplete/useInlineAutocomplete.ts.html +0 -454
  967. package/coverage/lcov-report/src/autocomplete/useInlineSelection.ts.html +0 -373
  968. package/coverage/lcov-report/src/autocomplete/utils.ts.html +0 -196
  969. package/coverage/lcov-report/src/avatar/Avatar.tsx.html +0 -472
  970. package/coverage/lcov-report/src/avatar/index.html +0 -131
  971. package/coverage/lcov-report/src/avatar/styles.ts.html +0 -268
  972. package/coverage/lcov-report/src/badge/Badge.tsx.html +0 -382
  973. package/coverage/lcov-report/src/badge/index.html +0 -116
  974. package/coverage/lcov-report/src/box/Box.tsx.html +0 -541
  975. package/coverage/lcov-report/src/box/index.html +0 -131
  976. package/coverage/lcov-report/src/box/styles.ts.html +0 -622
  977. package/coverage/lcov-report/src/button/AsyncButton.tsx.html +0 -1045
  978. package/coverage/lcov-report/src/button/Button.tsx.html +0 -688
  979. package/coverage/lcov-report/src/button/ButtonUnstyled.tsx.html +0 -211
  980. package/coverage/lcov-report/src/button/FloatingActionButton.tsx.html +0 -382
  981. package/coverage/lcov-report/src/button/TooltippedButton.tsx.html +0 -445
  982. package/coverage/lcov-report/src/button/buttonStyles.ts.html +0 -607
  983. package/coverage/lcov-report/src/button/buttonUnstyledStyles.ts.html +0 -142
  984. package/coverage/lcov-report/src/button/index.html +0 -116
  985. package/coverage/lcov-report/src/card/CardContent.tsx.html +0 -223
  986. package/coverage/lcov-report/src/card/CardFooter.tsx.html +0 -196
  987. package/coverage/lcov-report/src/card/CardHeader.tsx.html +0 -319
  988. package/coverage/lcov-report/src/card/CardTitle.tsx.html +0 -247
  989. package/coverage/lcov-report/src/card/ClickableCard.tsx.html +0 -400
  990. package/coverage/lcov-report/src/chip/Chip.tsx.html +0 -1102
  991. package/coverage/lcov-report/src/chip/index.html +0 -131
  992. package/coverage/lcov-report/src/chip/styles.ts.html +0 -457
  993. package/coverage/lcov-report/src/delegateEvent.ts.html +0 -619
  994. package/coverage/lcov-report/src/dialog/Dialog.tsx.html +0 -1309
  995. package/coverage/lcov-report/src/dialog/DialogContainer.tsx.html +0 -175
  996. package/coverage/lcov-report/src/dialog/DialogContent.tsx.html +0 -178
  997. package/coverage/lcov-report/src/dialog/DialogFooter.tsx.html +0 -169
  998. package/coverage/lcov-report/src/dialog/DialogHeader.tsx.html +0 -148
  999. package/coverage/lcov-report/src/dialog/DialogTitle.tsx.html +0 -256
  1000. package/coverage/lcov-report/src/dialog/FixedDialog.tsx.html +0 -577
  1001. package/coverage/lcov-report/src/dialog/NestedDialogProvider.ts.html +0 -127
  1002. package/coverage/lcov-report/src/dialog/index.html +0 -236
  1003. package/coverage/lcov-report/src/dialog/styles.ts.html +0 -439
  1004. package/coverage/lcov-report/src/divider/Divider.tsx.html +0 -274
  1005. package/coverage/lcov-report/src/divider/VerticalDivider.tsx.html +0 -235
  1006. package/coverage/lcov-report/src/divider/index.html +0 -116
  1007. package/coverage/lcov-report/src/divider/styles.ts.html +0 -232
  1008. package/coverage/lcov-report/src/divider/useVerticalDividerHeight.ts.html +0 -301
  1009. package/coverage/lcov-report/src/draggable/index.html +0 -131
  1010. package/coverage/lcov-report/src/draggable/useControlledDraggable.ts.html +0 -2137
  1011. package/coverage/lcov-report/src/draggable/useDraggable.ts.html +0 -2398
  1012. package/coverage/lcov-report/src/draggable/useDraggableOrig.ts.html +0 -316
  1013. package/coverage/lcov-report/src/draggable/useLocalStorageDraggable.ts.html +0 -370
  1014. package/coverage/lcov-report/src/draggable/utils.ts.html +0 -808
  1015. package/coverage/lcov-report/src/expansion-panel/ExpansionList.tsx.html +0 -211
  1016. package/coverage/lcov-report/src/expansion-panel/ExpansionPanel.tsx.html +0 -943
  1017. package/coverage/lcov-report/src/expansion-panel/ExpansionPanelHeader.tsx.html +0 -649
  1018. package/coverage/lcov-report/src/expansion-panel/index.html +0 -176
  1019. package/coverage/lcov-report/src/expansion-panel/useExpansionList.ts.html +0 -322
  1020. package/coverage/lcov-report/src/expansion-panel/useExpansionPanels.ts.html +0 -928
  1021. package/coverage/lcov-report/src/focus/index.html +0 -131
  1022. package/coverage/lcov-report/src/focus/useFocusContainer.ts.html +0 -883
  1023. package/coverage/lcov-report/src/focus/utils.ts.html +0 -544
  1024. package/coverage/lcov-report/src/form/AutoComplete.tsx.html +0 -283
  1025. package/coverage/lcov-report/src/form/Checkbox.tsx.html +0 -160
  1026. package/coverage/lcov-report/src/form/Fieldset.tsx.html +0 -355
  1027. package/coverage/lcov-report/src/form/FileInput.tsx.html +0 -739
  1028. package/coverage/lcov-report/src/form/Form.tsx.html +0 -238
  1029. package/coverage/lcov-report/src/form/FormMessage.tsx.html +0 -322
  1030. package/coverage/lcov-report/src/form/FormMessageContainer.tsx.html +0 -223
  1031. package/coverage/lcov-report/src/form/FormMessageCounter.tsx.html +0 -262
  1032. package/coverage/lcov-report/src/form/FormThemeProvider.tsx.html +0 -313
  1033. package/coverage/lcov-report/src/form/InputToggle.tsx.html +0 -1108
  1034. package/coverage/lcov-report/src/form/InputToggleIcon.tsx.html +0 -478
  1035. package/coverage/lcov-report/src/form/Label.tsx.html +0 -439
  1036. package/coverage/lcov-report/src/form/Legend.tsx.html +0 -199
  1037. package/coverage/lcov-report/src/form/MenuItemCheckbox.tsx.html +0 -223
  1038. package/coverage/lcov-report/src/form/MenuItemFileInput.tsx.html +0 -424
  1039. package/coverage/lcov-report/src/form/MenuItemInputToggle.tsx.html +0 -925
  1040. package/coverage/lcov-report/src/form/MenuItemRadio.tsx.html +0 -436
  1041. package/coverage/lcov-report/src/form/MenuItemSwitch.tsx.html +0 -211
  1042. package/coverage/lcov-report/src/form/MenuItemTextField.tsx.html +0 -289
  1043. package/coverage/lcov-report/src/form/NativeSelect.tsx.html +0 -763
  1044. package/coverage/lcov-report/src/form/OptGroup.tsx.html +0 -343
  1045. package/coverage/lcov-report/src/form/Option.tsx.html +0 -709
  1046. package/coverage/lcov-report/src/form/Password.tsx.html +0 -721
  1047. package/coverage/lcov-report/src/form/Radio.tsx.html +0 -172
  1048. package/coverage/lcov-report/src/form/ResizingTextArea.tsx.html +0 -988
  1049. package/coverage/lcov-report/src/form/ResizingTextAreaWrapper.tsx.html +0 -310
  1050. package/coverage/lcov-report/src/form/Select.tsx.html +0 -1411
  1051. package/coverage/lcov-report/src/form/SelectValue.tsx.html +0 -202
  1052. package/coverage/lcov-report/src/form/SimpleTextArea.tsx.html +0 -694
  1053. package/coverage/lcov-report/src/form/Slider.tsx.html +0 -2008
  1054. package/coverage/lcov-report/src/form/SliderContainer.tsx.html +0 -358
  1055. package/coverage/lcov-report/src/form/SliderMark.tsx.html +0 -208
  1056. package/coverage/lcov-report/src/form/SliderMarkLabel.tsx.html +0 -271
  1057. package/coverage/lcov-report/src/form/SliderThumb.tsx.html +0 -1084
  1058. package/coverage/lcov-report/src/form/SliderTrack.tsx.html +0 -454
  1059. package/coverage/lcov-report/src/form/SliderValueMarks.tsx.html +0 -745
  1060. package/coverage/lcov-report/src/form/SliderValueTooltip.tsx.html +0 -319
  1061. package/coverage/lcov-report/src/form/Switch.tsx.html +0 -535
  1062. package/coverage/lcov-report/src/form/SwitchTrack.tsx.html +0 -262
  1063. package/coverage/lcov-report/src/form/TextArea.tsx.html +0 -1006
  1064. package/coverage/lcov-report/src/form/TextArea2.tsx.html +0 -985
  1065. package/coverage/lcov-report/src/form/TextAreaBackup.tsx.html +0 -985
  1066. package/coverage/lcov-report/src/form/TextField.tsx.html +0 -829
  1067. package/coverage/lcov-report/src/form/TextFieldAddon.tsx.html +0 -382
  1068. package/coverage/lcov-report/src/form/TextFieldContainer.tsx.html +0 -364
  1069. package/coverage/lcov-report/src/form/TextFieldContainerStyles.ts.html +0 -418
  1070. package/coverage/lcov-report/src/form/fileUtils.ts.html +0 -2155
  1071. package/coverage/lcov-report/src/form/formConfig.ts.html +0 -157
  1072. package/coverage/lcov-report/src/form/formMessageStyles.ts.html +0 -238
  1073. package/coverage/lcov-report/src/form/index.html +0 -176
  1074. package/coverage/lcov-report/src/form/inputToggleStyles.ts.html +0 -316
  1075. package/coverage/lcov-report/src/form/menuItemInputToggleStyles.ts.html +0 -319
  1076. package/coverage/lcov-report/src/form/nativeSelectStyles.ts.html +0 -253
  1077. package/coverage/lcov-report/src/form/optionStyles.ts.html +0 -151
  1078. package/coverage/lcov-report/src/form/passwordStyles.ts.html +0 -235
  1079. package/coverage/lcov-report/src/form/selectStyles.ts.html +0 -181
  1080. package/coverage/lcov-report/src/form/selectUtils.ts.html +0 -430
  1081. package/coverage/lcov-report/src/form/sliderUtils.ts.html +0 -790
  1082. package/coverage/lcov-report/src/form/switchStyles.ts.html +0 -172
  1083. package/coverage/lcov-report/src/form/textAreaStyles.ts.html +0 -385
  1084. package/coverage/lcov-report/src/form/textFieldStyles.ts.html +0 -184
  1085. package/coverage/lcov-report/src/form/useAutoComplete.ts.html +0 -787
  1086. package/coverage/lcov-report/src/form/useCheckboxGroup.ts.html +0 -1087
  1087. package/coverage/lcov-report/src/form/useCombobox.ts.html +0 -1540
  1088. package/coverage/lcov-report/src/form/useComboboxBoth.ts.html +0 -85
  1089. package/coverage/lcov-report/src/form/useComboboxDialog.ts.html +0 -85
  1090. package/coverage/lcov-report/src/form/useComboboxList.ts.html +0 -403
  1091. package/coverage/lcov-report/src/form/useComboboxOrig.ts.html +0 -781
  1092. package/coverage/lcov-report/src/form/useEditableCombobox.ts.html +0 -502
  1093. package/coverage/lcov-report/src/form/useFileUpload.ts.html +0 -1702
  1094. package/coverage/lcov-report/src/form/useInlineAutoComplete.ts.html +0 -109
  1095. package/coverage/lcov-report/src/form/useListboxProvider.ts.html +0 -214
  1096. package/coverage/lcov-report/src/form/useNumberField.ts.html +0 -1561
  1097. package/coverage/lcov-report/src/form/useRadioGroup.ts.html +0 -1021
  1098. package/coverage/lcov-report/src/form/useRangeSlider.ts.html +0 -355
  1099. package/coverage/lcov-report/src/form/useResizingTextArea.ts.html +0 -634
  1100. package/coverage/lcov-report/src/form/useResizingTextArea.tsx.html +0 -523
  1101. package/coverage/lcov-report/src/form/useSelectCombobox.ts.html +0 -295
  1102. package/coverage/lcov-report/src/form/useSlider.ts.html +0 -421
  1103. package/coverage/lcov-report/src/form/useTextField.ts.html +0 -2203
  1104. package/coverage/lcov-report/src/form/utils.ts.html +0 -373
  1105. package/coverage/lcov-report/src/form/validation.ts.html +0 -886
  1106. package/coverage/lcov-report/src/hoverMode/index.html +0 -131
  1107. package/coverage/lcov-report/src/hoverMode/useHoverMode.ts.html +0 -676
  1108. package/coverage/lcov-report/src/hoverMode/useHoverModeProvider.ts.html +0 -1018
  1109. package/coverage/lcov-report/src/icon/FontIcon.tsx.html +0 -256
  1110. package/coverage/lcov-report/src/icon/IconProvider.tsx.html +0 -931
  1111. package/coverage/lcov-report/src/icon/IconRotator.tsx.html +0 -322
  1112. package/coverage/lcov-report/src/icon/MaterialIcon.tsx.html +0 -235
  1113. package/coverage/lcov-report/src/icon/MaterialIconsProvider.ts.html +0 -154
  1114. package/coverage/lcov-report/src/icon/MaterialSymbol.tsx.html +0 -421
  1115. package/coverage/lcov-report/src/icon/MaterialSymbolsProvider.tsx.html +0 -757
  1116. package/coverage/lcov-report/src/icon/SVGIcon.tsx.html +0 -445
  1117. package/coverage/lcov-report/src/icon/TextIconSpacing.tsx.html +0 -679
  1118. package/coverage/lcov-report/src/icon/iconConfig.tsx.html +0 -973
  1119. package/coverage/lcov-report/src/icon/index.html +0 -116
  1120. package/coverage/lcov-report/src/icon/material.ts.html +0 -15922
  1121. package/coverage/lcov-report/src/icon/materialConfig.ts.html +0 -703
  1122. package/coverage/lcov-report/src/icon/styles.ts.html +0 -586
  1123. package/coverage/lcov-report/src/interaction/ElementInteractionProvider.tsx.html +0 -277
  1124. package/coverage/lcov-report/src/interaction/LazyRippleContainer.tsx.html +0 -136
  1125. package/coverage/lcov-report/src/interaction/Ripple.tsx.html +0 -283
  1126. package/coverage/lcov-report/src/interaction/RippleContainer.tsx.html +0 -211
  1127. package/coverage/lcov-report/src/interaction/UserInteractionModeProvider.tsx.html +0 -679
  1128. package/coverage/lcov-report/src/interaction/config.ts.html +0 -181
  1129. package/coverage/lcov-report/src/interaction/index.html +0 -206
  1130. package/coverage/lcov-report/src/interaction/useElementInteraction.ts.html +0 -1474
  1131. package/coverage/lcov-report/src/interaction/useElementInteraction.tsx.html +0 -1513
  1132. package/coverage/lcov-report/src/interaction/useHigherContrastChildren.tsx.html +0 -355
  1133. package/coverage/lcov-report/src/interaction/utils.ts.html +0 -496
  1134. package/coverage/lcov-report/src/layout/DefaultLayoutNavigationItemRenderer.tsx.html +0 -169
  1135. package/coverage/lcov-report/src/layout/DefaultLayoutNavigationMiniItemRenderer.tsx.html +0 -160
  1136. package/coverage/lcov-report/src/layout/Layout.tsx.html +0 -235
  1137. package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +0 -364
  1138. package/coverage/lcov-report/src/layout/LayoutAppBarTitle.tsx.html +0 -193
  1139. package/coverage/lcov-report/src/layout/LayoutChildren.tsx.html +0 -718
  1140. package/coverage/lcov-report/src/layout/LayoutMain.tsx.html +0 -580
  1141. package/coverage/lcov-report/src/layout/LayoutNav.tsx.html +0 -688
  1142. package/coverage/lcov-report/src/layout/LayoutNavToggle.tsx.html +0 -430
  1143. package/coverage/lcov-report/src/layout/LayoutNavigation.tsx.html +0 -445
  1144. package/coverage/lcov-report/src/layout/LayoutNavigationHeader.tsx.html +0 -274
  1145. package/coverage/lcov-report/src/layout/LayoutProvider.tsx.html +0 -706
  1146. package/coverage/lcov-report/src/layout/LayoutTree.tsx.html +0 -331
  1147. package/coverage/lcov-report/src/layout/LayoutWindowSplitter.tsx.html +0 -472
  1148. package/coverage/lcov-report/src/layout/Main.tsx.html +0 -364
  1149. package/coverage/lcov-report/src/layout/MiniLayoutWrapper.tsx.html +0 -541
  1150. package/coverage/lcov-report/src/layout/NavigationLink.tsx.html +0 -334
  1151. package/coverage/lcov-report/src/layout/NavigationRail.tsx.html +0 -157
  1152. package/coverage/lcov-report/src/layout/TemporaryLayout.tsx.html +0 -85
  1153. package/coverage/lcov-report/src/layout/constants.ts.html +0 -169
  1154. package/coverage/lcov-report/src/layout/index.html +0 -146
  1155. package/coverage/lcov-report/src/layout/layoutNavStyles.ts.html +0 -166
  1156. package/coverage/lcov-report/src/layout/layoutWindowSplitterStyles.ts.html +0 -220
  1157. package/coverage/lcov-report/src/layout/mainStyles.ts.html +0 -217
  1158. package/coverage/lcov-report/src/layout/navigationLinkStyles.ts.html +0 -250
  1159. package/coverage/lcov-report/src/layout/navigationRailStyles.ts.html +0 -148
  1160. package/coverage/lcov-report/src/layout/useExpandableLayout.ts.html +0 -742
  1161. package/coverage/lcov-report/src/layout/useHorizontalLayoutTransition.ts.html +0 -349
  1162. package/coverage/lcov-report/src/layout/useLayoutAppBarHeight.ts.html +0 -358
  1163. package/coverage/lcov-report/src/layout/useLayoutNavigation.ts.html +0 -544
  1164. package/coverage/lcov-report/src/layout/useLayoutTree.ts.html +0 -691
  1165. package/coverage/lcov-report/src/layout/useLayoutWindowSplitter.ts.html +0 -496
  1166. package/coverage/lcov-report/src/layout/useMainTabIndex.ts.html +0 -136
  1167. package/coverage/lcov-report/src/layout/useResizableLayout.ts.html +0 -535
  1168. package/coverage/lcov-report/src/layout/useTemporaryLayout.ts.html +0 -589
  1169. package/coverage/lcov-report/src/layout/utils.ts.html +0 -391
  1170. package/coverage/lcov-report/src/link/Link.tsx.html +0 -358
  1171. package/coverage/lcov-report/src/link/LinkProvider.tsx.html +0 -238
  1172. package/coverage/lcov-report/src/link/SkipToMainContent.tsx.html +0 -448
  1173. package/coverage/lcov-report/src/link/index.html +0 -146
  1174. package/coverage/lcov-report/src/link/styles.ts.html +0 -238
  1175. package/coverage/lcov-report/src/list/List.tsx.html +0 -487
  1176. package/coverage/lcov-report/src/list/ListItem.tsx.html +0 -892
  1177. package/coverage/lcov-report/src/list/ListItemAddon.tsx.html +0 -286
  1178. package/coverage/lcov-report/src/list/ListItemChildren.tsx.html +0 -445
  1179. package/coverage/lcov-report/src/list/ListItemLink.tsx.html +0 -616
  1180. package/coverage/lcov-report/src/list/ListItemText.tsx.html +0 -277
  1181. package/coverage/lcov-report/src/list/ListSubheader.tsx.html +0 -319
  1182. package/coverage/lcov-report/src/list/getListItemHeight.ts.html +0 -298
  1183. package/coverage/lcov-report/src/list/index.html +0 -116
  1184. package/coverage/lcov-report/src/list/listItemStyles.ts.html +0 -703
  1185. package/coverage/lcov-report/src/main-layout/DefaultLayoutNavigationItemRenderer.tsx.html +0 -169
  1186. package/coverage/lcov-report/src/main-layout/DefaultLayoutNavigationMiniItemRenderer.tsx.html +0 -160
  1187. package/coverage/lcov-report/src/main-layout/Main.tsx.html +0 -298
  1188. package/coverage/lcov-report/src/main-layout/MainLayout.tsx.html +0 -619
  1189. package/coverage/lcov-report/src/main-layout/MainLayoutAppBar.tsx.html +0 -448
  1190. package/coverage/lcov-report/src/main-layout/MainLayoutNavigationButton.tsx.html +0 -295
  1191. package/coverage/lcov-report/src/main-layout/MainLayoutTitle.tsx.html +0 -184
  1192. package/coverage/lcov-report/src/main-layout/MainNavWindowSplitter.tsx.html +0 -427
  1193. package/coverage/lcov-report/src/main-layout/MainNavigation.tsx.html +0 -568
  1194. package/coverage/lcov-report/src/main-layout/MainNavigationTree.tsx.html +0 -115
  1195. package/coverage/lcov-report/src/main-layout/index.html +0 -296
  1196. package/coverage/lcov-report/src/main-layout/useLayoutNavigation.ts.html +0 -727
  1197. package/coverage/lcov-report/src/main-layout/useMainLayout.ts.html +0 -523
  1198. package/coverage/lcov-report/src/main-layout/useMainLayoutProvider.ts.html +0 -484
  1199. package/coverage/lcov-report/src/main-layout-current/DefaultLayoutNavigationItemRenderer.tsx.html +0 -169
  1200. package/coverage/lcov-report/src/main-layout-current/DefaultLayoutNavigationMiniItemRenderer.tsx.html +0 -160
  1201. package/coverage/lcov-report/src/main-layout-current/Main.tsx.html +0 -265
  1202. package/coverage/lcov-report/src/main-layout-current/MainLayout.tsx.html +0 -739
  1203. package/coverage/lcov-report/src/main-layout-current/MainLayoutAppBar.tsx.html +0 -352
  1204. package/coverage/lcov-report/src/main-layout-current/MainLayoutProvider.ts.html +0 -991
  1205. package/coverage/lcov-report/src/main-layout-current/MainLayoutTitle.tsx.html +0 -184
  1206. package/coverage/lcov-report/src/main-layout-current/MainNavWindowSplitter.tsx.html +0 -520
  1207. package/coverage/lcov-report/src/main-layout-current/MainNavigation.tsx.html +0 -586
  1208. package/coverage/lcov-report/src/main-layout-current/NavigationButton.tsx.html +0 -283
  1209. package/coverage/lcov-report/src/main-layout-current/index.html +0 -266
  1210. package/coverage/lcov-report/src/main-layout-current/useLayoutNavigation.ts.html +0 -727
  1211. package/coverage/lcov-report/src/media-queries/AppSizeProvider.tsx.html +0 -502
  1212. package/coverage/lcov-report/src/media-queries/appSize.ts.html +0 -445
  1213. package/coverage/lcov-report/src/media-queries/index.html +0 -146
  1214. package/coverage/lcov-report/src/media-queries/useMediaQuery.ts.html +0 -244
  1215. package/coverage/lcov-report/src/media-queries/useMinWidthMediaQuery.ts.html +0 -115
  1216. package/coverage/lcov-report/src/menu/DropdownMenu.tsx.html +0 -976
  1217. package/coverage/lcov-report/src/menu/Menu.tsx.html +0 -1870
  1218. package/coverage/lcov-report/src/menu/MenuBar.tsx.html +0 -442
  1219. package/coverage/lcov-report/src/menu/MenuButton.tsx.html +0 -490
  1220. package/coverage/lcov-report/src/menu/MenuConfigurationProvider.tsx.html +0 -637
  1221. package/coverage/lcov-report/src/menu/MenuItem.tsx.html +0 -292
  1222. package/coverage/lcov-report/src/menu/MenuItemButton.tsx.html +0 -580
  1223. package/coverage/lcov-report/src/menu/MenuItemCircularProgress.tsx.html +0 -433
  1224. package/coverage/lcov-report/src/menu/MenuItemGroup.tsx.html +0 -376
  1225. package/coverage/lcov-report/src/menu/MenuItemSeparator.tsx.html +0 -226
  1226. package/coverage/lcov-report/src/menu/MenuSheet.tsx.html +0 -502
  1227. package/coverage/lcov-report/src/menu/MenuVisibilityProvider.tsx.html +0 -370
  1228. package/coverage/lcov-report/src/menu/MenuWidget.tsx.html +0 -631
  1229. package/coverage/lcov-report/src/menu/MenuWidgetKeyboardProvider.tsx.html +0 -190
  1230. package/coverage/lcov-report/src/menu/index.html +0 -116
  1231. package/coverage/lcov-report/src/menu/useContextMenu.ts.html +0 -490
  1232. package/coverage/lcov-report/src/menu/useMenuBarProvider.ts.html +0 -349
  1233. package/coverage/lcov-report/src/menu/utils.ts.html +0 -271
  1234. package/coverage/lcov-report/src/movement/constants.ts.html +0 -193
  1235. package/coverage/lcov-report/src/movement/findMatchIndex.ts.html +0 -385
  1236. package/coverage/lcov-report/src/movement/index.html +0 -116
  1237. package/coverage/lcov-report/src/movement/useKeyboardMovementProvider.ts.html +0 -1687
  1238. package/coverage/lcov-report/src/movement/utils.ts.html +0 -895
  1239. package/coverage/lcov-report/src/navigation/CollapsibleNavGroup.tsx.html +0 -367
  1240. package/coverage/lcov-report/src/navigation/DefaultNavigationRenderer.tsx.html +0 -325
  1241. package/coverage/lcov-report/src/navigation/NavGroup.tsx.html +0 -202
  1242. package/coverage/lcov-report/src/navigation/NavItem.tsx.html +0 -172
  1243. package/coverage/lcov-report/src/navigation/NavSubheader.tsx.html +0 -193
  1244. package/coverage/lcov-report/src/navigation/Navigation.tsx.html +0 -358
  1245. package/coverage/lcov-report/src/navigation/index.html +0 -191
  1246. package/coverage/lcov-report/src/overlay/Overlay.tsx.html +0 -556
  1247. package/coverage/lcov-report/src/overlay/index.html +0 -131
  1248. package/coverage/lcov-report/src/overlay/overlayStyles.ts.html +0 -340
  1249. package/coverage/lcov-report/src/portal/Portal.tsx.html +0 -223
  1250. package/coverage/lcov-report/src/portal/PortalContainerProvider.tsx.html +0 -367
  1251. package/coverage/lcov-report/src/portal/index.html +0 -131
  1252. package/coverage/lcov-report/src/positioning/constants.ts.html +0 -463
  1253. package/coverage/lcov-report/src/positioning/getFixedPosition.ts.html +0 -610
  1254. package/coverage/lcov-report/src/positioning/index.html +0 -191
  1255. package/coverage/lcov-report/src/positioning/useFixedPositioning.ts.html +0 -1339
  1256. package/coverage/lcov-report/src/positioning/utils.ts.html +0 -1225
  1257. package/coverage/lcov-report/src/progress/CircularProgress.tsx.html +0 -799
  1258. package/coverage/lcov-report/src/progress/LinearProgress.tsx.html +0 -658
  1259. package/coverage/lcov-report/src/progress/getProgressA11y.ts.html +0 -160
  1260. package/coverage/lcov-report/src/progress/index.html +0 -146
  1261. package/coverage/lcov-report/src/responsive-item/ResponsiveItemContainer.tsx.html +0 -628
  1262. package/coverage/lcov-report/src/responsive-item/ResponsiveItemOverlay.tsx.html +0 -385
  1263. package/coverage/lcov-report/src/responsive-item/index.html +0 -146
  1264. package/coverage/lcov-report/src/responsive-item/styles.ts.html +0 -259
  1265. package/coverage/lcov-report/src/scroll/ScrollLock.tsx.html +0 -133
  1266. package/coverage/lcov-report/src/scroll/getScrollbarWidth.ts.html +0 -181
  1267. package/coverage/lcov-report/src/scroll/index.html +0 -146
  1268. package/coverage/lcov-report/src/scroll/useScrollLock.ts.html +0 -241
  1269. package/coverage/lcov-report/src/segmented-button/SegmentedButton.tsx.html +0 -619
  1270. package/coverage/lcov-report/src/segmented-button/SegmentedButtonContainer.tsx.html +0 -277
  1271. package/coverage/lcov-report/src/segmented-button/index.html +0 -161
  1272. package/coverage/lcov-report/src/segmented-button/segmentedButtonContainerStyles.ts.html +0 -160
  1273. package/coverage/lcov-report/src/segmented-button/segmentedButtonStyles.ts.html +0 -205
  1274. package/coverage/lcov-report/src/sheet/Sheet.tsx.html +0 -397
  1275. package/coverage/lcov-report/src/sheet/index.html +0 -131
  1276. package/coverage/lcov-report/src/sheet/styles.ts.html +0 -376
  1277. package/coverage/lcov-report/src/snackbar/DefaultToastRenderer.tsx.html +0 -526
  1278. package/coverage/lcov-report/src/snackbar/Snackbar.tsx.html +0 -628
  1279. package/coverage/lcov-report/src/snackbar/Toast.tsx.html +0 -841
  1280. package/coverage/lcov-report/src/snackbar/ToastActionButton.tsx.html +0 -298
  1281. package/coverage/lcov-report/src/snackbar/ToastCloseButton.tsx.html +0 -349
  1282. package/coverage/lcov-report/src/snackbar/ToastContent.tsx.html +0 -364
  1283. package/coverage/lcov-report/src/snackbar/ToastManager.tsx.html +0 -1786
  1284. package/coverage/lcov-report/src/snackbar/ToastManagerProvider.tsx.html +0 -400
  1285. package/coverage/lcov-report/src/snackbar/index.html +0 -281
  1286. package/coverage/lcov-report/src/snackbar/snackbarStyles.ts.html +0 -214
  1287. package/coverage/lcov-report/src/snackbar/toastContentStyles.ts.html +0 -196
  1288. package/coverage/lcov-report/src/snackbar/toastStyles.ts.html +0 -268
  1289. package/coverage/lcov-report/src/snackbar/useCurrentToastActions.ts.html +0 -226
  1290. package/coverage/lcov-report/src/snackbar/useDefaultToastRenderer.ts.html +0 -85
  1291. package/coverage/lcov-report/src/snackbar/useDefaultToastRenderer.tsx.html +0 -394
  1292. package/coverage/lcov-report/src/snackbar/useRemoveToast.ts.html +0 -169
  1293. package/coverage/lcov-report/src/snackbar/useToast.ts.html +0 -184
  1294. package/coverage/lcov-report/src/snackbar/useToastRenderer.ts.html +0 -85
  1295. package/coverage/lcov-report/src/suspense/CircularProgressSuspense.tsx.html +0 -283
  1296. package/coverage/lcov-report/src/suspense/NullSsrSuspense.tsx.html +0 -151
  1297. package/coverage/lcov-report/src/suspense/NullSuspense.tsx.html +0 -202
  1298. package/coverage/lcov-report/src/suspense/index.html +0 -131
  1299. package/coverage/lcov-report/src/table/Table.tsx.html +0 -457
  1300. package/coverage/lcov-report/src/table/TableBody.tsx.html +0 -280
  1301. package/coverage/lcov-report/src/table/TableCell.tsx.html +0 -982
  1302. package/coverage/lcov-report/src/table/TableCellContent.tsx.html +0 -436
  1303. package/coverage/lcov-report/src/table/TableCheckbox.tsx.html +0 -715
  1304. package/coverage/lcov-report/src/table/TableConfigurationProvider.tsx.html +0 -484
  1305. package/coverage/lcov-report/src/table/TableContainer.tsx.html +0 -220
  1306. package/coverage/lcov-report/src/table/TableContainerProvider.tsx.html +0 -193
  1307. package/coverage/lcov-report/src/table/TableFooter.tsx.html +0 -538
  1308. package/coverage/lcov-report/src/table/TableHeader.tsx.html +0 -565
  1309. package/coverage/lcov-report/src/table/TableRadio.tsx.html +0 -676
  1310. package/coverage/lcov-report/src/table/TableRow.tsx.html +0 -289
  1311. package/coverage/lcov-report/src/table/index.html +0 -371
  1312. package/coverage/lcov-report/src/table/tableCellStyles.ts.html +0 -334
  1313. package/coverage/lcov-report/src/table/tableContainerStyles.ts.html +0 -142
  1314. package/coverage/lcov-report/src/table/tableFooterStyles.ts.html +0 -166
  1315. package/coverage/lcov-report/src/table/tableHeaderStyles.ts.html +0 -172
  1316. package/coverage/lcov-report/src/table/tableRowStyles.ts.html +0 -169
  1317. package/coverage/lcov-report/src/table/tableStyles.ts.html +0 -157
  1318. package/coverage/lcov-report/src/tabs/Tab.tsx.html +0 -622
  1319. package/coverage/lcov-report/src/tabs/TabList.tsx.html +0 -796
  1320. package/coverage/lcov-report/src/tabs/TabListScrollButton.tsx.html +0 -490
  1321. package/coverage/lcov-report/src/tabs/index.html +0 -251
  1322. package/coverage/lcov-report/src/tabs/tabIndicatorStyles.ts.html +0 -187
  1323. package/coverage/lcov-report/src/tabs/tabListScrollButtonStyles.ts.html +0 -226
  1324. package/coverage/lcov-report/src/tabs/tabListStyles.ts.html +0 -241
  1325. package/coverage/lcov-report/src/tabs/tabStyles.ts.html +0 -265
  1326. package/coverage/lcov-report/src/tabs/useTabList.ts.html +0 -736
  1327. package/coverage/lcov-report/src/tabs/useTabs.ts.html +0 -1567
  1328. package/coverage/lcov-report/src/tabs/useTabsOriginal.ts.html +0 -760
  1329. package/coverage/lcov-report/src/tabs/utils.ts.html +0 -337
  1330. package/coverage/lcov-report/src/test-utils/IntersectionObserver.ts.html +0 -235
  1331. package/coverage/lcov-report/src/test-utils/ResizeObserver.ts.html +0 -1045
  1332. package/coverage/lcov-report/src/test-utils/data-testid.ts.html +0 -112
  1333. package/coverage/lcov-report/src/test-utils/drag.ts.html +0 -337
  1334. package/coverage/lcov-report/src/test-utils/index.html +0 -116
  1335. package/coverage/lcov-report/src/test-utils/jest-setup.ts.html +0 -124
  1336. package/coverage/lcov-report/src/test-utils/matchMedia.ts.html +0 -679
  1337. package/coverage/lcov-report/src/test-utils/polyfills/IntersectionObserver.ts.html +0 -109
  1338. package/coverage/lcov-report/src/test-utils/polyfills/ResizeObserver.ts.html +0 -100
  1339. package/coverage/lcov-report/src/test-utils/polyfills/TextDecoder.ts.html +0 -106
  1340. package/coverage/lcov-report/src/test-utils/polyfills/TextEncoder.ts.html +0 -100
  1341. package/coverage/lcov-report/src/test-utils/polyfills/index.html +0 -176
  1342. package/coverage/lcov-report/src/test-utils/polyfills/matchMedia.ts.html +0 -109
  1343. package/coverage/lcov-report/src/test-utils/polyfills/offsetParent.ts.html +0 -202
  1344. package/coverage/lcov-report/src/test-utils/polyfills/scrollIntoView.ts.html +0 -112
  1345. package/coverage/lcov-report/src/test-utils/render.tsx.html +0 -220
  1346. package/coverage/lcov-report/src/test-utils/root-html-environment.ts.html +0 -85
  1347. package/coverage/lcov-report/src/test-utils/timers.ts.html +0 -223
  1348. package/coverage/lcov-report/src/test-utils/utils.ts.html +0 -118
  1349. package/coverage/lcov-report/src/theme/ColorSchemeProvider.tsx.html +0 -811
  1350. package/coverage/lcov-report/src/theme/LocalStorageColorSchemeProvider.tsx.html +0 -475
  1351. package/coverage/lcov-report/src/theme/ThemeProvider.tsx.html +0 -1510
  1352. package/coverage/lcov-report/src/theme/colors.ts.html +0 -910
  1353. package/coverage/lcov-report/src/theme/cssVars.ts.html +0 -130
  1354. package/coverage/lcov-report/src/theme/index.html +0 -251
  1355. package/coverage/lcov-report/src/theme/useCSSVariables.ts.html +0 -622
  1356. package/coverage/lcov-report/src/theme/useColorScheme.ts.html +0 -490
  1357. package/coverage/lcov-report/src/theme/useColorSchemeMetaTag.ts.html +0 -244
  1358. package/coverage/lcov-report/src/theme/useColorSchemeProvider.ts.html +0 -433
  1359. package/coverage/lcov-report/src/theme/usePrefersColorScheme.ts.html +0 -121
  1360. package/coverage/lcov-report/src/theme/utils.ts.html +0 -670
  1361. package/coverage/lcov-report/src/tooltip/Tooltip.tsx.html +0 -559
  1362. package/coverage/lcov-report/src/tooltip/TooltipHoverModeProvider.tsx.html +0 -409
  1363. package/coverage/lcov-report/src/tooltip/constants.ts.html +0 -208
  1364. package/coverage/lcov-report/src/tooltip/index.html +0 -206
  1365. package/coverage/lcov-report/src/tooltip/tooltipStyles.ts.html +0 -181
  1366. package/coverage/lcov-report/src/tooltip/useOverflowTooltip.ts.html +0 -364
  1367. package/coverage/lcov-report/src/tooltip/useTooltip.ts.html +0 -2095
  1368. package/coverage/lcov-report/src/tooltip/useTooltipPosition.ts.html +0 -388
  1369. package/coverage/lcov-report/src/tooltip/utils.ts.html +0 -238
  1370. package/coverage/lcov-report/src/transition/CSSTransition.tsx.html +0 -358
  1371. package/coverage/lcov-report/src/transition/Collapse.tsx.html +0 -337
  1372. package/coverage/lcov-report/src/transition/CrossFade.tsx.html +0 -436
  1373. package/coverage/lcov-report/src/transition/ScaleTransition.tsx.html +0 -328
  1374. package/coverage/lcov-report/src/transition/SkeletonPlaceholder.tsx.html +0 -613
  1375. package/coverage/lcov-report/src/transition/Slide.tsx.html +0 -367
  1376. package/coverage/lcov-report/src/transition/SlideContainer.tsx.html +0 -649
  1377. package/coverage/lcov-report/src/transition/collapseStyles.ts.html +0 -184
  1378. package/coverage/lcov-report/src/transition/config.ts.html +0 -187
  1379. package/coverage/lcov-report/src/transition/constants.ts.html +0 -103
  1380. package/coverage/lcov-report/src/transition/maxWidthTransition.ts.html +0 -157
  1381. package/coverage/lcov-report/src/transition/skeletonPlaceholderUtils.ts.html +0 -400
  1382. package/coverage/lcov-report/src/transition/useCarousel.ts.html +0 -835
  1383. package/coverage/lcov-report/src/transition/useCollapseTransition.ts.html +0 -1384
  1384. package/coverage/lcov-report/src/transition/useCrossFadeTransition.ts.html +0 -469
  1385. package/coverage/lcov-report/src/transition/useMaxWidthTransition.ts.html +0 -205
  1386. package/coverage/lcov-report/src/transition/useScaleTransition.ts.html +0 -535
  1387. package/coverage/lcov-report/src/transition/useSkeletonPlaceholder.ts.html +0 -958
  1388. package/coverage/lcov-report/src/transition/useSlideTransition.ts.html +0 -424
  1389. package/coverage/lcov-report/src/transition/useTransition.ts.html +0 -943
  1390. package/coverage/lcov-report/src/transition/utils.ts.html +0 -529
  1391. package/coverage/lcov-report/src/tree/DefaultTreeItemRenderer.tsx.html +0 -313
  1392. package/coverage/lcov-report/src/tree/Tree.tsx.html +0 -1054
  1393. package/coverage/lcov-report/src/tree/TreeGroup.tsx.html +0 -367
  1394. package/coverage/lcov-report/src/tree/TreeItem.tsx.html +0 -1006
  1395. package/coverage/lcov-report/src/tree/TreeItemExpander.tsx.html +0 -355
  1396. package/coverage/lcov-report/src/tree/TreeProvider.tsx.html +0 -679
  1397. package/coverage/lcov-report/src/tree/index.html +0 -116
  1398. package/coverage/lcov-report/src/tree/styles.ts.html +0 -538
  1399. package/coverage/lcov-report/src/tree/useTree.ts.html +0 -289
  1400. package/coverage/lcov-report/src/tree/useTreeExpansion.ts.html +0 -241
  1401. package/coverage/lcov-report/src/tree/useTreeItems.ts.html +0 -496
  1402. package/coverage/lcov-report/src/tree/useTreeMovement.ts.html +0 -700
  1403. package/coverage/lcov-report/src/tree/useTreeSelection.ts.html +0 -274
  1404. package/coverage/lcov-report/src/tree/utils.ts.html +0 -277
  1405. package/coverage/lcov-report/src/typography/SrOnly.tsx.html +0 -328
  1406. package/coverage/lcov-report/src/typography/TextContainer.tsx.html +0 -403
  1407. package/coverage/lcov-report/src/typography/Typography.tsx.html +0 -1027
  1408. package/coverage/lcov-report/src/typography/WritingDirection.tsx.html +0 -775
  1409. package/coverage/lcov-report/src/typography/WritingDirectionProvider.tsx.html +0 -781
  1410. package/coverage/lcov-report/src/typography/index.html +0 -161
  1411. package/coverage/lcov-report/src/useAsyncAction.ts.html +0 -685
  1412. package/coverage/lcov-report/src/useDebounced.ts.html +0 -190
  1413. package/coverage/lcov-report/src/useDebouncedFunction.ts.html +0 -436
  1414. package/coverage/lcov-report/src/useDropzone.ts.html +0 -766
  1415. package/coverage/lcov-report/src/useElementSize.ts.html +0 -409
  1416. package/coverage/lcov-report/src/useEnsuredId.ts.html +0 -175
  1417. package/coverage/lcov-report/src/useEnsuredRef.ts.html +0 -253
  1418. package/coverage/lcov-report/src/useEnsuredState.ts.html +0 -235
  1419. package/coverage/lcov-report/src/useHtmlClassName.ts.html +0 -142
  1420. package/coverage/lcov-report/src/useIntersectionObserver.ts.html +0 -1075
  1421. package/coverage/lcov-report/src/useIsomorphicLayoutEffect.ts.html +0 -130
  1422. package/coverage/lcov-report/src/useLocalStorage.ts.html +0 -1852
  1423. package/coverage/lcov-report/src/useLocalStorageEvents.ts.html +0 -85
  1424. package/coverage/lcov-report/src/useMediaQuery.ts.html +0 -241
  1425. package/coverage/lcov-report/src/useMinWidthMediaQuery.ts.html +0 -115
  1426. package/coverage/lcov-report/src/useMutationObserver.ts.html +0 -310
  1427. package/coverage/lcov-report/src/useOrientation.ts.html +0 -271
  1428. package/coverage/lcov-report/src/usePageInactive.ts.html +0 -448
  1429. package/coverage/lcov-report/src/useResizeListener.ts.html +0 -391
  1430. package/coverage/lcov-report/src/useResizeObserver.ts.html +0 -790
  1431. package/coverage/lcov-report/src/useThrottledFunction.ts.html +0 -484
  1432. package/coverage/lcov-report/src/useToggle.ts.html +0 -253
  1433. package/coverage/lcov-report/src/useUnmounted.ts.html +0 -217
  1434. package/coverage/lcov-report/src/useWindowSize.ts.html +0 -460
  1435. package/coverage/lcov-report/src/utils/RecursiveRender.tsx.html +0 -253
  1436. package/coverage/lcov-report/src/utils/RenderRecursively.tsx.html +0 -790
  1437. package/coverage/lcov-report/src/utils/alphaNumericSort.ts.html +0 -535
  1438. package/coverage/lcov-report/src/utils/applyRef.ts.html +0 -214
  1439. package/coverage/lcov-report/src/utils/bem.ts.html +0 -412
  1440. package/coverage/lcov-report/src/utils/filters.ts.html +0 -1318
  1441. package/coverage/lcov-report/src/utils/getClientPosition.ts.html +0 -226
  1442. package/coverage/lcov-report/src/utils/getMiddleOfRange.ts.html +0 -163
  1443. package/coverage/lcov-report/src/utils/getPercentage.ts.html +0 -253
  1444. package/coverage/lcov-report/src/utils/getRangeDefaultValue.ts.html +0 -169
  1445. package/coverage/lcov-report/src/utils/getRangeSteps.ts.html +0 -157
  1446. package/coverage/lcov-report/src/utils/getUseStateSetterValue.ts.html +0 -85
  1447. package/coverage/lcov-report/src/utils/identity.ts.html +0 -100
  1448. package/coverage/lcov-report/src/utils/index.html +0 -116
  1449. package/coverage/lcov-report/src/utils/isElementVisible.ts.html +0 -214
  1450. package/coverage/lcov-report/src/utils/isValidNumber.ts.html +0 -118
  1451. package/coverage/lcov-report/src/utils/loop.ts.html +0 -262
  1452. package/coverage/lcov-report/src/utils/nearest.ts.html +0 -220
  1453. package/coverage/lcov-report/src/utils/parseCssLengthUnit.ts.html +0 -280
  1454. package/coverage/lcov-report/src/utils/randomInt.ts.html +0 -148
  1455. package/coverage/lcov-report/src/utils/wait.ts.html +0 -139
  1456. package/coverage/lcov-report/src/utils/withinRange.ts.html +0 -184
  1457. package/coverage/lcov-report/src/window-splitter/WindowSplitter.tsx.html +0 -445
  1458. package/coverage/lcov-report/src/window-splitter/index.html +0 -131
  1459. package/coverage/lcov-report/src/window-splitter/useControlledWindowSplitter.ts.html +0 -562
  1460. package/coverage/lcov-report/src/window-splitter/useLocalStorageWindowSplitter.ts.html +0 -331
  1461. package/coverage/lcov-report/src/window-splitter/useWindowSplitter.ts.html +0 -508
  1462. package/coverage/lcov-report/src/window-splitter/useWindowSplitterDefault.ts.html +0 -466
  1463. package/coverage/lcov-report/src/window-splitter/useWindowSplitterMaxValue.ts.html +0 -256
  1464. package/coverage/lcov-report/styles.ts.html +0 -457
  1465. package/coverage/lcov-report/suspense/CircularProgressSuspense.tsx.html +0 -283
  1466. package/coverage/lcov-report/suspense/NullSuspense.tsx.html +0 -202
  1467. package/coverage/lcov-report/suspense/index.html +0 -131
  1468. package/coverage/lcov-report/switchStyles.ts.html +0 -172
  1469. package/coverage/lcov-report/tabIndicatorStyles.ts.html +0 -187
  1470. package/coverage/lcov-report/tabListScrollButtonStyles.ts.html +0 -226
  1471. package/coverage/lcov-report/tabListStyles.ts.html +0 -241
  1472. package/coverage/lcov-report/tabStyles.ts.html +0 -265
  1473. package/coverage/lcov-report/table/Table.tsx.html +0 -526
  1474. package/coverage/lcov-report/table/TableBody.tsx.html +0 -280
  1475. package/coverage/lcov-report/table/TableCell.tsx.html +0 -1180
  1476. package/coverage/lcov-report/table/TableCheckbox.tsx.html +0 -709
  1477. package/coverage/lcov-report/table/TableFooter.tsx.html +0 -508
  1478. package/coverage/lcov-report/table/TableHeader.tsx.html +0 -607
  1479. package/coverage/lcov-report/table/TableRadio.tsx.html +0 -670
  1480. package/coverage/lcov-report/table/TableRow.tsx.html +0 -370
  1481. package/coverage/lcov-report/table/index.html +0 -191
  1482. package/coverage/lcov-report/tableCellStyles.ts.html +0 -334
  1483. package/coverage/lcov-report/tableContainerStyles.ts.html +0 -142
  1484. package/coverage/lcov-report/tableFooterStyles.ts.html +0 -157
  1485. package/coverage/lcov-report/tableHeaderStyles.ts.html +0 -163
  1486. package/coverage/lcov-report/tableRowStyles.ts.html +0 -169
  1487. package/coverage/lcov-report/tableStyles.ts.html +0 -157
  1488. package/coverage/lcov-report/tabs/Tab.tsx.html +0 -592
  1489. package/coverage/lcov-report/tabs/TabList.tsx.html +0 -796
  1490. package/coverage/lcov-report/tabs/TabListScrollButton.tsx.html +0 -472
  1491. package/coverage/lcov-report/tabs/index.html +0 -206
  1492. package/coverage/lcov-report/tabs/tabIndicatorStyles.ts.html +0 -187
  1493. package/coverage/lcov-report/tabs/tabListStyles.ts.html +0 -241
  1494. package/coverage/lcov-report/tabs/tabStyles.ts.html +0 -253
  1495. package/coverage/lcov-report/tabs/useTabList.ts.html +0 -736
  1496. package/coverage/lcov-report/tabs/useTabs.ts.html +0 -1567
  1497. package/coverage/lcov-report/tabs/utils.ts.html +0 -337
  1498. package/coverage/lcov-report/test-utils/index.html +0 -116
  1499. package/coverage/lcov-report/test-utils/jest-setup.ts.html +0 -124
  1500. package/coverage/lcov-report/test-utils/matchMedia.ts.html +0 -667
  1501. package/coverage/lcov-report/test-utils/polyfills/index.html +0 -116
  1502. package/coverage/lcov-report/test-utils/polyfills/matchMedia.ts.html +0 -109
  1503. package/coverage/lcov-report/test-utils/polyfills/offsetParent.ts.html +0 -202
  1504. package/coverage/lcov-report/test-utils/use.ts.html +0 -187
  1505. package/coverage/lcov-report/theme/ColorSchemeProvider.tsx.html +0 -811
  1506. package/coverage/lcov-report/theme/LocalStorageColorSchemeProvider.tsx.html +0 -268
  1507. package/coverage/lcov-report/theme/ThemeProvider.tsx.html +0 -1453
  1508. package/coverage/lcov-report/theme/cssVars.ts.html +0 -130
  1509. package/coverage/lcov-report/theme/index.html +0 -191
  1510. package/coverage/lcov-report/theme/useColorScheme.ts.html +0 -475
  1511. package/coverage/lcov-report/theme/useColorSchemeMetaTag.ts.html +0 -175
  1512. package/coverage/lcov-report/theme/useColorSchemeProvider.ts.html +0 -244
  1513. package/coverage/lcov-report/theme/usePrefersColorScheme.ts.html +0 -103
  1514. package/coverage/lcov-report/tooltip/Tooltip.tsx.html +0 -559
  1515. package/coverage/lcov-report/tooltip/TooltipHoverModeProvider.tsx.html +0 -409
  1516. package/coverage/lcov-report/tooltip/constants.ts.html +0 -208
  1517. package/coverage/lcov-report/tooltip/index.html +0 -116
  1518. package/coverage/lcov-report/tooltip/tooltipStyles.ts.html +0 -181
  1519. package/coverage/lcov-report/tooltip/useOverflowTooltip.ts.html +0 -364
  1520. package/coverage/lcov-report/tooltip/useTooltip.ts.html +0 -2095
  1521. package/coverage/lcov-report/tooltipStyles.ts.html +0 -181
  1522. package/coverage/lcov-report/transition/SkeletonPlaceholder.tsx.html +0 -595
  1523. package/coverage/lcov-report/transition/config.ts.html +0 -187
  1524. package/coverage/lcov-report/transition/maxWidthTransition.ts.html +0 -157
  1525. package/coverage/lcov-report/transition/skeletonPlaceholderUtils.ts.html +0 -400
  1526. package/coverage/lcov-report/transition/useMaxWidthTransition.ts.html +0 -199
  1527. package/coverage/lcov-report/transition/useScaleTransition.ts.html +0 -535
  1528. package/coverage/lcov-report/transition/useSkeletonPlaceholder.ts.html +0 -952
  1529. package/coverage/lcov-report/transition/useTransition.ts.html +0 -943
  1530. package/coverage/lcov-report/tree/DefaultTreeItemRenderer.tsx.html +0 -301
  1531. package/coverage/lcov-report/tree/Tree.tsx.html +0 -1054
  1532. package/coverage/lcov-report/tree/TreeGroup.tsx.html +0 -370
  1533. package/coverage/lcov-report/tree/TreeItem.tsx.html +0 -1006
  1534. package/coverage/lcov-report/tree/TreeItemExpander.tsx.html +0 -328
  1535. package/coverage/lcov-report/tree/TreeProvider.tsx.html +0 -679
  1536. package/coverage/lcov-report/tree/index.html +0 -116
  1537. package/coverage/lcov-report/tree/styles.ts.html +0 -538
  1538. package/coverage/lcov-report/tree/useTree.ts.html +0 -289
  1539. package/coverage/lcov-report/tree/useTreeExpansion.ts.html +0 -241
  1540. package/coverage/lcov-report/tree/useTreeItems.ts.html +0 -496
  1541. package/coverage/lcov-report/tree/useTreeMovement.ts.html +0 -700
  1542. package/coverage/lcov-report/tree/useTreeSelection.ts.html +0 -274
  1543. package/coverage/lcov-report/tree/utils.ts.html +0 -277
  1544. package/coverage/lcov-report/typography/TextContainer.tsx.html +0 -433
  1545. package/coverage/lcov-report/typography/Typography.tsx.html +0 -1027
  1546. package/coverage/lcov-report/typography/WritingDirection.tsx.html +0 -775
  1547. package/coverage/lcov-report/typography/WritingDirectionProvider.tsx.html +0 -781
  1548. package/coverage/lcov-report/useAutoComplete.ts.html +0 -787
  1549. package/coverage/lcov-report/useCollapseTransition.ts.html +0 -1384
  1550. package/coverage/lcov-report/useCombobox.ts.html +0 -1513
  1551. package/coverage/lcov-report/useDraggable.ts.html +0 -2458
  1552. package/coverage/lcov-report/useDropzone.ts.html +0 -763
  1553. package/coverage/lcov-report/useEnsuredRef.ts.html +0 -250
  1554. package/coverage/lcov-report/useExpandableLayout.ts.html +0 -802
  1555. package/coverage/lcov-report/useExpansionPanels.ts.html +0 -913
  1556. package/coverage/lcov-report/useHigherContrastChildren.tsx.html +0 -355
  1557. package/coverage/lcov-report/useInlineAutoComplete.ts.html +0 -379
  1558. package/coverage/lcov-report/useLayoutTree.ts.html +0 -691
  1559. package/coverage/lcov-report/useLocalStorage.ts.html +0 -1828
  1560. package/coverage/lcov-report/useMinWidthMediaQuery.ts.html +0 -115
  1561. package/coverage/lcov-report/useMutationObserver.ts.html +0 -310
  1562. package/coverage/lcov-report/useRemoveToast.ts.html +0 -160
  1563. package/coverage/lcov-report/useResizeObserver.ts.html +0 -874
  1564. package/coverage/lcov-report/useResizingTextArea.ts.html +0 -523
  1565. package/coverage/lcov-report/useSelectCombobox.ts.html +0 -295
  1566. package/coverage/lcov-report/useSkeletonPlaceholder.ts.html +0 -952
  1567. package/coverage/lcov-report/useTabList.ts.html +0 -736
  1568. package/coverage/lcov-report/useTabs.ts.html +0 -757
  1569. package/coverage/lcov-report/useThrottledFunction.ts.html +0 -475
  1570. package/coverage/lcov-report/useTooltip.ts.html +0 -2041
  1571. package/coverage/lcov-report/useTransition.ts.html +0 -934
  1572. package/coverage/lcov-report/useTree.ts.html +0 -286
  1573. package/coverage/lcov-report/useWindowSplitter.ts.html +0 -640
  1574. package/coverage/lcov-report/useWindowSplitterMaxValue.ts.html +0 -256
  1575. package/coverage/lcov-report/utils/RecursiveRender.tsx.html +0 -253
  1576. package/coverage/lcov-report/utils/RenderRecursively.tsx.html +0 -688
  1577. package/coverage/lcov-report/utils/alphaNumericSort.ts.html +0 -496
  1578. package/coverage/lcov-report/utils/caseInsensitiveFilter.ts.html +0 -397
  1579. package/coverage/lcov-report/utils/filters.ts.html +0 -1318
  1580. package/coverage/lcov-report/utils/fuzzyFilter.ts.html +0 -241
  1581. package/coverage/lcov-report/utils/index.html +0 -116
  1582. package/coverage/lcov-report/utils/isElementVisible.ts.html +0 -211
  1583. package/coverage/lcov-report/utils/parseCssLengthUnit.ts.html +0 -280
  1584. package/coverage/lcov-report/utils/randomInt.ts.html +0 -148
  1585. package/coverage/lcov-report/utils/searching.ts.html +0 -85
  1586. package/coverage/lcov-report/utils/wait.ts.html +0 -139
  1587. package/coverage/lcov-report/wait.ts.html +0 -139
  1588. package/coverage/lcov-report/window-splitter/WindowSplitter.tsx.html +0 -448
  1589. package/coverage/lcov-report/window-splitter/index.html +0 -116
  1590. package/coverage/lcov-report/window-splitter/useControlledWindowSplitter.ts.html +0 -562
  1591. package/coverage/lcov-report/window-splitter/useLocalStorageWindowSplitter.ts.html +0 -331
  1592. package/coverage/lcov-report/window-splitter/useWindowSplitter.ts.html +0 -640
  1593. package/coverage/lcov-report/window-splitter/useWindowSplitterDefault.ts.html +0 -466
  1594. package/coverage/lcov-report/window-splitter/useWindowSplitterOrig.ts.html +0 -598
  1595. package/dist/useAsyncAction.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/textFieldStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-text-field\");\n\n/** @since 6.0.0 */\nexport interface TextFieldClassNameOptions {\n className?: string;\n\n /**\n * Set this value to `true` when a text field has a floating label the text\n * field is not focused or valued so that the placeholder is hidden by setting\n * the opacity to 0. This makes it so the placeholder and label to not cover\n * each other.\n *\n * @defaultValue `false`\n */\n placeholderHidden?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textField(options: TextFieldClassNameOptions = {}): string {\n const { className, placeholderHidden = false } = options;\n\n return cnb(\n styles({\n \"placeholder-hidden\": placeholderHidden,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","textField","options","className","placeholderHidden"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAiBnB;;CAEC,GACD,OAAO,SAASE,UAAUC,UAAqC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,oBAAoB,KAAK,EAAE,GAAGF;IAEjD,OAAOJ,IACLE,OAAO;QACL,sBAAsBI;IACxB,IACAD;AAEJ"}
1
+ {"version":3,"sources":["../../src/form/textFieldStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-text-field\");\n\n/** @since 6.0.0 */\nexport interface TextFieldClassNameOptions {\n className?: string;\n\n /**\n * Set this value to `true` when a text field has a floating label the text\n * field is not focused or valued so that the placeholder is hidden by setting\n * the opacity to 0. This makes it so the placeholder and label to not cover\n * each other.\n *\n * @defaultValue `false`\n */\n placeholderHidden?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textField(options: TextFieldClassNameOptions = {}): string {\n const { className, placeholderHidden = false } = options;\n\n return cnb(\n styles({\n \"placeholder-hidden\": placeholderHidden,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","textField","options","className","placeholderHidden"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAiBnB;;CAEC,GACD,OAAO,SAASE,UAAUC,UAAqC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,oBAAoB,KAAK,EAAE,GAAGF;IAEjD,OAAOJ,IACLE,OAAO;QACL,sBAAsBI;IACxB,IACAD;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/types.ts"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-form-active-color\"?: string;\n \"--rmd-form-focus-color\"?: string;\n }\n}\n\n/**\n * The supported themes for the `TextField`, `TextArea`, and `Select`\n * components.\n *\n * - \"none\" - display as an unstyled text field without any border or background\n * colors.\n * - \"underline\" - display with only an underline that gains the form active\n * color and animates from the left or right to the other side when the field\n * is focused.\n * - \"filled\" - an extension of the `\"underline\"` state that will also have a\n * slightly dark background applied.\n * - \"outline\" - outlines the entire text field in a border and applies the\n * active color as box shadow when the field is focused.\n */\nexport type FormTheme = \"none\" | \"underline\" | \"filled\" | \"outline\";\n\n/**\n * The direction that the underline should appear from when the theme is\n * `\"underline\"` or `\"filled\"`.\n */\nexport type FormUnderlineDirection = \"left\" | \"center\" | \"right\";\n\nexport interface FormThemeOptions {\n /**\n * The current theme type.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n\n /**\n * The current underline direction.\n *\n * @defaultValue `\"left\"`\n */\n underlineDirection?: FormUnderlineDirection;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface FormConfiguration extends Required<FormThemeOptions> {\n /**\n * Set this to `false` if the `$disable-uncontrolled-input-toggles` variable\n * is set to `true` in the Sass configuration.\n *\n * Since the `checked` state only changes for the radio that has been clicked,\n * the previously checked radio would also be shown as checked with no way of\n * fixing it without controlling the radio component. When this flag is\n * enabled, the checked icons and state are handled through css instead of\n * `useState`.\n *\n * @defaultValue `true`\n */\n uncontrolledToggles: boolean;\n}\n\nexport interface FormComponentStates {\n /** @defaultValue `false` */\n error?: boolean;\n\n /** @defaultValue `false` */\n active?: boolean;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n readOnly?: boolean;\n}\n\n/**\n * @since 6.0.0\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\nexport type AutocompleteValue =\n | \"off\"\n | \"on\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level1\"\n | \"address-level2\"\n | \"address-level3\"\n | \"address-level4\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tek-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\n/**\n * @since 6.0.0\n */\nexport interface UserAgentAutocompleteProps {\n /**\n * Set this to enable additional autocompletion suggestions for a user for\n * different form fields. Using this prop will update the\n * {@link UserAgentAutocompleteProps.name} and {@link autoComplete} to default to\n * this value.\n *\n * @example\n * ```tsx\n * <Form>\n * <TextField\n * label=\"Enter your credit card number\"\n * autoCompleteValue=\"cc-number\"\n * {...creditCardProps}\n * inputMode=\"number\"\n * />\n * <TextField\n * label=\"Name on card\"\n * autoCompleteValue=\"cc-name\"\n * {...creditCardNameProps}\n * />\n * <TextField\n * label=\"Security code\"\n * autoCompleteValue=\"cc-csc\"\n * {...securityCodeProps}\n * inputMode=\"number\"\n * />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n * @see {@link AutocompleteValue}\n * @see {@link autoComplete}\n * @see {@link UserAgentAutocompleteProps.name}\n */\n autoCompleteValue?: AutocompleteValue;\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n autoComplete?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n name?: string;\n}\n\nexport interface FormMessageClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the message should gain the error state which changes the text\n * color to `red` by default.\n *\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * The current theme for the related text field. This is really only used to\n * match the current horizontal padding of the text field.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\nexport interface FormMessageProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"minLength\" | \"maxLength\">,\n FormMessageClassNameOptions {\n /**\n * If this component is acting as a form-level error message handler, the role\n * should be updated to be `\"alert\"` for additional accessibility.\n *\n * Note: when creating a form-level error message handler, the messages should\n * no longer appear as the user types and instead once the user tries to\n * submit the form. Having an alert role disrupts normal screen reader\n * behavior by immediately reading changes in this element.\n *\n * @defaultValue `undefined`\n */\n role?: \"alert\";\n\n /**\n * Boolean if the children should no longer be wrapped in a `<p>` tag. This\n * should normally only be disabled if using a custom error message wrapper or\n * the counter behavior is not being used. To get correct alignments of the\n * message and counter, the `children` must be wrapped in some element and\n * cannot be plain test.\n *\n * Note: this will always be considered `true` if the `role` is set to\n * `\"alert\"`.\n *\n * @defaultValue `false`\n */\n disableWrap?: boolean;\n\n /**\n * An optional style to apply to the `<p>` tag that surrounds the `children`.\n * This will not be used if `role=\"alert\"` or `disableWrap={true}`.\n */\n messageStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the `<p>` tag that surrounds the\n * `children`. This will not be used if `role=\"alert\"` or\n * `disableWrap={true}`.\n */\n messageClassName?: string;\n}\n\n/**\n * Props that are used to automatically add a counter for the remaining letters\n * available for the text field. The counter will always be created to the right\n * of the optional message.\n *\n * The counter is really a simple string of: `${length} / ${maxLength}`.\n *\n * If you need additional customization, it is recommended to create your own\n * implementation such as:\n *\n * ```tsx\n * <FormMessage>\n * {errorMessage}\n * <MyCounter {...props} />\n * </FormMessage>\n * ```\n *\n * Note: this should not be used alongside form-level messages.\n *\n * @since 2.9.0 Renamed from `FormMessageCounterProps` to\n * `FormMessageInputLengthCounterProps` since a `FormMessageCounter` component\n * was added\n */\nexport interface FormMessageInputLengthCounterProps {\n /**\n * The current length of the value in the related text field.\n */\n length: number;\n\n /**\n * The max length allowed for the value in the related text field.\n */\n maxLength: number;\n\n /**\n * An optional style to apply to the counter wrapper element.\n */\n counterStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the counter wrapper element.\n */\n counterClassName?: string;\n}\n\nexport interface FormMessageWithCounterProps\n extends FormMessageProps,\n FormMessageInputLengthCounterProps {}\n\n/**\n * @since 6.0.0\n */\nexport interface FormMessageWithoutCounterProps extends FormMessageProps {\n length?: never;\n maxLength?: never;\n counterStyle?: never;\n counterClassName?: never;\n}\n\nexport interface FormMessageContainerExtension {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>,\n HTMLDivElement\n >;\n\n /**\n * Any props (and an optional ref) to provide to the `<div>` surrounding the\n * children and `FormMessage` component.\n *\n * Note: This will not be used if the `messageProps` are not provided since\n * only the `children` will be returned without the container.\n */\n messageContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n}\n\n/** @since 6.0.0 */\nexport interface LabelClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to remove the `gap` style from the label.\n *\n * @see `$label-gap`\n * @defaultValue `false`\n */\n gap?: boolean;\n\n /**\n * Set this to `true` when the parent `TextFieldContainer` has the `dense`\n * spec enabled. This updates the floating styles to match the smaller height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the error color.\n *\n * @see `$error-color`\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the active color.\n *\n * @see `$active-color`\n * @defaultValue `false`\n */\n active?: boolean;\n\n /**\n * Set this to `true` if the label should gain `flex-direction: column`\n * styling.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Set this to `true` to update the label's color to be the disabled color.\n *\n * @see `$disabled-color`\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Set this to true when label can floating above an input, textarea, or\n * select inside of a `TextFieldContainer`.\n *\n * @defaultValue `false`\n */\n floating?: boolean;\n\n /**\n * Set this to true when label is currently floating above an input,\n * textarea, or selected inside of a `TextFieldContainer`.\n *\n * @see {@link active}\n * @defaultValue `active`\n */\n floatingActive?: boolean;\n\n /**\n * Set this to `true` to gain `flex-direction: row-reversed` styling. If the\n * {@link stacked} prop is also `true`, `flex-direction: column-reversed` will\n * be applied.\n *\n * @defaultValue `false`\n */\n reversed?: boolean;\n\n /**\n * @defaultValue `false`\n */\n inactive?: boolean;\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n LabelClassNameOptions {}\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableTextFieldAddonProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Boolean if the addon should be presentational only and prevent pointer\n * events.\n *\n * @defaultValue `false`\n */\n pointerEvents?: boolean;\n}\n\n/**\n * @since 6.0.0 Added support for `leftAddonProps` and\n * `rightAddonProps`.\n */\nexport interface TextFieldContainerOptions\n extends FormThemeOptions,\n FormComponentStates {\n /**\n * Set this to `true` to enable the dense spec which reduces the height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to change the style from `display: flex` to\n * `display: inline-flex`.\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n\n /**\n * Set this to `true` if this component should stretch to fill a flex or grid\n * container using `flex: 1 1 auto`.\n *\n * @defaultValue `false`\n */\n stretch?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed before the\n * `TextField` or `TextArea`.\n */\n leftAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link leftAddon}.\n *\n * @since 6.0.0\n */\n leftAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableLeftAddonStyles?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed after the\n * `TextField` or `TextArea`.\n */\n rightAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link rightAddon}.\n *\n * @since 6.0.0\n */\n rightAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableRightAddonStyles?: boolean;\n}\n\nexport interface FormFieldOptions\n extends TextFieldContainerOptions,\n FormMessageContainerExtension {\n /**\n * An optional floating label to use with the text field. A label is generally\n * recommended for accessibility, but can be omitted if an `aria-label` or\n * `aria-labelledby` is provided.\n */\n label?: ReactNode;\n\n /**\n * Any additional props and/or ref that should be passed to the `<label>`\n * element when a {@link label} is provided.\n *\n * @example\n * ```tsx\n * labelProps={{\n * ref: labelRef,\n * style: {},\n * className: \"some-custom-class-name\",\n * onClick: (event) => {\n * // do something\n * }\n * }}\n * ```\n */\n labelProps?: PropsWithRef<LabelProps, HTMLLabelElement>;\n\n /**\n * A convenience prop to apply a custom style to a label. This is equivalent\n * to:\n *\n * ```ts\n * labelProps={{\n * style: // some style here\n * }}\n * ```\n */\n labelStyle?: CSSProperties;\n\n /**\n * A convenience prop to apply a custom className to a label. This is\n * equivalent to:\n *\n * ```ts\n * labelProps={{\n * className: \"some-class-name\",\n * }}\n * ```\n */\n labelClassName?: string;\n}\n"],"names":[],"rangeMappings":"","mappings":"AAihBA,WAmDC"}
1
+ {"version":3,"sources":["../../src/form/types.ts"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-form-active-color\"?: string;\n \"--rmd-form-focus-color\"?: string;\n }\n}\n\n/**\n * The supported themes for the `TextField`, `TextArea`, and `Select`\n * components.\n *\n * - \"none\" - display as an unstyled text field without any border or background\n * colors.\n * - \"underline\" - display with only an underline that gains the form active\n * color and animates from the left or right to the other side when the field\n * is focused.\n * - \"filled\" - an extension of the `\"underline\"` state that will also have a\n * slightly dark background applied.\n * - \"outline\" - outlines the entire text field in a border and applies the\n * active color as box shadow when the field is focused.\n */\nexport type FormTheme = \"none\" | \"underline\" | \"filled\" | \"outline\";\n\n/**\n * The direction that the underline should appear from when the theme is\n * `\"underline\"` or `\"filled\"`.\n */\nexport type FormUnderlineDirection = \"left\" | \"center\" | \"right\";\n\nexport interface FormThemeOptions {\n /**\n * The current theme type.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n\n /**\n * The current underline direction.\n *\n * @defaultValue `\"left\"`\n */\n underlineDirection?: FormUnderlineDirection;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface FormConfiguration extends Required<FormThemeOptions> {\n /**\n * Set this to `false` if the `$disable-uncontrolled-input-toggles` variable\n * is set to `true` in the Sass configuration.\n *\n * Since the `checked` state only changes for the radio that has been clicked,\n * the previously checked radio would also be shown as checked with no way of\n * fixing it without controlling the radio component. When this flag is\n * enabled, the checked icons and state are handled through css instead of\n * `useState`.\n *\n * @defaultValue `true`\n */\n uncontrolledToggles: boolean;\n}\n\nexport interface FormComponentStates {\n /** @defaultValue `false` */\n error?: boolean;\n\n /** @defaultValue `false` */\n active?: boolean;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n readOnly?: boolean;\n}\n\n/**\n * @since 6.0.0\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\nexport type AutocompleteValue =\n | \"off\"\n | \"on\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level1\"\n | \"address-level2\"\n | \"address-level3\"\n | \"address-level4\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tek-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\n/**\n * @since 6.0.0\n */\nexport interface UserAgentAutocompleteProps {\n /**\n * Set this to enable additional autocompletion suggestions for a user for\n * different form fields. Using this prop will update the\n * {@link UserAgentAutocompleteProps.name} and {@link autoComplete} to default to\n * this value.\n *\n * @example\n * ```tsx\n * <Form>\n * <TextField\n * label=\"Enter your credit card number\"\n * autoCompleteValue=\"cc-number\"\n * {...creditCardProps}\n * inputMode=\"number\"\n * />\n * <TextField\n * label=\"Name on card\"\n * autoCompleteValue=\"cc-name\"\n * {...creditCardNameProps}\n * />\n * <TextField\n * label=\"Security code\"\n * autoCompleteValue=\"cc-csc\"\n * {...securityCodeProps}\n * inputMode=\"number\"\n * />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n * @see {@link AutocompleteValue}\n * @see {@link autoComplete}\n * @see {@link UserAgentAutocompleteProps.name}\n */\n autoCompleteValue?: AutocompleteValue;\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n autoComplete?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n name?: string;\n}\n\nexport interface FormMessageClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the message should gain the error state which changes the text\n * color to `red` by default.\n *\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * The current theme for the related text field. This is really only used to\n * match the current horizontal padding of the text field.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\nexport interface FormMessageProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"minLength\" | \"maxLength\">,\n FormMessageClassNameOptions {\n /**\n * If this component is acting as a form-level error message handler, the role\n * should be updated to be `\"alert\"` for additional accessibility.\n *\n * Note: when creating a form-level error message handler, the messages should\n * no longer appear as the user types and instead once the user tries to\n * submit the form. Having an alert role disrupts normal screen reader\n * behavior by immediately reading changes in this element.\n *\n * @defaultValue `undefined`\n */\n role?: \"alert\";\n\n /**\n * Boolean if the children should no longer be wrapped in a `<p>` tag. This\n * should normally only be disabled if using a custom error message wrapper or\n * the counter behavior is not being used. To get correct alignments of the\n * message and counter, the `children` must be wrapped in some element and\n * cannot be plain test.\n *\n * Note: this will always be considered `true` if the `role` is set to\n * `\"alert\"`.\n *\n * @defaultValue `false`\n */\n disableWrap?: boolean;\n\n /**\n * An optional style to apply to the `<p>` tag that surrounds the `children`.\n * This will not be used if `role=\"alert\"` or `disableWrap={true}`.\n */\n messageStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the `<p>` tag that surrounds the\n * `children`. This will not be used if `role=\"alert\"` or\n * `disableWrap={true}`.\n */\n messageClassName?: string;\n}\n\n/**\n * Props that are used to automatically add a counter for the remaining letters\n * available for the text field. The counter will always be created to the right\n * of the optional message.\n *\n * The counter is really a simple string of: `${length} / ${maxLength}`.\n *\n * If you need additional customization, it is recommended to create your own\n * implementation such as:\n *\n * ```tsx\n * <FormMessage>\n * {errorMessage}\n * <MyCounter {...props} />\n * </FormMessage>\n * ```\n *\n * Note: this should not be used alongside form-level messages.\n *\n * @since 2.9.0 Renamed from `FormMessageCounterProps` to\n * `FormMessageInputLengthCounterProps` since a `FormMessageCounter` component\n * was added\n */\nexport interface FormMessageInputLengthCounterProps {\n /**\n * The current length of the value in the related text field.\n */\n length: number;\n\n /**\n * The max length allowed for the value in the related text field.\n */\n maxLength: number;\n\n /**\n * An optional style to apply to the counter wrapper element.\n */\n counterStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the counter wrapper element.\n */\n counterClassName?: string;\n}\n\nexport interface FormMessageWithCounterProps\n extends FormMessageProps,\n FormMessageInputLengthCounterProps {}\n\n/**\n * @since 6.0.0\n */\nexport interface FormMessageWithoutCounterProps extends FormMessageProps {\n length?: never;\n maxLength?: never;\n counterStyle?: never;\n counterClassName?: never;\n}\n\nexport interface FormMessageContainerExtension {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>,\n HTMLDivElement\n >;\n\n /**\n * Any props (and an optional ref) to provide to the `<div>` surrounding the\n * children and `FormMessage` component.\n *\n * Note: This will not be used if the `messageProps` are not provided since\n * only the `children` will be returned without the container.\n */\n messageContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n}\n\n/** @since 6.0.0 */\nexport interface LabelClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to remove the `gap` style from the label.\n *\n * @see `$label-gap`\n * @defaultValue `false`\n */\n gap?: boolean;\n\n /**\n * Set this to `true` when the parent `TextFieldContainer` has the `dense`\n * spec enabled. This updates the floating styles to match the smaller height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the error color.\n *\n * @see `$error-color`\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the active color.\n *\n * @see `$active-color`\n * @defaultValue `false`\n */\n active?: boolean;\n\n /**\n * Set this to `true` if the label should gain `flex-direction: column`\n * styling.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Set this to `true` to update the label's color to be the disabled color.\n *\n * @see `$disabled-color`\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Set this to true when label can floating above an input, textarea, or\n * select inside of a `TextFieldContainer`.\n *\n * @defaultValue `false`\n */\n floating?: boolean;\n\n /**\n * Set this to true when label is currently floating above an input,\n * textarea, or selected inside of a `TextFieldContainer`.\n *\n * @see {@link active}\n * @defaultValue `active`\n */\n floatingActive?: boolean;\n\n /**\n * Set this to `true` to gain `flex-direction: row-reversed` styling. If the\n * {@link stacked} prop is also `true`, `flex-direction: column-reversed` will\n * be applied.\n *\n * @defaultValue `false`\n */\n reversed?: boolean;\n\n /**\n * @defaultValue `false`\n */\n inactive?: boolean;\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n LabelClassNameOptions {}\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableTextFieldAddonProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Boolean if the addon should be presentational only and prevent pointer\n * events.\n *\n * @defaultValue `false`\n */\n pointerEvents?: boolean;\n}\n\n/**\n * @since 6.0.0 Added support for `leftAddonProps` and\n * `rightAddonProps`.\n */\nexport interface TextFieldContainerOptions\n extends FormThemeOptions,\n FormComponentStates {\n /**\n * Set this to `true` to enable the dense spec which reduces the height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to change the style from `display: flex` to\n * `display: inline-flex`.\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n\n /**\n * Set this to `true` if this component should stretch to fill a flex or grid\n * container using `flex: 1 1 auto`.\n *\n * @defaultValue `false`\n */\n stretch?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed before the\n * `TextField` or `TextArea`.\n */\n leftAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link leftAddon}.\n *\n * @since 6.0.0\n */\n leftAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableLeftAddonStyles?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed after the\n * `TextField` or `TextArea`.\n */\n rightAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link rightAddon}.\n *\n * @since 6.0.0\n */\n rightAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableRightAddonStyles?: boolean;\n}\n\nexport interface FormFieldOptions\n extends TextFieldContainerOptions,\n FormMessageContainerExtension {\n /**\n * An optional floating label to use with the text field. A label is generally\n * recommended for accessibility, but can be omitted if an `aria-label` or\n * `aria-labelledby` is provided.\n */\n label?: ReactNode;\n\n /**\n * Any additional props and/or ref that should be passed to the `<label>`\n * element when a {@link label} is provided.\n *\n * @example\n * ```tsx\n * labelProps={{\n * ref: labelRef,\n * style: {},\n * className: \"some-custom-class-name\",\n * onClick: (event) => {\n * // do something\n * }\n * }}\n * ```\n */\n labelProps?: PropsWithRef<LabelProps, HTMLLabelElement>;\n\n /**\n * A convenience prop to apply a custom style to a label. This is equivalent\n * to:\n *\n * ```ts\n * labelProps={{\n * style: // some style here\n * }}\n * ```\n */\n labelStyle?: CSSProperties;\n\n /**\n * A convenience prop to apply a custom className to a label. This is\n * equivalent to:\n *\n * ```ts\n * labelProps={{\n * className: \"some-class-name\",\n * }}\n * ```\n */\n labelClassName?: string;\n}\n"],"names":[],"mappings":"AAihBA,WAmDC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/useCheckboxGroup.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\n\nconst EMPTY_LIST = [] as const;\n\n/** @since 6.0.0 */\nexport interface CheckboxGroupOptions<V> {\n /**\n * A `name` to apply to all the checkboxes within the group. This is required\n * if the {@link menu} option is set to `true`.\n */\n name?: string;\n\n /**\n * Set this to `true` if using the `MenuItemCheckbox` component instead of the\n * `Checkbox` so the correct props can be provided.\n *\n * @defaultValue `false`\n */\n menu?: boolean;\n\n /**\n * This prop **must** be defined to enable the indeterminate checkbox feature\n * from the hook. This should be a list of all the possible checkbox values in\n * the group. This will be used to select all values when the indeterminate\n * checkbox is checked and determine if all the checkboxes have manually be\n * selected.\n *\n * @example Indeterminate Behavior\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const {\n * getCheckboxProps,\n * getIndeterminateProps,\n * checkedValues,\n * } = useCheckboxGroup({ name: \"group\", values: VALUES });\n * ```\n */\n values?: readonly V[];\n\n /**\n * Set this to a list of checkbox values that should be checked by default.\n *\n * @defaultValue `[]`\n */\n defaultCheckedValues?: UseStateInitializer<readonly V[]>;\n}\n\n/** @since 6.0.0 */\nexport interface CheckboxGroupImplementation<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n name: string;\n value: V;\n checked: boolean;\n onChange(): void;\n };\n}\n\n/** @since 6.0.0 */\nexport interface IndeterminateCheckboxGroupImplementation<V extends string>\n extends CheckboxGroupImplementation<V> {\n getIndeterminateProps(): {\n \"aria-checked\": \"mixed\" | undefined;\n name: string;\n checked: boolean;\n indeterminate: boolean;\n onChange(): void;\n };\n}\n\n/** @since 6.0.0 */\nexport interface MenuItemCheckboxGroupImplementation<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n checked: boolean;\n onCheckedChange(): void;\n };\n}\n\n/** @since 6.0.0 */\nexport interface IndeterminateMenuItemCheckboxGroupImplementation<\n V extends string,\n> extends MenuItemCheckboxGroupImplementation<V> {\n getIndeterminateProps(): {\n \"aria-checked\": \"mixed\" | undefined;\n checked: boolean;\n indeterminate: boolean;\n onCheckedChange(): void;\n };\n}\n\n/** @since 6.0.0 */\nexport interface CombinedCheckboxGroupReturnValue<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n name?: string;\n value?: V;\n checked: boolean;\n onChange?(): void;\n onCheckedChange?(): void;\n };\n getIndeterminateProps?(): {\n \"aria-checked\": \"mixed\" | undefined;\n name?: string;\n checked: boolean;\n indeterminate: boolean;\n onChange?(): void;\n onCheckedChange?(): void;\n };\n}\n\n/**\n * @example Checkbox Group\n * ```tsx\n * const { getCheckboxProps, checkedValues } = useCheckboxGroup({ name: \"example\" });\n *\n * return (\n * <>\n * <Checkbox {...getCheckboxProps(\"a\")}>\n * First\n * </Checkbox>\n * <Checkbox {...getCheckboxProps(\"b\")}>\n * Second\n * </Checkbox>\n * <Checkbox {...getCheckboxProps(\"c\")}>\n * Third\n * </Checkbox>\n * </>\n * );\n * ```\n *\n * @since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu?: false;\n name: string;\n values?: never;\n }\n): CheckboxGroupImplementation<V>;\n/**\n * @example Indeterminate Checkbox Group\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const {\n * getCheckboxProps,\n * getIndeterminateProps,\n * checkedValues\n * } = useCheckboxGroup({\n * name: \"example\",\n * values: VALUES,\n * });\n *\n * return (\n * <>\n * <Checkbox {...getIndeterminateProps()} label=\"Select all\" />\n * {VALUES.map(({ label, value }) => (\n * <Checkbox key={value} label={label} {...getCheckboxProps(value)} />\n * ))}\n * </>\n * );\n * ```\n *\n * @since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu?: false;\n name: string;\n values: readonly V[];\n }\n): IndeterminateCheckboxGroupImplementation<V>;\n/**\n * @example MenuItemCheckbox Group\n * ```tsx\n * const { getCheckboxProps, checkedValues } = useCheckboxGroup({ menu: true });\n *\n * return (\n * <>\n * <MenuItemCheckbox {...getCheckboxProps(\"a\")}>\n * First\n * </MenuItemCheckbox>\n * <MenuItemCheckbox {...getCheckboxProps(\"b\")}>\n * Second\n * </MenuItemCheckbox>\n * <MenuItemCheckbox {...getCheckboxProps(\"c\")}>\n * Third\n * </MenuItemCheckbox>\n * </>\n * );\n * ```\n *\n * @since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu: true;\n name?: never;\n values?: never;\n }\n): MenuItemCheckboxGroupImplementation<V>;\n/**\n * @example Indeterminate MenuItemCheckbox Group\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const { getCheckboxProps, getIndeterminateProps, checkedValues } = useCheckboxGroup({\n * menu: true,\n * values: VALUES,\n * });\n *\n * return (\n * <>\n * <MenuItemCheckbox {...getIndeterminateProps()}>\n * All\n * <MenuItemCheckbox>\n * {OPTIONS.map(({ label, value }) => (\n * <MenuItemCheckbox key={value} {...getCheckboxProps(value)}>\n * {label}\n * </MenuItemCheckbox>\n * ))}\n * </>\n * );\n * ```\n *\n * @since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu: true;\n name?: never;\n values: readonly V[];\n }\n): IndeterminateMenuItemCheckboxGroupImplementation<V>;\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V>\n): CombinedCheckboxGroupReturnValue<V> {\n const {\n name,\n menu = false,\n values,\n defaultCheckedValues = EMPTY_LIST,\n } = options;\n const [checkedValues, setCheckedValues] = useState<ReadonlySet<V>>(() => {\n if (typeof defaultCheckedValues === \"function\") {\n return new Set(defaultCheckedValues());\n }\n\n return new Set(defaultCheckedValues);\n });\n const initial = useRef(checkedValues);\n\n let getIndeterminateProps: CombinedCheckboxGroupReturnValue<V>[\"getIndeterminateProps\"];\n if (values) {\n getIndeterminateProps = () => {\n const checked = checkedValues.size > 0;\n const indeterminate = checked && checkedValues.size < values.length;\n\n return {\n \"aria-checked\": indeterminate ? \"mixed\" : undefined,\n name,\n checked,\n indeterminate,\n [menu ? \"onCheckedChange\" : \"onChange\"]() {\n setCheckedValues(() => {\n if (checkedValues.size === 0 || indeterminate) {\n return new Set(values);\n }\n\n return new Set();\n });\n },\n };\n };\n }\n\n return {\n reset: useCallback(() => {\n setCheckedValues(initial.current);\n }, []),\n checkedValues,\n setCheckedValues,\n getIndeterminateProps,\n getCheckboxProps(value) {\n return {\n name,\n value: menu ? undefined : value,\n checked: checkedValues.has(value),\n [menu ? \"onCheckedChange\" : \"onChange\"]() {\n setCheckedValues((prevValues) => {\n const nextValues = new Set(prevValues);\n if (prevValues.has(value)) {\n nextValues.delete(value);\n } else {\n nextValues.add(value);\n }\n\n return nextValues;\n });\n },\n };\n },\n };\n}\n"],"names":["useCallback","useRef","useState","EMPTY_LIST","useCheckboxGroup","options","name","menu","values","defaultCheckedValues","checkedValues","setCheckedValues","Set","initial","getIndeterminateProps","checked","size","indeterminate","length","undefined","reset","current","getCheckboxProps","value","has","prevValues","nextValues","delete","add"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAGtD,MAAMC,aAAa,EAAE;AA+PrB,OAAO,SAASC,iBACdC,OAAgC;IAEhC,MAAM,EACJC,IAAI,EACJC,OAAO,KAAK,EACZC,MAAM,EACNC,uBAAuBN,UAAU,EAClC,GAAGE;IACJ,MAAM,CAACK,eAAeC,iBAAiB,GAAGT,SAAyB;QACjE,IAAI,OAAOO,yBAAyB,YAAY;YAC9C,OAAO,IAAIG,IAAIH;QACjB;QAEA,OAAO,IAAIG,IAAIH;IACjB;IACA,MAAMI,UAAUZ,OAAOS;IAEvB,IAAII;IACJ,IAAIN,QAAQ;QACVM,wBAAwB;YACtB,MAAMC,UAAUL,cAAcM,IAAI,GAAG;YACrC,MAAMC,gBAAgBF,WAAWL,cAAcM,IAAI,GAAGR,OAAOU,MAAM;YAEnE,OAAO;gBACL,gBAAgBD,gBAAgB,UAAUE;gBAC1Cb;gBACAS;gBACAE;gBACA,CAACV,OAAO,oBAAoB,WAAW;oBACrCI,iBAAiB;wBACf,IAAID,cAAcM,IAAI,KAAK,KAAKC,eAAe;4BAC7C,OAAO,IAAIL,IAAIJ;wBACjB;wBAEA,OAAO,IAAII;oBACb;gBACF;YACF;QACF;IACF;IAEA,OAAO;QACLQ,OAAOpB,YAAY;YACjBW,iBAAiBE,QAAQQ,OAAO;QAClC,GAAG,EAAE;QACLX;QACAC;QACAG;QACAQ,kBAAiBC,KAAK;YACpB,OAAO;gBACLjB;gBACAiB,OAAOhB,OAAOY,YAAYI;gBAC1BR,SAASL,cAAcc,GAAG,CAACD;gBAC3B,CAAChB,OAAO,oBAAoB,WAAW;oBACrCI,iBAAiB,CAACc;wBAChB,MAAMC,aAAa,IAAId,IAAIa;wBAC3B,IAAIA,WAAWD,GAAG,CAACD,QAAQ;4BACzBG,WAAWC,MAAM,CAACJ;wBACpB,OAAO;4BACLG,WAAWE,GAAG,CAACL;wBACjB;wBAEA,OAAOG;oBACT;gBACF;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/form/useCheckboxGroup.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\n\nconst EMPTY_LIST = [] as const;\n\n/** @since 6.0.0 */\nexport interface CheckboxGroupOptions<V> {\n /**\n * A `name` to apply to all the checkboxes within the group. This is required\n * if the {@link menu} option is set to `true`.\n */\n name?: string;\n\n /**\n * Set this to `true` if using the `MenuItemCheckbox` component instead of the\n * `Checkbox` so the correct props can be provided.\n *\n * @defaultValue `false`\n */\n menu?: boolean;\n\n /**\n * This prop **must** be defined to enable the indeterminate checkbox feature\n * from the hook. This should be a list of all the possible checkbox values in\n * the group. This will be used to select all values when the indeterminate\n * checkbox is checked and determine if all the checkboxes have manually be\n * selected.\n *\n * @example Indeterminate Behavior\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const {\n * getCheckboxProps,\n * getIndeterminateProps,\n * checkedValues,\n * } = useCheckboxGroup({ name: \"group\", values: VALUES });\n * ```\n */\n values?: readonly V[];\n\n /**\n * Set this to a list of checkbox values that should be checked by default.\n *\n * @defaultValue `[]`\n */\n defaultCheckedValues?: UseStateInitializer<readonly V[]>;\n}\n\n/** @since 6.0.0 */\nexport interface CheckboxGroupImplementation<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n name: string;\n value: V;\n checked: boolean;\n onChange(): void;\n };\n}\n\n/** @since 6.0.0 */\nexport interface IndeterminateCheckboxGroupImplementation<V extends string>\n extends CheckboxGroupImplementation<V> {\n getIndeterminateProps(): {\n \"aria-checked\": \"mixed\" | undefined;\n name: string;\n checked: boolean;\n indeterminate: boolean;\n onChange(): void;\n };\n}\n\n/** @since 6.0.0 */\nexport interface MenuItemCheckboxGroupImplementation<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n checked: boolean;\n onCheckedChange(): void;\n };\n}\n\n/** @since 6.0.0 */\nexport interface IndeterminateMenuItemCheckboxGroupImplementation<\n V extends string,\n> extends MenuItemCheckboxGroupImplementation<V> {\n getIndeterminateProps(): {\n \"aria-checked\": \"mixed\" | undefined;\n checked: boolean;\n indeterminate: boolean;\n onCheckedChange(): void;\n };\n}\n\n/** @since 6.0.0 */\nexport interface CombinedCheckboxGroupReturnValue<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n name?: string;\n value?: V;\n checked: boolean;\n onChange?(): void;\n onCheckedChange?(): void;\n };\n getIndeterminateProps?(): {\n \"aria-checked\": \"mixed\" | undefined;\n name?: string;\n checked: boolean;\n indeterminate: boolean;\n onChange?(): void;\n onCheckedChange?(): void;\n };\n}\n\n/**\n * @example Checkbox Group\n * ```tsx\n * const { getCheckboxProps, checkedValues } = useCheckboxGroup({ name: \"example\" });\n *\n * return (\n * <>\n * <Checkbox {...getCheckboxProps(\"a\")}>\n * First\n * </Checkbox>\n * <Checkbox {...getCheckboxProps(\"b\")}>\n * Second\n * </Checkbox>\n * <Checkbox {...getCheckboxProps(\"c\")}>\n * Third\n * </Checkbox>\n * </>\n * );\n * ```\n *\n * @since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu?: false;\n name: string;\n values?: never;\n }\n): CheckboxGroupImplementation<V>;\n/**\n * @example Indeterminate Checkbox Group\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const {\n * getCheckboxProps,\n * getIndeterminateProps,\n * checkedValues\n * } = useCheckboxGroup({\n * name: \"example\",\n * values: VALUES,\n * });\n *\n * return (\n * <>\n * <Checkbox {...getIndeterminateProps()} label=\"Select all\" />\n * {VALUES.map(({ label, value }) => (\n * <Checkbox key={value} label={label} {...getCheckboxProps(value)} />\n * ))}\n * </>\n * );\n * ```\n *\n * @since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu?: false;\n name: string;\n values: readonly V[];\n }\n): IndeterminateCheckboxGroupImplementation<V>;\n/**\n * @example MenuItemCheckbox Group\n * ```tsx\n * const { getCheckboxProps, checkedValues } = useCheckboxGroup({ menu: true });\n *\n * return (\n * <>\n * <MenuItemCheckbox {...getCheckboxProps(\"a\")}>\n * First\n * </MenuItemCheckbox>\n * <MenuItemCheckbox {...getCheckboxProps(\"b\")}>\n * Second\n * </MenuItemCheckbox>\n * <MenuItemCheckbox {...getCheckboxProps(\"c\")}>\n * Third\n * </MenuItemCheckbox>\n * </>\n * );\n * ```\n *\n * @since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu: true;\n name?: never;\n values?: never;\n }\n): MenuItemCheckboxGroupImplementation<V>;\n/**\n * @example Indeterminate MenuItemCheckbox Group\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const { getCheckboxProps, getIndeterminateProps, checkedValues } = useCheckboxGroup({\n * menu: true,\n * values: VALUES,\n * });\n *\n * return (\n * <>\n * <MenuItemCheckbox {...getIndeterminateProps()}>\n * All\n * <MenuItemCheckbox>\n * {OPTIONS.map(({ label, value }) => (\n * <MenuItemCheckbox key={value} {...getCheckboxProps(value)}>\n * {label}\n * </MenuItemCheckbox>\n * ))}\n * </>\n * );\n * ```\n *\n * @since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu: true;\n name?: never;\n values: readonly V[];\n }\n): IndeterminateMenuItemCheckboxGroupImplementation<V>;\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V>\n): CombinedCheckboxGroupReturnValue<V> {\n const {\n name,\n menu = false,\n values,\n defaultCheckedValues = EMPTY_LIST,\n } = options;\n const [checkedValues, setCheckedValues] = useState<ReadonlySet<V>>(() => {\n if (typeof defaultCheckedValues === \"function\") {\n return new Set(defaultCheckedValues());\n }\n\n return new Set(defaultCheckedValues);\n });\n const initial = useRef(checkedValues);\n\n let getIndeterminateProps: CombinedCheckboxGroupReturnValue<V>[\"getIndeterminateProps\"];\n if (values) {\n getIndeterminateProps = () => {\n const checked = checkedValues.size > 0;\n const indeterminate = checked && checkedValues.size < values.length;\n\n return {\n \"aria-checked\": indeterminate ? \"mixed\" : undefined,\n name,\n checked,\n indeterminate,\n [menu ? \"onCheckedChange\" : \"onChange\"]() {\n setCheckedValues(() => {\n if (checkedValues.size === 0 || indeterminate) {\n return new Set(values);\n }\n\n return new Set();\n });\n },\n };\n };\n }\n\n return {\n reset: useCallback(() => {\n setCheckedValues(initial.current);\n }, []),\n checkedValues,\n setCheckedValues,\n getIndeterminateProps,\n getCheckboxProps(value) {\n return {\n name,\n value: menu ? undefined : value,\n checked: checkedValues.has(value),\n [menu ? \"onCheckedChange\" : \"onChange\"]() {\n setCheckedValues((prevValues) => {\n const nextValues = new Set(prevValues);\n if (prevValues.has(value)) {\n nextValues.delete(value);\n } else {\n nextValues.add(value);\n }\n\n return nextValues;\n });\n },\n };\n },\n };\n}\n"],"names":["useCallback","useRef","useState","EMPTY_LIST","useCheckboxGroup","options","name","menu","values","defaultCheckedValues","checkedValues","setCheckedValues","Set","initial","getIndeterminateProps","checked","size","indeterminate","length","undefined","reset","current","getCheckboxProps","value","has","prevValues","nextValues","delete","add"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAGtD,MAAMC,aAAa,EAAE;AA+PrB,OAAO,SAASC,iBACdC,OAAgC;IAEhC,MAAM,EACJC,IAAI,EACJC,OAAO,KAAK,EACZC,MAAM,EACNC,uBAAuBN,UAAU,EAClC,GAAGE;IACJ,MAAM,CAACK,eAAeC,iBAAiB,GAAGT,SAAyB;QACjE,IAAI,OAAOO,yBAAyB,YAAY;YAC9C,OAAO,IAAIG,IAAIH;QACjB;QAEA,OAAO,IAAIG,IAAIH;IACjB;IACA,MAAMI,UAAUZ,OAAOS;IAEvB,IAAII;IACJ,IAAIN,QAAQ;QACVM,wBAAwB;YACtB,MAAMC,UAAUL,cAAcM,IAAI,GAAG;YACrC,MAAMC,gBAAgBF,WAAWL,cAAcM,IAAI,GAAGR,OAAOU,MAAM;YAEnE,OAAO;gBACL,gBAAgBD,gBAAgB,UAAUE;gBAC1Cb;gBACAS;gBACAE;gBACA,CAACV,OAAO,oBAAoB,WAAW;oBACrCI,iBAAiB;wBACf,IAAID,cAAcM,IAAI,KAAK,KAAKC,eAAe;4BAC7C,OAAO,IAAIL,IAAIJ;wBACjB;wBAEA,OAAO,IAAII;oBACb;gBACF;YACF;QACF;IACF;IAEA,OAAO;QACLQ,OAAOpB,YAAY;YACjBW,iBAAiBE,QAAQQ,OAAO;QAClC,GAAG,EAAE;QACLX;QACAC;QACAG;QACAQ,kBAAiBC,KAAK;YACpB,OAAO;gBACLjB;gBACAiB,OAAOhB,OAAOY,YAAYI;gBAC1BR,SAASL,cAAcc,GAAG,CAACD;gBAC3B,CAAChB,OAAO,oBAAoB,WAAW;oBACrCI,iBAAiB,CAACc;wBAChB,MAAMC,aAAa,IAAId,IAAIa;wBAC3B,IAAIA,WAAWD,GAAG,CAACD,QAAQ;4BACzBG,WAAWC,MAAM,CAACJ;wBACpB,OAAO;4BACLG,WAAWE,GAAG,CAACL;wBACjB;wBAEA,OAAOG;oBACT;gBACF;YACF;QACF;IACF;AACF"}
@@ -110,31 +110,31 @@ export interface ComboboxTransitionOptions extends ComboboxTransitionCallbacks {
110
110
  /**
111
111
  * @since 6.0.0
112
112
  */
113
- export type ConfigurableComboboxMenuProps = Partial<Omit<MenuProps, "fixedTo" | "visible" | "onRequestClose" | keyof ComboboxWidgetPopupProps>>;
113
+ export type ConfigurableComboboxMenuProps = Partial<Omit<MenuProps, "visible" | "onRequestClose" | keyof ComboboxWidgetPopupProps>>;
114
114
  /**
115
115
  * @since 6.0.0
116
116
  */
117
- export interface ProvidedComboboxMenuProps<ComboboxEl extends HTMLElement = HTMLInputElement, PopupEl extends HTMLElement = HTMLDivElement> extends Required<ComboboxTransitionCallbacks>, ComboboxWidgetPopupProps<PopupEl> {
117
+ export interface ProvidedComboboxMenuProps<PopupEl extends HTMLElement = HTMLDivElement> extends Required<ComboboxTransitionCallbacks>, ComboboxWidgetPopupProps<PopupEl> {
118
118
  visible: boolean;
119
119
  onRequestClose(): void;
120
120
  /** @defaultValue `"min"` */
121
121
  width: PositionWidth;
122
122
  /** @defaultValue `BELOW_CENTER_ANCHOR` */
123
123
  anchor: PositionAnchor;
124
- fixedTo: RefObject<ComboboxEl>;
124
+ fixedTo: RefObject<HTMLElement>;
125
125
  sheetProps: MenuSheetConfigurableProps & Required<ComboboxTransitionCallbacks>;
126
126
  }
127
127
  /**
128
128
  * @since 6.0.0
129
129
  */
130
- export interface ComboboxMenuProps<ComboboxEl extends HTMLElement = HTMLInputElement, PopupEl extends HTMLElement = HTMLDivElement> extends Omit<ConfigurableComboboxMenuProps, keyof ProvidedComboboxMenuProps>, ProvidedComboboxMenuProps<ComboboxEl, PopupEl> {
130
+ export interface ComboboxMenuProps<PopupEl extends HTMLElement = HTMLDivElement> extends Omit<ConfigurableComboboxMenuProps, keyof ProvidedComboboxMenuProps>, ProvidedComboboxMenuProps<PopupEl> {
131
131
  }
132
132
  /**
133
133
  * Since the combobox usually uses the `Menu` as a popup element, this is a
134
134
  * helper util to create the required props and merge any additional props
135
135
  * with reasonable defaults.
136
136
  */
137
- export type ComboboxGetMenuProps<ComboboxEl extends HTMLElement = HTMLInputElement, PopupEl extends HTMLElement = HTMLDivElement> = (props?: ConfigurableComboboxMenuProps) => ComboboxMenuProps<ComboboxEl, PopupEl>;
137
+ export type ComboboxGetMenuProps<PopupEl extends HTMLElement = HTMLDivElement> = (props?: ConfigurableComboboxMenuProps) => ComboboxMenuProps<PopupEl>;
138
138
  /**
139
139
  * @since 6.0.0
140
140
  */
@@ -148,7 +148,7 @@ export interface ComboboxImplementation<ComboboxEl extends HTMLElement = HTMLInp
148
148
  popupProps: ComboboxWidgetPopupProps<PopupEl>;
149
149
  comboboxRef: RefObject<ComboboxEl>;
150
150
  comboboxProps: ComboboxWidgetProps<ComboboxEl>;
151
- getMenuProps: ComboboxGetMenuProps<ComboboxEl, PopupEl>;
151
+ getMenuProps: ComboboxGetMenuProps<PopupEl>;
152
152
  getTransitionCallbacks(options: ComboboxTransitionOptions): Required<ComboboxTransitionCallbacks>;
153
153
  }
154
154
  /**
@@ -185,9 +185,9 @@ const noop = ()=>{
185
185
  return {
186
186
  anchor: BELOW_CENTER_ANCHOR,
187
187
  width: "min",
188
+ fixedTo: comboboxRef,
188
189
  ...props,
189
190
  ...popupProps,
190
- fixedTo: comboboxRef,
191
191
  visible,
192
192
  onRequestClose: hide,
193
193
  ...getTransitionCallbacks(props),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/useCombobox.ts"],"sourcesContent":["\"use client\";\nimport {\n useRef,\n type FocusEventHandler,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type InputHTMLAttributes,\n type KeyboardEventHandler,\n type MouseEventHandler,\n type Ref,\n type RefCallback,\n type RefObject,\n} from \"react\";\nimport { type MenuProps } from \"../menu/Menu.js\";\nimport { type MenuSheetConfigurableProps } from \"../menu/MenuSheet.js\";\nimport {\n type GetDefaultFocusedIndex,\n type GetFocusableElements,\n type KeyboardMovementExtensionData,\n type KeyboardMovementProviderImplementation,\n type KeyboardMovementProviderOptions,\n} from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { BELOW_CENTER_ANCHOR } from \"../positioning/constants.js\";\nimport {\n type PositionAnchor,\n type PositionWidth,\n} from \"../positioning/types.js\";\nimport { TRANSITION_CONFIG } from \"../transition/config.js\";\nimport {\n type TransitionCallbacks,\n type TransitionEnterHandler,\n type TransitionExitHandler,\n} from \"../transition/types.js\";\nimport {\n type NonNullMutableRef,\n type UseStateInitializer,\n type UseStateSetter,\n} from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useToggle } from \"../useToggle.js\";\nimport { tryToSubmitRelatedForm } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport const getNonDisabledOptions = (\n container: HTMLElement\n): readonly HTMLElement[] => [\n ...container.querySelectorAll<HTMLLIElement>(\n '[role=\"option\"]:not([aria-disabled])'\n ),\n];\n\n/**\n * @since 6.0.0\n */\nexport type SupportedComboboxPopup = \"listbox\" | \"grid\" | \"dialog\";\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxKeyboardMovementData<\n E extends HTMLElement = HTMLInputElement,\n> extends KeyboardMovementExtensionData<E> {\n show(): void;\n hide(): void;\n visible: boolean;\n focusLast: NonNullMutableRef<boolean>;\n}\n\n/**\n * @since 6.0.0\n */\nexport type ExtendComboboxKeyDown<E extends HTMLElement = HTMLInputElement> = (\n movementData: ComboboxKeyboardMovementData<E>\n) => void;\n\n/**\n * @since 6.0.0\n */\nexport type ComboboxKeyboardMovementOptions<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n> = Pick<\n KeyboardMovementProviderOptions<ComboboxEl>,\n | \"onClick\"\n | \"onFocus\"\n | \"onKeyDown\"\n | \"disabled\"\n | \"loopable\"\n | \"searchable\"\n | \"onFocusChange\"\n | \"isNegativeOneAllowed\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface BaseComboboxOptions<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends ComboboxKeyboardMovementOptions<ComboboxEl> {\n /**\n * This is the {@link InputHTMLAttributes.form} attribute and is used to\n * attempt submitting a form when the enter key is pressed.\n */\n form?: string;\n\n /**\n * @defaultValue `\"combobox-popup-\" + useId()`\n */\n popupId?: string;\n popupRef?: Ref<PopupEl>;\n\n /**\n * @defaultValue `\"combobox-\" + useId()`\n */\n comboboxId?: string;\n comboboxRef?: Ref<ComboboxEl>;\n\n /**\n * @defaultValue `\"listbox\"`\n */\n popup?: \"listbox\" | \"grid\" | \"dialog\";\n\n /**\n * @defaultValue `false`\n */\n defaultVisible?: UseStateInitializer<boolean>;\n\n extendKeyDown?: ExtendComboboxKeyDown<ComboboxEl>;\n\n /**\n * @defaultValue {@link getNonDisabledOptions}\n */\n getFocusableElements?: GetFocusableElements;\n\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxOptions<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends BaseComboboxOptions<ComboboxEl, PopupEl> {\n getEnterDefaultFocusedIndex(options: {\n focusLast: boolean;\n focusables: readonly HTMLElement[];\n currentFocusIndex: number;\n }): number;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxWidgetProps<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n> {\n \"aria-controls\": string;\n \"aria-disabled\": true | undefined;\n \"aria-expanded\": boolean;\n \"aria-haspopup\": SupportedComboboxPopup;\n id: string;\n ref: RefCallback<ComboboxEl>;\n role: \"combobox\";\n onClick: MouseEventHandler<ComboboxEl>;\n onFocus: FocusEventHandler<ComboboxEl>;\n onKeyDown: KeyboardEventHandler<ComboboxEl>;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxWidgetPopupProps<\n PopupEl extends HTMLElement = HTMLElement,\n> {\n id: string;\n ref: RefCallback<PopupEl>;\n role: \"listbox\" | \"dialog\" | \"grid\";\n}\n\n/**\n * @since 6.0.0\n */\nexport type ComboboxTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEntering\" | \"onEntered\" | \"onExiting\" | \"onExited\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxTransitionOptions extends ComboboxTransitionCallbacks {\n disableTransition?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport type ConfigurableComboboxMenuProps = Partial<\n Omit<\n MenuProps,\n \"fixedTo\" | \"visible\" | \"onRequestClose\" | keyof ComboboxWidgetPopupProps\n >\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface ProvidedComboboxMenuProps<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLDivElement,\n> extends Required<ComboboxTransitionCallbacks>,\n ComboboxWidgetPopupProps<PopupEl> {\n visible: boolean;\n onRequestClose(): void;\n\n /** @defaultValue `\"min\"` */\n width: PositionWidth;\n\n /** @defaultValue `BELOW_CENTER_ANCHOR` */\n anchor: PositionAnchor;\n\n fixedTo: RefObject<ComboboxEl>;\n\n sheetProps: MenuSheetConfigurableProps &\n Required<ComboboxTransitionCallbacks>;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxMenuProps<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLDivElement,\n> extends Omit<ConfigurableComboboxMenuProps, keyof ProvidedComboboxMenuProps>,\n ProvidedComboboxMenuProps<ComboboxEl, PopupEl> {}\n\n/**\n * Since the combobox usually uses the `Menu` as a popup element, this is a\n * helper util to create the required props and merge any additional props\n * with reasonable defaults.\n */\nexport type ComboboxGetMenuProps<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLDivElement,\n> = (\n props?: ConfigurableComboboxMenuProps\n) => ComboboxMenuProps<ComboboxEl, PopupEl>;\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxImplementation<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends KeyboardMovementProviderImplementation<ComboboxEl> {\n show(): void;\n hide(): void;\n visible: boolean;\n setVisible: UseStateSetter<boolean>;\n focusLast: NonNullMutableRef<boolean>;\n popupRef: RefObject<PopupEl>;\n popupProps: ComboboxWidgetPopupProps<PopupEl>;\n comboboxRef: RefObject<ComboboxEl>;\n comboboxProps: ComboboxWidgetProps<ComboboxEl>;\n\n getMenuProps: ComboboxGetMenuProps<ComboboxEl, PopupEl>;\n getTransitionCallbacks(\n options: ComboboxTransitionOptions\n ): Required<ComboboxTransitionCallbacks>;\n}\n\n/**\n * @since 6.0.0\n */\nexport function useCombobox<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n>(\n options: ComboboxOptions<ComboboxEl, PopupEl>\n): ComboboxImplementation<ComboboxEl, PopupEl> {\n const {\n form,\n popup = \"listbox\",\n onClick = noop,\n onFocus,\n onKeyDown,\n searchable,\n isNegativeOneAllowed,\n loopable,\n disabled,\n comboboxId: propComboboxId,\n comboboxRef: propComboboxRef,\n popupId: propPopupId,\n popupRef: propPopupRef,\n defaultVisible = false,\n onFocusChange = noop,\n extendKeyDown = noop,\n getFocusableElements = getNonDisabledOptions,\n getEnterDefaultFocusedIndex,\n getDefaultFocusedIndex,\n } = options;\n\n const {\n toggled: visible,\n enable: show,\n disable: hide,\n setToggled: setVisible,\n } = useToggle(defaultVisible);\n const popupId = useEnsuredId(propPopupId, \"combobox-popup\");\n const comboboxId = useEnsuredId(propComboboxId, \"combobox\");\n const [comboboxRef, comboboxRefCallback] = useEnsuredRef(propComboboxRef);\n const [popupRef, popupRefCallback] = useEnsuredRef(propPopupRef);\n const focusLast = useRef(false);\n const {\n movementProps,\n movementContext,\n currentFocusIndex,\n activeDescendantId,\n setActiveDescendantId,\n } = useKeyboardMovementProvider<ComboboxEl>({\n onFocus,\n onKeyDown,\n onClick(event) {\n onClick(event);\n if (disabled) {\n return;\n }\n\n show();\n },\n extendKeyDown(movementData) {\n extendKeyDown({\n ...movementData,\n show,\n hide,\n visible,\n focusLast,\n });\n const { event } = movementData;\n if (event.isPropagationStopped()) {\n return;\n }\n\n if (visible) {\n switch (event.key) {\n case \"Tab\":\n case \"Escape\":\n event.stopPropagation();\n hide();\n break;\n case \"Enter\":\n event.preventDefault();\n break;\n }\n\n // while visible, always use the default keyboard movement behavior\n return;\n }\n\n switch (event.key) {\n case \"ArrowUp\":\n case \"ArrowDown\":\n event.preventDefault();\n event.stopPropagation();\n focusLast.current = event.key === \"ArrowUp\";\n show();\n break;\n case \"Enter\":\n tryToSubmitRelatedForm(event, form);\n break;\n }\n },\n disabled,\n loopable,\n searchable,\n onFocusChange,\n programmatic: true,\n includeDisabled: false,\n tabIndexBehavior: \"virtual\",\n getFocusableElements(container, programmatic) {\n const popup = popupRef.current;\n if (!popup) {\n return [];\n }\n\n return getFocusableElements(popup || container, programmatic);\n },\n isNegativeOneAllowed,\n getDefaultFocusedIndex,\n });\n const getTransitionCallbacks = (\n options: ComboboxTransitionOptions = {}\n ): Required<ComboboxTransitionCallbacks> => {\n const { onEntered, onEntering, onExiting, onExited, disableTransition } =\n options;\n\n const handleEntering =\n (callback: TransitionEnterHandler = noop, skipped: boolean) =>\n (appearing: boolean) => {\n callback(appearing);\n\n const popup = popupRef.current;\n if (!popup || skipped) {\n // Chrome does not trigger the scrollIntoView behavior correctly while\n // using a scale transition, so need to trigger this on the entered\n // flow to really make sure the item is in view.\n // An alternative would be to implement a custom scrollIntoView\n // behavior again like the previous versions of react-md, but this is\n // less lines of code\n const activeOption = document.getElementById(activeDescendantId);\n if (activeOption) {\n activeOption.scrollIntoView({ block: \"nearest\" });\n }\n return;\n }\n\n const focusables = getFocusableElements(popup, true);\n const index = getEnterDefaultFocusedIndex({\n focusLast: focusLast.current,\n focusables,\n currentFocusIndex: currentFocusIndex.current,\n });\n focusLast.current = false;\n currentFocusIndex.current = index;\n\n const option = focusables[index];\n if (!option) {\n return;\n }\n\n onFocusChange({\n index,\n element: option,\n });\n\n option.scrollIntoView({ block: \"nearest\" });\n setActiveDescendantId(option.id || \"\");\n };\n const handleExiting =\n (callback: TransitionExitHandler = noop, skipped: boolean) =>\n (): void => {\n callback();\n\n if (!skipped) {\n // since the menu is unmounted or set to hidden while not visible, need\n // to clear the aria-activedescendant and current focus index when\n // hiding\n currentFocusIndex.current = -1;\n setActiveDescendantId(\"\");\n }\n };\n\n const isTransitionCompleteSkipped =\n !disableTransition && !TRANSITION_CONFIG.disabled;\n\n return {\n onEntering: handleEntering(onEntering, false),\n onEntered: handleEntering(onEntered, isTransitionCompleteSkipped),\n onExiting: handleExiting(onExiting, false),\n onExited: handleExiting(onExited, isTransitionCompleteSkipped),\n };\n };\n\n const popupProps: ComboboxWidgetPopupProps<PopupEl> = {\n id: popupId,\n ref: popupRefCallback,\n role: popup,\n };\n\n return {\n show,\n hide,\n visible,\n setVisible,\n focusLast,\n popupRef,\n popupProps,\n comboboxRef,\n comboboxProps: {\n ...movementProps,\n \"aria-controls\": popupId,\n \"aria-disabled\": disabled || undefined,\n \"aria-expanded\": visible,\n \"aria-haspopup\": popup,\n id: comboboxId,\n ref: comboboxRefCallback,\n role: \"combobox\",\n },\n movementProps,\n movementContext,\n currentFocusIndex,\n activeDescendantId,\n setActiveDescendantId,\n getTransitionCallbacks,\n getMenuProps(props = {}) {\n const { sheetProps, disableTransition } = props;\n return {\n anchor: BELOW_CENTER_ANCHOR,\n width: \"min\",\n ...props,\n ...popupProps,\n fixedTo: comboboxRef,\n visible,\n onRequestClose: hide,\n ...getTransitionCallbacks(props),\n sheetProps: {\n ...sheetProps,\n ...getTransitionCallbacks({\n ...sheetProps,\n disableTransition:\n sheetProps?.disableTransition ?? disableTransition,\n }),\n },\n };\n },\n };\n}\n"],"names":["useRef","useKeyboardMovementProvider","BELOW_CENTER_ANCHOR","TRANSITION_CONFIG","useEnsuredId","useEnsuredRef","useToggle","tryToSubmitRelatedForm","noop","getNonDisabledOptions","container","querySelectorAll","useCombobox","options","form","popup","onClick","onFocus","onKeyDown","searchable","isNegativeOneAllowed","loopable","disabled","comboboxId","propComboboxId","comboboxRef","propComboboxRef","popupId","propPopupId","popupRef","propPopupRef","defaultVisible","onFocusChange","extendKeyDown","getFocusableElements","getEnterDefaultFocusedIndex","getDefaultFocusedIndex","toggled","visible","enable","show","disable","hide","setToggled","setVisible","comboboxRefCallback","popupRefCallback","focusLast","movementProps","movementContext","currentFocusIndex","activeDescendantId","setActiveDescendantId","event","movementData","isPropagationStopped","key","stopPropagation","preventDefault","current","programmatic","includeDisabled","tabIndexBehavior","getTransitionCallbacks","onEntered","onEntering","onExiting","onExited","disableTransition","handleEntering","callback","skipped","appearing","activeOption","document","getElementById","scrollIntoView","block","focusables","index","option","element","id","handleExiting","isTransitionCompleteSkipped","popupProps","ref","role","comboboxProps","undefined","getMenuProps","props","sheetProps","anchor","width","fixedTo","onRequestClose"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SACEA,MAAM,QASD,QAAQ;AAUf,SAASC,2BAA2B,QAAQ,6CAA6C;AACzF,SAASC,mBAAmB,QAAQ,8BAA8B;AAKlE,SAASC,iBAAiB,QAAQ,0BAA0B;AAW5D,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,sBAAsB,QAAQ,aAAa;AAEpD,MAAMC,OAAO;AACX,aAAa;AACf;AAEA;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CACnCC,YAC2B;WACxBA,UAAUC,gBAAgB,CAC3B;KAEH,CAAC;AA+NF;;CAEC,GACD,OAAO,SAASC,YAIdC,OAA6C;IAE7C,MAAM,EACJC,IAAI,EACJC,QAAQ,SAAS,EACjBC,UAAUR,IAAI,EACdS,OAAO,EACPC,SAAS,EACTC,UAAU,EACVC,oBAAoB,EACpBC,QAAQ,EACRC,QAAQ,EACRC,YAAYC,cAAc,EAC1BC,aAAaC,eAAe,EAC5BC,SAASC,WAAW,EACpBC,UAAUC,YAAY,EACtBC,iBAAiB,KAAK,EACtBC,gBAAgBxB,IAAI,EACpByB,gBAAgBzB,IAAI,EACpB0B,uBAAuBzB,qBAAqB,EAC5C0B,2BAA2B,EAC3BC,sBAAsB,EACvB,GAAGvB;IAEJ,MAAM,EACJwB,SAASC,OAAO,EAChBC,QAAQC,IAAI,EACZC,SAASC,IAAI,EACb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AAqB,CAACjE,kBAAkBmB,QAAQ;QAEnD,OAAO;YACL2C,YAAYI,eAAeJ,YAAY;YACvCD,WAAWK,eAAeL,WAAWoB;YACrClB,WAAWiB,cAAcjB,WAAW;YACpCC,UAAUgB,cAAchB,UAAUiB;QACpC;IACF;IAEA,MAAMC,aAAgD;QACpDH,IAAIvD;QACJ2D,KAAKxC;QACLyC,MAAMxE;IACR;IAEA,OAAO;QACLyB;QACAE;QACAJ;QACAM;QACAG;QACAlB;QACAwD;QACA5D;QACA+D,eAAe;YACb,GAAGxC,aAAa;YAChB,iBAAiBrB;YACjB,iBAAiBL,YAAYmE;YAC7B,iBAAiBnD;YACjB,iBAAiBvB;YACjBmE,IAAI3D;YACJ+D,KAAKzC;YACL0C,MAAM;QACR;QACAvC;QACAC;QACAC;QACAC;QACAC;QACAW;QACA2B,cAAaC,QAAQ,CAAC,CAAC;YACrB,MAAM,EAAEC,UAAU,EAAExB,iBAAiB,EAAE,GAAGuB;YAC1C,OAAO;gBACLE,QAAQ3F;gBACR4F,OAAO;gBACP,GAAGH,KAAK;gBACR,GAAGN,UAAU;gBACbU,SAAStE;gBACTa;gBACA0D,gBAAgBtD;gBAChB,GAAGqB,uBAAuB4B,MAAM;gBAChCC,YAAY;oBACV,GAAGA,UAAU;oBACb,GAAG7B,uBAAuB;wBACxB,GAAG6B,UAAU;wBACbxB,mBACEwB,YAAYxB,qBAAqBA;oBACrC,EAAE;gBACJ;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/form/useCombobox.ts"],"sourcesContent":["\"use client\";\nimport {\n useRef,\n type FocusEventHandler,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type InputHTMLAttributes,\n type KeyboardEventHandler,\n type MouseEventHandler,\n type Ref,\n type RefCallback,\n type RefObject,\n} from \"react\";\nimport { type MenuProps } from \"../menu/Menu.js\";\nimport { type MenuSheetConfigurableProps } from \"../menu/MenuSheet.js\";\nimport {\n type GetDefaultFocusedIndex,\n type GetFocusableElements,\n type KeyboardMovementExtensionData,\n type KeyboardMovementProviderImplementation,\n type KeyboardMovementProviderOptions,\n} from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { BELOW_CENTER_ANCHOR } from \"../positioning/constants.js\";\nimport {\n type PositionAnchor,\n type PositionWidth,\n} from \"../positioning/types.js\";\nimport { TRANSITION_CONFIG } from \"../transition/config.js\";\nimport {\n type TransitionCallbacks,\n type TransitionEnterHandler,\n type TransitionExitHandler,\n} from \"../transition/types.js\";\nimport {\n type NonNullMutableRef,\n type UseStateInitializer,\n type UseStateSetter,\n} from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useToggle } from \"../useToggle.js\";\nimport { tryToSubmitRelatedForm } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport const getNonDisabledOptions = (\n container: HTMLElement\n): readonly HTMLElement[] => [\n ...container.querySelectorAll<HTMLLIElement>(\n '[role=\"option\"]:not([aria-disabled])'\n ),\n];\n\n/**\n * @since 6.0.0\n */\nexport type SupportedComboboxPopup = \"listbox\" | \"grid\" | \"dialog\";\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxKeyboardMovementData<\n E extends HTMLElement = HTMLInputElement,\n> extends KeyboardMovementExtensionData<E> {\n show(): void;\n hide(): void;\n visible: boolean;\n focusLast: NonNullMutableRef<boolean>;\n}\n\n/**\n * @since 6.0.0\n */\nexport type ExtendComboboxKeyDown<E extends HTMLElement = HTMLInputElement> = (\n movementData: ComboboxKeyboardMovementData<E>\n) => void;\n\n/**\n * @since 6.0.0\n */\nexport type ComboboxKeyboardMovementOptions<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n> = Pick<\n KeyboardMovementProviderOptions<ComboboxEl>,\n | \"onClick\"\n | \"onFocus\"\n | \"onKeyDown\"\n | \"disabled\"\n | \"loopable\"\n | \"searchable\"\n | \"onFocusChange\"\n | \"isNegativeOneAllowed\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface BaseComboboxOptions<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends ComboboxKeyboardMovementOptions<ComboboxEl> {\n /**\n * This is the {@link InputHTMLAttributes.form} attribute and is used to\n * attempt submitting a form when the enter key is pressed.\n */\n form?: string;\n\n /**\n * @defaultValue `\"combobox-popup-\" + useId()`\n */\n popupId?: string;\n popupRef?: Ref<PopupEl>;\n\n /**\n * @defaultValue `\"combobox-\" + useId()`\n */\n comboboxId?: string;\n comboboxRef?: Ref<ComboboxEl>;\n\n /**\n * @defaultValue `\"listbox\"`\n */\n popup?: \"listbox\" | \"grid\" | \"dialog\";\n\n /**\n * @defaultValue `false`\n */\n defaultVisible?: UseStateInitializer<boolean>;\n\n extendKeyDown?: ExtendComboboxKeyDown<ComboboxEl>;\n\n /**\n * @defaultValue {@link getNonDisabledOptions}\n */\n getFocusableElements?: GetFocusableElements;\n\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxOptions<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends BaseComboboxOptions<ComboboxEl, PopupEl> {\n getEnterDefaultFocusedIndex(options: {\n focusLast: boolean;\n focusables: readonly HTMLElement[];\n currentFocusIndex: number;\n }): number;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxWidgetProps<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n> {\n \"aria-controls\": string;\n \"aria-disabled\": true | undefined;\n \"aria-expanded\": boolean;\n \"aria-haspopup\": SupportedComboboxPopup;\n id: string;\n ref: RefCallback<ComboboxEl>;\n role: \"combobox\";\n onClick: MouseEventHandler<ComboboxEl>;\n onFocus: FocusEventHandler<ComboboxEl>;\n onKeyDown: KeyboardEventHandler<ComboboxEl>;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxWidgetPopupProps<\n PopupEl extends HTMLElement = HTMLElement,\n> {\n id: string;\n ref: RefCallback<PopupEl>;\n role: \"listbox\" | \"dialog\" | \"grid\";\n}\n\n/**\n * @since 6.0.0\n */\nexport type ComboboxTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEntering\" | \"onEntered\" | \"onExiting\" | \"onExited\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxTransitionOptions extends ComboboxTransitionCallbacks {\n disableTransition?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport type ConfigurableComboboxMenuProps = Partial<\n Omit<MenuProps, \"visible\" | \"onRequestClose\" | keyof ComboboxWidgetPopupProps>\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface ProvidedComboboxMenuProps<\n PopupEl extends HTMLElement = HTMLDivElement,\n> extends Required<ComboboxTransitionCallbacks>,\n ComboboxWidgetPopupProps<PopupEl> {\n visible: boolean;\n onRequestClose(): void;\n\n /** @defaultValue `\"min\"` */\n width: PositionWidth;\n\n /** @defaultValue `BELOW_CENTER_ANCHOR` */\n anchor: PositionAnchor;\n\n fixedTo: RefObject<HTMLElement>;\n\n sheetProps: MenuSheetConfigurableProps &\n Required<ComboboxTransitionCallbacks>;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxMenuProps<PopupEl extends HTMLElement = HTMLDivElement>\n extends Omit<ConfigurableComboboxMenuProps, keyof ProvidedComboboxMenuProps>,\n ProvidedComboboxMenuProps<PopupEl> {}\n\n/**\n * Since the combobox usually uses the `Menu` as a popup element, this is a\n * helper util to create the required props and merge any additional props\n * with reasonable defaults.\n */\nexport type ComboboxGetMenuProps<PopupEl extends HTMLElement = HTMLDivElement> =\n (props?: ConfigurableComboboxMenuProps) => ComboboxMenuProps<PopupEl>;\n\n/**\n * @since 6.0.0\n */\nexport interface ComboboxImplementation<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends KeyboardMovementProviderImplementation<ComboboxEl> {\n show(): void;\n hide(): void;\n visible: boolean;\n setVisible: UseStateSetter<boolean>;\n focusLast: NonNullMutableRef<boolean>;\n popupRef: RefObject<PopupEl>;\n popupProps: ComboboxWidgetPopupProps<PopupEl>;\n comboboxRef: RefObject<ComboboxEl>;\n comboboxProps: ComboboxWidgetProps<ComboboxEl>;\n\n getMenuProps: ComboboxGetMenuProps<PopupEl>;\n getTransitionCallbacks(\n options: ComboboxTransitionOptions\n ): Required<ComboboxTransitionCallbacks>;\n}\n\n/**\n * @since 6.0.0\n */\nexport function useCombobox<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n>(\n options: ComboboxOptions<ComboboxEl, PopupEl>\n): ComboboxImplementation<ComboboxEl, PopupEl> {\n const {\n form,\n popup = \"listbox\",\n onClick = noop,\n onFocus,\n onKeyDown,\n searchable,\n isNegativeOneAllowed,\n loopable,\n disabled,\n comboboxId: propComboboxId,\n comboboxRef: propComboboxRef,\n popupId: propPopupId,\n popupRef: propPopupRef,\n defaultVisible = false,\n onFocusChange = noop,\n extendKeyDown = noop,\n getFocusableElements = getNonDisabledOptions,\n getEnterDefaultFocusedIndex,\n getDefaultFocusedIndex,\n } = options;\n\n const {\n toggled: visible,\n enable: show,\n disable: hide,\n setToggled: setVisible,\n } = useToggle(defaultVisible);\n const popupId = useEnsuredId(propPopupId, \"combobox-popup\");\n const comboboxId = useEnsuredId(propComboboxId, \"combobox\");\n const [comboboxRef, comboboxRefCallback] = useEnsuredRef(propComboboxRef);\n const [popupRef, popupRefCallback] = useEnsuredRef(propPopupRef);\n const focusLast = useRef(false);\n const {\n movementProps,\n movementContext,\n currentFocusIndex,\n activeDescendantId,\n setActiveDescendantId,\n } = useKeyboardMovementProvider<ComboboxEl>({\n onFocus,\n onKeyDown,\n onClick(event) {\n onClick(event);\n if (disabled) {\n return;\n }\n\n show();\n },\n extendKeyDown(movementData) {\n extendKeyDown({\n ...movementData,\n show,\n hide,\n visible,\n focusLast,\n });\n const { event } = movementData;\n if (event.isPropagationStopped()) {\n return;\n }\n\n if (visible) {\n switch (event.key) {\n case \"Tab\":\n case \"Escape\":\n event.stopPropagation();\n hide();\n break;\n case \"Enter\":\n event.preventDefault();\n break;\n }\n\n // while visible, always use the default keyboard movement behavior\n return;\n }\n\n switch (event.key) {\n case \"ArrowUp\":\n case \"ArrowDown\":\n event.preventDefault();\n event.stopPropagation();\n focusLast.current = event.key === \"ArrowUp\";\n show();\n break;\n case \"Enter\":\n tryToSubmitRelatedForm(event, form);\n break;\n }\n },\n disabled,\n loopable,\n searchable,\n onFocusChange,\n programmatic: true,\n includeDisabled: false,\n tabIndexBehavior: \"virtual\",\n getFocusableElements(container, programmatic) {\n const popup = popupRef.current;\n if (!popup) {\n return [];\n }\n\n return getFocusableElements(popup || container, programmatic);\n },\n isNegativeOneAllowed,\n getDefaultFocusedIndex,\n });\n const getTransitionCallbacks = (\n options: ComboboxTransitionOptions = {}\n ): Required<ComboboxTransitionCallbacks> => {\n const { onEntered, onEntering, onExiting, onExited, disableTransition } =\n options;\n\n const handleEntering =\n (callback: TransitionEnterHandler = noop, skipped: boolean) =>\n (appearing: boolean) => {\n callback(appearing);\n\n const popup = popupRef.current;\n if (!popup || skipped) {\n // Chrome does not trigger the scrollIntoView behavior correctly while\n // using a scale transition, so need to trigger this on the entered\n // flow to really make sure the item is in view.\n // An alternative would be to implement a custom scrollIntoView\n // behavior again like the previous versions of react-md, but this is\n // less lines of code\n const activeOption = document.getElementById(activeDescendantId);\n if (activeOption) {\n activeOption.scrollIntoView({ block: \"nearest\" });\n }\n return;\n }\n\n const focusables = getFocusableElements(popup, true);\n const index = getEnterDefaultFocusedIndex({\n focusLast: focusLast.current,\n focusables,\n currentFocusIndex: currentFocusIndex.current,\n });\n focusLast.current = false;\n currentFocusIndex.current = index;\n\n const option = focusables[index];\n if (!option) {\n return;\n }\n\n onFocusChange({\n index,\n element: option,\n });\n\n option.scrollIntoView({ block: \"nearest\" });\n setActiveDescendantId(option.id || \"\");\n };\n const handleExiting =\n (callback: TransitionExitHandler = noop, skipped: boolean) =>\n (): void => {\n callback();\n\n if (!skipped) {\n // since the menu is unmounted or set to hidden while not visible, need\n // to clear the aria-activedescendant and current focus index when\n // hiding\n currentFocusIndex.current = -1;\n setActiveDescendantId(\"\");\n }\n };\n\n const isTransitionCompleteSkipped =\n !disableTransition && !TRANSITION_CONFIG.disabled;\n\n return {\n onEntering: handleEntering(onEntering, false),\n onEntered: handleEntering(onEntered, isTransitionCompleteSkipped),\n onExiting: handleExiting(onExiting, false),\n onExited: handleExiting(onExited, isTransitionCompleteSkipped),\n };\n };\n\n const popupProps: ComboboxWidgetPopupProps<PopupEl> = {\n id: popupId,\n ref: popupRefCallback,\n role: popup,\n };\n\n return {\n show,\n hide,\n visible,\n setVisible,\n focusLast,\n popupRef,\n popupProps,\n comboboxRef,\n comboboxProps: {\n ...movementProps,\n \"aria-controls\": popupId,\n \"aria-disabled\": disabled || undefined,\n \"aria-expanded\": visible,\n \"aria-haspopup\": popup,\n id: comboboxId,\n ref: comboboxRefCallback,\n role: \"combobox\",\n },\n movementProps,\n movementContext,\n currentFocusIndex,\n activeDescendantId,\n setActiveDescendantId,\n getTransitionCallbacks,\n getMenuProps(props = {}) {\n const { sheetProps, disableTransition } = props;\n return {\n anchor: BELOW_CENTER_ANCHOR,\n width: \"min\",\n fixedTo: comboboxRef,\n ...props,\n ...popupProps,\n visible,\n onRequestClose: hide,\n ...getTransitionCallbacks(props),\n sheetProps: {\n ...sheetProps,\n ...getTransitionCallbacks({\n ...sheetProps,\n disableTransition:\n sheetProps?.disableTransition ?? disableTransition,\n }),\n },\n };\n },\n };\n}\n"],"names":["useRef","useKeyboardMovementProvider","BELOW_CENTER_ANCHOR","TRANSITION_CONFIG","useEnsuredId","useEnsuredRef","useToggle","tryToSubmitRelatedForm","noop","getNonDisabledOptions","container","querySelectorAll","useCombobox","options","form","popup","onClick","onFocus","onKeyDown","searchable","isNegativeOneAllowed","loopable","disabled","comboboxId","propComboboxId","comboboxRef","propComboboxRef","popupId","propPopupId","popupRef","propPopupRef","defaultVisible","onFocusChange","extendKeyDown","getFocusableElements","getEnterDefaultFocusedIndex","getDefaultFocusedIndex","toggled","visible","enable","show","disable","hide","setToggled","setVisible","comboboxRefCallback","popupRefCallback","focusLast","movementProps","movementContext","currentFocusIndex","activeDescendantId","setActiveDescendantId","event","movementData","isPropagationStopped","key","stopPropagation","preventDefault","current","programmatic","includeDisabled","tabIndexBehavior","getTransitionCallbacks","onEntered","onEntering","onExiting","onExited","disableTransition","handleEntering","callback","skipped","appearing","activeOption","document","getElementById","scrollIntoView","block","focusables","index","option","element","id","handleExiting","isTransitionCompleteSkipped","popupProps","ref","role","comboboxProps","undefined","getMenuProps","props","sheetProps","anchor","width","fixedTo","onRequestClose"],"mappings":"AAAA;AACA,SACEA,MAAM,QASD,QAAQ;AAUf,SAASC,2BAA2B,QAAQ,6CAA6C;AACzF,SAASC,mBAAmB,QAAQ,8BAA8B;AAKlE,SAASC,iBAAiB,QAAQ,0BAA0B;AAW5D,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,sBAAsB,QAAQ,aAAa;AAEpD,MAAMC,OAAO;AACX,aAAa;AACf;AAEA;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CACnCC,YAC2B;WACxBA,UAAUC,gBAAgB,CAC3B;KAEH,CAAC;AAqNF;;CAEC,GACD,OAAO,SAASC,YAIdC,OAA6C;IAE7C,MAAM,EACJC,IAAI,EACJC,QAAQ,SAAS,EACjBC,UAAUR,IAAI,EACdS,OAAO,EACPC,SAAS,EACTC,UAAU,EACVC,oBAAoB,EACpBC,QAAQ,EACRC,QAAQ,EACRC,YAAYC,cAAc,EAC1BC,aAAaC,eAAe,EAC5BC,SAASC,WAAW,EACpBC,UAAUC,YAAY,EAC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C,gBACJ,CAACb,WAAkC9D,IAAI,EAAE+D,UACzC;gBACED;gBAEA,IAAI,CAACC,SAAS;oBACZ,uEAAuE;oBACvE,kEAAkE;oBAClE,SAAS;oBACTrB,kBAAkBS,OAAO,GAAG,CAAC;oBAC7BP,sBAAsB;gBACxB;YACF;QAEF,MAAMgC,8BACJ,CAAChB,qBAAqB,CAACjE,kBAAkBmB,QAAQ;QAEnD,OAAO;YACL2C,YAAYI,eAAeJ,YAAY;YACvCD,WAAWK,eAAeL,WAAWoB;YACrClB,WAAWiB,cAAcjB,WAAW;YACpCC,UAAUgB,cAAchB,UAAUiB;QACpC;IACF;IAEA,MAAMC,aAAgD;QACpDH,IAAIvD;QACJ2D,KAAKxC;QACLyC,MAAMxE;IACR;IAEA,OAAO;QACLyB;QACAE;QACAJ;QACAM;QACAG;QACAlB;QACAwD;QACA5D;QACA+D,eAAe;YACb,GAAGxC,aAAa;YAChB,iBAAiBrB;YACjB,iBAAiBL,YAAYmE;YAC7B,iBAAiBnD;YACjB,iBAAiBvB;YACjBmE,IAAI3D;YACJ+D,KAAKzC;YACL0C,MAAM;QACR;QACAvC;QACAC;QACAC;QACAC;QACAC;QACAW;QACA2B,cAAaC,QAAQ,CAAC,CAAC;YACrB,MAAM,EAAEC,UAAU,EAAExB,iBAAiB,EAAE,GAAGuB;YAC1C,OAAO;gBACLE,QAAQ3F;gBACR4F,OAAO;gBACPC,SAAStE;gBACT,GAAGkE,KAAK;gBACR,GAAGN,UAAU;gBACb/C;gBACA0D,gBAAgBtD;gBAChB,GAAGqB,uBAAuB4B,MAAM;gBAChCC,YAAY;oBACV,GAAGA,UAAU;oBACb,GAAG7B,uBAAuB;wBACxB,GAAG6B,UAAU;wBACbxB,mBACEwB,YAAYxB,qBAAqBA;oBACrC,EAAE;gBACJ;YACF;QACF;IACF;AACF"}
@@ -91,6 +91,9 @@ import { isChangeableHTMLElement, triggerManualChangeEvent } from "./utils.js";
91
91
  ...combobox,
92
92
  getMenuProps (props) {
93
93
  return {
94
+ // override the inherited renderAsSheet context since the sheet makes it
95
+ // so the user can't actually type in the combobox
96
+ renderAsSheet: false,
94
97
  preventOverlap: true,
95
98
  ...getMenuProps(props)
96
99
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/useEditableCombobox.ts"],"sourcesContent":["\"use client\";\nimport { useRef } from \"react\";\nimport { isTypeEvent } from \"../movement/utils.js\";\nimport {\n useCombobox,\n type BaseComboboxOptions,\n type ComboboxImplementation,\n} from \"./useCombobox.js\";\nimport { isChangeableHTMLElement, triggerManualChangeEvent } from \"./utils.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface EditableComboboxOptions<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends BaseComboboxOptions<ComboboxEl, PopupEl> {}\n\n/**\n * @since 6.0.0\n */\nexport interface EditableComboboxImplementation<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends ComboboxImplementation<ComboboxEl, PopupEl> {}\n\n/**\n * @since 6.0.0\n */\nexport function useEditableCombobox<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n>(\n options: EditableComboboxOptions<ComboboxEl, PopupEl> = {}\n): EditableComboboxImplementation<ComboboxEl, PopupEl> {\n const focusFirst = useRef(false);\n const { getMenuProps, ...combobox } = useCombobox({\n ...options,\n loopable: true,\n searchable: false,\n isNegativeOneAllowed: true,\n getEnterDefaultFocusedIndex(options) {\n const { focusLast, focusables, currentFocusIndex } = options;\n if (focusFirst.current) {\n focusFirst.current = false;\n return 0;\n }\n\n if (focusLast) {\n return focusables.length - 1;\n }\n\n return currentFocusIndex;\n },\n extendKeyDown(movementData) {\n const {\n event,\n show,\n hide,\n visible,\n currentFocusIndex,\n setActiveDescendantId,\n } = movementData;\n\n const resetFocus = (): void => {\n currentFocusIndex.current = -1;\n setActiveDescendantId(\"\");\n };\n\n switch (event.key) {\n case \"Escape\":\n if (!visible && isChangeableHTMLElement(event.currentTarget)) {\n event.preventDefault();\n event.stopPropagation();\n triggerManualChangeEvent(event.currentTarget, \"\");\n }\n break;\n case \"Home\":\n case \"End\":\n // do not attempt to jump to the start or end of the listbox so\n // natural text editing occurs\n event.stopPropagation();\n if (visible) {\n resetFocus();\n }\n break;\n case \"ArrowLeft\":\n case \"ArrowRight\":\n if (visible) {\n resetFocus();\n }\n break;\n case \"ArrowUp\":\n // Note: The non-altKey version is handled in the `useCombobox` hook\n //\n // if the popup is available and the altKey was pressed, return focus\n // to the combobox without closing. If the focus was already on the\n // combobox, hide the popup\n if (visible && event.altKey) {\n event.preventDefault();\n event.stopPropagation();\n\n if (currentFocusIndex.current !== -1) {\n resetFocus();\n } else {\n hide();\n }\n }\n break;\n case \"ArrowDown\":\n // if the popup is available, display the popup keep the focus on the\n // combobox if the altKey was pressed. Otherwise, move focus into the\n // listbox\n if (!visible) {\n event.preventDefault();\n event.stopPropagation();\n focusFirst.current = !event.altKey;\n show();\n }\n break;\n default:\n if (isTypeEvent(event)) {\n show();\n resetFocus();\n }\n }\n },\n });\n\n return {\n ...combobox,\n getMenuProps(props) {\n return {\n preventOverlap: true,\n ...getMenuProps(props),\n };\n },\n };\n}\n"],"names":["useRef","isTypeEvent","useCombobox","isChangeableHTMLElement","triggerManualChangeEvent","useEditableCombobox","options","focusFirst","getMenuProps","combobox","loopable","searchable","isNegativeOneAllowed","getEnterDefaultFocusedIndex","focusLast","focusables","currentFocusIndex","current","length","extendKeyDown","movementData","event","show","hide","visible","setActiveDescendantId","resetFocus","key","currentTarget","preventDefault","stopPropagation","altKey","props","preventOverlap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,SAASC,WAAW,QAAQ,uBAAuB;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AAM,EAAE;wBAC3BV,MAAMQ,cAAc;wBACpBR,MAAMS,eAAe;wBAErB,IAAId,kBAAkBC,OAAO,KAAK,CAAC,GAAG;4BACpCS;wBACF,OAAO;4BACLH;wBACF;oBACF;oBACA;gBACF,KAAK;oBACH,qEAAqE;oBACrE,qEAAqE;oBACrE,UAAU;oBACV,IAAI,CAACC,SAAS;wBACZH,MAAMQ,cAAc;wBACpBR,MAAMS,eAAe;wBACrBvB,WAAWU,OAAO,GAAG,CAACI,MAAMU,MAAM;wBAClCT;oBACF;oBACA;gBACF;oBACE,IAAIrB,YAAYoB,QAAQ;wBACtBC;wBACAI;oBACF;YACJ;QACF;IACF;IAEA,OAAO;QACL,GAAGjB,QAAQ;QACXD,cAAawB,KAAK;YAChB,OAAO;gBACLC,gBAAgB;gBAChB,GAAGzB,aAAawB,MAAM;YACxB;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/form/useEditableCombobox.ts"],"sourcesContent":["\"use client\";\nimport { useRef } from \"react\";\nimport { isTypeEvent } from \"../movement/utils.js\";\nimport {\n useCombobox,\n type BaseComboboxOptions,\n type ComboboxImplementation,\n} from \"./useCombobox.js\";\nimport { isChangeableHTMLElement, triggerManualChangeEvent } from \"./utils.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface EditableComboboxOptions<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends BaseComboboxOptions<ComboboxEl, PopupEl> {}\n\n/**\n * @since 6.0.0\n */\nexport interface EditableComboboxImplementation<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n> extends ComboboxImplementation<ComboboxEl, PopupEl> {}\n\n/**\n * @since 6.0.0\n */\nexport function useEditableCombobox<\n ComboboxEl extends HTMLElement = HTMLInputElement,\n PopupEl extends HTMLElement = HTMLElement,\n>(\n options: EditableComboboxOptions<ComboboxEl, PopupEl> = {}\n): EditableComboboxImplementation<ComboboxEl, PopupEl> {\n const focusFirst = useRef(false);\n const { getMenuProps, ...combobox } = useCombobox({\n ...options,\n loopable: true,\n searchable: false,\n isNegativeOneAllowed: true,\n getEnterDefaultFocusedIndex(options) {\n const { focusLast, focusables, currentFocusIndex } = options;\n if (focusFirst.current) {\n focusFirst.current = false;\n return 0;\n }\n\n if (focusLast) {\n return focusables.length - 1;\n }\n\n return currentFocusIndex;\n },\n extendKeyDown(movementData) {\n const {\n event,\n show,\n hide,\n visible,\n currentFocusIndex,\n setActiveDescendantId,\n } = movementData;\n\n const resetFocus = (): void => {\n currentFocusIndex.current = -1;\n setActiveDescendantId(\"\");\n };\n\n switch (event.key) {\n case \"Escape\":\n if (!visible && isChangeableHTMLElement(event.currentTarget)) {\n event.preventDefault();\n event.stopPropagation();\n triggerManualChangeEvent(event.currentTarget, \"\");\n }\n break;\n case \"Home\":\n case \"End\":\n // do not attempt to jump to the start or end of the listbox so\n // natural text editing occurs\n event.stopPropagation();\n if (visible) {\n resetFocus();\n }\n break;\n case \"ArrowLeft\":\n case \"ArrowRight\":\n if (visible) {\n resetFocus();\n }\n break;\n case \"ArrowUp\":\n // Note: The non-altKey version is handled in the `useCombobox` hook\n //\n // if the popup is available and the altKey was pressed, return focus\n // to the combobox without closing. If the focus was already on the\n // combobox, hide the popup\n if (visible && event.altKey) {\n event.preventDefault();\n event.stopPropagation();\n\n if (currentFocusIndex.current !== -1) {\n resetFocus();\n } else {\n hide();\n }\n }\n break;\n case \"ArrowDown\":\n // if the popup is available, display the popup keep the focus on the\n // combobox if the altKey was pressed. Otherwise, move focus into the\n // listbox\n if (!visible) {\n event.preventDefault();\n event.stopPropagation();\n focusFirst.current = !event.altKey;\n show();\n }\n break;\n default:\n if (isTypeEvent(event)) {\n show();\n resetFocus();\n }\n }\n },\n });\n\n return {\n ...combobox,\n getMenuProps(props) {\n return {\n // override the inherited renderAsSheet context since the sheet makes it\n // so the user can't actually type in the combobox\n renderAsSheet: false,\n preventOverlap: true,\n ...getMenuProps(props),\n };\n },\n };\n}\n"],"names":["useRef","isTypeEvent","useCombobox","isChangeableHTMLElement","triggerManualChangeEvent","useEditableCombobox","options","focusFirst","getMenuProps","combobox","loopable","searchable","isNegativeOneAllowed","getEnterDefaultFocusedIndex","focusLast","focusables","currentFocusIndex","current","length","extendKeyDown","movementData","event","show","hide","visible","setActiveDescendantId","resetFocus","key","currentTarget","preventDefault","stopPropagation","altKey","props","renderAsSheet","preventOverlap"],"mappings":"AAAA;AACA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SACEC,WAAW,QAGN,mBAAmB;AAC1B,SAASC,uBAAuB,EAAEC,wBAAwB,QAAQ,aAAa;AAkB/E;;CAEC,GACD,OAAO,SAASC,oBAIdC,UAAwD,CAAC,CAAC;IAE1D,MAAMC,aAAaP,OAAO;IAC1B,MAAM,EAAEQ,YAAY,EAAE,GAAGC,UAAU,GAAGP,YAAY;QAChD,GAAGI,OAAO;QACVI,UAAU;QACVC,YAAY;QACZC,sBAAsB;QACtBC,6BAA4BP,OAAO;YACjC,MAAM,EAAEQ,SAAS,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GAAGV;YACrD,IAAIC,WAAWU,OAAO,EAAE;gBACtBV,WAAWU,OAAO,GAAG;gBACrB,OAAO;YACT;YAEA,IAAIH,WAAW;gBACb,OAAOC,WAAWG,MAAM,GAAG;YAC7B;YAEA,OAAOF;QACT;QACAG,eAAcC,YAAY;YACxB,MAAM,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPR,iBAAiB,EACjBS,qBAAqB,EACtB,GAAGL;YAEJ,MAAMM,aAAa;gBACjBV,kBAAkBC,OAAO,GAAG,CAAC;gBAC7BQ,sBAAsB;YACxB;YAEA,OAAQJ,MAAMM,GAAG;gBACf,KAAK;oBACH,IAAI,CAACH,WAAWrB,wBAAwBkB,MAAMO,aAAa,GAAG;wBAC5DP,MAAMQ,cAAc;wBACpBR,MAAMS,eAAe;wBACrB1B,yBAAyBiB,MAAMO,aAAa,EAAE;oBAChD;oBACA;gBACF,KAAK;gBACL,KAAK;oBACH,+DAA+D;oBAC/D,8BAA8B;oBAC9BP,MAAMS,eAAe;oBACrB,IAAIN,SAAS;wBACXE;oBACF;oBACA;gBACF,KAAK;gBACL,KAAK;oBACH,IAAIF,SAAS;wBACXE;oBACF;oBACA;gBACF,KAAK;oBACH,oEAAoE;oBACpE,EAAE;oBACF,qEAAqE;oBACrE,mEAAmE;oBACnE,2BAA2B;oBAC3B,IAAIF,WAAWH,MAAMU,MAAM,EAAE;wBAC3BV,MAAMQ,cAAc;wBACpBR,MAAMS,eAAe;wBAErB,IAAId,kBAAkBC,OAAO,KAAK,CAAC,GAAG;4BACpCS;wBACF,OAAO;4BACLH;wBACF;oBACF;oBACA;gBACF,KAAK;oBACH,qEAAqE;oBACrE,qEAAqE;oBACrE,UAAU;oBACV,IAAI,CAACC,SAAS;wBACZH,MAAMQ,cAAc;wBACpBR,MAAMS,eAAe;wBACrBvB,WAAWU,OAAO,GAAG,CAACI,MAAMU,MAAM;wBAClCT;oBACF;oBACA;gBACF;oBACE,IAAIrB,YAAYoB,QAAQ;wBACtBC;wBACAI;oBACF;YACJ;QACF;IACF;IAEA,OAAO;QACL,GAAGjB,QAAQ;QACXD,cAAawB,KAAK;YAChB,OAAO;gBACL,wEAAwE;gBACxE,kDAAkD;gBAClDC,eAAe;gBACfC,gBAAgB;gBAChB,GAAG1B,aAAawB,MAAM;YACxB;QACF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/useFileUpload.ts"],"sourcesContent":["\"use client\";\nimport { nanoid } from \"nanoid\";\nimport {\n useCallback,\n useEffect,\n useReducer,\n type ChangeEvent,\n type DragEvent,\n} from \"react\";\nimport {\n FileAccessError,\n getFileParser as defaultGetFileParser,\n isValidFileName as defaultIsValidFileName,\n validateFiles as defaultValidateFiles,\n type CompletedFileUploadStats,\n type FileReaderResult,\n type FileUploadHandlers,\n type FileUploadStats,\n type FileValidationError,\n type FileValidationOptions,\n type FilesValidator,\n type GetFileParser,\n type ProcessingFileUploadStats,\n} from \"./fileUtils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadState<CustomError = never> {\n /**\n * All the files that have been validated and are either:\n * - pending upload\n * - uploading\n * - complete\n *\n * Each key in this object is the {@link BaseFileUploadStats.key} generated\n * once the upload starts pending.\n */\n stats: Readonly<Record<string, Readonly<FileUploadStats>>>;\n\n /**\n * A list of validation errors that have occurred before starting the upload\n * process.\n *\n * @see {@link FileAccessError}\n * @see {@link TooManyFilesError}\n * @see {@link FileValidationError}\n */\n errors: readonly FileValidationError<CustomError>[];\n}\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n * @internal\n */\nexport interface FileUploadHookState<CustomError = never>\n extends FileUploadState<CustomError> {\n /**\n * All the current readers used for uploading files to the browser.\n *\n * Note: Once an upload has completed, the reader will be removed.\n */\n readers: Readonly<Record<string, FileReader>>;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadOptions<E extends HTMLElement, CustomError = never>\n extends FileUploadHandlers<E>,\n FileValidationOptions {\n /**\n * Setting this value to a number greater than `0` will update the browser\n * upload process to queue the uploads in chunks instead of all at once. This\n * can help prevent the browser from freezing if dealing with large files that\n * are being converted to data urls.\n *\n * @defaultValue `-1`\n */\n concurrency?: number;\n\n /** {@inheritDoc FilesValidator} */\n validateFiles?: FilesValidator<CustomError>;\n /** {@inheritDoc GetFileParser} */\n getFileParser?: GetFileParser;\n}\n\n/** @internal */\ntype Action<E = never> =\n | {\n type: \"queue\";\n errors: readonly FileValidationError<E>[];\n files: readonly File[];\n }\n | { type: \"reset\" }\n | { type: \"remove\"; files: readonly string[] }\n | { type: \"start\"; key: string; reader: FileReader }\n | { type: \"progress\"; key: string; progress: number }\n | { type: \"complete\"; key: string; result: FileReaderResult }\n | { type: \"clearErrors\" };\n\n/** @since 2.9.0 */\nexport interface FileUploadActions {\n /**\n * Reset everything related to uploads ensuring that all file readers have\n * been aborted.\n */\n reset(): void;\n\n /**\n * Removes all the errors that exist in state without cancelling any of the\n * uploads already in progress.\n */\n clearErrors(): void;\n\n /**\n * This function is used to cancel pending and uploading files or removing\n * completed files.\n *\n * @param keyOrKeys - A single or list of {@link BaseFileUploadStats.key} to\n * remove from state.\n */\n remove(keyOrKeys: string | readonly string[]): void;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadHookReturnValue<\n E extends HTMLElement = HTMLElement,\n CustomError = never,\n> extends FileUploadActions,\n Required<FileUploadHandlers<E>> {\n /** {@inheritDoc FileUploadState.errors} */\n errors: readonly FileValidationError<CustomError>[];\n\n /**\n * A list of all the {@link FileUploadStats}.\n *\n * @see {@link getSplitFileUploads} for separating by status\n */\n stats: readonly Readonly<FileUploadStats>[];\n\n /**\n * The total number of bytes for all the files that exist in the\n * {@link stats} list.\n */\n totalBytes: number;\n\n /**\n * The total number of files in the {@link stats} list.\n */\n totalFiles: number;\n\n /**\n * An `accept` string that can be passed to the {@link FileInput} component\n * when the {@link FileValidationOptions.extensions} list has been provided to\n * limit which files the OS will _attempt_ to allow access to.\n *\n * @example Simple example\n * ```ts\n * const extensions = ['pdf', 'docx', 'ppt'];\n * const { accept } = useFileUpload({ extensions, ...others });\n *\n * expect(accept).toBe(\"*.pdf,*.docx,*.ppt\")\n * ```\n *\n * @defaultValue `\"*\"`\n */\n accept: string;\n}\n\n/** @internal */\nconst EMPTY_LIST = [] as const;\n/** @internal */\nconst EMPTY_OBJECT = {} as const;\n\n/**\n * This hook is generally used to upload files **to the browser** in different\n * formats to be previewed `<img>`, `<video>`, `<embed>`, etc tags. However, it\n * can also be used to upload the files as an `ArrayBuffer` and then uploaded to\n * a server.\n *\n * Note: If using the `aws-sdk` to upload files directly to S3, **do not use\n * this hook** since it uses its own upload process.\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @param options - All the {@link FileUploadOptions}\n * @returns the {@link FileUploadHookReturnValue}\n * @since 2.9.0\n */\nexport function useFileUpload<E extends HTMLElement, CustomError = never>({\n maxFiles = -1,\n extensions = EMPTY_LIST,\n minFileSize = -1,\n maxFileSize = -1,\n totalFileSize = -1,\n concurrency = -1,\n onDrop: propOnDrop = noop,\n onChange: propOnChange = noop,\n validateFiles = defaultValidateFiles,\n getFileParser = defaultGetFileParser,\n isValidFileName = defaultIsValidFileName,\n}: FileUploadOptions<E, CustomError> = {}): Readonly<\n FileUploadHookReturnValue<E, CustomError>\n> {\n const [state, dispatch] = useReducer(\n function reducer(\n state: FileUploadHookState<CustomError>,\n action: Action<CustomError>\n ): FileUploadHookState<CustomError> {\n switch (action.type) {\n case \"reset\":\n // need to reuse constants so that calling reset doesn't cause an\n // infinite loop in an effect\n return {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n };\n case \"remove\": {\n const stats: Record<string, FileUploadStats> = {};\n for (const key in state.stats) {\n if (!action.files.includes(key)) {\n stats[key] = state.stats[key];\n }\n }\n\n return {\n ...state,\n stats,\n };\n }\n case \"queue\":\n return {\n ...state,\n stats: {\n ...state.stats,\n ...action.files.reduce<Record<string, ProcessingFileUploadStats>>(\n (files, file) => {\n const key = nanoid();\n files[key] = {\n key,\n file,\n progress: 0,\n status: \"pending\",\n };\n\n return files;\n },\n {}\n ),\n },\n errors: [...state.errors, ...action.errors],\n };\n case \"start\": {\n const { key, reader } = action;\n const fileStats: ProcessingFileUploadStats = {\n key,\n file: state.stats[key].file,\n progress: 0,\n status: \"uploading\",\n };\n\n return {\n ...state,\n readers: {\n ...state.readers,\n [key]: reader,\n },\n stats: {\n ...state.stats,\n [key]: fileStats,\n },\n };\n }\n case \"progress\": {\n const { key, progress } = action;\n return {\n ...state,\n stats: {\n ...state.stats,\n [key]: {\n ...state.stats[key],\n progress,\n },\n },\n };\n }\n case \"complete\": {\n const { key, result } = action;\n const file: CompletedFileUploadStats = {\n key,\n file: state.stats[key].file,\n status: \"complete\",\n result,\n progress: 100,\n };\n const { [key]: _reader, ...readers } = state.readers;\n\n return {\n ...state,\n readers,\n stats: {\n ...state.stats,\n [key]: file,\n },\n };\n }\n case \"clearErrors\":\n return { ...state, errors: [] };\n }\n },\n {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n }\n );\n const { stats, errors, readers } = state;\n\n const statsList = Object.values(stats);\n const totalFiles = statsList.length;\n const totalBytes = statsList.reduce(\n (result, { file: { size } }) => result + size,\n 0\n );\n const queueFiles = useCallback(\n (files: readonly File[]) => {\n const { pending, errors } = validateFiles(files, {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n });\n\n dispatch({ type: \"queue\", errors, files: pending });\n },\n [\n validateFiles,\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n ]\n );\n const onDrop = useCallback(\n (event: DragEvent<E>) => {\n propOnDrop(event);\n event.preventDefault();\n event.stopPropagation();\n\n try {\n const files = event.dataTransfer.files;\n if (files) {\n queueFiles(Array.from(files));\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnDrop]\n );\n const onChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n propOnChange(event);\n try {\n const files = event.currentTarget.files;\n if (files) {\n queueFiles(Array.from(files));\n } else {\n throw new Error();\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnChange]\n );\n\n const remove = useCallback(\n (keyOrKeys: string | readonly string[]) => {\n const files = typeof keyOrKeys === \"string\" ? [keyOrKeys] : keyOrKeys;\n files.forEach((fileKey) => {\n readers[fileKey]?.abort();\n });\n\n dispatch({ type: \"remove\", files });\n },\n [readers]\n );\n const reset = useCallback(() => {\n Object.values(readers).forEach((reader) => {\n reader.abort();\n });\n\n dispatch({ type: \"reset\" });\n }, [readers]);\n const clearErrors = useCallback(() => {\n dispatch({ type: \"clearErrors\" });\n }, []);\n const start = useCallback((key: string, reader: FileReader) => {\n dispatch({ type: \"start\", key, reader });\n }, []);\n const complete = useCallback(\n (key: string, result: FileReaderResult = null) => {\n dispatch({ type: \"complete\", key, result });\n },\n []\n );\n const createProgressEventHandler = useCallback(\n (key: string) => (event: ProgressEvent) => {\n if (event.lengthComputable) {\n const percentage = Math.round((event.loaded * 100) / event.total);\n dispatch({ type: \"progress\", key, progress: percentage });\n }\n },\n []\n );\n\n useEffect(() => {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n Object.values(stats).forEach((file) => {\n if (file.status === \"pending\") {\n pending.push(file);\n } else if (file.status === \"uploading\") {\n uploading.push(file);\n }\n });\n\n const lastIndex =\n concurrency === -1\n ? pending.length\n : Math.max(0, concurrency - uploading.length);\n const queue = pending.slice(0, lastIndex);\n if (!queue.length) {\n return;\n }\n\n queue.forEach((stats) => {\n const { key, file } = stats;\n const reader = new FileReader();\n\n // using `addEventListener` instead of directly setting to\n // `reader.progress`/`reader.load` so it's easier to test\n reader.addEventListener(\"progress\", createProgressEventHandler(key));\n reader.addEventListener(\"load\", () => {\n complete(key, reader.result);\n });\n\n start(key, reader);\n const parser = getFileParser(file);\n /* istanbul ignore next */\n if (\n process.env.NODE_ENV !== \"production\" &&\n ![\n \"readAsText\",\n \"readAsDataURL\",\n \"readAsArrayBuffer\",\n \"readAsBinaryString\",\n ].includes(parser)\n ) {\n throw new Error(\"Invalid file reader parser\");\n }\n\n reader[parser](file);\n });\n }, [\n concurrency,\n stats,\n getFileParser,\n createProgressEventHandler,\n start,\n complete,\n ]);\n\n let accept = \"\";\n if (extensions.length) {\n accept = extensions.reduce((s, ext) => `${s ? `${s},` : \"\"}.${ext}`, \"\");\n }\n\n return {\n stats: statsList,\n errors,\n accept,\n totalBytes,\n totalFiles,\n onDrop,\n onChange,\n reset,\n remove,\n clearErrors,\n };\n}\n"],"names":["nanoid","useCallback","useEffect","useReducer","FileAccessError","getFileParser","defaultGetFileParser","isValidFileName","defaultIsValidFileName","validateFiles","defaultValidateFiles","noop","EMPTY_LIST","EMPTY_OBJECT","useFileUpload","maxFiles","extensions","minFileSize","maxFileSize","totalFileSize","concurrency","onDrop","propOnDrop","onChange","propOnChange","state","dispatch","reducer","action","type","stats","errors","readers","key","files","includes","reduce","file","progress","status","reader","fileStats","result","_reader","statsList","Object","values","totalFiles","length","totalBytes","size","queueFiles","pending","event","preventDefault","stopPropagation","dataTransfer","Array","from","e","Error","message","undefined","currentTarget","remove","keyOrKeys","forEach","fileKey","abort","reset","clearErrors","start","complete","createProgressEventHandler","lengthComputable","percentage","Math","round","loaded","total","uploading","push","lastIndex","max","queue","slice","FileReader","addEventListener","parser","process","env","NODE_ENV","accept","s","ext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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YAClB;YAEApB,MAAM,CAACgD,OAAO,CAACnD;QACjB;IACF,GAAG;QACDjB;QACAU;QACAzB;QACAoE;QACAF;QACAC;KACD;IAED,IAAIoB,SAAS;IACb,IAAI5E,WAAWgC,MAAM,EAAE;QACrB4C,SAAS5E,WAAWoB,MAAM,CAAC,CAACyD,GAAGC,MAAQ,CAAC,EAAED,IAAI,CAAC,EAAEA,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,EAAEC,IAAI,CAAC,EAAE;IACvE;IAEA,OAAO;QACLhE,OAAOc;QACPb;QACA6D;QACA3C;QACAF;QACA1B;QACAE;QACA8C;QACAL;QACAM;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/form/useFileUpload.ts"],"sourcesContent":["\"use client\";\nimport { nanoid } from \"nanoid\";\nimport {\n useCallback,\n useEffect,\n useReducer,\n type ChangeEvent,\n type DragEvent,\n} from \"react\";\nimport {\n FileAccessError,\n getFileParser as defaultGetFileParser,\n isValidFileName as defaultIsValidFileName,\n validateFiles as defaultValidateFiles,\n type CompletedFileUploadStats,\n type FileReaderResult,\n type FileUploadHandlers,\n type FileUploadStats,\n type FileValidationError,\n type FileValidationOptions,\n type FilesValidator,\n type GetFileParser,\n type ProcessingFileUploadStats,\n} from \"./fileUtils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadState<CustomError = never> {\n /**\n * All the files that have been validated and are either:\n * - pending upload\n * - uploading\n * - complete\n *\n * Each key in this object is the {@link BaseFileUploadStats.key} generated\n * once the upload starts pending.\n */\n stats: Readonly<Record<string, Readonly<FileUploadStats>>>;\n\n /**\n * A list of validation errors that have occurred before starting the upload\n * process.\n *\n * @see {@link FileAccessError}\n * @see {@link TooManyFilesError}\n * @see {@link FileValidationError}\n */\n errors: readonly FileValidationError<CustomError>[];\n}\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n * @internal\n */\nexport interface FileUploadHookState<CustomError = never>\n extends FileUploadState<CustomError> {\n /**\n * All the current readers used for uploading files to the browser.\n *\n * Note: Once an upload has completed, the reader will be removed.\n */\n readers: Readonly<Record<string, FileReader>>;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadOptions<E extends HTMLElement, CustomError = never>\n extends FileUploadHandlers<E>,\n FileValidationOptions {\n /**\n * Setting this value to a number greater than `0` will update the browser\n * upload process to queue the uploads in chunks instead of all at once. This\n * can help prevent the browser from freezing if dealing with large files that\n * are being converted to data urls.\n *\n * @defaultValue `-1`\n */\n concurrency?: number;\n\n /** {@inheritDoc FilesValidator} */\n validateFiles?: FilesValidator<CustomError>;\n /** {@inheritDoc GetFileParser} */\n getFileParser?: GetFileParser;\n}\n\n/** @internal */\ntype Action<E = never> =\n | {\n type: \"queue\";\n errors: readonly FileValidationError<E>[];\n files: readonly File[];\n }\n | { type: \"reset\" }\n | { type: \"remove\"; files: readonly string[] }\n | { type: \"start\"; key: string; reader: FileReader }\n | { type: \"progress\"; key: string; progress: number }\n | { type: \"complete\"; key: string; result: FileReaderResult }\n | { type: \"clearErrors\" };\n\n/** @since 2.9.0 */\nexport interface FileUploadActions {\n /**\n * Reset everything related to uploads ensuring that all file readers have\n * been aborted.\n */\n reset(): void;\n\n /**\n * Removes all the errors that exist in state without cancelling any of the\n * uploads already in progress.\n */\n clearErrors(): void;\n\n /**\n * This function is used to cancel pending and uploading files or removing\n * completed files.\n *\n * @param keyOrKeys - A single or list of {@link BaseFileUploadStats.key} to\n * remove from state.\n */\n remove(keyOrKeys: string | readonly string[]): void;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadHookReturnValue<\n E extends HTMLElement = HTMLElement,\n CustomError = never,\n> extends FileUploadActions,\n Required<FileUploadHandlers<E>> {\n /** {@inheritDoc FileUploadState.errors} */\n errors: readonly FileValidationError<CustomError>[];\n\n /**\n * A list of all the {@link FileUploadStats}.\n *\n * @see {@link getSplitFileUploads} for separating by status\n */\n stats: readonly Readonly<FileUploadStats>[];\n\n /**\n * The total number of bytes for all the files that exist in the\n * {@link stats} list.\n */\n totalBytes: number;\n\n /**\n * The total number of files in the {@link stats} list.\n */\n totalFiles: number;\n\n /**\n * An `accept` string that can be passed to the {@link FileInput} component\n * when the {@link FileValidationOptions.extensions} list has been provided to\n * limit which files the OS will _attempt_ to allow access to.\n *\n * @example Simple example\n * ```ts\n * const extensions = ['pdf', 'docx', 'ppt'];\n * const { accept } = useFileUpload({ extensions, ...others });\n *\n * expect(accept).toBe(\"*.pdf,*.docx,*.ppt\")\n * ```\n *\n * @defaultValue `\"*\"`\n */\n accept: string;\n}\n\n/** @internal */\nconst EMPTY_LIST = [] as const;\n/** @internal */\nconst EMPTY_OBJECT = {} as const;\n\n/**\n * This hook is generally used to upload files **to the browser** in different\n * formats to be previewed `<img>`, `<video>`, `<embed>`, etc tags. However, it\n * can also be used to upload the files as an `ArrayBuffer` and then uploaded to\n * a server.\n *\n * Note: If using the `aws-sdk` to upload files directly to S3, **do not use\n * this hook** since it uses its own upload process.\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @param options - All the {@link FileUploadOptions}\n * @returns the {@link FileUploadHookReturnValue}\n * @since 2.9.0\n */\nexport function useFileUpload<E extends HTMLElement, CustomError = never>({\n maxFiles = -1,\n extensions = EMPTY_LIST,\n minFileSize = -1,\n maxFileSize = -1,\n totalFileSize = -1,\n concurrency = -1,\n onDrop: propOnDrop = noop,\n onChange: propOnChange = noop,\n validateFiles = defaultValidateFiles,\n getFileParser = defaultGetFileParser,\n isValidFileName = defaultIsValidFileName,\n}: FileUploadOptions<E, CustomError> = {}): Readonly<\n FileUploadHookReturnValue<E, CustomError>\n> {\n const [state, dispatch] = useReducer(\n function reducer(\n state: FileUploadHookState<CustomError>,\n action: Action<CustomError>\n ): FileUploadHookState<CustomError> {\n switch (action.type) {\n case \"reset\":\n // need to reuse constants so that calling reset doesn't cause an\n // infinite loop in an effect\n return {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n };\n case \"remove\": {\n const stats: Record<string, FileUploadStats> = {};\n for (const key in state.stats) {\n if (!action.files.includes(key)) {\n stats[key] = state.stats[key];\n }\n }\n\n return {\n ...state,\n stats,\n };\n }\n case \"queue\":\n return {\n ...state,\n stats: {\n ...state.stats,\n ...action.files.reduce<Record<string, ProcessingFileUploadStats>>(\n (files, file) => {\n const key = nanoid();\n files[key] = {\n key,\n file,\n progress: 0,\n status: \"pending\",\n };\n\n return files;\n },\n {}\n ),\n },\n errors: [...state.errors, ...action.errors],\n };\n case \"start\": {\n const { key, reader } = action;\n const fileStats: ProcessingFileUploadStats = {\n key,\n file: state.stats[key].file,\n progress: 0,\n status: \"uploading\",\n };\n\n return {\n ...state,\n readers: {\n ...state.readers,\n [key]: reader,\n },\n stats: {\n ...state.stats,\n [key]: fileStats,\n },\n };\n }\n case \"progress\": {\n const { key, progress } = action;\n return {\n ...state,\n stats: {\n ...state.stats,\n [key]: {\n ...state.stats[key],\n progress,\n },\n },\n };\n }\n case \"complete\": {\n const { key, result } = action;\n const file: CompletedFileUploadStats = {\n key,\n file: state.stats[key].file,\n status: \"complete\",\n result,\n progress: 100,\n };\n const { [key]: _reader, ...readers } = state.readers;\n\n return {\n ...state,\n readers,\n stats: {\n ...state.stats,\n [key]: file,\n },\n };\n }\n case \"clearErrors\":\n return { ...state, errors: [] };\n }\n },\n {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n }\n );\n const { stats, errors, readers } = state;\n\n const statsList = Object.values(stats);\n const totalFiles = statsList.length;\n const totalBytes = statsList.reduce(\n (result, { file: { size } }) => result + size,\n 0\n );\n const queueFiles = useCallback(\n (files: readonly File[]) => {\n const { pending, errors } = validateFiles(files, {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n });\n\n dispatch({ type: \"queue\", errors, files: pending });\n },\n [\n validateFiles,\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n ]\n );\n const onDrop = useCallback(\n (event: DragEvent<E>) => {\n propOnDrop(event);\n event.preventDefault();\n event.stopPropagation();\n\n try {\n const files = event.dataTransfer.files;\n if (files) {\n queueFiles(Array.from(files));\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnDrop]\n );\n const onChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n propOnChange(event);\n try {\n const files = event.currentTarget.files;\n if (files) {\n queueFiles(Array.from(files));\n } else {\n throw new Error();\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnChange]\n );\n\n const remove = useCallback(\n (keyOrKeys: string | readonly string[]) => {\n const files = typeof keyOrKeys === \"string\" ? [keyOrKeys] : keyOrKeys;\n files.forEach((fileKey) => {\n readers[fileKey]?.abort();\n });\n\n dispatch({ type: \"remove\", files });\n },\n [readers]\n );\n const reset = useCallback(() => {\n Object.values(readers).forEach((reader) => {\n reader.abort();\n });\n\n dispatch({ type: \"reset\" });\n }, [readers]);\n const clearErrors = useCallback(() => {\n dispatch({ type: \"clearErrors\" });\n }, []);\n const start = useCallback((key: string, reader: FileReader) => {\n dispatch({ type: \"start\", key, reader });\n }, []);\n const complete = useCallback(\n (key: string, result: FileReaderResult = null) => {\n dispatch({ type: \"complete\", key, result });\n },\n []\n );\n const createProgressEventHandler = useCallback(\n (key: string) => (event: ProgressEvent) => {\n if (event.lengthComputable) {\n const percentage = Math.round((event.loaded * 100) / event.total);\n dispatch({ type: \"progress\", key, progress: percentage });\n }\n },\n []\n );\n\n useEffect(() => {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n Object.values(stats).forEach((file) => {\n if (file.status === \"pending\") {\n pending.push(file);\n } else if (file.status === \"uploading\") {\n uploading.push(file);\n }\n });\n\n const lastIndex =\n concurrency === -1\n ? pending.length\n : Math.max(0, concurrency - uploading.length);\n const queue = pending.slice(0, lastIndex);\n if (!queue.length) {\n return;\n }\n\n queue.forEach((stats) => {\n const { key, file } = stats;\n const reader = new FileReader();\n\n // using `addEventListener` instead of directly setting to\n // `reader.progress`/`reader.load` so it's easier to test\n reader.addEventListener(\"progress\", createProgressEventHandler(key));\n reader.addEventListener(\"load\", () => {\n complete(key, reader.result);\n });\n\n start(key, reader);\n const parser = getFileParser(file);\n /* istanbul ignore next */\n if (\n process.env.NODE_ENV !== \"production\" &&\n ![\n \"readAsText\",\n \"readAsDataURL\",\n \"readAsArrayBuffer\",\n \"readAsBinaryString\",\n ].includes(parser)\n ) {\n throw new Error(\"Invalid file reader parser\");\n }\n\n reader[parser](file);\n });\n }, [\n concurrency,\n stats,\n getFileParser,\n createProgressEventHandler,\n start,\n complete,\n ]);\n\n let accept = \"\";\n if (extensions.length) {\n accept = extensions.reduce((s, ext) => `${s ? `${s},` : \"\"}.${ext}`, \"\");\n }\n\n return {\n stats: statsList,\n errors,\n accept,\n totalBytes,\n totalFiles,\n onDrop,\n onChange,\n reset,\n remove,\n clearErrors,\n };\n}\n"],"names":["nanoid","useCallback","useEffect","useReducer","FileAccessError","getFileParser","defaultGetFileParser","isValidFileName","defaultIsValidFileName","validateFiles","defaultValidateFiles","noop","EMPTY_LIST","EMPTY_OBJECT","useFileUpload","maxFiles","extensions","minFileSize","maxFileSize","totalFileSize","concurrency","onDrop","propOnDrop","onChange","propOnChange","state","dispatch","reducer","action","type","stats","errors","readers","key","files","includes","reduce","file","progress","status","reader","fileStats","result","_reader","statsList","Object","values","totalFiles","length","totalBytes","size","queueFiles","pending","event","preventDefault","stopPropagation","dataTransfer","Array","from","e","Error","message","undefined","currentTarget","remove","keyOrKeys","forEach","fileKey","abort","reset","clearErrors","start","complete","createProgressEventHandler","lengthComputable","percentage","Math","round","loaded","total","uploading","push","lastIndex","max","queue","slice","FileReader","addEventListener","parser","process","env","NODE_ENV","accept","s","ext"],"mappings":"AAAA;AACA,SAASA,MAAM,QAAQ,SAAS;AAChC,SACEC,WAAW,EACXC,SAAS,EACTC,UAAU,QAGL,QAAQ;AACf,SACEC,eAAe,EACfC,iBAAiBC,oBAAoB,EACrCC,mBAAmBC,sBAAsB,EACzCC,iBAAiBC,oBAAoB,QAUhC,iBAAiB;AAExB,MAAMC,OAAO;AACX,aAAa;AACf;AAqKA,cAAc,GACd,MAAMC,aAAa,EAAE;AACrB,cAAc,GACd,MAAMC,eAAe,CAAC;AAEtB;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASC,cAA0D,EACxEC,WAAW,CAAC,CAAC,EACbC,aAAaJ,UAAU,EACvBK,cAAc,CAAC,CAAC,EAChBC,cAAc,CAAC,CAAC,EAChBC,gBAAgB,CAAC,CAAC,EAClBC,cAAc,CAAC,CAAC,EAChBC,QAAQC,aAAaX,IAAI,EACzBY,UAAUC,eAAeb,IAAI,EAC7BF,gBAAgBC,oBAAoB,EACpCL,gBAAgBC,oBAAoB,EACpCC,kBAAkBC,sBAAsB,EACN,GAAG,CAAC,CAAC;IAGvC,MAAM,CAACiB,OAAOC,SAAS,GAAGvB,WACxB,SAASwB,QACPF,KAAuC,EACvCG,MAA2B;QAE3B,OAAQA,OAAOC,IAAI;YACjB,KAAK;gBACH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/DO,OAAO+C,gBAAgB,CAAC,QAAQ;gBAC9Bf,SAASvC,KAAKO,OAAOE,MAAM;YAC7B;YAEA6B,MAAMtC,KAAKO;YACX,MAAMgD,SAASnF,cAAcgC;YAC7B,wBAAwB,GACxB,IACEoD,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACzB,CAAC;gBACC;gBACA;gBACA;gBACA;aACD,CAACxD,QAAQ,CAACqD,SACX;gBACA,MAAM,IAAI5B,MAAM;YAClB;YAEApB,MAAM,CAACgD,OAAO,CAACnD;QACjB;IACF,GAAG;QACDjB;QACAU;QACAzB;QACAoE;QACAF;QACAC;KACD;IAED,IAAIoB,SAAS;IACb,IAAI5E,WAAWgC,MAAM,EAAE;QACrB4C,SAAS5E,WAAWoB,MAAM,CAAC,CAACyD,GAAGC,MAAQ,CAAC,EAAED,IAAI,CAAC,EAAEA,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,EAAEC,IAAI,CAAC,EAAE;IACvE;IAEA,OAAO;QACLhE,OAAOc;QACPb;QACA6D;QACA3C;QACAF;QACA1B;QACAE;QACA8C;QACAL;QACAM;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/useFormReset.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, type RefObject } from \"react\";\nimport {\n triggerManualChangeEvent,\n type ChangeableHTMLElement,\n} from \"./utils.js\";\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface FormResetOptions {\n form?: string;\n elementRef: RefObject<ChangeableHTMLElement>;\n defaultValue: string;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function useFormReset(options: FormResetOptions): void {\n const { form, elementRef, defaultValue } = options;\n\n useEffect(() => {\n const element = elementRef.current;\n if (!element) {\n return;\n }\n\n const formElement =\n (form && document.getElementById(form)) ||\n element.closest<HTMLFormElement>(\"form\") ||\n null;\n if (!formElement) {\n return;\n }\n\n const handleReset = (): void => {\n triggerManualChangeEvent(element, defaultValue);\n };\n\n formElement.addEventListener(\"reset\", handleReset);\n return () => {\n formElement.removeEventListener(\"reset\", handleReset);\n };\n }, [defaultValue, elementRef, form]);\n}\n"],"names":["useEffect","triggerManualChangeEvent","useFormReset","options","form","elementRef","defaultValue","element","current","formElement","document","getElementById","closest","handleReset","addEventListener","removeEventListener"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,SAAS,QAAwB,QAAQ;AAClD,SACEC,wBAAwB,QAEnB,aAAa;AAYpB;;;CAGC,GACD,OAAO,SAASC,aAAaC,OAAyB;IACpD,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAEC,YAAY,EAAE,GAAGH;IAE3CH,UAAU;QACR,MAAMO,UAAUF,WAAWG,OAAO;QAClC,IAAI,CAACD,SAAS;YACZ;QACF;QAEA,MAAME,cACJ,AAACL,QAAQM,SAASC,cAAc,CAACP,SACjCG,QAAQK,OAAO,CAAkB,WACjC;QACF,IAAI,CAACH,aAAa;YAChB;QACF;QAEA,MAAMI,cAAc;YAClBZ,yBAAyBM,SAASD;QACpC;QAEAG,YAAYK,gBAAgB,CAAC,SAASD;QACtC,OAAO;YACLJ,YAAYM,mBAAmB,CAAC,SAASF;QAC3C;IACF,GAAG;QAACP;QAAcD;QAAYD;KAAK;AACrC"}
1
+ {"version":3,"sources":["../../src/form/useFormReset.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, type RefObject } from \"react\";\nimport {\n triggerManualChangeEvent,\n type ChangeableHTMLElement,\n} from \"./utils.js\";\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface FormResetOptions {\n form?: string;\n elementRef: RefObject<ChangeableHTMLElement>;\n defaultValue: string;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function useFormReset(options: FormResetOptions): void {\n const { form, elementRef, defaultValue } = options;\n\n useEffect(() => {\n const element = elementRef.current;\n if (!element) {\n return;\n }\n\n const formElement =\n (form && document.getElementById(form)) ||\n element.closest<HTMLFormElement>(\"form\") ||\n null;\n if (!formElement) {\n return;\n }\n\n const handleReset = (): void => {\n triggerManualChangeEvent(element, defaultValue);\n };\n\n formElement.addEventListener(\"reset\", handleReset);\n return () => {\n formElement.removeEventListener(\"reset\", handleReset);\n };\n }, [defaultValue, elementRef, form]);\n}\n"],"names":["useEffect","triggerManualChangeEvent","useFormReset","options","form","elementRef","defaultValue","element","current","formElement","document","getElementById","closest","handleReset","addEventListener","removeEventListener"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAwB,QAAQ;AAClD,SACEC,wBAAwB,QAEnB,aAAa;AAYpB;;;CAGC,GACD,OAAO,SAASC,aAAaC,OAAyB;IACpD,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAEC,YAAY,EAAE,GAAGH;IAE3CH,UAAU;QACR,MAAMO,UAAUF,WAAWG,OAAO;QAClC,IAAI,CAACD,SAAS;YACZ;QACF;QAEA,MAAME,cACJ,AAACL,QAAQM,SAASC,cAAc,CAACP,SACjCG,QAAQK,OAAO,CAAkB,WACjC;QACF,IAAI,CAACH,aAAa;YAChB;QACF;QAEA,MAAMI,cAAc;YAClBZ,yBAAyBM,SAASD;QACpC;QAEAG,YAAYK,gBAAgB,CAAC,SAASD;QACtC,OAAO;YACLJ,YAAYM,mBAAmB,CAAC,SAASF;QAC3C;IACF,GAAG;QAACP;QAAcD;QAAYD;KAAK;AACrC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/useListboxProvider.ts"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type RefObject } from \"react\";\nimport { type ChangeableHTMLElement } from \"./utils.js\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface ListboxContext {\n /**\n * This ref is used to trigger the change event when an option is clicked.\n */\n inputRef: RefObject<ChangeableHTMLElement>;\n\n /**\n * This is used within the `Option` component to determine if it is currently\n * selected or not.\n */\n currentValue: string | number | null;\n\n selectedIconAfter: boolean;\n disableSelectedIcon: boolean;\n}\n\nconst context = createContext<ListboxContext | null>(null);\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 6.0.0\n */\nexport const { Provider: ListboxProvider } = context;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function useListboxContext(): ListboxContext {\n const value = useContext(context);\n if (!value) {\n throw new Error(\"The `ListboxProvider` must be a parent component\");\n }\n return value;\n}\n"],"names":["createContext","useContext","context","Provider","ListboxProvider","useListboxContext","value","Error"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAwB,QAAQ;AAuBlE,MAAMC,UAAUF,cAAqC;AAErD;;;;;CAKC,GACD,OAAO,MAAM,EAAEG,UAAUC,eAAe,EAAE,GAAGF,QAAQ;AAErD;;;CAGC,GACD,OAAO,SAASG;IACd,MAAMC,QAAQL,WAAWC;IACzB,IAAI,CAACI,OAAO;QACV,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOD;AACT"}
1
+ {"version":3,"sources":["../../src/form/useListboxProvider.ts"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type RefObject } from \"react\";\nimport { type ChangeableHTMLElement } from \"./utils.js\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface ListboxContext {\n /**\n * This ref is used to trigger the change event when an option is clicked.\n */\n inputRef: RefObject<ChangeableHTMLElement>;\n\n /**\n * This is used within the `Option` component to determine if it is currently\n * selected or not.\n */\n currentValue: string | number | null;\n\n selectedIconAfter: boolean;\n disableSelectedIcon: boolean;\n}\n\nconst context = createContext<ListboxContext | null>(null);\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 6.0.0\n */\nexport const { Provider: ListboxProvider } = context;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function useListboxContext(): ListboxContext {\n const value = useContext(context);\n if (!value) {\n throw new Error(\"The `ListboxProvider` must be a parent component\");\n }\n return value;\n}\n"],"names":["createContext","useContext","context","Provider","ListboxProvider","useListboxContext","value","Error"],"mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAwB,QAAQ;AAuBlE,MAAMC,UAAUF,cAAqC;AAErD;;;;;CAKC,GACD,OAAO,MAAM,EAAEG,UAAUC,eAAe,EAAE,GAAGF,QAAQ;AAErD;;;CAGC,GACD,OAAO,SAASG;IACd,MAAMC,QAAQL,WAAWC;IACzB,IAAI,CAACI,OAAO;QACV,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOD;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/useNumberField.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { withinRange } from \"../utils/withinRange.js\";\nimport {\n useTextField,\n type ProvidedTextFieldMessageProps,\n type ProvidedTextFieldProps,\n type TextFieldHookOptions,\n type TextFieldHookState,\n type TextFieldImplementation,\n type ValidatedTextFieldImplementation,\n} from \"./useTextField.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 2.5.0 */\nexport interface NumberFieldConstraints {\n /**\n * An optional min value for the number field.\n */\n min?: number;\n\n /**\n * An optional max value for the number field.\n */\n max?: number;\n\n /**\n * An optional step amount to use.\n *\n * Note: The `min` and `max` values must be divisible by this value when any\n * are defined.\n */\n step?: number;\n}\n\n/**\n * @since 2.5.0\n * @since 6.0.0\n * - Removed `updateOnChange` in favor of `updateValue`\n * - Renamed `fixOnBlur` to `updateValueOnBlur`\n */\nexport interface NumberFieldHookOptions\n extends Omit<\n TextFieldHookOptions<HTMLInputElement>,\n \"defaultValue\" | \"isNumber\"\n >,\n NumberFieldConstraints {\n /**\n * @defaultValue `undefined`\n */\n defaultValue?: UseStateInitializer<number>;\n\n /**\n * This controls the behavior for the `value` returned by this hook. If you\n * need access to the current value immediately as the user types to update\n * other components, keep this as the default of `\"change\"`. Otherwise, set\n * this to `\"blur\"`.\n *\n * @example Deferring Updates on Blur\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * updateValue: \"blur\",\n * });\n *\n * const result = useMemo(() => someExpensiveComputation(value), [value]);\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @defaultValue `\"change\"`\n */\n updateValue?: \"blur\" | \"change\";\n\n /**\n * This option is used to update the `number` value and text field value to be\n * within the `min` and `max` range or just format the text field value when\n * the input is blurred. This update will only be applied if the text field\n * contains a valid number. Using `min = 0` and `max = 10`:\n *\n * | text value | updated value |\n * | ---------- | ------------- |\n * | 000001 | 1 |\n * | -1 | 0 |\n * | 20 | 10 |\n * | -12 | 0 |\n * | --1 | --1 |\n * | fjdka | fjdka |\n *\n *\n * Set this to `false` if no changed should be applied and force the user to\n * fix any min/max errors manually and maintain weird formatting.\n *\n * @defaultValue `true`\n * @since 6.0.0 This was renamed from `fixOnBlur` and removed the\n * `\"min\"` and `\"max\"` behavior.\n */\n updateValueOnBlur?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface NumberFieldHookState\n extends Omit<TextFieldHookState, \"value\"> {\n value: number | undefined;\n}\n\n/** @since 2.5.6 */\nexport interface ProvidedNumberFieldProps\n extends ProvidedTextFieldProps<HTMLInputElement>,\n NumberFieldConstraints {\n type: \"number\";\n}\n\n/** @since 2.5.6 */\nexport interface ProvidedNumberFieldMessageProps\n extends ProvidedTextFieldMessageProps<HTMLInputElement>,\n NumberFieldConstraints {\n type: \"number\";\n}\n\n/** @since 6.0.0 */\nexport interface NumberFieldImplementation\n extends Omit<\n TextFieldImplementation<HTMLInputElement>,\n \"value\" | \"setState\"\n > {\n value: number | undefined;\n setState: UseStateSetter<NumberFieldHookState>;\n fieldProps: ProvidedNumberFieldProps;\n}\n\n/** @since 6.0.0 */\nexport interface NumberFieldWithMessageImplementation\n extends NumberFieldImplementation {\n fieldProps: ProvidedNumberFieldMessageProps;\n}\n\n/** @since 6.0.0 */\nexport interface ValidatedNumberFieldImplementation\n extends Omit<\n ValidatedTextFieldImplementation<HTMLInputElement>,\n \"value\" | \"setState\"\n > {\n value: number | undefined;\n setState: UseStateSetter<NumberFieldHookState>;\n fieldProps: ProvidedNumberFieldProps | ProvidedNumberFieldMessageProps;\n}\n\n/**\n * @example Enforce Number Value and No Error Messages\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * disableMessage: true,\n * });\n *\n * // this is safe since `value` will always be a number even if there is a\n * // validation error. since the min and max options were provided as well,\n * // number will be between that range as well.\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n * ```\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & {\n disableMessage: true;\n defaultValue: UseStateInitializer<number>;\n }\n): NumberFieldImplementation & {\n value: number;\n setState: UseStateSetter<NumberFieldHookState & { value: number }>;\n};\n\n/**\n * @example No Error Messages\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * disableMessage: true,\n * });\n *\n * // `value` will be `undefined` until the user enters a valid value once\n * // there is a valid value, `value` will be a `number`. So this might cause\n * // `computed` to be `NaN | number`\n * //\n * // const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & { disableMessage: true }\n): NumberFieldImplementation;\n\n/**\n * @example Enforce Number Value\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * });\n *\n * // this is safe since `value` will always be a number even if there is a\n * // validation error. since the min and max options were provided as well,\n * // number will be between that range as well.\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @example Enforce Number Value and Deferring Updates\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * updateValue: \"blur\",\n * });\n *\n * // the `value` will only be updated whenever the `TextField` is blurred.\n * // This is helpful if the `value` is used in expensive computations or\n * // updates that do not need to be updated as the user types\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & {\n defaultValue: UseStateInitializer<number>;\n }\n): NumberFieldWithMessageImplementation & {\n value: number;\n setState: UseStateSetter<NumberFieldHookState & { value: number }>;\n};\n\n/**\n * The `useNumberField` hook is used to control the state of a `TextField` or\n * `<input type=\"number\">`\n *\n * @example Default Implementation\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * name: \"someName\",\n * });\n *\n * // `value` will be `undefined` until the user enters a valid value once\n * // there is a valid value, `value` will be a `number`. So this might cause\n * // `computed` to be `NaN | number`\n * //\n * // const computed = value * 10;\n *\n * // whenever there is an error, an error message will be displayed below the\n * // `TextField`\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @example Adding Constraints\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * name: \"someName\",\n * min: 0,\n * max: 100,\n * step: 2,\n * required: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * @see {@link useTextField}\n */\nexport function useNumberField(\n options: NumberFieldHookOptions\n): NumberFieldWithMessageImplementation;\n\n/**\n * @internal\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions\n): ValidatedNumberFieldImplementation {\n const {\n min,\n max,\n step,\n onBlur = noop,\n onChange = noop,\n updateValue = \"change\",\n updateValueOnBlur = true,\n defaultValue,\n ...textOptions\n } = options;\n\n const [number, setNumber] = useState(defaultValue);\n const initial = useRef(number);\n const {\n value: _value,\n reset: resetTextField,\n fieldProps,\n setState: setTextFieldState,\n ...remaining\n } = useTextField({\n ...textOptions,\n isNumber: true,\n defaultValue: `${number ?? \"\"}`,\n onBlur(event) {\n onBlur(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n const input = event.currentTarget;\n input.setCustomValidity(\"\");\n input.checkValidity();\n if (\n !updateValueOnBlur ||\n // do nothing else since it's a weird value like: `\"--0\"` which causes\n // the value to be `\"\"` and `numberAsValue` to be `NaN`\n input.validity.badInput\n ) {\n return;\n }\n\n let value = input.valueAsNumber;\n if (input.value === \"\" && typeof initial.current === \"number\") {\n value = min ?? initial.current;\n }\n\n // can't have both rangeUnderflow and rangeOverflow at the same time, so\n // it's \"safe\" to always provide both\n value = withinRange({ min, max, value });\n if (!Number.isNaN(value)) {\n setNumber(value);\n input.value = `${value}`;\n } else if (typeof initial.current === \"undefined\") {\n setNumber(undefined);\n }\n },\n onChange(event) {\n onChange(event);\n if (event.isPropagationStopped() || updateValue === \"blur\") {\n return;\n }\n\n const input = event.currentTarget;\n input.checkValidity();\n const value = withinRange({\n min,\n max,\n value: event.currentTarget.valueAsNumber,\n });\n if (\n !input.validity.valid &&\n !input.validity.rangeUnderflow &&\n !input.validity.rangeOverflow\n ) {\n return;\n }\n\n if (!Number.isNaN(value)) {\n setNumber(value);\n } else if (initial.current === undefined) {\n setNumber(undefined);\n }\n },\n });\n\n const reset = useCallback(() => {\n resetTextField();\n setNumber(initial.current);\n }, [resetTextField]);\n const setState = useCallback<UseStateSetter<NumberFieldHookState>>(\n (nextState) => {\n if (typeof nextState === \"function\") {\n setNumber((prevNumber) => {\n let nextNumber: number | undefined = prevNumber;\n setTextFieldState((prevState) => {\n const updated = nextState({\n ...prevState,\n value: prevNumber,\n });\n\n nextNumber = updated.value;\n\n return {\n ...updated,\n value: `${nextNumber ?? \"\"}`,\n };\n });\n\n return nextNumber;\n });\n return;\n }\n\n const { value, error, errorMessage } = nextState;\n setNumber(value);\n setTextFieldState({\n value: `${value ?? \"\"}`,\n error,\n errorMessage,\n });\n },\n [setTextFieldState]\n );\n\n return {\n ...remaining,\n reset,\n value: number,\n setState,\n fieldProps: {\n ...fieldProps,\n min,\n max,\n step,\n type: \"number\",\n },\n };\n}\n"],"names":["useCallback","useRef","useState","withinRange","useTextField","noop","useNumberField","options","min","max","step","onBlur","onChange","updateValue","updateValueOnBlur","defaultValue","textOptions","number","setNumber","initial","value","_value","reset","resetTextField","fieldProps","setState","setTextFieldState","remaining","isNumber","event","isPropagationStopped","input","currentTarget","setCustomValidity","checkValidity","validity","badInput","valueAsNumber","current","Number","isNaN","undefined","valid","rangeUnderflow","rangeOverflow","nextState","prevNumber","nextNumber","prevState","updated","error","errorMessage","type"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAEtD,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SACE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Q;QACAD,YAAY;YACV,GAAGA,UAAU;YACbhB;YACAC;YACAC;YACA0C,MAAM;QACR;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/form/useNumberField.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { withinRange } from \"../utils/withinRange.js\";\nimport {\n useTextField,\n type ProvidedTextFieldMessageProps,\n type ProvidedTextFieldProps,\n type TextFieldHookOptions,\n type TextFieldHookState,\n type TextFieldImplementation,\n type ValidatedTextFieldImplementation,\n} from \"./useTextField.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 2.5.0 */\nexport interface NumberFieldConstraints {\n /**\n * An optional min value for the number field.\n */\n min?: number;\n\n /**\n * An optional max value for the number field.\n */\n max?: number;\n\n /**\n * An optional step amount to use.\n *\n * Note: The `min` and `max` values must be divisible by this value when any\n * are defined.\n */\n step?: number;\n}\n\n/**\n * @since 2.5.0\n * @since 6.0.0\n * - Removed `updateOnChange` in favor of `updateValue`\n * - Renamed `fixOnBlur` to `updateValueOnBlur`\n */\nexport interface NumberFieldHookOptions\n extends Omit<\n TextFieldHookOptions<HTMLInputElement>,\n \"defaultValue\" | \"isNumber\"\n >,\n NumberFieldConstraints {\n /**\n * @defaultValue `undefined`\n */\n defaultValue?: UseStateInitializer<number>;\n\n /**\n * This controls the behavior for the `value` returned by this hook. If you\n * need access to the current value immediately as the user types to update\n * other components, keep this as the default of `\"change\"`. Otherwise, set\n * this to `\"blur\"`.\n *\n * @example Deferring Updates on Blur\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * updateValue: \"blur\",\n * });\n *\n * const result = useMemo(() => someExpensiveComputation(value), [value]);\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @defaultValue `\"change\"`\n */\n updateValue?: \"blur\" | \"change\";\n\n /**\n * This option is used to update the `number` value and text field value to be\n * within the `min` and `max` range or just format the text field value when\n * the input is blurred. This update will only be applied if the text field\n * contains a valid number. Using `min = 0` and `max = 10`:\n *\n * | text value | updated value |\n * | ---------- | ------------- |\n * | 000001 | 1 |\n * | -1 | 0 |\n * | 20 | 10 |\n * | -12 | 0 |\n * | --1 | --1 |\n * | fjdka | fjdka |\n *\n *\n * Set this to `false` if no changed should be applied and force the user to\n * fix any min/max errors manually and maintain weird formatting.\n *\n * @defaultValue `true`\n * @since 6.0.0 This was renamed from `fixOnBlur` and removed the\n * `\"min\"` and `\"max\"` behavior.\n */\n updateValueOnBlur?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface NumberFieldHookState\n extends Omit<TextFieldHookState, \"value\"> {\n value: number | undefined;\n}\n\n/** @since 2.5.6 */\nexport interface ProvidedNumberFieldProps\n extends ProvidedTextFieldProps<HTMLInputElement>,\n NumberFieldConstraints {\n type: \"number\";\n}\n\n/** @since 2.5.6 */\nexport interface ProvidedNumberFieldMessageProps\n extends ProvidedTextFieldMessageProps<HTMLInputElement>,\n NumberFieldConstraints {\n type: \"number\";\n}\n\n/** @since 6.0.0 */\nexport interface NumberFieldImplementation\n extends Omit<\n TextFieldImplementation<HTMLInputElement>,\n \"value\" | \"setState\"\n > {\n value: number | undefined;\n setState: UseStateSetter<NumberFieldHookState>;\n fieldProps: ProvidedNumberFieldProps;\n}\n\n/** @since 6.0.0 */\nexport interface NumberFieldWithMessageImplementation\n extends NumberFieldImplementation {\n fieldProps: ProvidedNumberFieldMessageProps;\n}\n\n/** @since 6.0.0 */\nexport interface ValidatedNumberFieldImplementation\n extends Omit<\n ValidatedTextFieldImplementation<HTMLInputElement>,\n \"value\" | \"setState\"\n > {\n value: number | undefined;\n setState: UseStateSetter<NumberFieldHookState>;\n fieldProps: ProvidedNumberFieldProps | ProvidedNumberFieldMessageProps;\n}\n\n/**\n * @example Enforce Number Value and No Error Messages\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * disableMessage: true,\n * });\n *\n * // this is safe since `value` will always be a number even if there is a\n * // validation error. since the min and max options were provided as well,\n * // number will be between that range as well.\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n * ```\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & {\n disableMessage: true;\n defaultValue: UseStateInitializer<number>;\n }\n): NumberFieldImplementation & {\n value: number;\n setState: UseStateSetter<NumberFieldHookState & { value: number }>;\n};\n\n/**\n * @example No Error Messages\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * disableMessage: true,\n * });\n *\n * // `value` will be `undefined` until the user enters a valid value once\n * // there is a valid value, `value` will be a `number`. So this might cause\n * // `computed` to be `NaN | number`\n * //\n * // const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & { disableMessage: true }\n): NumberFieldImplementation;\n\n/**\n * @example Enforce Number Value\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * });\n *\n * // this is safe since `value` will always be a number even if there is a\n * // validation error. since the min and max options were provided as well,\n * // number will be between that range as well.\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @example Enforce Number Value and Deferring Updates\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * updateValue: \"blur\",\n * });\n *\n * // the `value` will only be updated whenever the `TextField` is blurred.\n * // This is helpful if the `value` is used in expensive computations or\n * // updates that do not need to be updated as the user types\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & {\n defaultValue: UseStateInitializer<number>;\n }\n): NumberFieldWithMessageImplementation & {\n value: number;\n setState: UseStateSetter<NumberFieldHookState & { value: number }>;\n};\n\n/**\n * The `useNumberField` hook is used to control the state of a `TextField` or\n * `<input type=\"number\">`\n *\n * @example Default Implementation\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * name: \"someName\",\n * });\n *\n * // `value` will be `undefined` until the user enters a valid value once\n * // there is a valid value, `value` will be a `number`. So this might cause\n * // `computed` to be `NaN | number`\n * //\n * // const computed = value * 10;\n *\n * // whenever there is an error, an error message will be displayed below the\n * // `TextField`\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @example Adding Constraints\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * name: \"someName\",\n * min: 0,\n * max: 100,\n * step: 2,\n * required: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * @see {@link useTextField}\n */\nexport function useNumberField(\n options: NumberFieldHookOptions\n): NumberFieldWithMessageImplementation;\n\n/**\n * @internal\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions\n): ValidatedNumberFieldImplementation {\n const {\n min,\n max,\n step,\n onBlur = noop,\n onChange = noop,\n updateValue = \"change\",\n updateValueOnBlur = true,\n defaultValue,\n ...textOptions\n } = options;\n\n const [number, setNumber] = useState(defaultValue);\n const initial = useRef(number);\n const {\n value: _value,\n reset: resetTextField,\n fieldProps,\n setState: setTextFieldState,\n ...remaining\n } = useTextField({\n ...textOptions,\n isNumber: true,\n defaultValue: `${number ?? \"\"}`,\n onBlur(event) {\n onBlur(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n const input = event.currentTarget;\n input.setCustomValidity(\"\");\n input.checkValidity();\n if (\n !updateValueOnBlur ||\n // do nothing else since it's a weird value like: `\"--0\"` which causes\n // the value to be `\"\"` and `numberAsValue` to be `NaN`\n input.validity.badInput\n ) {\n return;\n }\n\n let value = input.valueAsNumber;\n if (input.value === \"\" && typeof initial.current === \"number\") {\n value = min ?? initial.current;\n }\n\n // can't have both rangeUnderflow and rangeOverflow at the same time, so\n // it's \"safe\" to always provide both\n value = withinRange({ min, max, value });\n if (!Number.isNaN(value)) {\n setNumber(value);\n input.value = `${value}`;\n } else if (typeof initial.current === \"undefined\") {\n setNumber(undefined);\n }\n },\n onChange(event) {\n onChange(event);\n if (event.isPropagationStopped() || updateValue === \"blur\") {\n return;\n }\n\n const input = event.currentTarget;\n input.checkValidity();\n const value = withinRange({\n min,\n max,\n value: event.currentTarget.valueAsNumber,\n });\n if (\n !input.validity.valid &&\n !input.validity.rangeUnderflow &&\n !input.validity.rangeOverflow\n ) {\n return;\n }\n\n if (!Number.isNaN(value)) {\n setNumber(value);\n } else if (initial.current === undefined) {\n setNumber(undefined);\n }\n },\n });\n\n const reset = useCallback(() => {\n resetTextField();\n setNumber(initial.current);\n }, [resetTextField]);\n const setState = useCallback<UseStateSetter<NumberFieldHookState>>(\n (nextState) => {\n if (typeof nextState === \"function\") {\n setNumber((prevNumber) => {\n let nextNumber: number | undefined = prevNumber;\n setTextFieldState((prevState) => {\n const updated = nextState({\n ...prevState,\n value: prevNumber,\n });\n\n nextNumber = updated.value;\n\n return {\n ...updated,\n value: `${nextNumber ?? \"\"}`,\n };\n });\n\n return nextNumber;\n });\n return;\n }\n\n const { value, error, errorMessage } = nextState;\n setNumber(value);\n setTextFieldState({\n value: `${value ?? \"\"}`,\n error,\n errorMessage,\n });\n },\n [setTextFieldState]\n );\n\n return {\n ...remaining,\n reset,\n value: number,\n setState,\n fieldProps: {\n ...fieldProps,\n min,\n max,\n step,\n type: \"number\",\n },\n };\n}\n"],"names":["useCallback","useRef","useState","withinRange","useTextField","noop","useNumberField","options","min","max","step","onBlur","onChange","updateValue","updateValueOnBlur","defaultValue","textOptions","number","setNumber","initial","value","_value","reset","resetTextField","fieldProps","setState","setTextFieldState","remaining","isNumber","event","isPropagationStopped","input","currentTarget","setCustomValidity","checkValidity","validity","badInput","valueAsNumber","current","Number","isNaN","undefined","valid","rangeUnderflow","rangeOverflow","nextState","prevNumber","nextNumber","prevState","updated","error","errorMessage","type"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAEtD,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SACEC,YAAY,QAOP,oBAAoB;AAE3B,MAAMC,OAAO;AACX,aAAa;AACf;AAiUA;;;;CAIC,GACD,OAAO,SAASC,eACdC,OAA+B;IAE/B,MAAM,EACJC,GAAG,EACHC,GAAG,EACHC,IAAI,EACJC,SAASN,IAAI,EACbO,WAAWP,IAAI,EACfQ,cAAc,QAAQ,EACtBC,oBAAoB,IAAI,EACxBC,YAAY,EACZ,GAAGC,aACJ,GAAGT;IAEJ,MAAM,CAACU,QAAQC,UAAU,GAAGhB,SAASa;I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