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

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 (1344) hide show
  1. package/dist/RootHtml.d.ts +0 -2
  2. package/dist/RootHtml.js +0 -2
  3. package/dist/RootHtml.js.map +1 -1
  4. package/dist/_box-shadows.scss +76 -0
  5. package/dist/_colors.scss +279 -277
  6. package/dist/_core.scss +107 -16
  7. package/dist/_object-fit.scss +86 -0
  8. package/dist/_utils.scss +246 -72
  9. package/dist/app-bar/AppBar.d.ts +1 -92
  10. package/dist/app-bar/AppBar.js +1 -42
  11. package/dist/app-bar/AppBar.js.map +1 -1
  12. package/dist/app-bar/AppBarTitle.d.ts +1 -30
  13. package/dist/app-bar/AppBarTitle.js +1 -17
  14. package/dist/app-bar/AppBarTitle.js.map +1 -1
  15. package/dist/app-bar/_app-bar.scss +156 -25
  16. package/dist/app-bar/styles.d.ts +117 -0
  17. package/dist/app-bar/styles.js +55 -0
  18. package/dist/app-bar/styles.js.map +1 -0
  19. package/dist/autocomplete/Autocomplete.d.ts +8 -79
  20. package/dist/autocomplete/Autocomplete.js +112 -83
  21. package/dist/autocomplete/Autocomplete.js.map +1 -1
  22. package/dist/autocomplete/AutocompleteChip.d.ts +8 -0
  23. package/dist/autocomplete/AutocompleteChip.js +34 -0
  24. package/dist/autocomplete/AutocompleteChip.js.map +1 -0
  25. package/dist/autocomplete/AutocompleteCircularProgress.d.ts +5 -11
  26. package/dist/autocomplete/AutocompleteCircularProgress.js +4 -0
  27. package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
  28. package/dist/autocomplete/AutocompleteClearButton.d.ts +9 -0
  29. package/dist/autocomplete/AutocompleteClearButton.js +29 -0
  30. package/dist/autocomplete/AutocompleteClearButton.js.map +1 -0
  31. package/dist/autocomplete/AutocompleteDropdownButton.d.ts +4 -26
  32. package/dist/autocomplete/AutocompleteDropdownButton.js +5 -1
  33. package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
  34. package/dist/autocomplete/AutocompleteListboxChildren.d.ts +22 -0
  35. package/dist/autocomplete/AutocompleteListboxChildren.js +37 -0
  36. package/dist/autocomplete/AutocompleteListboxChildren.js.map +1 -0
  37. package/dist/autocomplete/_autocomplete.scss +362 -34
  38. package/dist/autocomplete/autocompleteStyles.d.ts +22 -0
  39. package/dist/autocomplete/autocompleteStyles.js +17 -8
  40. package/dist/autocomplete/autocompleteStyles.js.map +1 -1
  41. package/dist/autocomplete/defaults.d.ts +9 -9
  42. package/dist/autocomplete/defaults.js +13 -13
  43. package/dist/autocomplete/defaults.js.map +1 -1
  44. package/dist/autocomplete/types.d.ts +554 -56
  45. package/dist/autocomplete/types.js.map +1 -1
  46. package/dist/autocomplete/useAutocomplete.d.ts +22 -0
  47. package/dist/autocomplete/useAutocomplete.js +281 -0
  48. package/dist/autocomplete/useAutocomplete.js.map +1 -0
  49. package/dist/autocomplete/utils.d.ts +81 -0
  50. package/dist/autocomplete/utils.js +108 -0
  51. package/dist/autocomplete/utils.js.map +1 -0
  52. package/dist/avatar/Avatar.d.ts +0 -2
  53. package/dist/avatar/Avatar.js +0 -2
  54. package/dist/avatar/Avatar.js.map +1 -1
  55. package/dist/avatar/_avatar.scss +93 -2
  56. package/dist/badge/Badge.d.ts +2 -23
  57. package/dist/badge/Badge.js +1 -16
  58. package/dist/badge/Badge.js.map +1 -1
  59. package/dist/badge/_badge.scss +90 -3
  60. package/dist/badge/styles.d.ts +26 -0
  61. package/dist/badge/styles.js +18 -0
  62. package/dist/badge/styles.js.map +1 -0
  63. package/dist/box/Box.d.ts +0 -2
  64. package/dist/box/Box.js +2 -3
  65. package/dist/box/Box.js.map +1 -1
  66. package/dist/box/_box.scss +130 -17
  67. package/dist/box/styles.d.ts +6 -0
  68. package/dist/box/styles.js +2 -1
  69. package/dist/box/styles.js.map +1 -1
  70. package/dist/button/AsyncButton.d.ts +1 -1
  71. package/dist/button/AsyncButton.js.map +1 -1
  72. package/dist/button/Button.d.ts +2 -1
  73. package/dist/button/Button.js +2 -1
  74. package/dist/button/Button.js.map +1 -1
  75. package/dist/button/ButtonUnstyled.d.ts +0 -2
  76. package/dist/button/ButtonUnstyled.js +0 -2
  77. package/dist/button/ButtonUnstyled.js.map +1 -1
  78. package/dist/button/_button.scss +157 -25
  79. package/dist/card/Card.d.ts +16 -2
  80. package/dist/card/Card.js +11 -5
  81. package/dist/card/Card.js.map +1 -1
  82. package/dist/card/CardContent.d.ts +0 -2
  83. package/dist/card/CardContent.js +0 -2
  84. package/dist/card/CardContent.js.map +1 -1
  85. package/dist/card/CardFooter.d.ts +0 -3
  86. package/dist/card/CardFooter.js +0 -2
  87. package/dist/card/CardFooter.js.map +1 -1
  88. package/dist/card/CardHeader.d.ts +0 -2
  89. package/dist/card/CardHeader.js +0 -2
  90. package/dist/card/CardHeader.js.map +1 -1
  91. package/dist/card/CardSubtitle.d.ts +0 -3
  92. package/dist/card/CardSubtitle.js +0 -2
  93. package/dist/card/CardSubtitle.js.map +1 -1
  94. package/dist/card/CardTitle.d.ts +0 -3
  95. package/dist/card/CardTitle.js +0 -2
  96. package/dist/card/CardTitle.js.map +1 -1
  97. package/dist/card/ClickableCard.d.ts +2 -1
  98. package/dist/card/ClickableCard.js +5 -2
  99. package/dist/card/ClickableCard.js.map +1 -1
  100. package/dist/card/_card.scss +90 -19
  101. package/dist/card/styles.d.ts +0 -7
  102. package/dist/card/styles.js +2 -3
  103. package/dist/card/styles.js.map +1 -1
  104. package/dist/chip/Chip.d.ts +2 -3
  105. package/dist/chip/Chip.js +2 -3
  106. package/dist/chip/Chip.js.map +1 -1
  107. package/dist/chip/_chip.scss +42 -20
  108. package/dist/chip/styles.d.ts +12 -10
  109. package/dist/chip/styles.js.map +1 -1
  110. package/dist/cssUtils.js.map +1 -1
  111. package/dist/delegateEvent.d.ts +2 -2
  112. package/dist/delegateEvent.js.map +1 -1
  113. package/dist/dialog/Dialog.d.ts +8 -21
  114. package/dist/dialog/Dialog.js +27 -27
  115. package/dist/dialog/Dialog.js.map +1 -1
  116. package/dist/dialog/DialogContent.d.ts +3 -3
  117. package/dist/dialog/DialogContent.js +3 -3
  118. package/dist/dialog/DialogContent.js.map +1 -1
  119. package/dist/dialog/DialogFooter.d.ts +2 -3
  120. package/dist/dialog/DialogFooter.js +2 -3
  121. package/dist/dialog/DialogFooter.js.map +1 -1
  122. package/dist/dialog/DialogHeader.d.ts +3 -3
  123. package/dist/dialog/DialogHeader.js +3 -3
  124. package/dist/dialog/DialogHeader.js.map +1 -1
  125. package/dist/dialog/DialogTitle.d.ts +3 -4
  126. package/dist/dialog/DialogTitle.js +3 -3
  127. package/dist/dialog/DialogTitle.js.map +1 -1
  128. package/dist/dialog/FixedDialog.d.ts +1 -3
  129. package/dist/dialog/FixedDialog.js +0 -8
  130. package/dist/dialog/FixedDialog.js.map +1 -1
  131. package/dist/dialog/NestedDialogProvider.d.ts +0 -1
  132. package/dist/dialog/_dialog.scss +67 -13
  133. package/dist/dialog/styles.d.ts +56 -0
  134. package/dist/dialog/styles.js +29 -2
  135. package/dist/dialog/styles.js.map +1 -1
  136. package/dist/divider/Divider.d.ts +0 -13
  137. package/dist/divider/Divider.js +0 -2
  138. package/dist/divider/Divider.js.map +1 -1
  139. package/dist/divider/_divider.scss +7 -1
  140. package/dist/divider/styles.d.ts +11 -0
  141. package/dist/divider/styles.js.map +1 -1
  142. package/dist/draggable/useDraggable.d.ts +6 -6
  143. package/dist/draggable/useDraggable.js.map +1 -1
  144. package/dist/draggable/utils.d.ts +3 -3
  145. package/dist/draggable/utils.js.map +1 -1
  146. package/dist/expansion-panel/ExpansionList.d.ts +1 -1
  147. package/dist/expansion-panel/ExpansionList.js +1 -1
  148. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  149. package/dist/expansion-panel/ExpansionPanel.d.ts +9 -25
  150. package/dist/expansion-panel/ExpansionPanel.js +1 -12
  151. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  152. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +0 -1
  153. package/dist/expansion-panel/ExpansionPanelHeader.js +0 -1
  154. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  155. package/dist/expansion-panel/_expansion-panel.scss +5 -1
  156. package/dist/expansion-panel/expansionPanelStyles.d.ts +19 -0
  157. package/dist/expansion-panel/expansionPanelStyles.js +14 -0
  158. package/dist/expansion-panel/expansionPanelStyles.js.map +1 -0
  159. package/dist/expansion-panel/useExpansionPanels.js +12 -24
  160. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  161. package/dist/{form → files}/FileInput.d.ts +3 -6
  162. package/dist/{form → files}/FileInput.js +3 -6
  163. package/dist/files/FileInput.js.map +1 -0
  164. package/dist/files/_files.scss +22 -0
  165. package/dist/files/styles.d.ts +5 -0
  166. package/dist/files/styles.js +7 -0
  167. package/dist/files/styles.js.map +1 -0
  168. package/dist/{form → files}/useFileUpload.d.ts +7 -9
  169. package/dist/{form → files}/useFileUpload.js +5 -7
  170. package/dist/files/useFileUpload.js.map +1 -0
  171. package/dist/files/utils.d.ts +169 -0
  172. package/dist/files/utils.js +114 -0
  173. package/dist/files/utils.js.map +1 -0
  174. package/dist/{form/fileUtils.d.ts → files/validation.d.ts} +9 -174
  175. package/dist/{form/fileUtils.js → files/validation.js} +9 -134
  176. package/dist/files/validation.js.map +1 -0
  177. package/dist/focus/useFocusContainer.d.ts +2 -2
  178. package/dist/focus/useFocusContainer.js.map +1 -1
  179. package/dist/focus/utils.js.map +1 -1
  180. package/dist/form/Checkbox.d.ts +0 -1
  181. package/dist/form/Fieldset.d.ts +0 -2
  182. package/dist/form/Fieldset.js.map +1 -1
  183. package/dist/form/FormMessage.d.ts +0 -3
  184. package/dist/form/FormMessage.js +0 -2
  185. package/dist/form/FormMessage.js.map +1 -1
  186. package/dist/form/FormMessageContainer.d.ts +0 -1
  187. package/dist/form/FormMessageContainer.js +4 -3
  188. package/dist/form/FormMessageContainer.js.map +1 -1
  189. package/dist/form/FormMessageCounter.d.ts +0 -2
  190. package/dist/form/FormMessageCounter.js +0 -2
  191. package/dist/form/FormMessageCounter.js.map +1 -1
  192. package/dist/form/InputToggle.d.ts +2 -1
  193. package/dist/form/InputToggle.js +2 -1
  194. package/dist/form/InputToggle.js.map +1 -1
  195. package/dist/form/InputToggleIcon.d.ts +0 -2
  196. package/dist/form/InputToggleIcon.js +0 -2
  197. package/dist/form/InputToggleIcon.js.map +1 -1
  198. package/dist/form/Label.d.ts +0 -3
  199. package/dist/form/Label.js +2 -4
  200. package/dist/form/Label.js.map +1 -1
  201. package/dist/form/Legend.d.ts +0 -3
  202. package/dist/form/Legend.js +0 -2
  203. package/dist/form/Legend.js.map +1 -1
  204. package/dist/form/Listbox.d.ts +24 -0
  205. package/dist/form/Listbox.js +46 -0
  206. package/dist/form/Listbox.js.map +1 -0
  207. package/dist/form/ListboxProvider.d.ts +21 -0
  208. package/dist/form/{useListboxProvider.js → ListboxProvider.js} +1 -1
  209. package/dist/form/ListboxProvider.js.map +1 -0
  210. package/dist/form/MenuItemCheckbox.d.ts +0 -1
  211. package/dist/form/MenuItemRadio.d.ts +0 -1
  212. package/dist/form/MenuItemSwitch.d.ts +0 -1
  213. package/dist/form/MenuItemTextField.js +1 -2
  214. package/dist/form/MenuItemTextField.js.map +1 -1
  215. package/dist/form/NativeSelect.d.ts +0 -2
  216. package/dist/form/NativeSelect.js +7 -6
  217. package/dist/form/NativeSelect.js.map +1 -1
  218. package/dist/form/Option.d.ts +49 -10
  219. package/dist/form/Option.js +11 -9
  220. package/dist/form/Option.js.map +1 -1
  221. package/dist/form/Password.js.map +1 -1
  222. package/dist/form/Radio.d.ts +0 -1
  223. package/dist/form/Select.d.ts +2 -2
  224. package/dist/form/Select.js +81 -85
  225. package/dist/form/Select.js.map +1 -1
  226. package/dist/form/SelectedOption.d.ts +0 -2
  227. package/dist/form/SelectedOption.js +0 -2
  228. package/dist/form/SelectedOption.js.map +1 -1
  229. package/dist/form/Slider.d.ts +4 -4
  230. package/dist/form/Slider.js +6 -2
  231. package/dist/form/Slider.js.map +1 -1
  232. package/dist/form/SliderContainer.d.ts +0 -2
  233. package/dist/form/SliderContainer.js +0 -2
  234. package/dist/form/SliderContainer.js.map +1 -1
  235. package/dist/form/SliderMark.d.ts +0 -2
  236. package/dist/form/SliderMark.js +0 -2
  237. package/dist/form/SliderMark.js.map +1 -1
  238. package/dist/form/SliderMarkLabel.d.ts +0 -2
  239. package/dist/form/SliderMarkLabel.js +0 -2
  240. package/dist/form/SliderMarkLabel.js.map +1 -1
  241. package/dist/form/SliderThumb.d.ts +3 -3
  242. package/dist/form/SliderThumb.js.map +1 -1
  243. package/dist/form/SliderTrack.d.ts +0 -2
  244. package/dist/form/SliderTrack.js +0 -2
  245. package/dist/form/SliderTrack.js.map +1 -1
  246. package/dist/form/SliderValueMarks.d.ts +2 -4
  247. package/dist/form/SliderValueMarks.js +0 -2
  248. package/dist/form/SliderValueMarks.js.map +1 -1
  249. package/dist/form/SliderValueTooltip.js.map +1 -1
  250. package/dist/form/Switch.d.ts +0 -2
  251. package/dist/form/Switch.js +0 -2
  252. package/dist/form/Switch.js.map +1 -1
  253. package/dist/form/SwitchTrack.d.ts +2 -1
  254. package/dist/form/SwitchTrack.js +2 -1
  255. package/dist/form/SwitchTrack.js.map +1 -1
  256. package/dist/form/TextArea.js +1 -2
  257. package/dist/form/TextArea.js.map +1 -1
  258. package/dist/form/TextField.d.ts +0 -2
  259. package/dist/form/TextField.js +1 -4
  260. package/dist/form/TextField.js.map +1 -1
  261. package/dist/form/TextFieldAddon.d.ts +1 -4
  262. package/dist/form/TextFieldAddon.js +1 -3
  263. package/dist/form/TextFieldAddon.js.map +1 -1
  264. package/dist/form/TextFieldContainer.js +1 -2
  265. package/dist/form/TextFieldContainer.js.map +1 -1
  266. package/dist/form/_form.scss +186 -121
  267. package/dist/form/formMessageContainerStyles.d.ts +10 -0
  268. package/dist/form/formMessageContainerStyles.js +11 -0
  269. package/dist/form/formMessageContainerStyles.js.map +1 -0
  270. package/dist/form/inputToggleStyles.js.map +1 -1
  271. package/dist/form/optionStyles.d.ts +1 -0
  272. package/dist/form/optionStyles.js +2 -2
  273. package/dist/form/optionStyles.js.map +1 -1
  274. package/dist/form/selectUtils.js.map +1 -1
  275. package/dist/form/sliderUtils.d.ts +1 -1
  276. package/dist/form/sliderUtils.js.map +1 -1
  277. package/dist/form/textFieldContainerStyles.d.ts +0 -2
  278. package/dist/form/textFieldContainerStyles.js +1 -2
  279. package/dist/form/textFieldContainerStyles.js.map +1 -1
  280. package/dist/form/types.d.ts +3 -10
  281. package/dist/form/types.js.map +1 -1
  282. package/dist/form/useCheckboxGroup.d.ts +17 -17
  283. package/dist/form/useCheckboxGroup.js +9 -17
  284. package/dist/form/useCheckboxGroup.js.map +1 -1
  285. package/dist/form/useCombobox.d.ts +56 -21
  286. package/dist/form/useCombobox.js +19 -4
  287. package/dist/form/useCombobox.js.map +1 -1
  288. package/dist/form/useEditableCombobox.d.ts +24 -4
  289. package/dist/form/useEditableCombobox.js +5 -0
  290. package/dist/form/useEditableCombobox.js.map +1 -1
  291. package/dist/form/useNumberField.js.map +1 -1
  292. package/dist/form/useRadioGroup.d.ts +6 -6
  293. package/dist/form/useRadioGroup.js.map +1 -1
  294. package/dist/form/useResizingTextArea.js.map +1 -1
  295. package/dist/form/useSelectCombobox.d.ts +3 -4
  296. package/dist/form/useSelectCombobox.js.map +1 -1
  297. package/dist/form/useTextField.d.ts +1 -1
  298. package/dist/form/useTextField.js.map +1 -1
  299. package/dist/form/useTextFieldContainerAddons.js.map +1 -1
  300. package/dist/hoverMode/useHoverMode.d.ts +3 -3
  301. package/dist/hoverMode/useHoverMode.js.map +1 -1
  302. package/dist/hoverMode/useHoverModeProvider.d.ts +4 -4
  303. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  304. package/dist/icon/FontIcon.d.ts +0 -2
  305. package/dist/icon/FontIcon.js +0 -2
  306. package/dist/icon/FontIcon.js.map +1 -1
  307. package/dist/icon/IconRotator.d.ts +0 -2
  308. package/dist/icon/IconRotator.js +0 -2
  309. package/dist/icon/IconRotator.js.map +1 -1
  310. package/dist/icon/MaterialIcon.d.ts +0 -2
  311. package/dist/icon/MaterialIcon.js +0 -2
  312. package/dist/icon/MaterialIcon.js.map +1 -1
  313. package/dist/icon/MaterialSymbol.d.ts +0 -1
  314. package/dist/icon/MaterialSymbol.js +0 -1
  315. package/dist/icon/MaterialSymbol.js.map +1 -1
  316. package/dist/icon/SVGIcon.d.ts +0 -2
  317. package/dist/icon/SVGIcon.js +0 -2
  318. package/dist/icon/SVGIcon.js.map +1 -1
  319. package/dist/icon/TextIconSpacing.d.ts +0 -2
  320. package/dist/icon/TextIconSpacing.js +0 -2
  321. package/dist/icon/TextIconSpacing.js.map +1 -1
  322. package/dist/icon/_icon.scss +153 -4
  323. package/dist/icon/iconConfig.d.ts +10 -0
  324. package/dist/icon/iconConfig.js +7 -0
  325. package/dist/icon/iconConfig.js.map +1 -1
  326. package/dist/icon/materialConfig.js.map +1 -1
  327. package/dist/icon/styles.js +1 -1
  328. package/dist/icon/styles.js.map +1 -1
  329. package/dist/interaction/RippleContainer.d.ts +0 -2
  330. package/dist/interaction/RippleContainer.js +0 -2
  331. package/dist/interaction/RippleContainer.js.map +1 -1
  332. package/dist/interaction/UserInteractionModeProvider.d.ts +5 -5
  333. package/dist/interaction/UserInteractionModeProvider.js +12 -8
  334. package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
  335. package/dist/interaction/types.d.ts +20 -2
  336. package/dist/interaction/types.js.map +1 -1
  337. package/dist/interaction/useElementInteraction.d.ts +7 -1
  338. package/dist/interaction/useElementInteraction.js +1 -2
  339. package/dist/interaction/useElementInteraction.js.map +1 -1
  340. package/dist/interaction/utils.d.ts +2 -2
  341. package/dist/interaction/utils.js +2 -2
  342. package/dist/interaction/utils.js.map +1 -1
  343. package/dist/layout/LayoutAppBar.d.ts +0 -1
  344. package/dist/layout/LayoutNav.js +1 -2
  345. package/dist/layout/LayoutNav.js.map +1 -1
  346. package/dist/layout/LayoutWindowSplitter.d.ts +0 -1
  347. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  348. package/dist/layout/_layout.scss +23 -10
  349. package/dist/layout/useExpandableLayout.d.ts +3 -3
  350. package/dist/layout/useExpandableLayout.js.map +1 -1
  351. package/dist/layout/useHorizontalLayoutTransition.js +1 -1
  352. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  353. package/dist/layout/useLayoutAppBarHeight.d.ts +2 -3
  354. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  355. package/dist/layout/useLayoutTree.d.ts +2 -2
  356. package/dist/layout/useLayoutTree.js.map +1 -1
  357. package/dist/layout/useTemporaryLayout.d.ts +2 -2
  358. package/dist/layout/useTemporaryLayout.js.map +1 -1
  359. package/dist/link/Link.d.ts +0 -2
  360. package/dist/link/Link.js +0 -2
  361. package/dist/link/Link.js.map +1 -1
  362. package/dist/link/SkipToMainContent.js.map +1 -1
  363. package/dist/list/List.d.ts +0 -20
  364. package/dist/list/List.js +1 -14
  365. package/dist/list/List.js.map +1 -1
  366. package/dist/list/ListItem.d.ts +2 -17
  367. package/dist/list/ListItem.js +2 -1
  368. package/dist/list/ListItem.js.map +1 -1
  369. package/dist/list/ListItemAddon.d.ts +0 -2
  370. package/dist/list/ListItemAddon.js +0 -2
  371. package/dist/list/ListItemAddon.js.map +1 -1
  372. package/dist/list/ListItemChildren.d.ts +0 -2
  373. package/dist/list/ListItemChildren.js +0 -2
  374. package/dist/list/ListItemChildren.js.map +1 -1
  375. package/dist/list/ListItemLink.d.ts +2 -1
  376. package/dist/list/ListItemLink.js +2 -1
  377. package/dist/list/ListItemLink.js.map +1 -1
  378. package/dist/list/ListItemText.d.ts +0 -2
  379. package/dist/list/ListItemText.js +0 -2
  380. package/dist/list/ListItemText.js.map +1 -1
  381. package/dist/list/ListSubheader.d.ts +3 -2
  382. package/dist/list/ListSubheader.js +0 -2
  383. package/dist/list/ListSubheader.js.map +1 -1
  384. package/dist/list/_list.scss +6 -5
  385. package/dist/list/getListItemHeight.d.ts +2 -2
  386. package/dist/list/getListItemHeight.js +2 -2
  387. package/dist/list/getListItemHeight.js.map +1 -1
  388. package/dist/list/listItemStyles.d.ts +17 -1
  389. package/dist/list/listItemStyles.js.map +1 -1
  390. package/dist/list/listStyles.d.ts +18 -0
  391. package/dist/list/listStyles.js +14 -0
  392. package/dist/list/listStyles.js.map +1 -0
  393. package/dist/list/types.d.ts +9 -3
  394. package/dist/list/types.js +6 -1
  395. package/dist/list/types.js.map +1 -1
  396. package/dist/media-queries/AppSizeProvider.d.ts +8 -0
  397. package/dist/media-queries/AppSizeProvider.js +2 -0
  398. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  399. package/dist/media-queries/_media-queries.scss +12 -0
  400. package/dist/media-queries/appSize.d.ts +5 -5
  401. package/dist/media-queries/appSize.js.map +1 -1
  402. package/dist/media-queries/useMediaQuery.d.ts +1 -1
  403. package/dist/media-queries/useMediaQuery.js +4 -2
  404. package/dist/media-queries/useMediaQuery.js.map +1 -1
  405. package/dist/menu/DropdownMenu.js.map +1 -1
  406. package/dist/menu/Menu.d.ts +8 -3
  407. package/dist/menu/Menu.js +2 -1
  408. package/dist/menu/Menu.js.map +1 -1
  409. package/dist/menu/MenuBar.d.ts +0 -1
  410. package/dist/menu/MenuButton.d.ts +0 -1
  411. package/dist/menu/MenuConfigurationProvider.js.map +1 -1
  412. package/dist/menu/MenuItem.d.ts +0 -1
  413. package/dist/menu/MenuItemButton.d.ts +0 -1
  414. package/dist/menu/MenuItemButton.js +6 -2
  415. package/dist/menu/MenuItemButton.js.map +1 -1
  416. package/dist/menu/useContextMenu.d.ts +3 -3
  417. package/dist/menu/useContextMenu.js.map +1 -1
  418. package/dist/menu/useMenuBarProvider.d.ts +0 -1
  419. package/dist/movement/types.d.ts +5 -5
  420. package/dist/movement/types.js.map +1 -1
  421. package/dist/movement/useKeyboardMovementProvider.d.ts +0 -1
  422. package/dist/navigation/CollapsibleNavGroup.d.ts +5 -3
  423. package/dist/navigation/CollapsibleNavGroup.js +3 -4
  424. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  425. package/dist/navigation/DefaultNavigationRenderer.d.ts +1 -2
  426. package/dist/navigation/DefaultNavigationRenderer.js +6 -2
  427. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
  428. package/dist/navigation/NavGroup.d.ts +0 -2
  429. package/dist/navigation/NavGroup.js +0 -2
  430. package/dist/navigation/NavGroup.js.map +1 -1
  431. package/dist/navigation/NavItem.d.ts +0 -2
  432. package/dist/navigation/NavItem.js +0 -2
  433. package/dist/navigation/NavItem.js.map +1 -1
  434. package/dist/navigation/NavItemButton.d.ts +1 -1
  435. package/dist/navigation/NavItemButton.js +1 -0
  436. package/dist/navigation/NavItemButton.js.map +1 -1
  437. package/dist/navigation/NavItemLink.d.ts +3 -2
  438. package/dist/navigation/NavItemLink.js +6 -2
  439. package/dist/navigation/NavItemLink.js.map +1 -1
  440. package/dist/navigation/NavSubheader.d.ts +2 -6
  441. package/dist/navigation/NavSubheader.js +0 -2
  442. package/dist/navigation/NavSubheader.js.map +1 -1
  443. package/dist/navigation/Navigation.d.ts +1 -1
  444. package/dist/navigation/Navigation.js.map +1 -1
  445. package/dist/navigation/_navigation.scss +6 -5
  446. package/dist/navigation/types.d.ts +54 -6
  447. package/dist/navigation/types.js.map +1 -1
  448. package/dist/navigation/useActiveHeadingId.d.ts +1 -1
  449. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  450. package/dist/navigation/useNavigationExpansion.d.ts +104 -0
  451. package/dist/navigation/useNavigationExpansion.js +77 -0
  452. package/dist/navigation/useNavigationExpansion.js.map +1 -0
  453. package/dist/navigation/utils.d.ts +13 -0
  454. package/dist/navigation/utils.js +36 -0
  455. package/dist/navigation/utils.js.map +1 -0
  456. package/dist/objectFit.d.ts +69 -0
  457. package/dist/objectFit.js +52 -0
  458. package/dist/objectFit.js.map +1 -0
  459. package/dist/overlay/_overlay.scss +2 -1
  460. package/dist/positioning/useFixedPositioning.d.ts +17 -4
  461. package/dist/positioning/useFixedPositioning.js +10 -5
  462. package/dist/positioning/useFixedPositioning.js.map +1 -1
  463. package/dist/positioning/utils.js.map +1 -1
  464. package/dist/progress/CircularProgress.d.ts +0 -2
  465. package/dist/progress/CircularProgress.js +0 -2
  466. package/dist/progress/CircularProgress.js.map +1 -1
  467. package/dist/progress/LinearProgress.d.ts +0 -2
  468. package/dist/progress/LinearProgress.js +0 -2
  469. package/dist/progress/LinearProgress.js.map +1 -1
  470. package/dist/progress/_progress.scss +20 -14
  471. package/dist/responsive-item/ResponsiveItem.d.ts +64 -0
  472. package/dist/responsive-item/ResponsiveItem.js +68 -0
  473. package/dist/responsive-item/ResponsiveItem.js.map +1 -0
  474. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +1 -21
  475. package/dist/responsive-item/ResponsiveItemOverlay.js +1 -14
  476. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  477. package/dist/responsive-item/_responsive-item.scss +110 -133
  478. package/dist/responsive-item/responsiveItemOverlayStyles.d.ts +19 -0
  479. package/dist/responsive-item/responsiveItemOverlayStyles.js +14 -0
  480. package/dist/responsive-item/responsiveItemOverlayStyles.js.map +1 -0
  481. package/dist/responsive-item/responsiveItemStyles.d.ts +52 -0
  482. package/dist/responsive-item/responsiveItemStyles.js +15 -0
  483. package/dist/responsive-item/responsiveItemStyles.js.map +1 -0
  484. package/dist/scroll/useScrollLock.d.ts +5 -0
  485. package/dist/scroll/useScrollLock.js.map +1 -1
  486. package/dist/searching/utils.d.ts +2 -2
  487. package/dist/searching/utils.js.map +1 -1
  488. package/dist/segmented-button/SegmentedButton.d.ts +2 -1
  489. package/dist/segmented-button/SegmentedButton.js +2 -1
  490. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  491. package/dist/segmented-button/SegmentedButtonContainer.d.ts +0 -2
  492. package/dist/segmented-button/SegmentedButtonContainer.js +0 -2
  493. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  494. package/dist/segmented-button/_segmented-button.scss +6 -6
  495. package/dist/sheet/Sheet.d.ts +30 -16
  496. package/dist/sheet/Sheet.js +24 -14
  497. package/dist/sheet/Sheet.js.map +1 -1
  498. package/dist/sheet/_sheet.scss +18 -6
  499. package/dist/sheet/styles.d.ts +29 -0
  500. package/dist/sheet/styles.js +13 -0
  501. package/dist/sheet/styles.js.map +1 -1
  502. package/dist/snackbar/ToastActionButton.d.ts +0 -1
  503. package/dist/snackbar/ToastCloseButton.d.ts +0 -1
  504. package/dist/snackbar/ToastManager.js +15 -5
  505. package/dist/snackbar/ToastManager.js.map +1 -1
  506. package/dist/snackbar/_snackbar.scss +30 -17
  507. package/dist/snackbar/useCurrentToastActions.d.ts +5 -6
  508. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  509. package/dist/suspense/CircularProgressSuspense.d.ts +0 -2
  510. package/dist/suspense/CircularProgressSuspense.js +0 -2
  511. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  512. package/dist/suspense/NullSuspense.d.ts +0 -2
  513. package/dist/suspense/NullSuspense.js +0 -2
  514. package/dist/suspense/NullSuspense.js.map +1 -1
  515. package/dist/table/TableCellContent.d.ts +0 -3
  516. package/dist/table/TableCellContent.js +0 -3
  517. package/dist/table/TableCellContent.js.map +1 -1
  518. package/dist/table/TableConfigurationProvider.d.ts +0 -1
  519. package/dist/table/_table.scss +15 -3
  520. package/dist/table/tableCellStyles.d.ts +7 -3
  521. package/dist/table/tableCellStyles.js +2 -2
  522. package/dist/table/tableCellStyles.js.map +1 -1
  523. package/dist/tabs/Tab.d.ts +5 -1
  524. package/dist/tabs/Tab.js +2 -1
  525. package/dist/tabs/Tab.js.map +1 -1
  526. package/dist/tabs/TabList.d.ts +2 -2
  527. package/dist/tabs/TabList.js.map +1 -1
  528. package/dist/tabs/TabListScrollButton.d.ts +1 -1
  529. package/dist/tabs/TabListScrollButton.js +6 -2
  530. package/dist/tabs/TabListScrollButton.js.map +1 -1
  531. package/dist/tabs/_tabs.scss +48 -9
  532. package/dist/tabs/getTabListScrollToOptions.d.ts +18 -0
  533. package/dist/tabs/getTabListScrollToOptions.js +19 -0
  534. package/dist/tabs/getTabListScrollToOptions.js.map +1 -0
  535. package/dist/tabs/tabListScrollButtonStyles.d.ts +2 -0
  536. package/dist/tabs/tabListScrollButtonStyles.js +9 -5
  537. package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
  538. package/dist/tabs/tabStyles.d.ts +3 -0
  539. package/dist/tabs/tabStyles.js.map +1 -1
  540. package/dist/tabs/useTabList.d.ts +3 -8
  541. package/dist/tabs/useTabList.js +5 -2
  542. package/dist/tabs/useTabList.js.map +1 -1
  543. package/dist/tabs/useTabs.d.ts +39 -17
  544. package/dist/tabs/useTabs.js +9 -3
  545. package/dist/tabs/useTabs.js.map +1 -1
  546. package/dist/tabs/utils.d.ts +0 -18
  547. package/dist/tabs/utils.js +0 -15
  548. package/dist/tabs/utils.js.map +1 -1
  549. package/dist/test-utils/IntersectionObserver.js.map +1 -1
  550. package/dist/test-utils/data-testid.d.ts +0 -1
  551. package/dist/test-utils/matchMedia.d.ts +1 -1
  552. package/dist/test-utils/matchMedia.js +4 -4
  553. package/dist/test-utils/matchMedia.js.map +1 -1
  554. package/dist/test-utils/polyfills/TextDecoder.js +0 -1
  555. package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
  556. package/dist/test-utils/timers.d.ts +9 -5
  557. package/dist/test-utils/timers.js +5 -5
  558. package/dist/test-utils/timers.js.map +1 -1
  559. package/dist/theme/LocalStorageColorSchemeProvider.d.ts +1 -1
  560. package/dist/theme/LocalStorageColorSchemeProvider.js +2 -1
  561. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  562. package/dist/theme/ThemeProvider.js +3 -1
  563. package/dist/theme/ThemeProvider.js.map +1 -1
  564. package/dist/theme/_a11y.scss +77 -13
  565. package/dist/theme/_colors.scss +279 -277
  566. package/dist/theme/_theme.scss +308 -37
  567. package/dist/theme/isColorScheme.d.ts +16 -0
  568. package/dist/theme/isColorScheme.js +19 -0
  569. package/dist/theme/isColorScheme.js.map +1 -0
  570. package/dist/theme/types.d.ts +53 -1
  571. package/dist/theme/types.js +1 -23
  572. package/dist/theme/types.js.map +1 -1
  573. package/dist/theme/useCSSVariables.d.ts +2 -19
  574. package/dist/theme/useCSSVariables.js.map +1 -1
  575. package/dist/theme/useColorScheme.d.ts +1 -36
  576. package/dist/theme/useColorScheme.js.map +1 -1
  577. package/dist/theme/useColorSchemeMetaTag.d.ts +1 -1
  578. package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
  579. package/dist/theme/useColorSchemeProvider.d.ts +1 -1
  580. package/dist/theme/useColorSchemeProvider.js +1 -1
  581. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  582. package/dist/theme/{usePrefersColorScheme.js → usePrefersDarkScheme.js} +1 -1
  583. package/dist/theme/usePrefersDarkScheme.js.map +1 -0
  584. package/dist/theme/utils.js.map +1 -1
  585. package/dist/tooltip/useTooltip.d.ts +14 -9
  586. package/dist/tooltip/useTooltip.js +2 -1
  587. package/dist/tooltip/useTooltip.js.map +1 -1
  588. package/dist/transition/SlideContainer.d.ts +2 -48
  589. package/dist/transition/SlideContainer.js +2 -48
  590. package/dist/transition/SlideContainer.js.map +1 -1
  591. package/dist/transition/_transition.scss +16 -9
  592. package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
  593. package/dist/transition/types.d.ts +1 -1
  594. package/dist/transition/types.js.map +1 -1
  595. package/dist/transition/useCarousel.d.ts +3 -3
  596. package/dist/transition/useCarousel.js.map +1 -1
  597. package/dist/transition/useCollapseTransition.js.map +1 -1
  598. package/dist/transition/useTransition.js +1 -0
  599. package/dist/transition/useTransition.js.map +1 -1
  600. package/dist/transition/utils.js.map +1 -1
  601. package/dist/tree/DefaultTreeItemRenderer.d.ts +2 -3
  602. package/dist/tree/DefaultTreeItemRenderer.js +1 -1
  603. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  604. package/dist/tree/Tree.d.ts +3 -4
  605. package/dist/tree/Tree.js.map +1 -1
  606. package/dist/tree/TreeItem.d.ts +12 -4
  607. package/dist/tree/TreeItem.js +9 -5
  608. package/dist/tree/TreeItem.js.map +1 -1
  609. package/dist/tree/TreeItemExpander.js.map +1 -1
  610. package/dist/tree/_tree.scss +8 -6
  611. package/dist/tree/types.d.ts +11 -6
  612. package/dist/tree/types.js +1 -26
  613. package/dist/tree/types.js.map +1 -1
  614. package/dist/tree/useTree.d.ts +3 -3
  615. package/dist/tree/useTree.js.map +1 -1
  616. package/dist/tree/useTreeExpansion.d.ts +4 -4
  617. package/dist/tree/useTreeExpansion.js +6 -18
  618. package/dist/tree/useTreeExpansion.js.map +1 -1
  619. package/dist/tree/useTreeSelection.d.ts +4 -4
  620. package/dist/tree/useTreeSelection.js +7 -25
  621. package/dist/tree/useTreeSelection.js.map +1 -1
  622. package/dist/tree/utils.d.ts +1 -1
  623. package/dist/tree/utils.js.map +1 -1
  624. package/dist/types.d.ts +12 -4
  625. package/dist/types.js.map +1 -1
  626. package/dist/typography/SrOnly.d.ts +2 -1
  627. package/dist/typography/SrOnly.js +2 -1
  628. package/dist/typography/SrOnly.js.map +1 -1
  629. package/dist/typography/TextContainer.d.ts +0 -2
  630. package/dist/typography/TextContainer.js +0 -2
  631. package/dist/typography/TextContainer.js.map +1 -1
  632. package/dist/typography/Typography.d.ts +0 -2
  633. package/dist/typography/Typography.js +0 -2
  634. package/dist/typography/Typography.js.map +1 -1
  635. package/dist/typography/WritingDirectionProvider.d.ts +3 -3
  636. package/dist/typography/WritingDirectionProvider.js +2 -2
  637. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  638. package/dist/typography/_typography.scss +94 -37
  639. package/dist/typography/typographyStyles.js.map +1 -1
  640. package/dist/useDebouncedFunction.d.ts +1 -5
  641. package/dist/useDebouncedFunction.js +3 -1
  642. package/dist/useDebouncedFunction.js.map +1 -1
  643. package/dist/useDropzone.d.ts +4 -4
  644. package/dist/useDropzone.js.map +1 -1
  645. package/dist/useEnsuredId.js.map +1 -1
  646. package/dist/useIntersectionObserver.d.ts +5 -5
  647. package/dist/useIntersectionObserver.js.map +1 -1
  648. package/dist/useLocalStorage.d.ts +3 -3
  649. package/dist/useLocalStorage.js +1 -1
  650. package/dist/useLocalStorage.js.map +1 -1
  651. package/dist/useMutationObserver.d.ts +1 -1
  652. package/dist/useMutationObserver.js.map +1 -1
  653. package/dist/useOrientation.js +3 -1
  654. package/dist/useOrientation.js.map +1 -1
  655. package/dist/usePageInactive.d.ts +2 -2
  656. package/dist/usePageInactive.js.map +1 -1
  657. package/dist/useReadonlySet.d.ts +76 -0
  658. package/dist/useReadonlySet.js +72 -0
  659. package/dist/useReadonlySet.js.map +1 -0
  660. package/dist/useResizeListener.d.ts +8 -2
  661. package/dist/useResizeListener.js.map +1 -1
  662. package/dist/useResizeObserver.d.ts +3 -3
  663. package/dist/useResizeObserver.js.map +1 -1
  664. package/dist/useThrottledFunction.d.ts +1 -5
  665. package/dist/useThrottledFunction.js +3 -1
  666. package/dist/useThrottledFunction.js.map +1 -1
  667. package/dist/useToggle.d.ts +7 -7
  668. package/dist/useToggle.js +1 -1
  669. package/dist/useToggle.js.map +1 -1
  670. package/dist/utils/RenderRecursively.d.ts +1 -1
  671. package/dist/utils/RenderRecursively.js.map +1 -1
  672. package/dist/utils/alphaNumericSort.d.ts +1 -1
  673. package/dist/utils/alphaNumericSort.js.map +1 -1
  674. package/dist/utils/bem.js.map +1 -1
  675. package/dist/utils/debounce.d.ts +5 -0
  676. package/dist/utils/debounce.js +17 -0
  677. package/dist/utils/debounce.js.map +1 -0
  678. package/dist/utils/nearest.js.map +1 -1
  679. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  680. package/dist/utils/throttle.d.ts +5 -0
  681. package/dist/utils/throttle.js +30 -0
  682. package/dist/utils/throttle.js.map +1 -0
  683. package/dist/utils/wait.js +3 -1
  684. package/dist/utils/wait.js.map +1 -1
  685. package/dist/window-splitter/WindowSplitter.d.ts +39 -17
  686. package/dist/window-splitter/WindowSplitter.js +40 -19
  687. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  688. package/dist/window-splitter/_window-splitter.scss +32 -14
  689. package/dist/window-splitter/styles.d.ts +14 -0
  690. package/dist/window-splitter/styles.js +18 -0
  691. package/dist/window-splitter/styles.js.map +1 -0
  692. package/package.json +27 -26
  693. package/src/RootHtml.tsx +0 -2
  694. package/src/app-bar/AppBar.tsx +1 -172
  695. package/src/app-bar/AppBarTitle.tsx +1 -46
  696. package/src/app-bar/styles.ts +206 -0
  697. package/src/autocomplete/Autocomplete.tsx +194 -211
  698. package/src/autocomplete/AutocompleteChip.tsx +48 -0
  699. package/src/autocomplete/AutocompleteCircularProgress.tsx +6 -17
  700. package/src/autocomplete/AutocompleteClearButton.tsx +44 -0
  701. package/src/autocomplete/AutocompleteDropdownButton.tsx +16 -37
  702. package/src/autocomplete/AutocompleteListboxChildren.tsx +68 -0
  703. package/src/autocomplete/autocompleteStyles.ts +48 -9
  704. package/src/autocomplete/defaults.ts +26 -17
  705. package/src/autocomplete/types.ts +744 -61
  706. package/src/autocomplete/useAutocomplete.ts +428 -0
  707. package/src/autocomplete/utils.ts +211 -0
  708. package/src/avatar/Avatar.tsx +0 -2
  709. package/src/badge/Badge.tsx +2 -42
  710. package/src/badge/styles.ts +45 -0
  711. package/src/box/Box.tsx +11 -11
  712. package/src/box/styles.ts +14 -5
  713. package/src/button/AsyncButton.tsx +1 -1
  714. package/src/button/Button.tsx +5 -1
  715. package/src/button/ButtonUnstyled.tsx +0 -2
  716. package/src/card/Card.tsx +35 -6
  717. package/src/card/CardContent.tsx +0 -2
  718. package/src/card/CardFooter.tsx +0 -2
  719. package/src/card/CardHeader.tsx +0 -2
  720. package/src/card/CardSubtitle.tsx +0 -2
  721. package/src/card/CardTitle.tsx +0 -2
  722. package/src/card/ClickableCard.tsx +9 -2
  723. package/src/card/styles.ts +1 -10
  724. package/src/chip/Chip.tsx +6 -3
  725. package/src/chip/styles.ts +12 -10
  726. package/src/delegateEvent.ts +5 -5
  727. package/src/dialog/Dialog.tsx +48 -61
  728. package/src/dialog/DialogContent.tsx +3 -3
  729. package/src/dialog/DialogFooter.tsx +2 -3
  730. package/src/dialog/DialogHeader.tsx +3 -3
  731. package/src/dialog/DialogTitle.tsx +3 -3
  732. package/src/dialog/FixedDialog.tsx +1 -11
  733. package/src/dialog/styles.ts +97 -0
  734. package/src/divider/Divider.tsx +0 -14
  735. package/src/divider/styles.ts +12 -0
  736. package/src/draggable/useDraggable.ts +17 -10
  737. package/src/draggable/utils.ts +3 -3
  738. package/src/expansion-panel/ExpansionList.tsx +1 -1
  739. package/src/expansion-panel/ExpansionPanel.tsx +10 -39
  740. package/src/expansion-panel/ExpansionPanelHeader.tsx +0 -1
  741. package/src/expansion-panel/expansionPanelStyles.ts +33 -0
  742. package/src/expansion-panel/useExpansionPanels.ts +18 -27
  743. package/src/{form → files}/FileInput.tsx +7 -15
  744. package/src/files/styles.ts +10 -0
  745. package/src/{form → files}/useFileUpload.ts +30 -34
  746. package/src/files/utils.ts +234 -0
  747. package/src/{form/fileUtils.ts → files/validation.ts} +13 -242
  748. package/src/focus/useFocusContainer.ts +16 -8
  749. package/src/form/Fieldset.tsx +0 -2
  750. package/src/form/FormMessage.tsx +0 -2
  751. package/src/form/FormMessageContainer.tsx +2 -3
  752. package/src/form/FormMessageCounter.tsx +0 -2
  753. package/src/form/InputToggle.tsx +6 -2
  754. package/src/form/InputToggleIcon.tsx +0 -2
  755. package/src/form/Label.tsx +18 -20
  756. package/src/form/Legend.tsx +0 -2
  757. package/src/form/Listbox.tsx +87 -0
  758. package/src/form/ListboxProvider.ts +37 -0
  759. package/src/form/MenuItemTextField.tsx +1 -2
  760. package/src/form/NativeSelect.tsx +14 -12
  761. package/src/form/Option.tsx +74 -22
  762. package/src/form/Select.tsx +89 -85
  763. package/src/form/SelectedOption.tsx +0 -2
  764. package/src/form/Slider.tsx +14 -11
  765. package/src/form/SliderContainer.tsx +0 -2
  766. package/src/form/SliderMark.tsx +0 -2
  767. package/src/form/SliderMarkLabel.tsx +0 -2
  768. package/src/form/SliderThumb.tsx +4 -4
  769. package/src/form/SliderTrack.tsx +0 -2
  770. package/src/form/SliderValueMarks.tsx +4 -6
  771. package/src/form/Switch.tsx +0 -2
  772. package/src/form/SwitchTrack.tsx +2 -1
  773. package/src/form/TextArea.tsx +6 -8
  774. package/src/form/TextField.tsx +0 -4
  775. package/src/form/TextFieldAddon.tsx +1 -3
  776. package/src/form/TextFieldContainer.tsx +9 -11
  777. package/src/form/formMessageContainerStyles.ts +22 -0
  778. package/src/form/optionStyles.ts +7 -2
  779. package/src/form/sliderUtils.ts +1 -1
  780. package/src/form/textFieldContainerStyles.ts +9 -14
  781. package/src/form/types.ts +3 -11
  782. package/src/form/useCheckboxGroup.ts +28 -36
  783. package/src/form/useCombobox.ts +86 -38
  784. package/src/form/useEditableCombobox.ts +43 -8
  785. package/src/form/useRadioGroup.ts +6 -6
  786. package/src/form/useSelectCombobox.ts +4 -4
  787. package/src/form/useTextField.ts +1 -1
  788. package/src/hoverMode/useHoverMode.ts +3 -3
  789. package/src/hoverMode/useHoverModeProvider.ts +4 -4
  790. package/src/icon/FontIcon.tsx +0 -2
  791. package/src/icon/IconRotator.tsx +0 -2
  792. package/src/icon/MaterialIcon.tsx +0 -2
  793. package/src/icon/MaterialSymbol.tsx +0 -1
  794. package/src/icon/SVGIcon.tsx +0 -2
  795. package/src/icon/TextIconSpacing.tsx +0 -2
  796. package/src/icon/iconConfig.tsx +12 -0
  797. package/src/icon/styles.ts +1 -1
  798. package/src/interaction/RippleContainer.tsx +0 -2
  799. package/src/interaction/UserInteractionModeProvider.tsx +12 -8
  800. package/src/interaction/types.ts +21 -2
  801. package/src/interaction/useElementInteraction.tsx +9 -2
  802. package/src/interaction/utils.ts +7 -7
  803. package/src/layout/LayoutNav.tsx +3 -2
  804. package/src/layout/useExpandableLayout.ts +3 -3
  805. package/src/layout/useHorizontalLayoutTransition.ts +1 -1
  806. package/src/layout/useLayoutAppBarHeight.ts +3 -4
  807. package/src/layout/useLayoutTree.ts +2 -2
  808. package/src/layout/useTemporaryLayout.ts +2 -2
  809. package/src/link/Link.tsx +0 -2
  810. package/src/list/List.tsx +1 -33
  811. package/src/list/ListItem.tsx +5 -18
  812. package/src/list/ListItemAddon.tsx +0 -2
  813. package/src/list/ListItemChildren.tsx +0 -2
  814. package/src/list/ListItemLink.tsx +5 -1
  815. package/src/list/ListItemText.tsx +0 -2
  816. package/src/list/ListSubheader.tsx +3 -2
  817. package/src/list/getListItemHeight.ts +2 -2
  818. package/src/list/listItemStyles.ts +21 -4
  819. package/src/list/listStyles.ts +31 -0
  820. package/src/list/types.ts +9 -3
  821. package/src/media-queries/AppSizeProvider.tsx +8 -0
  822. package/src/media-queries/useMediaQuery.ts +3 -2
  823. package/src/menu/Menu.tsx +11 -3
  824. package/src/menu/MenuConfigurationProvider.tsx +2 -2
  825. package/src/menu/MenuItemButton.tsx +7 -1
  826. package/src/menu/useContextMenu.ts +3 -3
  827. package/src/movement/types.ts +5 -5
  828. package/src/navigation/CollapsibleNavGroup.tsx +16 -8
  829. package/src/navigation/DefaultNavigationRenderer.tsx +8 -6
  830. package/src/navigation/NavGroup.tsx +0 -2
  831. package/src/navigation/NavItem.tsx +0 -2
  832. package/src/navigation/NavItemButton.tsx +2 -1
  833. package/src/navigation/NavItemLink.tsx +11 -3
  834. package/src/navigation/NavSubheader.tsx +1 -3
  835. package/src/navigation/Navigation.tsx +1 -1
  836. package/src/navigation/types.ts +60 -10
  837. package/src/navigation/useActiveHeadingId.ts +1 -1
  838. package/src/navigation/useNavigationExpansion.ts +170 -0
  839. package/src/navigation/utils.ts +47 -0
  840. package/src/objectFit.ts +88 -0
  841. package/src/positioning/useFixedPositioning.ts +34 -11
  842. package/src/progress/CircularProgress.tsx +0 -2
  843. package/src/progress/LinearProgress.tsx +0 -2
  844. package/src/responsive-item/ResponsiveItem.tsx +96 -0
  845. package/src/responsive-item/ResponsiveItemOverlay.tsx +6 -48
  846. package/src/responsive-item/responsiveItemOverlayStyles.ts +46 -0
  847. package/src/responsive-item/responsiveItemStyles.ts +81 -0
  848. package/src/scroll/useScrollLock.ts +6 -0
  849. package/src/searching/utils.ts +3 -3
  850. package/src/segmented-button/SegmentedButton.tsx +5 -1
  851. package/src/segmented-button/SegmentedButtonContainer.tsx +0 -2
  852. package/src/sheet/Sheet.tsx +36 -33
  853. package/src/sheet/styles.ts +50 -0
  854. package/src/snackbar/ToastManager.tsx +16 -5
  855. package/src/snackbar/useCurrentToastActions.ts +5 -5
  856. package/src/suspense/CircularProgressSuspense.tsx +0 -2
  857. package/src/suspense/NullSuspense.tsx +0 -2
  858. package/src/table/TableCellContent.tsx +0 -3
  859. package/src/table/tableCellStyles.ts +10 -6
  860. package/src/tabs/Tab.tsx +7 -1
  861. package/src/tabs/TabList.tsx +2 -2
  862. package/src/tabs/TabListScrollButton.tsx +13 -6
  863. package/src/tabs/getTabListScrollToOptions.ts +37 -0
  864. package/src/tabs/tabListScrollButtonStyles.ts +9 -5
  865. package/src/tabs/tabStyles.ts +4 -0
  866. package/src/tabs/useTabList.ts +6 -9
  867. package/src/tabs/useTabs.ts +67 -20
  868. package/src/tabs/utils.ts +0 -38
  869. package/src/test-utils/IntersectionObserver.ts +1 -1
  870. package/src/test-utils/matchMedia.ts +5 -5
  871. package/src/test-utils/polyfills/TextDecoder.ts +0 -1
  872. package/src/test-utils/timers.ts +10 -7
  873. package/src/theme/LocalStorageColorSchemeProvider.tsx +4 -4
  874. package/src/theme/ThemeProvider.tsx +3 -3
  875. package/src/theme/isColorScheme.ts +22 -0
  876. package/src/theme/types.ts +67 -1
  877. package/src/theme/useCSSVariables.ts +7 -30
  878. package/src/theme/useColorScheme.ts +1 -40
  879. package/src/theme/useColorSchemeMetaTag.ts +1 -1
  880. package/src/theme/useColorSchemeProvider.ts +2 -2
  881. package/src/tooltip/useTooltip.ts +17 -9
  882. package/src/transition/SlideContainer.tsx +2 -48
  883. package/src/transition/types.ts +1 -1
  884. package/src/transition/useCarousel.ts +3 -3
  885. package/src/transition/useTransition.ts +1 -0
  886. package/src/tree/DefaultTreeItemRenderer.tsx +3 -4
  887. package/src/tree/Tree.tsx +4 -6
  888. package/src/tree/TreeItem.tsx +18 -5
  889. package/src/tree/TreeItemExpander.tsx +1 -1
  890. package/src/tree/types.ts +16 -6
  891. package/src/tree/useTree.ts +3 -3
  892. package/src/tree/useTreeExpansion.ts +10 -28
  893. package/src/tree/useTreeSelection.ts +11 -35
  894. package/src/tree/utils.ts +6 -2
  895. package/src/types.ts +20 -4
  896. package/src/typography/SrOnly.tsx +2 -1
  897. package/src/typography/TextContainer.tsx +0 -2
  898. package/src/typography/Typography.tsx +0 -2
  899. package/src/typography/WritingDirectionProvider.tsx +3 -3
  900. package/src/useDebouncedFunction.ts +4 -9
  901. package/src/useDropzone.ts +4 -4
  902. package/src/useIntersectionObserver.ts +5 -5
  903. package/src/useLocalStorage.ts +6 -6
  904. package/src/useMutationObserver.ts +1 -1
  905. package/src/useOrientation.ts +3 -1
  906. package/src/usePageInactive.ts +2 -2
  907. package/src/useReadonlySet.ts +122 -0
  908. package/src/useResizeListener.ts +8 -2
  909. package/src/useResizeObserver.ts +3 -3
  910. package/src/useThrottledFunction.ts +6 -9
  911. package/src/useToggle.ts +7 -7
  912. package/src/utils/RenderRecursively.tsx +1 -1
  913. package/src/utils/alphaNumericSort.ts +1 -1
  914. package/src/utils/debounce.ts +22 -0
  915. package/src/utils/throttle.ts +38 -0
  916. package/src/utils/wait.ts +5 -1
  917. package/src/window-splitter/WindowSplitter.tsx +40 -45
  918. package/src/window-splitter/styles.ts +42 -0
  919. package/.eslintrc.cjs +0 -34
  920. package/.stylelintrc.json +0 -14
  921. package/.swcrc +0 -17
  922. package/.turbo/turbo-build.log +0 -22
  923. package/.turbo/turbo-lint.log +0 -12
  924. package/.turbo/turbo-test.log +0 -5516
  925. package/.turbo/turbo-typecheck.log +0 -4
  926. package/CHANGELOG.md +0 -323
  927. package/coverage/clover.xml +0 -842
  928. package/coverage/coverage-final.json +0 -6
  929. package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +0 -1033
  930. package/coverage/lcov-report/autocomplete/AutocompleteClearButton.tsx.html +0 -262
  931. package/coverage/lcov-report/autocomplete/FilterAutocompleteOptions.tsx.html +0 -364
  932. package/coverage/lcov-report/autocomplete/index.html +0 -146
  933. package/coverage/lcov-report/base.css +0 -224
  934. package/coverage/lcov-report/block-navigation.js +0 -87
  935. package/coverage/lcov-report/button/Button.tsx.html +0 -676
  936. package/coverage/lcov-report/button/index.html +0 -116
  937. package/coverage/lcov-report/card/Card.tsx.html +0 -349
  938. package/coverage/lcov-report/card/CardSubtitle.tsx.html +0 -265
  939. package/coverage/lcov-report/card/index.html +0 -146
  940. package/coverage/lcov-report/card/styles.ts.html +0 -682
  941. package/coverage/lcov-report/createHorizontalPosition.ts.html +0 -1075
  942. package/coverage/lcov-report/createVerticalPosition.ts.html +0 -997
  943. package/coverage/lcov-report/favicon.png +0 -0
  944. package/coverage/lcov-report/form/Option.tsx.html +0 -727
  945. package/coverage/lcov-report/form/index.html +0 -131
  946. package/coverage/lcov-report/form/useListboxProvider.ts.html +0 -253
  947. package/coverage/lcov-report/index.html +0 -146
  948. package/coverage/lcov-report/prettify.css +0 -1
  949. package/coverage/lcov-report/prettify.js +0 -2
  950. package/coverage/lcov-report/searching/fuzzy.ts.html +0 -607
  951. package/coverage/lcov-report/searching/index.html +0 -116
  952. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  953. package/coverage/lcov-report/sorter.js +0 -196
  954. package/coverage/lcov-report/src/card/Card.tsx.html +0 -349
  955. package/coverage/lcov-report/src/card/CardSubtitle.tsx.html +0 -277
  956. package/coverage/lcov-report/src/card/index.html +0 -146
  957. package/coverage/lcov-report/src/card/styles.ts.html +0 -682
  958. package/coverage/lcov-report/src/cssUtils.ts.html +0 -787
  959. package/coverage/lcov-report/src/index.html +0 -116
  960. package/coverage/lcov-report/src/transition/index.html +0 -116
  961. package/coverage/lcov-report/src/transition/useCSSTransition.ts.html +0 -766
  962. package/coverage/lcov-report/transition/index.html +0 -116
  963. package/coverage/lcov-report/transition/useCSSTransition.ts.html +0 -766
  964. package/coverage/lcov-report/typography/SrOnly.tsx.html +0 -325
  965. package/coverage/lcov-report/typography/index.html +0 -116
  966. package/coverage/lcov-report/utils.ts.html +0 -1225
  967. package/coverage/lcov.info +0 -952
  968. package/dist/autocomplete/FilterAutocompleteOptions.d.ts +0 -8
  969. package/dist/autocomplete/FilterAutocompleteOptions.js +0 -57
  970. package/dist/autocomplete/FilterAutocompleteOptions.js.map +0 -1
  971. package/dist/dialog/DialogContainer.d.ts +0 -16
  972. package/dist/dialog/DialogContainer.js +0 -22
  973. package/dist/dialog/DialogContainer.js.map +0 -1
  974. package/dist/form/FileInput.js.map +0 -1
  975. package/dist/form/fileUtils.js.map +0 -1
  976. package/dist/form/useFileUpload.js.map +0 -1
  977. package/dist/form/useListboxProvider.d.ts +0 -31
  978. package/dist/form/useListboxProvider.js.map +0 -1
  979. package/dist/navigation/getHrefFromParents.d.ts +0 -5
  980. package/dist/navigation/getHrefFromParents.js +0 -13
  981. package/dist/navigation/getHrefFromParents.js.map +0 -1
  982. package/dist/responsive-item/ResponsiveItemContainer.d.ts +0 -117
  983. package/dist/responsive-item/ResponsiveItemContainer.js +0 -82
  984. package/dist/responsive-item/ResponsiveItemContainer.js.map +0 -1
  985. package/dist/responsive-item/styles.d.ts +0 -34
  986. package/dist/responsive-item/styles.js +0 -17
  987. package/dist/responsive-item/styles.js.map +0 -1
  988. package/dist/theme/usePrefersColorScheme.js.map +0 -1
  989. package/jest.config.ts +0 -68
  990. package/jest.setup.ts +0 -3
  991. package/scripts/copySassFiles.ts +0 -70
  992. package/scripts/getExportMap.ts +0 -66
  993. package/scripts/tsconfig.json +0 -18
  994. package/src/__tests__/NoSsr.node.tsx +0 -26
  995. package/src/__tests__/NoSsr.tsx +0 -89
  996. package/src/__tests__/RootHtml.node.tsx +0 -46
  997. package/src/__tests__/__snapshots__/RootHtml.node.tsx.snap +0 -19
  998. package/src/__tests__/useAsyncFunction.tsx +0 -124
  999. package/src/__tests__/useDebouncedFunction.tsx +0 -108
  1000. package/src/__tests__/useDropzone.tsx +0 -131
  1001. package/src/__tests__/useElementSize.tsx +0 -181
  1002. package/src/__tests__/useEnsuredId.tsx +0 -25
  1003. package/src/__tests__/useEnsuredState.tsx +0 -74
  1004. package/src/__tests__/useHtmlClassName.tsx +0 -54
  1005. package/src/__tests__/useLocalStorage.tsx +0 -377
  1006. package/src/__tests__/useOrientation.node.tsx +0 -20
  1007. package/src/__tests__/useOrientation.tsx +0 -63
  1008. package/src/__tests__/useResizeObserver.tsx +0 -258
  1009. package/src/__tests__/useThrottledFunction.tsx +0 -226
  1010. package/src/__tests__/useToggle.tsx +0 -78
  1011. package/src/__tests__/useWindowSize.node.tsx +0 -56
  1012. package/src/__tests__/useWindowSize.tsx +0 -155
  1013. package/src/_box-shadows.scss +0 -219
  1014. package/src/_core.scss +0 -432
  1015. package/src/_utils.scss +0 -348
  1016. package/src/app-bar/__tests__/AppBar.tsx +0 -121
  1017. package/src/app-bar/__tests__/AppBarTitle.tsx +0 -39
  1018. package/src/app-bar/__tests__/__snapshots__/AppBar.tsx.snap +0 -186
  1019. package/src/app-bar/__tests__/__snapshots__/AppBarTitle.tsx.snap +0 -47
  1020. package/src/app-bar/_app-bar.scss +0 -248
  1021. package/src/autocomplete/FilterAutocompleteOptions.tsx +0 -86
  1022. package/src/autocomplete/__tests__/Autocomplete.tsx +0 -458
  1023. package/src/autocomplete/__tests__/__snapshots__/Autocomplete.tsx.snap +0 -144
  1024. package/src/autocomplete/_autocomplete.scss +0 -75
  1025. package/src/avatar/__tests__/Avatar.tsx +0 -75
  1026. package/src/avatar/__tests__/__snapshots__/Avatar.tsx.snap +0 -73
  1027. package/src/avatar/_avatar.scss +0 -157
  1028. package/src/badge/__tests__/Badge.tsx +0 -42
  1029. package/src/badge/__tests__/__snapshots__/Badge.tsx.snap +0 -54
  1030. package/src/badge/_badge.scss +0 -145
  1031. package/src/box/__tests__/Box.tsx +0 -158
  1032. package/src/box/__tests__/__snapshots__/Box.tsx.snap +0 -544
  1033. package/src/box/_box.scss +0 -168
  1034. package/src/button/__tests__/AsyncButton.tsx +0 -211
  1035. package/src/button/__tests__/Button.tsx +0 -198
  1036. package/src/button/__tests__/ButtonUnstyled.tsx +0 -37
  1037. package/src/button/__tests__/TooltippedButton.tsx +0 -60
  1038. package/src/button/__tests__/__snapshots__/AsyncButton.tsx.snap +0 -418
  1039. package/src/button/__tests__/__snapshots__/Button.tsx.snap +0 -573
  1040. package/src/button/__tests__/__snapshots__/ButtonUnstyled.tsx.snap +0 -22
  1041. package/src/button/__tests__/__snapshots__/TooltippedButton.tsx.snap +0 -26
  1042. package/src/button/__tests__/__snapshots__/buttonStyles.ts.snap +0 -11
  1043. package/src/button/__tests__/buttonStyles.ts +0 -15
  1044. package/src/button/_button.scss +0 -330
  1045. package/src/card/__tests__/Card.tsx +0 -37
  1046. package/src/card/__tests__/CardContent.tsx +0 -40
  1047. package/src/card/__tests__/CardFooter.tsx +0 -34
  1048. package/src/card/__tests__/CardHeader.tsx +0 -66
  1049. package/src/card/__tests__/CardSubtitle.tsx +0 -30
  1050. package/src/card/__tests__/CardTitle.tsx +0 -30
  1051. package/src/card/__tests__/ClickableCard.tsx +0 -66
  1052. package/src/card/__tests__/__snapshots__/Card.tsx.snap +0 -40
  1053. package/src/card/__tests__/__snapshots__/CardContent.tsx.snap +0 -50
  1054. package/src/card/__tests__/__snapshots__/CardFooter.tsx.snap +0 -30
  1055. package/src/card/__tests__/__snapshots__/CardHeader.tsx.snap +0 -74
  1056. package/src/card/__tests__/__snapshots__/CardSubtitle.tsx.snap +0 -18
  1057. package/src/card/__tests__/__snapshots__/CardTitle.tsx.snap +0 -18
  1058. package/src/card/__tests__/__snapshots__/ClickableCard.tsx.snap +0 -20
  1059. package/src/card/__tests__/__snapshots__/styles.ts.snap +0 -13
  1060. package/src/card/__tests__/styles.ts +0 -45
  1061. package/src/card/_card.scss +0 -189
  1062. package/src/chip/__tests__/Chip.tsx +0 -327
  1063. package/src/chip/__tests__/__snapshots__/Chip.tsx.snap +0 -597
  1064. package/src/chip/__tests__/__snapshots__/styles.ts.snap +0 -5
  1065. package/src/chip/__tests__/styles.ts +0 -14
  1066. package/src/chip/_chip.scss +0 -324
  1067. package/src/dialog/DialogContainer.tsx +0 -30
  1068. package/src/dialog/__tests__/Dialog.tsx +0 -316
  1069. package/src/dialog/__tests__/DialogContent.tsx +0 -53
  1070. package/src/dialog/__tests__/DialogFooter.tsx +0 -70
  1071. package/src/dialog/__tests__/DialogHeader.tsx +0 -37
  1072. package/src/dialog/__tests__/DialogTitle.tsx +0 -41
  1073. package/src/dialog/__tests__/__snapshots__/Dialog.tsx.snap +0 -84
  1074. package/src/dialog/__tests__/__snapshots__/DialogContent.tsx.snap +0 -36
  1075. package/src/dialog/__tests__/__snapshots__/DialogFooter.tsx.snap +0 -186
  1076. package/src/dialog/__tests__/__snapshots__/DialogHeader.tsx.snap +0 -18
  1077. package/src/dialog/__tests__/__snapshots__/DialogTitle.tsx.snap +0 -26
  1078. package/src/dialog/_dialog.scss +0 -273
  1079. package/src/divider/__tests__/Divider.tsx +0 -36
  1080. package/src/divider/__tests__/__snapshots__/Divider.tsx.snap +0 -26
  1081. package/src/divider/_divider.scss +0 -124
  1082. package/src/draggable/__tests__/__snapshots__/useDraggable.tsx.snap +0 -49
  1083. package/src/draggable/__tests__/useDraggable.tsx +0 -540
  1084. package/src/draggable/_draggable.scss +0 -29
  1085. package/src/expansion-panel/__tests__/ExpansionPanel.tsx +0 -290
  1086. package/src/expansion-panel/__tests__/__snapshots__/ExpansionPanel.tsx.snap +0 -197
  1087. package/src/expansion-panel/_expansion-panel.scss +0 -107
  1088. package/src/focus/__tests__/useFocusContainer.tsx +0 -280
  1089. package/src/form/__tests__/Checkbox.tsx +0 -42
  1090. package/src/form/__tests__/Fieldset.tsx +0 -44
  1091. package/src/form/__tests__/FileInput.tsx +0 -120
  1092. package/src/form/__tests__/Label.tsx +0 -69
  1093. package/src/form/__tests__/Legend.tsx +0 -34
  1094. package/src/form/__tests__/MenuItemCheckbox.tsx +0 -53
  1095. package/src/form/__tests__/MenuItemRadio.tsx +0 -53
  1096. package/src/form/__tests__/Radio.tsx +0 -35
  1097. package/src/form/__tests__/Select.tsx +0 -439
  1098. package/src/form/__tests__/Switch.tsx +0 -152
  1099. package/src/form/__tests__/TextArea.tsx +0 -433
  1100. package/src/form/__tests__/TextField.tsx +0 -195
  1101. package/src/form/__tests__/__snapshots__/Checkbox.tsx.snap +0 -99
  1102. package/src/form/__tests__/__snapshots__/Fieldset.tsx.snap +0 -58
  1103. package/src/form/__tests__/__snapshots__/FileInput.tsx.snap +0 -612
  1104. package/src/form/__tests__/__snapshots__/Label.tsx.snap +0 -140
  1105. package/src/form/__tests__/__snapshots__/Legend.tsx.snap +0 -30
  1106. package/src/form/__tests__/__snapshots__/MenuItemCheckbox.tsx.snap +0 -96
  1107. package/src/form/__tests__/__snapshots__/MenuItemRadio.tsx.snap +0 -96
  1108. package/src/form/__tests__/__snapshots__/Radio.tsx.snap +0 -99
  1109. package/src/form/__tests__/__snapshots__/Select.tsx.snap +0 -492
  1110. package/src/form/__tests__/__snapshots__/Switch.tsx.snap +0 -428
  1111. package/src/form/__tests__/__snapshots__/TextArea.tsx.snap +0 -548
  1112. package/src/form/__tests__/__snapshots__/TextField.tsx.snap +0 -279
  1113. package/src/form/__tests__/__snapshots__/useCheckboxGroup.tsx.snap +0 -481
  1114. package/src/form/__tests__/__snapshots__/useRadioGroup.tsx.snap +0 -704
  1115. package/src/form/__tests__/useCheckboxGroup.tsx +0 -292
  1116. package/src/form/__tests__/useFileUpload.tsx +0 -289
  1117. package/src/form/__tests__/useFormReset.tsx +0 -194
  1118. package/src/form/__tests__/useRadioGroup.tsx +0 -227
  1119. package/src/form/__tests__/utils.ts +0 -247
  1120. package/src/form/_form.scss +0 -2190
  1121. package/src/form/useListboxProvider.ts +0 -45
  1122. package/src/icon/__tests__/FontIcon.tsx +0 -45
  1123. package/src/icon/__tests__/IconRotator.tsx +0 -120
  1124. package/src/icon/__tests__/MaterialIcon.tsx +0 -79
  1125. package/src/icon/__tests__/MaterialSymbol.tsx +0 -100
  1126. package/src/icon/__tests__/SVGIcon.tsx +0 -40
  1127. package/src/icon/__tests__/TextIconSpacing.tsx +0 -108
  1128. package/src/icon/__tests__/__snapshots__/FontIcon.tsx.snap +0 -35
  1129. package/src/icon/__tests__/__snapshots__/IconRotator.tsx.snap +0 -165
  1130. package/src/icon/__tests__/__snapshots__/MaterialIcon.tsx.snap +0 -82
  1131. package/src/icon/__tests__/__snapshots__/MaterialSymbol.tsx.snap +0 -42
  1132. package/src/icon/__tests__/__snapshots__/SVGIcon.tsx.snap +0 -47
  1133. package/src/icon/__tests__/__snapshots__/TextIconSpacing.tsx.snap +0 -101
  1134. package/src/icon/__tests__/__snapshots__/styles.ts.snap +0 -29
  1135. package/src/icon/__tests__/styles.ts +0 -28
  1136. package/src/icon/_icon.scss +0 -213
  1137. package/src/interaction/__tests__/UserInteractionModeProvider.tsx +0 -121
  1138. package/src/interaction/__tests__/__snapshots__/useHigherContrastChildren.tsx.snap +0 -79
  1139. package/src/interaction/__tests__/useHigherContrastChildren.tsx +0 -97
  1140. package/src/interaction/_interaction.scss +0 -436
  1141. package/src/layout/__tests__/LayoutAppBar.tsx +0 -117
  1142. package/src/layout/__tests__/LayoutNav.tsx +0 -78
  1143. package/src/layout/__tests__/LayoutWindowSplitter.tsx +0 -63
  1144. package/src/layout/__tests__/Main.tsx +0 -51
  1145. package/src/layout/__tests__/__snapshots__/LayoutAppBar.tsx.snap +0 -78
  1146. package/src/layout/__tests__/__snapshots__/LayoutNav.tsx.snap +0 -31
  1147. package/src/layout/__tests__/__snapshots__/LayoutWindowSplitter.tsx.snap +0 -60
  1148. package/src/layout/__tests__/__snapshots__/Main.tsx.snap +0 -32
  1149. package/src/layout/__tests__/__snapshots__/useExpandableLayout.tsx.snap +0 -116
  1150. package/src/layout/__tests__/__snapshots__/useLayoutTree.tsx.snap +0 -676
  1151. package/src/layout/__tests__/__snapshots__/useResizableLayout.tsx.snap +0 -95
  1152. package/src/layout/__tests__/__snapshots__/useTemporaryLayout.tsx.snap +0 -141
  1153. package/src/layout/__tests__/useExpandableLayout.tsx +0 -279
  1154. package/src/layout/__tests__/useLayoutTree.tsx +0 -212
  1155. package/src/layout/__tests__/useResizableLayout.tsx +0 -170
  1156. package/src/layout/__tests__/useTemporaryLayout.tsx +0 -109
  1157. package/src/layout/_layout.scss +0 -163
  1158. package/src/link/__tests__/Link.tsx +0 -31
  1159. package/src/link/__tests__/SkipToMainContent.tsx +0 -125
  1160. package/src/link/__tests__/__snapshots__/Link.tsx.snap +0 -20
  1161. package/src/link/__tests__/__snapshots__/SkipToMainContent.tsx.snap +0 -22
  1162. package/src/link/_link.scss +0 -149
  1163. package/src/list/__tests__/List.tsx +0 -58
  1164. package/src/list/__tests__/ListItem.tsx +0 -280
  1165. package/src/list/__tests__/ListItemLink.tsx +0 -89
  1166. package/src/list/__tests__/ListSubheader.tsx +0 -81
  1167. package/src/list/__tests__/__snapshots__/List.tsx.snap +0 -41
  1168. package/src/list/__tests__/__snapshots__/ListItem.tsx.snap +0 -414
  1169. package/src/list/__tests__/__snapshots__/ListItemLink.tsx.snap +0 -73
  1170. package/src/list/__tests__/__snapshots__/ListSubheader.tsx.snap +0 -99
  1171. package/src/list/__tests__/getListItemHeight.ts +0 -176
  1172. package/src/list/_list.scss +0 -322
  1173. package/src/media-queries/__tests__/AppSizeProvider.node.tsx +0 -37
  1174. package/src/media-queries/__tests__/AppSizeProvider.tsx +0 -119
  1175. package/src/media-queries/__tests__/useMediaQuery.node.tsx +0 -20
  1176. package/src/media-queries/__tests__/useMediaQuery.tsx +0 -59
  1177. package/src/media-queries/_media-queries.scss +0 -63
  1178. package/src/menu/__tests__/DropdownMenu.tsx +0 -627
  1179. package/src/menu/__tests__/MenuBar.tsx +0 -354
  1180. package/src/menu/__tests__/MenuItemCircularProgress.tsx +0 -39
  1181. package/src/menu/__tests__/MenuVisibilityProvider.tsx +0 -34
  1182. package/src/menu/__tests__/__snapshots__/DropdownMenu.tsx.snap +0 -292
  1183. package/src/menu/__tests__/__snapshots__/MenuBar.tsx.snap +0 -87
  1184. package/src/menu/__tests__/__snapshots__/MenuItemCircularProgress.tsx.snap +0 -68
  1185. package/src/menu/__tests__/__snapshots__/useContextMenu.tsx.snap +0 -54
  1186. package/src/menu/__tests__/useContextMenu.tsx +0 -41
  1187. package/src/menu/__tests__/utils.ts +0 -121
  1188. package/src/menu/_menu.scss +0 -116
  1189. package/src/movement/__tests__/findMatchIndex.ts +0 -244
  1190. package/src/movement/__tests__/utils.ts +0 -710
  1191. package/src/navigation/__tests__/Navigation.tsx +0 -97
  1192. package/src/navigation/__tests__/__snapshots__/Navigation.tsx.snap +0 -165
  1193. package/src/navigation/_navigation.scss +0 -99
  1194. package/src/navigation/getHrefFromParents.ts +0 -15
  1195. package/src/overlay/__tests__/Overlay.tsx +0 -198
  1196. package/src/overlay/__tests__/__snapshots__/Overlay.tsx.snap +0 -77
  1197. package/src/overlay/_overlay.scss +0 -74
  1198. package/src/portal/__tests__/PortalContainerProvider.node.tsx +0 -26
  1199. package/src/portal/__tests__/PortalContainerProvider.tsx +0 -84
  1200. package/src/positioning/__tests__/__snapshots__/useFixedPositioning.tsx.snap +0 -87
  1201. package/src/positioning/__tests__/createHorizontalPosition.ts +0 -777
  1202. package/src/positioning/__tests__/createVerticalPosition.ts +0 -464
  1203. package/src/positioning/__tests__/useFixedPositioning.tsx +0 -205
  1204. package/src/positioning/__tests__/utils.ts +0 -1311
  1205. package/src/progress/__tests__/CircularProgress.tsx +0 -153
  1206. package/src/progress/__tests__/LinearProgress.tsx +0 -131
  1207. package/src/progress/__tests__/__snapshots__/CircularProgress.tsx.snap +0 -499
  1208. package/src/progress/__tests__/__snapshots__/LinearProgress.tsx.snap +0 -321
  1209. package/src/progress/__tests__/getProgressA11y.ts +0 -16
  1210. package/src/progress/_progress.scss +0 -577
  1211. package/src/responsive-item/ResponsiveItemContainer.tsx +0 -176
  1212. package/src/responsive-item/__tests__/ResponsiveItemContainer.tsx +0 -56
  1213. package/src/responsive-item/__tests__/ResponsiveItemOverlay.tsx +0 -66
  1214. package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemContainer.tsx.snap +0 -85
  1215. package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemOverlay.tsx.snap +0 -151
  1216. package/src/responsive-item/__tests__/__snapshots__/styles.ts.snap +0 -9
  1217. package/src/responsive-item/__tests__/styles.ts +0 -32
  1218. package/src/responsive-item/_responsive-item.scss +0 -199
  1219. package/src/responsive-item/styles.ts +0 -58
  1220. package/src/searching/__tests__/caseInsensitive.ts +0 -165
  1221. package/src/searching/__tests__/fuzzy.ts +0 -169
  1222. package/src/searching/__tests__/toSearchQuery.ts +0 -21
  1223. package/src/searching/__tests__/useFuzzyMatch.tsx +0 -200
  1224. package/src/segmented-button/__tests__/SegmentedButton.tsx +0 -61
  1225. package/src/segmented-button/__tests__/SegmentedButtonContainer.tsx +0 -38
  1226. package/src/segmented-button/__tests__/__snapshots__/SegmentedButton.tsx.snap +0 -116
  1227. package/src/segmented-button/__tests__/__snapshots__/SegmentedButtonContainer.tsx.snap +0 -22
  1228. package/src/segmented-button/_segmented-button.scss +0 -208
  1229. package/src/sheet/_sheet.scss +0 -189
  1230. package/src/snackbar/__tests__/Snackbar.tsx +0 -85
  1231. package/src/snackbar/__tests__/Toast.tsx +0 -105
  1232. package/src/snackbar/__tests__/ToastActionButton.tsx +0 -112
  1233. package/src/snackbar/__tests__/ToastCloseButton.tsx +0 -140
  1234. package/src/snackbar/__tests__/ToastContent.tsx +0 -88
  1235. package/src/snackbar/__tests__/ToastManagerProvider.tsx +0 -852
  1236. package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +0 -176
  1237. package/src/snackbar/__tests__/__snapshots__/Toast.tsx.snap +0 -52
  1238. package/src/snackbar/__tests__/__snapshots__/ToastActionButton.tsx.snap +0 -36
  1239. package/src/snackbar/__tests__/__snapshots__/ToastCloseButton.tsx.snap +0 -104
  1240. package/src/snackbar/__tests__/__snapshots__/ToastContent.tsx.snap +0 -26
  1241. package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +0 -290
  1242. package/src/snackbar/_snackbar.scss +0 -266
  1243. package/src/suspense/__tests__/CircularProgressSuspense.tsx +0 -90
  1244. package/src/suspense/__tests__/NullSuspense.tsx +0 -46
  1245. package/src/suspense/__tests__/__snapshots__/CircularProgressSuspense.tsx.snap +0 -24
  1246. package/src/table/__tests__/Table.tsx +0 -315
  1247. package/src/table/__tests__/TableBody.tsx +0 -52
  1248. package/src/table/__tests__/TableCheckbox.tsx +0 -89
  1249. package/src/table/__tests__/TableContainer.tsx +0 -31
  1250. package/src/table/__tests__/TableRadio.tsx +0 -112
  1251. package/src/table/__tests__/TableRow.tsx +0 -63
  1252. package/src/table/__tests__/__snapshots__/Table.tsx.snap +0 -2426
  1253. package/src/table/__tests__/__snapshots__/TableBody.tsx.snap +0 -54
  1254. package/src/table/__tests__/__snapshots__/TableCheckbox.tsx.snap +0 -142
  1255. package/src/table/__tests__/__snapshots__/TableContainer.tsx.snap +0 -16
  1256. package/src/table/__tests__/__snapshots__/TableRadio.tsx.snap +0 -138
  1257. package/src/table/__tests__/__snapshots__/TableRow.tsx.snap +0 -56
  1258. package/src/table/__tests__/__snapshots__/tableContainerStyles.ts.snap +0 -3
  1259. package/src/table/__tests__/__snapshots__/tableRowStyles.ts.snap +0 -3
  1260. package/src/table/__tests__/__snapshots__/tableStyles.ts.snap +0 -3
  1261. package/src/table/__tests__/tableContainerStyles.ts +0 -8
  1262. package/src/table/__tests__/tableRowStyles.ts +0 -8
  1263. package/src/table/__tests__/tableStyles.ts +0 -8
  1264. package/src/table/_table.scss +0 -447
  1265. package/src/tabs/__tests__/Tab.tsx +0 -51
  1266. package/src/tabs/__tests__/TabList.tsx +0 -640
  1267. package/src/tabs/__tests__/__snapshots__/Tab.tsx.snap +0 -85
  1268. package/src/tabs/__tests__/__snapshots__/TabList.tsx.snap +0 -51
  1269. package/src/tabs/__tests__/useTabs.tsx +0 -212
  1270. package/src/tabs/_tabs.scss +0 -273
  1271. package/src/test-utils/__tests__/ResizeObserver.ts +0 -171
  1272. package/src/theme/__tests__/LocalStorageColorSchemeProvider.tsx +0 -162
  1273. package/src/theme/__tests__/ThemeProvider.tsx +0 -90
  1274. package/src/theme/__tests__/__snapshots__/useCSSVariables.tsx.snap +0 -27
  1275. package/src/theme/__tests__/__snapshots__/useColorSchemeMetaTag.tsx.snap +0 -15
  1276. package/src/theme/__tests__/useCSSVariables.tsx +0 -177
  1277. package/src/theme/__tests__/useColorSchemeMetaTag.tsx +0 -36
  1278. package/src/theme/__tests__/utils.ts +0 -67
  1279. package/src/theme/_a11y.scss +0 -114
  1280. package/src/theme/_colors.scss +0 -1057
  1281. package/src/theme/_theme.scss +0 -520
  1282. package/src/tooltip/__tests__/Tooltip.tsx +0 -501
  1283. package/src/tooltip/__tests__/TooltipHoverModeProvider.tsx +0 -94
  1284. package/src/tooltip/__tests__/__snapshots__/Tooltip.tsx.snap +0 -34
  1285. package/src/tooltip/__tests__/utils.ts +0 -94
  1286. package/src/tooltip/_tooltip.scss +0 -155
  1287. package/src/transition/__tests__/CSSTransition.tsx +0 -182
  1288. package/src/transition/__tests__/Collapse.tsx +0 -209
  1289. package/src/transition/__tests__/CrossFade.tsx +0 -227
  1290. package/src/transition/__tests__/ScaleTransition.tsx +0 -204
  1291. package/src/transition/__tests__/SkeletonPlaceholder.tsx +0 -72
  1292. package/src/transition/__tests__/__snapshots__/CSSTransition.tsx.snap +0 -145
  1293. package/src/transition/__tests__/__snapshots__/Collapse.tsx.snap +0 -224
  1294. package/src/transition/__tests__/__snapshots__/CrossFade.tsx.snap +0 -240
  1295. package/src/transition/__tests__/__snapshots__/ScaleTransition.tsx.snap +0 -239
  1296. package/src/transition/__tests__/__snapshots__/SkeletonPlaceholder.tsx.snap +0 -24
  1297. package/src/transition/__tests__/__snapshots__/useCollapseTransition.tsx.snap +0 -361
  1298. package/src/transition/__tests__/__snapshots__/useCrossFadeTransition.tsx.snap +0 -258
  1299. package/src/transition/__tests__/__snapshots__/useMaxWidthTransition.tsx.snap +0 -68
  1300. package/src/transition/__tests__/__snapshots__/useScaleTransition.tsx.snap +0 -209
  1301. package/src/transition/__tests__/useCSSTransition.tsx +0 -190
  1302. package/src/transition/__tests__/useCollapseTransition.tsx +0 -316
  1303. package/src/transition/__tests__/useCrossFadeTransition.tsx +0 -229
  1304. package/src/transition/__tests__/useMaxWidthTransition.tsx +0 -123
  1305. package/src/transition/__tests__/useScaleTransition.tsx +0 -212
  1306. package/src/transition/__tests__/useTransition.tsx +0 -569
  1307. package/src/transition/__tests__/utils.ts +0 -620
  1308. package/src/transition/_transition.scss +0 -365
  1309. package/src/tree/__tests__/Tree.tsx +0 -735
  1310. package/src/tree/__tests__/TreeGroup.tsx +0 -76
  1311. package/src/tree/__tests__/TreeItemExpander.tsx +0 -74
  1312. package/src/tree/__tests__/__snapshots__/Tree.tsx.snap +0 -3618
  1313. package/src/tree/__tests__/__snapshots__/TreeItemExpander.tsx.snap +0 -11
  1314. package/src/tree/__tests__/utils.ts +0 -98
  1315. package/src/tree/_tree.scss +0 -176
  1316. package/src/typography/__tests__/SrOnly.tsx +0 -43
  1317. package/src/typography/__tests__/TextContainer.tsx +0 -45
  1318. package/src/typography/__tests__/Typography.tsx +0 -87
  1319. package/src/typography/__tests__/WritingDirectionProvider.node.tsx +0 -27
  1320. package/src/typography/__tests__/WritingDirectionProvider.tsx +0 -119
  1321. package/src/typography/__tests__/__snapshots__/SrOnly.tsx.snap +0 -56
  1322. package/src/typography/__tests__/__snapshots__/TextContainer.tsx.snap +0 -29
  1323. package/src/typography/__tests__/__snapshots__/Typography.tsx.snap +0 -112
  1324. package/src/typography/_typography.scss +0 -399
  1325. package/src/utils/__tests__/RenderRecursively.tsx +0 -87
  1326. package/src/utils/__tests__/__snapshots__/RenderRecursively.tsx.snap +0 -80
  1327. package/src/utils/__tests__/applyRef.ts +0 -30
  1328. package/src/utils/__tests__/bem.ts +0 -54
  1329. package/src/utils/__tests__/getMiddleOfRange.ts +0 -12
  1330. package/src/utils/__tests__/getPercentage.ts +0 -104
  1331. package/src/utils/__tests__/getRangeDefaultValue.ts +0 -47
  1332. package/src/utils/__tests__/getRangeSteps.ts +0 -14
  1333. package/src/utils/__tests__/loop.ts +0 -50
  1334. package/src/utils/__tests__/nearest.ts +0 -83
  1335. package/src/utils/__tests__/parseCssLengthUnit.node.ts +0 -28
  1336. package/src/utils/__tests__/parseCssLengthUnit.ts +0 -47
  1337. package/src/utils/__tests__/wait.ts +0 -12
  1338. package/src/utils/__tests__/withinRange.ts +0 -24
  1339. package/src/window-splitter/_window-splitter.scss +0 -143
  1340. package/tsconfig.json +0 -19
  1341. package/tsconfig.types.json +0 -12
  1342. package/tsdoc.json +0 -14
  1343. /package/dist/theme/{usePrefersColorScheme.d.ts → usePrefersDarkScheme.d.ts} +0 -0
  1344. /package/src/theme/{usePrefersColorScheme.ts → usePrefersDarkScheme.ts} +0 -0
