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

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 (1511) hide show
  1. package/.turbo/turbo-build.log +22 -22
  2. package/CHANGELOG.md +30 -0
  3. package/coverage/clover.xml +255 -3
  4. package/coverage/coverage-final.json +5 -1
  5. package/coverage/lcov-report/DefaultNavigationRenderer.tsx.html +298 -0
  6. package/coverage/lcov-report/Navigation.tsx.html +358 -0
  7. package/coverage/lcov-report/app-bar/AppBar.tsx.html +125 -134
  8. package/coverage/lcov-report/app-bar/AppBarTitle.tsx.html +54 -75
  9. package/coverage/lcov-report/app-bar/index.html +24 -9
  10. package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +34 -181
  11. package/coverage/lcov-report/autocomplete/AutocompleteGeneric.tsx.html +1 -1
  12. package/coverage/lcov-report/autocomplete/index.html +11 -11
  13. package/coverage/lcov-report/autocomplete/useAutocomplete.ts.html +102 -336
  14. package/coverage/lcov-report/autocomplete/useAutocompleteAgain.ts.html +1 -1
  15. package/coverage/lcov-report/autocomplete/useAutocompletev2.ts.html +1 -1
  16. package/coverage/lcov-report/autocomplete/useInlineAutocomplete.ts.html +31 -7
  17. package/coverage/lcov-report/autocomplete/useInlineSelection.ts.html +67 -4
  18. package/coverage/lcov-report/autocomplete/utils.ts.html +1 -1
  19. package/coverage/lcov-report/box/Box.tsx.html +115 -103
  20. package/coverage/lcov-report/box/index.html +22 -7
  21. package/coverage/lcov-report/box/styles.ts.html +622 -0
  22. package/coverage/lcov-report/button/Button.tsx.html +93 -105
  23. package/coverage/lcov-report/button/TooltippedButton.tsx.html +55 -67
  24. package/coverage/lcov-report/button/index.html +10 -10
  25. package/coverage/lcov-report/form/Form.tsx.html +18 -18
  26. package/coverage/lcov-report/form/Radio.tsx.html +8 -14
  27. package/coverage/lcov-report/form/index.html +35 -95
  28. package/coverage/lcov-report/form/useRadioGroup.ts.html +68 -80
  29. package/coverage/lcov-report/getHrefFromParents.ts.html +133 -0
  30. package/coverage/lcov-report/icon/FontIcon.tsx.html +65 -65
  31. package/coverage/lcov-report/icon/index.html +19 -19
  32. package/coverage/lcov-report/index.html +41 -11
  33. package/coverage/lcov-report/layout/LayoutNav.tsx.html +74 -86
  34. package/coverage/lcov-report/layout/Main.tsx.html +47 -38
  35. package/coverage/lcov-report/layout/index.html +54 -9
  36. package/coverage/lcov-report/layout/useExpandableLayout.ts.html +275 -89
  37. package/coverage/lcov-report/layout/useHorizontalLayoutTransition.ts.html +18 -18
  38. package/coverage/lcov-report/media-queries/AppSizeProvider.tsx.html +79 -64
  39. package/coverage/lcov-report/media-queries/index.html +18 -18
  40. package/coverage/lcov-report/navigation/CollapsibleNavGroup.tsx.html +334 -0
  41. package/coverage/lcov-report/navigation/DefaultNavigationRenderer.tsx.html +298 -0
  42. package/coverage/lcov-report/navigation/NavGroup.tsx.html +193 -0
  43. package/coverage/lcov-report/navigation/NavItem.tsx.html +160 -0
  44. package/coverage/lcov-report/navigation/NavItemButton.tsx.html +397 -0
  45. package/coverage/lcov-report/navigation/NavItemLink.tsx.html +574 -0
  46. package/coverage/lcov-report/navigation/NavSubheader.tsx.html +184 -0
  47. package/coverage/lcov-report/navigation/Navigation.tsx.html +358 -0
  48. package/coverage/lcov-report/navigation/getHrefFromParents.ts.html +130 -0
  49. package/coverage/lcov-report/navigation/index.html +146 -0
  50. package/coverage/lcov-report/navigation/navGroupStyles.ts.html +148 -0
  51. package/coverage/lcov-report/navigation/navItemStyles.ts.html +298 -0
  52. package/coverage/lcov-report/sheet/Sheet.tsx.html +50 -56
  53. package/coverage/lcov-report/sheet/index.html +8 -8
  54. package/coverage/lcov-report/snackbar/DefaultToastRenderer.tsx.html +307 -304
  55. package/coverage/lcov-report/snackbar/ToastManager.tsx.html +377 -356
  56. package/coverage/lcov-report/snackbar/index.html +16 -106
  57. package/coverage/lcov-report/src/autocomplete/Autocomplete.tsx.html +56 -92
  58. package/coverage/lcov-report/src/autocomplete/AutocompleteGeneric.tsx.html +1 -1
  59. package/coverage/lcov-report/src/autocomplete/index.html +11 -11
  60. package/coverage/lcov-report/src/autocomplete/useAutocomplete.ts.html +513 -111
  61. package/coverage/lcov-report/src/autocomplete/useAutocompleteAgain.ts.html +7 -7
  62. package/coverage/lcov-report/src/autocomplete/useAutocompletev2.ts.html +1 -1
  63. package/coverage/lcov-report/src/autocomplete/useInlineAutocomplete.ts.html +32 -8
  64. package/coverage/lcov-report/src/autocomplete/useInlineSelection.ts.html +146 -14
  65. package/coverage/lcov-report/src/autocomplete/utils.ts.html +1 -1
  66. package/coverage/lcov-report/src/divider/Divider.tsx.html +6 -9
  67. package/coverage/lcov-report/src/divider/index.html +8 -23
  68. package/coverage/lcov-report/src/icon/FontIcon.tsx.html +29 -29
  69. package/coverage/lcov-report/src/icon/index.html +1 -1
  70. package/coverage/lcov-report/src/index.html +21 -21
  71. package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +33 -42
  72. package/coverage/lcov-report/src/layout/Main.tsx.html +33 -36
  73. package/coverage/lcov-report/src/layout/index.html +15 -195
  74. package/coverage/lcov-report/src/layout/useLayoutAppBarHeight.ts.html +37 -46
  75. package/coverage/lcov-report/src/list/List.tsx.html +39 -42
  76. package/coverage/lcov-report/src/list/index.html +10 -130
  77. package/coverage/lcov-report/src/navigation/CollapsibleNavGroup.tsx.html +367 -0
  78. package/coverage/lcov-report/src/navigation/DefaultNavigationRenderer.tsx.html +325 -0
  79. package/coverage/lcov-report/src/navigation/NavGroup.tsx.html +202 -0
  80. package/coverage/lcov-report/src/navigation/NavItem.tsx.html +172 -0
  81. package/coverage/lcov-report/src/navigation/NavSubheader.tsx.html +193 -0
  82. package/coverage/lcov-report/src/navigation/Navigation.tsx.html +358 -0
  83. package/coverage/lcov-report/src/navigation/index.html +191 -0
  84. package/coverage/lcov-report/src/tree/Tree.tsx.html +12 -24
  85. package/coverage/lcov-report/src/tree/index.html +18 -18
  86. package/coverage/lcov-report/src/useElementSize.ts.html +115 -40
  87. package/coverage/lcov-report/src/useMutationObserver.ts.html +310 -0
  88. package/coverage/lcov-report/src/utils/RenderRecursively.tsx.html +151 -52
  89. package/coverage/lcov-report/src/utils/index.html +10 -10
  90. package/coverage/lcov-report/test-utils/index.html +21 -21
  91. package/coverage/lcov-report/test-utils/matchMedia.ts.html +98 -95
  92. package/coverage/lcov-report/transition/config.ts.html +7 -7
  93. package/coverage/lcov-report/transition/index.html +1 -1
  94. package/coverage/lcov-report/useExpandableLayout.ts.html +171 -105
  95. package/coverage/lcov-report/useMutationObserver.ts.html +310 -0
  96. package/coverage/lcov-report/utils/index.html +16 -16
  97. package/coverage/lcov-report/utils/isElementVisible.ts.html +21 -24
  98. package/coverage/lcov.info +302 -0
  99. package/dist/CoreProviders.d.ts +3 -3
  100. package/dist/CoreProviders.js +1 -1
  101. package/dist/CoreProviders.js.map +1 -1
  102. package/dist/NoSsr.d.ts +3 -4
  103. package/dist/NoSsr.js +2 -3
  104. package/dist/NoSsr.js.map +1 -1
  105. package/dist/RootHtml.d.ts +3 -4
  106. package/dist/RootHtml.js +2 -3
  107. package/dist/RootHtml.js.map +1 -1
  108. package/dist/SsrProvider.d.ts +3 -3
  109. package/dist/SsrProvider.js +2 -2
  110. package/dist/SsrProvider.js.map +1 -1
  111. package/dist/_core.scss +5 -0
  112. package/dist/app-bar/AppBar.d.ts +11 -14
  113. package/dist/app-bar/AppBar.js +3 -5
  114. package/dist/app-bar/AppBar.js.map +1 -1
  115. package/dist/app-bar/AppBarTitle.d.ts +7 -9
  116. package/dist/app-bar/AppBarTitle.js +4 -6
  117. package/dist/app-bar/AppBarTitle.js.map +1 -1
  118. package/dist/avatar/Avatar.d.ts +5 -6
  119. package/dist/avatar/Avatar.js +2 -3
  120. package/dist/avatar/Avatar.js.map +1 -1
  121. package/dist/avatar/styles.d.ts +4 -4
  122. package/dist/avatar/styles.js +2 -2
  123. package/dist/avatar/styles.js.map +1 -1
  124. package/dist/badge/Badge.d.ts +4 -6
  125. package/dist/badge/Badge.js +3 -5
  126. package/dist/badge/Badge.js.map +1 -1
  127. package/dist/box/Box.d.ts +6 -9
  128. package/dist/box/Box.js +14 -9
  129. package/dist/box/Box.js.map +1 -1
  130. package/dist/box/_box.scss +1 -1
  131. package/dist/box/styles.d.ts +9 -9
  132. package/dist/box/styles.js +1 -1
  133. package/dist/box/styles.js.map +1 -1
  134. package/dist/button/AsyncButton.d.ts +5 -7
  135. package/dist/button/AsyncButton.js +3 -5
  136. package/dist/button/AsyncButton.js.map +1 -1
  137. package/dist/button/Button.d.ts +4 -8
  138. package/dist/button/Button.js +4 -8
  139. package/dist/button/Button.js.map +1 -1
  140. package/dist/button/ButtonUnstyled.d.ts +2 -2
  141. package/dist/button/ButtonUnstyled.js +1 -1
  142. package/dist/button/ButtonUnstyled.js.map +1 -1
  143. package/dist/button/FloatingActionButton.d.ts +5 -5
  144. package/dist/button/FloatingActionButton.js +2 -2
  145. package/dist/button/FloatingActionButton.js.map +1 -1
  146. package/dist/button/TooltippedButton.d.ts +2 -2
  147. package/dist/button/TooltippedButton.js +2 -5
  148. package/dist/button/TooltippedButton.js.map +1 -1
  149. package/dist/button/buttonStyles.d.ts +3 -3
  150. package/dist/button/buttonStyles.js +1 -1
  151. package/dist/button/buttonStyles.js.map +1 -1
  152. package/dist/button/buttonUnstyledStyles.d.ts +2 -2
  153. package/dist/button/buttonUnstyledStyles.js +1 -1
  154. package/dist/button/buttonUnstyledStyles.js.map +1 -1
  155. package/dist/card/Card.d.ts +3 -4
  156. package/dist/card/Card.js +2 -3
  157. package/dist/card/Card.js.map +1 -1
  158. package/dist/card/CardContent.d.ts +2 -4
  159. package/dist/card/CardContent.js +1 -2
  160. package/dist/card/CardContent.js.map +1 -1
  161. package/dist/card/CardFooter.d.ts +2 -2
  162. package/dist/card/CardFooter.js +1 -1
  163. package/dist/card/CardFooter.js.map +1 -1
  164. package/dist/card/CardHeader.d.ts +10 -12
  165. package/dist/card/CardHeader.js +6 -7
  166. package/dist/card/CardHeader.js.map +1 -1
  167. package/dist/card/CardSubtitle.d.ts +2 -2
  168. package/dist/card/CardSubtitle.js +1 -1
  169. package/dist/card/CardSubtitle.js.map +1 -1
  170. package/dist/card/CardTitle.d.ts +2 -2
  171. package/dist/card/CardTitle.js +1 -1
  172. package/dist/card/CardTitle.js.map +1 -1
  173. package/dist/card/ClickableCard.d.ts +3 -4
  174. package/dist/card/ClickableCard.js +2 -3
  175. package/dist/card/ClickableCard.js.map +1 -1
  176. package/dist/card/styles.d.ts +15 -15
  177. package/dist/card/styles.js +7 -7
  178. package/dist/card/styles.js.map +1 -1
  179. package/dist/chip/Chip.d.ts +10 -14
  180. package/dist/chip/Chip.js +4 -7
  181. package/dist/chip/Chip.js.map +1 -1
  182. package/dist/chip/styles.d.ts +4 -4
  183. package/dist/chip/styles.js +2 -2
  184. package/dist/chip/styles.js.map +1 -1
  185. package/dist/cssUtils.d.ts +10 -10
  186. package/dist/cssUtils.js +1 -1
  187. package/dist/cssUtils.js.map +1 -1
  188. package/dist/dialog/Dialog.d.ts +5 -6
  189. package/dist/dialog/Dialog.js +4 -5
  190. package/dist/dialog/Dialog.js.map +1 -1
  191. package/dist/dialog/DialogContainer.d.ts +2 -2
  192. package/dist/dialog/DialogContainer.js +1 -1
  193. package/dist/dialog/DialogContainer.js.map +1 -1
  194. package/dist/dialog/DialogTitle.d.ts +1 -1
  195. package/dist/dialog/DialogTitle.js.map +1 -1
  196. package/dist/dialog/FixedDialog.d.ts +1 -2
  197. package/dist/dialog/FixedDialog.js +1 -2
  198. package/dist/dialog/FixedDialog.js.map +1 -1
  199. package/dist/dialog/styles.d.ts +9 -9
  200. package/dist/dialog/styles.js +4 -4
  201. package/dist/dialog/styles.js.map +1 -1
  202. package/dist/divider/Divider.d.ts +2 -3
  203. package/dist/divider/Divider.js +1 -2
  204. package/dist/divider/Divider.js.map +1 -1
  205. package/dist/divider/styles.d.ts +2 -2
  206. package/dist/divider/styles.js +1 -1
  207. package/dist/divider/styles.js.map +1 -1
  208. package/dist/draggable/useDraggable.d.ts +17 -18
  209. package/dist/draggable/useDraggable.js +2 -2
  210. package/dist/draggable/useDraggable.js.map +1 -1
  211. package/dist/draggable/utils.d.ts +2 -2
  212. package/dist/draggable/utils.js +1 -1
  213. package/dist/draggable/utils.js.map +1 -1
  214. package/dist/expansion-panel/ExpansionList.d.ts +2 -2
  215. package/dist/expansion-panel/ExpansionList.js +1 -1
  216. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  217. package/dist/expansion-panel/ExpansionPanel.d.ts +8 -9
  218. package/dist/expansion-panel/ExpansionPanel.js +2 -3
  219. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  220. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +3 -4
  221. package/dist/expansion-panel/ExpansionPanelHeader.js +2 -3
  222. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  223. package/dist/expansion-panel/useExpansionList.d.ts +5 -6
  224. package/dist/expansion-panel/useExpansionList.js +4 -5
  225. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  226. package/dist/expansion-panel/useExpansionPanels.d.ts +9 -14
  227. package/dist/expansion-panel/useExpansionPanels.js +3 -6
  228. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  229. package/dist/focus/useFocusContainer.d.ts +9 -10
  230. package/dist/focus/useFocusContainer.js +2 -3
  231. package/dist/focus/useFocusContainer.js.map +1 -1
  232. package/dist/focus/utils.d.ts +4 -5
  233. package/dist/focus/utils.js +3 -4
  234. package/dist/focus/utils.js.map +1 -1
  235. package/dist/form/Checkbox.d.ts +1 -2
  236. package/dist/form/Checkbox.js +1 -2
  237. package/dist/form/Checkbox.js.map +1 -1
  238. package/dist/form/Fieldset.d.ts +5 -6
  239. package/dist/form/Fieldset.js +2 -3
  240. package/dist/form/Fieldset.js.map +1 -1
  241. package/dist/form/FileInput.d.ts +6 -7
  242. package/dist/form/FileInput.js +3 -4
  243. package/dist/form/FileInput.js.map +1 -1
  244. package/dist/form/FormMessageContainer.d.ts +2 -2
  245. package/dist/form/FormMessageContainer.js +1 -1
  246. package/dist/form/FormMessageContainer.js.map +1 -1
  247. package/dist/form/FormMessageCounter.d.ts +4 -6
  248. package/dist/form/FormMessageCounter.js +2 -3
  249. package/dist/form/FormMessageCounter.js.map +1 -1
  250. package/dist/form/InputToggle.d.ts +11 -12
  251. package/dist/form/InputToggle.js +1 -1
  252. package/dist/form/InputToggle.js.map +1 -1
  253. package/dist/form/InputToggleIcon.d.ts +4 -6
  254. package/dist/form/InputToggleIcon.js +2 -3
  255. package/dist/form/InputToggleIcon.js.map +1 -1
  256. package/dist/form/Label.d.ts +2 -2
  257. package/dist/form/Label.js +2 -2
  258. package/dist/form/Label.js.map +1 -1
  259. package/dist/form/Legend.d.ts +2 -2
  260. package/dist/form/Legend.js +1 -1
  261. package/dist/form/Legend.js.map +1 -1
  262. package/dist/form/MenuItemCheckbox.d.ts +2 -3
  263. package/dist/form/MenuItemCheckbox.js +2 -3
  264. package/dist/form/MenuItemCheckbox.js.map +1 -1
  265. package/dist/form/MenuItemFileInput.d.ts +3 -5
  266. package/dist/form/MenuItemFileInput.js +2 -3
  267. package/dist/form/MenuItemFileInput.js.map +1 -1
  268. package/dist/form/MenuItemInputToggle.d.ts +7 -9
  269. package/dist/form/MenuItemInputToggle.js +1 -1
  270. package/dist/form/MenuItemInputToggle.js.map +1 -1
  271. package/dist/form/MenuItemRadio.d.ts +3 -5
  272. package/dist/form/MenuItemRadio.js +3 -5
  273. package/dist/form/MenuItemRadio.js.map +1 -1
  274. package/dist/form/MenuItemSwitch.d.ts +2 -3
  275. package/dist/form/MenuItemSwitch.js +2 -3
  276. package/dist/form/MenuItemSwitch.js.map +1 -1
  277. package/dist/form/MenuItemTextField.d.ts +2 -2
  278. package/dist/form/MenuItemTextField.js +1 -1
  279. package/dist/form/MenuItemTextField.js.map +1 -1
  280. package/dist/form/NativeSelect.d.ts +3 -5
  281. package/dist/form/NativeSelect.js +2 -4
  282. package/dist/form/NativeSelect.js.map +1 -1
  283. package/dist/form/OptGroup.d.ts +3 -4
  284. package/dist/form/OptGroup.js +2 -3
  285. package/dist/form/OptGroup.js.map +1 -1
  286. package/dist/form/Option.d.ts +5 -7
  287. package/dist/form/Option.js +3 -4
  288. package/dist/form/Option.js.map +1 -1
  289. package/dist/form/Password.d.ts +7 -13
  290. package/dist/form/Password.js +1 -2
  291. package/dist/form/Password.js.map +1 -1
  292. package/dist/form/Radio.d.ts +1 -2
  293. package/dist/form/Radio.js +1 -2
  294. package/dist/form/Radio.js.map +1 -1
  295. package/dist/form/ResizingTextAreaWrapper.d.ts +2 -2
  296. package/dist/form/ResizingTextAreaWrapper.js +1 -1
  297. package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
  298. package/dist/form/Select.d.ts +6 -9
  299. package/dist/form/Select.js +3 -5
  300. package/dist/form/Select.js.map +1 -1
  301. package/dist/form/SelectedOption.d.ts +2 -2
  302. package/dist/form/SelectedOption.js +1 -1
  303. package/dist/form/SelectedOption.js.map +1 -1
  304. package/dist/form/Slider.d.ts +16 -25
  305. package/dist/form/Slider.js.map +1 -1
  306. package/dist/form/SliderContainer.d.ts +6 -9
  307. package/dist/form/SliderContainer.js +2 -3
  308. package/dist/form/SliderContainer.js.map +1 -1
  309. package/dist/form/SliderMark.d.ts +2 -2
  310. package/dist/form/SliderMark.js +1 -1
  311. package/dist/form/SliderMark.js.map +1 -1
  312. package/dist/form/SliderMarkLabel.d.ts +3 -3
  313. package/dist/form/SliderMarkLabel.js +1 -1
  314. package/dist/form/SliderMarkLabel.js.map +1 -1
  315. package/dist/form/SliderThumb.d.ts +6 -8
  316. package/dist/form/SliderThumb.js +3 -4
  317. package/dist/form/SliderThumb.js.map +1 -1
  318. package/dist/form/SliderTrack.d.ts +4 -6
  319. package/dist/form/SliderTrack.js +2 -3
  320. package/dist/form/SliderTrack.js.map +1 -1
  321. package/dist/form/SliderValueMarks.d.ts +7 -9
  322. package/dist/form/SliderValueMarks.js +1 -1
  323. package/dist/form/SliderValueMarks.js.map +1 -1
  324. package/dist/form/SliderValueTooltip.d.ts +4 -6
  325. package/dist/form/SliderValueTooltip.js +2 -3
  326. package/dist/form/SliderValueTooltip.js.map +1 -1
  327. package/dist/form/Switch.d.ts +3 -4
  328. package/dist/form/Switch.js +2 -3
  329. package/dist/form/Switch.js.map +1 -1
  330. package/dist/form/TextArea.d.ts +2 -3
  331. package/dist/form/TextArea.js +1 -2
  332. package/dist/form/TextArea.js.map +1 -1
  333. package/dist/form/TextField.d.ts +7 -10
  334. package/dist/form/TextField.js +2 -4
  335. package/dist/form/TextField.js.map +1 -1
  336. package/dist/form/TextFieldAddon.d.ts +3 -3
  337. package/dist/form/TextFieldAddon.js +1 -1
  338. package/dist/form/TextFieldAddon.js.map +1 -1
  339. package/dist/form/fileUtils.d.ts +33 -36
  340. package/dist/form/fileUtils.js +14 -14
  341. package/dist/form/fileUtils.js.map +1 -1
  342. package/dist/form/formConfig.d.ts +2 -2
  343. package/dist/form/formConfig.js +2 -2
  344. package/dist/form/formConfig.js.map +1 -1
  345. package/dist/form/formMessageStyles.d.ts +5 -5
  346. package/dist/form/formMessageStyles.js +3 -3
  347. package/dist/form/formMessageStyles.js.map +1 -1
  348. package/dist/form/inputToggleStyles.d.ts +3 -3
  349. package/dist/form/inputToggleStyles.js +1 -1
  350. package/dist/form/inputToggleStyles.js.map +1 -1
  351. package/dist/form/menuItemInputToggleStyles.d.ts +8 -8
  352. package/dist/form/menuItemInputToggleStyles.js +4 -4
  353. package/dist/form/menuItemInputToggleStyles.js.map +1 -1
  354. package/dist/form/nativeSelectStyles.d.ts +4 -4
  355. package/dist/form/nativeSelectStyles.js +2 -2
  356. package/dist/form/nativeSelectStyles.js.map +1 -1
  357. package/dist/form/optionStyles.d.ts +2 -2
  358. package/dist/form/optionStyles.js +1 -1
  359. package/dist/form/optionStyles.js.map +1 -1
  360. package/dist/form/passwordStyles.d.ts +4 -4
  361. package/dist/form/passwordStyles.js +1 -1
  362. package/dist/form/passwordStyles.js.map +1 -1
  363. package/dist/form/selectStyles.d.ts +2 -2
  364. package/dist/form/selectStyles.js +1 -1
  365. package/dist/form/selectStyles.js.map +1 -1
  366. package/dist/form/selectUtils.d.ts +3 -3
  367. package/dist/form/selectUtils.js +2 -2
  368. package/dist/form/selectUtils.js.map +1 -1
  369. package/dist/form/sliderUtils.d.ts +9 -9
  370. package/dist/form/sliderUtils.js +4 -4
  371. package/dist/form/sliderUtils.js.map +1 -1
  372. package/dist/form/switchStyles.d.ts +2 -2
  373. package/dist/form/switchStyles.js +1 -1
  374. package/dist/form/switchStyles.js.map +1 -1
  375. package/dist/form/textAreaStyles.d.ts +4 -4
  376. package/dist/form/textAreaStyles.js +2 -2
  377. package/dist/form/textAreaStyles.js.map +1 -1
  378. package/dist/form/textFieldContainerStyles.d.ts +2 -2
  379. package/dist/form/textFieldContainerStyles.js +1 -1
  380. package/dist/form/textFieldContainerStyles.js.map +1 -1
  381. package/dist/form/textFieldStyles.d.ts +2 -2
  382. package/dist/form/textFieldStyles.js +1 -1
  383. package/dist/form/textFieldStyles.js.map +1 -1
  384. package/dist/form/types.d.ts +10 -10
  385. package/dist/form/types.js.map +1 -1
  386. package/dist/form/useCheckboxGroup.d.ts +15 -20
  387. package/dist/form/useCheckboxGroup.js.map +1 -1
  388. package/dist/form/useCombobox.d.ts +16 -16
  389. package/dist/form/useCombobox.js +2 -2
  390. package/dist/form/useCombobox.js.map +1 -1
  391. package/dist/form/useEditableCombobox.d.ts +3 -3
  392. package/dist/form/useEditableCombobox.js +1 -1
  393. package/dist/form/useEditableCombobox.js.map +1 -1
  394. package/dist/form/useFileUpload.d.ts +7 -8
  395. package/dist/form/useFileUpload.js +1 -1
  396. package/dist/form/useFileUpload.js.map +1 -1
  397. package/dist/form/useFormReset.d.ts +2 -2
  398. package/dist/form/useFormReset.js +1 -1
  399. package/dist/form/useFormReset.js.map +1 -1
  400. package/dist/form/useListboxProvider.d.ts +3 -3
  401. package/dist/form/useListboxProvider.js +2 -2
  402. package/dist/form/useListboxProvider.js.map +1 -1
  403. package/dist/form/useNumberField.d.ts +17 -25
  404. package/dist/form/useNumberField.js.map +1 -1
  405. package/dist/form/useRadioGroup.d.ts +12 -15
  406. package/dist/form/useRadioGroup.js +2 -3
  407. package/dist/form/useRadioGroup.js.map +1 -1
  408. package/dist/form/useRangeSlider.d.ts +8 -11
  409. package/dist/form/useRangeSlider.js +3 -5
  410. package/dist/form/useRangeSlider.js.map +1 -1
  411. package/dist/form/useSelectCombobox.d.ts +3 -3
  412. package/dist/form/useSelectCombobox.js +1 -1
  413. package/dist/form/useSelectCombobox.js.map +1 -1
  414. package/dist/form/useSlider.d.ts +7 -9
  415. package/dist/form/useSlider.js +3 -5
  416. package/dist/form/useSlider.js.map +1 -1
  417. package/dist/form/useTextField.d.ts +22 -31
  418. package/dist/form/useTextField.js.map +1 -1
  419. package/dist/form/utils.d.ts +7 -8
  420. package/dist/form/utils.js +5 -6
  421. package/dist/form/utils.js.map +1 -1
  422. package/dist/form/validation.d.ts +16 -16
  423. package/dist/form/validation.js +7 -7
  424. package/dist/form/validation.js.map +1 -1
  425. package/dist/hoverMode/useHoverMode.d.ts +9 -10
  426. package/dist/hoverMode/useHoverMode.js.map +1 -1
  427. package/dist/hoverMode/useHoverModeProvider.d.ts +11 -15
  428. package/dist/hoverMode/useHoverModeProvider.js +3 -4
  429. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  430. package/dist/icon/FontIcon.d.ts +1 -1
  431. package/dist/icon/FontIcon.js +1 -1
  432. package/dist/icon/FontIcon.js.map +1 -1
  433. package/dist/icon/IconRotator.d.ts +1 -1
  434. package/dist/icon/IconRotator.js.map +1 -1
  435. package/dist/icon/MaterialIcon.d.ts +2 -2
  436. package/dist/icon/MaterialIcon.js +1 -1
  437. package/dist/icon/MaterialIcon.js.map +1 -1
  438. package/dist/icon/MaterialSymbol.d.ts +3 -4
  439. package/dist/icon/MaterialSymbol.js +2 -3
  440. package/dist/icon/MaterialSymbol.js.map +1 -1
  441. package/dist/icon/SVGIcon.d.ts +0 -1
  442. package/dist/icon/SVGIcon.js.map +1 -1
  443. package/dist/icon/TextIconSpacing.d.ts +3 -5
  444. package/dist/icon/TextIconSpacing.js +2 -4
  445. package/dist/icon/TextIconSpacing.js.map +1 -1
  446. package/dist/icon/iconConfig.d.ts +14 -16
  447. package/dist/icon/iconConfig.js +5 -7
  448. package/dist/icon/iconConfig.js.map +1 -1
  449. package/dist/icon/material.d.ts +4 -4
  450. package/dist/icon/material.js +1 -1
  451. package/dist/icon/material.js.map +1 -1
  452. package/dist/icon/materialConfig.d.ts +12 -12
  453. package/dist/icon/materialConfig.js +2 -2
  454. package/dist/icon/materialConfig.js.map +1 -1
  455. package/dist/icon/styles.d.ts +8 -8
  456. package/dist/icon/styles.js +2 -2
  457. package/dist/icon/styles.js.map +1 -1
  458. package/dist/interaction/UserInteractionModeProvider.d.ts +1 -2
  459. package/dist/interaction/UserInteractionModeProvider.js +1 -2
  460. package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
  461. package/dist/interaction/config.d.ts +2 -2
  462. package/dist/interaction/config.js +1 -1
  463. package/dist/interaction/config.js.map +1 -1
  464. package/dist/interaction/types.d.ts +8 -8
  465. package/dist/interaction/types.js +1 -1
  466. package/dist/interaction/types.js.map +1 -1
  467. package/dist/interaction/useElementInteraction.d.ts +6 -7
  468. package/dist/interaction/useElementInteraction.js +3 -4
  469. package/dist/interaction/useElementInteraction.js.map +1 -1
  470. package/dist/interaction/useHigherContrastChildren.d.ts +2 -3
  471. package/dist/interaction/useHigherContrastChildren.js +2 -3
  472. package/dist/interaction/useHigherContrastChildren.js.map +1 -1
  473. package/dist/layout/LayoutAppBar.d.ts +4 -7
  474. package/dist/layout/LayoutAppBar.js +3 -6
  475. package/dist/layout/LayoutAppBar.js.map +1 -1
  476. package/dist/layout/LayoutNav.d.ts +4 -6
  477. package/dist/layout/LayoutNav.js +3 -5
  478. package/dist/layout/LayoutNav.js.map +1 -1
  479. package/dist/layout/LayoutWindowSplitter.d.ts +3 -4
  480. package/dist/layout/LayoutWindowSplitter.js +2 -3
  481. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  482. package/dist/layout/Main.d.ts +4 -5
  483. package/dist/layout/Main.js +2 -3
  484. package/dist/layout/Main.js.map +1 -1
  485. package/dist/layout/_layout.scss +12 -1
  486. package/dist/layout/layoutNavStyles.d.ts +2 -2
  487. package/dist/layout/layoutNavStyles.js +1 -1
  488. package/dist/layout/layoutNavStyles.js.map +1 -1
  489. package/dist/layout/layoutWindowSplitterStyles.d.ts +2 -2
  490. package/dist/layout/layoutWindowSplitterStyles.js +1 -1
  491. package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
  492. package/dist/layout/mainStyles.d.ts +2 -2
  493. package/dist/layout/mainStyles.js +1 -1
  494. package/dist/layout/mainStyles.js.map +1 -1
  495. package/dist/layout/useExpandableLayout.d.ts +66 -14
  496. package/dist/layout/useExpandableLayout.js +50 -5
  497. package/dist/layout/useExpandableLayout.js.map +1 -1
  498. package/dist/layout/useHorizontalLayoutTransition.d.ts +4 -4
  499. package/dist/layout/useHorizontalLayoutTransition.js +2 -2
  500. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  501. package/dist/layout/useLayoutAppBarHeight.d.ts +7 -9
  502. package/dist/layout/useLayoutAppBarHeight.js +7 -8
  503. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  504. package/dist/layout/useLayoutTree.d.ts +6 -6
  505. package/dist/layout/useLayoutTree.js +1 -1
  506. package/dist/layout/useLayoutTree.js.map +1 -1
  507. package/dist/layout/useLayoutWindowSplitter.d.ts +5 -6
  508. package/dist/layout/useLayoutWindowSplitter.js +2 -3
  509. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  510. package/dist/layout/useMainTabIndex.d.ts +1 -1
  511. package/dist/layout/useMainTabIndex.js +1 -1
  512. package/dist/layout/useMainTabIndex.js.map +1 -1
  513. package/dist/layout/useResizableLayout.d.ts +54 -8
  514. package/dist/layout/useResizableLayout.js +51 -5
  515. package/dist/layout/useResizableLayout.js.map +1 -1
  516. package/dist/layout/useTemporaryLayout.d.ts +12 -12
  517. package/dist/layout/useTemporaryLayout.js +1 -1
  518. package/dist/layout/useTemporaryLayout.js.map +1 -1
  519. package/dist/link/Link.d.ts +10 -13
  520. package/dist/link/Link.js +5 -7
  521. package/dist/link/Link.js.map +1 -1
  522. package/dist/link/SkipToMainContent.d.ts +2 -4
  523. package/dist/link/SkipToMainContent.js +1 -2
  524. package/dist/link/SkipToMainContent.js.map +1 -1
  525. package/dist/link/styles.d.ts +4 -4
  526. package/dist/link/styles.js +2 -2
  527. package/dist/link/styles.js.map +1 -1
  528. package/dist/list/List.d.ts +3 -4
  529. package/dist/list/List.js +2 -3
  530. package/dist/list/List.js.map +1 -1
  531. package/dist/list/ListItem.d.ts +4 -6
  532. package/dist/list/ListItem.js +2 -4
  533. package/dist/list/ListItem.js.map +1 -1
  534. package/dist/list/ListItemChildren.d.ts +1 -2
  535. package/dist/list/ListItemChildren.js +1 -2
  536. package/dist/list/ListItemChildren.js.map +1 -1
  537. package/dist/list/ListSubheader.d.ts +3 -3
  538. package/dist/list/ListSubheader.js +1 -1
  539. package/dist/list/ListSubheader.js.map +1 -1
  540. package/dist/list/getListItemHeight.d.ts +1 -1
  541. package/dist/list/getListItemHeight.js.map +1 -1
  542. package/dist/list/listItemStyles.d.ts +9 -9
  543. package/dist/list/listItemStyles.js +3 -3
  544. package/dist/list/listItemStyles.js.map +1 -1
  545. package/dist/list/types.d.ts +11 -11
  546. package/dist/list/types.js.map +1 -1
  547. package/dist/media-queries/AppSizeProvider.d.ts +1 -2
  548. package/dist/media-queries/AppSizeProvider.js +1 -2
  549. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  550. package/dist/media-queries/useMediaQuery.d.ts +2 -3
  551. package/dist/media-queries/useMediaQuery.js +2 -3
  552. package/dist/media-queries/useMediaQuery.js.map +1 -1
  553. package/dist/menu/DropdownMenu.d.ts +7 -11
  554. package/dist/menu/DropdownMenu.js +4 -7
  555. package/dist/menu/DropdownMenu.js.map +1 -1
  556. package/dist/menu/Menu.d.ts +10 -13
  557. package/dist/menu/Menu.js +2 -3
  558. package/dist/menu/Menu.js.map +1 -1
  559. package/dist/menu/MenuBar.d.ts +3 -4
  560. package/dist/menu/MenuBar.js +3 -4
  561. package/dist/menu/MenuBar.js.map +1 -1
  562. package/dist/menu/MenuButton.d.ts +8 -8
  563. package/dist/menu/MenuButton.js +2 -2
  564. package/dist/menu/MenuButton.js.map +1 -1
  565. package/dist/menu/MenuConfigurationProvider.d.ts +8 -8
  566. package/dist/menu/MenuConfigurationProvider.js +5 -5
  567. package/dist/menu/MenuConfigurationProvider.js.map +1 -1
  568. package/dist/menu/MenuItem.d.ts +2 -2
  569. package/dist/menu/MenuItem.js +1 -1
  570. package/dist/menu/MenuItem.js.map +1 -1
  571. package/dist/menu/MenuItemButton.d.ts +2 -2
  572. package/dist/menu/MenuItemButton.js +1 -1
  573. package/dist/menu/MenuItemButton.js.map +1 -1
  574. package/dist/menu/MenuItemCircularProgress.d.ts +3 -4
  575. package/dist/menu/MenuItemCircularProgress.js +2 -3
  576. package/dist/menu/MenuItemCircularProgress.js.map +1 -1
  577. package/dist/menu/MenuItemGroup.d.ts +3 -4
  578. package/dist/menu/MenuItemGroup.js +2 -3
  579. package/dist/menu/MenuItemGroup.js.map +1 -1
  580. package/dist/menu/MenuItemSeparator.d.ts +2 -2
  581. package/dist/menu/MenuItemSeparator.js +1 -1
  582. package/dist/menu/MenuItemSeparator.js.map +1 -1
  583. package/dist/menu/MenuSheet.d.ts +7 -9
  584. package/dist/menu/MenuSheet.js +2 -3
  585. package/dist/menu/MenuSheet.js.map +1 -1
  586. package/dist/menu/MenuVisibilityProvider.d.ts +6 -8
  587. package/dist/menu/MenuVisibilityProvider.js +5 -6
  588. package/dist/menu/MenuVisibilityProvider.js.map +1 -1
  589. package/dist/menu/MenuWidget.d.ts +2 -2
  590. package/dist/menu/MenuWidget.js +1 -1
  591. package/dist/menu/MenuWidget.js.map +1 -1
  592. package/dist/menu/MenuWidgetKeyboardProvider.d.ts +2 -2
  593. package/dist/menu/MenuWidgetKeyboardProvider.js +1 -1
  594. package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
  595. package/dist/menu/useContextMenu.d.ts +8 -12
  596. package/dist/menu/useContextMenu.js +3 -5
  597. package/dist/menu/useContextMenu.js.map +1 -1
  598. package/dist/menu/useMenuBarProvider.d.ts +6 -6
  599. package/dist/menu/useMenuBarProvider.js +3 -3
  600. package/dist/menu/useMenuBarProvider.js.map +1 -1
  601. package/dist/menu/utils.d.ts +2 -2
  602. package/dist/menu/utils.js +1 -1
  603. package/dist/menu/utils.js.map +1 -1
  604. package/dist/movement/constants.d.ts +3 -3
  605. package/dist/movement/constants.js +3 -3
  606. package/dist/movement/constants.js.map +1 -1
  607. package/dist/movement/types.d.ts +16 -17
  608. package/dist/movement/types.js +1 -1
  609. package/dist/movement/types.js.map +1 -1
  610. package/dist/movement/useKeyboardMovementProvider.d.ts +5 -8
  611. package/dist/movement/useKeyboardMovementProvider.js +6 -9
  612. package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
  613. package/dist/movement/utils.d.ts +13 -13
  614. package/dist/movement/utils.js +10 -10
  615. package/dist/movement/utils.js.map +1 -1
  616. package/dist/navigation/CollapsibleNavGroup.d.ts +29 -0
  617. package/dist/navigation/CollapsibleNavGroup.js +49 -0
  618. package/dist/navigation/CollapsibleNavGroup.js.map +1 -0
  619. package/dist/navigation/DefaultNavigationRenderer.d.ts +22 -0
  620. package/dist/navigation/DefaultNavigationRenderer.js +58 -0
  621. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -0
  622. package/dist/navigation/NavGroup.d.ts +18 -0
  623. package/dist/navigation/NavGroup.js +29 -0
  624. package/dist/navigation/NavGroup.js.map +1 -0
  625. package/dist/navigation/NavItem.d.ts +17 -0
  626. package/dist/navigation/NavItem.js +24 -0
  627. package/dist/navigation/NavItem.js.map +1 -0
  628. package/dist/navigation/NavItemButton.d.ts +26 -0
  629. package/dist/navigation/NavItemButton.js +65 -0
  630. package/dist/navigation/NavItemButton.js.map +1 -0
  631. package/dist/navigation/NavItemLink.d.ts +40 -0
  632. package/dist/navigation/NavItemLink.js +88 -0
  633. package/dist/navigation/NavItemLink.js.map +1 -0
  634. package/dist/navigation/NavSubheader.d.ts +16 -0
  635. package/dist/navigation/NavSubheader.js +26 -0
  636. package/dist/navigation/NavSubheader.js.map +1 -0
  637. package/dist/navigation/Navigation.d.ts +31 -0
  638. package/dist/navigation/Navigation.js +46 -0
  639. package/dist/navigation/Navigation.js.map +1 -0
  640. package/dist/navigation/_navigation.scss +99 -0
  641. package/dist/navigation/getHrefFromParents.d.ts +5 -0
  642. package/dist/navigation/getHrefFromParents.js +13 -0
  643. package/dist/navigation/getHrefFromParents.js.map +1 -0
  644. package/dist/navigation/navGroupStyles.d.ts +11 -0
  645. package/dist/navigation/navGroupStyles.js +13 -0
  646. package/dist/navigation/navGroupStyles.js.map +1 -0
  647. package/dist/navigation/navItemStyles.d.ts +33 -0
  648. package/dist/navigation/navItemStyles.js +31 -0
  649. package/dist/navigation/navItemStyles.js.map +1 -0
  650. package/dist/navigation/types.d.ts +137 -0
  651. package/dist/navigation/types.js +5 -0
  652. package/dist/navigation/types.js.map +1 -0
  653. package/dist/navigation/useActiveHeadingId.d.ts +54 -0
  654. package/dist/navigation/useActiveHeadingId.js +117 -0
  655. package/dist/navigation/useActiveHeadingId.js.map +1 -0
  656. package/dist/overlay/Overlay.d.ts +5 -6
  657. package/dist/overlay/Overlay.js +2 -3
  658. package/dist/overlay/Overlay.js.map +1 -1
  659. package/dist/overlay/overlayStyles.d.ts +4 -4
  660. package/dist/overlay/overlayStyles.js +3 -3
  661. package/dist/overlay/overlayStyles.js.map +1 -1
  662. package/dist/portal/Portal.d.ts +1 -2
  663. package/dist/portal/Portal.js +1 -2
  664. package/dist/portal/Portal.js.map +1 -1
  665. package/dist/portal/PortalContainerProvider.d.ts +4 -4
  666. package/dist/portal/PortalContainerProvider.js +2 -2
  667. package/dist/portal/PortalContainerProvider.js.map +1 -1
  668. package/dist/positioning/createVerticalPosition.d.ts +1 -1
  669. package/dist/positioning/createVerticalPosition.js.map +1 -1
  670. package/dist/positioning/getFixedPosition.js +1 -1
  671. package/dist/positioning/getFixedPosition.js.map +1 -1
  672. package/dist/positioning/types.d.ts +4 -4
  673. package/dist/positioning/types.js.map +1 -1
  674. package/dist/positioning/useFixedPositioning.d.ts +8 -9
  675. package/dist/positioning/useFixedPositioning.js +2 -3
  676. package/dist/positioning/useFixedPositioning.js.map +1 -1
  677. package/dist/positioning/utils.d.ts +3 -3
  678. package/dist/positioning/utils.js +1 -1
  679. package/dist/positioning/utils.js.map +1 -1
  680. package/dist/progress/CircularProgress.d.ts +7 -10
  681. package/dist/progress/CircularProgress.js +3 -5
  682. package/dist/progress/CircularProgress.js.map +1 -1
  683. package/dist/progress/LinearProgress.d.ts +4 -6
  684. package/dist/progress/LinearProgress.js +3 -5
  685. package/dist/progress/LinearProgress.js.map +1 -1
  686. package/dist/progress/types.d.ts +5 -5
  687. package/dist/progress/types.js +1 -1
  688. package/dist/progress/types.js.map +1 -1
  689. package/dist/responsive-item/ResponsiveItemContainer.d.ts +10 -15
  690. package/dist/responsive-item/ResponsiveItemContainer.js +5 -8
  691. package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
  692. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +6 -7
  693. package/dist/responsive-item/ResponsiveItemOverlay.js +3 -4
  694. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  695. package/dist/responsive-item/styles.d.ts +2 -2
  696. package/dist/responsive-item/styles.js +1 -1
  697. package/dist/responsive-item/styles.js.map +1 -1
  698. package/dist/scroll/ScrollLock.d.ts +1 -1
  699. package/dist/scroll/ScrollLock.js +1 -1
  700. package/dist/scroll/ScrollLock.js.map +1 -1
  701. package/dist/scroll/useScrollLock.d.ts +2 -3
  702. package/dist/scroll/useScrollLock.js +2 -3
  703. package/dist/scroll/useScrollLock.js.map +1 -1
  704. package/dist/searching/caseInsensitive.d.ts +9 -13
  705. package/dist/searching/caseInsensitive.js +1 -1
  706. package/dist/searching/caseInsensitive.js.map +1 -1
  707. package/dist/searching/fuzzy.d.ts +4 -5
  708. package/dist/searching/fuzzy.js +1 -1
  709. package/dist/searching/fuzzy.js.map +1 -1
  710. package/dist/searching/toSearchQuery.d.ts +1 -1
  711. package/dist/searching/toSearchQuery.js +1 -1
  712. package/dist/searching/toSearchQuery.js.map +1 -1
  713. package/dist/searching/types.d.ts +2 -2
  714. package/dist/searching/types.js +1 -1
  715. package/dist/searching/types.js.map +1 -1
  716. package/dist/searching/useFuzzyMatch.d.ts +3 -3
  717. package/dist/searching/useFuzzyMatch.js +1 -1
  718. package/dist/searching/useFuzzyMatch.js.map +1 -1
  719. package/dist/searching/utils.d.ts +3 -3
  720. package/dist/searching/utils.js +2 -2
  721. package/dist/searching/utils.js.map +1 -1
  722. package/dist/segmented-button/SegmentedButton.d.ts +3 -4
  723. package/dist/segmented-button/SegmentedButton.js +2 -3
  724. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  725. package/dist/segmented-button/SegmentedButtonContainer.d.ts +3 -4
  726. package/dist/segmented-button/SegmentedButtonContainer.js +2 -3
  727. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  728. package/dist/segmented-button/segmentedButtonContainerStyles.d.ts +2 -2
  729. package/dist/segmented-button/segmentedButtonContainerStyles.js +1 -1
  730. package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
  731. package/dist/segmented-button/segmentedButtonStyles.d.ts +2 -2
  732. package/dist/segmented-button/segmentedButtonStyles.js +1 -1
  733. package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
  734. package/dist/sheet/Sheet.d.ts +1 -1
  735. package/dist/sheet/Sheet.js.map +1 -1
  736. package/dist/sheet/styles.d.ts +3 -3
  737. package/dist/sheet/styles.js +1 -1
  738. package/dist/sheet/styles.js.map +1 -1
  739. package/dist/snackbar/DefaultToastRenderer.d.ts +2 -2
  740. package/dist/snackbar/DefaultToastRenderer.js +1 -1
  741. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  742. package/dist/snackbar/Snackbar.d.ts +3 -4
  743. package/dist/snackbar/Snackbar.js +2 -3
  744. package/dist/snackbar/Snackbar.js.map +1 -1
  745. package/dist/snackbar/Toast.d.ts +3 -3
  746. package/dist/snackbar/Toast.js +1 -1
  747. package/dist/snackbar/Toast.js.map +1 -1
  748. package/dist/snackbar/ToastActionButton.d.ts +2 -2
  749. package/dist/snackbar/ToastActionButton.js +1 -1
  750. package/dist/snackbar/ToastActionButton.js.map +1 -1
  751. package/dist/snackbar/ToastCloseButton.d.ts +2 -2
  752. package/dist/snackbar/ToastCloseButton.js +1 -1
  753. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  754. package/dist/snackbar/ToastContent.d.ts +2 -2
  755. package/dist/snackbar/ToastContent.js +1 -1
  756. package/dist/snackbar/ToastContent.js.map +1 -1
  757. package/dist/snackbar/ToastManager.d.ts +17 -18
  758. package/dist/snackbar/ToastManager.js +21 -19
  759. package/dist/snackbar/ToastManager.js.map +1 -1
  760. package/dist/snackbar/ToastManagerProvider.d.ts +6 -6
  761. package/dist/snackbar/ToastManagerProvider.js +5 -5
  762. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  763. package/dist/snackbar/snackbarStyles.d.ts +4 -5
  764. package/dist/snackbar/snackbarStyles.js +1 -1
  765. package/dist/snackbar/snackbarStyles.js.map +1 -1
  766. package/dist/snackbar/toastContentStyles.d.ts +2 -2
  767. package/dist/snackbar/toastContentStyles.js +1 -1
  768. package/dist/snackbar/toastContentStyles.js.map +1 -1
  769. package/dist/snackbar/toastStyles.d.ts +2 -2
  770. package/dist/snackbar/toastStyles.js +1 -1
  771. package/dist/snackbar/toastStyles.js.map +1 -1
  772. package/dist/snackbar/useCurrentToastActions.d.ts +3 -3
  773. package/dist/snackbar/useCurrentToastActions.js +2 -2
  774. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  775. package/dist/suspense/CircularProgressSuspense.d.ts +3 -4
  776. package/dist/suspense/CircularProgressSuspense.js +2 -3
  777. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  778. package/dist/suspense/NullSuspense.d.ts +3 -4
  779. package/dist/suspense/NullSuspense.js +2 -3
  780. package/dist/suspense/NullSuspense.js.map +1 -1
  781. package/dist/table/Table.d.ts +1 -2
  782. package/dist/table/Table.js +1 -2
  783. package/dist/table/Table.js.map +1 -1
  784. package/dist/table/TableCell.d.ts +7 -7
  785. package/dist/table/TableCell.js.map +1 -1
  786. package/dist/table/TableCellContent.d.ts +3 -3
  787. package/dist/table/TableCellContent.js.map +1 -1
  788. package/dist/table/TableCheckbox.d.ts +11 -15
  789. package/dist/table/TableCheckbox.js +4 -6
  790. package/dist/table/TableCheckbox.js.map +1 -1
  791. package/dist/table/TableContainerProvider.d.ts +3 -3
  792. package/dist/table/TableContainerProvider.js +2 -2
  793. package/dist/table/TableContainerProvider.js.map +1 -1
  794. package/dist/table/TableFooter.d.ts +2 -2
  795. package/dist/table/TableFooter.js +1 -1
  796. package/dist/table/TableFooter.js.map +1 -1
  797. package/dist/table/TableHeader.d.ts +2 -2
  798. package/dist/table/TableHeader.js +1 -1
  799. package/dist/table/TableHeader.js.map +1 -1
  800. package/dist/table/TableRadio.d.ts +7 -9
  801. package/dist/table/TableRadio.js +2 -3
  802. package/dist/table/TableRadio.js.map +1 -1
  803. package/dist/table/tableCellStyles.d.ts +2 -2
  804. package/dist/table/tableCellStyles.js +1 -1
  805. package/dist/table/tableCellStyles.js.map +1 -1
  806. package/dist/table/tableContainerStyles.d.ts +2 -2
  807. package/dist/table/tableContainerStyles.js +1 -1
  808. package/dist/table/tableContainerStyles.js.map +1 -1
  809. package/dist/table/tableFooterStyles.d.ts +1 -1
  810. package/dist/table/tableFooterStyles.js.map +1 -1
  811. package/dist/table/tableHeaderStyles.d.ts +2 -2
  812. package/dist/table/tableHeaderStyles.js +1 -1
  813. package/dist/table/tableHeaderStyles.js.map +1 -1
  814. package/dist/table/tableRowStyles.d.ts +2 -2
  815. package/dist/table/tableRowStyles.js +1 -1
  816. package/dist/table/tableRowStyles.js.map +1 -1
  817. package/dist/table/tableStyles.d.ts +2 -2
  818. package/dist/table/tableStyles.js +1 -1
  819. package/dist/table/tableStyles.js.map +1 -1
  820. package/dist/table/types.d.ts +7 -9
  821. package/dist/table/types.js +1 -1
  822. package/dist/table/types.js.map +1 -1
  823. package/dist/tabs/Tab.d.ts +4 -4
  824. package/dist/tabs/Tab.js +1 -1
  825. package/dist/tabs/Tab.js.map +1 -1
  826. package/dist/tabs/TabList.d.ts +2 -2
  827. package/dist/tabs/TabList.js +1 -1
  828. package/dist/tabs/TabList.js.map +1 -1
  829. package/dist/tabs/TabListScrollButton.d.ts +3 -3
  830. package/dist/tabs/TabListScrollButton.js +1 -1
  831. package/dist/tabs/TabListScrollButton.js.map +1 -1
  832. package/dist/tabs/tabIndicatorStyles.d.ts +2 -2
  833. package/dist/tabs/tabIndicatorStyles.js +1 -1
  834. package/dist/tabs/tabIndicatorStyles.js.map +1 -1
  835. package/dist/tabs/tabListScrollButtonStyles.d.ts +4 -4
  836. package/dist/tabs/tabListScrollButtonStyles.js +2 -2
  837. package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
  838. package/dist/tabs/tabListStyles.d.ts +2 -2
  839. package/dist/tabs/tabListStyles.js +1 -1
  840. package/dist/tabs/tabListStyles.js.map +1 -1
  841. package/dist/tabs/tabStyles.d.ts +2 -2
  842. package/dist/tabs/tabStyles.js +1 -1
  843. package/dist/tabs/tabStyles.js.map +1 -1
  844. package/dist/tabs/useTabs.d.ts +15 -20
  845. package/dist/tabs/useTabs.js +1 -1
  846. package/dist/tabs/useTabs.js.map +1 -1
  847. package/dist/tabs/utils.d.ts +3 -3
  848. package/dist/tabs/utils.js +1 -1
  849. package/dist/tabs/utils.js.map +1 -1
  850. package/dist/test-utils/ResizeObserver.d.ts +9 -11
  851. package/dist/test-utils/ResizeObserver.js +6 -8
  852. package/dist/test-utils/ResizeObserver.js.map +1 -1
  853. package/dist/test-utils/matchMedia.d.ts +13 -17
  854. package/dist/test-utils/matchMedia.js +9 -11
  855. package/dist/test-utils/matchMedia.js.map +1 -1
  856. package/dist/test-utils/render.d.ts +2 -2
  857. package/dist/test-utils/render.js +1 -1
  858. package/dist/test-utils/render.js.map +1 -1
  859. package/dist/test-utils/timers.d.ts +2 -3
  860. package/dist/test-utils/timers.js +2 -3
  861. package/dist/test-utils/timers.js.map +1 -1
  862. package/dist/theme/LocalStorageColorSchemeProvider.d.ts +2 -2
  863. package/dist/theme/LocalStorageColorSchemeProvider.js +1 -1
  864. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  865. package/dist/theme/ThemeProvider.d.ts +17 -20
  866. package/dist/theme/ThemeProvider.js +7 -8
  867. package/dist/theme/ThemeProvider.js.map +1 -1
  868. package/dist/theme/types.d.ts +3 -3
  869. package/dist/theme/types.js +1 -1
  870. package/dist/theme/types.js.map +1 -1
  871. package/dist/theme/useCSSVariables.d.ts +7 -9
  872. package/dist/theme/useCSSVariables.js +1 -1
  873. package/dist/theme/useCSSVariables.js.map +1 -1
  874. package/dist/theme/useColorScheme.d.ts +6 -7
  875. package/dist/theme/useColorScheme.js +2 -3
  876. package/dist/theme/useColorScheme.js.map +1 -1
  877. package/dist/theme/useColorSchemeMetaTag.d.ts +2 -2
  878. package/dist/theme/useColorSchemeMetaTag.js +1 -1
  879. package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
  880. package/dist/theme/useColorSchemeProvider.d.ts +2 -2
  881. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  882. package/dist/theme/usePrefersColorScheme.d.ts +1 -1
  883. package/dist/theme/usePrefersColorScheme.js +1 -1
  884. package/dist/theme/usePrefersColorScheme.js.map +1 -1
  885. package/dist/theme/utils.d.ts +1 -1
  886. package/dist/theme/utils.js +1 -1
  887. package/dist/theme/utils.js.map +1 -1
  888. package/dist/tooltip/Tooltip.d.ts +3 -5
  889. package/dist/tooltip/Tooltip.js +1 -2
  890. package/dist/tooltip/Tooltip.js.map +1 -1
  891. package/dist/tooltip/TooltipHoverModeProvider.d.ts +5 -6
  892. package/dist/tooltip/TooltipHoverModeProvider.js +3 -4
  893. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  894. package/dist/tooltip/constants.d.ts +9 -9
  895. package/dist/tooltip/constants.js +9 -9
  896. package/dist/tooltip/constants.js.map +1 -1
  897. package/dist/tooltip/tooltipStyles.d.ts +2 -2
  898. package/dist/tooltip/tooltipStyles.js +1 -1
  899. package/dist/tooltip/tooltipStyles.js.map +1 -1
  900. package/dist/tooltip/useTooltip.d.ts +18 -26
  901. package/dist/tooltip/useTooltip.js +4 -7
  902. package/dist/tooltip/useTooltip.js.map +1 -1
  903. package/dist/tooltip/useTooltipPosition.d.ts +4 -4
  904. package/dist/tooltip/useTooltipPosition.js +1 -1
  905. package/dist/tooltip/useTooltipPosition.js.map +1 -1
  906. package/dist/transition/CSSTransition.d.ts +3 -4
  907. package/dist/transition/CSSTransition.js +2 -3
  908. package/dist/transition/CSSTransition.js.map +1 -1
  909. package/dist/transition/Collapse.d.ts +5 -8
  910. package/dist/transition/Collapse.js +3 -5
  911. package/dist/transition/Collapse.js.map +1 -1
  912. package/dist/transition/CrossFade.d.ts +5 -8
  913. package/dist/transition/CrossFade.js +3 -5
  914. package/dist/transition/CrossFade.js.map +1 -1
  915. package/dist/transition/ScaleTransition.d.ts +7 -10
  916. package/dist/transition/ScaleTransition.js +4 -6
  917. package/dist/transition/ScaleTransition.js.map +1 -1
  918. package/dist/transition/SkeletonPlaceholder.d.ts +4 -6
  919. package/dist/transition/SkeletonPlaceholder.js +3 -5
  920. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  921. package/dist/transition/Slide.d.ts +2 -2
  922. package/dist/transition/Slide.js +1 -1
  923. package/dist/transition/Slide.js.map +1 -1
  924. package/dist/transition/SlideContainer.d.ts +9 -13
  925. package/dist/transition/SlideContainer.js +4 -6
  926. package/dist/transition/SlideContainer.js.map +1 -1
  927. package/dist/transition/collapseStyles.d.ts +2 -2
  928. package/dist/transition/collapseStyles.js +1 -1
  929. package/dist/transition/collapseStyles.js.map +1 -1
  930. package/dist/transition/config.d.ts +2 -2
  931. package/dist/transition/config.js +2 -2
  932. package/dist/transition/config.js.map +1 -1
  933. package/dist/transition/skeletonPlaceholderUtils.d.ts +3 -3
  934. package/dist/transition/skeletonPlaceholderUtils.js +2 -2
  935. package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
  936. package/dist/transition/types.d.ts +34 -37
  937. package/dist/transition/types.js +1 -1
  938. package/dist/transition/types.js.map +1 -1
  939. package/dist/transition/useCSSTransition.d.ts +4 -7
  940. package/dist/transition/useCSSTransition.js +4 -7
  941. package/dist/transition/useCSSTransition.js.map +1 -1
  942. package/dist/transition/useCarousel.d.ts +6 -7
  943. package/dist/transition/useCarousel.js +2 -3
  944. package/dist/transition/useCarousel.js.map +1 -1
  945. package/dist/transition/useCollapseTransition.d.ts +10 -13
  946. package/dist/transition/useCollapseTransition.js +4 -6
  947. package/dist/transition/useCollapseTransition.js.map +1 -1
  948. package/dist/transition/useCrossFadeTransition.d.ts +5 -6
  949. package/dist/transition/useCrossFadeTransition.js +4 -5
  950. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  951. package/dist/transition/useMaxWidthTransition.d.ts +2 -2
  952. package/dist/transition/useMaxWidthTransition.js +1 -1
  953. package/dist/transition/useMaxWidthTransition.js.map +1 -1
  954. package/dist/transition/useScaleTransition.d.ts +8 -11
  955. package/dist/transition/useScaleTransition.js +7 -10
  956. package/dist/transition/useScaleTransition.js.map +1 -1
  957. package/dist/transition/useSkeletonPlaceholder.d.ts +6 -10
  958. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  959. package/dist/transition/useSlideTransition.d.ts +5 -6
  960. package/dist/transition/useSlideTransition.js +4 -5
  961. package/dist/transition/useSlideTransition.js.map +1 -1
  962. package/dist/transition/useTransition.d.ts +1 -1
  963. package/dist/transition/useTransition.js +1 -1
  964. package/dist/transition/useTransition.js.map +1 -1
  965. package/dist/transition/utils.d.ts +6 -6
  966. package/dist/transition/utils.js +3 -3
  967. package/dist/transition/utils.js.map +1 -1
  968. package/dist/tree/DefaultTreeItemRenderer.d.ts +1 -1
  969. package/dist/tree/DefaultTreeItemRenderer.js +1 -1
  970. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  971. package/dist/tree/Tree.d.ts +7 -11
  972. package/dist/tree/Tree.js +4 -6
  973. package/dist/tree/Tree.js.map +1 -1
  974. package/dist/tree/TreeGroup.d.ts +3 -3
  975. package/dist/tree/TreeGroup.js +1 -1
  976. package/dist/tree/TreeGroup.js.map +1 -1
  977. package/dist/tree/TreeItem.d.ts +3 -4
  978. package/dist/tree/TreeItem.js +2 -3
  979. package/dist/tree/TreeItem.js.map +1 -1
  980. package/dist/tree/TreeItemExpander.d.ts +2 -2
  981. package/dist/tree/TreeItemExpander.js +1 -1
  982. package/dist/tree/TreeItemExpander.js.map +1 -1
  983. package/dist/tree/TreeProvider.d.ts +6 -6
  984. package/dist/tree/TreeProvider.js +2 -2
  985. package/dist/tree/TreeProvider.js.map +1 -1
  986. package/dist/tree/styles.d.ts +10 -10
  987. package/dist/tree/styles.js +5 -5
  988. package/dist/tree/styles.js.map +1 -1
  989. package/dist/tree/types.d.ts +6 -7
  990. package/dist/tree/types.js.map +1 -1
  991. package/dist/tree/useTree.d.ts +4 -5
  992. package/dist/tree/useTree.js +2 -3
  993. package/dist/tree/useTree.js.map +1 -1
  994. package/dist/tree/useTreeExpansion.d.ts +2 -2
  995. package/dist/tree/useTreeExpansion.js +1 -1
  996. package/dist/tree/useTreeExpansion.js.map +1 -1
  997. package/dist/tree/useTreeItems.d.ts +7 -7
  998. package/dist/tree/useTreeItems.js +2 -2
  999. package/dist/tree/useTreeItems.js.map +1 -1
  1000. package/dist/tree/useTreeMovement.d.ts +3 -3
  1001. package/dist/tree/useTreeMovement.js +3 -3
  1002. package/dist/tree/useTreeMovement.js.map +1 -1
  1003. package/dist/tree/useTreeSelection.d.ts +2 -2
  1004. package/dist/tree/useTreeSelection.js +1 -1
  1005. package/dist/tree/useTreeSelection.js.map +1 -1
  1006. package/dist/tree/utils.d.ts +2 -2
  1007. package/dist/tree/utils.js +2 -2
  1008. package/dist/tree/utils.js.map +1 -1
  1009. package/dist/types.d.ts +14 -16
  1010. package/dist/types.js +1 -1
  1011. package/dist/types.js.map +1 -1
  1012. package/dist/typography/SrOnly.d.ts +1 -2
  1013. package/dist/typography/SrOnly.js +1 -2
  1014. package/dist/typography/SrOnly.js.map +1 -1
  1015. package/dist/typography/TextContainer.d.ts +3 -4
  1016. package/dist/typography/TextContainer.js +2 -3
  1017. package/dist/typography/TextContainer.js.map +1 -1
  1018. package/dist/typography/Typography.d.ts +3 -4
  1019. package/dist/typography/Typography.js +1 -2
  1020. package/dist/typography/Typography.js.map +1 -1
  1021. package/dist/typography/WritingDirectionProvider.d.ts +10 -13
  1022. package/dist/typography/WritingDirectionProvider.js +6 -9
  1023. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  1024. package/dist/typography/textContainerStyles.d.ts +3 -4
  1025. package/dist/typography/textContainerStyles.js +2 -3
  1026. package/dist/typography/textContainerStyles.js.map +1 -1
  1027. package/dist/typography/typographyStyles.d.ts +6 -8
  1028. package/dist/typography/typographyStyles.js +3 -5
  1029. package/dist/typography/typographyStyles.js.map +1 -1
  1030. package/dist/useAsyncAction.d.ts +7 -9
  1031. package/dist/useAsyncAction.js +3 -5
  1032. package/dist/useAsyncAction.js.map +1 -1
  1033. package/dist/useDebouncedFunction.d.ts +3 -4
  1034. package/dist/useDebouncedFunction.js +2 -3
  1035. package/dist/useDebouncedFunction.js.map +1 -1
  1036. package/dist/useDropzone.d.ts +9 -14
  1037. package/dist/useDropzone.js +4 -7
  1038. package/dist/useDropzone.js.map +1 -1
  1039. package/dist/useElementSize.d.ts +26 -5
  1040. package/dist/useElementSize.js +7 -5
  1041. package/dist/useElementSize.js.map +1 -1
  1042. package/dist/useEnsuredId.d.ts +2 -3
  1043. package/dist/useEnsuredId.js +2 -3
  1044. package/dist/useEnsuredId.js.map +1 -1
  1045. package/dist/useEnsuredRef.d.ts +3 -4
  1046. package/dist/useEnsuredRef.js +2 -3
  1047. package/dist/useEnsuredRef.js.map +1 -1
  1048. package/dist/useEnsuredState.d.ts +2 -2
  1049. package/dist/useEnsuredState.js +1 -1
  1050. package/dist/useEnsuredState.js.map +1 -1
  1051. package/dist/useHtmlClassName.d.ts +1 -1
  1052. package/dist/useHtmlClassName.js +1 -1
  1053. package/dist/useHtmlClassName.js.map +1 -1
  1054. package/dist/useIntersectionObserver.d.ts +13 -20
  1055. package/dist/useIntersectionObserver.js +2 -3
  1056. package/dist/useIntersectionObserver.js.map +1 -1
  1057. package/dist/useLocalStorage.d.ts +17 -22
  1058. package/dist/useLocalStorage.js +9 -13
  1059. package/dist/useLocalStorage.js.map +1 -1
  1060. package/dist/usePageInactive.d.ts +3 -3
  1061. package/dist/usePageInactive.js +1 -1
  1062. package/dist/usePageInactive.js.map +1 -1
  1063. package/dist/useResizeListener.d.ts +3 -4
  1064. package/dist/useResizeListener.js +2 -3
  1065. package/dist/useResizeListener.js.map +1 -1
  1066. package/dist/useResizeObserver.d.ts +8 -10
  1067. package/dist/useResizeObserver.js +4 -5
  1068. package/dist/useResizeObserver.js.map +1 -1
  1069. package/dist/useThrottledFunction.d.ts +3 -4
  1070. package/dist/useThrottledFunction.js +2 -3
  1071. package/dist/useThrottledFunction.js.map +1 -1
  1072. package/dist/useToggle.d.ts +2 -3
  1073. package/dist/useToggle.js +1 -2
  1074. package/dist/useToggle.js.map +1 -1
  1075. package/dist/useUnmounted.d.ts +2 -3
  1076. package/dist/useUnmounted.js +2 -3
  1077. package/dist/useUnmounted.js.map +1 -1
  1078. package/dist/useWindowSize.d.ts +3 -4
  1079. package/dist/useWindowSize.js +2 -3
  1080. package/dist/useWindowSize.js.map +1 -1
  1081. package/dist/utils/RenderRecursively.d.ts +26 -7
  1082. package/dist/utils/RenderRecursively.js +19 -3
  1083. package/dist/utils/RenderRecursively.js.map +1 -1
  1084. package/dist/utils/alphaNumericSort.d.ts +6 -11
  1085. package/dist/utils/alphaNumericSort.js +1 -1
  1086. package/dist/utils/alphaNumericSort.js.map +1 -1
  1087. package/dist/utils/applyRef.d.ts +1 -2
  1088. package/dist/utils/applyRef.js +1 -2
  1089. package/dist/utils/applyRef.js.map +1 -1
  1090. package/dist/utils/bem.d.ts +2 -3
  1091. package/dist/utils/bem.js +2 -3
  1092. package/dist/utils/bem.js.map +1 -1
  1093. package/dist/utils/getClientPosition.d.ts +4 -4
  1094. package/dist/utils/getClientPosition.js +2 -2
  1095. package/dist/utils/getClientPosition.js.map +1 -1
  1096. package/dist/utils/getMiddleOfRange.d.ts +2 -2
  1097. package/dist/utils/getMiddleOfRange.js +1 -1
  1098. package/dist/utils/getMiddleOfRange.js.map +1 -1
  1099. package/dist/utils/getPercentage.d.ts +3 -4
  1100. package/dist/utils/getPercentage.js +3 -4
  1101. package/dist/utils/getPercentage.js.map +1 -1
  1102. package/dist/utils/getRangeDefaultValue.d.ts +2 -2
  1103. package/dist/utils/getRangeDefaultValue.js +1 -1
  1104. package/dist/utils/getRangeDefaultValue.js.map +1 -1
  1105. package/dist/utils/getRangeSteps.d.ts +3 -4
  1106. package/dist/utils/getRangeSteps.js +3 -4
  1107. package/dist/utils/getRangeSteps.js.map +1 -1
  1108. package/dist/utils/identity.d.ts +1 -1
  1109. package/dist/utils/identity.js +1 -1
  1110. package/dist/utils/identity.js.map +1 -1
  1111. package/dist/utils/isElementVisible.d.ts +3 -4
  1112. package/dist/utils/isElementVisible.js +3 -4
  1113. package/dist/utils/isElementVisible.js.map +1 -1
  1114. package/dist/utils/loop.d.ts +2 -2
  1115. package/dist/utils/loop.js +2 -2
  1116. package/dist/utils/loop.js.map +1 -1
  1117. package/dist/utils/nearest.d.ts +3 -4
  1118. package/dist/utils/nearest.js +3 -4
  1119. package/dist/utils/nearest.js.map +1 -1
  1120. package/dist/utils/parseCssLengthUnit.d.ts +2 -4
  1121. package/dist/utils/parseCssLengthUnit.js +2 -4
  1122. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  1123. package/dist/utils/randomInt.d.ts +2 -2
  1124. package/dist/utils/randomInt.js +2 -2
  1125. package/dist/utils/randomInt.js.map +1 -1
  1126. package/dist/utils/wait.d.ts +2 -3
  1127. package/dist/utils/wait.js +2 -3
  1128. package/dist/utils/wait.js.map +1 -1
  1129. package/dist/utils/withinRange.d.ts +3 -4
  1130. package/dist/utils/withinRange.js +3 -4
  1131. package/dist/utils/withinRange.js.map +1 -1
  1132. package/dist/window-splitter/WindowSplitter.d.ts +5 -5
  1133. package/dist/window-splitter/WindowSplitter.js +2 -2
  1134. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  1135. package/dist/window-splitter/useWindowSplitter.d.ts +6 -7
  1136. package/dist/window-splitter/useWindowSplitter.js +2 -3
  1137. package/dist/window-splitter/useWindowSplitter.js.map +1 -1
  1138. package/package.json +19 -13
  1139. package/src/CoreProviders.tsx +3 -3
  1140. package/src/NoSsr.tsx +3 -4
  1141. package/src/RootHtml.tsx +3 -4
  1142. package/src/SsrProvider.tsx +3 -3
  1143. package/src/_core.scss +5 -0
  1144. package/src/app-bar/AppBar.tsx +11 -14
  1145. package/src/app-bar/AppBarTitle.tsx +7 -9
  1146. package/src/avatar/Avatar.tsx +5 -6
  1147. package/src/avatar/__tests__/Avatar.tsx +1 -1
  1148. package/src/avatar/styles.ts +4 -4
  1149. package/src/badge/Badge.tsx +4 -6
  1150. package/src/box/Box.tsx +16 -9
  1151. package/src/box/__tests__/Box.tsx +158 -0
  1152. package/src/box/__tests__/__snapshots__/Box.tsx.snap +544 -0
  1153. package/src/box/_box.scss +1 -1
  1154. package/src/box/styles.ts +9 -9
  1155. package/src/button/AsyncButton.tsx +5 -7
  1156. package/src/button/Button.tsx +4 -8
  1157. package/src/button/ButtonUnstyled.tsx +2 -2
  1158. package/src/button/FloatingActionButton.tsx +5 -5
  1159. package/src/button/TooltippedButton.tsx +9 -13
  1160. package/src/button/buttonStyles.ts +3 -3
  1161. package/src/button/buttonUnstyledStyles.ts +2 -2
  1162. package/src/card/Card.tsx +3 -4
  1163. package/src/card/CardContent.tsx +2 -4
  1164. package/src/card/CardFooter.tsx +2 -2
  1165. package/src/card/CardHeader.tsx +10 -12
  1166. package/src/card/CardSubtitle.tsx +2 -2
  1167. package/src/card/CardTitle.tsx +2 -2
  1168. package/src/card/ClickableCard.tsx +3 -4
  1169. package/src/card/styles.ts +15 -15
  1170. package/src/chip/Chip.tsx +10 -14
  1171. package/src/chip/styles.ts +4 -4
  1172. package/src/cssUtils.ts +10 -10
  1173. package/src/dialog/Dialog.tsx +5 -6
  1174. package/src/dialog/DialogContainer.tsx +2 -2
  1175. package/src/dialog/DialogTitle.tsx +1 -1
  1176. package/src/dialog/FixedDialog.tsx +1 -2
  1177. package/src/dialog/styles.ts +9 -9
  1178. package/src/divider/Divider.tsx +2 -3
  1179. package/src/divider/styles.ts +2 -2
  1180. package/src/draggable/useDraggable.ts +18 -19
  1181. package/src/draggable/utils.ts +2 -2
  1182. package/src/expansion-panel/ExpansionList.tsx +2 -2
  1183. package/src/expansion-panel/ExpansionPanel.tsx +8 -9
  1184. package/src/expansion-panel/ExpansionPanelHeader.tsx +3 -4
  1185. package/src/expansion-panel/useExpansionList.ts +6 -7
  1186. package/src/expansion-panel/useExpansionPanels.ts +9 -14
  1187. package/src/focus/useFocusContainer.ts +9 -10
  1188. package/src/focus/utils.ts +4 -5
  1189. package/src/form/Checkbox.tsx +1 -2
  1190. package/src/form/Fieldset.tsx +5 -6
  1191. package/src/form/FileInput.tsx +6 -7
  1192. package/src/form/FormMessageContainer.tsx +2 -2
  1193. package/src/form/FormMessageCounter.tsx +4 -6
  1194. package/src/form/InputToggle.tsx +11 -12
  1195. package/src/form/InputToggleIcon.tsx +4 -6
  1196. package/src/form/Label.tsx +2 -2
  1197. package/src/form/Legend.tsx +2 -2
  1198. package/src/form/MenuItemCheckbox.tsx +2 -3
  1199. package/src/form/MenuItemFileInput.tsx +3 -5
  1200. package/src/form/MenuItemInputToggle.tsx +7 -9
  1201. package/src/form/MenuItemRadio.tsx +3 -5
  1202. package/src/form/MenuItemSwitch.tsx +2 -3
  1203. package/src/form/MenuItemTextField.tsx +2 -2
  1204. package/src/form/NativeSelect.tsx +3 -5
  1205. package/src/form/OptGroup.tsx +3 -4
  1206. package/src/form/Option.tsx +5 -7
  1207. package/src/form/Password.tsx +7 -13
  1208. package/src/form/Radio.tsx +1 -2
  1209. package/src/form/ResizingTextAreaWrapper.tsx +2 -2
  1210. package/src/form/Select.tsx +6 -9
  1211. package/src/form/SelectedOption.tsx +2 -2
  1212. package/src/form/Slider.tsx +16 -25
  1213. package/src/form/SliderContainer.tsx +6 -9
  1214. package/src/form/SliderMark.tsx +2 -2
  1215. package/src/form/SliderMarkLabel.tsx +3 -3
  1216. package/src/form/SliderThumb.tsx +8 -10
  1217. package/src/form/SliderTrack.tsx +4 -6
  1218. package/src/form/SliderValueMarks.tsx +7 -9
  1219. package/src/form/SliderValueTooltip.tsx +4 -6
  1220. package/src/form/Switch.tsx +3 -4
  1221. package/src/form/TextArea.tsx +2 -3
  1222. package/src/form/TextField.tsx +7 -10
  1223. package/src/form/TextFieldAddon.tsx +3 -3
  1224. package/src/form/fileUtils.ts +33 -36
  1225. package/src/form/formConfig.ts +2 -2
  1226. package/src/form/formMessageStyles.ts +5 -5
  1227. package/src/form/inputToggleStyles.ts +3 -3
  1228. package/src/form/menuItemInputToggleStyles.ts +8 -8
  1229. package/src/form/nativeSelectStyles.ts +4 -4
  1230. package/src/form/optionStyles.ts +2 -2
  1231. package/src/form/passwordStyles.ts +4 -4
  1232. package/src/form/selectStyles.ts +2 -2
  1233. package/src/form/selectUtils.ts +4 -4
  1234. package/src/form/sliderUtils.ts +9 -9
  1235. package/src/form/switchStyles.ts +2 -2
  1236. package/src/form/textAreaStyles.ts +4 -4
  1237. package/src/form/textFieldContainerStyles.ts +2 -2
  1238. package/src/form/textFieldStyles.ts +2 -2
  1239. package/src/form/types.ts +10 -10
  1240. package/src/form/useCheckboxGroup.ts +15 -20
  1241. package/src/form/useCombobox.ts +18 -16
  1242. package/src/form/useEditableCombobox.ts +3 -3
  1243. package/src/form/useFileUpload.ts +7 -8
  1244. package/src/form/useFormReset.ts +2 -2
  1245. package/src/form/useListboxProvider.ts +3 -3
  1246. package/src/form/useNumberField.ts +17 -25
  1247. package/src/form/useRadioGroup.ts +14 -18
  1248. package/src/form/useRangeSlider.ts +8 -11
  1249. package/src/form/useSelectCombobox.ts +3 -3
  1250. package/src/form/useSlider.ts +7 -9
  1251. package/src/form/useTextField.ts +22 -31
  1252. package/src/form/utils.ts +7 -8
  1253. package/src/form/validation.ts +18 -18
  1254. package/src/hoverMode/useHoverMode.ts +9 -10
  1255. package/src/hoverMode/useHoverModeProvider.ts +11 -15
  1256. package/src/icon/FontIcon.tsx +1 -1
  1257. package/src/icon/IconRotator.tsx +1 -1
  1258. package/src/icon/MaterialIcon.tsx +2 -2
  1259. package/src/icon/MaterialSymbol.tsx +3 -4
  1260. package/src/icon/SVGIcon.tsx +0 -1
  1261. package/src/icon/TextIconSpacing.tsx +3 -5
  1262. package/src/icon/iconConfig.tsx +14 -16
  1263. package/src/icon/material.ts +4 -4
  1264. package/src/icon/materialConfig.ts +12 -12
  1265. package/src/icon/styles.ts +8 -8
  1266. package/src/interaction/UserInteractionModeProvider.tsx +1 -2
  1267. package/src/interaction/config.ts +2 -2
  1268. package/src/interaction/types.ts +8 -8
  1269. package/src/interaction/useElementInteraction.tsx +6 -7
  1270. package/src/interaction/useHigherContrastChildren.tsx +2 -3
  1271. package/src/layout/LayoutAppBar.tsx +4 -7
  1272. package/src/layout/LayoutNav.tsx +4 -6
  1273. package/src/layout/LayoutWindowSplitter.tsx +3 -4
  1274. package/src/layout/Main.tsx +4 -5
  1275. package/src/layout/__tests__/LayoutAppBar.tsx +23 -0
  1276. package/src/layout/__tests__/useExpandableLayout.tsx +8 -0
  1277. package/src/layout/_layout.scss +12 -1
  1278. package/src/layout/layoutNavStyles.ts +2 -2
  1279. package/src/layout/layoutWindowSplitterStyles.ts +2 -2
  1280. package/src/layout/mainStyles.ts +2 -2
  1281. package/src/layout/useExpandableLayout.ts +85 -23
  1282. package/src/layout/useHorizontalLayoutTransition.ts +8 -8
  1283. package/src/layout/useLayoutAppBarHeight.ts +10 -13
  1284. package/src/layout/useLayoutTree.ts +10 -10
  1285. package/src/layout/useLayoutWindowSplitter.ts +5 -6
  1286. package/src/layout/useMainTabIndex.ts +1 -1
  1287. package/src/layout/useResizableLayout.ts +54 -8
  1288. package/src/layout/useTemporaryLayout.ts +12 -13
  1289. package/src/link/Link.tsx +10 -13
  1290. package/src/link/SkipToMainContent.tsx +2 -4
  1291. package/src/link/styles.ts +4 -4
  1292. package/src/list/List.tsx +3 -4
  1293. package/src/list/ListItem.tsx +4 -6
  1294. package/src/list/ListItemChildren.tsx +1 -2
  1295. package/src/list/ListSubheader.tsx +3 -3
  1296. package/src/list/getListItemHeight.ts +1 -1
  1297. package/src/list/listItemStyles.ts +9 -9
  1298. package/src/list/types.ts +11 -11
  1299. package/src/media-queries/AppSizeProvider.tsx +1 -2
  1300. package/src/media-queries/useMediaQuery.ts +2 -3
  1301. package/src/menu/DropdownMenu.tsx +7 -11
  1302. package/src/menu/Menu.tsx +10 -13
  1303. package/src/menu/MenuBar.tsx +3 -4
  1304. package/src/menu/MenuButton.tsx +8 -8
  1305. package/src/menu/MenuConfigurationProvider.tsx +10 -10
  1306. package/src/menu/MenuItem.tsx +2 -2
  1307. package/src/menu/MenuItemButton.tsx +2 -2
  1308. package/src/menu/MenuItemCircularProgress.tsx +3 -4
  1309. package/src/menu/MenuItemGroup.tsx +3 -4
  1310. package/src/menu/MenuItemSeparator.tsx +2 -2
  1311. package/src/menu/MenuSheet.tsx +7 -9
  1312. package/src/menu/MenuVisibilityProvider.tsx +8 -10
  1313. package/src/menu/MenuWidget.tsx +2 -2
  1314. package/src/menu/MenuWidgetKeyboardProvider.tsx +2 -2
  1315. package/src/menu/useContextMenu.ts +8 -12
  1316. package/src/menu/useMenuBarProvider.ts +6 -6
  1317. package/src/menu/utils.ts +2 -2
  1318. package/src/movement/constants.ts +3 -3
  1319. package/src/movement/types.ts +16 -17
  1320. package/src/movement/useKeyboardMovementProvider.ts +6 -9
  1321. package/src/movement/utils.ts +13 -13
  1322. package/src/navigation/CollapsibleNavGroup.tsx +94 -0
  1323. package/src/navigation/DefaultNavigationRenderer.tsx +71 -0
  1324. package/src/navigation/NavGroup.tsx +39 -0
  1325. package/src/navigation/NavItem.tsx +29 -0
  1326. package/src/navigation/NavItemButton.tsx +104 -0
  1327. package/src/navigation/NavItemLink.tsx +163 -0
  1328. package/src/navigation/NavSubheader.tsx +36 -0
  1329. package/src/navigation/Navigation.tsx +91 -0
  1330. package/src/navigation/__tests__/Navigation.tsx +97 -0
  1331. package/src/navigation/__tests__/__snapshots__/Navigation.tsx.snap +165 -0
  1332. package/src/navigation/_navigation.scss +99 -0
  1333. package/src/navigation/getHrefFromParents.ts +15 -0
  1334. package/src/navigation/navGroupStyles.ts +21 -0
  1335. package/src/navigation/navItemStyles.ts +71 -0
  1336. package/src/navigation/types.ts +166 -0
  1337. package/src/navigation/useActiveHeadingId.ts +190 -0
  1338. package/src/overlay/Overlay.tsx +5 -6
  1339. package/src/overlay/overlayStyles.ts +4 -4
  1340. package/src/portal/Portal.tsx +1 -2
  1341. package/src/portal/PortalContainerProvider.tsx +4 -4
  1342. package/src/positioning/createVerticalPosition.ts +1 -1
  1343. package/src/positioning/getFixedPosition.ts +1 -1
  1344. package/src/positioning/types.ts +4 -4
  1345. package/src/positioning/useFixedPositioning.ts +8 -9
  1346. package/src/positioning/utils.ts +3 -3
  1347. package/src/progress/CircularProgress.tsx +7 -10
  1348. package/src/progress/LinearProgress.tsx +4 -6
  1349. package/src/progress/types.ts +5 -5
  1350. package/src/responsive-item/ResponsiveItemContainer.tsx +10 -15
  1351. package/src/responsive-item/ResponsiveItemOverlay.tsx +6 -7
  1352. package/src/responsive-item/styles.ts +2 -2
  1353. package/src/scroll/ScrollLock.tsx +1 -1
  1354. package/src/scroll/useScrollLock.ts +2 -3
  1355. package/src/searching/caseInsensitive.ts +9 -13
  1356. package/src/searching/fuzzy.ts +4 -5
  1357. package/src/searching/toSearchQuery.ts +1 -1
  1358. package/src/searching/types.ts +2 -2
  1359. package/src/searching/useFuzzyMatch.ts +3 -3
  1360. package/src/searching/utils.ts +3 -3
  1361. package/src/segmented-button/SegmentedButton.tsx +3 -4
  1362. package/src/segmented-button/SegmentedButtonContainer.tsx +3 -4
  1363. package/src/segmented-button/segmentedButtonContainerStyles.ts +2 -2
  1364. package/src/segmented-button/segmentedButtonStyles.ts +2 -2
  1365. package/src/sheet/Sheet.tsx +1 -1
  1366. package/src/sheet/styles.ts +3 -3
  1367. package/src/snackbar/DefaultToastRenderer.tsx +2 -2
  1368. package/src/snackbar/Snackbar.tsx +3 -4
  1369. package/src/snackbar/Toast.tsx +3 -3
  1370. package/src/snackbar/ToastActionButton.tsx +2 -2
  1371. package/src/snackbar/ToastCloseButton.tsx +2 -2
  1372. package/src/snackbar/ToastContent.tsx +2 -2
  1373. package/src/snackbar/ToastManager.tsx +30 -24
  1374. package/src/snackbar/ToastManagerProvider.tsx +6 -6
  1375. package/src/snackbar/__tests__/ToastManagerProvider.tsx +34 -0
  1376. package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +21 -21
  1377. package/src/snackbar/snackbarStyles.ts +4 -5
  1378. package/src/snackbar/toastContentStyles.ts +2 -2
  1379. package/src/snackbar/toastStyles.ts +2 -2
  1380. package/src/snackbar/useCurrentToastActions.ts +3 -3
  1381. package/src/suspense/CircularProgressSuspense.tsx +3 -4
  1382. package/src/suspense/NullSuspense.tsx +3 -4
  1383. package/src/table/Table.tsx +1 -2
  1384. package/src/table/TableCell.tsx +7 -7
  1385. package/src/table/TableCellContent.tsx +3 -3
  1386. package/src/table/TableCheckbox.tsx +11 -15
  1387. package/src/table/TableContainerProvider.tsx +3 -3
  1388. package/src/table/TableFooter.tsx +2 -2
  1389. package/src/table/TableHeader.tsx +2 -2
  1390. package/src/table/TableRadio.tsx +7 -9
  1391. package/src/table/tableCellStyles.ts +2 -2
  1392. package/src/table/tableContainerStyles.ts +2 -2
  1393. package/src/table/tableFooterStyles.ts +1 -1
  1394. package/src/table/tableHeaderStyles.ts +2 -2
  1395. package/src/table/tableRowStyles.ts +2 -2
  1396. package/src/table/tableStyles.ts +2 -2
  1397. package/src/table/types.ts +7 -9
  1398. package/src/tabs/Tab.tsx +4 -4
  1399. package/src/tabs/TabList.tsx +2 -2
  1400. package/src/tabs/TabListScrollButton.tsx +3 -3
  1401. package/src/tabs/tabIndicatorStyles.ts +2 -2
  1402. package/src/tabs/tabListScrollButtonStyles.ts +4 -4
  1403. package/src/tabs/tabListStyles.ts +2 -2
  1404. package/src/tabs/tabStyles.ts +2 -2
  1405. package/src/tabs/useTabs.ts +16 -21
  1406. package/src/tabs/utils.ts +3 -3
  1407. package/src/test-utils/ResizeObserver.ts +9 -11
  1408. package/src/test-utils/matchMedia.ts +13 -17
  1409. package/src/test-utils/render.tsx +2 -2
  1410. package/src/test-utils/timers.ts +2 -3
  1411. package/src/theme/LocalStorageColorSchemeProvider.tsx +2 -2
  1412. package/src/theme/ThemeProvider.tsx +18 -21
  1413. package/src/theme/types.ts +3 -3
  1414. package/src/theme/useCSSVariables.ts +8 -10
  1415. package/src/theme/useColorScheme.ts +6 -7
  1416. package/src/theme/useColorSchemeMetaTag.ts +2 -2
  1417. package/src/theme/useColorSchemeProvider.ts +2 -2
  1418. package/src/theme/usePrefersColorScheme.ts +1 -1
  1419. package/src/theme/utils.ts +1 -1
  1420. package/src/tooltip/Tooltip.tsx +3 -5
  1421. package/src/tooltip/TooltipHoverModeProvider.tsx +5 -6
  1422. package/src/tooltip/constants.ts +9 -9
  1423. package/src/tooltip/tooltipStyles.ts +2 -2
  1424. package/src/tooltip/useTooltip.ts +18 -26
  1425. package/src/tooltip/useTooltipPosition.ts +4 -4
  1426. package/src/transition/CSSTransition.tsx +3 -4
  1427. package/src/transition/Collapse.tsx +5 -8
  1428. package/src/transition/CrossFade.tsx +5 -8
  1429. package/src/transition/ScaleTransition.tsx +7 -10
  1430. package/src/transition/SkeletonPlaceholder.tsx +4 -6
  1431. package/src/transition/Slide.tsx +2 -2
  1432. package/src/transition/SlideContainer.tsx +9 -13
  1433. package/src/transition/collapseStyles.ts +2 -2
  1434. package/src/transition/config.ts +2 -2
  1435. package/src/transition/skeletonPlaceholderUtils.ts +3 -3
  1436. package/src/transition/types.ts +34 -37
  1437. package/src/transition/useCSSTransition.ts +4 -7
  1438. package/src/transition/useCarousel.ts +6 -7
  1439. package/src/transition/useCollapseTransition.ts +10 -13
  1440. package/src/transition/useCrossFadeTransition.ts +5 -6
  1441. package/src/transition/useMaxWidthTransition.ts +2 -2
  1442. package/src/transition/useScaleTransition.ts +8 -11
  1443. package/src/transition/useSkeletonPlaceholder.ts +6 -10
  1444. package/src/transition/useSlideTransition.ts +5 -6
  1445. package/src/transition/useTransition.ts +1 -1
  1446. package/src/transition/utils.ts +6 -6
  1447. package/src/tree/DefaultTreeItemRenderer.tsx +1 -1
  1448. package/src/tree/Tree.tsx +8 -12
  1449. package/src/tree/TreeGroup.tsx +3 -3
  1450. package/src/tree/TreeItem.tsx +3 -4
  1451. package/src/tree/TreeItemExpander.tsx +2 -2
  1452. package/src/tree/TreeProvider.tsx +6 -6
  1453. package/src/tree/styles.ts +10 -10
  1454. package/src/tree/types.ts +6 -7
  1455. package/src/tree/useTree.ts +4 -5
  1456. package/src/tree/useTreeExpansion.ts +2 -2
  1457. package/src/tree/useTreeItems.ts +7 -7
  1458. package/src/tree/useTreeMovement.ts +5 -5
  1459. package/src/tree/useTreeSelection.ts +2 -2
  1460. package/src/tree/utils.ts +2 -2
  1461. package/src/types.ts +14 -16
  1462. package/src/typography/SrOnly.tsx +1 -2
  1463. package/src/typography/TextContainer.tsx +3 -4
  1464. package/src/typography/Typography.tsx +3 -4
  1465. package/src/typography/WritingDirectionProvider.tsx +10 -13
  1466. package/src/typography/textContainerStyles.ts +3 -4
  1467. package/src/typography/typographyStyles.ts +6 -8
  1468. package/src/useAsyncAction.ts +7 -9
  1469. package/src/useDebouncedFunction.ts +3 -4
  1470. package/src/useDropzone.ts +9 -14
  1471. package/src/useElementSize.ts +31 -6
  1472. package/src/useEnsuredId.ts +2 -3
  1473. package/src/useEnsuredRef.ts +3 -4
  1474. package/src/useEnsuredState.ts +2 -2
  1475. package/src/useHtmlClassName.ts +1 -1
  1476. package/src/useIntersectionObserver.ts +13 -20
  1477. package/src/useLocalStorage.ts +17 -22
  1478. package/src/usePageInactive.ts +3 -3
  1479. package/src/useResizeListener.ts +3 -4
  1480. package/src/useResizeObserver.ts +8 -10
  1481. package/src/useThrottledFunction.ts +3 -4
  1482. package/src/useToggle.ts +2 -3
  1483. package/src/useUnmounted.ts +2 -3
  1484. package/src/useWindowSize.ts +3 -4
  1485. package/src/utils/RenderRecursively.tsx +42 -9
  1486. package/src/utils/__tests__/RenderRecursively.tsx +1 -1
  1487. package/src/utils/alphaNumericSort.ts +6 -11
  1488. package/src/utils/applyRef.ts +1 -2
  1489. package/src/utils/bem.ts +2 -3
  1490. package/src/utils/getClientPosition.ts +4 -4
  1491. package/src/utils/getMiddleOfRange.ts +2 -2
  1492. package/src/utils/getPercentage.ts +3 -4
  1493. package/src/utils/getRangeDefaultValue.ts +2 -2
  1494. package/src/utils/getRangeSteps.ts +3 -4
  1495. package/src/utils/identity.ts +1 -1
  1496. package/src/utils/isElementVisible.ts +3 -4
  1497. package/src/utils/loop.ts +2 -2
  1498. package/src/utils/nearest.ts +3 -4
  1499. package/src/utils/parseCssLengthUnit.ts +2 -4
  1500. package/src/utils/randomInt.ts +2 -2
  1501. package/src/utils/wait.ts +2 -3
  1502. package/src/utils/withinRange.ts +3 -4
  1503. package/src/window-splitter/WindowSplitter.tsx +5 -5
  1504. package/src/window-splitter/useWindowSplitter.ts +6 -7
  1505. package/tsdoc.json +14 -0
  1506. package/.turbo/turbo-lint.log +0 -12
  1507. package/.turbo/turbo-typecheck.log +0 -4
  1508. package/dist/index.d.ts +0 -346
  1509. package/dist/index.js +0 -347
  1510. package/dist/index.js.map +0 -1
  1511. package/src/index.ts +0 -349