@@ -23,8 +23,7 @@ import { nanoid } from "nanoid";
23
23
  *
24
24
  * @param message - An optional message for the error.
25
25
  */ constructor(message){
26
- super(message);
27
- /**
26
+ super(message), /**
28
27
  * A unique key generated by `nanoid` that can be used as a `React` key
29
28
  */ _define_property(this, "key", void 0);
30
29
  this.key = nanoid();
@@ -41,14 +40,9 @@ import { nanoid } from "nanoid";
41
40
  * @param files - A list of files that caused the error.
42
41
  * @param reason - An optional reason for the error
43
42
  */ constructor(files, reason){
44
- super("Invalid files");
45
- _define_property(this, "files", void 0);
46
- _define_property(this, "reason", void 0);
47
- /**
43
+ super("Invalid files"), _define_property(this, "files", void 0), _define_property(this, "reason", void 0), /**
48
44
  * A unique key generated by `nanoid` that can be used as a `React` key
49
- */ _define_property(this, "key", void 0);
50
- this.files = files;
51
- this.reason = reason;
45
+ */ _define_property(this, "key", void 0), this.files = files, this.reason = reason;
52
46
  this.key = nanoid();
53
47
  this.name = "GenericFileError";
54
48
  }
@@ -65,9 +59,7 @@ import { nanoid } from "nanoid";
65
59
  * limit defined.
66
60
  * @param limit - The max limit of files allowed.
67
61
  */ constructor(files, limit){
68
- super(files, "file limit");
69
- _define_property(this, "limit", void 0);
70
- this.limit = limit;
62
+ super(files, "file limit"), _define_property(this, "limit", void 0), this.limit = limit;
71
63
  this.name = "TooManyFilesError";
72
64
  }
73
65
  }
@@ -86,11 +78,7 @@ import { nanoid } from "nanoid";
86
78
  * @param type - The file size error type
87
79
  * @param limit - The number of bytes allowed based on the type
88
80
  */ constructor(files, type, limit){
89
- super(files, "file size");
90
- _define_property(this, "type", void 0);
91
- _define_property(this, "limit", void 0);
92
- this.type = type;
93
- this.limit = limit;
81
+ super(files, "file size"), _define_property(this, "type", void 0), _define_property(this, "limit", void 0), this.type = type, this.limit = limit;
94
82
  this.name = "FileSizeError";
95
83
  }
96
84
  }
@@ -105,9 +93,7 @@ import { nanoid } from "nanoid";
105
93
  * @param files - The file that caused the error
106
94
  * @param extensions - The allowed list of file extensions
107
95
  */ constructor(files, extensions){
108
- super(files, "extension");
109
- _define_property(this, "extensions", void 0);
110
- this.extensions = extensions;
96
+ super(files, "extension"), _define_property(this, "extensions", void 0), this.extensions = extensions;
111
97
  this.name = "FileExtensionError";
112
98
  }
113
99
  }
@@ -176,7 +162,8 @@ import { nanoid } from "nanoid";
176
162
  * @param options - The {@link FilesValidationOptions}