@@ -4,12 +4,11 @@ import { type TextFieldProps } from "./TextField.js";
4
4
  import { type FormMessageInputLengthCounterProps, type FormMessageProps } from "./types.js";
5
5
  import { type GetErrorIcon, type GetErrorMessage, type IsErrored, type TextFieldValidationOptions, type TextFieldValidationType } from "./validation.js";
6
6
  /**
7
- * @remarks
8
- * \@since 2.5.0
9
- * \@since 6.0.0 Added the `onInvalid` handler
7
+ * @since 2.5.0
8
+ * @since 6.0.0 Added the `onInvalid` handler
10
9
  */
11
10
  export type TextFieldChangeHandlers<E extends HTMLInputElement | HTMLTextAreaElement> = Pick<HTMLAttributes<E>, "onBlur" | "onChange" | "onInvalid">;
12
- /** @remarks \@since 6.0.0 */
11
+ /** @since 6.0.0 */
13
12
  export interface ErrorChangeHandlerOptions<E extends HTMLInputElement | HTMLTextAreaElement> {
14
13
  /**
15
14
  * A ref containing the `TextField` or `TextArea` if you need access to that
@@ -49,12 +48,11 @@ export interface ErrorChangeHandlerOptions<E extends HTMLInputElement | HTMLText
49
48
  * <Button type="submit" disabled={invalid} onClick={submitForm}>Submit</Button>
50
49
  * ```
51
50
  *
52
- * @remarks
53
- * \@since 2.5.0
54
- * \@since 6.0.0 Changed to object argument.
51
+ * @since 2.5.0
52
+ * @since 6.0.0 Changed to object argument.
55
53
  */
56
54
  export type ErrorChangeHandler<E extends HTMLInputElement | HTMLTextAreaElement> = (options: ErrorChangeHandlerOptions<E>) => void;
57
- /** @remarks \@since 2.5.6 */
55
+ /** @since 2.5.6 */
58
56
  export interface TextFieldHookState {
59
57
  /**
60
58
  * The current value for the `TextField` or `TextArea`.
@@ -75,7 +73,7 @@ export interface TextFieldHookState {
75
73
  * All the props that will be generated and return from the `useTextField` hook
76
74
  * that should be passed to a `FormMessage` component.
77
75
  *
78
- * @remarks \@since 2.5.0
76
+ * @since 2.5.0
79
77
  */
80
78
  export interface ProvidedFormMessageProps extends Pick<FormMessageProps, "id" | "theme" | "children">, Required<Pick<TextFieldProps, "error">>, Partial<Pick<FormMessageInputLengthCounterProps, "length" | "maxLength">> {
81
79
  }
@@ -83,19 +81,19 @@ export interface ProvidedFormMessageProps extends Pick<FormMessageProps, "id" |
83
81
  * All the props that will be generated and returned by the `useTextField` hook
84
82
  * that should be passed to a `TextField` component.
85
83
  *
86
- * @remarks \@since 2.5.0
84
+ * @since 2.5.0
87
85
  */
88
86
  export interface ProvidedTextFieldProps<E extends HTMLInputElement | HTMLTextAreaElement> extends TextFieldValidationOptions, TextFieldChangeHandlers<E>, Required<Pick<TextFieldProps, "id" | "name" | "value" | "error">>, Pick<TextFieldProps, "aria-describedby" | "rightAddon"> {
89
87
  /**
90
88
  * A ref that must be passed to the `TextField`/`TextArea` so that the custom
91
89
  * validity behavior can work.
92
90
  *
93
- * @remarks \@since 6.0.0
91
+ * @since 6.0.0
94
92
  */
95
93
  ref: RefCallback<E>;
96
94
  }
97
95
  /**
98
- * @remarks \@since 2.5.0
96
+ * @since 2.5.0
99
97
  */
100
98
  export interface ProvidedTextFieldMessageProps<E extends HTMLInputElement | HTMLTextAreaElement> extends ProvidedTextFieldProps<E> {
101
99
  /**
@@ -104,7 +102,7 @@ export interface ProvidedTextFieldMessageProps<E extends HTMLInputElement | HTML
104
102
  */
105
103
  messageProps: ProvidedFormMessageProps;
106
104
  }
107
- /** @remarks \@since 2.5.6 */
105
+ /** @since 2.5.6 */
108
106
  export interface TextFieldHookOptions<E extends HTMLInputElement | HTMLTextAreaElement> extends TextFieldValidationOptions, TextFieldChangeHandlers<E> {
109
107
  /**
110
108
  * An optional id to use for the `TextField` or `TextArea` that is also used
@@ -120,8 +118,7 @@ export interface TextFieldHookOptions<E extends HTMLInputElement | HTMLTextAreaE
120
118
  * `<textarea>` DOM node, you can use the `fieldRef` returned by this hook
121
119
  * instead.
122
120
  *
123
- * @example
124
- * Accessing TextField DOM Node
121
+ * @example Accessing TextField DOM Node
125
122
  * ```tsx
126
123
  * import { TextField, useTextField } from "@react-md/core";
127
124
  * import { useEffect } from "react";
@@ -239,18 +236,18 @@ export interface TextFieldHookOptions<E extends HTMLInputElement | HTMLTextAreaE
239
236
  */
240
237
  validationType?: TextFieldValidationType;
241
238
  }
242
- /** @remarks \@since 6.0.0 */
239
+ /** @since 6.0.0 */
243
240
  export interface TextFieldImplementation<E extends HTMLInputElement | HTMLTextAreaElement> extends TextFieldHookState {
244
241
  fieldRef: RefObject<E>;
245
242
  reset(): void;
246
243
  setState: UseStateSetter<Readonly<TextFieldHookState>>;
247
244
  fieldProps: ProvidedTextFieldProps<E>;
248
245
  }
249
- /** @remarks \@since 6.0.0 */
246
+ /** @since 6.0.0 */
250
247
  export interface TextFieldWithMessageImplementation<E extends HTMLInputElement | HTMLTextAreaElement> extends TextFieldImplementation<E> {
251
248
  fieldProps: ProvidedTextFieldMessageProps<E>;
252
249
  }
253
- /** @remarks \@since 6.0.0 */
250
+ /** @since 6.0.0 */
254
251
  export interface ValidatedTextFieldImplementation<E extends HTMLInputElement | HTMLTextAreaElement> extends TextFieldImplementation<E> {
255
252
  fieldProps: ProvidedTextFieldProps<E> | ProvidedTextFieldMessageProps<E>;
256
253
  }
@@ -258,8 +255,7 @@ export interface ValidatedTextFieldImplementation<E extends HTMLInputElement | H
258
255
  * If you do not want to display the error messages below the `TextField` and
259
256
  * handle error messages separately, set the `disableMessage` option to `true`.
260
257
  *
261
- * @example
262
- * No Inline Error Messages
258
+ * @example No Inline Error Messages
263
259
  * ```tsx
264
260
  * import type { ReactElement } from "react";
265
261
  * import { TextField, useTextField } from "@react-md/core";
@@ -280,8 +276,7 @@ export declare function useTextField<E extends HTMLInputElement | HTMLTextAreaEl
280
276
  disableMessage: true;
281
277
  }): TextFieldImplementation<E>;
282
278
  /**
283
- * @example
284
- * Simple Example
279
+ * @example Simple Example
285
280
  * ```tsx
286
281
  * import type { ReactElement } from "react";
287
282
  * import { TextField, useTextField } from "@react-md/core";
@@ -295,8 +290,7 @@ export declare function useTextField<E extends HTMLInputElement | HTMLTextAreaEl
295
290
  * }
296
291
  * ```
297
292
  *
298
- * @example
299
- * Inline Counter
293
+ * @example Inline Counter
300
294
  * ```tsx
301
295
  * import type { ReactElement } from "react";
302
296
  * import { TextField, useTextField } from "@react-md/core";
@@ -314,8 +308,7 @@ export declare function useTextField<E extends HTMLInputElement | HTMLTextAreaEl
314
308
  * }