177
163
  * @returns the {@link ValidatedFilesResult}
178
164
  * @since 2.9.0
179
- */ export function validateFiles(files, { maxFiles, extensions, minFileSize, maxFileSize, totalBytes, totalFiles, totalFileSize, isValidFileName }) {
165
+ */ export function validateFiles(files, options) {
166
+ const { maxFiles, extensions, minFileSize, maxFileSize, totalBytes, totalFiles, totalFileSize, isValidFileName } = options;
180
167
  const errors = [];
181
168
  const pending = [];
182
169
  const extraFiles = [];
@@ -235,117 +222,5 @@ import { nanoid } from "nanoid";
235
222
  errors
236
223
  };
237
224
  }
238
- /**
239
- * This will first check if the mime-type of the file starts with `text/` and
240
- * fallback to checking a few file names or extensions that should be considered
241
- * text.
242
- *
243
- * This function is not guaranteed to be 100% correct and is only useful if
244
- * trying to generate a preview of files uploaded to the browser.
245
- *
246
- * @param file - The file to check
247
- * @returns `true` if the file should be considered as a text-content file.
248
- * @since 2.9.0
249
- */ export function isTextFile(file) {
250
- return /\.((j|t)sx?|json|lock|hbs|ya?ml|log|txt|md)$/i.test(file.name);
251
- }
252
- /**
253
- * This will first check if the mime-type of the file starts with `text\/` and
254
- * fallback to checking a few file names or extensions that should be considered
255
- * text.
256
- *
257
- * This function is not guaranteed to be 100% correct and is only useful if
258
- * trying to generate a preview of files uploaded to the browser.
259
- *
260
- * @param file - The file to check
261
- * @returns `true` if the file should be considered as a text content file.
262
- * @since 2.9.0
263
- */ export function isImageFile(file) {
264
- return /\.(a?png|avif|svg|tiff|gifv?|jpe?g)/i.test(file.name);
265
- }
266
- /**
267
- * This will first check if the mime-type of the file starts with `audio/` and
268
- * fallback to checking a few file names or extensions that should be considered
269
- * audio.
270
- *
271
- * This function is not guaranteed to be 100% correct and is only useful if
272
- * trying to generate a preview of files uploaded to the browser.
273
- *
274
- * @param file - The file to check
275
- * @returns `true` if the file should be considered as a audio content file.
276
- * @since 2.9.0
277
- */ export function isAudioFile(file) {
278
- return /\.(mp3|wav|ogg|m4p|flac)$/i.test(file.name);
279
- }
280
- /**
281
- * This will first check if the mime-type of the file starts with `video/` and
282
- * fallback to checking a few file names or extensions that should be considered
283
- * video.
284
- *
285
- * This function is not guaranteed to be 100% correct and is only useful if
286
- * trying to generate a preview of files uploaded to the browser.
287
- *
288
- * @param file - The file to check
289
- * @returns `true` if the file should be considered as a video content file.
290
- * @since 2.9.0
291
- */ export function isVideoFile(file) {
292
- return /\.(mkv|mpe?g|mov|avi|flv|webm|mp4)$/i.test(file.name);
293
- }
294
- /**
295
- * This function is not guaranteed to be 100% correct and is only useful if
296
- * trying to generate a preview of files uploaded to the browser.
297
- *
298
- * @param file - The file to check
299
- * @returns `true` if the file matches an image, audio, or video file.
300
- * @since 2.9.0
301
- */ export function isMediaFile(file) {
302
- return isImageFile(file) || isAudioFile(file) || isVideoFile(file);
303
- }
304
- /**
305
- * This function will attempt to read:
306
- * - media (image, audio, and video) files as a data url so they can be
307
- * previewed in `<img>`, `<audio>`, and `<video>` tags
308
- * - text files as plain text
309
- * - everything else as an `ArrayBuffer` which can be manually converted into a
310
- * data url if needed with `URL.createObjectURL`
311
- *
312
- * @since 2.9.0
313
- */ export const getFileParser = (file)=>{
314
- if (isMediaFile(file)) {
315
- return "readAsDataURL";
316
- }
317
- if (isTextFile(file)) {
318
- return "readAsText";
319
- }
320
- return "readAsArrayBuffer";
321
- };
322
- /**
323
- * This util will split all the current upload stats by status.
324
- *
325
- * @param stats - The {@link FileUploadStats} list generally returned by the
326
- * {@link useFileUpload} hook.
327
- * @returns the {@link SplitFileUploads}.
328
- * @since 2.9.0
329
- */ export function getSplitFileUploads(stats) {
330
- const pending = [];
331
- const uploading = [];
332
- const complete = [];
333
- stats.forEach((stat)=>{
334
- if (stat.status === "pending") {
335
- pending.push(stat);
336
- } else if (stat.status === "uploading") {
337
- uploading.push(stat);
338
- } else if (stat.status === "complete") {
339
- complete.push(stat);
340
- } else {
341
- /* istanbul ignore next */ throw new Error("Invalid upload stat");
342
- }
343
- });
344
- return {
345
- pending,
346
- uploading,
347
- complete
348
- };
349
- }
350
225
 
351
- //# sourceMappingURL=fileUtils.js.map
226
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/files/validation.ts"],"sourcesContent":["import { nanoid } from \"nanoid\";\n\n/**\n * An error that will be created if a user tries dragging and dropping files\n * from a shared directory that they do not have access to. This error will not\n * occur much.\n *\n * @since 2.9.0\n */\nexport class FileAccessError extends Error {\n /**\n * A unique key generated by `nanoid` that can be used as a `React` key\n */\n public key: string;\n\n /**\n *\n * @param message - An optional message for the error.\n */\n constructor(message?: string) {\n super(message);\n this.key = nanoid();\n this.name = \"FileAccessError\";\n }\n}\n\n/**\n * An error that just requires a `File` to be passed as the first argument.\n *\n * @since 2.9.0\n */\nexport class GenericFileError extends Error {\n /**\n * A unique key generated by `nanoid` that can be used as a `React` key\n */\n public key: string;\n\n /**\n *\n * @param files - A list of files that caused the error.\n * @param reason - An optional reason for the error\n */\n constructor(\n public files: readonly File[],\n public reason?: string\n ) {\n super(\"Invalid files\");\n this.key = nanoid();\n this.name = \"GenericFileError\";\n }\n}\n\n/**\n * An error that is created during the upload process if the number of files\n * exceeds the {@link FileUploadOptions.maxFiles} amount.\n *\n * @since 2.9.0\n */\nexport class TooManyFilesError extends GenericFileError {\n /**\n *\n * @param files - The list of files that could not be uploaded due to the file\n * limit defined.\n * @param limit - The max limit of files allowed.\n */\n constructor(\n files: readonly File[],\n public limit: number\n ) {\n super(files, \"file limit\");\n this.name = \"TooManyFilesError\";\n }\n}\n\n/**\n * An error that will be created if a user tries to upload a file that\n * is either:\n * - less than the {@link FileValidationOptions.minFileSize}\n * - greater than the {@link FileValidationOptions.maxFileSize}\n * - including the file would be greater than the {@link FileValidationOptions.totalFileSize}\n *\n * @since 2.9.0\n */\nexport class FileSizeError extends GenericFileError {\n /**\n *\n * @param files - The list of files that have the file size error\n * @param type - The file size error type\n * @param limit - The number of bytes allowed based on the type\n */\n constructor(\n files: readonly File[],\n public type: \"min\" | \"max\" | \"total\",\n public limit: number\n ) {\n super(files, \"file size\");\n this.name = \"FileSizeError\";\n }\n}\n\n/**\n * An error that will be created if a user tries to upload a file that does not\n * end with one of the {@link FileValidationOptions.extensions}.\n *\n * @since 2.9.0\n */\nexport class FileExtensionError extends GenericFileError {\n /**\n *\n * @param files - The file that caused the error\n * @param extensions - The allowed list of file extensions\n */\n constructor(\n files: readonly File[],\n public extensions: readonly string[]\n ) {\n super(files, \"extension\");\n this.name = \"FileExtensionError\";\n }\n}\n\n/**\n * Mostly an internal type that is used to allow custom validation errors\n *\n * @since 2.9.0\n */\nexport type FileValidationError<E = GenericFileError> =\n | FileAccessError\n | TooManyFilesError\n | FileSizeError\n | FileExtensionError\n | E;\n\n/**\n * A simple type-guard that can be used to check if the\n * {@link FileValidationError} is the {@link GenericFileError} which can be\n * useful when displaying the errors to the user.\n *\n * @param error - The error to check\n * @returns true if the error is a {@link FileAccessError}\n */\nexport function isGenericFileError<CustomError extends object>(\n error: FileValidationError<CustomError>\n): error is GenericFileError {\n return \"name\" in error && error.name === \"GenericFileError\";\n}\n\n/**\n * A simple type-guard that can be used to check if the\n * {@link FileValidationError} is the {@link FileAccessError} which can be\n * useful when displaying the errors to the user.\n *\n * @param error - The error to check\n * @returns true if the error is a {@link FileAccessError}\n */\nexport function isFileAccessError<CustomError extends object>(\n error: FileValidationError<CustomError>\n): error is FileAccessError {\n return \"name\" in error && error.name === \"FileAccessError\";\n}\n\n/**\n * A simple type-guard that can be used to check if the\n * {@link FileValidationError} is the {@link TooManyFilesError} which can be\n * useful when displaying the errors to the user.\n *\n * @param error - The error to check\n * @returns true if the error is a {@link TooManyFilesError}\n */\nexport function isTooManyFilesError<CustomError extends object>(\n error: FileValidationError<CustomError>\n): error is TooManyFilesError {\n return \"name\" in error && error.name === \"TooManyFilesError\";\n}\n\n/**\n * A simple type-guard that can be used to check if the\n * {@link FileValidationError} is the {@link FileSizeError} which can be\n * useful when displaying the errors to the user.\n *\n * @param error - The error to check\n * @returns true if the error is a {@link FileSizeError}\n */\nexport function isFileSizeError<CustomError extends object>(\n error: FileValidationError<CustomError>\n): error is FileSizeError {\n return \"name\" in error && error.name === \"FileSizeError\";\n}\n\n/**\n * A simple type-guard that can be used to check if the\n * {@link FileValidationError} is the {@link FileExtensionError} which can be\n * useful when displaying the errors to the user.\n *\n * @param error - The error to check\n * @returns true if the error is a {@link FileExtensionError}\n */\nexport function isFileExtensionError<CustomError extends object>(\n error: FileValidationError<CustomError>\n): error is FileExtensionError {\n return \"name\" in error && error.name === \"FileExtensionError\";\n}\n\n/**\n * This function is used to determine if a file should be added to the\n * {@link FileExtensionError}. The default implementation should work for most\n * use cases except when files that do not have extensions can be uploaded. i.e.\n * LICENSE files.\n *\n * @param file - The file being checked\n * @param extensionRegExp - A regex that will only be defined if the\n * `extensions` list had at least one value.\n * @param extensions - The list of extensions allowed\n * @returns true if the file has a valid name.\n * @since 3.1.0\n */\nexport type IsValidFileName = (\n file: File,\n extensionRegExp: RegExp | undefined,\n extensions: readonly string[]\n) => boolean;\n\n/**\n *\n * @defaultValue `matcher?.test(file.name) ?? true`\n * @since 3.1.0\n */\nexport const isValidFileName: IsValidFileName = (file, matcher) =>\n matcher?.test(file.name) ?? true;\n\n/** @since 2.9.0 */\nexport interface FileValidationOptions {\n /**\n * If the number of files should be limited, set this value to a number\n * greater than `0`.\n *\n * Note: This still allows \"infinite\" files when set to `0` since the\n * `<input>` element should normally be set to `disabled` if files should not\n * be able to be uploaded.\n *\n * @defaultValue `-1`\n */\n maxFiles?: number;\n\n /**\n * An optional minimum file size to enforce for each file. This will only be\n * used when it is greater than `0`.\n *\n * @defaultValue `-1`\n */\n minFileSize?: number;\n\n /**\n * An optional maximum file size to enforce for each file. This will only be\n * used when it is greater than `0`.\n *\n * @defaultValue `-1`\n */\n maxFileSize?: number;\n\n /**\n * An optional list of extensions to enforce when uploading files.\n *\n * Note: The extensions and file names will be compared ignoring case.\n *\n * @example Only Allow Images\n * ```ts\n * const extensions = [\"png\", \"jpeg\", \"jpg\", \"gif\"];\n * ```\n */\n extensions?: readonly string[];\n\n /** {@inheritDoc IsValidFileName} */\n isValidFileName?: IsValidFileName;\n\n /**\n * An optional total file size to enforce when the {@link maxFiles} option is\n * not set to `1`.\n *\n * @defaultValue `-1`\n */\n totalFileSize?: number;\n}\n\n/** @since 2.9.0 */\nexport interface FilesValidationOptions\n extends Required<FileValidationOptions> {\n /**\n * The total number of bytes in the {@link FileUploadHookReturnValue.stats}\n * list. This is really just:\n *\n * ```ts\n * const totalBytes = stats.reduce((total, stat) => total + stat.file.size, 0);\n * ```\n */\n totalBytes: number;\n\n /**\n * The total number of files in the {@link FileUploadHookReturnValue.stats}.\n */\n totalFiles: number;\n}\n\n/**\n * @since 2.9.0\n */\nexport interface ValidatedFilesResult<CustomError> {\n /**\n * A filtered list of files that have been validated and can be queued for the\n * upload process.\n */\n pending: readonly File[];\n\n /**\n * A list of {@link FileValidationError} that occurred during the validation\n * step.\n *\n * Note: If an error has occurred, the file **should not** be added to the\n * {@link pending} list of files.\n */\n errors: readonly FileValidationError<CustomError>[];\n}\n\n/**\n * This function will be called whenever a file has been uploaded by the user\n * either through an `<input type=\"file\">` or drag and drop behavior.\n *\n * @example Simple Example\n * ```ts\n * const validateFiles: FilesValidator = (files, options) => {\n * const invalid: File[] = [];\n * const pending: File[] = [];\n * for (const file of files) {\n * if (!/\\.(jpe?g|svg|png)$/i.test(name)) {\n * invalid.push(file);\n * } else {\n * pending.push(file);\n * }\n * }\n *\n * const errors: FileValidationError[] = [];\n * if (invalid.length) {\n * errors.push(new GenericFileError(invalid))\n * }\n *\n * return { pending, errors };\n * };\n * ```\n *\n * @typeparam E - An optional custom file validation error.\n * @param files - The list of files to check\n * @param options - The {@link FilesValidationOptions}\n * @returns the {@link ValidatedFilesResult}\n * @see {@link validateFiles} for the default implementation\n * @since 2.9.0\n */\nexport type FilesValidator<CustomError = never> = (\n files: readonly File[],\n options: FilesValidationOptions\n) => ValidatedFilesResult<CustomError>;\n\n/**\n * A pretty decent default implementation for validating files with the\n * {@link useFileUpload} that ensures the {@link FilesValidationOptions} are\n * enforced before allowing a file to be uploaded.\n *\n * @typeparam E - An optional custom file validation error.\n * @param files - The list of files to check\n * @param options - The {@link FilesValidationOptions}\n * @returns the {@link ValidatedFilesResult}\n * @since 2.9.0\n */\nexport function validateFiles<CustomError>(\n files: readonly File[],\n options: FilesValidationOptions\n): ValidatedFilesResult<CustomError> {\n const {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n } = options;\n\n const errors: FileValidationError<CustomError>[] = [];\n const pending: File[] = [];\n const extraFiles: File[] = [];\n const extensionRegExp =\n extensions.length > 0\n ? new RegExp(`\\\\.(${extensions.join(\"|\")})$`, \"i\")\n : undefined;\n\n let maxFilesReached = maxFiles > 0 && totalFiles >= maxFiles;\n let remainingBytes = totalFileSize - totalBytes;\n const extensionErrors: File[] = [];\n const minErrors: File[] = [];\n const maxErrors: File[] = [];\n const totalSizeErrors: File[] = [];\n for (let i = 0; i < files.length; i += 1) {\n const file = files[i];\n\n let valid = true;\n const { size } = file;\n if (!isValidFileName(file, extensionRegExp, extensions)) {\n valid = false;\n extensionErrors.push(file);\n }\n\n if (minFileSize > 0 && size < minFileSize) {\n valid = false;\n minErrors.push(file);\n }\n\n if (maxFileSize > 0 && size > maxFileSize) {\n valid = false;\n maxErrors.push(file);\n } else if (totalFileSize > 0 && remainingBytes - file.size < 0) {\n // don't want both errors displaying\n valid = false;\n totalSizeErrors.push(file);\n }\n\n if (maxFilesReached && valid) {\n extraFiles.push(file);\n } else if (!maxFilesReached && valid) {\n pending.push(file);\n remainingBytes -= file.size;\n maxFilesReached =\n maxFilesReached ||\n (maxFiles > 0 && totalFiles + pending.length >= maxFiles);\n }\n }\n\n if (extensionErrors.length) {\n errors.push(new FileExtensionError(extensionErrors, extensions));\n }\n\n if (minErrors.length) {\n errors.push(new FileSizeError(minErrors, \"min\", minFileSize));\n }\n\n if (maxErrors.length) {\n errors.push(new FileSizeError(maxErrors, \"max\", maxFileSize));\n }\n\n if (totalSizeErrors.length) {\n errors.push(new FileSizeError(totalSizeErrors, \"total\", totalFileSize));\n }\n\n if (extraFiles.length) {\n errors.push(new TooManyFilesError(extraFiles, maxFiles));\n }\n\n return { pending, errors };\n}\n"],"names":["nanoid","FileAccessError","Error","constructor","message","key","name","GenericFileError","files","reason","TooManyFilesError","limit","FileSizeError","type","FileExtensionError","extensions","isGenericFileError","error","isFileAccessError","isTooManyFilesError","isFileSizeError","isFileExtensionError","isValidFileName","file","matcher","test","validateFiles","options","maxFiles","minFileSize","maxFileSize","totalBytes","totalFiles","totalFileSize","errors","pending","extraFiles","extensionRegExp","length","RegExp","join","undefined","maxFilesReached","remainingBytes","extensionErrors","minErrors","maxErrors","totalSizeErrors","i","valid","size","push"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,MAAM,QAAQ,SAAS;AAEhC;;;;;;CAMC,GACD,OAAO,MAAMC,wBAAwBC;IAMnC;;;GAGC,GACDC,YAAYC,OAAgB,CAAE;QAC5B,KAAK,CAACA,UAVR;;GAEC,GACD,uBAAOC,OAAP,KAAA;QAQE,IAAI,CAACA,GAAG,GAAGL;QACX,IAAI,CAACM,IAAI,GAAG;IACd;AACF;AAEA;;;;CAIC,GACD,OAAO,MAAMC,yBAAyBL;IAMpC;;;;GAIC,GACDC,YACE,AAAOK,KAAsB,EAC7B,AAAOC,MAAe,CACtB;QACA,KAAK,CAAC,qGAdR;;GAEC,GACD,uBAAOJ,OAAP,KAAA,SAQSG,QAAAA,YACAC,SAAAA;QAGP,IAAI,CAACJ,GAAG,GAAGL;QACX,IAAI,CAACM,IAAI,GAAG;IACd;AACF;AAEA;;;;;CAKC,GACD,OAAO,MAAMI,0BAA0BH;IACrC;;;;;GAKC,GACDJ,YACEK,KAAsB,EACtB,AAAOG,KAAa,CACpB;QACA,KAAK,CAACH,OAAO,6DAFNG,QAAAA;QAGP,IAAI,CAACL,IAAI,GAAG;IACd;AACF;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMM,sBAAsBL;IACjC;;;;;GAKC,GACDJ,YACEK,KAAsB,EACtB,AAAOK,IAA6B,EACpC,AAAOF,KAAa,CACpB;QACA,KAAK,CAACH,OAAO,oGAHNK,OAAAA,WACAF,QAAAA;QAGP,IAAI,CAACL,IAAI,GAAG;IACd;AACF;AAEA;;;;;CAKC,GACD,OAAO,MAAMQ,2BAA2BP;IACtC;;;;GAIC,GACDJ,YACEK,KAAsB,EACtB,AAAOO,UAA6B,CACpC;QACA,KAAK,CAACP,OAAO,iEAFNO,aAAAA;QAGP,IAAI,CAACT,IAAI,GAAG;IACd;AACF;AAcA;;;;;;;CAOC,GACD,OAAO,SAASU,mBACdC,KAAuC;IAEvC,OAAO,UAAUA,SAASA,MAAMX,IAAI,KAAK;AAC3C;AAEA;;;;;;;CAOC,GACD,OAAO,SAASY,kBACdD,KAAuC;IAEvC,OAAO,UAAUA,SAASA,MAAMX,IAAI,KAAK;AAC3C;AAEA;;;;;;;CAOC,GACD,OAAO,SAASa,oBACdF,KAAuC;IAEvC,OAAO,UAAUA,SAASA,MAAMX,IAAI,KAAK;AAC3C;AAEA;;;;;;;CAOC,GACD,OAAO,SAASc,gBACdH,KAAuC;IAEvC,OAAO,UAAUA,SAASA,MAAMX,IAAI,KAAK;AAC3C;AAEA;;;;;;;CAOC,GACD,OAAO,SAASe,qBACdJ,KAAuC;IAEvC,OAAO,UAAUA,SAASA,MAAMX,IAAI,KAAK;AAC3C;AAqBA;;;;CAIC,GACD,OAAO,MAAMgB,kBAAmC,CAACC,MAAMC,UACrDA,SAASC,KAAKF,KAAKjB,IAAI,KAAK,KAAK;AAqInC;;;;;;;;;;CAUC,GACD,OAAO,SAASoB,cACdlB,KAAsB,EACtBmB,OAA+B;IAE/B,MAAM,EACJC,QAAQ,EACRb,UAAU,EACVc,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,UAAU,EACVC,aAAa,EACbX,eAAe,EAChB,GAAGK;IAEJ,MAAMO,SAA6C,EAAE;IACrD,MAAMC,UAAkB,EAAE;IAC1B,MAAMC,aAAqB,EAAE;IAC7B,MAAMC,kBACJtB,WAAWuB,MAAM,GAAG,IAChB,IAAIC,OAAO,CAAC,IAAI,EAAExB,WAAWyB,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,OAC5CC;IAEN,IAAIC,kBAAkBd,WAAW,KAAKI,cAAcJ;IACpD,IAAIe,iBAAiBV,gBAAgBF;IACrC,MAAMa,kBAA0B,EAAE;IAClC,MAAMC,YAAoB,EAAE;IAC5B,MAAMC,YAAoB,EAAE;IAC5B,MAAMC,kBAA0B,EAAE;IAClC,IAAK,IAAIC,IAAI,GAAGA,IAAIxC,MAAM8B,MAAM,EAAEU,KAAK,EAAG;QACxC,MAAMzB,OAAOf,KAAK,CAACwC,EAAE;QAErB,IAAIC,QAAQ;QACZ,MAAM,EAAEC,IAAI,EAAE,GAAG3B;QACjB,IAAI,CAACD,gBAAgBC,MAAMc,iBAAiBtB,aAAa;YACvDkC,QAAQ;YACRL,gBAAgBO,IAAI,CAAC5B;QACvB;QAEA,IAAIM,cAAc,KAAKqB,OAAOrB,aAAa;YACzCoB,QAAQ;YACRJ,UAAUM,IAAI,CAAC5B;QACjB;QAEA,IAAIO,cAAc,KAAKoB,OAAOpB,aAAa;YACzCmB,QAAQ;YACRH,UAAUK,IAAI,CAAC5B;QACjB,OAAO,IAAIU,gBAAgB,KAAKU,iBAAiBpB,KAAK2B,IAAI,GAAG,GAAG;YAC9D,oCAAoC;YACpCD,QAAQ;YACRF,gBAAgBI,IAAI,CAAC5B;QACvB;QAEA,IAAImB,mBAAmBO,OAAO;YAC5Bb,WAAWe,IAAI,CAAC5B;QAClB,OAAO,IAAI,CAACmB,mBAAmBO,OAAO;YACpCd,QAAQgB,IAAI,CAAC5B;YACboB,kBAAkBpB,KAAK2B,IAAI;YAC3BR,kBACEA,mBACCd,WAAW,KAAKI,aAAaG,QAAQG,MAAM,IAAIV;QACpD;IACF;IAEA,IAAIgB,gBAAgBN,MAAM,EAAE;QAC1BJ,OAAOiB,IAAI,CAAC,IAAIrC,mBAAmB8B,iBAAiB7B;IACtD;IAEA,IAAI8B,UAAUP,MAAM,EAAE;QACpBJ,OAAOiB,IAAI,CAAC,IAAIvC,cAAciC,WAAW,OAAOhB;IAClD;IAEA,IAAIiB,UAAUR,MAAM,EAAE;QACpBJ,OAAOiB,IAAI,CAAC,IAAIvC,cAAckC,WAAW,OAAOhB;IAClD;IAEA,IAAIiB,gBAAgBT,MAAM,EAAE;QAC1BJ,OAAOiB,IAAI,CAAC,IAAIvC,cAAcmC,iBAAiB,SAASd;IAC1D;IAEA,IAAIG,WAAWE,MAAM,EAAE;QACrBJ,OAAOiB,IAAI,CAAC,IAAIzC,kBAAkB0B,YAAYR;IAChD;IAEA,OAAO;QAAEO;QAASD;IAAO;AAC3B"}
@@ -1,5 +1,5 @@
1
- import type { KeyboardEventHandler, Ref, RefObject } from "react";
2
- import type { TransitionCallbacks } from "../transition/types.js";
1
+ import { type KeyboardEventHandler, type Ref, type RefObject } from "react";
2
+ import { type TransitionCallbacks } from "../transition/types.js";
3
3
  /**
4
4
  * `"mount"` - this will attempt to focus the container element if:
5
5
  * - there is no `document.activeElement`
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/focus/useFocusContainer.ts"],"sourcesContent":["\"use client\";\nimport type { KeyboardEventHandler, Ref, RefObject } from \"react\";\nimport { useEffect, useRef } from \"react\";\nimport { TRANSITION_CONFIG } from \"../transition/config.js\";\nimport type {\n TransitionCallbacks,\n TransitionEnterHandler,\n TransitionExitHandler,\n} from \"../transition/types.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport type { FocusElementWithinType } from \"./utils.js\";\nimport { focusElementWithin, getFocusableElements } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * `\"mount\"` - this will attempt to focus the container element if:\n * - there is no `document.activeElement`\n * - the container element does not contain the `document.activeElement`\n *\n * `\"unmount\"` - attempts to re-focus the element that was focused before the\n * focus container became active. The previous focus element is captured\n * whenever the `activate` option on the `useFocusContainer` hook is set to\n * `true`. This is normally when an element becomes `visible`.\n *\n * `\"keyboard\"` - refocuses the first focusable element if pressing `Tab` would\n * move the focus outside of the container element. If `Shift + Tab` was used,\n * the last focusable element will be used instead.\n *\n * @since 6.0.0\n */\nexport type FocusType = \"mount\" | \"unmount\" | \"keyboard\";\n\n/** @since 6.0.0 */\nexport type FocusContainerTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEntering\" | \"onEntered\" | \"onExiting\" | \"onExited\"\n>;\n\n/** @since 6.0.0 */\nexport interface FocusContainerTransitionOptions<E extends HTMLElement>\n extends FocusContainerTransitionCallbacks {\n /**\n * An optional ref that will be merged with the\n * {@link FocusContainerImplementation.nodeRef}\n */\n nodeRef?: Ref<E>;\n}\n\n/** @since 6.0.0 */\nexport interface FocusContainerEventHandlers<E extends HTMLElement> {\n onKeyDown?: KeyboardEventHandler<E>;\n}\n\n/**\n * @since 6.0.0\n */\nexport type IsFocusTypeDisabled = (type: FocusType) => boolean;\n\nexport interface FocusContainerComponentProps {\n /**\n * @defaultValue `() => false`\n */\n isFocusTypeDisabled?: IsFocusTypeDisabled;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface FocusContainerOptions<E extends HTMLElement>\n extends FocusContainerTransitionOptions<E>,\n FocusContainerComponentProps {\n onKeyDown?: KeyboardEventHandler<E>;\n /**\n * This to `true` will capture the current focused element as a focus target\n * once the `onExited` hook is fired. This should usually be set to the\n * `transitionIn` prop for `useTransition`.\n */\n activate: boolean;\n\n /**\n * Set this to true if elements that can be programmatically focused should be\n * included. These would be elements with a `tabIndex={-1}`.\n *\n * @defaultValue `false`\n */\n programmatic?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface FocusContainerImplementation<E extends HTMLElement> {\n nodeRef: RefObject<E>;\n eventHandlers: Required<FocusContainerEventHandlers<E>>;\n transitionOptions: Required<FocusContainerTransitionOptions<E>>;\n}\n\n/**\n * This hook is mostly for internal use only for dialog accessibility behavior\n * to prevent the focus from moving outside of the dialog while it is visible.\n * This API was developed to be used with the `useCSSTransition`/`useTransition`\n * hooks as well.\n *\n * @example Main Usage\n * ```tsx\n * import {\n * Button,\n * useFocusContainer,\n * useScaleTransition,\n * useToggle,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { toggled, enable, disable } = useToggle(false);\n *\n * const { eventHandlers, transitionOptions } = useFocusContainer({\n * activate: toggled,\n * });\n * const { elementProps, rendered } = useScaleTransition({\n * transitionIn: toggled,\n * temporary: true,\n * ...transitionOptions,\n * });\n *\n * return (\n * <>\n * <Button onClick={enable}>Toggle</Button>\n * {rendered && (\n * <div {...eventHandlers} {...elementProps}>\n * <Button onClick={disable}>Button 1</Button>\n * <Button onClick={disable}>Button 2</Button>\n * <Button onClick={disable}>Button 3</Button>\n * <Button onClick={disable}>Button 4</Button>\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useFocusContainer<E extends HTMLElement>(\n options: FocusContainerOptions<E>\n): FocusContainerImplementation<E> {\n const {\n nodeRef,\n activate,\n onEntering = noop,\n onEntered = noop,\n onExiting = noop,\n onExited = noop,\n onKeyDown = noop,\n programmatic = false,\n disableTransition = false,\n isFocusTypeDisabled = noop,\n } = options;\n\n const [ref, refCallback] = useEnsuredRef(nodeRef);\n const prevFocus = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!activate || !(document.activeElement instanceof HTMLElement)) {\n return;\n }\n\n prevFocus.current = document.activeElement;\n }, [activate]);\n\n const handleMountFocus =\n (callback: TransitionEnterHandler, skipped: boolean) =>\n (appearing: boolean) => {\n callback(appearing);\n const instance = ref.current;\n if (\n instance &&\n !skipped &&\n !isFocusTypeDisabled(\"mount\") &&\n (!document.activeElement || !instance.contains(document.activeElement))\n ) {\n instance.focus();\n }\n };\n\n const handleUnmountFocus =\n (callback: TransitionExitHandler, skipped: boolean) => (): void => {\n callback();\n if (skipped || isFocusTypeDisabled(\"unmount\")) {\n return;\n }\n\n // For some reason, the `\"Enter\"` keydown event fires at a different timing\n // than the Space keydown event.\n window.requestAnimationFrame(() => {\n prevFocus.current?.focus();\n });\n };\n\n return {\n nodeRef: ref,\n transitionOptions: {\n nodeRef: refCallback,\n onEntering: handleMountFocus(onEntering, false),\n onEntered: handleMountFocus(\n onEntered,\n !disableTransition && !TRANSITION_CONFIG.disabled\n ),\n onExiting: handleUnmountFocus(onExiting, false),\n onExited: handleUnmountFocus(\n onExited,\n !disableTransition && !TRANSITION_CONFIG.disabled\n ),\n },\n eventHandlers: {\n onKeyDown(event) {\n onKeyDown(event);\n if (\n event.isPropagationStopped() ||\n event.key !== \"Tab\" ||\n isFocusTypeDisabled(\"keyboard\")\n ) {\n return;\n }\n\n const { target, shiftKey, currentTarget } = event;\n const elements = getFocusableElements(currentTarget, programmatic);\n const count = elements.length;\n if (count === 0) {\n event.preventDefault();\n return;\n }\n\n // if the container element is the current focus, need to either focus\n // the first or last element so focus doesn't escape\n let type: FocusElementWithinType | undefined;\n if (\n count === 1 ||\n (!shiftKey &&\n (target === currentTarget || target === elements[count - 1]))\n ) {\n type = \"first\";\n } else if (\n shiftKey &&\n (target === currentTarget || target === elements[0])\n ) {\n type = \"last\";\n }\n\n if (type) {\n event.preventDefault();\n focusElementWithin({\n type,\n elements,\n container: currentTarget,\n });\n }\n },\n },\n };\n}\n"],"names":["useEffect","useRef","TRANSITION_CONFIG","useEnsuredRef","focusElementWithin","getFocusableElements","noop","useFocusContainer","options","nodeRef","activate","onEntering","onEntered","onExiting","onExited","onKeyDown","programmatic","disableTransition","isFocusTypeDisabled","ref","refCallback","prevFocus","document","activeElement","HTMLElement","current","handleMountFocus","callback","skipped","appearing","instance","contains","focus","handleUnmountFocus","window","requestAnimationFrame","transitionOptions","disabled","eventHandlers","event","isPropagationStopped","key","target","shiftKey","currentTarget","elements","count","length","preventDefault","type","container"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAC1C,SAASC,iBAAiB,QAAQ,0BAA0B;AAM5D,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,aAAa;AAEtE,MAAMC,OAAO;AACX,aAAa;AACf;AAsFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CC,GACD,OAAO,SAASC,kBACdC,OAAiC;IAEjC,MAAM,EACJC,OAAO,EACPC,QAAQ,EACRC,aAAaL,IAAI,EACjBM,YAAYN,IAAI,EAChBO,YAAYP,IAAI,EAChBQ,WAAWR,IAAI,EACfS,YAAYT,IAAI,EAChBU,eAAe,KAAK,EACpBC,oBAAoB,KAAK,EACzBC,sBAAsBZ,IAAI,EAC3B,GAAGE;IAEJ,MAAM,CAACW,KAAKC,YAAY,GAAGjB,cAAcM;IACzC,MAAMY,YAAYpB,OAA2B;IAE7CD,UAAU;QACR,IAAI,CAACU,YAAY,CAAEY,CAAAA,SAASC,aAAa,YAAYC,WAAU,GAAI;YACjE;QACF;QAEAH,UAAUI,OAAO,GAAGH,SAASC,aAAa;IAC5C,GAAG;QAACb;KAAS;IAEb,MAAMgB,mBACJ,CAACC,UAAkCC,UACnC,CAACC;YACCF,SAASE;YACT,MAAMC,WAAWX,IAAIM,OAAO;YAC5B,IACEK,YACA,CAACF,WACD,CAACV,oBAAoB,YACpB,CAAA,CAACI,SAASC,aAAa,IAAI,CAACO,SAASC,QAAQ,CAACT,SAASC,aAAa,CAAA,GACrE;gBACAO,SAASE,KAAK;YAChB;QACF;IAEF,MAAMC,qBACJ,CAACN,UAAiCC,UAAqB;YACrDD;YACA,IAAIC,WAAWV,oBAAoB,YAAY;gBAC7C;YACF;YAEA,2EAA2E;YAC3E,iCAAiC;YACjCgB,OAAOC,qBAAqB,CAAC;gBAC3Bd,UAAUI,OAAO,EAAEO;YACrB;QACF;IAEF,OAAO;QACLvB,SAASU;QACTiB,mBAAmB;YACjB3B,SAASW;YACTT,YAAYe,iBAAiBf,YAAY;YACzCC,WAAWc,iBACTd,WACA,CAACK,qBAAqB,CAACf,kBAAkBmC,QAAQ;YAEnDxB,WAAWoB,mBAAmBpB,WAAW;YACzCC,UAAUmB,mBACRnB,UACA,CAACG,qBAAqB,CAACf,kBAAkBmC,QAAQ;QAErD;QACAC,eAAe;YACbvB,WAAUwB,KAAK;gBACbxB,UAAUwB;gBACV,IACEA,MAAMC,oBAAoB,MAC1BD,MAAME,GAAG,KAAK,SACdvB,oBAAoB,aACpB;oBACA;gBACF;gBAEA,MAAM,EAAEwB,MAAM,EAAEC,QAAQ,EAAEC,aAAa,EAAE,GAAGL;gBAC5C,MAAMM,WAAWxC,qBAAqBuC,eAAe5B;gBACrD,MAAM8B,QAAQD,SAASE,MAAM;gBAC7B,IAAID,UAAU,GAAG;oBACfP,MAAMS,cAAc;oBACpB;gBACF;gBAEA,sEAAsE;gBACtE,oDAAoD;gBACpD,IAAIC;gBACJ,IACEH,UAAU,KACT,CAACH,YACCD,CAAAA,WAAWE,iBAAiBF,WAAWG,QAAQ,CAACC,QAAQ,EAAE,AAAD,GAC5D;oBACAG,OAAO;gBACT,OAAO,IACLN,YACCD,CAAAA,WAAWE,iBAAiBF,WAAWG,QAAQ,CAAC,EAAE,AAAD,GAClD;oBACAI,OAAO;gBACT;gBAEA,IAAIA,MAAM;oBACRV,MAAMS,cAAc;oBACpB5C,mBAAmB;wBACjB6C;wBACAJ;wBACAK,WAAWN;oBACb;gBACF;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/focus/useFocusContainer.ts"],"sourcesContent":["\"use client\";\nimport {\n useEffect,\n useRef,\n type KeyboardEventHandler,\n type Ref,\n type RefObject,\n} from \"react\";\nimport { TRANSITION_CONFIG } from \"../transition/config.js\";\nimport {\n type TransitionCallbacks,\n type TransitionEnterHandler,\n type TransitionExitHandler,\n} from \"../transition/types.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport {\n focusElementWithin,\n getFocusableElements,\n type FocusElementWithinType,\n} from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * `\"mount\"` - this will attempt to focus the container element if:\n * - there is no `document.activeElement`\n * - the container element does not contain the `document.activeElement`\n *\n * `\"unmount\"` - attempts to re-focus the element that was focused before the\n * focus container became active. The previous focus element is captured\n * whenever the `activate` option on the `useFocusContainer` hook is set to\n * `true`. This is normally when an element becomes `visible`.\n *\n * `\"keyboard\"` - refocuses the first focusable element if pressing `Tab` would\n * move the focus outside of the container element. If `Shift + Tab` was used,\n * the last focusable element will be used instead.\n *\n * @since 6.0.0\n */\nexport type FocusType = \"mount\" | \"unmount\" | \"keyboard\";\n\n/** @since 6.0.0 */\nexport type FocusContainerTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEntering\" | \"onEntered\" | \"onExiting\" | \"onExited\"\n>;\n\n/** @since 6.0.0 */\nexport interface FocusContainerTransitionOptions<E extends HTMLElement>\n extends FocusContainerTransitionCallbacks {\n /**\n * An optional ref that will be merged with the\n * {@link FocusContainerImplementation.nodeRef}\n */\n nodeRef?: Ref<E>;\n}\n\n/** @since 6.0.0 */\nexport interface FocusContainerEventHandlers<E extends HTMLElement> {\n onKeyDown?: KeyboardEventHandler<E>;\n}\n\n/**\n * @since 6.0.0\n */\nexport type IsFocusTypeDisabled = (type: FocusType) => boolean;\n\nexport interface FocusContainerComponentProps {\n /**\n * @defaultValue `() => false`\n */\n isFocusTypeDisabled?: IsFocusTypeDisabled;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface FocusContainerOptions<E extends HTMLElement>\n extends FocusContainerTransitionOptions<E>,\n FocusContainerComponentProps {\n onKeyDown?: KeyboardEventHandler<E>;\n /**\n * This to `true` will capture the current focused element as a focus target\n * once the `onExited` hook is fired. This should usually be set to the\n * `transitionIn` prop for `useTransition`.\n */\n activate: boolean;\n\n /**\n * Set this to true if elements that can be programmatically focused should be\n * included. These would be elements with a `tabIndex={-1}`.\n *\n * @defaultValue `false`\n */\n programmatic?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface FocusContainerImplementation<E extends HTMLElement> {\n nodeRef: RefObject<E>;\n eventHandlers: Required<FocusContainerEventHandlers<E>>;\n transitionOptions: Required<FocusContainerTransitionOptions<E>>;\n}\n\n/**\n * This hook is mostly for internal use only for dialog accessibility behavior\n * to prevent the focus from moving outside of the dialog while it is visible.\n * This API was developed to be used with the `useCSSTransition`/`useTransition`\n * hooks as well.\n *\n * @example Main Usage\n * ```tsx\n * import {\n * Button,\n * useFocusContainer,\n * useScaleTransition,\n * useToggle,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { toggled, enable, disable } = useToggle(false);\n *\n * const { eventHandlers, transitionOptions } = useFocusContainer({\n * activate: toggled,\n * });\n * const { elementProps, rendered } = useScaleTransition({\n * transitionIn: toggled,\n * temporary: true,\n * ...transitionOptions,\n * });\n *\n * return (\n * <>\n * <Button onClick={enable}>Toggle</Button>\n * {rendered && (\n * <div {...eventHandlers} {...elementProps}>\n * <Button onClick={disable}>Button 1</Button>\n * <Button onClick={disable}>Button 2</Button>\n * <Button onClick={disable}>Button 3</Button>\n * <Button onClick={disable}>Button 4</Button>\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useFocusContainer<E extends HTMLElement>(\n options: FocusContainerOptions<E>\n): FocusContainerImplementation<E> {\n const {\n nodeRef,\n activate,\n onEntering = noop,\n onEntered = noop,\n onExiting = noop,\n onExited = noop,\n onKeyDown = noop,\n programmatic = false,\n disableTransition = false,\n isFocusTypeDisabled = noop,\n } = options;\n\n const [ref, refCallback] = useEnsuredRef(nodeRef);\n const prevFocus = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!activate || !(document.activeElement instanceof HTMLElement)) {\n return;\n }\n\n prevFocus.current = document.activeElement;\n }, [activate]);\n\n const handleMountFocus =\n (callback: TransitionEnterHandler, skipped: boolean) =>\n (appearing: boolean) => {\n callback(appearing);\n const instance = ref.current;\n if (\n instance &&\n !skipped &&\n !isFocusTypeDisabled(\"mount\") &&\n (!document.activeElement || !instance.contains(document.activeElement))\n ) {\n instance.focus();\n }\n };\n\n const handleUnmountFocus =\n (callback: TransitionExitHandler, skipped: boolean) => (): void => {\n callback();\n if (skipped || isFocusTypeDisabled(\"unmount\")) {\n return;\n }\n\n // For some reason, the `\"Enter\"` keydown event fires at a different timing\n // than the Space keydown event.\n window.requestAnimationFrame(() => {\n prevFocus.current?.focus();\n });\n };\n\n return {\n nodeRef: ref,\n transitionOptions: {\n nodeRef: refCallback,\n onEntering: handleMountFocus(onEntering, false),\n onEntered: handleMountFocus(\n onEntered,\n !disableTransition && !TRANSITION_CONFIG.disabled\n ),\n onExiting: handleUnmountFocus(onExiting, false),\n onExited: handleUnmountFocus(\n onExited,\n !disableTransition && !TRANSITION_CONFIG.disabled\n ),\n },\n eventHandlers: {\n onKeyDown(event) {\n onKeyDown(event);\n if (\n event.isPropagationStopped() ||\n event.key !== \"Tab\" ||\n isFocusTypeDisabled(\"keyboard\")\n ) {\n return;\n }\n\n const { target, shiftKey, currentTarget } = event;\n const elements = getFocusableElements(currentTarget, programmatic);\n const count = elements.length;\n if (count === 0) {\n event.preventDefault();\n return;\n }\n\n // if the container element is the current focus, need to either focus\n // the first or last element so focus doesn't escape\n let type: FocusElementWithinType | undefined;\n if (\n count === 1 ||\n (!shiftKey &&\n (target === currentTarget || target === elements[count - 1]))\n ) {\n type = \"first\";\n } else if (\n shiftKey &&\n (target === currentTarget || target === elements[0])\n ) {\n type = \"last\";\n }\n\n if (type) {\n event.preventDefault();\n focusElementWithin({\n type,\n elements,\n container: currentTarget,\n });\n }\n },\n },\n };\n}\n"],"names":["useEffect","useRef","TRANSITION_CONFIG","useEnsuredRef","focusElementWithin","getFocusableElements","noop","useFocusContainer","options","nodeRef","activate","onEntering","onEntered","onExiting","onExited","onKeyDown","programmatic","disableTransition","isFocusTypeDisabled","ref","refCallback","prevFocus","document","activeElement","HTMLElement","current","handleMountFocus","callback","skipped","appearing","instance","contains","focus","handleUnmountFocus","window","requestAnimationFrame","transitionOptions","disabled","eventHandlers","event","isPropagationStopped","key","target","shiftKey","currentTarget","elements","count","length","preventDefault","type","container"],"mappings":"AAAA;AACA,SACEA,SAAS,EACTC,MAAM,QAID,QAAQ;AACf,SAASC,iBAAiB,QAAQ,0BAA0B;AAM5D,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SACEC,kBAAkB,EAClBC,oBAAoB,QAEf,aAAa;AAEpB,MAAMC,OAAO;AACX,aAAa;AACf;AAsFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CC,GACD,OAAO,SAASC,kBACdC,OAAiC;IAEjC,MAAM,EACJC,OAAO,EACPC,QAAQ,EACRC,aAAaL,IAAI,EACjBM,YAAYN,IAAI,EAChBO,YAAYP,IAAI,EAChBQ,WAAWR,IAAI,EACfS,YAAYT,IAAI,EAChBU,eAAe,KAAK,EACpBC,oBAAoB,KAAK,EACzBC,sBAAsBZ,IAAI,EAC3B,GAAGE;IAEJ,MAAM,CAACW,KAAKC,YAAY,GAAGjB,cAAcM;IACzC,MAAMY,YAAYpB,OAA2B;IAE7CD,UAAU;QACR,IAAI,CAACU,YAAY,CAAEY,CAAAA,SAASC,aAAa,YAAYC,WAAU,GAAI;YACjE;QACF;QAEAH,UAAUI,OAAO,GAAGH,SAASC,aAAa;IAC5C,GAAG;QAACb;KAAS;IAEb,MAAMgB,mBACJ,CAACC,UAAkCC,UACnC,CAACC;YACCF,SAASE;YACT,MAAMC,WAAWX,IAAIM,OAAO;YAC5B,IACEK,YACA,CAACF,WACD,CAACV,oBAAoB,YACpB,CAAA,CAACI,SAASC,aAAa,IAAI,CAACO,SAASC,QAAQ,CAACT,SAASC,aAAa,CAAA,GACrE;gBACAO,SAASE,KAAK;YAChB;QACF;IAEF,MAAMC,qBACJ,CAACN,UAAiCC,UAAqB;YACrDD;YACA,IAAIC,WAAWV,oBAAoB,YAAY;gBAC7C;YACF;YAEA,2EAA2E;YAC3E,iCAAiC;YACjCgB,OAAOC,qBAAqB,CAAC;gBAC3Bd,UAAUI,OAAO,EAAEO;YACrB;QACF;IAEF,OAAO;QACLvB,SAASU;QACTiB,mBAAmB;YACjB3B,SAASW;YACTT,YAAYe,iBAAiBf,YAAY;YACzCC,WAAWc,iBACTd,WACA,CAACK,qBAAqB,CAACf,kBAAkBmC,QAAQ;YAEnDxB,WAAWoB,mBAAmBpB,WAAW;YACzCC,UAAUmB,mBACRnB,UACA,CAACG,qBAAqB,CAACf,kBAAkBmC,QAAQ;QAErD;QACAC,eAAe;YACbvB,WAAUwB,KAAK;gBACbxB,UAAUwB;gBACV,IACEA,MAAMC,oBAAoB,MAC1BD,MAAME,GAAG,KAAK,SACdvB,oBAAoB,aACpB;oBACA;gBACF;gBAEA,MAAM,EAAEwB,MAAM,EAAEC,QAAQ,EAAEC,aAAa,EAAE,GAAGL;gBAC5C,MAAMM,WAAWxC,qBAAqBuC,eAAe5B;gBACrD,MAAM8B,QAAQD,SAASE,MAAM;gBAC7B,IAAID,UAAU,GAAG;oBACfP,MAAMS,cAAc;oBACpB;gBACF;gBAEA,sEAAsE;gBACtE,oDAAoD;gBACpD,IAAIC;gBACJ,IACEH,UAAU,KACT,CAACH,YACCD,CAAAA,WAAWE,iBAAiBF,WAAWG,QAAQ,CAACC,QAAQ,EAAE,AAAD,GAC5D;oBACAG,OAAO;gBACT,OAAO,IACLN,YACCD,CAAAA,WAAWE,iBAAiBF,WAAWG,QAAQ,CAAC,EAAE,AAAD,GAClD;oBACAI,OAAO;gBACT;gBAEA,IAAIA,MAAM;oBACRV,MAAMS,cAAc;oBACpB5C,mBAAmB;wBACjB6C;wBACAJ;wBACAK,WAAWN;oBACb;gBACF;YACF;QACF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/focus/utils.ts"],"sourcesContent":["const queries = [\n 'input:not([type=\"hidden\"]):not([disabled])',\n \"button:not([disabled])\",\n \"textarea:not([disabled])\",\n \"select:not([disabled])\",\n \"a[href]\",\n \"area[href]\",\n \"[tabindex]\",\n] as const;\n\n/**\n * A query selector to find elements that are programmatically focusable.\n *\n * Example:\n *\n * ```ts\n * const focusableElements = document.querySelectorAll(PROGRAMMATICALLY_FOCUSABLE);\n * // do something with elements\n * ```\n */\nexport const PROGRAMMATICALLY_FOCUSABLE = queries.join(\",\");\n\n/**\n * A query selector to find elements that are focusable only with tab and shift+tab.\n *\n * Example:\n *\n * ```ts\n * const focusableElements = document.querySelectorAll(TAB_FOCUSABLE);\n * // do something with elements\n * ```\n *\n * @since 6.0.0 This was updated to remove ALL elements that have a\n * `tabindex=\"-1\"` applied instead of only elements that had a manual tab index\n * applied.\n */\nexport const TAB_FOCUSABLE = queries.reduce((fullQuery, query) => {\n const prefix = `${fullQuery}${fullQuery ? \",\" : \"\"}`;\n const notProgrammaticQuery = `${query}:not([tabindex=\"-1\"])`;\n\n return `${prefix}${notProgrammaticQuery}`;\n}, \"\");\n\n/**\n * A simple util that will find all the tab focusable elements within a\n * container element. The container should normally be a specific HTMLElement,\n * but it can also be the entire document if you want to find **all** focusable\n * elements within your page.\n *\n * @since 6.0.0 This function will be used for all keyboard focus behavior\n * instead of trying to use refs. I did some performance testing in Firefox and\n * Chrome and the `querySelectorAll` takes 4ms with 5000 elements for my use\n * cases. There is more of a performance issue around rendering all 5000\n * elements and since this is only used for specific keydown events, this is\n * good enough for me.\n *\n * @param container - The container element/document to find focusable elements\n * within.\n * @param programmatic - Boolean if programmatically focusable elements should be\n * included instead of only tab focusable.\n * @returns A list of HTMLElements that are focusable within the container.\n */\nexport function getFocusableElements(\n container: HTMLElement | Document,\n programmatic = false\n): readonly HTMLElement[] {\n // spread operator is faster than Array.from\n return [\n ...container.querySelectorAll<HTMLElement>(\n programmatic ? PROGRAMMATICALLY_FOCUSABLE : TAB_FOCUSABLE\n ),\n ];\n}\n\n/**\n * Attempts to find the first focusable element within a container.\n *\n * @since 6.0.0\n * @param container - The container element/document to find focusable elements\n * within.\n * @param programmatic - Boolean if programmatically focusable elements should be\n * included instead of only tab focusable.\n * @returns A list of HTMLElements that are focusable within the container.\n */\nexport function getFocusableElement(\n container: HTMLElement | Document,\n programmatic = false\n): HTMLElement | null {\n return container.querySelector<HTMLElement>(\n programmatic ? PROGRAMMATICALLY_FOCUSABLE : TAB_FOCUSABLE\n );\n}\n\n/**\n * An element can be tab focused if it is:\n * - an anchor or area with an `href`\n * - a non-disabled `input` element that is not `type=\"hidden\"`\n * - a non-disabled `button`, `textarea`, or `select` element\n * - an element with a `tabIndex >= 0`\n *\n * An element can be noted as \"programmatically focusable only\" has the above\n * rules, but the `tabIndex` will be set to `-1`.\n *\n * @since 2.8.0\n */\nexport type ElementFocusType = \"tab\" | \"programmatic\";\n\nexport function isFocusable(\n element: HTMLElement | Document | Window,\n type: ElementFocusType = \"programmatic\"\n): element is HTMLElement {\n const selector = type === \"tab\" ? TAB_FOCUSABLE : PROGRAMMATICALLY_FOCUSABLE;\n\n return \"matches\" in element && element.matches(selector);\n}\n\nexport type FocusElementWithinType =\n | \"first\"\n | \"last\"\n | \"query\"\n | \"self\"\n | \"none\";\n\nexport interface FocusElementWithinOptions {\n type: FocusElementWithinType;\n query?: string;\n elements: readonly HTMLElement[];\n container: HTMLElement | Document;\n}\n\nexport function focusElementWithin(options: FocusElementWithinOptions): void {\n const { type, query = \"\", container, elements } = options;\n if (type === \"none\") {\n return;\n }\n\n let element: HTMLElement | null = null;\n if (type === \"first\") {\n [element] = elements;\n } else if (type === \"last\") {\n element = elements[elements.length - 1];\n } else if (type === \"query\") {\n element = document.querySelector<HTMLElement>(query);\n }\n\n if (!element && isFocusable(container)) {\n element = container;\n }\n\n // TODO: Why did I add preventScroll?\n element?.focus();\n}\n"],"names":["queries","PROGRAMMATICALLY_FOCUSABLE","join","TAB_FOCUSABLE","reduce","fullQuery","query","prefix","notProgrammaticQuery","getFocusableElements","container","programmatic","querySelectorAll","getFocusableElement","querySelector","isFocusable","element","type","selector","matches","focusElementWithin","options","elements","length","document","focus"],"mappings":"AAAA,MAAMA,UAAU;IACd;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED;;;;;;;;;CASC,GACD,OAAO,MAAMC,6BAA6BD,QAAQE,IAAI,CAAC,KAAK;AAE5D;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMC,gBAAgBH,QAAQI,MAAM,CAAC,CAACC,WAAWC;IACtD,MAAMC,SAAS,CAAC,EAAEF,UAAU,EAAEA,YAAY,MAAM,GAAG,CAAC;IACpD,MAAMG,uBAAuB,CAAC,EAAEF,MAAM,qBAAqB,CAAC;IAE5D,OAAO,CAAC,EAAEC,OAAO,EAAEC,qBAAqB,CAAC;AAC3C,GAAG,IAAI;AAEP;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,SAASC,qBACdC,SAAiC,EACjCC,eAAe,KAAK;IAEpB,4CAA4C;IAC5C,OAAO;WACFD,UAAUE,gBAAgB,CAC3BD,eAAeV,6BAA6BE;KAE/C;AACH;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASU,oBACdH,SAAiC,EACjCC,eAAe,KAAK;IAEpB,OAAOD,UAAUI,aAAa,CAC5BH,eAAeV,6BAA6BE;AAEhD;AAgBA,OAAO,SAASY,YACdC,OAAwC,EACxCC,OAAyB,cAAc;IAEvC,MAAMC,WAAWD,SAAS,QAAQd,gBAAgBF;IAElD,OAAO,aAAae,WAAWA,QAAQG,OAAO,CAACD;AACjD;AAgBA,OAAO,SAASE,mBAAmBC,OAAkC;IACnE,MAAM,EAAEJ,IAAI,EAAEX,QAAQ,EAAE,EAAEI,SAAS,EAAEY,QAAQ,EAAE,GAAGD;IAClD,IAAIJ,SAAS,QAAQ;QACnB;IACF;IAEA,IAAID,UAA8B;IAClC,IAAIC,SAAS,SAAS;QACpB,CAACD,QAAQ,GAAGM;IACd,OAAO,IAAIL,SAAS,QAAQ;QAC1BD,UAAUM,QAAQ,CAACA,SAASC,MAAM,GAAG,EAAE;IACzC,OAAO,IAAIN,SAAS,SAAS;QAC3BD,UAAUQ,SAASV,aAAa,CAAcR;IAChD;IAEA,IAAI,CAACU,WAAWD,YAAYL,YAAY;QACtCM,UAAUN;IACZ;IAEA,qCAAqC;IACrCM,SAASS;AACX"}
1
+ {"version":3,"sources":["../../src/focus/utils.ts"],"sourcesContent":["const queries = [\n 'input:not([type=\"hidden\"]):not([disabled])',\n \"button:not([disabled])\",\n \"textarea:not([disabled])\",\n \"select:not([disabled])\",\n \"a[href]\",\n \"area[href]\",\n \"[tabindex]\",\n] as const;\n\n/**\n * A query selector to find elements that are programmatically focusable.\n *\n * Example:\n *\n * ```ts\n * const focusableElements = document.querySelectorAll(PROGRAMMATICALLY_FOCUSABLE);\n * // do something with elements\n * ```\n */\nexport const PROGRAMMATICALLY_FOCUSABLE = queries.join(\",\");\n\n/**\n * A query selector to find elements that are focusable only with tab and shift+tab.\n *\n * Example:\n *\n * ```ts\n * const focusableElements = document.querySelectorAll(TAB_FOCUSABLE);\n * // do something with elements\n * ```\n *\n * @since 6.0.0 This was updated to remove ALL elements that have a\n * `tabindex=\"-1\"` applied instead of only elements that had a manual tab index\n * applied.\n */\nexport const TAB_FOCUSABLE = queries.reduce((fullQuery, query) => {\n const prefix = `${fullQuery}${fullQuery ? \",\" : \"\"}`;\n const notProgrammaticQuery = `${query}:not([tabindex=\"-1\"])`;\n\n return `${prefix}${notProgrammaticQuery}`;\n}, \"\");\n\n/**\n * A simple util that will find all the tab focusable elements within a\n * container element. The container should normally be a specific HTMLElement,\n * but it can also be the entire document if you want to find **all** focusable\n * elements within your page.\n *\n * @since 6.0.0 This function will be used for all keyboard focus behavior\n * instead of trying to use refs. I did some performance testing in Firefox and\n * Chrome and the `querySelectorAll` takes 4ms with 5000 elements for my use\n * cases. There is more of a performance issue around rendering all 5000\n * elements and since this is only used for specific keydown events, this is\n * good enough for me.\n *\n * @param container - The container element/document to find focusable elements\n * within.\n * @param programmatic - Boolean if programmatically focusable elements should be\n * included instead of only tab focusable.\n * @returns A list of HTMLElements that are focusable within the container.\n */\nexport function getFocusableElements(\n container: HTMLElement | Document,\n programmatic = false\n): readonly HTMLElement[] {\n // spread operator is faster than Array.from\n return [\n ...container.querySelectorAll<HTMLElement>(\n programmatic ? PROGRAMMATICALLY_FOCUSABLE : TAB_FOCUSABLE\n ),\n ];\n}\n\n/**\n * Attempts to find the first focusable element within a container.\n *\n * @since 6.0.0\n * @param container - The container element/document to find focusable elements\n * within.\n * @param programmatic - Boolean if programmatically focusable elements should be\n * included instead of only tab focusable.\n * @returns A list of HTMLElements that are focusable within the container.\n */\nexport function getFocusableElement(\n container: HTMLElement | Document,\n programmatic = false\n): HTMLElement | null {\n return container.querySelector<HTMLElement>(\n programmatic ? PROGRAMMATICALLY_FOCUSABLE : TAB_FOCUSABLE\n );\n}\n\n/**\n * An element can be tab focused if it is:\n * - an anchor or area with an `href`\n * - a non-disabled `input` element that is not `type=\"hidden\"`\n * - a non-disabled `button`, `textarea`, or `select` element\n * - an element with a `tabIndex >= 0`\n *\n * An element can be noted as \"programmatically focusable only\" has the above\n * rules, but the `tabIndex` will be set to `-1`.\n *\n * @since 2.8.0\n */\nexport type ElementFocusType = \"tab\" | \"programmatic\";\n\nexport function isFocusable(\n element: HTMLElement | Document | Window,\n type: ElementFocusType = \"programmatic\"\n): element is HTMLElement {\n const selector = type === \"tab\" ? TAB_FOCUSABLE : PROGRAMMATICALLY_FOCUSABLE;\n\n return \"matches\" in element && element.matches(selector);\n}\n\nexport type FocusElementWithinType =\n | \"first\"\n | \"last\"\n | \"query\"\n | \"self\"\n | \"none\";\n\nexport interface FocusElementWithinOptions {\n type: FocusElementWithinType;\n query?: string;\n elements: readonly HTMLElement[];\n container: HTMLElement | Document;\n}\n\nexport function focusElementWithin(options: FocusElementWithinOptions): void {\n const { type, query = \"\", container, elements } = options;\n if (type === \"none\") {\n return;\n }\n\n let element: HTMLElement | null = null;\n if (type === \"first\") {\n [element] = elements;\n } else if (type === \"last\") {\n element = elements[elements.length - 1];\n } else if (type === \"query\") {\n element = document.querySelector<HTMLElement>(query);\n }\n\n if (!element && isFocusable(container)) {\n element = container;\n }\n\n // TODO: Why did I add preventScroll?\n element?.focus();\n}\n"],"names":["queries","PROGRAMMATICALLY_FOCUSABLE","join","TAB_FOCUSABLE","reduce","fullQuery","query","prefix","notProgrammaticQuery","getFocusableElements","container","programmatic","querySelectorAll","getFocusableElement","querySelector","isFocusable","element","type","selector","matches","focusElementWithin","options","elements","length","document","focus"],"mappings":"AAAA,MAAMA,UAAU;IACd;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED;;;;;;;;;CASC,GACD,OAAO,MAAMC,6BAA6BD,QAAQE,IAAI,CAAC,KAAK;AAE5D;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMC,gBAAgBH,QAAQI,MAAM,CAAC,CAACC,WAAWC;IACtD,MAAMC,SAAS,GAAGF,YAAYA,YAAY,MAAM,IAAI;IACpD,MAAMG,uBAAuB,GAAGF,MAAM,qBAAqB,CAAC;IAE5D,OAAO,GAAGC,SAASC,sBAAsB;AAC3C,GAAG,IAAI;AAEP;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,SAASC,qBACdC,SAAiC,EACjCC,eAAe,KAAK;IAEpB,4CAA4C;IAC5C,OAAO;WACFD,UAAUE,gBAAgB,CAC3BD,eAAeV,6BAA6BE;KAE/C;AACH;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASU,oBACdH,SAAiC,EACjCC,eAAe,KAAK;IAEpB,OAAOD,UAAUI,aAAa,CAC5BH,eAAeV,6BAA6BE;AAEhD;AAgBA,OAAO,SAASY,YACdC,OAAwC,EACxCC,OAAyB,cAAc;IAEvC,MAAMC,WAAWD,SAAS,QAAQd,gBAAgBF;IAElD,OAAO,aAAae,WAAWA,QAAQG,OAAO,CAACD;AACjD;AAgBA,OAAO,SAASE,mBAAmBC,OAAkC;IACnE,MAAM,EAAEJ,IAAI,EAAEX,QAAQ,EAAE,EAAEI,SAAS,EAAEY,QAAQ,EAAE,GAAGD;IAClD,IAAIJ,SAAS,QAAQ;QACnB;IACF;IAEA,IAAID,UAA8B;IAClC,IAAIC,SAAS,SAAS;QACpB,CAACD,QAAQ,GAAGM;IACd,OAAO,IAAIL,SAAS,QAAQ;QAC1BD,UAAUM,QAAQ,CAACA,SAASC,MAAM,GAAG,EAAE;IACzC,OAAO,IAAIN,SAAS,SAAS;QAC3BD,UAAUQ,SAASV,aAAa,CAAcR;IAChD;IAEA,IAAI,CAACU,WAAWD,YAAYL,YAAY;QACtCM,UAAUN;IACZ;IAEA,qCAAqC;IACrCM,SAASS;AACX"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type CheckboxProps } from "./InputToggle.js";
3
2
  /**
4
3
  * **Client Component**
@@ -19,8 +19,6 @@ export interface FieldsetClassNameOptions {
19
19
  */