315
309
  * ```
316
310
  *
317
- * @example
318
- * Adding Constraints
311
+ * @example Adding Constraints
319
312
  * ```tsx
320
313
  * import type { ReactElement } from "react";
321
314
  * import { TextField, useTextField } from "@react-md/core";
@@ -333,8 +326,7 @@ export declare function useTextField<E extends HTMLInputElement | HTMLTextAreaEl
333
326
  * }
334
327
  * ```
335
328
  *
336
- * @example
337
- * Custom Validation
329
+ * @example Custom Validation
338
330
  * ```tsx
339
331
  * import type { ReactElement } from "react";
340
332
  * import { TextField, useTextField } from "@react-md/core";
@@ -382,8 +374,7 @@ export declare function useTextField<E extends HTMLInputElement | HTMLTextAreaEl
382
374
  * ```
383
375
  *
384
376
  * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation
385
- * @remarks
386
- * \@since 2.5.6
387
- * \@since 6.0.0 This hook returns an object instead of an ordered list.
377
+ * @since 2.5.6
378
+ * @since 6.0.0 This hook returns an object instead of an ordered list.
388
379
  */
389
380
  export declare function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(options: TextFieldHookOptions<E>): TextFieldWithMessageImplementation<E>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/useTextField.ts"],"sourcesContent":["\"use client\";\nimport {\n useCallback,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n type RefCallback,\n type RefObject,\n} from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { type TextFieldProps } from \"./TextField.js\";\nimport {\n type FormMessageInputLengthCounterProps,\n type FormMessageProps,\n} from \"./types.js\";\nimport {\n defaultGetErrorIcon,\n defaultGetErrorMessage,\n defaultIsErrored,\n type ErrorMessageOptions,\n type GetErrorIcon,\n type GetErrorMessage,\n type IsErrored,\n type TextFieldValidationOptions,\n type TextFieldValidationType,\n} from \"./validation.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0 Added the `onInvalid` handler\n */\nexport type TextFieldChangeHandlers<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> = Pick<HTMLAttributes<E>, \"onBlur\" | \"onChange\" | \"onInvalid\">;\n\n/** @remarks \\@since 6.0.0 */\nexport interface ErrorChangeHandlerOptions<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> {\n /**\n * A ref containing the `TextField` or `TextArea` if you need access to that\n * DOM node for error reporting.\n */\n ref: RefObject<E>;\n\n /**\n * The current name for the `TextField` or `TextArea`.\n */\n name: string;\n\n /**\n * This will be `true` when the `TextField`/`TextArea` has an error.\n */\n error: boolean;\n\n /**\n * The error message returned by {@link GetErrorMessage}/the browser's\n * validation message. This is normally an empty string when the {@link error}\n * state is `false`.\n */\n errorMessage: string;\n}\n\n/**\n * A function that reports the error state changing. A good use-case for this is\n * to keep track of all the errors within your form and keep a submit button\n * disabled until they have been resolved.\n *\n * Example:\n *\n * ```ts\n * const [errors, setErrors] = useState<Record<string, boolean | undefined>>({});\n * const onErrorChange: ErrorChangeHandler = ({ name, error }) =>\n * setErrors((prevErrors) => ({ ...prevErrors, [name]: error }));\n *\n * const invalid = Object.values(errors).some(Boolean);\n *\n * // form implementation is left as an exercise for the reader\n * <Button type=\"submit\" disabled={invalid} onClick={submitForm}>Submit</Button>\n * ```\n *\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0 Changed to object argument.\n */\nexport type ErrorChangeHandler<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> = (options: ErrorChangeHandlerOptions<E>) => void;\n\n/** @remarks \\@since 2.5.6 */\nexport interface TextFieldHookState {\n /**\n * The current value for the `TextField` or `TextArea`.\n */\n value: string;\n\n /**\n * This will be `true` when the `TextField`/`TextArea` has an error.\n */\n error: boolean;\n\n /**\n * The error message returned by {@link GetErrorMessage}/the browser's\n * validation message. This is normally an empty string when the {@link error}\n * state is `false`.\n */\n errorMessage: string;\n}\n\n/**\n * All the props that will be generated and return from the `useTextField` hook\n * that should be passed to a `FormMessage` component.\n *\n * @remarks \\@since 2.5.0\n */\nexport interface ProvidedFormMessageProps\n extends Pick<FormMessageProps, \"id\" | \"theme\" | \"children\">,\n Required<Pick<TextFieldProps, \"error\">>,\n Partial<Pick<FormMessageInputLengthCounterProps, \"length\" | \"maxLength\">> {}\n\n/**\n * All the props that will be generated and returned by the `useTextField` hook\n * that should be passed to a `TextField` component.\n *\n * @remarks \\@since 2.5.0\n */\nexport interface ProvidedTextFieldProps<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldValidationOptions,\n TextFieldChangeHandlers<E>,\n Required<Pick<TextFieldProps, \"id\" | \"name\" | \"value\" | \"error\">>,\n Pick<TextFieldProps, \"aria-describedby\" | \"rightAddon\"> {\n /**\n * A ref that must be passed to the `TextField`/`TextArea` so that the custom\n * validity behavior can work.\n *\n * @remarks \\@since 6.0.0\n */\n ref: RefCallback<E>;\n}\n\n/**\n * @remarks \\@since 2.5.0\n */\nexport interface ProvidedTextFieldMessageProps<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends ProvidedTextFieldProps<E> {\n /**\n * These props will be defined as long as the `disableMessage` prop is not\n * `true` from the `useTextField` hook.\n */\n messageProps: ProvidedFormMessageProps;\n}\n\n/** @remarks \\@since 2.5.6 */\nexport interface TextFieldHookOptions<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldValidationOptions,\n TextFieldChangeHandlers<E> {\n /**\n * An optional id to use for the `TextField` or `TextArea` that is also used\n * to create an id for the inline help/error messages.\n *\n * @defaultValue `\"text-field-\" + useId()`\n */\n id?: string;\n\n /**\n * An optional ref that should be merged with the ref returned by this hook.\n * This should really only be used if you are making a custom component using\n * this hook and forwarding refs. If you need a ref to access the `<input>` or\n * `<textarea>` DOM node, you can use the `fieldRef` returned by this hook\n * instead.\n *\n * @example\n * Accessing TextField DOM Node\n * ```tsx\n * import { TextField, useTextField } from \"@react-md/core\";\n * import { useEffect } from \"react\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldRef, fieldProps } = useTextField({ name: \"example\" });\n *\n * useEffect(() => {\n * fieldRef.current;\n * // ^ HTMLInputElement | null\n * }, [fieldRef]);\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n */\n ref?: Ref<E>;\n\n /**\n * A unique name to attach to the `TextField`, `TextArea` or `Password`\n * component.\n */\n name: string;\n\n /**\n * Boolean if the `FormMessage` should also display a counter for the\n * remaining letters allowed based on the `maxLength`.\n *\n * This will still be considered false if the `maxLength` value is not\n * provided.\n *\n * @defaultValue `false`\n */\n counter?: boolean;\n\n /**\n * This is used internally for the `useNumberField` hook and probably\n * shouldn't be used otherwise. This is just passed into the\n * {@link getErrorMessage} options and is used for additional validation.\n *\n * @defaultValue `false`\n */\n isNumber?: boolean;\n\n /**\n * The default value to use for the `TextField` or `TextArea` one initial\n * render. If you want to manually change the value to something else after\n * the initial render, either change the `key` for the component containing\n * this hook, or use the `setState` function returned from this hook.\n *\n * @defaultValue `\"\"`\n */\n defaultValue?: UseStateInitializer<string>;\n\n /**\n * An optional help text to display in the `FormMessage` component when there\n * is not an error.\n */\n helpText?: ReactNode;\n\n /**\n * A function used to determine if the `TextField` or `TextArea` is an in\n * errored state.\n *\n * @see {@link defaultIsErrored}\n * @defaultValue `defaultIsErrored`\n */\n isErrored?: IsErrored;\n\n /**\n * An optional error icon used in the {@link getErrorIcon} option.\n *\n * @defaultValue `getIcon(\"error\")`\n */\n errorIcon?: ReactNode;\n\n /**\n * A function used to get the error icon to display at the right of the\n * `TextField` or `TextArea`. The default behavior will only show an icon when\n * the `error` state is `true` and an `errorIcon` option has been provided.\n *\n * @see {@link defaultGetErrorIcon}\n * @defaultValue `defaultGetErrorIcon`\n */\n getErrorIcon?: GetErrorIcon;\n\n /**\n * A function to get and display an error message based on the `TextField` or\n * `TextArea` validity.\n *\n * @see {@link defaultGetErrorMessage}\n * @defaultValue `defaultGetErrorMessage`\n */\n getErrorMessage?: GetErrorMessage;\n\n /**\n * An optional function that will be called whenever the `error` state is\n * changed. This can be used for more complex forms to `disable` the Submit\n * button or anything else if any field has an error.\n *\n * @defaultValue `() => {}`\n */\n onErrorChange?: ErrorChangeHandler<E>;\n\n /**\n * Boolean if the `TextField` or `TextArea` will **not** be rendered along\n * with a `FormMessage` component. This will prevent the `aria-describedby`\n * prop from being returned when set to `true`.\n *\n * @defaultValue `false`\n */\n disableMessage?: boolean;\n\n /**\n * Boolean if the `maxLength` prop should not be passed to the `TextField`\n * component since it will prevent any additional characters from being\n * entered in the text field which might feel like weird behavior to some\n * users. This should really only be used when the `counter` option is also\n * enabled and rendering along with a `FormMessage` component.\n *\n * @defaultValue `false`\n */\n disableMaxLength?: boolean;\n\n /**\n * @defaultValue `\"recommended\"`\n */\n validationType?: TextFieldValidationType;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface TextFieldImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldHookState {\n fieldRef: RefObject<E>;\n reset(): void;\n setState: UseStateSetter<Readonly<TextFieldHookState>>;\n fieldProps: ProvidedTextFieldProps<E>;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface TextFieldWithMessageImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldImplementation<E> {\n fieldProps: ProvidedTextFieldMessageProps<E>;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface ValidatedTextFieldImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldImplementation<E> {\n fieldProps: ProvidedTextFieldProps<E> | ProvidedTextFieldMessageProps<E>;\n}\n\n/**\n * If you do not want to display the error messages below the `TextField` and\n * handle error messages separately, set the `disableMessage` option to `true`.\n *\n * @example\n * No Inline Error Messages\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * disableMessage: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * Look at the other {@link useTextField} override for additional examples.\n */\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E> & { disableMessage: true }\n): TextFieldImplementation<E>;\n\n/**\n * @example\n * Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example\n * Inline Counter\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * counter: true,\n * required: true,\n * maxLength: 20,\n * disableMaxLength: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example\n * Adding Constraints\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * required: true,\n * pattern: \"^[A-z]+$\",\n * minLength: 4,\n * maxLength: 20,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example\n * Custom Validation\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * required: true,\n * getErrorMessage(options) {\n * const {\n * value,\n * pattern,\n * required,\n * minLength,\n * maxLength,\n * validity,\n * validationMessage,\n * isNumber,\n * isBlurEvent,\n * validationType,\n * } = options;\n *\n * if (validity.tooLong) {\n * return `No more than ${maxLength} characters.`;\n * }\n *\n * if (validity.tooShort) {\n * return `No more than ${minLength} characters.`;\n * }\n *\n * if (validity.valueMissing) {\n * return \"This value is required!\";\n * }\n *\n * if (value === \"bad value\") {\n * return \"Value cannot be bad value\";\n * }\n *\n * return defaultGetErrorMessage(options);\n * }\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * @remarks\n * \\@since 2.5.6\n * \\@since 6.0.0 This hook returns an object instead of an ordered list.\n */\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E>\n): TextFieldWithMessageImplementation<E>;\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E>\n): ValidatedTextFieldImplementation<E> {\n const {\n id: propId,\n ref: propRef,\n name,\n defaultValue = \"\",\n isNumber = false,\n required,\n pattern,\n minLength,\n maxLength,\n onBlur = noop,\n onChange = noop,\n onInvalid = noop,\n counter = false,\n helpText,\n validationType = \"recommended\",\n disableMessage = false,\n disableMaxLength = false,\n errorIcon: propErrorIcon,\n isErrored = defaultIsErrored,\n onErrorChange = noop,\n getErrorIcon = defaultGetErrorIcon,\n getErrorMessage = defaultGetErrorMessage,\n } = options;\n\n const id = useEnsuredId(propId, \"text-field\");\n const messageId = `${id}-message`;\n const [fieldRef, ref] = useEnsuredRef(propRef);\n const [state, setState] = useState<TextFieldHookState>(() => {\n const value =\n typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n\n return {\n value,\n error: false,\n errorMessage: \"\",\n };\n });\n const { value, error, errorMessage } = state;\n\n // using a `ref` instead of a `useCallback` makes it so the `defaultValue`\n // will always be used once reset.\n const reset = useRef(() => {\n fieldRef.current?.setCustomValidity(\"\");\n setState({ value, error: false, errorMessage: \"\" });\n }).current;\n\n const errored = useRef(error);\n const checkValidity = useCallback(\n (isBlurEvent: boolean) => {\n const field = fieldRef.current;\n if (!field) {\n throw new Error(\"Unable to check validity due to missing ref\");\n }\n\n // need to temporarily set the `maxLength` back so it can be \"verified\"\n // through the validity api\n /* istanbul ignore next */\n if (isBlurEvent && disableMaxLength && typeof maxLength === \"number\") {\n field.maxLength = maxLength;\n }\n\n const { value } = field;\n field.setCustomValidity(\"\");\n field.checkValidity();\n\n // remove the temporarily set `maxLength` attribute after checking the\n // validity\n /* istanbul ignore next */\n if (disableMaxLength && typeof maxLength === \"number\") {\n field.removeAttribute(\"maxLength\");\n }\n\n const options: ErrorMessageOptions = {\n value,\n pattern,\n required,\n minLength,\n maxLength,\n isBlurEvent,\n isNumber,\n validationType,\n validity: field.validity,\n validationMessage: field.validationMessage,\n };\n const errorMessage = getErrorMessage(options);\n const error = isErrored({ ...options, errorMessage });\n\n if (errored.current !== error) {\n errored.current = error;\n onErrorChange({\n ref: fieldRef,\n name,\n error,\n errorMessage,\n });\n }\n\n /* istanbul ignore next */\n if (errorMessage !== field.validationMessage) {\n field.setCustomValidity(errorMessage);\n }\n\n setState((prevState) => {\n if (\n prevState.value === value &&\n prevState.error === error &&\n prevState.errorMessage === errorMessage\n ) {\n return prevState;\n }\n\n return {\n value,\n error,\n errorMessage,\n };\n });\n },\n [\n disableMaxLength,\n fieldRef,\n getErrorMessage,\n isErrored,\n isNumber,\n maxLength,\n minLength,\n name,\n onErrorChange,\n pattern,\n required,\n validationType,\n ]\n );\n\n const errorIcon = getIcon(\"error\", propErrorIcon);\n const fieldProps: ProvidedTextFieldProps<E> & {\n messageProps?: ProvidedFormMessageProps;\n } = {\n id,\n ref,\n name,\n value,\n error,\n required,\n pattern,\n minLength,\n maxLength: disableMaxLength ? undefined : maxLength,\n rightAddon: getErrorIcon({\n error,\n errorIcon,\n errorMessage,\n }),\n onBlur(event) {\n onBlur(event);\n if (event.isPropagationStopped()) {\n return;\n }\n checkValidity(true);\n },\n onChange(event) {\n onChange(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n if (validationType === \"blur\") {\n setState((prevState) => ({\n ...prevState,\n value: event.currentTarget.value,\n }));\n return;\n }\n\n checkValidity(false);\n },\n onInvalid(event) {\n onInvalid(event);\n if (\n event.isPropagationStopped() ||\n event.currentTarget === document.activeElement\n ) {\n return;\n }\n\n // this makes it so that if a submit button is clicked in a form, all\n // textfields will gain the error state immediately\n // also need to extract the validationMessage immediately because of the\n // SyntheticEvent behavior in React. By the time the `setState` is called,\n // the event might've been deleted\n const { validationMessage } = event.currentTarget;\n\n setState((prevState) => {\n if (prevState.error) {\n return prevState;\n }\n\n return {\n ...prevState,\n error: true,\n errorMessage: validationMessage,\n };\n });\n },\n };\n\n if (!disableMessage) {\n fieldProps[\"aria-describedby\"] = messageId;\n fieldProps.messageProps = {\n id: messageId,\n error,\n length: counter ? value.length : undefined,\n maxLength:\n counter && typeof maxLength === \"number\" ? maxLength : undefined,\n children: errorMessage || helpText,\n };\n }\n\n return {\n ...state,\n reset,\n setState,\n fieldRef,\n fieldProps,\n };\n}\n"],"names":["useCallback","useRef","useState","getIcon","useEnsuredId","useEnsuredRef","defaultGetErrorIcon","defaultGetErrorMessage","defaultIsErrored","noop","useTextField","options","id","propId","ref","propRef","name","defaultValue","isNumber","required","pattern","minLength","maxLength","onBlur","onChange","onInvalid","counter","helpText","validationType","disableMessage","disableMaxLength","errorIcon","propErrorIcon","isErrored","onErrorChange","getErrorIcon","getErrorMessage","messageId","fieldRef","state","setState","value","error","errorMessage","reset","current","setCustomValidity","errored","checkValidity","isBlurEvent","field","Error","removeAttribute","validity","validationMessage","prevState","fieldProps","undefined","rightAddon","event","isPropagationStopped","currentTarget","document","activeElement","messageProps","length","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SACEA,WAAW,EACXC,MAAM,EACNC,QAAQ,QAMH,QAAQ;AACf,SAASC,OAAO,QAAQ,wBAAwB;AAEhD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,aAAa,QAAQ,sBAAsB;AAMpD,SACEC,mBAAmB,EACnBC,sBAAsB,EACtBC,gBAAgB,QAOX,kBAAkB;AAEzB,MAAMC,OAAO;AACX,aAAa;AACf;AA2bA,OAAO,SAASC,aACdC,OAAgC;IAEhC,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAKC,OAAO,EACZC,IAAI,EACJC,eAAe,EAAE,EACjBC,WAAW,KAAK,EAChBC,QAAQ,EACRC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,SAASd,IAAI,EACbe,WAAWf,IAAI,EACfgB,YAAYhB,IAAI,EAChBiB,UAAU,KAAK,EACfC,QAAQ,EACRC,iBAAiB,aAAa,EAC9BC,iBAAiB,KAAK,EACtBC,mBAAmB,KAAK,EACxBC,WAAWC,aAAa,EACxBC,YAAYzB,gBAAgB,EAC5B0B,gBAAgBzB,IAAI,EACpB0B,eAAe7B,mBAAmB,EAClC8B,kBAAkB7B,sBAAsB,EACzC,GAAGI;IAEJ,MAAMC,KAAKR,aAAaS,QAAQ;IAChC,MAAMwB,YAAY,CAAC,EAAEzB,GAAG,QAAQ,CAAC;IACjC,MAAM,CAAC0B,UAAUxB,IAAI,GAAGT,cAAcU;IACtC,MAAM,CAACwB,OAAOC,SAAS,GAAGtC,SAA6B;QACrD,MAAMuC,QACJ,OAAOxB,iBAAiB,aAAaA,iBAAiBA;QAExD,OAAO;YACLwB;YACAC,OAAO;YACPC,cAAc;QAChB;IACF;IACA,MAAM,EAAEF,KAAK,EAAEC,KAAK,EAAEC,YAAY,EAAE,GAAGJ;IAEvC,0EAA0E;IAC1E,kCAAkC;IAClC,MAAMK,QAAQ3C,OAAO;QACnBqC,SAASO,OAAO,EAAEC,kBAAkB;QACpCN,SAAS;YAAEC;YAAOC,OAAO;YAAOC,cAAc;QAAG;IACnD,GAAGE,OAAO;IAEV,MAAME,UAAU9C,OAAOyC;IACvB,MAAMM,gBAAgBhD,YACpB,CAACiD;QACC,MAAMC,QAAQZ,SAASO,OAAO;QAC9B,IAAI,CAACK,OAAO;YACV,MAAM,IAAIC,MAAM;QAClB;QAEA,uEAAuE;QACvE,2BAA2B;QAC3B,wBAAwB,GACxB,IAAIF,eAAenB,oBAAoB,OAAOR,cAAc,UAAU;YACpE4B,MAAM5B,SAAS,GAAGA;QACpB;QAEA,MAAM,EAAEmB,KAAK,EAAE,GAAGS;QAClBA,MAAMJ,iBAAiB,CAAC;QACxBI,MAAMF,aAAa;QAEnB,sEAAsE;QACtE,WAAW;QACX,wBAAwB,GACxB,IAAIlB,oBAAoB,OAAOR,cAAc,UAAU;YACrD4B,MAAME,eAAe,CAAC;QACxB;QAEA,MAAMzC,UAA+B;YACnC8B;YACArB;YACAD;YACAE;YACAC;YACA2B;YACA/B;YACAU;YACAyB,UAAUH,MAAMG,QAAQ;YACxBC,mBAAmBJ,MAAMI,iBAAiB;QAC5C;QACA,MAAMX,eAAeP,gBAAgBzB;QACrC,MAAM+B,QAAQT,UAAU;YAAE,GAAGtB,OAAO;YAAEgC;QAAa;QAEnD,IAAII,QAAQF,OAAO,KAAKH,OAAO;YAC7BK,QAAQF,OAAO,GAAGH;YAClBR,cAAc;gBACZpB,KAAKwB;gBACLtB;gBACA0B;gBACAC;YACF;QACF;QAEA,wBAAwB,GACxB,IAAIA,iBAAiBO,MAAMI,iBAAiB,EAAE;YAC5CJ,MAAMJ,iBAAiB,CAACH;QAC1B;QAEAH,SAAS,CAACe;YACR,IACEA,UAAUd,KAAK,KAAKA,SACpBc,UAAUb,KAAK,KAAKA,SACpBa,UAAUZ,YAAY,KAAKA,cAC3B;gBACA,OAAOY;YACT;YAEA,OAAO;gBACLd;gBACAC;gBACAC;YACF;QACF;IACF,GACA;QACEb;QACAQ;QACAF;QACAH;QACAf;QACAI;QACAD;QACAL;QACAkB;QACAd;QACAD;QACAS;KACD;IAGH,MAAMG,YAAY5B,QAAQ,SAAS6B;IACnC,MAAMwB,aAEF;QACF5C;QACAE;QACAE;QACAyB;QACAC;QACAvB;QACAC;QACAC;QACAC,WAAWQ,mBAAmB2B,YAAYnC;QAC1CoC,YAAYvB,aAAa;YACvBO;YACAX;YACAY;QACF;QACApB,QAAOoC,KAAK;YACVpC,OAAOoC;YACP,IAAIA,MAAMC,oBAAoB,IAAI;gBAChC;YACF;YACAZ,cAAc;QAChB;QACAxB,UAASmC,KAAK;YACZnC,SAASmC;YACT,IAAIA,MAAMC,oBAAoB,IAAI;gBAChC;YACF;YAEA,IAAIhC,mBAAmB,QAAQ;gBAC7BY,SAAS,CAACe,YAAe,CAAA;wBACvB,GAAGA,SAAS;wBACZd,OAAOkB,MAAME,aAAa,CAACpB,KAAK;oBAClC,CAAA;gBACA;YACF;YAEAO,cAAc;QAChB;QACAvB,WAAUkC,KAAK;YACblC,UAAUkC;YACV,IACEA,MAAMC,oBAAoB,MAC1BD,MAAME,aAAa,KAAKC,SAASC,aAAa,EAC9C;gBACA;YACF;YAEA,qEAAqE;YACrE,mDAAmD;YACnD,wEAAwE;YACxE,0EAA0E;YAC1E,kCAAkC;YAClC,MAAM,EAAET,iBAAiB,EAAE,GAAGK,MAAME,aAAa;YAEjDrB,SAAS,CAACe;gBACR,IAAIA,UAAUb,KAAK,EAAE;oBACnB,OAAOa;gBACT;gBAEA,OAAO;oBACL,GAAGA,SAAS;oBACZb,OAAO;oBACPC,cAAcW;gBAChB;YACF;QACF;IACF;IAEA,IAAI,CAACzB,gBAAgB;QACnB2B,UAAU,CAAC,mBAAmB,GAAGnB;QACjCmB,WAAWQ,YAAY,GAAG;YACxBpD,IAAIyB;YACJK;YACAuB,QAAQvC,UAAUe,MAAMwB,MAAM,GAAGR;YACjCnC,WACEI,WAAW,OAAOJ,cAAc,WAAWA,YAAYmC;YACzDS,UAAUvB,gBAAgBhB;QAC5B;IACF;IAEA,OAAO;QACL,GAAGY,KAAK;QACRK;QACAJ;QACAF;QACAkB;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/form/useTextField.ts"],"sourcesContent":["\"use client\";\nimport {\n useCallback,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n type RefCallback,\n type RefObject,\n} from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { type TextFieldProps } from \"./TextField.js\";\nimport {\n type FormMessageInputLengthCounterProps,\n type FormMessageProps,\n} from \"./types.js\";\nimport {\n defaultGetErrorIcon,\n defaultGetErrorMessage,\n defaultIsErrored,\n type ErrorMessageOptions,\n type GetErrorIcon,\n type GetErrorMessage,\n type IsErrored,\n type TextFieldValidationOptions,\n type TextFieldValidationType,\n} from \"./validation.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 2.5.0\n * @since 6.0.0 Added the `onInvalid` handler\n */\nexport type TextFieldChangeHandlers<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> = Pick<HTMLAttributes<E>, \"onBlur\" | \"onChange\" | \"onInvalid\">;\n\n/** @since 6.0.0 */\nexport interface ErrorChangeHandlerOptions<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> {\n /**\n * A ref containing the `TextField` or `TextArea` if you need access to that\n * DOM node for error reporting.\n */\n ref: RefObject<E>;\n\n /**\n * The current name for the `TextField` or `TextArea`.\n */\n name: string;\n\n /**\n * This will be `true` when the `TextField`/`TextArea` has an error.\n */\n error: boolean;\n\n /**\n * The error message returned by {@link GetErrorMessage}/the browser's\n * validation message. This is normally an empty string when the {@link error}\n * state is `false`.\n */\n errorMessage: string;\n}\n\n/**\n * A function that reports the error state changing. A good use-case for this is\n * to keep track of all the errors within your form and keep a submit button\n * disabled until they have been resolved.\n *\n * Example:\n *\n * ```ts\n * const [errors, setErrors] = useState<Record<string, boolean | undefined>>({});\n * const onErrorChange: ErrorChangeHandler = ({ name, error }) =>\n * setErrors((prevErrors) => ({ ...prevErrors, [name]: error }));\n *\n * const invalid = Object.values(errors).some(Boolean);\n *\n * // form implementation is left as an exercise for the reader\n * <Button type=\"submit\" disabled={invalid} onClick={submitForm}>Submit</Button>\n * ```\n *\n * @since 2.5.0\n * @since 6.0.0 Changed to object argument.\n */\nexport type ErrorChangeHandler<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> = (options: ErrorChangeHandlerOptions<E>) => void;\n\n/** @since 2.5.6 */\nexport interface TextFieldHookState {\n /**\n * The current value for the `TextField` or `TextArea`.\n */\n value: string;\n\n /**\n * This will be `true` when the `TextField`/`TextArea` has an error.\n */\n error: boolean;\n\n /**\n * The error message returned by {@link GetErrorMessage}/the browser's\n * validation message. This is normally an empty string when the {@link error}\n * state is `false`.\n */\n errorMessage: string;\n}\n\n/**\n * All the props that will be generated and return from the `useTextField` hook\n * that should be passed to a `FormMessage` component.\n *\n * @since 2.5.0\n */\nexport interface ProvidedFormMessageProps\n extends Pick<FormMessageProps, \"id\" | \"theme\" | \"children\">,\n Required<Pick<TextFieldProps, \"error\">>,\n Partial<Pick<FormMessageInputLengthCounterProps, \"length\" | \"maxLength\">> {}\n\n/**\n * All the props that will be generated and returned by the `useTextField` hook\n * that should be passed to a `TextField` component.\n *\n * @since 2.5.0\n */\nexport interface ProvidedTextFieldProps<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldValidationOptions,\n TextFieldChangeHandlers<E>,\n Required<Pick<TextFieldProps, \"id\" | \"name\" | \"value\" | \"error\">>,\n Pick<TextFieldProps, \"aria-describedby\" | \"rightAddon\"> {\n /**\n * A ref that must be passed to the `TextField`/`TextArea` so that the custom\n * validity behavior can work.\n *\n * @since 6.0.0\n */\n ref: RefCallback<E>;\n}\n\n/**\n * @since 2.5.0\n */\nexport interface ProvidedTextFieldMessageProps<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends ProvidedTextFieldProps<E> {\n /**\n * These props will be defined as long as the `disableMessage` prop is not\n * `true` from the `useTextField` hook.\n */\n messageProps: ProvidedFormMessageProps;\n}\n\n/** @since 2.5.6 */\nexport interface TextFieldHookOptions<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldValidationOptions,\n TextFieldChangeHandlers<E> {\n /**\n * An optional id to use for the `TextField` or `TextArea` that is also used\n * to create an id for the inline help/error messages.\n *\n * @defaultValue `\"text-field-\" + useId()`\n */\n id?: string;\n\n /**\n * An optional ref that should be merged with the ref returned by this hook.\n * This should really only be used if you are making a custom component using\n * this hook and forwarding refs. If you need a ref to access the `<input>` or\n * `<textarea>` DOM node, you can use the `fieldRef` returned by this hook\n * instead.\n *\n * @example Accessing TextField DOM Node\n * ```tsx\n * import { TextField, useTextField } from \"@react-md/core\";\n * import { useEffect } from \"react\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldRef, fieldProps } = useTextField({ name: \"example\" });\n *\n * useEffect(() => {\n * fieldRef.current;\n * // ^ HTMLInputElement | null\n * }, [fieldRef]);\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n */\n ref?: Ref<E>;\n\n /**\n * A unique name to attach to the `TextField`, `TextArea` or `Password`\n * component.\n */\n name: string;\n\n /**\n * Boolean if the `FormMessage` should also display a counter for the\n * remaining letters allowed based on the `maxLength`.\n *\n * This will still be considered false if the `maxLength` value is not\n * provided.\n *\n * @defaultValue `false`\n */\n counter?: boolean;\n\n /**\n * This is used internally for the `useNumberField` hook and probably\n * shouldn't be used otherwise. This is just passed into the\n * {@link getErrorMessage} options and is used for additional validation.\n *\n * @defaultValue `false`\n */\n isNumber?: boolean;\n\n /**\n * The default value to use for the `TextField` or `TextArea` one initial\n * render. If you want to manually change the value to something else after\n * the initial render, either change the `key` for the component containing\n * this hook, or use the `setState` function returned from this hook.\n *\n * @defaultValue `\"\"`\n */\n defaultValue?: UseStateInitializer<string>;\n\n /**\n * An optional help text to display in the `FormMessage` component when there\n * is not an error.\n */\n helpText?: ReactNode;\n\n /**\n * A function used to determine if the `TextField` or `TextArea` is an in\n * errored state.\n *\n * @see {@link defaultIsErrored}\n * @defaultValue `defaultIsErrored`\n */\n isErrored?: IsErrored;\n\n /**\n * An optional error icon used in the {@link getErrorIcon} option.\n *\n * @defaultValue `getIcon(\"error\")`\n */\n errorIcon?: ReactNode;\n\n /**\n * A function used to get the error icon to display at the right of the\n * `TextField` or `TextArea`. The default behavior will only show an icon when\n * the `error` state is `true` and an `errorIcon` option has been provided.\n *\n * @see {@link defaultGetErrorIcon}\n * @defaultValue `defaultGetErrorIcon`\n */\n getErrorIcon?: GetErrorIcon;\n\n /**\n * A function to get and display an error message based on the `TextField` or\n * `TextArea` validity.\n *\n * @see {@link defaultGetErrorMessage}\n * @defaultValue `defaultGetErrorMessage`\n */\n getErrorMessage?: GetErrorMessage;\n\n /**\n * An optional function that will be called whenever the `error` state is\n * changed. This can be used for more complex forms to `disable` the Submit\n * button or anything else if any field has an error.\n *\n * @defaultValue `() => {}`\n */\n onErrorChange?: ErrorChangeHandler<E>;\n\n /**\n * Boolean if the `TextField` or `TextArea` will **not** be rendered along\n * with a `FormMessage` component. This will prevent the `aria-describedby`\n * prop from being returned when set to `true`.\n *\n * @defaultValue `false`\n */\n disableMessage?: boolean;\n\n /**\n * Boolean if the `maxLength` prop should not be passed to the `TextField`\n * component since it will prevent any additional characters from being\n * entered in the text field which might feel like weird behavior to some\n * users. This should really only be used when the `counter` option is also\n * enabled and rendering along with a `FormMessage` component.\n *\n * @defaultValue `false`\n */\n disableMaxLength?: boolean;\n\n /**\n * @defaultValue `\"recommended\"`\n */\n validationType?: TextFieldValidationType;\n}\n\n/** @since 6.0.0 */\nexport interface TextFieldImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldHookState {\n fieldRef: RefObject<E>;\n reset(): void;\n setState: UseStateSetter<Readonly<TextFieldHookState>>;\n fieldProps: ProvidedTextFieldProps<E>;\n}\n\n/** @since 6.0.0 */\nexport interface TextFieldWithMessageImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldImplementation<E> {\n fieldProps: ProvidedTextFieldMessageProps<E>;\n}\n\n/** @since 6.0.0 */\nexport interface ValidatedTextFieldImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldImplementation<E> {\n fieldProps: ProvidedTextFieldProps<E> | ProvidedTextFieldMessageProps<E>;\n}\n\n/**\n * If you do not want to display the error messages below the `TextField` and\n * handle error messages separately, set the `disableMessage` option to `true`.\n *\n * @example No Inline Error Messages\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * disableMessage: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * Look at the other {@link useTextField} override for additional examples.\n */\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E> & { disableMessage: true }\n): TextFieldImplementation<E>;\n\n/**\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example Inline Counter\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * counter: true,\n * required: true,\n * maxLength: 20,\n * disableMaxLength: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example Adding Constraints\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * required: true,\n * pattern: \"^[A-z]+$\",\n * minLength: 4,\n * maxLength: 20,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example Custom Validation\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * required: true,\n * getErrorMessage(options) {\n * const {\n * value,\n * pattern,\n * required,\n * minLength,\n * maxLength,\n * validity,\n * validationMessage,\n * isNumber,\n * isBlurEvent,\n * validationType,\n * } = options;\n *\n * if (validity.tooLong) {\n * return `No more than ${maxLength} characters.`;\n * }\n *\n * if (validity.tooShort) {\n * return `No more than ${minLength} characters.`;\n * }\n *\n * if (validity.valueMissing) {\n * return \"This value is required!\";\n * }\n *\n * if (value === \"bad value\") {\n * return \"Value cannot be bad value\";\n * }\n *\n * return defaultGetErrorMessage(options);\n * }\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * @since 2.5.6\n * @since 6.0.0 This hook returns an object instead of an ordered list.\n */\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E>\n): TextFieldWithMessageImplementation<E>;\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E>\n): ValidatedTextFieldImplementation<E> {\n const {\n id: propId,\n ref: propRef,\n name,\n defaultValue = \"\",\n isNumber = false,\n required,\n pattern,\n minLength,\n maxLength,\n onBlur = noop,\n onChange = noop,\n onInvalid = noop,\n counter = false,\n helpText,\n validationType = \"recommended\",\n disableMessage = false,\n disableMaxLength = false,\n errorIcon: propErrorIcon,\n isErrored = defaultIsErrored,\n onErrorChange = noop,\n getErrorIcon = defaultGetErrorIcon,\n getErrorMessage = defaultGetErrorMessage,\n } = options;\n\n const id = useEnsuredId(propId, \"text-field\");\n const messageId = `${id}-message`;\n const [fieldRef, ref] = useEnsuredRef(propRef);\n const [state, setState] = useState<TextFieldHookState>(() => {\n const value =\n typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n\n return {\n value,\n error: false,\n errorMessage: \"\",\n };\n });\n const { value, error, errorMessage } = state;\n\n // using a `ref` instead of a `useCallback` makes it so the `defaultValue`\n // will always be used once reset.\n const reset = useRef(() => {\n fieldRef.current?.setCustomValidity(\"\");\n setState({ value, error: false, errorMessage: \"\" });\n }).current;\n\n const errored = useRef(error);\n const checkValidity = useCallback(\n (isBlurEvent: boolean) => {\n const field = fieldRef.current;\n if (!field) {\n throw new Error(\"Unable to check validity due to missing ref\");\n }\n\n // need to temporarily set the `maxLength` back so it can be \"verified\"\n // through the validity api\n /* istanbul ignore next */\n if (isBlurEvent && disableMaxLength && typeof maxLength === \"number\") {\n field.maxLength = maxLength;\n }\n\n const { value } = field;\n field.setCustomValidity(\"\");\n field.checkValidity();\n\n // remove the temporarily set `maxLength` attribute after checking the\n // validity\n /* istanbul ignore next */\n if (disableMaxLength && typeof maxLength === \"number\") {\n field.removeAttribute(\"maxLength\");\n }\n\n const options: ErrorMessageOptions = {\n value,\n pattern,\n required,\n minLength,\n maxLength,\n isBlurEvent,\n isNumber,\n validationType,\n validity: field.validity,\n validationMessage: field.validationMessage,\n };\n const errorMessage = getErrorMessage(options);\n const error = isErrored({ ...options, errorMessage });\n\n if (errored.current !== error) {\n errored.current = error;\n onErrorChange({\n ref: fieldRef,\n name,\n error,\n errorMessage,\n });\n }\n\n /* istanbul ignore next */\n if (errorMessage !== field.validationMessage) {\n field.setCustomValidity(errorMessage);\n }\n\n setState((prevState) => {\n if (\n prevState.value === value &&\n prevState.error === error &&\n prevState.errorMessage === errorMessage\n ) {\n return prevState;\n }\n\n return {\n value,\n error,\n errorMessage,\n };\n });\n },\n [\n disableMaxLength,\n fieldRef,\n getErrorMessage,\n isErrored,\n isNumber,\n maxLength,\n minLength,\n name,\n onErrorChange,\n pattern,\n required,\n validationType,\n ]\n );\n\n const errorIcon = getIcon(\"error\", propErrorIcon);\n const fieldProps: ProvidedTextFieldProps<E> & {\n messageProps?: ProvidedFormMessageProps;\n } = {\n id,\n ref,\n name,\n value,\n error,\n required,\n pattern,\n minLength,\n maxLength: disableMaxLength ? undefined : maxLength,\n rightAddon: getErrorIcon({\n error,\n errorIcon,\n errorMessage,\n }),\n onBlur(event) {\n onBlur(event);\n if (event.isPropagationStopped()) {\n return;\n }\n checkValidity(true);\n },\n onChange(event) {\n onChange(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n if (validationType === \"blur\") {\n setState((prevState) => ({\n ...prevState,\n value: event.currentTarget.value,\n }));\n return;\n }\n\n checkValidity(false);\n },\n onInvalid(event) {\n onInvalid(event);\n if (\n event.isPropagationStopped() ||\n event.currentTarget === document.activeElement\n ) {\n return;\n }\n\n // this makes it so that if a submit button is clicked in a form, all\n // textfields will gain the error state immediately\n // also need to extract the validationMessage immediately because of the\n // SyntheticEvent behavior in React. By the time the `setState` is called,\n // the event might've been deleted\n const { validationMessage } = event.currentTarget;\n\n setState((prevState) => {\n if (prevState.error) {\n return prevState;\n }\n\n return {\n ...prevState,\n error: true,\n errorMessage: validationMessage,\n };\n });\n },\n };\n\n if (!disableMessage) {\n fieldProps[\"aria-describedby\"] = messageId;\n fieldProps.messageProps = {\n id: messageId,\n error,\n length: counter ? value.length : undefined,\n maxLength:\n counter && typeof maxLength === \"number\" ? maxLength : undefined,\n children: errorMessage || helpText,\n };\n }\n\n return {\n ...state,\n reset,\n setState,\n fieldRef,\n fieldProps,\n };\n}\n"],"names":["useCallback","useRef","useState","getIcon","useEnsuredId","useEnsuredRef","defaultGetErrorIcon","defaultGetErrorMessage","defaultIsErrored","noop","useTextField","options","id","propId","ref","propRef","name","defaultValue","isNumber","required","pattern","minLength","maxLength","onBlur","onChange","onInvalid","counter","helpText","validationType","disableMessage","disableMaxLength","errorIcon","propErrorIcon","isErrored","onErrorChange","getErrorIcon","getErrorMessage","messageId","fieldRef","state","setState","value","error","errorMessage","reset","current","setCustomValidity","errored","checkValidity","isBlurEvent","field","Error","removeAttribute","validity","validationMessage","prevState","fieldProps","undefined","rightAddon","event","isPropagationStopped","currentTarget","document","activeElement","messageProps","length","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SACEA,WAAW,EACXC,MAAM,EACNC,QAAQ,QAMH,QAAQ;AACf,SAASC,OAAO,QAAQ,wBAAwB;AAEhD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,aAAa,QAAQ,sBAAsB;AAMpD,SACEC,mBAAmB,EACnBC,sBAAsB,EACtBC,gBAAgB,QAOX,kBAAkB;AAEzB,MAAMC,OAAO;AACX,aAAa;AACf;AAkbA,OAAO,SAASC,aACdC,OAAgC;IAEhC,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAKC,OAAO,EACZC,IAAI,EACJC,eAAe,EAAE,EACjBC,WAAW,KAAK,EAChBC,QAAQ,EACRC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,SAASd,IAAI,EACbe,WAAWf,IAAI,EACfgB,YAAYhB,IAAI,EAChBiB,UAAU,KAAK,EACfC,QAAQ,EACRC,iBAAiB,aAAa,EAC9BC,iBAAiB,KAAK,EACtBC,mBAAmB,KAAK,EACxBC,WAAWC,aAAa,EACxBC,YAAYzB,gBAAgB,EAC5B0B,gBAAgBzB,IAAI,EACpB0B,eAAe7B,mBAAmB,EAClC8B,kBAAkB7B,sBAAsB,EACzC,GAAGI;IAEJ,MAAMC,KAAKR,aAAaS,QAAQ;IAChC,MAAMwB,YAAY,CAAC,EAAEzB,GAAG,QAAQ,CAAC;IACjC,MAAM,CAAC0B,UAAUxB,IAAI,GAAGT,cAAcU;IACtC,MAAM,CAACwB,OAAOC,SAAS,GAAGtC,SAA6B;QACrD,MAAMuC,QACJ,OAAOxB,iBAAiB,aAAaA,iBAAiBA;QAExD,OAAO;YACLwB;YACAC,OAAO;YACPC,cAAc;QAChB;IACF;IACA,MAAM,EAAEF,KAAK,EAAEC,KAAK,EAAEC,YAAY,EAAE,GAAGJ;IAEvC,0EAA0E;IAC1E,kCAAkC;IAClC,MAAMK,QAAQ3C,OAAO;QACnBqC,SAASO,OAAO,EAAEC,kBAAkB;QACpCN,SAAS;YAAEC;YAAOC,OAAO;YAAOC,cAAc;QAAG;IACnD,GAAGE,OAAO;IAEV,MAAME,UAAU9C,OAAOyC;IACvB,MAAMM,gBAAgBhD,YACpB,CAACiD;QACC,MAAMC,QAAQZ,SAASO,OAAO;QAC9B,IAAI,CAACK,OAAO;YACV,MAAM,IAAIC,MAAM;QAClB;QAEA,uEAAuE;QACvE,2BAA2B;QAC3B,wBAAwB,GACxB,IAAIF,eAAenB,oBAAoB,OAAOR,cAAc,UAAU;YACpE4B,MAAM5B,SAAS,GAAGA;QACpB;QAEA,MAAM,EAAEmB,KAAK,EAAE,GAAGS;QAClBA,MAAMJ,iBAAiB,CAAC;QACxBI,MAAMF,aAAa;QAEnB,sEAAsE;QACtE,WAAW;QACX,wBAAwB,GACxB,IAAIlB,oBAAoB,OAAOR,cAAc,UAAU;YACrD4B,MAAME,eAAe,CAAC;QACxB;QAEA,MAAMzC,UAA+B;YACnC8B;YACArB;YACAD;YACAE;YACAC;YACA2B;YACA/B;YACAU;YACAyB,UAAUH,MAAMG,QAAQ;YACxBC,mBAAmBJ,MAAMI,iBAAiB;QAC5C;QACA,MAAMX,eAAeP,gBAAgBzB;QACrC,MAAM+B,QAAQT,UAAU;YAAE,GAAGtB,OAAO;YAAEgC;QAAa;QAEnD,IAAII,QAAQF,OAAO,KAAKH,OAAO;YAC7BK,QAAQF,OAAO,GAAGH;YAClBR,cAAc;gBACZpB,KAAKwB;gBACLtB;gBACA0B;gBACAC;YACF;QACF;QAEA,wBAAwB,GACxB,IAAIA,iBAAiBO,MAAMI,iBAAiB,EAAE;YAC5CJ,MAAMJ,iBAAiB,CAACH;QAC1B;QAEAH,SAAS,CAACe;YACR,IACEA,UAAUd,KAAK,KAAKA,SACpBc,UAAUb,KAAK,KAAKA,SACpBa,UAAUZ,YAAY,KAAKA,cAC3B;gBACA,OAAOY;YACT;YAEA,OAAO;gBACLd;gBACAC;gBACAC;YACF;QACF;IACF,GACA;QACEb;QACAQ;QACAF;QACAH;QACAf;QACAI;QACAD;QACAL;QACAkB;QACAd;QACAD;QACAS;KACD;IAGH,MAAMG,YAAY5B,QAAQ,SAAS6B;IACnC,MAAMwB,aAEF;QACF5C;QACAE;QACAE;QACAyB;QACAC;QACAvB;QACAC;QACAC;QACAC,WAAWQ,mBAAmB2B,YAAYnC;QAC1CoC,YAAYvB,aAAa;YACvBO;YACAX;YACAY;QACF;QACApB,QAAOoC,KAAK;YACVpC,OAAOoC;YACP,IAAIA,MAAMC,oBAAoB,IAAI;gBAChC;YACF;YACAZ,cAAc;QAChB;QACAxB,UAASmC,KAAK;YACZnC,SAASmC;YACT,IAAIA,MAAMC,oBAAoB,IAAI;gBAChC;YACF;YAEA,IAAIhC,mBAAmB,QAAQ;gBAC7BY,SAAS,CAACe,YAAe,CAAA;wBACvB,GAAGA,SAAS;wBACZd,OAAOkB,MAAME,aAAa,CAACpB,KAAK;oBAClC,CAAA;gBACA;YACF;YAEAO,cAAc;QAChB;QACAvB,WAAUkC,KAAK;YACblC,UAAUkC;YACV,IACEA,MAAMC,oBAAoB,MAC1BD,MAAME,aAAa,KAAKC,SAASC,aAAa,EAC9C;gBACA;YACF;YAEA,qEAAqE;YACrE,mDAAmD;YACnD,wEAAwE;YACxE,0EAA0E;YAC1E,kCAAkC;YAClC,MAAM,EAAET,iBAAiB,EAAE,GAAGK,MAAME,aAAa;YAEjDrB,SAAS,CAACe;gBACR,IAAIA,UAAUb,KAAK,EAAE;oBACnB,OAAOa;gBACT;gBAEA,OAAO;oBACL,GAAGA,SAAS;oBACZb,OAAO;oBACPC,cAAcW;gBAChB;YACF;QACF;IACF;IAEA,IAAI,CAACzB,gBAAgB;QACnB2B,UAAU,CAAC,mBAAmB,GAAGnB;QACjCmB,WAAWQ,YAAY,GAAG;YACxBpD,IAAIyB;YACJK;YACAuB,QAAQvC,UAAUe,MAAMwB,MAAM,GAAGR;YACjCnC,WACEI,WAAW,OAAOJ,cAAc,WAAWA,YAAYmC;YACzDS,UAAUvB,gBAAgBhB;QAC5B;IACF;IAEA,OAAO;QACL,GAAGY,KAAK;QACRK;QACAJ;QACAF;QACAkB;IACF;AACF"}
@@ -16,26 +16,25 @@ import { type KeyboardEvent } from "react";
16
16
  * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit
17
17
  * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit
18
18
  * @internal
19
- * @remarks
20
- * \@since 2.7.0
21
- * \@since 6.0.0 No longer returns a boolean, added the `formId` parameter, and
19
+ * @since 2.7.0
20
+ * @since 6.0.0 No longer returns a boolean, added the `formId` parameter, and
22
21
  * moved into the form package.
23
- * \@since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button
22
+ * @since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button
24
23
  */
25
24
  export declare function tryToSubmitRelatedForm<E extends HTMLElement>(event: KeyboardEvent<E>, formId: string | undefined): void;
26
25
  /**
27
26
  * @internal
28
- * @remarks \@since 6.0.0
27
+ * @since 6.0.0
29
28
  */
30
29
  export type EditableHTMLElement = HTMLInputElement | HTMLTextAreaElement;
31
30
  /**
32
31
  * @internal
33
- * @remarks \@since 6.0.0
32
+ * @since 6.0.0
34
33
  */
35
34
  export type ChangeableHTMLElement = EditableHTMLElement | HTMLSelectElement;
36
35
  /**
37
36
  * @internal
38
- * @remarks \@since 6.0.0
37
+ * @since 6.0.0
39
38
  */