20
20
  export declare function fieldset(options?: FieldsetClassNameOptions): string;
21
21
  /**
22
- * **Server Component**
23
- *
24
22
  * @since 6.0.0 Removed the `legend`, `legendStyle`,
25
23
  * `legendClassName`, and `legendSROnly` props. You must provide a `Legend`
26
24
  * yourself manually instead of using a prop.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Fieldset.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type FieldsetHTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-fieldset\");\n\n/** @since 6.0.0 */\nexport interface FieldsetClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to enable the default browser styles for a fieldset.\n *\n * @since 6.0.0 This was renamed from `unstyled`.\n * @defaultValue `false`\n */\n browserStyles?: boolean;\n\n /**\n * @defaultValue `false`\n */\n fullWidth?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function fieldset(options: FieldsetClassNameOptions = {}): string {\n const { className, fullWidth, browserStyles = false } = options;\n\n return cnb(\n styles({ unstyled: !browserStyles, \"full-width\": fullWidth }),\n className\n );\n}\n\n/**\n * **Server Component**\n *\n * @since 6.0.0 Removed the `legend`, `legendStyle`,\n * `legendClassName`, and `legendSROnly` props. You must provide a `Legend`\n * yourself manually instead of using a prop.\n */\nexport interface FieldsetProps\n extends FieldsetHTMLAttributes<HTMLFieldSetElement>,\n FieldsetClassNameOptions {}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Form, Fieldset, Legend } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * return (\n * <Form>\n * <Fieldset>\n * <Legend>Some Title</Legend>\n * // form components\n * </Fieldset>\n * </Form>\n * );\n * }\n * ```\n */\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset(props, ref) {\n const {\n className,\n fullWidth = false,\n browserStyles = false,\n children,\n ...remaining\n } = props;\n\n return (\n <fieldset\n {...remaining}\n ref={ref}\n className={fieldset({\n className,\n fullWidth,\n browserStyles,\n })}\n >\n {children}\n </fieldset>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","styles","fieldset","options","className","fullWidth","browserStyles","unstyled","Fieldset","props","ref","children","remaining"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAqC,QAAQ;AAChE,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAoBnB;;CAEC,GACD,OAAO,SAASE,SAASC,UAAoC,CAAC,CAAC;IAC7D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,gBAAgB,KAAK,EAAE,GAAGH;IAExD,OAAOL,IACLG,OAAO;QAAEM,UAAU,CAACD;QAAe,cAAcD;IAAU,IAC3DD;AAEJ;AAaA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,MAAMI,yBAAWT,WACtB,SAASS,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJN,SAAS,EACTC,YAAY,KAAK,EACjBC,gBAAgB,KAAK,EACrBK,QAAQ,EACR,GAAGC,WACJ,GAAGH;IAEJ,qBACE,KAACP;QACE,GAAGU,SAAS;QACbF,KAAKA;QACLN,WAAWF,SAAS;YAClBE;YACAC;YACAC;QACF;kBAECK;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/Fieldset.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type FieldsetHTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-fieldset\");\n\n/** @since 6.0.0 */\nexport interface FieldsetClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to enable the default browser styles for a fieldset.\n *\n * @since 6.0.0 This was renamed from `unstyled`.\n * @defaultValue `false`\n */\n browserStyles?: boolean;\n\n /**\n * @defaultValue `false`\n */\n fullWidth?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function fieldset(options: FieldsetClassNameOptions = {}): string {\n const { className, fullWidth, browserStyles = false } = options;\n\n return cnb(\n styles({ unstyled: !browserStyles, \"full-width\": fullWidth }),\n className\n );\n}\n\n/**\n * @since 6.0.0 Removed the `legend`, `legendStyle`,\n * `legendClassName`, and `legendSROnly` props. You must provide a `Legend`\n * yourself manually instead of using a prop.\n */\nexport interface FieldsetProps\n extends FieldsetHTMLAttributes<HTMLFieldSetElement>,\n FieldsetClassNameOptions {}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Form, Fieldset, Legend } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * return (\n * <Form>\n * <Fieldset>\n * <Legend>Some Title</Legend>\n * // form components\n * </Fieldset>\n * </Form>\n * );\n * }\n * ```\n */\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset(props, ref) {\n const {\n className,\n fullWidth = false,\n browserStyles = false,\n children,\n ...remaining\n } = props;\n\n return (\n <fieldset\n {...remaining}\n ref={ref}\n className={fieldset({\n className,\n fullWidth,\n browserStyles,\n })}\n >\n {children}\n </fieldset>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","styles","fieldset","options","className","fullWidth","browserStyles","unstyled","Fieldset","props","ref","children","remaining"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAqC,QAAQ;AAChE,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAoBnB;;CAEC,GACD,OAAO,SAASE,SAASC,UAAoC,CAAC,CAAC;IAC7D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,gBAAgB,KAAK,EAAE,GAAGH;IAExD,OAAOL,IACLG,OAAO;QAAEM,UAAU,CAACD;QAAe,cAAcD;IAAU,IAC3DD;AAEJ;AAWA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,MAAMI,yBAAWT,WACtB,SAASS,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJN,SAAS,EACTC,YAAY,KAAK,EACjBC,gBAAgB,KAAK,EACrBK,QAAQ,EACR,GAAGC,WACJ,GAAGH;IAEJ,qBACE,KAACP;QACE,GAAGU,SAAS;QACbF,KAAKA;QACLN,WAAWF,SAAS;YAClBE;YACAC;YACAC;QACF;kBAECK;;AAGP,GACA"}
@@ -1,8 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { type FormMessageInputLengthCounterProps, type FormMessageProps } from "./types.js";
3
2
  /**
4
- * **Server Component**
5
- *
6
3
  * The `FormMessage` component is used to create additional helper messages or
7
4
  * error messages and generally placed below the related `TextField`. If a
8
5
  * `length` (of the `value`) and `maxLength` are provided, a counter will also
@@ -5,8 +5,6 @@ import { FormMessageCounter } from "./FormMessageCounter.js";
5
5
  import { getFormConfig } from "./formConfig.js";
6
6
  import { formMessage, formMessageText } from "./formMessageStyles.js";
7
7
  /**
8
- * **Server Component**
9
- *
10
8
  * The `FormMessage` component is used to create additional helper messages or
11
9
  * error messages and generally placed below the related `TextField`. If a
12
10
  * `length` (of the `value`) and `maxLength` are provided, a counter will also
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/FormMessage.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageCounter } from \"./FormMessageCounter.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { formMessage, formMessageText } from \"./formMessageStyles.js\";\nimport {\n type FormMessageInputLengthCounterProps,\n type FormMessageProps,\n} from \"./types.js\";\n\n/**\n * **Server Component**\n *\n * The `FormMessage` component is used to create additional helper messages or\n * error messages and generally placed below the related `TextField`. If a\n * `length` (of the `value`) and `maxLength` are provided, a counter will also\n * be displayed to the right of the `children`.\n *\n * This component can also be used to create form-level validation messages by\n * setting the `role` prop to `\"alert\"`.\n */\nexport const FormMessage = forwardRef<\n HTMLDivElement,\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>\n>(function FormMessage(props, ref) {\n const {\n id: propId,\n role,\n className,\n counterStyle,\n counterClassName,\n messageStyle,\n messageClassName,\n error = false,\n disableWrap = false,\n theme: propTheme,\n children,\n length,\n maxLength,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"form-message\");\n const theme = getFormConfig(\"theme\", propTheme);\n\n let message = children;\n if (!disableWrap && children) {\n message = (\n <p\n id={`${id}-message`}\n style={messageStyle}\n className={formMessageText({ className: messageClassName })}\n >\n {children}\n </p>\n );\n }\n\n return (\n <div\n {...remaining}\n id={id}\n ref={ref}\n aria-live={role !== \"alert\" ? \"polite\" : undefined}\n role={role}\n className={formMessage({ error, theme, className })}\n >\n {message}\n {typeof length === \"number\" && typeof maxLength === \"number\" && (\n <FormMessageCounter\n id={`${id}-counter`}\n style={counterStyle}\n className={counterClassName}\n >\n {`${length} / ${maxLength}`}\n </FormMessageCounter>\n )}\n </div>\n );\n});\n"],"names":["forwardRef","useEnsuredId","FormMessageCounter","getFormConfig","formMessage","formMessageText","FormMessage","props","ref","id","propId","role","className","counterStyle","counterClassName","messageStyle","messageClassName","error","disableWrap","theme","propTheme","children","length","maxLength","remaining","message","p","style","div","aria-live","undefined"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,WAAW,EAAEC,eAAe,QAAQ,yBAAyB;AAMtE;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,4BAAcN,WAGzB,SAASM,YAAYC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EACJC,IAAIC,MAAM,EACVC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,gBAAgB,EAChBC,YAAY,EACZC,gBAAgB,EAChBC,QAAQ,KAAK,EACbC,cAAc,KAAK,EACnBC,OAAOC,SAAS,EAChBC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACT,GAAGC,WACJ,GAAGjB;IACJ,MAAME,KAAKR,aAAaS,QAAQ;IAChC,MAAMS,QAAQhB,cAAc,SAASiB;IAErC,IAAIK,UAAUJ;IACd,IAAI,CAACH,eAAeG,UAAU;QAC5BI,wBACE,KAACC;YACCjB,IAAI,CAAC,EAAEA,GAAG,QAAQ,CAAC;YACnBkB,OAAOZ;YACPH,WAAWP,gBAAgB;gBAAEO,WAAWI;YAAiB;sBAExDK;;IAGP;IAEA,qBACE,MAACO;QACE,GAAGJ,SAAS;QACbf,IAAIA;QACJD,KAAKA;QACLqB,aAAWlB,SAAS,UAAU,WAAWmB;QACzCnB,MAAMA;QACNC,WAAWR,YAAY;YAAEa;YAAOE;YAAOP;QAAU;;YAEhDa;YACA,OAAOH,WAAW,YAAY,OAAOC,cAAc,0BAClD,KAACrB;gBACCO,IAAI,CAAC,EAAEA,GAAG,QAAQ,CAAC;gBACnBkB,OAAOd;gBACPD,WAAWE;0BAEV,CAAC,EAAEQ,OAAO,GAAG,EAAEC,UAAU,CAAC;;;;AAKrC,GAAG"}
1
+ {"version":3,"sources":["../../src/form/FormMessage.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageCounter } from \"./FormMessageCounter.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { formMessage, formMessageText } from \"./formMessageStyles.js\";\nimport {\n type FormMessageInputLengthCounterProps,\n type FormMessageProps,\n} from \"./types.js\";\n\n/**\n * The `FormMessage` component is used to create additional helper messages or\n * error messages and generally placed below the related `TextField`. If a\n * `length` (of the `value`) and `maxLength` are provided, a counter will also\n * be displayed to the right of the `children`.\n *\n * This component can also be used to create form-level validation messages by\n * setting the `role` prop to `\"alert\"`.\n */\nexport const FormMessage = forwardRef<\n HTMLDivElement,\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>\n>(function FormMessage(props, ref) {\n const {\n id: propId,\n role,\n className,\n counterStyle,\n counterClassName,\n messageStyle,\n messageClassName,\n error = false,\n disableWrap = false,\n theme: propTheme,\n children,\n length,\n maxLength,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"form-message\");\n const theme = getFormConfig(\"theme\", propTheme);\n\n let message = children;\n if (!disableWrap && children) {\n message = (\n <p\n id={`${id}-message`}\n style={messageStyle}\n className={formMessageText({ className: messageClassName })}\n >\n {children}\n </p>\n );\n }\n\n return (\n <div\n {...remaining}\n id={id}\n ref={ref}\n aria-live={role !== \"alert\" ? \"polite\" : undefined}\n role={role}\n className={formMessage({ error, theme, className })}\n >\n {message}\n {typeof length === \"number\" && typeof maxLength === \"number\" && (\n <FormMessageCounter\n id={`${id}-counter`}\n style={counterStyle}\n className={counterClassName}\n >\n {`${length} / ${maxLength}`}\n </FormMessageCounter>\n )}\n </div>\n );\n});\n"],"names":["forwardRef","useEnsuredId","FormMessageCounter","getFormConfig","formMessage","formMessageText","FormMessage","props","ref","id","propId","role","className","counterStyle","counterClassName","messageStyle","messageClassName","error","disableWrap","theme","propTheme","children","length","maxLength","remaining","message","p","style","div","aria-live","undefined"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,WAAW,EAAEC,eAAe,QAAQ,yBAAyB;AAMtE;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAAcN,WAGzB,SAASM,YAAYC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EACJC,IAAIC,MAAM,EACVC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,gBAAgB,EAChBC,YAAY,EACZC,gBAAgB,EAChBC,QAAQ,KAAK,EACbC,cAAc,KAAK,EACnBC,OAAOC,SAAS,EAChBC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACT,GAAGC,WACJ,GAAGjB;IACJ,MAAME,KAAKR,aAAaS,QAAQ;IAChC,MAAMS,QAAQhB,cAAc,SAASiB;IAErC,IAAIK,UAAUJ;IACd,IAAI,CAACH,eAAeG,UAAU;QAC5BI,wBACE,KAACC;YACCjB,IAAI,GAAGA,GAAG,QAAQ,CAAC;YACnBkB,OAAOZ;YACPH,WAAWP,gBAAgB;gBAAEO,WAAWI;YAAiB;sBAExDK;;IAGP;IAEA,qBACE,MAACO;QACE,GAAGJ,SAAS;QACbf,IAAIA;QACJD,KAAKA;QACLqB,aAAWlB,SAAS,UAAU,WAAWmB;QACzCnB,MAAMA;QACNC,WAAWR,YAAY;YAAEa;YAAOE;YAAOP;QAAU;;YAEhDa;YACA,OAAOH,WAAW,YAAY,OAAOC,cAAc,0BAClD,KAACrB;gBACCO,IAAI,GAAGA,GAAG,QAAQ,CAAC;gBACnBkB,OAAOd;gBACPD,WAAWE;0BAEV,GAAGQ,OAAO,GAAG,EAAEC,WAAW;;;;AAKrC,GAAG"}
@@ -13,7 +13,6 @@ export interface FormMessageContainerProps extends HTMLAttributes<HTMLDivElement
13
13
  messageProps?: PropsWithRef<FormMessageProps, HTMLDivElement>;
14
14
  }
15
15
  /**
16
- * **Server Component**
17
16
  * Conditionally wraps the `children` in a `.rmd-form-message-container` wrapper
18
17
  * and renders the {@link FormMessage} component.
19
18
  *
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { cnb } from "cnbuilder";
3
2
  import { forwardRef } from "react";
4
3
  import { FormMessage } from "./FormMessage.js";
4
+ import { formMessageContainer } from "./formMessageContainerStyles.js";
5
5
  /**
6
- * **Server Component**
7
6
  * Conditionally wraps the `children` in a `.rmd-form-message-container` wrapper
8
7
  * and renders the {@link FormMessage} component.
9
8
  *
@@ -18,7 +17,9 @@ import { FormMessage } from "./FormMessage.js";
18
17
  return /*#__PURE__*/ _jsxs("div", {
19
18
  ...remaining,
20
19
  ref: ref,
21
- className: cnb("rmd-form-message-container", className),
20
+ className: formMessageContainer({
21
+ className
22
+ }),
22
23
  children: [
23
24
  children,
24
25
  /*#__PURE__*/ _jsx(FormMessage, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/FormMessageContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { FormMessage } from \"./FormMessage.js\";\nimport { type FormMessageProps } from \"./types.js\";\n\n/**\n * @since 2.5.0\n */\nexport interface FormMessageContainerProps\n extends HTMLAttributes<HTMLDivElement> {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<FormMessageProps, HTMLDivElement>;\n}\n\n/**\n * **Server Component**\n * Conditionally wraps the `children` in a `.rmd-form-message-container` wrapper\n * and renders the {@link FormMessage} component.\n *\n * @since 2.5.0\n */\nexport const FormMessageContainer = forwardRef<\n HTMLDivElement,\n FormMessageContainerProps\n>(function FormMessageContainer(props, ref) {\n const { className, children, messageProps, ...remaining } = props;\n if (!messageProps) {\n return <>{children}</>;\n }\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={cnb(\"rmd-form-message-container\", className)}\n >\n {children}\n <FormMessage {...messageProps} />\n </div>\n );\n});\n"],"names":["cnb","forwardRef","FormMessage","FormMessageContainer","props","ref","className","children","messageProps","remaining","div"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6B,QAAQ;AAExD,SAASC,WAAW,QAAQ,mBAAmB;AAgB/C;;;;;;CAMC,GACD,OAAO,MAAMC,qCAAuBF,WAGlC,SAASE,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGC,WAAW,GAAGL;IAC5D,IAAI,CAACI,cAAc;QACjB,qBAAO;sBAAGD;;IACZ;IAEA,qBACE,MAACG;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,WAAWN,IAAI,8BAA8BM;;YAE5CC;0BACD,KAACL;gBAAa,GAAGM,YAAY;;;;AAGnC,GAAG"}
1
+ {"version":3,"sources":["../../src/form/FormMessageContainer.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { FormMessage } from \"./FormMessage.js\";\nimport { formMessageContainer } from \"./formMessageContainerStyles.js\";\nimport { type FormMessageProps } from \"./types.js\";\n\n/**\n * @since 2.5.0\n */\nexport interface FormMessageContainerProps\n extends HTMLAttributes<HTMLDivElement> {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<FormMessageProps, HTMLDivElement>;\n}\n\n/**\n * Conditionally wraps the `children` in a `.rmd-form-message-container` wrapper\n * and renders the {@link FormMessage} component.\n *\n * @since 2.5.0\n */\nexport const FormMessageContainer = forwardRef<\n HTMLDivElement,\n FormMessageContainerProps\n>(function FormMessageContainer(props, ref) {\n const { className, children, messageProps, ...remaining } = props;\n if (!messageProps) {\n return <>{children}</>;\n }\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={formMessageContainer({ className })}\n >\n {children}\n <FormMessage {...messageProps} />\n </div>\n );\n});\n"],"names":["forwardRef","FormMessage","formMessageContainer","FormMessageContainer","props","ref","className","children","messageProps","remaining","div"],"mappings":";AAAA,SAASA,UAAU,QAA6B,QAAQ;AAExD,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,oBAAoB,QAAQ,kCAAkC;AAgBvE;;;;;CAKC,GACD,OAAO,MAAMC,qCAAuBH,WAGlC,SAASG,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGC,WAAW,GAAGL;IAC5D,IAAI,CAACI,cAAc;QACjB,qBAAO;sBAAGD;;IACZ;IAEA,qBACE,MAACG;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,WAAWJ,qBAAqB;YAAEI;QAAU;;YAE3CC;0BACD,KAACN;gBAAa,GAAGO,YAAY;;;;AAGnC,GAAG"}
@@ -12,8 +12,6 @@ export interface FormMessageCounterProps extends HTMLAttributes<HTMLSpanElement>
12
12
  children: ReactNode;
13
13
  }
14
14
  /**
15
- * **Server Component**
16
- *
17
15
  * This component can be used to create a "counter" within the
18
16
  * {@link FormMessage} component.
19
17
  *
@@ -1,8 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { formMessageCounter } from "./formMessageStyles.js";
3
3
  /**
4
- * **Server Component**
5
- *
6
4
  * This component can be used to create a "counter" within the
7
5
  * {@link FormMessage} component.
8
6
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/FormMessageCounter.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type ReactNode } from \"react\";\nimport { formMessageCounter } from \"./formMessageStyles.js\";\n\n/** @since 2.9.0 */\nexport interface FormMessageCounterProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * The children to display in the counter. This is normally a string like:\n *\n * @example String Example\n * ```ts\n * `${min} / ${max}`\n * ```\n */\n children: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * This component can be used to create a \"counter\" within the\n * {@link FormMessage} component.\n *\n * Note: This is really only useful when using the {@link FormMessage} component\n * without a {@link TextField}.\n *\n * @example Example Usage\n * ```ts\n * interface ExampleProps {\n * min: number;\n * max: number;\n * }\n *\n * function Example({ min, max }: ExampleProps) {\n * return (\n * <FormMessage disableWrap>\n * <FormMessageCounter>\n * {`${min} / ${max}`}\n * </FormMessageCounter>\n * </FormMessage>\n * );\n * }\n * ```\n *\n * @since 2.9.0\n */\nexport function FormMessageCounter(\n props: FormMessageCounterProps\n): ReactElement {\n const { children, className, ...remaining } = props;\n\n return (\n <span {...remaining} className={formMessageCounter({ className })}>\n {children}\n </span>\n );\n}\n"],"names":["formMessageCounter","FormMessageCounter","props","children","className","remaining","span"],"mappings":";AACA,SAASA,kBAAkB,QAAQ,yBAAyB;AAgB5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,SAASC,mBACdC,KAA8B;IAE9B,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGH;IAE9C,qBACE,KAACI;QAAM,GAAGD,SAAS;QAAED,WAAWJ,mBAAmB;YAAEI;QAAU;kBAC5DD;;AAGP"}
1
+ {"version":3,"sources":["../../src/form/FormMessageCounter.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type ReactNode } from \"react\";\nimport { formMessageCounter } from \"./formMessageStyles.js\";\n\n/** @since 2.9.0 */\nexport interface FormMessageCounterProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * The children to display in the counter. This is normally a string like:\n *\n * @example String Example\n * ```ts\n * `${min} / ${max}`\n * ```\n */\n children: ReactNode;\n}\n\n/**\n * This component can be used to create a \"counter\" within the\n * {@link FormMessage} component.\n *\n * Note: This is really only useful when using the {@link FormMessage} component\n * without a {@link TextField}.\n *\n * @example Example Usage\n * ```ts\n * interface ExampleProps {\n * min: number;\n * max: number;\n * }\n *\n * function Example({ min, max }: ExampleProps) {\n * return (\n * <FormMessage disableWrap>\n * <FormMessageCounter>\n * {`${min} / ${max}`}\n * </FormMessageCounter>\n * </FormMessage>\n * );\n * }\n * ```\n *\n * @since 2.9.0\n */\nexport function FormMessageCounter(\n props: FormMessageCounterProps\n): ReactElement {\n const { children, className, ...remaining } = props;\n\n return (\n <span {...remaining} className={formMessageCounter({ className })}>\n {children}\n </span>\n );\n}\n"],"names":["formMessageCounter","FormMessageCounter","props","children","className","remaining","span"],"mappings":";AACA,SAASA,kBAAkB,QAAQ,yBAAyB;AAgB5D;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GACD,OAAO,SAASC,mBACdC,KAA8B;IAE9B,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGH;IAE9C,qBACE,KAACI;QAAM,GAAGD,SAAS;QAAED,WAAWJ,mBAAmB;YAAEI;QAAU;kBAC5DD;;AAGP"}
@@ -1,4 +1,5 @@
1
1
  import { type CSSProperties, type HTMLAttributes, type InputHTMLAttributes, type LabelHTMLAttributes, type ReactNode } from "react";
2
+ import { type ComponentWithRippleProps } from "../interaction/types.js";
2
3
  import { type PropsWithRef } from "../types.js";
3
4
  import { type InputToggleSize } from "./inputToggleStyles.js";
4
5
  import { type FormComponentStates, type FormMessageContainerExtension } from "./types.js";
@@ -114,7 +115,7 @@ export interface InputToggleLabelProps {
114
115
  /**
115
116
  * @since 6.0.0
116
117
  */
117
- export interface BaseInputToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, FormMessageContainerExtension, FormComponentStates, InputToggleIconProps, InputToggleLabelProps {
118
+ export interface BaseInputToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, FormMessageContainerExtension, FormComponentStates, InputToggleIconProps, InputToggleLabelProps, ComponentWithRippleProps {
118
119
  /**
119
120
  * @see https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing
120
121
  * @defaultValue `type === "checkbox" ? "off" : undefined`
@@ -13,10 +13,11 @@ import { Label } from "./Label.js";
13
13
  * @since 6.0.0 Now supports the `FormMessage` behavior and requires
14
14
  * different icons for each checked state.
15
15
  */ export const InputToggle = /*#__PURE__*/ forwardRef(function InputToggle(props, ref) {
16
- const { id: propId, type, label, labelProps, style, className, autoComplete = type === "checkbox" ? "off" : undefined, disableLabelGap = false, stacked = false, iconAfter = false, size = "normal", error = false, active = false, indeterminate = false, messageProps, messageContainerProps, icon, checkedIcon, indeterminateIcon, iconProps, iconStyle, iconClassName, onBlur, onClick, onKeyDown, onKeyUp, onMouseDown, onMouseLeave, onDragStart, onMouseUp, onTouchEnd, onTouchMove, onTouchStart, ...remaining } = props;
16
+ const { id: propId, type, label, labelProps, style, className, autoComplete = type === "checkbox" ? "off" : undefined, disableLabelGap = false, stacked = false, iconAfter = false, size = "normal", error = false, active = false, indeterminate = false, messageProps, messageContainerProps, icon, checkedIcon, indeterminateIcon, iconProps, iconStyle, iconClassName, onBlur, onClick, onKeyDown, onKeyUp, onMouseDown, onMouseLeave, onDragStart, onMouseUp, onTouchEnd, onTouchMove, onTouchStart, disableRipple, ...remaining } = props;
17
17
  const { disabled = false, checked } = props;
18
18
  const id = useEnsuredId(propId, type);
19
19
  const { pressedClassName, ripples, handlers } = useElementInteraction({
20
+ mode: disableRipple ? "none" : undefined,
20
21
  disabled,
21
22
  onBlur,
22
23
  onClick,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/InputToggle.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { InputToggleIcon } from \"./InputToggleIcon.js\";\nimport { Label } from \"./Label.js\";\nimport { type InputToggleSize } from \"./inputToggleStyles.js\";\nimport {\n type FormComponentStates,\n type FormMessageContainerExtension,\n} from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface InputToggleIconProps {\n /**\n * @see {@link InputToggleSize}\n * @defaultValue `\"normal\"`\n */\n size?: InputToggleSize;\n\n /**\n * The icon to use while unchecked. This defaults to the unchecked\n * checkbox/radio icon from the `ICON_CONFIG`.\n *\n * @defaultValue `getIcon(props.type)`\n */\n icon?: ReactNode;\n\n /**\n * The icon to use while unchecked. This defaults to the unchecked\n * checkbox/radio icon from the `ICON_CONFIG`.\n *\n * @defaultValue `getIcon(``${props.type}Checked``)`\n */\n checkedIcon?: ReactNode;\n\n /**\n * Any props that should be passed to the `<span>` that surrounds the current\n * icon element.\n */\n iconProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;\n\n /**\n * Optional style to set on the `<span>` that surrounds the current icon\n * element.\n */\n iconStyle?: CSSProperties;\n\n /**\n * Optional className to set on the `<span>` that surrounds the current icon\n * element.\n */\n iconClassName?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface InputToggleLabelProps {\n /**\n * An optional label to display with the checkbox. If this is omitted, it is\n * recommended to provide an `aria-label` for accessibility.\n */\n label?: ReactNode;\n\n /**\n * Any props that should be passed to the `<Label>` component.\n *\n * Note: If `style` or `className` are provided in this object, they will be\n * ignored. Use the top-level `style` and `className` props instead.\n *\n * @example\n * ```\n * // bad\n * labelProps={{\n * \"aria-label\": \"checkbox\",\n * style: { color: \"red\" },\n * className: \"custom\"\n * }}\n *\n * // good\n * style={{ color: \"red\" }}\n * className=\"custom\"\n * labelProps={{\n * \"aria-label\": \"checkbox\",\n * }}\n * ```\n */\n labelProps?: PropsWithRef<\n LabelHTMLAttributes<HTMLLabelElement>,\n HTMLLabelElement\n >;\n\n /**\n * @see {@link LabelClassNameOptions.gap}\n * @defaultValue `false`\n */\n disableLabelGap?: boolean;\n\n /**\n * Set this to `true` to swap the position of the {@link label} and the current\n * icon. This prop can be used with the {@link stacked} prop to change the\n * position if the icon and label:\n *\n * ____________________________________\n * | stacked | iconAfter | position |\n * ____________________________________\n * | | | icon label |\n * ____________________________________\n * | | X | label icon |\n * ____________________________________\n * | X | | icon |\n * | | | label |\n * ____________________________________\n * | X | X | label |\n * | | | icon |\n * ____________________________________\n *\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * Set this to `true` if the label should be stacked instead of inline with\n * the current icon.\n *\n * @see {@link iconAfter}\n * @defaultValue `false`\n */\n stacked?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface BaseInputToggleProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\">,\n FormMessageContainerExtension,\n FormComponentStates,\n InputToggleIconProps,\n InputToggleLabelProps {\n /**\n * @see https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing\n * @defaultValue `type === \"checkbox\" ? \"off\" : undefined`\n */\n autoComplete?: string;\n}\n\n/**\n * @since 2.8.5\n * @since 6.0.0 Removed the `aria-controls` prop and added the\n * `indeterminateIcon` prop.\n */\nexport interface IndeterminateCheckboxProps {\n /**\n * Set this value to `true` if the checkbox is in an \"indeterminate\" state:\n *\n * - this checkbox controls the select all/select none behavior of other\n * checkboxes in a group\n * - at least one of the checkboxes have been checked\n * - the `checked` prop for this Checkbox should also be `true`\n *\n * You should normally use the `useCheckboxGroup` hook to handle this\n * behavior.\n *\n * @defaultValue `false`\n */\n indeterminate?: boolean;\n\n /**\n * The icon to display when the checkbox is checked and the\n * {@link indeterminate} prop is `true`.\n *\n * @defaultValue `getIcon(\"checkboxIndeterminate\")`\n * @since 6.0.0\n */\n indeterminateIcon?: ReactNode;\n}\n\nexport interface CheckboxProps\n extends BaseInputToggleProps,\n IndeterminateCheckboxProps {}\n\n/** @since 6.0.0 */\nexport interface CheckboxInputToggleProps extends CheckboxProps {\n type: \"checkbox\";\n}\n\nexport interface RadioProps extends BaseInputToggleProps {\n /**\n * The value for the radio button.\n *\n * @since 6.0.0 This is now optional and no longer supports\n * `string[]` since there isn't much of a use case for array values.\n */\n value?: string | number;\n}\n\n/** @since 6.0.0 */\nexport interface RadioInputToggleProps extends RadioProps {\n type: \"radio\";\n}\n\n/**\n * @since 6.0.0 Updated to be a union between\n * `CheckboxInputToggleProps` and `RadioInputToggleProps`\n */\nexport type InputToggleProps = CheckboxInputToggleProps | RadioInputToggleProps;\n\n/**\n * **Client Component**\n *\n * @since 6.0.0 Now supports the `FormMessage` behavior and requires\n * different icons for each checked state.\n */\nexport const InputToggle = forwardRef<HTMLInputElement, InputToggleProps>(\n function InputToggle(props, ref) {\n const {\n id: propId,\n type,\n label,\n labelProps,\n style,\n className,\n autoComplete = type === \"checkbox\" ? \"off\" : undefined,\n disableLabelGap = false,\n stacked = false,\n iconAfter = false,\n size = \"normal\",\n error = false,\n active = false,\n indeterminate = false,\n messageProps,\n messageContainerProps,\n icon,\n checkedIcon,\n indeterminateIcon,\n iconProps,\n iconStyle,\n iconClassName,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onDragStart,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n ...remaining\n } = props as CheckboxInputToggleProps;\n const { disabled = false, checked } = props;\n\n const id = useEnsuredId(propId, type);\n const { pressedClassName, ripples, handlers } = useElementInteraction({\n disabled,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onDragStart,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n });\n\n // set on the `remaining` object to bypass the eslint rule about\n // aria-checked not being valid for textbox role\n remaining[\"aria-checked\"] =\n remaining[\"aria-checked\"] ?? indeterminate ? \"mixed\" : undefined;\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <Label\n {...labelProps}\n gap={!disableLabelGap}\n style={style}\n stacked={stacked}\n reversed={!iconAfter}\n active={active}\n error={error}\n disabled={disabled}\n className={className}\n >\n {label}\n <InputToggleIcon\n style={iconStyle}\n {...iconProps}\n className={cnb(\n pressedClassName,\n iconClassName,\n iconProps?.className\n )}\n error={error}\n checked={checked}\n disabled={disabled}\n size={size}\n type={type}\n icon={icon}\n checkedIcon={checkedIcon}\n indeterminate={indeterminate}\n indeterminateIcon={indeterminateIcon}\n >\n <input\n {...remaining}\n {...handlers}\n autoComplete={autoComplete}\n id={id}\n ref={ref}\n type={type}\n className=\"rmd-hidden-input\"\n />\n {ripples}\n </InputToggleIcon>\n </Label>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["cnb","forwardRef","useElementInteraction","useEnsuredId","FormMessageContainer","InputToggleIcon","Label","InputToggle","props","ref","id","propId","type","label","labelProps","style","className","autoComplete","undefined","disableLabelGap","stacked","iconAfter","size","error","active","indeterminate","messageProps","messageContainerProps","icon","checkedIcon","indeterminateIcon","iconProps","iconStyle","iconClassName","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onDragStart","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","remaining","disabled","checked","pressedClassName","ripples","handlers","gap","reversed","input"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,QAML,QAAQ;AACf,SAASC,qBAAqB,QAAQ,0CAA0C;AAEhF,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,KAAK,QAAQ,aAAa;AA+MnC;;;;;CAKC,GACD,OAAO,MAAMC,4BAAcN,WACzB,SAASM,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,IAAIC,MAAM,EACVC,IAAI,EACJC,KAAK,EACLC,UAAU,EACVC,KAAK,EACLC,SAAS,EACTC,eAAeL,SAAS,aAAa,QAAQM,SAAS,EACtDC,kBAAkB,KAAK,EACvBC,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,OAAO,QAAQ,EACfC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,gBAAgB,KAAK,EACrBC,YAAY,EACZC,qBAAqB,EACrBC,IAAI,EACJC,WAAW,EACXC,iBAAiB,EACjBC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,YAAY,EACZ,GAAGC,WACJ,GAAGrC;IACJ,MAAM,EAAEsC,WAAW,KAAK,EAAEC,OAAO,EAAE,GAAGvC;IAEtC,MAAME,KAAKP,aAAaQ,QAAQC;IAChC,MAAM,EAAEoC,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGhD,sBAAsB;QACpE4C;QACAZ;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,gEAAgE;IAChE,gDAAgD;IAChDC,SAAS,CAAC,eAAe,GACvBA,SAAS,CAAC,eAAe,IAAIpB,gBAAgB,UAAUP;IAEzD,qBACE,KAACd;QACE,GAAGuB,qBAAqB;QACzBD,cAAcA;kBAEd,cAAA,MAACpB;YACE,GAAGQ,UAAU;YACdqC,KAAK,CAAChC;YACNJ,OAAOA;YACPK,SAASA;YACTgC,UAAU,CAAC/B;YACXG,QAAQA;YACRD,OAAOA;YACPuB,UAAUA;YACV9B,WAAWA;;gBAEVH;8BACD,MAACR;oBACCU,OAAOiB;oBACN,GAAGD,SAAS;oBACbf,WAAWhB,IACTgD,kBACAf,eACAF,WAAWf;oBAEbO,OAAOA;oBACPwB,SAASA;oBACTD,UAAUA;oBACVxB,MAAMA;oBACNV,MAAMA;oBACNgB,MAAMA;oBACNC,aAAaA;oBACbJ,eAAeA;oBACfK,mBAAmBA;;sCAEnB,KAACuB;4BACE,GAAGR,SAAS;4BACZ,GAAGK,QAAQ;4BACZjC,cAAcA;4BACdP,IAAIA;4BACJD,KAAKA;4BACLG,MAAMA;4BACNI,WAAU;;wBAEXiC;;;;;;AAKX,GACA"}
1
+ {"version":3,"sources":["../../src/form/InputToggle.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { type ComponentWithRippleProps } from \"../interaction/types.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { InputToggleIcon } from \"./InputToggleIcon.js\";\nimport { Label } from \"./Label.js\";\nimport { type InputToggleSize } from \"./inputToggleStyles.js\";\nimport {\n type FormComponentStates,\n type FormMessageContainerExtension,\n} from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface InputToggleIconProps {\n /**\n * @see {@link InputToggleSize}\n * @defaultValue `\"normal\"`\n */\n size?: InputToggleSize;\n\n /**\n * The icon to use while unchecked. This defaults to the unchecked\n * checkbox/radio icon from the `ICON_CONFIG`.\n *\n * @defaultValue `getIcon(props.type)`\n */\n icon?: ReactNode;\n\n /**\n * The icon to use while unchecked. This defaults to the unchecked\n * checkbox/radio icon from the `ICON_CONFIG`.\n *\n * @defaultValue `getIcon(``${props.type}Checked``)`\n */\n checkedIcon?: ReactNode;\n\n /**\n * Any props that should be passed to the `<span>` that surrounds the current\n * icon element.\n */\n iconProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;\n\n /**\n * Optional style to set on the `<span>` that surrounds the current icon\n * element.\n */\n iconStyle?: CSSProperties;\n\n /**\n * Optional className to set on the `<span>` that surrounds the current icon\n * element.\n */\n iconClassName?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface InputToggleLabelProps {\n /**\n * An optional label to display with the checkbox. If this is omitted, it is\n * recommended to provide an `aria-label` for accessibility.\n */\n label?: ReactNode;\n\n /**\n * Any props that should be passed to the `<Label>` component.\n *\n * Note: If `style` or `className` are provided in this object, they will be\n * ignored. Use the top-level `style` and `className` props instead.\n *\n * @example\n * ```\n * // bad\n * labelProps={{\n * \"aria-label\": \"checkbox\",\n * style: { color: \"red\" },\n * className: \"custom\"\n * }}\n *\n * // good\n * style={{ color: \"red\" }}\n * className=\"custom\"\n * labelProps={{\n * \"aria-label\": \"checkbox\",\n * }}\n * ```\n */\n labelProps?: PropsWithRef<\n LabelHTMLAttributes<HTMLLabelElement>,\n HTMLLabelElement\n >;\n\n /**\n * @see {@link LabelClassNameOptions.gap}\n * @defaultValue `false`\n */\n disableLabelGap?: boolean;\n\n /**\n * Set this to `true` to swap the position of the {@link label} and the current\n * icon. This prop can be used with the {@link stacked} prop to change the\n * position if the icon and label:\n *\n * ____________________________________\n * | stacked | iconAfter | position |\n * ____________________________________\n * | | | icon label |\n * ____________________________________\n * | | X | label icon |\n * ____________________________________\n * | X | | icon |\n * | | | label |\n * ____________________________________\n * | X | X | label |\n * | | | icon |\n * ____________________________________\n *\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * Set this to `true` if the label should be stacked instead of inline with\n * the current icon.\n *\n * @see {@link iconAfter}\n * @defaultValue `false`\n */\n stacked?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface BaseInputToggleProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\">,\n FormMessageContainerExtension,\n FormComponentStates,\n InputToggleIconProps,\n InputToggleLabelProps,\n ComponentWithRippleProps {\n /**\n * @see https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing\n * @defaultValue `type === \"checkbox\" ? \"off\" : undefined`\n */\n autoComplete?: string;\n}\n\n/**\n * @since 2.8.5\n * @since 6.0.0 Removed the `aria-controls` prop and added the\n * `indeterminateIcon` prop.\n */\nexport interface IndeterminateCheckboxProps {\n /**\n * Set this value to `true` if the checkbox is in an \"indeterminate\" state:\n *\n * - this checkbox controls the select all/select none behavior of other\n * checkboxes in a group\n * - at least one of the checkboxes have been checked\n * - the `checked` prop for this Checkbox should also be `true`\n *\n * You should normally use the `useCheckboxGroup` hook to handle this\n * behavior.\n *\n * @defaultValue `false`\n */\n indeterminate?: boolean;\n\n /**\n * The icon to display when the checkbox is checked and the\n * {@link indeterminate} prop is `true`.\n *\n * @defaultValue `getIcon(\"checkboxIndeterminate\")`\n * @since 6.0.0\n */\n indeterminateIcon?: ReactNode;\n}\n\nexport interface CheckboxProps\n extends BaseInputToggleProps,\n IndeterminateCheckboxProps {}\n\n/** @since 6.0.0 */\nexport interface CheckboxInputToggleProps extends CheckboxProps {\n type: \"checkbox\";\n}\n\nexport interface RadioProps extends BaseInputToggleProps {\n /**\n * The value for the radio button.\n *\n * @since 6.0.0 This is now optional and no longer supports\n * `string[]` since there isn't much of a use case for array values.\n */\n value?: string | number;\n}\n\n/** @since 6.0.0 */\nexport interface RadioInputToggleProps extends RadioProps {\n type: \"radio\";\n}\n\n/**\n * @since 6.0.0 Updated to be a union between\n * `CheckboxInputToggleProps` and `RadioInputToggleProps`\n */\nexport type InputToggleProps = CheckboxInputToggleProps | RadioInputToggleProps;\n\n/**\n * **Client Component**\n *\n * @since 6.0.0 Now supports the `FormMessage` behavior and requires\n * different icons for each checked state.\n */\nexport const InputToggle = forwardRef<HTMLInputElement, InputToggleProps>(\n function InputToggle(props, ref) {\n const {\n id: propId,\n type,\n label,\n labelProps,\n style,\n className,\n autoComplete = type === \"checkbox\" ? \"off\" : undefined,\n disableLabelGap = false,\n stacked = false,\n iconAfter = false,\n size = \"normal\",\n error = false,\n active = false,\n indeterminate = false,\n messageProps,\n messageContainerProps,\n icon,\n checkedIcon,\n indeterminateIcon,\n iconProps,\n iconStyle,\n iconClassName,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onDragStart,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n disableRipple,\n ...remaining\n } = props as CheckboxInputToggleProps;\n const { disabled = false, checked } = props;\n\n const id = useEnsuredId(propId, type);\n const { pressedClassName, ripples, handlers } = useElementInteraction({\n mode: disableRipple ? \"none\" : undefined,\n disabled,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onDragStart,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n });\n\n // set on the `remaining` object to bypass the eslint rule about\n // aria-checked not being valid for textbox role\n remaining[\"aria-checked\"] =\n (remaining[\"aria-checked\"] ?? indeterminate) ? \"mixed\" : undefined;\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <Label\n {...labelProps}\n gap={!disableLabelGap}\n style={style}\n stacked={stacked}\n reversed={!iconAfter}\n active={active}\n error={error}\n disabled={disabled}\n className={className}\n >\n {label}\n <InputToggleIcon\n style={iconStyle}\n {...iconProps}\n className={cnb(\n pressedClassName,\n iconClassName,\n iconProps?.className\n )}\n error={error}\n checked={checked}\n disabled={disabled}\n size={size}\n type={type}\n icon={icon}\n checkedIcon={checkedIcon}\n indeterminate={indeterminate}\n indeterminateIcon={indeterminateIcon}\n >\n <input\n {...remaining}\n {...handlers}\n autoComplete={autoComplete}\n id={id}\n ref={ref}\n type={type}\n className=\"rmd-hidden-input\"\n />\n {ripples}\n </InputToggleIcon>\n </Label>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["cnb","forwardRef","useElementInteraction","useEnsuredId","FormMessageContainer","InputToggleIcon","Label","InputToggle","props","ref","id","propId","type","label","labelProps","style","className","autoComplete","undefined","disableLabelGap","stacked","iconAfter","size","error","active","indeterminate","messageProps","messageContainerProps","icon","checkedIcon","indeterminateIcon","iconProps","iconStyle","iconClassName","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onDragStart","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","disableRipple","remaining","disabled","checked","pressedClassName","ripples","handlers","mode","gap","reversed","input"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,QAML,QAAQ;AAEf,SAASC,qBAAqB,QAAQ,0CAA0C;AAEhF,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,KAAK,QAAQ,aAAa;AAgNnC;;;;;CAKC,GACD,OAAO,MAAMC,4BAAcN,WACzB,SAASM,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,IAAIC,MAAM,EACVC,IAAI,EACJC,KAAK,EACLC,UAAU,EACVC,KAAK,EACLC,SAAS,EACTC,eAAeL,SAAS,aAAa,QAAQM,SAAS,EACtDC,kBAAkB,KAAK,EACvBC,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,OAAO,QAAQ,EACfC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,gBAAgB,KAAK,EACrBC,YAAY,EACZC,qBAAqB,EACrBC,IAAI,EACJC,WAAW,EACXC,iBAAiB,EACjBC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,YAAY,EACZC,aAAa,EACb,GAAGC,WACJ,GAAGtC;IACJ,MAAM,EAAEuC,WAAW,KAAK,EAAEC,OAAO,EAAE,GAAGxC;IAEtC,MAAME,KAAKP,aAAaQ,QAAQC;IAChC,MAAM,EAAEqC,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGjD,sBAAsB;QACpEkD,MAAMP,gBAAgB,SAAS3B;QAC/B6B;QACAb;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,gEAAgE;IAChE,gDAAgD;IAChDE,SAAS,CAAC,eAAe,GACvB,AAACA,SAAS,CAAC,eAAe,IAAIrB,gBAAiB,UAAUP;IAE3D,qBACE,KAACd;QACE,GAAGuB,qBAAqB;QACzBD,cAAcA;kBAEd,cAAA,MAACpB;YACE,GAAGQ,UAAU;YACduC,KAAK,CAAClC;YACNJ,OAAOA;YACPK,SAASA;YACTkC,UAAU,CAACjC;YACXG,QAAQA;YACRD,OAAOA;YACPwB,UAAUA;YACV/B,WAAWA;;gBAEVH;8BACD,MAACR;oBACCU,OAAOiB;oBACN,GAAGD,SAAS;oBACbf,WAAWhB,IACTiD,kBACAhB,eACAF,WAAWf;oBAEbO,OAAOA;oBACPyB,SAASA;oBACTD,UAAUA;oBACVzB,MAAMA;oBACNV,MAAMA;oBACNgB,MAAMA;oBACNC,aAAaA;oBACbJ,eAAeA;oBACfK,mBAAmBA;;sCAEnB,KAACyB;4BACE,GAAGT,SAAS;4BACZ,GAAGK,QAAQ;4BACZlC,cAAcA;4BACdP,IAAIA;4BACJD,KAAKA;4BACLG,MAAMA;4BACNI,WAAU;;wBAEXkC;;;;;;AAKX,GACA"}
@@ -40,8 +40,6 @@ export interface InputToggleIconProps extends HTMLAttributes<HTMLSpanElement> {
40
40
  indeterminate?: boolean;
41
41
  }
42
42
  /**
43
- * **Server Component**
44
- *
45
43
  * @since 2.8.0
46
44
  * @since 6.0.0 Updated to use different icons for each checked state instead
47
45
  * of a css overlay hack.
@@ -5,8 +5,6 @@ import { getIcon } from "../icon/iconConfig.js";
5
5
  import { FORM_CONFIG } from "./formConfig.js";
6
6
  import { inputToggle } from "./inputToggleStyles.js";
7
7
  /**
8
- * **Server Component**
9
- *
10
8
  * @since 2.8.0
11
9
  * @since 6.0.0 Updated to use different icons for each checked state instead
12
10
  * of a css overlay hack.