40
39
  export declare function isChangeableHTMLElement(element: Element | null): element is ChangeableHTMLElement;
41
40
  /**
@@ -43,6 +42,6 @@ export declare function isChangeableHTMLElement(element: Element | null): elemen
43
42
  *
44
43
  * @internal
45
44
  * @see https://stackoverflow.com/a/46012210
46
- * @remarks \@since 6.0.0
45
+ * @since 6.0.0
47
46
  */
48
47
  export declare function triggerManualChangeEvent(element: ChangeableHTMLElement | null, value: string | number): void;
@@ -15,11 +15,10 @@
15
15
  * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit
16
16
  * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit
17
17
  * @internal
18
- * @remarks
19
- * \@since 2.7.0
20
- * \@since 6.0.0 No longer returns a boolean, added the `formId` parameter, and
18
+ * @since 2.7.0
19
+ * @since 6.0.0 No longer returns a boolean, added the `formId` parameter, and
21
20
  * moved into the form package.
22
- * \@since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button
21
+ * @since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button
23
22
  */ export function tryToSubmitRelatedForm(event, formId) {
24
23
  const { currentTarget } = event;
25
24
  let form = null;
@@ -40,7 +39,7 @@
40
39
  }
41
40
  /**
42
41
  * @internal
43
- * @remarks \@since 6.0.0
42
+ * @since 6.0.0
44
43
  */ export function isChangeableHTMLElement(element) {
45
44
  return !!element && "value" in element;
46
45
  }
@@ -49,7 +48,7 @@
49
48
  *
50
49
  * @internal
51
50
  * @see https://stackoverflow.com/a/46012210
52
- * @remarks \@since 6.0.0
51
+ * @since 6.0.0
53
52
  */ export function triggerManualChangeEvent(element, value) {
54
53
  if (!element) {
55
54
  return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/utils.ts"],"sourcesContent":["import { type KeyboardEvent } from \"react\";\n\n/**\n * This util should be used to implement the native \"Enter\" keypress behavior\n * for \"fake\" form components to submit the form if exists.\n *\n * The way this will work will be:\n * - attempt to find a form by querying for a parent form element. if no parent\n * form element can be found, try to use the `formId` in a\n * `document.getElementById`\n * - if a form element is found, find the submit button within the form. If\n * there are no submit buttons within the form, try to find a submit button in\n * the document that is linked to this form by `form={formId}`\n * - if the submit button was found, click it to trigger the form submit\n * behavior\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n * @internal\n * @remarks\n * \\@since 2.7.0\n * \\@since 6.0.0 No longer returns a boolean, added the `formId` parameter, and\n * moved into the form package.\n * \\@since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button\n */\nexport function tryToSubmitRelatedForm<E extends HTMLElement>(\n event: KeyboardEvent<E>,\n formId: string | undefined\n): void {\n const { currentTarget } = event;\n let form: HTMLElement | null = null;\n if (formId) {\n form = document.getElementById(formId);\n } else {\n form = currentTarget.closest(\"form\");\n }\n\n if (!form || !(form instanceof HTMLFormElement)) {\n return;\n }\n\n formId = formId || form.id;\n let submit = form.querySelector<HTMLButtonElement>('[type=\"submit\"]');\n if (!submit && formId) {\n submit = document.querySelector<HTMLButtonElement>(\n `[type=\"submit\"][form=\"${formId}\"]`\n );\n }\n\n form.requestSubmit(submit);\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport type EditableHTMLElement = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport type ChangeableHTMLElement = EditableHTMLElement | HTMLSelectElement;\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function isChangeableHTMLElement(\n element: Element | null\n): element is ChangeableHTMLElement {\n return !!element && \"value\" in element;\n}\n\n/**\n * This is used to trigger a change event for a form element.\n *\n * @internal\n * @see https://stackoverflow.com/a/46012210\n * @remarks \\@since 6.0.0\n */\nexport function triggerManualChangeEvent(\n element: ChangeableHTMLElement | null,\n value: string | number\n): void {\n if (!element) {\n return;\n }\n\n const prototype = Object.getPrototypeOf(element);\n const setter = Object.getOwnPropertyDescriptor(prototype, \"value\")?.set;\n if (!setter) {\n return;\n }\n\n setter.call(element, value);\n const event = new Event(\"input\", { bubbles: true });\n element.dispatchEvent(event);\n}\n"],"names":["tryToSubmitRelatedForm","event","formId","currentTarget","form","document","getElementById","closest","HTMLFormElement","id","submit","querySelector","requestSubmit","isChangeableHTMLElement","element","triggerManualChangeEvent","value","prototype","Object","getPrototypeOf","setter","getOwnPropertyDescriptor","set","call","Event","bubbles","dispatchEvent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,SAASA,uBACdC,KAAuB,EACvBC,MAA0B;IAE1B,MAAM,EAAEC,aAAa,EAAE,GAAGF;IAC1B,IAAIG,OAA2B;IAC/B,IAAIF,QAAQ;QACVE,OAAOC,SAASC,cAAc,CAACJ;IACjC,OAAO;QACLE,OAAOD,cAAcI,OAAO,CAAC;IAC/B;IAEA,IAAI,CAACH,QAAQ,CAAEA,CAAAA,gBAAgBI,eAAc,GAAI;QAC/C;IACF;IAEAN,SAASA,UAAUE,KAAKK,EAAE;IAC1B,IAAIC,SAASN,KAAKO,aAAa,CAAoB;IACnD,IAAI,CAACD,UAAUR,QAAQ;QACrBQ,SAASL,SAASM,aAAa,CAC7B,CAAC,sBAAsB,EAAET,OAAO,EAAE,CAAC;IAEvC;IAEAE,KAAKQ,aAAa,CAACF;AACrB;AAcA;;;CAGC,GACD,OAAO,SAASG,wBACdC,OAAuB;IAEvB,OAAO,CAAC,CAACA,WAAW,WAAWA;AACjC;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,yBACdD,OAAqC,EACrCE,KAAsB;IAEtB,IAAI,CAACF,SAAS;QACZ;IACF;IAEA,MAAMG,YAAYC,OAAOC,cAAc,CAACL;IACxC,MAAMM,SAASF,OAAOG,wBAAwB,CAACJ,WAAW,UAAUK;IACpE,IAAI,CAACF,QAAQ;QACX;IACF;IAEAA,OAAOG,IAAI,CAACT,SAASE;IACrB,MAAMf,QAAQ,IAAIuB,MAAM,SAAS;QAAEC,SAAS;IAAK;IACjDX,QAAQY,aAAa,CAACzB;AACxB"}
1
+ {"version":3,"sources":["../../src/form/utils.ts"],"sourcesContent":["import { type KeyboardEvent } from \"react\";\n\n/**\n * This util should be used to implement the native \"Enter\" keypress behavior\n * for \"fake\" form components to submit the form if exists.\n *\n * The way this will work will be:\n * - attempt to find a form by querying for a parent form element. if no parent\n * form element can be found, try to use the `formId` in a\n * `document.getElementById`\n * - if a form element is found, find the submit button within the form. If\n * there are no submit buttons within the form, try to find a submit button in\n * the document that is linked to this form by `form={formId}`\n * - if the submit button was found, click it to trigger the form submit\n * behavior\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n * @internal\n * @since 2.7.0\n * @since 6.0.0 No longer returns a boolean, added the `formId` parameter, and\n * moved into the form package.\n * @since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button\n */\nexport function tryToSubmitRelatedForm<E extends HTMLElement>(\n event: KeyboardEvent<E>,\n formId: string | undefined\n): void {\n const { currentTarget } = event;\n let form: HTMLElement | null = null;\n if (formId) {\n form = document.getElementById(formId);\n } else {\n form = currentTarget.closest(\"form\");\n }\n\n if (!form || !(form instanceof HTMLFormElement)) {\n return;\n }\n\n formId = formId || form.id;\n let submit = form.querySelector<HTMLButtonElement>('[type=\"submit\"]');\n if (!submit && formId) {\n submit = document.querySelector<HTMLButtonElement>(\n `[type=\"submit\"][form=\"${formId}\"]`\n );\n }\n\n form.requestSubmit(submit);\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type EditableHTMLElement = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type ChangeableHTMLElement = EditableHTMLElement | HTMLSelectElement;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function isChangeableHTMLElement(\n element: Element | null\n): element is ChangeableHTMLElement {\n return !!element && \"value\" in element;\n}\n\n/**\n * This is used to trigger a change event for a form element.\n *\n * @internal\n * @see https://stackoverflow.com/a/46012210\n * @since 6.0.0\n */\nexport function triggerManualChangeEvent(\n element: ChangeableHTMLElement | null,\n value: string | number\n): void {\n if (!element) {\n return;\n }\n\n const prototype = Object.getPrototypeOf(element);\n const setter = Object.getOwnPropertyDescriptor(prototype, \"value\")?.set;\n if (!setter) {\n return;\n }\n\n setter.call(element, value);\n const event = new Event(\"input\", { bubbles: true });\n element.dispatchEvent(event);\n}\n"],"names":["tryToSubmitRelatedForm","event","formId","currentTarget","form","document","getElementById","closest","HTMLFormElement","id","submit","querySelector","requestSubmit","isChangeableHTMLElement","element","triggerManualChangeEvent","value","prototype","Object","getPrototypeOf","setter","getOwnPropertyDescriptor","set","call","Event","bubbles","dispatchEvent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASA,uBACdC,KAAuB,EACvBC,MAA0B;IAE1B,MAAM,EAAEC,aAAa,EAAE,GAAGF;IAC1B,IAAIG,OAA2B;IAC/B,IAAIF,QAAQ;QACVE,OAAOC,SAASC,cAAc,CAACJ;IACjC,OAAO;QACLE,OAAOD,cAAcI,OAAO,CAAC;IAC/B;IAEA,IAAI,CAACH,QAAQ,CAAEA,CAAAA,gBAAgBI,eAAc,GAAI;QAC/C;IACF;IAEAN,SAASA,UAAUE,KAAKK,EAAE;IAC1B,IAAIC,SAASN,KAAKO,aAAa,CAAoB;IACnD,IAAI,CAACD,UAAUR,QAAQ;QACrBQ,SAASL,SAASM,aAAa,CAC7B,CAAC,sBAAsB,EAAET,OAAO,EAAE,CAAC;IAEvC;IAEAE,KAAKQ,aAAa,CAACF;AACrB;AAcA;;;CAGC,GACD,OAAO,SAASG,wBACdC,OAAuB;IAEvB,OAAO,CAAC,CAACA,WAAW,WAAWA;AACjC;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,yBACdD,OAAqC,EACrCE,KAAsB;IAEtB,IAAI,CAACF,SAAS;QACZ;IACF;IAEA,MAAMG,YAAYC,OAAOC,cAAc,CAACL;IACxC,MAAMM,SAASF,OAAOG,wBAAwB,CAACJ,WAAW,UAAUK;IACpE,IAAI,CAACF,QAAQ;QACX;IACF;IAEAA,OAAOG,IAAI,CAACT,SAASE;IACrB,MAAMf,QAAQ,IAAIuB,MAAM,SAAS;QAAEC,SAAS;IAAK;IACjDX,QAAQY,aAAa,CAACzB;AACxB"}
@@ -1,7 +1,7 @@
1
1
  import { type InputHTMLAttributes, type ReactNode } from "react";
2
2
  /**
3
- * @remarks \@since 2.5.6
4
- * @remarks \@since 6.0.0 Renamed from `TextConstraints` to
3
+ * @since 2.5.6
4
+ * @since 6.0.0 Renamed from `TextConstraints` to
5
5
  * `TextFieldValidationOptions`
6
6
  */
7
7
  export type TextFieldValidationOptions = Pick<InputHTMLAttributes<HTMLInputElement>, "minLength" | "maxLength" | "required" | "pattern">;
@@ -24,13 +24,13 @@ export type TextFieldValidationOptions = Pick<InputHTMLAttributes<HTMLInputEleme
24
24
  *
25
25
  * @see {@link RECOMMENDED_STATE_KEYS}
26
26
  * @see {@link RECOMMENDED_NUMBER_STATE_KEYS}
27
- * @remarks \@since 2.5.6
28
- * @remarks \@since 6.0.0 Renamed from `ChangeValidationBehavior` to
27
+ * @since 2.5.6
28
+ * @since 6.0.0 Renamed from `ChangeValidationBehavior` to
29
29
  * `TextFieldValidationType`
30
30
  */
31
31
  export type TextFieldValidationType = "blur" | "change" | "recommended" | keyof ValidityState | readonly (keyof ValidityState)[];
32
32
  /**
33
- * @remarks \@since 2.5.0
33
+ * @since 2.5.0
34
34
  */
35
35
  export interface ErrorMessageOptions extends TextFieldValidationOptions {
36
36
  /**
@@ -67,17 +67,17 @@ export interface ErrorMessageOptions extends TextFieldValidationOptions {
67
67
  * @param options - An object containing metadata that can be used to create an
68
68
  * error message for your `TextField` or `TextArea`.
69
69
  * @returns An error message to display or an empty string.
70
- * @remarks \@since 2.5.0
70
+ * @since 2.5.0
71
71
  */
72
72
  export type GetErrorMessage = (options: ErrorMessageOptions) => string;
73
73
  /**
74
74
  * @internal
75
- * @remarks \@since 2.5.0
75
+ * @since 2.5.0
76
76
  */
77
77
  export declare const RECOMMENDED_STATE_KEYS: readonly (keyof ValidityState)[];
78
78
  /**
79
79
  * @internal
80
- * @remarks \@since 2.5.0
80
+ * @since 2.5.0
81
81
  */
82
82
  export declare const RECOMMENDED_NUMBER_STATE_KEYS: readonly (keyof ValidityState)[];
83
83
  /**
@@ -85,11 +85,11 @@ export declare const RECOMMENDED_NUMBER_STATE_KEYS: readonly (keyof ValidityStat
85
85
  * or `TextArea` components that relies on the behavior of the
86
86
  * {@link ChangeValidationBehavior}
87
87
  *
88
- * @remarks \@since 2.5.0
88
+ * @since 2.5.0
89
89
  */
90
90
  export declare const defaultGetErrorMessage: GetErrorMessage;
91
91
  /**
92
- * @remarks \@since 2.5.0
92
+ * @since 2.5.0
93
93
  */
94
94
  export interface IsErroredOptions extends ErrorMessageOptions {
95
95
  /**
@@ -104,7 +104,7 @@ export interface IsErroredOptions extends ErrorMessageOptions {
104
104
  * @param options - All the current options that can be used to determine the
105
105
  * error state.
106
106
  * @returns True if the component is considered to be in an errored state.
107
- * @remarks \@since 2.5.0
107
+ * @since 2.5.0
108
108
  */
109
109
  export type IsErrored = (options: IsErroredOptions) => boolean;
110
110
  /**
@@ -113,11 +113,11 @@ export type IsErrored = (options: IsErroredOptions) => boolean;
113
113
  * value is not within the `minLength` and `maxLength` constraints when they
114
114
  * exist.
115
115
  *
116
- * @remarks \@since 2.5.0
116
+ * @since 2.5.0
117
117
  */
118
118
  export declare const defaultIsErrored: IsErrored;
119
119
  /**
120
- * @remarks \@since 6.0.0
120
+ * @since 6.0.0
121
121
  */
122
122
  export interface GetErrorIconOptions {
123
123
  /**
@@ -139,14 +139,14 @@ export interface GetErrorIconOptions {
139
139
  *
140
140
  * @param options - The {@link GetErrorIconOptions}
141
141
  * @returns An icon to render or falsey to render nothing.
142
- * @remarks \@since 2.5.0
143
- * @remarks \@since 6.0.0 Updated to accept a single object argument
142
+ * @since 2.5.0
143
+ * @since 6.0.0 Updated to accept a single object argument
144
144
  */
145
145
  export type GetErrorIcon = (options: GetErrorIconOptions) => ReactNode;
146
146
  /**
147
147
  * The default implementation for showing an error icon in `TextField` and
148
148
  * `TextArea` components that will only display when the error flag is enabled.
149
149
  *
150
- * @remarks \@since 2.5.0
150
+ * @since 2.5.0
151
151
  */
152
152
  export declare const defaultGetErrorIcon: GetErrorIcon;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @internal
3
- * @remarks \@since 2.5.0
3
+ * @since 2.5.0
4
4
  */ const VALIDITY_STATE_KEYS = [
5
5
  "badInput",
6
6
  "customError",
@@ -15,7 +15,7 @@
15
15
  ];
16
16
  /**
17
17
  * @internal
18
- * @remarks \@since 2.5.0
18
+ * @since 2.5.0
19
19
  */ export const RECOMMENDED_STATE_KEYS = [
20
20
  "badInput",
21
21
  "tooLong",
@@ -23,7 +23,7 @@
23
23
  ];
24
24
  /**
25
25
  * @internal
26
- * @remarks \@since 2.5.0
26
+ * @since 2.5.0
27
27
  */ export const RECOMMENDED_NUMBER_STATE_KEYS = [
28
28
  ...RECOMMENDED_STATE_KEYS,
29
29
  "rangeOverflow",
@@ -39,7 +39,7 @@
39
39
  * of errors.
40
40
  *
41
41
  * @internal
42
- * @remarks \@since 2.5.0
42
+ * @since 2.5.0
43
43
  */ const isRecommended = (validity, isNumber)=>{
44
44
  const errorable = isNumber ? RECOMMENDED_NUMBER_STATE_KEYS : RECOMMENDED_STATE_KEYS;
45
45
  return VALIDITY_STATE_KEYS.every((key)=>{
@@ -52,7 +52,7 @@
52
52
  * or `TextArea` components that relies on the behavior of the
53
53
  * {@link ChangeValidationBehavior}
54
54
  *
55
- * @remarks \@since 2.5.0
55
+ * @since 2.5.0
56
56
  */ export const defaultGetErrorMessage = (options)=>{
57
57
  const { isNumber, isBlurEvent, validity, validationMessage, validationType: validate } = options;
58
58
  if (isBlurEvent || !validationMessage || validate === "change") {
@@ -75,7 +75,7 @@
75
75
  * value is not within the `minLength` and `maxLength` constraints when they
76
76
  * exist.
77
77
  *
78
- * @remarks \@since 2.5.0
78
+ * @since 2.5.0
79
79
  */ export const defaultIsErrored = (options)=>{
80
80
  const { value, errorMessage, minLength, maxLength, isBlurEvent } = options;
81
81
  return !!errorMessage || typeof maxLength === "number" && value.length > maxLength || isBlurEvent && typeof minLength === "number" && value.length < minLength;
@@ -84,7 +84,7 @@
84
84
  * The default implementation for showing an error icon in `TextField` and
85
85
  * `TextArea` components that will only display when the error flag is enabled.
86
86
  *
87
- * @remarks \@since 2.5.0
87
+ * @since 2.5.0
88
88
  */ export const defaultGetErrorIcon = (options)=>{
89
89
  const { error, errorIcon } = options;
90
90
  return error && errorIcon;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/validation.ts"],"sourcesContent":["import { type InputHTMLAttributes, type ReactNode } from \"react\";\n\n/**\n * @remarks \\@since 2.5.6\n * @remarks \\@since 6.0.0 Renamed from `TextConstraints` to\n * `TextFieldValidationOptions`\n */\nexport type TextFieldValidationOptions = Pick<\n InputHTMLAttributes<HTMLInputElement>,\n \"minLength\" | \"maxLength\" | \"required\" | \"pattern\"\n>;\n\n/**\n * Since the default validation messages can be verbose, this type is used to\n * configure when/how to display the native browser messages when the validation\n * state changes during the `change` event phase. The validation message will\n * always be shown on blur.\n *\n * When this is:\n *\n * - `true` -&gt; always show the browser message when it exists\n * - `false` -&gt; never show the browser message\n * - `\"recommended\"` -&gt; only shows the browser message if it is one of the\n * `RECOMMENDED_STATE_KEYS`/`RECOMMENDED_NUMBER_STATE_KEYS` validation errors\n * - `keyof ValidityState` -&gt; only shows the browser message if it is not the\n * specific validation error\n * - `(keyof ValidityState)[]` -&gt; only shows the browser message if it is not\n * the specific validation errors\n *\n * @see {@link RECOMMENDED_STATE_KEYS}\n * @see {@link RECOMMENDED_NUMBER_STATE_KEYS}\n * @remarks \\@since 2.5.6\n * @remarks \\@since 6.0.0 Renamed from `ChangeValidationBehavior` to\n * `TextFieldValidationType`\n */\nexport type TextFieldValidationType =\n | \"blur\"\n | \"change\"\n | \"recommended\"\n | keyof ValidityState\n | readonly (keyof ValidityState)[];\n\n/**\n * @remarks \\@since 2.5.0\n */\nexport interface ErrorMessageOptions extends TextFieldValidationOptions {\n /**\n * The current input or textarea's validity state.\n */\n validity: ValidityState;\n\n /**\n * The browser defined validation message based on the validity state. This\n * will be the empty string when there are no errors.\n */\n validationMessage: string;\n\n /**\n * The current `TextField` or `TextArea` value.\n */\n value: string;\n\n /**\n * This will only be `true` if called by the `useNumberField` hook.\n */\n isNumber: boolean;\n\n /**\n * Boolean if this is triggered from a blur event instead of a change event.\n */\n isBlurEvent: boolean;\n\n /**\n * The validation type defined by the `useTextField` hook.\n */\n validationType: TextFieldValidationType;\n}\n\n/**\n * A function to get a custom error message for specific errors. This is really\n * useful when using the `pattern` attribute to give additional information or\n * changing the native \"language translated\" error message.\n *\n * @param options - An object containing metadata that can be used to create an\n * error message for your `TextField` or `TextArea`.\n * @returns An error message to display or an empty string.\n * @remarks \\@since 2.5.0\n */\nexport type GetErrorMessage = (options: ErrorMessageOptions) => string;\n\n/**\n * @internal\n * @remarks \\@since 2.5.0\n */\nconst VALIDITY_STATE_KEYS: readonly (keyof ValidityState)[] = [\n \"badInput\",\n \"customError\",\n \"patternMismatch\",\n \"rangeOverflow\",\n \"rangeUnderflow\",\n \"stepMismatch\",\n \"tooLong\",\n \"tooShort\",\n \"typeMismatch\",\n \"valueMissing\",\n];\n\n/**\n * @internal\n * @remarks \\@since 2.5.0\n */\nexport const RECOMMENDED_STATE_KEYS: readonly (keyof ValidityState)[] = [\n \"badInput\",\n \"tooLong\",\n \"valueMissing\",\n];\n\n/**\n * @internal\n * @remarks \\@since 2.5.0\n */\nexport const RECOMMENDED_NUMBER_STATE_KEYS: readonly (keyof ValidityState)[] = [\n ...RECOMMENDED_STATE_KEYS,\n \"rangeOverflow\",\n \"rangeUnderflow\",\n \"tooShort\",\n \"typeMismatch\",\n];\n\n/**\n * The validation message is actually kind of weird since it's possible for a\n * form element to have multiple errors at once. The validation message will be\n * the first error that appears, so need to make sure that the first error is\n * one of the recommended state keys so the message appears for only those types\n * of errors.\n *\n * @internal\n * @remarks \\@since 2.5.0\n */\nconst isRecommended = (validity: ValidityState, isNumber: boolean): boolean => {\n const errorable = isNumber\n ? RECOMMENDED_NUMBER_STATE_KEYS\n : RECOMMENDED_STATE_KEYS;\n\n return VALIDITY_STATE_KEYS.every((key) => {\n const errored = validity[key];\n return !errored || errorable.includes(key);\n });\n};\n\n/**\n * The default implementation for getting an error message for the `TextField`\n * or `TextArea` components that relies on the behavior of the\n * {@link ChangeValidationBehavior}\n *\n * @remarks \\@since 2.5.0\n */\nexport const defaultGetErrorMessage: GetErrorMessage = (options) => {\n const {\n isNumber,\n isBlurEvent,\n validity,\n validationMessage,\n validationType: validate,\n } = options;\n\n if (isBlurEvent || !validationMessage || validate === \"change\") {\n return validationMessage;\n }\n\n if (validate === \"blur\") {\n return \"\";\n }\n\n if (validate === \"recommended\") {\n return isRecommended(validity, isNumber) ? validationMessage : \"\";\n }\n\n const keys = typeof validate === \"string\" ? [validate] : validate;\n\n return keys.length &&\n VALIDITY_STATE_KEYS.some((key) => validity[key] && keys.includes(key))\n ? validationMessage\n : \"\";\n};\n\n/**\n * @remarks \\@since 2.5.0\n */\nexport interface IsErroredOptions extends ErrorMessageOptions {\n /**\n * The current error message or an empty string.\n */\n errorMessage: string;\n}\n\n/**\n * A function that is used to determine if a `TextField` or `TextArea` is in an\n * errored state.\n *\n * @param options - All the current options that can be used to determine the\n * error state.\n * @returns True if the component is considered to be in an errored state.\n * @remarks \\@since 2.5.0\n */\nexport type IsErrored = (options: IsErroredOptions) => boolean;\n\n/**\n * The default implementation for checking if a `TextField` or `TextArea` is\n * errored by returning `true` if the `errorMessage` string is truthy or the\n * value is not within the `minLength` and `maxLength` constraints when they\n * exist.\n *\n * @remarks \\@since 2.5.0\n */\nexport const defaultIsErrored: IsErrored = (options) => {\n const { value, errorMessage, minLength, maxLength, isBlurEvent } = options;\n\n return (\n !!errorMessage ||\n (typeof maxLength === \"number\" && value.length > maxLength) ||\n (isBlurEvent && typeof minLength === \"number\" && value.length < minLength)\n );\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface GetErrorIconOptions {\n /**\n * This will be `true` if the `TextField` or `TextArea` is in an errored state.\n */\n error: boolean;\n\n /**\n * The current error icon that was provided.\n */\n errorIcon: ReactNode;\n\n /**\n * The current error message or an empty string.\n */\n errorMessage: string;\n}\n\n/**\n * A function that can be used to dynamically get an error icon based on the\n * current visible error.\n *\n * @param options - The {@link GetErrorIconOptions}\n * @returns An icon to render or falsey to render nothing.\n * @remarks \\@since 2.5.0\n * @remarks \\@since 6.0.0 Updated to accept a single object argument\n */\nexport type GetErrorIcon = (options: GetErrorIconOptions) => ReactNode;\n\n/**\n * The default implementation for showing an error icon in `TextField` and\n * `TextArea` components that will only display when the error flag is enabled.\n *\n * @remarks \\@since 2.5.0\n */\nexport const defaultGetErrorIcon: GetErrorIcon = (options) => {\n const { error, errorIcon } = options;\n\n return error && errorIcon;\n};\n"],"names":["VALIDITY_STATE_KEYS","RECOMMENDED_STATE_KEYS","RECOMMENDED_NUMBER_STATE_KEYS","isRecommended","validity","isNumber","errorable","every","key","errored","includes","defaultGetErrorMessage","options","isBlurEvent","validationMessage","validationType","validate","keys","length","some","defaultIsErrored","value","errorMessage","minLength","maxLength","defaultGetErrorIcon","error","errorIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AA0FA;;;CAGC,GACD,MAAMA,sBAAwD;IAC5D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED;;;CAGC,GACD,OAAO,MAAMC,yBAA2D;IACtE;IACA;IACA;CACD,CAAC;AAEF;;;CAGC,GACD,OAAO,MAAMC,gCAAkE;OAC1ED;IACH;IACA;IACA;IACA;CACD,CAAC;AAEF;;;;;;;;;CASC,GACD,MAAME,gBAAgB,CAACC,UAAyBC;IAC9C,MAAMC,YAAYD,WACdH,gCACAD;IAEJ,OAAOD,oBAAoBO,KAAK,CAAC,CAACC;QAChC,MAAMC,UAAUL,QAAQ,CAACI,IAAI;QAC7B,OAAO,CAACC,WAAWH,UAAUI,QAAQ,CAACF;IACxC;AACF;AAEA;;;;;;CAMC,GACD,OAAO,MAAMG,yBAA0C,CAACC;IACtD,MAAM,EACJP,QAAQ,EACRQ,WAAW,EACXT,QAAQ,EACRU,iBAAiB,EACjBC,gBAAgBC,QAAQ,EACzB,GAAGJ;IAEJ,IAAIC,eAAe,CAACC,qBAAqBE,aAAa,UAAU;QAC9D,OAAOF;IACT;IAEA,IAAIE,aAAa,QAAQ;QACvB,OAAO;IACT;IAEA,IAAIA,aAAa,eAAe;QAC9B,OAAOb,cAAcC,UAAUC,YAAYS,oBAAoB;IACjE;IAEA,MAAMG,OAAO,OAAOD,aAAa,WAAW;QAACA;KAAS,GAAGA;IAEzD,OAAOC,KAAKC,MAAM,IAChBlB,oBAAoBmB,IAAI,CAAC,CAACX,MAAQJ,QAAQ,CAACI,IAAI,IAAIS,KAAKP,QAAQ,CAACF,QAC/DM,oBACA;AACN,EAAE;AAuBF;;;;;;;CAOC,GACD,OAAO,MAAMM,mBAA8B,CAACR;IAC1C,MAAM,EAAES,KAAK,EAAEC,YAAY,EAAEC,SAAS,EAAEC,SAAS,EAAEX,WAAW,EAAE,GAAGD;IAEnE,OACE,CAAC,CAACU,gBACD,OAAOE,cAAc,YAAYH,MAAMH,MAAM,GAAGM,aAChDX,eAAe,OAAOU,cAAc,YAAYF,MAAMH,MAAM,GAAGK;AAEpE,EAAE;AAiCF;;;;;CAKC,GACD,OAAO,MAAME,sBAAoC,CAACb;IAChD,MAAM,EAAEc,KAAK,EAAEC,SAAS,EAAE,GAAGf;IAE7B,OAAOc,SAASC;AAClB,EAAE"}
1
+ {"version":3,"sources":["../../src/form/validation.ts"],"sourcesContent":["import { type InputHTMLAttributes, type ReactNode } from \"react\";\n\n/**\n * @since 2.5.6\n * @since 6.0.0 Renamed from `TextConstraints` to\n * `TextFieldValidationOptions`\n */\nexport type TextFieldValidationOptions = Pick<\n InputHTMLAttributes<HTMLInputElement>,\n \"minLength\" | \"maxLength\" | \"required\" | \"pattern\"\n>;\n\n/**\n * Since the default validation messages can be verbose, this type is used to\n * configure when/how to display the native browser messages when the validation\n * state changes during the `change` event phase. The validation message will\n * always be shown on blur.\n *\n * When this is:\n *\n * - `true` -&gt; always show the browser message when it exists\n * - `false` -&gt; never show the browser message\n * - `\"recommended\"` -&gt; only shows the browser message if it is one of the\n * `RECOMMENDED_STATE_KEYS`/`RECOMMENDED_NUMBER_STATE_KEYS` validation errors\n * - `keyof ValidityState` -&gt; only shows the browser message if it is not the\n * specific validation error\n * - `(keyof ValidityState)[]` -&gt; only shows the browser message if it is not\n * the specific validation errors\n *\n * @see {@link RECOMMENDED_STATE_KEYS}\n * @see {@link RECOMMENDED_NUMBER_STATE_KEYS}\n * @since 2.5.6\n * @since 6.0.0 Renamed from `ChangeValidationBehavior` to\n * `TextFieldValidationType`\n */\nexport type TextFieldValidationType =\n | \"blur\"\n | \"change\"\n | \"recommended\"\n | keyof ValidityState\n | readonly (keyof ValidityState)[];\n\n/**\n * @since 2.5.0\n */\nexport interface ErrorMessageOptions extends TextFieldValidationOptions {\n /**\n * The current input or textarea's validity state.\n */\n validity: ValidityState;\n\n /**\n * The browser defined validation message based on the validity state. This\n * will be the empty string when there are no errors.\n */\n validationMessage: string;\n\n /**\n * The current `TextField` or `TextArea` value.\n */\n value: string;\n\n /**\n * This will only be `true` if called by the `useNumberField` hook.\n */\n isNumber: boolean;\n\n /**\n * Boolean if this is triggered from a blur event instead of a change event.\n */\n isBlurEvent: boolean;\n\n /**\n * The validation type defined by the `useTextField` hook.\n */\n validationType: TextFieldValidationType;\n}\n\n/**\n * A function to get a custom error message for specific errors. This is really\n * useful when using the `pattern` attribute to give additional information or\n * changing the native \"language translated\" error message.\n *\n * @param options - An object containing metadata that can be used to create an\n * error message for your `TextField` or `TextArea`.\n * @returns An error message to display or an empty string.\n * @since 2.5.0\n */\nexport type GetErrorMessage = (options: ErrorMessageOptions) => string;\n\n/**\n * @internal\n * @since 2.5.0\n */\nconst VALIDITY_STATE_KEYS: readonly (keyof ValidityState)[] = [\n \"badInput\",\n \"customError\",\n \"patternMismatch\",\n \"rangeOverflow\",\n \"rangeUnderflow\",\n \"stepMismatch\",\n \"tooLong\",\n \"tooShort\",\n \"typeMismatch\",\n \"valueMissing\",\n];\n\n/**\n * @internal\n * @since 2.5.0\n */\nexport const RECOMMENDED_STATE_KEYS: readonly (keyof ValidityState)[] = [\n \"badInput\",\n \"tooLong\",\n \"valueMissing\",\n];\n\n/**\n * @internal\n * @since 2.5.0\n */\nexport const RECOMMENDED_NUMBER_STATE_KEYS: readonly (keyof ValidityState)[] = [\n ...RECOMMENDED_STATE_KEYS,\n \"rangeOverflow\",\n \"rangeUnderflow\",\n \"tooShort\",\n \"typeMismatch\",\n];\n\n/**\n * The validation message is actually kind of weird since it's possible for a\n * form element to have multiple errors at once. The validation message will be\n * the first error that appears, so need to make sure that the first error is\n * one of the recommended state keys so the message appears for only those types\n * of errors.\n *\n * @internal\n * @since 2.5.0\n */\nconst isRecommended = (validity: ValidityState, isNumber: boolean): boolean => {\n const errorable = isNumber\n ? RECOMMENDED_NUMBER_STATE_KEYS\n : RECOMMENDED_STATE_KEYS;\n\n return VALIDITY_STATE_KEYS.every((key) => {\n const errored = validity[key];\n return !errored || errorable.includes(key);\n });\n};\n\n/**\n * The default implementation for getting an error message for the `TextField`\n * or `TextArea` components that relies on the behavior of the\n * {@link ChangeValidationBehavior}\n *\n * @since 2.5.0\n */\nexport const defaultGetErrorMessage: GetErrorMessage = (options) => {\n const {\n isNumber,\n isBlurEvent,\n validity,\n validationMessage,\n validationType: validate,\n } = options;\n\n if (isBlurEvent || !validationMessage || validate === \"change\") {\n return validationMessage;\n }\n\n if (validate === \"blur\") {\n return \"\";\n }\n\n if (validate === \"recommended\") {\n return isRecommended(validity, isNumber) ? validationMessage : \"\";\n }\n\n const keys = typeof validate === \"string\" ? [validate] : validate;\n\n return keys.length &&\n VALIDITY_STATE_KEYS.some((key) => validity[key] && keys.includes(key))\n ? validationMessage\n : \"\";\n};\n\n/**\n * @since 2.5.0\n */\nexport interface IsErroredOptions extends ErrorMessageOptions {\n /**\n * The current error message or an empty string.\n */\n errorMessage: string;\n}\n\n/**\n * A function that is used to determine if a `TextField` or `TextArea` is in an\n * errored state.\n *\n * @param options - All the current options that can be used to determine the\n * error state.\n * @returns True if the component is considered to be in an errored state.\n * @since 2.5.0\n */\nexport type IsErrored = (options: IsErroredOptions) => boolean;\n\n/**\n * The default implementation for checking if a `TextField` or `TextArea` is\n * errored by returning `true` if the `errorMessage` string is truthy or the\n * value is not within the `minLength` and `maxLength` constraints when they\n * exist.\n *\n * @since 2.5.0\n */\nexport const defaultIsErrored: IsErrored = (options) => {\n const { value, errorMessage, minLength, maxLength, isBlurEvent } = options;\n\n return (\n !!errorMessage ||\n (typeof maxLength === \"number\" && value.length > maxLength) ||\n (isBlurEvent && typeof minLength === \"number\" && value.length < minLength)\n );\n};\n\n/**\n * @since 6.0.0\n */\nexport interface GetErrorIconOptions {\n /**\n * This will be `true` if the `TextField` or `TextArea` is in an errored state.\n */\n error: boolean;\n\n /**\n * The current error icon that was provided.\n */\n errorIcon: ReactNode;\n\n /**\n * The current error message or an empty string.\n */\n errorMessage: string;\n}\n\n/**\n * A function that can be used to dynamically get an error icon based on the\n * current visible error.\n *\n * @param options - The {@link GetErrorIconOptions}\n * @returns An icon to render or falsey to render nothing.\n * @since 2.5.0\n * @since 6.0.0 Updated to accept a single object argument\n */\nexport type GetErrorIcon = (options: GetErrorIconOptions) => ReactNode;\n\n/**\n * The default implementation for showing an error icon in `TextField` and\n * `TextArea` components that will only display when the error flag is enabled.\n *\n * @since 2.5.0\n */\nexport const defaultGetErrorIcon: GetErrorIcon = (options) => {\n const { error, errorIcon } = options;\n\n return error && errorIcon;\n};\n"],"names":["VALIDITY_STATE_KEYS","RECOMMENDED_STATE_KEYS","RECOMMENDED_NUMBER_STATE_KEYS","isRecommended","validity","isNumber","errorable","every","key","errored","includes","defaultGetErrorMessage","options","isBlurEvent","validationMessage","validationType","validate","keys","length","some","defaultIsErrored","value","errorMessage","minLength","maxLength","defaultGetErrorIcon","error","errorIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AA0FA;;;CAGC,GACD,MAAMA,sBAAwD;IAC5D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED;;;CAGC,GACD,OAAO,MAAMC,yBAA2D;IACtE;IACA;IACA;CACD,CAAC;AAEF;;;CAGC,GACD,OAAO,MAAMC,gCAAkE;OAC1ED;IACH;IACA;IACA;IACA;CACD,CAAC;AAEF;;;;;;;;;CASC,GACD,MAAME,gBAAgB,CAACC,UAAyBC;IAC9C,MAAMC,YAAYD,WACdH,gCACAD;IAEJ,OAAOD,oBAAoBO,KAAK,CAAC,CAACC;QAChC,MAAMC,UAAUL,QAAQ,CAACI,IAAI;QAC7B,OAAO,CAACC,WAAWH,UAAUI,QAAQ,CAACF;IACxC;AACF;AAEA;;;;;;CAMC,GACD,OAAO,MAAMG,yBAA0C,CAACC;IACtD,MAAM,EACJP,QAAQ,EACRQ,WAAW,EACXT,QAAQ,EACRU,iBAAiB,EACjBC,gBAAgBC,QAAQ,EACzB,GAAGJ;IAEJ,IAAIC,eAAe,CAACC,qBAAqBE,aAAa,UAAU;QAC9D,OAAOF;IACT;IAEA,IAAIE,aAAa,QAAQ;QACvB,OAAO;IACT;IAEA,IAAIA,aAAa,eAAe;QAC9B,OAAOb,cAAcC,UAAUC,YAAYS,oBAAoB;IACjE;IAEA,MAAMG,OAAO,OAAOD,aAAa,WAAW;QAACA;KAAS,GAAGA;IAEzD,OAAOC,KAAKC,MAAM,IAChBlB,oBAAoBmB,IAAI,CAAC,CAACX,MAAQJ,QAAQ,CAACI,IAAI,IAAIS,KAAKP,QAAQ,CAACF,QAC/DM,oBACA;AACN,EAAE;AAuBF;;;;;;;CAOC,GACD,OAAO,MAAMM,mBAA8B,CAACR;IAC1C,MAAM,EAAES,KAAK,EAAEC,YAAY,EAAEC,SAAS,EAAEC,SAAS,EAAEX,WAAW,EAAE,GAAGD;IAEnE,OACE,CAAC,CAACU,gBACD,OAAOE,cAAc,YAAYH,MAAMH,MAAM,GAAGM,aAChDX,eAAe,OAAOU,cAAc,YAAYF,MAAMH,MAAM,GAAGK;AAEpE,EAAE;AAiCF;;;;;CAKC,GACD,OAAO,MAAME,sBAAoC,CAACb;IAChD,MAAM,EAAEc,KAAK,EAAEC,SAAS,EAAE,GAAGf;IAE7B,OAAOc,SAASC;AAClB,EAAE"}