@react-md/core 1.0.0-next.14 → 1.0.0-next.16

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 (1165) hide show
  1. package/dist/CoreProviders.js.map +1 -1
  2. package/dist/NoSsr.js.map +1 -1
  3. package/dist/RootHtml.d.ts +0 -2
  4. package/dist/RootHtml.js +0 -2
  5. package/dist/RootHtml.js.map +1 -1
  6. package/dist/SsrProvider.js.map +1 -1
  7. package/dist/app-bar/AppBar.d.ts +0 -2
  8. package/dist/app-bar/AppBar.js +0 -2
  9. package/dist/app-bar/AppBar.js.map +1 -1
  10. package/dist/app-bar/AppBarTitle.d.ts +8 -7
  11. package/dist/app-bar/AppBarTitle.js +3 -4
  12. package/dist/app-bar/AppBarTitle.js.map +1 -1
  13. package/dist/autocomplete/Autocomplete.js.map +1 -1
  14. package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
  15. package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
  16. package/dist/autocomplete/FilterAutocompleteOptions.js.map +1 -1
  17. package/dist/autocomplete/autocompleteStyles.js.map +1 -1
  18. package/dist/autocomplete/defaults.d.ts +2 -2
  19. package/dist/autocomplete/defaults.js +3 -3
  20. package/dist/autocomplete/defaults.js.map +1 -1
  21. package/dist/autocomplete/types.js.map +1 -1
  22. package/dist/avatar/Avatar.d.ts +1 -4
  23. package/dist/avatar/Avatar.js +1 -4
  24. package/dist/avatar/Avatar.js.map +1 -1
  25. package/dist/avatar/styles.js.map +1 -1
  26. package/dist/badge/Badge.d.ts +1 -3
  27. package/dist/badge/Badge.js +0 -2
  28. package/dist/badge/Badge.js.map +1 -1
  29. package/dist/box/Box.d.ts +0 -2
  30. package/dist/box/Box.js +0 -2
  31. package/dist/box/Box.js.map +1 -1
  32. package/dist/box/styles.js.map +1 -1
  33. package/dist/button/AsyncButton.js.map +1 -1
  34. package/dist/button/Button.js.map +1 -1
  35. package/dist/button/ButtonUnstyled.d.ts +0 -2
  36. package/dist/button/ButtonUnstyled.js +0 -2
  37. package/dist/button/ButtonUnstyled.js.map +1 -1
  38. package/dist/button/FloatingActionButton.js.map +1 -1
  39. package/dist/button/TooltippedButton.js.map +1 -1
  40. package/dist/button/buttonStyles.js.map +1 -1
  41. package/dist/button/buttonUnstyledStyles.js.map +1 -1
  42. package/dist/card/Card.d.ts +2 -3
  43. package/dist/card/Card.js +0 -2
  44. package/dist/card/Card.js.map +1 -1
  45. package/dist/card/CardContent.d.ts +0 -2
  46. package/dist/card/CardContent.js +0 -2
  47. package/dist/card/CardContent.js.map +1 -1
  48. package/dist/card/CardFooter.d.ts +0 -3
  49. package/dist/card/CardFooter.js +0 -2
  50. package/dist/card/CardFooter.js.map +1 -1
  51. package/dist/card/CardHeader.d.ts +0 -2
  52. package/dist/card/CardHeader.js +0 -2
  53. package/dist/card/CardHeader.js.map +1 -1
  54. package/dist/card/CardSubtitle.d.ts +6 -3
  55. package/dist/card/CardSubtitle.js +2 -3
  56. package/dist/card/CardSubtitle.js.map +1 -1
  57. package/dist/card/CardTitle.d.ts +0 -3
  58. package/dist/card/CardTitle.js +0 -2
  59. package/dist/card/CardTitle.js.map +1 -1
  60. package/dist/card/ClickableCard.js.map +1 -1
  61. package/dist/card/styles.js +2 -4
  62. package/dist/card/styles.js.map +1 -1
  63. package/dist/chip/Chip.d.ts +0 -2
  64. package/dist/chip/Chip.js +0 -2
  65. package/dist/chip/Chip.js.map +1 -1
  66. package/dist/chip/styles.js.map +1 -1
  67. package/dist/cssUtils.d.ts +1 -1
  68. package/dist/cssUtils.js.map +1 -1
  69. package/dist/delegateEvent.js.map +1 -1
  70. package/dist/dialog/Dialog.js.map +1 -1
  71. package/dist/dialog/DialogContainer.d.ts +0 -2
  72. package/dist/dialog/DialogContainer.js +0 -2
  73. package/dist/dialog/DialogContainer.js.map +1 -1
  74. package/dist/dialog/DialogContent.d.ts +3 -3
  75. package/dist/dialog/DialogContent.js +3 -3
  76. package/dist/dialog/DialogContent.js.map +1 -1
  77. package/dist/dialog/DialogFooter.d.ts +2 -3
  78. package/dist/dialog/DialogFooter.js +2 -3
  79. package/dist/dialog/DialogFooter.js.map +1 -1
  80. package/dist/dialog/DialogHeader.d.ts +3 -3
  81. package/dist/dialog/DialogHeader.js +3 -3
  82. package/dist/dialog/DialogHeader.js.map +1 -1
  83. package/dist/dialog/DialogTitle.d.ts +3 -4
  84. package/dist/dialog/DialogTitle.js +3 -3
  85. package/dist/dialog/DialogTitle.js.map +1 -1
  86. package/dist/dialog/FixedDialog.js.map +1 -1
  87. package/dist/dialog/NestedDialogProvider.d.ts +0 -1
  88. package/dist/dialog/NestedDialogProvider.js.map +1 -1
  89. package/dist/dialog/styles.js.map +1 -1
  90. package/dist/divider/Divider.d.ts +0 -2
  91. package/dist/divider/Divider.js +0 -2
  92. package/dist/divider/Divider.js.map +1 -1
  93. package/dist/divider/styles.js.map +1 -1
  94. package/dist/draggable/useDraggable.js.map +1 -1
  95. package/dist/draggable/utils.js.map +1 -1
  96. package/dist/expansion-panel/ExpansionList.d.ts +1 -1
  97. package/dist/expansion-panel/ExpansionList.js +1 -1
  98. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  99. package/dist/expansion-panel/ExpansionPanel.d.ts +8 -24
  100. package/dist/expansion-panel/ExpansionPanel.js +1 -12
  101. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  102. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +0 -1
  103. package/dist/expansion-panel/ExpansionPanelHeader.js +0 -1
  104. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  105. package/dist/expansion-panel/expansionPanelStyles.d.ts +19 -0
  106. package/dist/expansion-panel/expansionPanelStyles.js +14 -0
  107. package/dist/expansion-panel/expansionPanelStyles.js.map +1 -0
  108. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  109. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  110. package/dist/focus/useFocusContainer.js.map +1 -1
  111. package/dist/focus/utils.js.map +1 -1
  112. package/dist/form/Checkbox.d.ts +0 -1
  113. package/dist/form/Checkbox.js.map +1 -1
  114. package/dist/form/Fieldset.d.ts +0 -2
  115. package/dist/form/Fieldset.js.map +1 -1
  116. package/dist/form/FileInput.js.map +1 -1
  117. package/dist/form/Form.js.map +1 -1
  118. package/dist/form/FormMessage.d.ts +0 -3
  119. package/dist/form/FormMessage.js +0 -2
  120. package/dist/form/FormMessage.js.map +1 -1
  121. package/dist/form/FormMessageContainer.d.ts +0 -1
  122. package/dist/form/FormMessageContainer.js +0 -1
  123. package/dist/form/FormMessageContainer.js.map +1 -1
  124. package/dist/form/FormMessageCounter.d.ts +0 -2
  125. package/dist/form/FormMessageCounter.js +0 -2
  126. package/dist/form/FormMessageCounter.js.map +1 -1
  127. package/dist/form/InputToggle.js.map +1 -1
  128. package/dist/form/InputToggleIcon.d.ts +0 -2
  129. package/dist/form/InputToggleIcon.js +0 -2
  130. package/dist/form/InputToggleIcon.js.map +1 -1
  131. package/dist/form/Label.d.ts +0 -3
  132. package/dist/form/Label.js +0 -2
  133. package/dist/form/Label.js.map +1 -1
  134. package/dist/form/Legend.d.ts +0 -3
  135. package/dist/form/Legend.js +0 -2
  136. package/dist/form/Legend.js.map +1 -1
  137. package/dist/form/MenuItemCheckbox.d.ts +0 -1
  138. package/dist/form/MenuItemCheckbox.js.map +1 -1
  139. package/dist/form/MenuItemFileInput.js.map +1 -1
  140. package/dist/form/MenuItemInputToggle.js.map +1 -1
  141. package/dist/form/MenuItemRadio.d.ts +0 -1
  142. package/dist/form/MenuItemRadio.js.map +1 -1
  143. package/dist/form/MenuItemSwitch.d.ts +0 -1
  144. package/dist/form/MenuItemSwitch.js.map +1 -1
  145. package/dist/form/MenuItemTextField.js.map +1 -1
  146. package/dist/form/NativeSelect.d.ts +0 -2
  147. package/dist/form/NativeSelect.js +0 -2
  148. package/dist/form/NativeSelect.js.map +1 -1
  149. package/dist/form/OptGroup.js.map +1 -1
  150. package/dist/form/Option.js.map +1 -1
  151. package/dist/form/Password.js.map +1 -1
  152. package/dist/form/Radio.d.ts +0 -1
  153. package/dist/form/Radio.js.map +1 -1
  154. package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
  155. package/dist/form/Select.js.map +1 -1
  156. package/dist/form/SelectedOption.d.ts +0 -2
  157. package/dist/form/SelectedOption.js +0 -2
  158. package/dist/form/SelectedOption.js.map +1 -1
  159. package/dist/form/Slider.js.map +1 -1
  160. package/dist/form/SliderContainer.d.ts +0 -2
  161. package/dist/form/SliderContainer.js +0 -2
  162. package/dist/form/SliderContainer.js.map +1 -1
  163. package/dist/form/SliderMark.d.ts +0 -2
  164. package/dist/form/SliderMark.js +0 -2
  165. package/dist/form/SliderMark.js.map +1 -1
  166. package/dist/form/SliderMarkLabel.d.ts +0 -2
  167. package/dist/form/SliderMarkLabel.js +0 -2
  168. package/dist/form/SliderMarkLabel.js.map +1 -1
  169. package/dist/form/SliderThumb.js.map +1 -1
  170. package/dist/form/SliderTrack.d.ts +0 -2
  171. package/dist/form/SliderTrack.js +0 -2
  172. package/dist/form/SliderTrack.js.map +1 -1
  173. package/dist/form/SliderValueMarks.d.ts +0 -2
  174. package/dist/form/SliderValueMarks.js +0 -2
  175. package/dist/form/SliderValueMarks.js.map +1 -1
  176. package/dist/form/SliderValueTooltip.js.map +1 -1
  177. package/dist/form/Switch.d.ts +0 -2
  178. package/dist/form/Switch.js +0 -2
  179. package/dist/form/Switch.js.map +1 -1
  180. package/dist/form/SwitchTrack.d.ts +2 -1
  181. package/dist/form/SwitchTrack.js +2 -1
  182. package/dist/form/SwitchTrack.js.map +1 -1
  183. package/dist/form/TextArea.js.map +1 -1
  184. package/dist/form/TextField.d.ts +0 -2
  185. package/dist/form/TextField.js +0 -2
  186. package/dist/form/TextField.js.map +1 -1
  187. package/dist/form/TextFieldAddon.d.ts +1 -4
  188. package/dist/form/TextFieldAddon.js +1 -3
  189. package/dist/form/TextFieldAddon.js.map +1 -1
  190. package/dist/form/TextFieldContainer.js.map +1 -1
  191. package/dist/form/fileUtils.js.map +1 -1
  192. package/dist/form/formConfig.js.map +1 -1
  193. package/dist/form/formMessageStyles.js.map +1 -1
  194. package/dist/form/inputToggleStyles.js.map +1 -1
  195. package/dist/form/menuItemInputToggleStyles.js.map +1 -1
  196. package/dist/form/nativeSelectStyles.js.map +1 -1
  197. package/dist/form/optionStyles.js.map +1 -1
  198. package/dist/form/passwordStyles.js.map +1 -1
  199. package/dist/form/selectStyles.js.map +1 -1
  200. package/dist/form/selectUtils.js.map +1 -1
  201. package/dist/form/sliderUtils.js.map +1 -1
  202. package/dist/form/switchStyles.js.map +1 -1
  203. package/dist/form/textAreaStyles.js.map +1 -1
  204. package/dist/form/textFieldContainerStyles.js.map +1 -1
  205. package/dist/form/textFieldStyles.js.map +1 -1
  206. package/dist/form/types.js.map +1 -1
  207. package/dist/form/useCheckboxGroup.js.map +1 -1
  208. package/dist/form/useCombobox.js.map +1 -1
  209. package/dist/form/useEditableCombobox.js.map +1 -1
  210. package/dist/form/useFileUpload.js.map +1 -1
  211. package/dist/form/useFormReset.js.map +1 -1
  212. package/dist/form/useListboxProvider.js.map +1 -1
  213. package/dist/form/useNumberField.js.map +1 -1
  214. package/dist/form/useRadioGroup.js.map +1 -1
  215. package/dist/form/useRangeSlider.js.map +1 -1
  216. package/dist/form/useResizingTextArea.js.map +1 -1
  217. package/dist/form/useSelectCombobox.js.map +1 -1
  218. package/dist/form/useSlider.js.map +1 -1
  219. package/dist/form/useTextField.js.map +1 -1
  220. package/dist/form/useTextFieldContainerAddons.js.map +1 -1
  221. package/dist/form/utils.js.map +1 -1
  222. package/dist/form/validation.js.map +1 -1
  223. package/dist/hoverMode/useHoverMode.js.map +1 -1
  224. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  225. package/dist/icon/FontIcon.d.ts +10 -8
  226. package/dist/icon/FontIcon.js +1 -7
  227. package/dist/icon/FontIcon.js.map +1 -1
  228. package/dist/icon/IconRotator.d.ts +0 -2
  229. package/dist/icon/IconRotator.js +0 -2
  230. package/dist/icon/IconRotator.js.map +1 -1
  231. package/dist/icon/MaterialIcon.d.ts +18 -3
  232. package/dist/icon/MaterialIcon.js +13 -3
  233. package/dist/icon/MaterialIcon.js.map +1 -1
  234. package/dist/icon/MaterialSymbol.d.ts +0 -1
  235. package/dist/icon/MaterialSymbol.js +0 -1
  236. package/dist/icon/MaterialSymbol.js.map +1 -1
  237. package/dist/icon/SVGIcon.d.ts +3 -2
  238. package/dist/icon/SVGIcon.js +0 -2
  239. package/dist/icon/SVGIcon.js.map +1 -1
  240. package/dist/icon/TextIconSpacing.d.ts +0 -2
  241. package/dist/icon/TextIconSpacing.js +0 -2
  242. package/dist/icon/TextIconSpacing.js.map +1 -1
  243. package/dist/icon/_icon.scss +2 -2
  244. package/dist/icon/iconConfig.d.ts +1 -0
  245. package/dist/icon/iconConfig.js +1 -0
  246. package/dist/icon/iconConfig.js.map +1 -1
  247. package/dist/icon/material.d.ts +1 -1
  248. package/dist/icon/material.js.map +1 -1
  249. package/dist/icon/materialConfig.js.map +1 -1
  250. package/dist/icon/styles.js +1 -1
  251. package/dist/icon/styles.js.map +1 -1
  252. package/dist/interaction/Ripple.js.map +1 -1
  253. package/dist/interaction/RippleContainer.d.ts +0 -2
  254. package/dist/interaction/RippleContainer.js +0 -2
  255. package/dist/interaction/RippleContainer.js.map +1 -1
  256. package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
  257. package/dist/interaction/config.js.map +1 -1
  258. package/dist/interaction/types.js.map +1 -1
  259. package/dist/interaction/useElementInteraction.js.map +1 -1
  260. package/dist/interaction/useHigherContrastChildren.js.map +1 -1
  261. package/dist/interaction/utils.js.map +1 -1
  262. package/dist/layout/LayoutAppBar.d.ts +0 -1
  263. package/dist/layout/LayoutAppBar.js.map +1 -1
  264. package/dist/layout/LayoutNav.js +1 -2
  265. package/dist/layout/LayoutNav.js.map +1 -1
  266. package/dist/layout/LayoutWindowSplitter.d.ts +0 -1
  267. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  268. package/dist/layout/Main.js.map +1 -1
  269. package/dist/layout/layoutNavStyles.js.map +1 -1
  270. package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
  271. package/dist/layout/mainStyles.js.map +1 -1
  272. package/dist/layout/useExpandableLayout.js.map +1 -1
  273. package/dist/layout/useHorizontalLayoutTransition.js +1 -1
  274. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  275. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  276. package/dist/layout/useLayoutTree.d.ts +2 -2
  277. package/dist/layout/useLayoutTree.js.map +1 -1
  278. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  279. package/dist/layout/useMainTabIndex.js.map +1 -1
  280. package/dist/layout/useResizableLayout.js.map +1 -1
  281. package/dist/layout/useTemporaryLayout.js.map +1 -1
  282. package/dist/link/Link.d.ts +2 -6
  283. package/dist/link/Link.js +1 -4
  284. package/dist/link/Link.js.map +1 -1
  285. package/dist/link/SkipToMainContent.d.ts +10 -3
  286. package/dist/link/SkipToMainContent.js +4 -1
  287. package/dist/link/SkipToMainContent.js.map +1 -1
  288. package/dist/link/styles.d.ts +2 -2
  289. package/dist/link/styles.js.map +1 -1
  290. package/dist/list/List.d.ts +0 -20
  291. package/dist/list/List.js +1 -14
  292. package/dist/list/List.js.map +1 -1
  293. package/dist/list/ListItem.d.ts +0 -16
  294. package/dist/list/ListItem.js.map +1 -1
  295. package/dist/list/ListItemAddon.d.ts +0 -2
  296. package/dist/list/ListItemAddon.js +0 -2
  297. package/dist/list/ListItemAddon.js.map +1 -1
  298. package/dist/list/ListItemChildren.d.ts +0 -2
  299. package/dist/list/ListItemChildren.js +0 -2
  300. package/dist/list/ListItemChildren.js.map +1 -1
  301. package/dist/list/ListItemLink.js.map +1 -1
  302. package/dist/list/ListItemText.d.ts +0 -2
  303. package/dist/list/ListItemText.js +0 -2
  304. package/dist/list/ListItemText.js.map +1 -1
  305. package/dist/list/ListSubheader.d.ts +3 -2
  306. package/dist/list/ListSubheader.js +0 -2
  307. package/dist/list/ListSubheader.js.map +1 -1
  308. package/dist/list/getListItemHeight.d.ts +2 -2
  309. package/dist/list/getListItemHeight.js +2 -2
  310. package/dist/list/getListItemHeight.js.map +1 -1
  311. package/dist/list/listItemStyles.d.ts +17 -1
  312. package/dist/list/listItemStyles.js.map +1 -1
  313. package/dist/list/listStyles.d.ts +18 -0
  314. package/dist/list/listStyles.js +14 -0
  315. package/dist/list/listStyles.js.map +1 -0
  316. package/dist/list/types.d.ts +9 -3
  317. package/dist/list/types.js +6 -1
  318. package/dist/list/types.js.map +1 -1
  319. package/dist/media-queries/AppSizeProvider.d.ts +8 -0
  320. package/dist/media-queries/AppSizeProvider.js +2 -0
  321. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  322. package/dist/media-queries/appSize.d.ts +5 -5
  323. package/dist/media-queries/appSize.js.map +1 -1
  324. package/dist/media-queries/useMediaQuery.d.ts +1 -1
  325. package/dist/media-queries/useMediaQuery.js +1 -1
  326. package/dist/media-queries/useMediaQuery.js.map +1 -1
  327. package/dist/menu/DropdownMenu.js.map +1 -1
  328. package/dist/menu/Menu.js.map +1 -1
  329. package/dist/menu/MenuBar.d.ts +0 -1
  330. package/dist/menu/MenuBar.js.map +1 -1
  331. package/dist/menu/MenuButton.d.ts +0 -1
  332. package/dist/menu/MenuButton.js.map +1 -1
  333. package/dist/menu/MenuConfigurationProvider.js.map +1 -1
  334. package/dist/menu/MenuItem.d.ts +0 -1
  335. package/dist/menu/MenuItem.js.map +1 -1
  336. package/dist/menu/MenuItemButton.d.ts +0 -1
  337. package/dist/menu/MenuItemButton.js.map +1 -1
  338. package/dist/menu/MenuItemCircularProgress.js.map +1 -1
  339. package/dist/menu/MenuItemGroup.js.map +1 -1
  340. package/dist/menu/MenuItemSeparator.js.map +1 -1
  341. package/dist/menu/MenuSheet.js.map +1 -1
  342. package/dist/menu/MenuVisibilityProvider.js.map +1 -1
  343. package/dist/menu/MenuWidget.js.map +1 -1
  344. package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
  345. package/dist/menu/useContextMenu.js.map +1 -1
  346. package/dist/menu/useMenuBarProvider.d.ts +0 -1
  347. package/dist/menu/useMenuBarProvider.js.map +1 -1
  348. package/dist/menu/utils.js.map +1 -1
  349. package/dist/movement/constants.js.map +1 -1
  350. package/dist/movement/findMatchIndex.js.map +1 -1
  351. package/dist/movement/types.js.map +1 -1
  352. package/dist/movement/useKeyboardMovementProvider.d.ts +0 -1
  353. package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
  354. package/dist/movement/utils.js.map +1 -1
  355. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  356. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
  357. package/dist/navigation/NavGroup.d.ts +0 -2
  358. package/dist/navigation/NavGroup.js +0 -2
  359. package/dist/navigation/NavGroup.js.map +1 -1
  360. package/dist/navigation/NavItem.d.ts +0 -2
  361. package/dist/navigation/NavItem.js +0 -2
  362. package/dist/navigation/NavItem.js.map +1 -1
  363. package/dist/navigation/NavItemButton.js.map +1 -1
  364. package/dist/navigation/NavItemLink.js.map +1 -1
  365. package/dist/navigation/NavSubheader.d.ts +0 -3
  366. package/dist/navigation/NavSubheader.js +0 -2
  367. package/dist/navigation/NavSubheader.js.map +1 -1
  368. package/dist/navigation/Navigation.js.map +1 -1
  369. package/dist/navigation/getHrefFromParents.js.map +1 -1
  370. package/dist/navigation/navGroupStyles.js.map +1 -1
  371. package/dist/navigation/navItemStyles.js.map +1 -1
  372. package/dist/navigation/types.js.map +1 -1
  373. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  374. package/dist/overlay/Overlay.d.ts +1 -0
  375. package/dist/overlay/Overlay.js.map +1 -1
  376. package/dist/overlay/overlayStyles.js.map +1 -1
  377. package/dist/portal/Portal.d.ts +4 -0
  378. package/dist/portal/Portal.js.map +1 -1
  379. package/dist/portal/PortalContainerProvider.d.ts +8 -3
  380. package/dist/portal/PortalContainerProvider.js +1 -0
  381. package/dist/portal/PortalContainerProvider.js.map +1 -1
  382. package/dist/positioning/constants.js.map +1 -1
  383. package/dist/positioning/createHorizontalPosition.js.map +1 -1
  384. package/dist/positioning/createVerticalPosition.js.map +1 -1
  385. package/dist/positioning/getFixedPosition.js.map +1 -1
  386. package/dist/positioning/types.js.map +1 -1
  387. package/dist/positioning/useFixedPositioning.js.map +1 -1
  388. package/dist/positioning/utils.js.map +1 -1
  389. package/dist/progress/CircularProgress.d.ts +5 -6
  390. package/dist/progress/CircularProgress.js +0 -2
  391. package/dist/progress/CircularProgress.js.map +1 -1
  392. package/dist/progress/LinearProgress.d.ts +0 -2
  393. package/dist/progress/LinearProgress.js +0 -2
  394. package/dist/progress/LinearProgress.js.map +1 -1
  395. package/dist/progress/getProgressA11y.js.map +1 -1
  396. package/dist/progress/types.js.map +1 -1
  397. package/dist/responsive-item/ResponsiveItemContainer.d.ts +0 -2
  398. package/dist/responsive-item/ResponsiveItemContainer.js +0 -2
  399. package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
  400. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +0 -2
  401. package/dist/responsive-item/ResponsiveItemOverlay.js +0 -2
  402. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  403. package/dist/responsive-item/styles.js.map +1 -1
  404. package/dist/scroll/ScrollLock.js.map +1 -1
  405. package/dist/scroll/getScrollbarWidth.js.map +1 -1
  406. package/dist/scroll/useScrollLock.js.map +1 -1
  407. package/dist/searching/caseInsensitive.js.map +1 -1
  408. package/dist/searching/fuzzy.js.map +1 -1
  409. package/dist/searching/toSearchQuery.js.map +1 -1
  410. package/dist/searching/types.js.map +1 -1
  411. package/dist/searching/useFuzzyMatch.js.map +1 -1
  412. package/dist/searching/utils.js.map +1 -1
  413. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  414. package/dist/segmented-button/SegmentedButtonContainer.d.ts +0 -2
  415. package/dist/segmented-button/SegmentedButtonContainer.js +0 -2
  416. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  417. package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
  418. package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
  419. package/dist/sheet/Sheet.d.ts +30 -16
  420. package/dist/sheet/Sheet.js +24 -14
  421. package/dist/sheet/Sheet.js.map +1 -1
  422. package/dist/sheet/styles.d.ts +29 -0
  423. package/dist/sheet/styles.js +13 -0
  424. package/dist/sheet/styles.js.map +1 -1
  425. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  426. package/dist/snackbar/Snackbar.js.map +1 -1
  427. package/dist/snackbar/Toast.js.map +1 -1
  428. package/dist/snackbar/ToastActionButton.d.ts +0 -1
  429. package/dist/snackbar/ToastActionButton.js.map +1 -1
  430. package/dist/snackbar/ToastCloseButton.d.ts +0 -1
  431. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  432. package/dist/snackbar/ToastContent.js.map +1 -1
  433. package/dist/snackbar/ToastManager.js.map +1 -1
  434. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  435. package/dist/snackbar/snackbarStyles.js.map +1 -1
  436. package/dist/snackbar/toastContentStyles.js.map +1 -1
  437. package/dist/snackbar/toastStyles.js.map +1 -1
  438. package/dist/snackbar/useCurrentToastActions.d.ts +0 -1
  439. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  440. package/dist/suspense/CircularProgressSuspense.d.ts +0 -2
  441. package/dist/suspense/CircularProgressSuspense.js +0 -2
  442. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  443. package/dist/suspense/NullSuspense.d.ts +0 -2
  444. package/dist/suspense/NullSuspense.js +0 -2
  445. package/dist/suspense/NullSuspense.js.map +1 -1
  446. package/dist/table/StickyTableSection.d.ts +23 -0
  447. package/dist/table/StickyTableSection.js +56 -0
  448. package/dist/table/StickyTableSection.js.map +1 -0
  449. package/dist/table/Table.d.ts +1 -1
  450. package/dist/table/Table.js.map +1 -1
  451. package/dist/table/TableBody.d.ts +1 -1
  452. package/dist/table/TableBody.js.map +1 -1
  453. package/dist/table/TableCell.d.ts +3 -2
  454. package/dist/table/TableCell.js.map +1 -1
  455. package/dist/table/TableCellContent.d.ts +1 -5
  456. package/dist/table/TableCellContent.js +0 -3
  457. package/dist/table/TableCellContent.js.map +1 -1
  458. package/dist/table/TableCheckbox.js.map +1 -1
  459. package/dist/table/TableConfigurationProvider.d.ts +1 -74
  460. package/dist/table/TableConfigurationProvider.js.map +1 -1
  461. package/dist/table/TableContainer.js.map +1 -1
  462. package/dist/table/TableContainerProvider.js.map +1 -1
  463. package/dist/table/TableFooter.d.ts +8 -17
  464. package/dist/table/TableFooter.js +17 -80
  465. package/dist/table/TableFooter.js.map +1 -1
  466. package/dist/table/TableHeader.d.ts +8 -17
  467. package/dist/table/TableHeader.js +20 -87
  468. package/dist/table/TableHeader.js.map +1 -1
  469. package/dist/table/TableRadio.js.map +1 -1
  470. package/dist/table/TableRow.d.ts +1 -1
  471. package/dist/table/TableRow.js.map +1 -1
  472. package/dist/table/tableCellStyles.d.ts +1 -1
  473. package/dist/table/tableCellStyles.js.map +1 -1
  474. package/dist/table/tableContainerStyles.js.map +1 -1
  475. package/dist/table/tableFooterStyles.js.map +1 -1
  476. package/dist/table/tableHeaderStyles.js.map +1 -1
  477. package/dist/table/tableRowStyles.js.map +1 -1
  478. package/dist/table/tableStyles.js.map +1 -1
  479. package/dist/table/types.d.ts +89 -9
  480. package/dist/table/types.js.map +1 -1
  481. package/dist/table/useStickyTableSection.d.ts +27 -0
  482. package/dist/table/useStickyTableSection.js +84 -0
  483. package/dist/table/useStickyTableSection.js.map +1 -0
  484. package/dist/table/useTableSectionConfig.d.ts +13 -0
  485. package/dist/table/useTableSectionConfig.js +33 -0
  486. package/dist/table/useTableSectionConfig.js.map +1 -0
  487. package/dist/tabs/Tab.d.ts +3 -0
  488. package/dist/tabs/Tab.js.map +1 -1
  489. package/dist/tabs/TabList.js.map +1 -1
  490. package/dist/tabs/TabListScrollButton.js +5 -1
  491. package/dist/tabs/TabListScrollButton.js.map +1 -1
  492. package/dist/tabs/_tabs.scss +21 -3
  493. package/dist/tabs/tabIndicatorStyles.js.map +1 -1
  494. package/dist/tabs/tabListScrollButtonStyles.d.ts +2 -0
  495. package/dist/tabs/tabListScrollButtonStyles.js +9 -5
  496. package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
  497. package/dist/tabs/tabListStyles.js.map +1 -1
  498. package/dist/tabs/tabStyles.js.map +1 -1
  499. package/dist/tabs/useTabList.d.ts +2 -0
  500. package/dist/tabs/useTabList.js +4 -2
  501. package/dist/tabs/useTabList.js.map +1 -1
  502. package/dist/tabs/useTabs.d.ts +33 -11
  503. package/dist/tabs/useTabs.js +9 -3
  504. package/dist/tabs/useTabs.js.map +1 -1
  505. package/dist/tabs/utils.js.map +1 -1
  506. package/dist/test-utils/IntersectionObserver.js.map +1 -1
  507. package/dist/test-utils/ResizeObserver.js.map +1 -1
  508. package/dist/test-utils/data-testid.d.ts +0 -1
  509. package/dist/test-utils/data-testid.js.map +1 -1
  510. package/dist/test-utils/index.js.map +1 -1
  511. package/dist/test-utils/jest-setup.js.map +1 -1
  512. package/dist/test-utils/matchMedia.js.map +1 -1
  513. package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
  514. package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
  515. package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
  516. package/dist/test-utils/polyfills/TextEncoder.js.map +1 -1
  517. package/dist/test-utils/polyfills/index.js.map +1 -1
  518. package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
  519. package/dist/test-utils/polyfills/offsetParent.js.map +1 -1
  520. package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -1
  521. package/dist/test-utils/render.js.map +1 -1
  522. package/dist/test-utils/timers.js.map +1 -1
  523. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  524. package/dist/theme/ThemeProvider.js.map +1 -1
  525. package/dist/theme/_theme.scss +2 -1
  526. package/dist/theme/colors.js.map +1 -1
  527. package/dist/theme/cssVars.js.map +1 -1
  528. package/dist/theme/types.js.map +1 -1
  529. package/dist/theme/useCSSVariables.js.map +1 -1
  530. package/dist/theme/useColorScheme.d.ts +0 -1
  531. package/dist/theme/useColorScheme.js.map +1 -1
  532. package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
  533. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  534. package/dist/theme/usePrefersColorScheme.js.map +1 -1
  535. package/dist/theme/utils.js.map +1 -1
  536. package/dist/tooltip/Tooltip.d.ts +20 -9
  537. package/dist/tooltip/Tooltip.js.map +1 -1
  538. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  539. package/dist/tooltip/constants.js.map +1 -1
  540. package/dist/tooltip/tooltipStyles.js.map +1 -1
  541. package/dist/tooltip/useTooltip.d.ts +30 -16
  542. package/dist/tooltip/useTooltip.js.map +1 -1
  543. package/dist/tooltip/useTooltipPosition.d.ts +2 -4
  544. package/dist/tooltip/useTooltipPosition.js.map +1 -1
  545. package/dist/tooltip/utils.js.map +1 -1
  546. package/dist/transition/CSSTransition.js.map +1 -1
  547. package/dist/transition/Collapse.js.map +1 -1
  548. package/dist/transition/CrossFade.js.map +1 -1
  549. package/dist/transition/ScaleTransition.js.map +1 -1
  550. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  551. package/dist/transition/Slide.js.map +1 -1
  552. package/dist/transition/SlideContainer.d.ts +2 -48
  553. package/dist/transition/SlideContainer.js +2 -48
  554. package/dist/transition/SlideContainer.js.map +1 -1
  555. package/dist/transition/collapseStyles.js.map +1 -1
  556. package/dist/transition/config.js.map +1 -1
  557. package/dist/transition/maxWidthTransition.js.map +1 -1
  558. package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
  559. package/dist/transition/types.d.ts +19 -24
  560. package/dist/transition/types.js.map +1 -1
  561. package/dist/transition/useCSSTransition.js.map +1 -1
  562. package/dist/transition/useCarousel.js.map +1 -1
  563. package/dist/transition/useCollapseTransition.js.map +1 -1
  564. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  565. package/dist/transition/useMaxWidthTransition.js.map +1 -1
  566. package/dist/transition/useScaleTransition.js.map +1 -1
  567. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  568. package/dist/transition/useSlideTransition.js.map +1 -1
  569. package/dist/transition/useTransition.d.ts +1 -0
  570. package/dist/transition/useTransition.js +1 -0
  571. package/dist/transition/useTransition.js.map +1 -1
  572. package/dist/transition/utils.js.map +1 -1
  573. package/dist/tree/DefaultTreeItemRenderer.d.ts +2 -3
  574. package/dist/tree/DefaultTreeItemRenderer.js +1 -1
  575. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  576. package/dist/tree/Tree.d.ts +3 -4
  577. package/dist/tree/Tree.js.map +1 -1
  578. package/dist/tree/TreeGroup.js.map +1 -1
  579. package/dist/tree/TreeItem.d.ts +10 -3
  580. package/dist/tree/TreeItem.js +5 -2
  581. package/dist/tree/TreeItem.js.map +1 -1
  582. package/dist/tree/TreeItemExpander.js.map +1 -1
  583. package/dist/tree/TreeProvider.js.map +1 -1
  584. package/dist/tree/styles.js.map +1 -1
  585. package/dist/tree/types.d.ts +11 -6
  586. package/dist/tree/types.js +1 -26
  587. package/dist/tree/types.js.map +1 -1
  588. package/dist/tree/useTree.d.ts +5 -5
  589. package/dist/tree/useTree.js.map +1 -1
  590. package/dist/tree/useTreeExpansion.d.ts +3 -3
  591. package/dist/tree/useTreeExpansion.js.map +1 -1
  592. package/dist/tree/useTreeItems.js.map +1 -1
  593. package/dist/tree/useTreeMovement.js.map +1 -1
  594. package/dist/tree/useTreeSelection.d.ts +3 -3
  595. package/dist/tree/useTreeSelection.js.map +1 -1
  596. package/dist/tree/utils.js.map +1 -1
  597. package/dist/types.js.map +1 -1
  598. package/dist/typography/SrOnly.d.ts +2 -1
  599. package/dist/typography/SrOnly.js +2 -1
  600. package/dist/typography/SrOnly.js.map +1 -1
  601. package/dist/typography/TextContainer.d.ts +4 -2
  602. package/dist/typography/TextContainer.js +2 -2
  603. package/dist/typography/TextContainer.js.map +1 -1
  604. package/dist/typography/Typography.d.ts +10 -2
  605. package/dist/typography/Typography.js +3 -2
  606. package/dist/typography/Typography.js.map +1 -1
  607. package/dist/typography/WritingDirectionProvider.d.ts +2 -2
  608. package/dist/typography/WritingDirectionProvider.js +2 -2
  609. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  610. package/dist/typography/textContainerStyles.js.map +1 -1
  611. package/dist/typography/typographyStyles.js.map +1 -1
  612. package/dist/useAsyncFunction.js.map +1 -1
  613. package/dist/useDebouncedFunction.js.map +1 -1
  614. package/dist/useDropzone.js.map +1 -1
  615. package/dist/useElementSize.js.map +1 -1
  616. package/dist/useEnsuredId.js.map +1 -1
  617. package/dist/useEnsuredRef.js.map +1 -1
  618. package/dist/useEnsuredState.js.map +1 -1
  619. package/dist/useHtmlClassName.js.map +1 -1
  620. package/dist/useIntersectionObserver.js.map +1 -1
  621. package/dist/useIsomorphicLayoutEffect.js.map +1 -1
  622. package/dist/useLocalStorage.js.map +1 -1
  623. package/dist/useMutationObserver.js.map +1 -1
  624. package/dist/useOrientation.js.map +1 -1
  625. package/dist/usePageInactive.js.map +1 -1
  626. package/dist/useResizeListener.d.ts +7 -1
  627. package/dist/useResizeListener.js.map +1 -1
  628. package/dist/useResizeObserver.d.ts +3 -3
  629. package/dist/useResizeObserver.js.map +1 -1
  630. package/dist/useThrottledFunction.js.map +1 -1
  631. package/dist/useToggle.d.ts +4 -4
  632. package/dist/useToggle.js +1 -1
  633. package/dist/useToggle.js.map +1 -1
  634. package/dist/useUnmounted.js.map +1 -1
  635. package/dist/useWindowSize.js.map +1 -1
  636. package/dist/utils/RenderRecursively.js.map +1 -1
  637. package/dist/utils/alphaNumericSort.js.map +1 -1
  638. package/dist/utils/applyRef.js.map +1 -1
  639. package/dist/utils/bem.js.map +1 -1
  640. package/dist/utils/getClientPosition.js.map +1 -1
  641. package/dist/utils/getMiddleOfRange.js.map +1 -1
  642. package/dist/utils/getPercentage.js.map +1 -1
  643. package/dist/utils/getRangeDefaultValue.js.map +1 -1
  644. package/dist/utils/getRangeSteps.js.map +1 -1
  645. package/dist/utils/identity.js.map +1 -1
  646. package/dist/utils/isElementVisible.js.map +1 -1
  647. package/dist/utils/loop.js.map +1 -1
  648. package/dist/utils/nearest.js.map +1 -1
  649. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  650. package/dist/utils/randomInt.js.map +1 -1
  651. package/dist/utils/wait.js.map +1 -1
  652. package/dist/utils/withinRange.js.map +1 -1
  653. package/dist/window-splitter/WindowSplitter.d.ts +2 -2
  654. package/dist/window-splitter/WindowSplitter.js +2 -2
  655. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  656. package/dist/window-splitter/useWindowSplitter.js.map +1 -1
  657. package/package.json +25 -24
  658. package/src/RootHtml.tsx +0 -2
  659. package/src/app-bar/AppBar.tsx +0 -2
  660. package/src/app-bar/AppBarTitle.tsx +8 -6
  661. package/src/autocomplete/defaults.ts +3 -3
  662. package/src/avatar/Avatar.tsx +1 -4
  663. package/src/badge/Badge.tsx +1 -3
  664. package/src/box/Box.tsx +0 -2
  665. package/src/button/ButtonUnstyled.tsx +0 -2
  666. package/src/card/Card.tsx +2 -3
  667. package/src/card/CardContent.tsx +0 -2
  668. package/src/card/CardFooter.tsx +0 -2
  669. package/src/card/CardHeader.tsx +0 -2
  670. package/src/card/CardSubtitle.tsx +9 -2
  671. package/src/card/CardTitle.tsx +0 -2
  672. package/src/card/styles.ts +2 -6
  673. package/src/chip/Chip.tsx +0 -2
  674. package/src/cssUtils.ts +1 -1
  675. package/src/dialog/DialogContainer.tsx +0 -2
  676. package/src/dialog/DialogContent.tsx +3 -3
  677. package/src/dialog/DialogFooter.tsx +2 -3
  678. package/src/dialog/DialogHeader.tsx +3 -3
  679. package/src/dialog/DialogTitle.tsx +3 -3
  680. package/src/divider/Divider.tsx +0 -2
  681. package/src/expansion-panel/ExpansionList.tsx +1 -1
  682. package/src/expansion-panel/ExpansionPanel.tsx +9 -38
  683. package/src/expansion-panel/ExpansionPanelHeader.tsx +0 -1
  684. package/src/expansion-panel/expansionPanelStyles.ts +33 -0
  685. package/src/form/Fieldset.tsx +0 -2
  686. package/src/form/FormMessage.tsx +0 -2
  687. package/src/form/FormMessageContainer.tsx +0 -1
  688. package/src/form/FormMessageCounter.tsx +0 -2
  689. package/src/form/InputToggle.tsx +1 -1
  690. package/src/form/InputToggleIcon.tsx +0 -2
  691. package/src/form/Label.tsx +0 -2
  692. package/src/form/Legend.tsx +0 -2
  693. package/src/form/NativeSelect.tsx +0 -2
  694. package/src/form/Option.tsx +1 -1
  695. package/src/form/SelectedOption.tsx +0 -2
  696. package/src/form/SliderContainer.tsx +0 -2
  697. package/src/form/SliderMark.tsx +0 -2
  698. package/src/form/SliderMarkLabel.tsx +0 -2
  699. package/src/form/SliderTrack.tsx +0 -2
  700. package/src/form/SliderValueMarks.tsx +0 -2
  701. package/src/form/Switch.tsx +0 -2
  702. package/src/form/SwitchTrack.tsx +2 -1
  703. package/src/form/TextField.tsx +0 -2
  704. package/src/form/TextFieldAddon.tsx +1 -3
  705. package/src/icon/FontIcon.tsx +19 -11
  706. package/src/icon/IconRotator.tsx +0 -2
  707. package/src/icon/MaterialIcon.tsx +22 -5
  708. package/src/icon/MaterialSymbol.tsx +0 -1
  709. package/src/icon/SVGIcon.tsx +3 -2
  710. package/src/icon/TextIconSpacing.tsx +0 -2
  711. package/src/icon/iconConfig.tsx +1 -0
  712. package/src/icon/material.ts +276 -19
  713. package/src/icon/styles.ts +1 -1
  714. package/src/interaction/RippleContainer.tsx +0 -2
  715. package/src/layout/LayoutNav.tsx +3 -2
  716. package/src/layout/useHorizontalLayoutTransition.ts +1 -1
  717. package/src/layout/useLayoutTree.ts +2 -2
  718. package/src/link/Link.tsx +2 -6
  719. package/src/link/SkipToMainContent.tsx +11 -4
  720. package/src/link/styles.ts +2 -2
  721. package/src/list/List.tsx +1 -33
  722. package/src/list/ListItem.tsx +0 -17
  723. package/src/list/ListItemAddon.tsx +0 -2
  724. package/src/list/ListItemChildren.tsx +0 -2
  725. package/src/list/ListItemText.tsx +0 -2
  726. package/src/list/ListSubheader.tsx +3 -2
  727. package/src/list/getListItemHeight.ts +2 -2
  728. package/src/list/listItemStyles.ts +21 -4
  729. package/src/list/listStyles.ts +31 -0
  730. package/src/list/types.ts +9 -3
  731. package/src/media-queries/AppSizeProvider.tsx +8 -0
  732. package/src/media-queries/useMediaQuery.ts +1 -1
  733. package/src/menu/MenuConfigurationProvider.tsx +2 -2
  734. package/src/navigation/NavGroup.tsx +0 -2
  735. package/src/navigation/NavItem.tsx +0 -2
  736. package/src/navigation/NavSubheader.tsx +0 -2
  737. package/src/overlay/Overlay.tsx +1 -0
  738. package/src/portal/Portal.tsx +5 -0
  739. package/src/portal/PortalContainerProvider.tsx +16 -7
  740. package/src/progress/CircularProgress.tsx +5 -6
  741. package/src/progress/LinearProgress.tsx +0 -2
  742. package/src/responsive-item/ResponsiveItemContainer.tsx +0 -2
  743. package/src/responsive-item/ResponsiveItemOverlay.tsx +0 -2
  744. package/src/segmented-button/SegmentedButtonContainer.tsx +0 -2
  745. package/src/sheet/Sheet.tsx +36 -33
  746. package/src/sheet/styles.ts +50 -0
  747. package/src/suspense/CircularProgressSuspense.tsx +0 -2
  748. package/src/suspense/NullSuspense.tsx +0 -2
  749. package/src/table/StickyTableSection.tsx +91 -0
  750. package/src/table/Table.tsx +2 -5
  751. package/src/table/TableBody.tsx +1 -2
  752. package/src/table/TableCell.tsx +3 -5
  753. package/src/table/TableCellContent.tsx +1 -6
  754. package/src/table/TableConfigurationProvider.tsx +1 -86
  755. package/src/table/TableFooter.tsx +19 -116
  756. package/src/table/TableHeader.tsx +20 -118
  757. package/src/table/TableRow.tsx +2 -4
  758. package/src/table/tableCellStyles.ts +1 -1
  759. package/src/table/types.ts +105 -10
  760. package/src/table/useStickyTableSection.tsx +126 -0
  761. package/src/table/useTableSectionConfig.ts +45 -0
  762. package/src/tabs/Tab.tsx +3 -0
  763. package/src/tabs/TabListScrollButton.tsx +9 -2
  764. package/src/tabs/tabListScrollButtonStyles.ts +9 -5
  765. package/src/tabs/useTabList.ts +4 -0
  766. package/src/tabs/useTabs.ts +61 -14
  767. package/src/test-utils/IntersectionObserver.ts +1 -1
  768. package/src/tooltip/Tooltip.tsx +24 -8
  769. package/src/tooltip/useTooltip.ts +52 -27
  770. package/src/tooltip/useTooltipPosition.ts +2 -4
  771. package/src/transition/SlideContainer.tsx +2 -48
  772. package/src/transition/types.ts +23 -27
  773. package/src/transition/useTransition.ts +1 -0
  774. package/src/tree/DefaultTreeItemRenderer.tsx +3 -4
  775. package/src/tree/Tree.tsx +4 -6
  776. package/src/tree/TreeItem.tsx +11 -4
  777. package/src/tree/types.ts +16 -6
  778. package/src/tree/useTree.ts +5 -7
  779. package/src/tree/useTreeExpansion.ts +3 -3
  780. package/src/tree/useTreeSelection.ts +3 -3
  781. package/src/typography/SrOnly.tsx +2 -1
  782. package/src/typography/TextContainer.tsx +4 -2
  783. package/src/typography/Typography.tsx +10 -2
  784. package/src/typography/WritingDirectionProvider.tsx +2 -2
  785. package/src/useResizeListener.ts +8 -2
  786. package/src/useResizeObserver.ts +3 -3
  787. package/src/useToggle.ts +4 -4
  788. package/src/window-splitter/WindowSplitter.tsx +2 -2
  789. package/.eslintrc.cjs +0 -26
  790. package/.stylelintrc.json +0 -14
  791. package/.swcrc +0 -17
  792. package/.turbo/turbo-build.log +0 -22
  793. package/.turbo/turbo-lint.log +0 -12
  794. package/.turbo/turbo-test.log +0 -5498
  795. package/.turbo/turbo-typecheck.log +0 -26
  796. package/CHANGELOG.md +0 -310
  797. package/coverage/clover.xml +0 -775
  798. package/coverage/coverage-final.json +0 -5
  799. package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +0 -967
  800. package/coverage/lcov-report/autocomplete/index.html +0 -116
  801. package/coverage/lcov-report/base.css +0 -224
  802. package/coverage/lcov-report/block-navigation.js +0 -87
  803. package/coverage/lcov-report/button/Button.tsx.html +0 -676
  804. package/coverage/lcov-report/button/index.html +0 -116
  805. package/coverage/lcov-report/createHorizontalPosition.ts.html +0 -1075
  806. package/coverage/lcov-report/createVerticalPosition.ts.html +0 -997
  807. package/coverage/lcov-report/favicon.png +0 -0
  808. package/coverage/lcov-report/index.html +0 -161
  809. package/coverage/lcov-report/prettify.css +0 -1
  810. package/coverage/lcov-report/prettify.js +0 -2
  811. package/coverage/lcov-report/searching/fuzzy.ts.html +0 -607
  812. package/coverage/lcov-report/searching/index.html +0 -116
  813. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  814. package/coverage/lcov-report/sorter.js +0 -196
  815. package/coverage/lcov-report/typography/SrOnly.tsx.html +0 -325
  816. package/coverage/lcov-report/typography/index.html +0 -116
  817. package/coverage/lcov-report/utils.ts.html +0 -1225
  818. package/coverage/lcov.info +0 -836
  819. package/jest.config.ts +0 -68
  820. package/jest.setup.ts +0 -3
  821. package/scripts/copySassFiles.ts +0 -70
  822. package/scripts/tsconfig.json +0 -18
  823. package/src/__tests__/NoSsr.node.tsx +0 -26
  824. package/src/__tests__/NoSsr.tsx +0 -89
  825. package/src/__tests__/RootHtml.node.tsx +0 -46
  826. package/src/__tests__/__snapshots__/RootHtml.node.tsx.snap +0 -19
  827. package/src/__tests__/useAsyncFunction.tsx +0 -124
  828. package/src/__tests__/useDebouncedFunction.tsx +0 -108
  829. package/src/__tests__/useDropzone.tsx +0 -131
  830. package/src/__tests__/useElementSize.tsx +0 -181
  831. package/src/__tests__/useEnsuredId.tsx +0 -25
  832. package/src/__tests__/useEnsuredState.tsx +0 -74
  833. package/src/__tests__/useHtmlClassName.tsx +0 -54
  834. package/src/__tests__/useLocalStorage.tsx +0 -377
  835. package/src/__tests__/useOrientation.node.tsx +0 -20
  836. package/src/__tests__/useOrientation.tsx +0 -63
  837. package/src/__tests__/useResizeObserver.tsx +0 -258
  838. package/src/__tests__/useThrottledFunction.tsx +0 -226
  839. package/src/__tests__/useToggle.tsx +0 -78
  840. package/src/__tests__/useWindowSize.node.tsx +0 -56
  841. package/src/__tests__/useWindowSize.tsx +0 -155
  842. package/src/_box-shadows.scss +0 -219
  843. package/src/_core.scss +0 -432
  844. package/src/_utils.scss +0 -348
  845. package/src/app-bar/__tests__/AppBar.tsx +0 -121
  846. package/src/app-bar/__tests__/AppBarTitle.tsx +0 -39
  847. package/src/app-bar/__tests__/__snapshots__/AppBar.tsx.snap +0 -186
  848. package/src/app-bar/__tests__/__snapshots__/AppBarTitle.tsx.snap +0 -47
  849. package/src/app-bar/_app-bar.scss +0 -248
  850. package/src/autocomplete/__tests__/Autocomplete.tsx +0 -458
  851. package/src/autocomplete/__tests__/__snapshots__/Autocomplete.tsx.snap +0 -144
  852. package/src/autocomplete/_autocomplete.scss +0 -75
  853. package/src/avatar/__tests__/Avatar.tsx +0 -75
  854. package/src/avatar/__tests__/__snapshots__/Avatar.tsx.snap +0 -73
  855. package/src/avatar/_avatar.scss +0 -157
  856. package/src/badge/__tests__/Badge.tsx +0 -42
  857. package/src/badge/__tests__/__snapshots__/Badge.tsx.snap +0 -54
  858. package/src/badge/_badge.scss +0 -145
  859. package/src/box/__tests__/Box.tsx +0 -158
  860. package/src/box/__tests__/__snapshots__/Box.tsx.snap +0 -544
  861. package/src/box/_box.scss +0 -168
  862. package/src/button/__tests__/AsyncButton.tsx +0 -211
  863. package/src/button/__tests__/Button.tsx +0 -198
  864. package/src/button/__tests__/ButtonUnstyled.tsx +0 -37
  865. package/src/button/__tests__/TooltippedButton.tsx +0 -60
  866. package/src/button/__tests__/__snapshots__/AsyncButton.tsx.snap +0 -418
  867. package/src/button/__tests__/__snapshots__/Button.tsx.snap +0 -573
  868. package/src/button/__tests__/__snapshots__/ButtonUnstyled.tsx.snap +0 -22
  869. package/src/button/__tests__/__snapshots__/TooltippedButton.tsx.snap +0 -26
  870. package/src/button/__tests__/__snapshots__/buttonStyles.ts.snap +0 -11
  871. package/src/button/__tests__/buttonStyles.ts +0 -15
  872. package/src/button/_button.scss +0 -330
  873. package/src/card/__tests__/Card.tsx +0 -37
  874. package/src/card/__tests__/CardContent.tsx +0 -40
  875. package/src/card/__tests__/CardFooter.tsx +0 -34
  876. package/src/card/__tests__/CardHeader.tsx +0 -66
  877. package/src/card/__tests__/CardSubtitle.tsx +0 -30
  878. package/src/card/__tests__/CardTitle.tsx +0 -30
  879. package/src/card/__tests__/ClickableCard.tsx +0 -66
  880. package/src/card/__tests__/__snapshots__/Card.tsx.snap +0 -40
  881. package/src/card/__tests__/__snapshots__/CardContent.tsx.snap +0 -50
  882. package/src/card/__tests__/__snapshots__/CardFooter.tsx.snap +0 -30
  883. package/src/card/__tests__/__snapshots__/CardHeader.tsx.snap +0 -74
  884. package/src/card/__tests__/__snapshots__/CardSubtitle.tsx.snap +0 -18
  885. package/src/card/__tests__/__snapshots__/CardTitle.tsx.snap +0 -18
  886. package/src/card/__tests__/__snapshots__/ClickableCard.tsx.snap +0 -20
  887. package/src/card/__tests__/__snapshots__/styles.ts.snap +0 -13
  888. package/src/card/__tests__/styles.ts +0 -45
  889. package/src/card/_card.scss +0 -189
  890. package/src/chip/__tests__/Chip.tsx +0 -327
  891. package/src/chip/__tests__/__snapshots__/Chip.tsx.snap +0 -597
  892. package/src/chip/__tests__/__snapshots__/styles.ts.snap +0 -5
  893. package/src/chip/__tests__/styles.ts +0 -14
  894. package/src/chip/_chip.scss +0 -324
  895. package/src/dialog/__tests__/Dialog.tsx +0 -316
  896. package/src/dialog/__tests__/DialogContent.tsx +0 -53
  897. package/src/dialog/__tests__/DialogFooter.tsx +0 -70
  898. package/src/dialog/__tests__/DialogHeader.tsx +0 -37
  899. package/src/dialog/__tests__/DialogTitle.tsx +0 -41
  900. package/src/dialog/__tests__/__snapshots__/Dialog.tsx.snap +0 -84
  901. package/src/dialog/__tests__/__snapshots__/DialogContent.tsx.snap +0 -36
  902. package/src/dialog/__tests__/__snapshots__/DialogFooter.tsx.snap +0 -186
  903. package/src/dialog/__tests__/__snapshots__/DialogHeader.tsx.snap +0 -18
  904. package/src/dialog/__tests__/__snapshots__/DialogTitle.tsx.snap +0 -26
  905. package/src/dialog/_dialog.scss +0 -273
  906. package/src/divider/__tests__/Divider.tsx +0 -36
  907. package/src/divider/__tests__/__snapshots__/Divider.tsx.snap +0 -26
  908. package/src/divider/_divider.scss +0 -124
  909. package/src/draggable/__tests__/__snapshots__/useDraggable.tsx.snap +0 -49
  910. package/src/draggable/__tests__/useDraggable.tsx +0 -540
  911. package/src/draggable/_draggable.scss +0 -29
  912. package/src/expansion-panel/__tests__/ExpansionPanel.tsx +0 -290
  913. package/src/expansion-panel/__tests__/__snapshots__/ExpansionPanel.tsx.snap +0 -197
  914. package/src/expansion-panel/_expansion-panel.scss +0 -107
  915. package/src/focus/__tests__/useFocusContainer.tsx +0 -280
  916. package/src/form/__tests__/Checkbox.tsx +0 -42
  917. package/src/form/__tests__/Fieldset.tsx +0 -44
  918. package/src/form/__tests__/FileInput.tsx +0 -120
  919. package/src/form/__tests__/Label.tsx +0 -69
  920. package/src/form/__tests__/Legend.tsx +0 -34
  921. package/src/form/__tests__/MenuItemCheckbox.tsx +0 -53
  922. package/src/form/__tests__/MenuItemRadio.tsx +0 -53
  923. package/src/form/__tests__/Radio.tsx +0 -35
  924. package/src/form/__tests__/Select.tsx +0 -439
  925. package/src/form/__tests__/Switch.tsx +0 -152
  926. package/src/form/__tests__/TextArea.tsx +0 -433
  927. package/src/form/__tests__/TextField.tsx +0 -195
  928. package/src/form/__tests__/__snapshots__/Checkbox.tsx.snap +0 -99
  929. package/src/form/__tests__/__snapshots__/Fieldset.tsx.snap +0 -58
  930. package/src/form/__tests__/__snapshots__/FileInput.tsx.snap +0 -612
  931. package/src/form/__tests__/__snapshots__/Label.tsx.snap +0 -140
  932. package/src/form/__tests__/__snapshots__/Legend.tsx.snap +0 -30
  933. package/src/form/__tests__/__snapshots__/MenuItemCheckbox.tsx.snap +0 -96
  934. package/src/form/__tests__/__snapshots__/MenuItemRadio.tsx.snap +0 -96
  935. package/src/form/__tests__/__snapshots__/Radio.tsx.snap +0 -99
  936. package/src/form/__tests__/__snapshots__/Select.tsx.snap +0 -492
  937. package/src/form/__tests__/__snapshots__/Switch.tsx.snap +0 -428
  938. package/src/form/__tests__/__snapshots__/TextArea.tsx.snap +0 -548
  939. package/src/form/__tests__/__snapshots__/TextField.tsx.snap +0 -279
  940. package/src/form/__tests__/__snapshots__/useCheckboxGroup.tsx.snap +0 -481
  941. package/src/form/__tests__/__snapshots__/useRadioGroup.tsx.snap +0 -704
  942. package/src/form/__tests__/useCheckboxGroup.tsx +0 -292
  943. package/src/form/__tests__/useFileUpload.tsx +0 -289
  944. package/src/form/__tests__/useFormReset.tsx +0 -194
  945. package/src/form/__tests__/useRadioGroup.tsx +0 -227
  946. package/src/form/__tests__/utils.ts +0 -247
  947. package/src/form/_form.scss +0 -2190
  948. package/src/icon/__tests__/FontIcon.tsx +0 -45
  949. package/src/icon/__tests__/IconRotator.tsx +0 -120
  950. package/src/icon/__tests__/MaterialIcon.tsx +0 -79
  951. package/src/icon/__tests__/MaterialSymbol.tsx +0 -100
  952. package/src/icon/__tests__/SVGIcon.tsx +0 -40
  953. package/src/icon/__tests__/TextIconSpacing.tsx +0 -108
  954. package/src/icon/__tests__/__snapshots__/FontIcon.tsx.snap +0 -35
  955. package/src/icon/__tests__/__snapshots__/IconRotator.tsx.snap +0 -165
  956. package/src/icon/__tests__/__snapshots__/MaterialIcon.tsx.snap +0 -82
  957. package/src/icon/__tests__/__snapshots__/MaterialSymbol.tsx.snap +0 -42
  958. package/src/icon/__tests__/__snapshots__/SVGIcon.tsx.snap +0 -47
  959. package/src/icon/__tests__/__snapshots__/TextIconSpacing.tsx.snap +0 -101
  960. package/src/icon/__tests__/__snapshots__/styles.ts.snap +0 -29
  961. package/src/icon/__tests__/styles.ts +0 -28
  962. package/src/icon/_icon.scss +0 -213
  963. package/src/interaction/__tests__/UserInteractionModeProvider.tsx +0 -121
  964. package/src/interaction/__tests__/__snapshots__/useHigherContrastChildren.tsx.snap +0 -79
  965. package/src/interaction/__tests__/useHigherContrastChildren.tsx +0 -97
  966. package/src/interaction/_interaction.scss +0 -436
  967. package/src/layout/__tests__/LayoutAppBar.tsx +0 -117
  968. package/src/layout/__tests__/LayoutNav.tsx +0 -78
  969. package/src/layout/__tests__/LayoutWindowSplitter.tsx +0 -63
  970. package/src/layout/__tests__/Main.tsx +0 -51
  971. package/src/layout/__tests__/__snapshots__/LayoutAppBar.tsx.snap +0 -78
  972. package/src/layout/__tests__/__snapshots__/LayoutNav.tsx.snap +0 -31
  973. package/src/layout/__tests__/__snapshots__/LayoutWindowSplitter.tsx.snap +0 -60
  974. package/src/layout/__tests__/__snapshots__/Main.tsx.snap +0 -32
  975. package/src/layout/__tests__/__snapshots__/useExpandableLayout.tsx.snap +0 -116
  976. package/src/layout/__tests__/__snapshots__/useLayoutTree.tsx.snap +0 -676
  977. package/src/layout/__tests__/__snapshots__/useResizableLayout.tsx.snap +0 -95
  978. package/src/layout/__tests__/__snapshots__/useTemporaryLayout.tsx.snap +0 -141
  979. package/src/layout/__tests__/useExpandableLayout.tsx +0 -279
  980. package/src/layout/__tests__/useLayoutTree.tsx +0 -212
  981. package/src/layout/__tests__/useResizableLayout.tsx +0 -170
  982. package/src/layout/__tests__/useTemporaryLayout.tsx +0 -109
  983. package/src/layout/_layout.scss +0 -163
  984. package/src/link/__tests__/Link.tsx +0 -31
  985. package/src/link/__tests__/SkipToMainContent.tsx +0 -125
  986. package/src/link/__tests__/__snapshots__/Link.tsx.snap +0 -20
  987. package/src/link/__tests__/__snapshots__/SkipToMainContent.tsx.snap +0 -22
  988. package/src/link/_link.scss +0 -149
  989. package/src/list/__tests__/List.tsx +0 -58
  990. package/src/list/__tests__/ListItem.tsx +0 -280
  991. package/src/list/__tests__/ListItemLink.tsx +0 -89
  992. package/src/list/__tests__/ListSubheader.tsx +0 -81
  993. package/src/list/__tests__/__snapshots__/List.tsx.snap +0 -41
  994. package/src/list/__tests__/__snapshots__/ListItem.tsx.snap +0 -414
  995. package/src/list/__tests__/__snapshots__/ListItemLink.tsx.snap +0 -73
  996. package/src/list/__tests__/__snapshots__/ListSubheader.tsx.snap +0 -99
  997. package/src/list/__tests__/getListItemHeight.ts +0 -176
  998. package/src/list/_list.scss +0 -322
  999. package/src/media-queries/__tests__/AppSizeProvider.node.tsx +0 -37
  1000. package/src/media-queries/__tests__/AppSizeProvider.tsx +0 -119
  1001. package/src/media-queries/__tests__/useMediaQuery.node.tsx +0 -20
  1002. package/src/media-queries/__tests__/useMediaQuery.tsx +0 -59
  1003. package/src/media-queries/_media-queries.scss +0 -63
  1004. package/src/menu/__tests__/DropdownMenu.tsx +0 -627
  1005. package/src/menu/__tests__/MenuBar.tsx +0 -354
  1006. package/src/menu/__tests__/MenuItemCircularProgress.tsx +0 -39
  1007. package/src/menu/__tests__/MenuVisibilityProvider.tsx +0 -34
  1008. package/src/menu/__tests__/__snapshots__/DropdownMenu.tsx.snap +0 -292
  1009. package/src/menu/__tests__/__snapshots__/MenuBar.tsx.snap +0 -87
  1010. package/src/menu/__tests__/__snapshots__/MenuItemCircularProgress.tsx.snap +0 -68
  1011. package/src/menu/__tests__/__snapshots__/useContextMenu.tsx.snap +0 -54
  1012. package/src/menu/__tests__/useContextMenu.tsx +0 -41
  1013. package/src/menu/__tests__/utils.ts +0 -121
  1014. package/src/menu/_menu.scss +0 -116
  1015. package/src/movement/__tests__/findMatchIndex.ts +0 -244
  1016. package/src/movement/__tests__/utils.ts +0 -710
  1017. package/src/navigation/__tests__/Navigation.tsx +0 -97
  1018. package/src/navigation/__tests__/__snapshots__/Navigation.tsx.snap +0 -165
  1019. package/src/navigation/_navigation.scss +0 -99
  1020. package/src/overlay/__tests__/Overlay.tsx +0 -198
  1021. package/src/overlay/__tests__/__snapshots__/Overlay.tsx.snap +0 -77
  1022. package/src/overlay/_overlay.scss +0 -74
  1023. package/src/portal/__tests__/PortalContainerProvider.node.tsx +0 -26
  1024. package/src/portal/__tests__/PortalContainerProvider.tsx +0 -84
  1025. package/src/positioning/__tests__/__snapshots__/useFixedPositioning.tsx.snap +0 -87
  1026. package/src/positioning/__tests__/createHorizontalPosition.ts +0 -777
  1027. package/src/positioning/__tests__/createVerticalPosition.ts +0 -464
  1028. package/src/positioning/__tests__/useFixedPositioning.tsx +0 -205
  1029. package/src/positioning/__tests__/utils.ts +0 -1311
  1030. package/src/progress/__tests__/CircularProgress.tsx +0 -153
  1031. package/src/progress/__tests__/LinearProgress.tsx +0 -131
  1032. package/src/progress/__tests__/__snapshots__/CircularProgress.tsx.snap +0 -499
  1033. package/src/progress/__tests__/__snapshots__/LinearProgress.tsx.snap +0 -321
  1034. package/src/progress/__tests__/getProgressA11y.ts +0 -16
  1035. package/src/progress/_progress.scss +0 -577
  1036. package/src/responsive-item/__tests__/ResponsiveItemContainer.tsx +0 -56
  1037. package/src/responsive-item/__tests__/ResponsiveItemOverlay.tsx +0 -66
  1038. package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemContainer.tsx.snap +0 -85
  1039. package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemOverlay.tsx.snap +0 -151
  1040. package/src/responsive-item/__tests__/__snapshots__/styles.ts.snap +0 -9
  1041. package/src/responsive-item/__tests__/styles.ts +0 -32
  1042. package/src/responsive-item/_responsive-item.scss +0 -199
  1043. package/src/searching/__tests__/caseInsensitive.ts +0 -165
  1044. package/src/searching/__tests__/fuzzy.ts +0 -169
  1045. package/src/searching/__tests__/toSearchQuery.ts +0 -21
  1046. package/src/searching/__tests__/useFuzzyMatch.tsx +0 -200
  1047. package/src/segmented-button/__tests__/SegmentedButton.tsx +0 -61
  1048. package/src/segmented-button/__tests__/SegmentedButtonContainer.tsx +0 -38
  1049. package/src/segmented-button/__tests__/__snapshots__/SegmentedButton.tsx.snap +0 -116
  1050. package/src/segmented-button/__tests__/__snapshots__/SegmentedButtonContainer.tsx.snap +0 -22
  1051. package/src/segmented-button/_segmented-button.scss +0 -208
  1052. package/src/sheet/_sheet.scss +0 -189
  1053. package/src/snackbar/__tests__/Snackbar.tsx +0 -85
  1054. package/src/snackbar/__tests__/Toast.tsx +0 -105
  1055. package/src/snackbar/__tests__/ToastActionButton.tsx +0 -112
  1056. package/src/snackbar/__tests__/ToastCloseButton.tsx +0 -140
  1057. package/src/snackbar/__tests__/ToastContent.tsx +0 -88
  1058. package/src/snackbar/__tests__/ToastManagerProvider.tsx +0 -852
  1059. package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +0 -176
  1060. package/src/snackbar/__tests__/__snapshots__/Toast.tsx.snap +0 -52
  1061. package/src/snackbar/__tests__/__snapshots__/ToastActionButton.tsx.snap +0 -36
  1062. package/src/snackbar/__tests__/__snapshots__/ToastCloseButton.tsx.snap +0 -104
  1063. package/src/snackbar/__tests__/__snapshots__/ToastContent.tsx.snap +0 -26
  1064. package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +0 -290
  1065. package/src/snackbar/_snackbar.scss +0 -266
  1066. package/src/suspense/__tests__/CircularProgressSuspense.tsx +0 -90
  1067. package/src/suspense/__tests__/NullSuspense.tsx +0 -46
  1068. package/src/suspense/__tests__/__snapshots__/CircularProgressSuspense.tsx.snap +0 -24
  1069. package/src/table/__tests__/Table.tsx +0 -314
  1070. package/src/table/__tests__/TableBody.tsx +0 -52
  1071. package/src/table/__tests__/TableCheckbox.tsx +0 -89
  1072. package/src/table/__tests__/TableContainer.tsx +0 -31
  1073. package/src/table/__tests__/TableRadio.tsx +0 -112
  1074. package/src/table/__tests__/TableRow.tsx +0 -63
  1075. package/src/table/__tests__/__snapshots__/Table.tsx.snap +0 -2426
  1076. package/src/table/__tests__/__snapshots__/TableBody.tsx.snap +0 -54
  1077. package/src/table/__tests__/__snapshots__/TableCheckbox.tsx.snap +0 -142
  1078. package/src/table/__tests__/__snapshots__/TableContainer.tsx.snap +0 -16
  1079. package/src/table/__tests__/__snapshots__/TableRadio.tsx.snap +0 -138
  1080. package/src/table/__tests__/__snapshots__/TableRow.tsx.snap +0 -56
  1081. package/src/table/__tests__/__snapshots__/tableContainerStyles.ts.snap +0 -3
  1082. package/src/table/__tests__/__snapshots__/tableRowStyles.ts.snap +0 -3
  1083. package/src/table/__tests__/__snapshots__/tableStyles.ts.snap +0 -3
  1084. package/src/table/__tests__/tableContainerStyles.ts +0 -8
  1085. package/src/table/__tests__/tableRowStyles.ts +0 -8
  1086. package/src/table/__tests__/tableStyles.ts +0 -8
  1087. package/src/table/_table.scss +0 -447
  1088. package/src/tabs/__tests__/Tab.tsx +0 -51
  1089. package/src/tabs/__tests__/TabList.tsx +0 -640
  1090. package/src/tabs/__tests__/__snapshots__/Tab.tsx.snap +0 -85
  1091. package/src/tabs/__tests__/__snapshots__/TabList.tsx.snap +0 -51
  1092. package/src/tabs/__tests__/useTabs.tsx +0 -212
  1093. package/src/tabs/_tabs.scss +0 -273
  1094. package/src/test-utils/__tests__/ResizeObserver.ts +0 -171
  1095. package/src/theme/__tests__/LocalStorageColorSchemeProvider.tsx +0 -162
  1096. package/src/theme/__tests__/ThemeProvider.tsx +0 -90
  1097. package/src/theme/__tests__/__snapshots__/useCSSVariables.tsx.snap +0 -27
  1098. package/src/theme/__tests__/__snapshots__/useColorSchemeMetaTag.tsx.snap +0 -15
  1099. package/src/theme/__tests__/useCSSVariables.tsx +0 -177
  1100. package/src/theme/__tests__/useColorSchemeMetaTag.tsx +0 -36
  1101. package/src/theme/__tests__/utils.ts +0 -67
  1102. package/src/theme/_a11y.scss +0 -114
  1103. package/src/theme/_colors.scss +0 -1057
  1104. package/src/theme/_theme.scss +0 -519
  1105. package/src/tooltip/__tests__/Tooltip.tsx +0 -501
  1106. package/src/tooltip/__tests__/TooltipHoverModeProvider.tsx +0 -94
  1107. package/src/tooltip/__tests__/__snapshots__/Tooltip.tsx.snap +0 -34
  1108. package/src/tooltip/__tests__/utils.ts +0 -94
  1109. package/src/tooltip/_tooltip.scss +0 -155
  1110. package/src/transition/__tests__/CSSTransition.tsx +0 -182
  1111. package/src/transition/__tests__/Collapse.tsx +0 -209
  1112. package/src/transition/__tests__/CrossFade.tsx +0 -227
  1113. package/src/transition/__tests__/ScaleTransition.tsx +0 -204
  1114. package/src/transition/__tests__/SkeletonPlaceholder.tsx +0 -72
  1115. package/src/transition/__tests__/__snapshots__/CSSTransition.tsx.snap +0 -145
  1116. package/src/transition/__tests__/__snapshots__/Collapse.tsx.snap +0 -224
  1117. package/src/transition/__tests__/__snapshots__/CrossFade.tsx.snap +0 -240
  1118. package/src/transition/__tests__/__snapshots__/ScaleTransition.tsx.snap +0 -239
  1119. package/src/transition/__tests__/__snapshots__/SkeletonPlaceholder.tsx.snap +0 -24
  1120. package/src/transition/__tests__/__snapshots__/useCollapseTransition.tsx.snap +0 -361
  1121. package/src/transition/__tests__/__snapshots__/useCrossFadeTransition.tsx.snap +0 -258
  1122. package/src/transition/__tests__/__snapshots__/useMaxWidthTransition.tsx.snap +0 -68
  1123. package/src/transition/__tests__/__snapshots__/useScaleTransition.tsx.snap +0 -209
  1124. package/src/transition/__tests__/useCSSTransition.tsx +0 -190
  1125. package/src/transition/__tests__/useCollapseTransition.tsx +0 -316
  1126. package/src/transition/__tests__/useCrossFadeTransition.tsx +0 -229
  1127. package/src/transition/__tests__/useMaxWidthTransition.tsx +0 -123
  1128. package/src/transition/__tests__/useScaleTransition.tsx +0 -212
  1129. package/src/transition/__tests__/useTransition.tsx +0 -569
  1130. package/src/transition/__tests__/utils.ts +0 -620
  1131. package/src/transition/_transition.scss +0 -365
  1132. package/src/tree/__tests__/Tree.tsx +0 -735
  1133. package/src/tree/__tests__/TreeGroup.tsx +0 -76
  1134. package/src/tree/__tests__/TreeItemExpander.tsx +0 -74
  1135. package/src/tree/__tests__/__snapshots__/Tree.tsx.snap +0 -3618
  1136. package/src/tree/__tests__/__snapshots__/TreeItemExpander.tsx.snap +0 -11
  1137. package/src/tree/__tests__/utils.ts +0 -98
  1138. package/src/tree/_tree.scss +0 -176
  1139. package/src/typography/__tests__/SrOnly.tsx +0 -43
  1140. package/src/typography/__tests__/TextContainer.tsx +0 -45
  1141. package/src/typography/__tests__/Typography.tsx +0 -87
  1142. package/src/typography/__tests__/WritingDirectionProvider.node.tsx +0 -27
  1143. package/src/typography/__tests__/WritingDirectionProvider.tsx +0 -119
  1144. package/src/typography/__tests__/__snapshots__/SrOnly.tsx.snap +0 -56
  1145. package/src/typography/__tests__/__snapshots__/TextContainer.tsx.snap +0 -29
  1146. package/src/typography/__tests__/__snapshots__/Typography.tsx.snap +0 -112
  1147. package/src/typography/_typography.scss +0 -399
  1148. package/src/utils/__tests__/RenderRecursively.tsx +0 -87
  1149. package/src/utils/__tests__/__snapshots__/RenderRecursively.tsx.snap +0 -80
  1150. package/src/utils/__tests__/applyRef.ts +0 -30
  1151. package/src/utils/__tests__/bem.ts +0 -54
  1152. package/src/utils/__tests__/getMiddleOfRange.ts +0 -12
  1153. package/src/utils/__tests__/getPercentage.ts +0 -104
  1154. package/src/utils/__tests__/getRangeDefaultValue.ts +0 -47
  1155. package/src/utils/__tests__/getRangeSteps.ts +0 -14
  1156. package/src/utils/__tests__/loop.ts +0 -50
  1157. package/src/utils/__tests__/nearest.ts +0 -83
  1158. package/src/utils/__tests__/parseCssLengthUnit.node.ts +0 -28
  1159. package/src/utils/__tests__/parseCssLengthUnit.ts +0 -47
  1160. package/src/utils/__tests__/wait.ts +0 -12
  1161. package/src/utils/__tests__/withinRange.ts +0 -24
  1162. package/src/window-splitter/_window-splitter.scss +0 -143
  1163. package/tsconfig.json +0 -19
  1164. package/tsconfig.types.json +0 -12
  1165. package/tsdoc.json +0 -14
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/TextArea.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { ResizingTextAreaWrapper } from \"./ResizingTextAreaWrapper.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { textArea, textAreaContainer } from \"./textAreaStyles.js\";\nimport { type FormFieldOptions } from \"./types.js\";\nimport {\n useResizingTextArea,\n type TextAreaResize,\n} from \"./useResizingTextArea.js\";\n\n/**\n * @since 6.0.0 Added `containerProps`.\n */\nexport interface TextAreaProps\n extends FormFieldOptions,\n TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** @defaultValue `\"text-area-\" + useId()` */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Set this to `true` if the auto resizing textarea should not animate for new\n * height changes.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * An optional style to apply to the textarea element. The base `style` prop\n * is applied to the surrounding `div` instead.\n */\n areaStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the textarea element. The base `style`\n * prop is applied to the surrounding `div` instead.\n */\n areaClassName?: string;\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n * @defaultValue `2`\n */\n rows?: number;\n\n /**\n * The maximum number of rows a textarea can expand to before showing a\n * scrollbar. When this is set to `-1`, there will be no limit.\n *\n * @defaultValue `-1`\n */\n maxRows?: number;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * When the {@link resize} prop is set to `\"auto\"`, an additional `<div>` is\n * added along with a hidden `<textarea>` mask. This prop can be used to add\n * any additional styling or props to that div.\n *\n * This will only be applied when {@link resize} is set to `\"auto\"`.\n */\n resizeContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { TextArea } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextArea\n * label=\"Label\"\n * placeholder=\"Placeholder\"\n * />\n * );\n * }\n * ```\n */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(props, ref) {\n const {\n id: propId,\n style,\n className,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n areaStyle,\n areaClassName,\n resizeContainerProps,\n resize = \"auto\",\n dense = false,\n error = false,\n active = false,\n inline: propInline = false,\n stretch = false,\n leftAddon,\n rightAddon,\n disableLeftAddonStyles = false,\n disableRightAddonStyles = false,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n rows = 2,\n maxRows = -1,\n onChange: propOnChange,\n disableTransition: propDisableTransition,\n ...remaining\n } = props;\n const { disabled = false, readOnly = false, value, defaultValue } = props;\n const id = useEnsuredId(propId, \"text-area\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const [areaRef, areaRefCallback] = useEnsuredRef(ref);\n\n const {\n maskRef,\n containerRef,\n height,\n onChange,\n scrollable,\n disableTransition,\n } = useResizingTextArea({\n maxRows,\n resize,\n onChange: propOnChange,\n containerRef: containerProps?.ref,\n disableTransition: propDisableTransition,\n });\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n // have to force it inline or else you won't be able to resize\n // it horizontally.\n const inline = resize === \"horizontal\" || resize === \"both\" || propInline;\n\n const area = (\n <textarea\n {...remaining}\n id={id}\n ref={areaRefCallback}\n rows={rows}\n disabled={disabled}\n onChange={onChange}\n placeholder={placeholder}\n style={areaStyle}\n className={textArea({\n resize,\n scrollable,\n className: areaClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n );\n\n const labelNode = label && (\n <Label\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n >\n {label}\n </Label>\n );\n\n let children = (\n <>\n {area}\n {labelNode}\n </>\n );\n\n if (resize === \"auto\") {\n children = (\n <ResizingTextAreaWrapper\n {...resizeContainerProps}\n maskId={`${id}-mask`}\n maskRef={maskRef}\n rows={rows}\n areaStyle={areaStyle}\n areaClassName={areaClassName}\n defaultValue={value ?? defaultValue}\n disableTransition={disableTransition}\n >\n {children}\n </ResizingTextAreaWrapper>\n );\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <TextFieldContainer\n {...containerProps}\n ref={containerRef}\n style={{\n ...style,\n \"--rmd-textarea-height\": height,\n }}\n className={textAreaContainer({\n animate: !disableTransition && resize == \"auto\",\n disabled,\n height: !!height,\n underlineLabelled:\n !!label && (theme === \"underline\" || theme === \"filled\"),\n className,\n })}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n stretch={stretch}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n onClick={(event) => {\n // The textarea container adds padding-top when there is a label so\n // that the label does not cover the text so this makes it so you\n // can still click anywhere in the \"box\" to focus the textarea.\n if (!disabled && event.target === event.currentTarget) {\n areaRef.current?.focus();\n }\n }}\n >\n {children}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","useEnsuredRef","FormMessageContainer","Label","ResizingTextAreaWrapper","TextFieldContainer","getFormConfig","textArea","textAreaContainer","useResizingTextArea","TextArea","props","ref","id","propId","style","className","label","labelProps","labelStyle","labelClassName","areaStyle","areaClassName","resizeContainerProps","resize","dense","error","active","inline","propInline","stretch","leftAddon","rightAddon","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","rows","maxRows","onChange","propOnChange","disableTransition","propDisableTransition","remaining","disabled","readOnly","value","defaultValue","areaRef","areaRefCallback","maskRef","containerRef","height","scrollable","placeholder","area","textarea","placeholderHidden","labelNode","htmlFor","floating","children","maskId","animate","underlineLabelled","onClick","event","target","currentTarget","current","focus"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SACEA,UAAU,QAIL,QAAQ;AAEf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,EAAEC,iBAAiB,QAAQ,sBAAsB;AAElE,SACEC,mBAAmB,QAEd,2BAA2B;AA8ElC;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMC,yBAAWX,WACtB,SAASW,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAAS,EACTC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,cAAc,EACdC,SAAS,EACTC,aAAa,EACbC,oBAAoB,EACpBC,SAAS,MAAM,EACfC,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BAECT;;;AAIT,GACA"}
1
+ {"version":3,"sources":["../../src/form/TextArea.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { ResizingTextAreaWrapper } from \"./ResizingTextAreaWrapper.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { textArea, textAreaContainer } from \"./textAreaStyles.js\";\nimport { type FormFieldOptions } from \"./types.js\";\nimport {\n useResizingTextArea,\n type TextAreaResize,\n} from \"./useResizingTextArea.js\";\n\n/**\n * @since 6.0.0 Added `containerProps`.\n */\nexport interface TextAreaProps\n extends FormFieldOptions,\n TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** @defaultValue `\"text-area-\" + useId()` */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Set this to `true` if the auto resizing textarea should not animate for new\n * height changes.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * An optional style to apply to the textarea element. The base `style` prop\n * is applied to the surrounding `div` instead.\n */\n areaStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the textarea element. The base `style`\n * prop is applied to the surrounding `div` instead.\n */\n areaClassName?: string;\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n * @defaultValue `2`\n */\n rows?: number;\n\n /**\n * The maximum number of rows a textarea can expand to before showing a\n * scrollbar. When this is set to `-1`, there will be no limit.\n *\n * @defaultValue `-1`\n */\n maxRows?: number;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * When the {@link resize} prop is set to `\"auto\"`, an additional `<div>` is\n * added along with a hidden `<textarea>` mask. This prop can be used to add\n * any additional styling or props to that div.\n *\n * This will only be applied when {@link resize} is set to `\"auto\"`.\n */\n resizeContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { TextArea } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextArea\n * label=\"Label\"\n * placeholder=\"Placeholder\"\n * />\n * );\n * }\n * ```\n */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(props, ref) {\n const {\n id: propId,\n style,\n className,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n areaStyle,\n areaClassName,\n resizeContainerProps,\n resize = \"auto\",\n dense = false,\n error = false,\n active = false,\n inline: propInline = false,\n stretch = false,\n leftAddon,\n rightAddon,\n disableLeftAddonStyles = false,\n disableRightAddonStyles = false,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n rows = 2,\n maxRows = -1,\n onChange: propOnChange,\n disableTransition: propDisableTransition,\n ...remaining\n } = props;\n const { disabled = false, readOnly = false, value, defaultValue } = props;\n const id = useEnsuredId(propId, \"text-area\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const [areaRef, areaRefCallback] = useEnsuredRef(ref);\n\n const {\n maskRef,\n containerRef,\n height,\n onChange,\n scrollable,\n disableTransition,\n } = useResizingTextArea({\n maxRows,\n resize,\n onChange: propOnChange,\n containerRef: containerProps?.ref,\n disableTransition: propDisableTransition,\n });\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n // have to force it inline or else you won't be able to resize\n // it horizontally.\n const inline = resize === \"horizontal\" || resize === \"both\" || propInline;\n\n const area = (\n <textarea\n {...remaining}\n id={id}\n ref={areaRefCallback}\n rows={rows}\n disabled={disabled}\n onChange={onChange}\n placeholder={placeholder}\n style={areaStyle}\n className={textArea({\n resize,\n scrollable,\n className: areaClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n );\n\n const labelNode = label && (\n <Label\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n >\n {label}\n </Label>\n );\n\n let children = (\n <>\n {area}\n {labelNode}\n </>\n );\n\n if (resize === \"auto\") {\n children = (\n <ResizingTextAreaWrapper\n {...resizeContainerProps}\n maskId={`${id}-mask`}\n maskRef={maskRef}\n rows={rows}\n areaStyle={areaStyle}\n areaClassName={areaClassName}\n defaultValue={value ?? defaultValue}\n disableTransition={disableTransition}\n >\n {children}\n </ResizingTextAreaWrapper>\n );\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <TextFieldContainer\n {...containerProps}\n ref={containerRef}\n style={{\n ...style,\n \"--rmd-textarea-height\": height,\n }}\n className={textAreaContainer({\n animate: !disableTransition && resize == \"auto\",\n disabled,\n height: !!height,\n underlineLabelled:\n !!label && (theme === \"underline\" || theme === \"filled\"),\n className,\n })}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n stretch={stretch}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n onClick={(event) => {\n // The textarea container adds padding-top when there is a label so\n // that the label does not cover the text so this makes it so you\n // can still click anywhere in the \"box\" to focus the textarea.\n if (!disabled && event.target === event.currentTarget) {\n areaRef.current?.focus();\n }\n }}\n >\n {children}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","useEnsuredRef","FormMessageContainer","Label","ResizingTextAreaWrapper","TextFieldContainer","getFormConfig","textArea","textAreaContainer","useResizingTextArea","TextArea","props","ref","id","propId","style","className","label","labelProps","labelStyle","labelClassName","areaStyle","areaClassName","resizeContainerProps","resize","dense","error","active","inline","propInline","stretch","leftAddon","rightAddon","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","rows","maxRows","onChange","propOnChange","disableTransition","propDisableTransition","remaining","disabled","readOnly","value","defaultValue","areaRef","areaRefCallback","maskRef","containerRef","height","scrollable","placeholder","area","textarea","placeholderHidden","labelNode","htmlFor","floating","children","maskId","animate","underlineLabelled","onClick","event","target","currentTarget","current","focus"],"mappings":"AAAA;;AACA,SACEA,UAAU,QAIL,QAAQ;AAEf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,EAAEC,iBAAiB,QAAQ,sBAAsB;AAElE,SACEC,mBAAmB,QAEd,2BAA2B;AA8ElC;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMC,yBAAWX,WACtB,SAASW,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAAS,EACTC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,c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AAKD,MAAME,aAAa,EAAE;oBACrDpB,QAAQqB,OAAO,EAAEC;gBACnB;YACF;sBAECT;;;AAIT,GACA"}
@@ -52,8 +52,6 @@ export interface TextFieldProps extends TextFieldInputAttributes, UserAgentAutoc
52
52
  containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
53
53
  }
54
54
  /**
55
- * **Server Component**
56
- *
57
55
  * The structure for this component is:
58
56
  * @example Component Structure
59
57
  * ```tsx
@@ -6,8 +6,6 @@ import { Label } from "./Label.js";
6
6
  import { TextFieldContainer } from "./TextFieldContainer.js";
7
7
  import { textField } from "./textFieldStyles.js";
8
8
  /**
9
- * **Server Component**
10
- *
11
9
  * The structure for this component is:
12
10
  * @example Component Structure
13
11
  * ```tsx
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/TextField.tsx"],"sourcesContent":["import {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { textField } from \"./textFieldStyles.js\";\nimport {\n type FormFieldOptions,\n type UserAgentAutocompleteProps,\n} from \"./types.js\";\n\n/**\n * These are all the \"supported\" input types for react-md so that they at least\n * render reasonably well by default. There is no built-in validation or\n * anything adding onto existing browser functionality for these types.\n *\n * @since 2.5.0 - `\"search\"` was added\n * @since 6.0.0 Dropped support for `\"week\"` and `\"month\"` input types since\n * they are not available in Firefox and Safari at this time.\n */\nexport type SupportedInputTypes =\n | \"text\"\n | \"password\"\n | \"number\"\n | \"tel\"\n | \"email\"\n | \"date\"\n | \"time\"\n | \"datetime-local\"\n | \"url\"\n | \"color\"\n | \"search\";\n\n/**\n * @since 6.0.0 Renamed from `TextFieldAttributes` to\n * `TextFieldInputAttributes`\n */\nexport type TextFieldInputAttributes = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\"\n>;\n\n/**\n * @since 6.0.0 Removed the `containerRef` prop.\n */\nexport interface TextFieldProps\n extends TextFieldInputAttributes,\n UserAgentAutocompleteProps,\n FormFieldOptions {\n /**\n * @defaultValue `\"text-field-\" + useId()`\n */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Any optional inline styles to set on the input.\n */\n inputStyle?: CSSProperties;\n\n /**\n * An optional `className` to add to the input.\n */\n inputClassName?: string;\n\n /**\n * The text field type.\n *\n * @defaultValue `\"text\"`\n */\n type?: SupportedInputTypes;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * **Server Component**\n *\n * The structure for this component is:\n * @example Component Structure\n * ```tsx\n * <FormMessageContainer {...messageContainerProps}>\n * <TextFieldContainer {...containerProps}>\n * <input {...props} />\n * <Label {...labelProps} />\n * </TextFieldContainer>\n * </FormMessageContainer>\n * ```\n *\n * @example Simple Example\n * ```tsx\n * import { TextField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextField\n * label=\"Name\"\n * placeholder=\"Bob\"\n * defaultValue=\"\"\n * />\n * );\n * }\n * ```\n */\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(props, ref) {\n const {\n id: propId,\n style,\n className,\n type = \"text\",\n label,\n labelProps,\n labelStyle,\n labelClassName,\n autoCompleteValue,\n autoComplete = autoCompleteValue,\n name = autoCompleteValue,\n dense,\n error,\n active,\n inline,\n stretch,\n leftAddon,\n leftAddonProps,\n rightAddon,\n rightAddonProps,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n inputStyle,\n inputClassName,\n theme,\n underlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n ...remaining\n } = props;\n const { disabled, readOnly } = props;\n const id = useEnsuredId(propId, \"text-field\");\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={\n messageProps && {\n error,\n theme,\n ...messageProps,\n }\n }\n >\n <TextFieldContainer\n {...containerProps}\n style={style}\n className={className}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n stretch={stretch}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n leftAddonProps={leftAddonProps}\n rightAddon={rightAddon}\n rightAddonProps={rightAddonProps}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n >\n <input\n {...remaining}\n id={id}\n ref={ref}\n type={type}\n name={name}\n disabled={disabled}\n placeholder={placeholder}\n autoComplete={autoComplete}\n style={inputStyle}\n className={textField({\n className: inputClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n {label && (\n <Label\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n >\n {label}\n </Label>\n )}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","FormMessageContainer","Label","TextFieldContainer","textField","TextField","props","ref","id","propId","style","className","type","label","labelProps","labelStyle","labelClassName","autoCompleteValue","autoComplete","name","dense","error","active","inline","stretch","leftAddon","leftAddonProps","rightAddon","rightAddonProps","disableLeftAddonStyles","disableRightAddonStyles","inputStyle","inputClassName","theme","underlineDirection","messageProps","messageContainerProps","containerProps","remaining","disabled","readOnly","placeholder","input","placeholderHidden","floating","htmlFor"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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WA;YACXsB,OAAOA;YACPpB,OAAO,CAAC,CAACA;YACTQ,OAAOA;YACPD,OAAOA;YACPG,QAAQA;YACRD,QAAQA;YACRE,SAASA;YACTgB,UAAUA;YACVD,UAAUA;YACVd,WAAWA;YACXC,gBAAgBA;YAChBC,YAAYA;YACZC,iBAAiBA;YACjBM,oBAAoBA;YACpBL,wBAAwBA;YACxBC,yBAAyBA;;8BAEzB,KAACY;oBACE,GAAGJ,SAAS;oBACb9B,IAAIA;oBACJD,KAAKA;oBACLK,MAAMA;oBACNO,MAAMA;oBACNoB,UAAUA;oBACVE,aAAaA;oBACbvB,cAAcA;oBACdR,OAAOqB;oBACPpB,WAAWP,UAAU;wBACnBO,WAAWqB;wBACXW,mBAAmB,CAAC,CAAC9B,SAAS,CAACS;oBACjC;;gBAEDT,uBACC,KAACX;oBACC0C,QAAQ;oBACRxB,OAAOA;oBACPC,OAAOA;oBACPC,QAAQA;oBACRiB,UAAUA;oBACT,GAAGzB,UAAU;oBACd+B,SAASrC;oBACTE,OAAOI,YAAYJ,SAASK;oBAC5BJ,WAAWG,YAAYH,aAAaK;8BAEnCH;;;;;AAMb,GACA"}
1
+ {"version":3,"sources":["../../src/form/TextField.tsx"],"sourcesContent":["import {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { textField } from \"./textFieldStyles.js\";\nimport {\n type FormFieldOptions,\n type UserAgentAutocompleteProps,\n} from \"./types.js\";\n\n/**\n * These are all the \"supported\" input types for react-md so that they at least\n * render reasonably well by default. There is no built-in validation or\n * anything adding onto existing browser functionality for these types.\n *\n * @since 2.5.0 - `\"search\"` was added\n * @since 6.0.0 Dropped support for `\"week\"` and `\"month\"` input types since\n * they are not available in Firefox and Safari at this time.\n */\nexport type SupportedInputTypes =\n | \"text\"\n | \"password\"\n | \"number\"\n | \"tel\"\n | \"email\"\n | \"date\"\n | \"time\"\n | \"datetime-local\"\n | \"url\"\n | \"color\"\n | \"search\";\n\n/**\n * @since 6.0.0 Renamed from `TextFieldAttributes` to\n * `TextFieldInputAttributes`\n */\nexport type TextFieldInputAttributes = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\"\n>;\n\n/**\n * @since 6.0.0 Removed the `containerRef` prop.\n */\nexport interface TextFieldProps\n extends TextFieldInputAttributes,\n UserAgentAutocompleteProps,\n FormFieldOptions {\n /**\n * @defaultValue `\"text-field-\" + useId()`\n */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Any optional inline styles to set on the input.\n */\n inputStyle?: CSSProperties;\n\n /**\n * An optional `className` to add to the input.\n */\n inputClassName?: string;\n\n /**\n * The text field type.\n *\n * @defaultValue `\"text\"`\n */\n type?: SupportedInputTypes;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * The structure for this component is:\n * @example Component Structure\n * ```tsx\n * <FormMessageContainer {...messageContainerProps}>\n * <TextFieldContainer {...containerProps}>\n * <input {...props} />\n * <Label {...labelProps} />\n * </TextFieldContainer>\n * </FormMessageContainer>\n * ```\n *\n * @example Simple Example\n * ```tsx\n * import { TextField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextField\n * label=\"Name\"\n * placeholder=\"Bob\"\n * defaultValue=\"\"\n * />\n * );\n * }\n * ```\n */\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(props, ref) {\n const {\n id: propId,\n style,\n className,\n type = \"text\",\n label,\n labelProps,\n labelStyle,\n labelClassName,\n autoCompleteValue,\n autoComplete = autoCompleteValue,\n name = autoCompleteValue,\n dense,\n error,\n active,\n inline,\n stretch,\n leftAddon,\n leftAddonProps,\n rightAddon,\n rightAddonProps,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n inputStyle,\n inputClassName,\n theme,\n underlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n ...remaining\n } = props;\n const { disabled, readOnly } = props;\n const id = useEnsuredId(propId, \"text-field\");\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={\n messageProps && {\n error,\n theme,\n ...messageProps,\n }\n }\n >\n <TextFieldContainer\n {...containerProps}\n style={style}\n className={className}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n stretch={stretch}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n leftAddonProps={leftAddonProps}\n rightAddon={rightAddon}\n rightAddonProps={rightAddonProps}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n >\n <input\n {...remaining}\n id={id}\n ref={ref}\n type={type}\n name={name}\n disabled={disabled}\n placeholder={placeholder}\n autoComplete={autoComplete}\n style={inputStyle}\n className={textField({\n className: inputClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n {label && (\n <Label\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n >\n {label}\n </Label>\n )}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","FormMessageContainer","Label","TextFieldContainer","textField","TextField","props","ref","id","propId","style","className","type","label","labelProps","labelStyle","labelClassName","autoCompleteValue","autoComplete","name","dense","error","active","inline","stretch","leftAddon","leftAddonProps","rightAddon","rightAddonProps","disableLeftAddonStyles","disableRightAddonStyles","inputStyle","inputClassName","theme","underlineDirection","messageProps","messageContainerProps","containerProps","remaining","disabled","readOnly","placeholder","input","placeholderHidden","floating","htmlFor"],"mappings":";AAAA,SACEA,UAAU,QAIL,QAAQ;AAEf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,SAAS,QAAQ,uBAAuB;AAiFjD;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAAS,EACTC,OAAO,MAAM,EACbC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,eAAeD,iBAAiB,EAChCE,OAAOF,iBAAiB,EACxBG,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,sBAAsB,EACtBC,uBAAuB,EACvBC,UAAU,EACVC,cAAc,EACdC,KAAK,EACLC,kBAAkB,EAClBC,YAAY,EACZC,qBAAqB,EACrBC,cAAc,EACd,GAAGC,WACJ,GAAGhC;IACJ,MAAM,EAAEiC,QAAQ,EAAEC,QAAQ,EAAE,GAAGlC;IAC/B,MAAME,KAAKR,aAAaS,QAAQ;IAEhC,IAAI,EAAEgC,cAAc,EAAE,EAAE,GAAGnC;IAC3B,IAAIO,SAAS,CAAC4B,aAAa;QACzB,+DAA+D;QAC/DA,cAAc;IAChB;IAEA,qBACE,KAACxC;QACE,GAAGmC,qBAAqB;QACzBD,cACEA,gBAAgB;YACdd;YACAY;YACA,GAAGE,YAAY;QACjB;kBAGF,cAAA,MAAChC;YACE,GAAGkC,cAAc;YAClB3B,OAAOA;YACPC,WAAWA;YACXsB,OAAOA;YACPpB,OAAO,CAAC,CAACA;YACTQ,OAAOA;YACPD,OAAOA;YACPG,QAAQA;YACRD,QAAQA;YACRE,SAASA;YACTgB,UAAUA;YACVD,UAAUA;YACVd,WAAWA;YACXC,gBAAgBA;YAChBC,YAAYA;YACZC,iBAAiBA;YACjBM,oBAAoBA;YACpBL,wBAAwBA;YACxBC,yBAAyBA;;8BAEzB,KAACY;oBACE,GAAGJ,SAAS;oBACb9B,IAAIA;oBACJD,KAAKA;oBACLK,MAAMA;oBACNO,MAAMA;oBACNoB,UAAUA;oBACVE,aAAaA;oBACbvB,cAAcA;oBACdR,OAAOqB;oBACPpB,WAAWP,UAAU;wBACnBO,WAAWqB;wBACXW,mBAAmB,CAAC,CAAC9B,SAAS,CAACS;oBACjC;;gBAEDT,uBACC,KAACX;oBACC0C,QAAQ;oBACRxB,OAAOA;oBACPC,OAAOA;oBACPC,QAAQA;oBACRiB,UAAUA;oBACT,GAAGzB,UAAU;oBACd+B,SAASrC;oBACTE,OAAOI,YAAYJ,SAASK;oBAC5BJ,WAAWG,YAAYH,aAAaK;8BAEnCH;;;;;AAMb,GACA"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConfigurableTextFieldAddonProps } from "./types.js";
3
2
  /** @since 6.0.0 */
4
3
  export interface TextFieldAddonClassNameOptions {
@@ -34,9 +33,7 @@ export interface TextFieldAddonProps extends ConfigurableTextFieldAddonProps {
34
33
  disabled?: boolean;
35
34
  }
36
35
  /**
37
- * **Server Component**
38
- *
39
- * This component is used to add an an icon before or after the text field with
36
+ * This component is used to add an icon before or after the text field with
40
37
  * correct styling.
41
38
  */
42
39
  export declare const TextFieldAddon: import("react").ForwardRefExoticComponent<TextFieldAddonProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -17,9 +17,7 @@ const styles = bem("rmd-text-field-addon");
17
17
  }), className);
18
18
  }
19
19
  /**
20
- * **Server Component**
21
- *
22
- * This component is used to add an an icon before or after the text field with
20
+ * This component is used to add an icon before or after the text field with
23
21
  * correct styling.
24
22
  */ export const TextFieldAddon = /*#__PURE__*/ forwardRef(function TextFieldAddon(props, ref) {
25
23
  const { after, disabled, pointerEvents, children, className, ...remaining } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/TextFieldAddon.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef } from \"react\";\nimport { box } from \"../box/styles.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type ConfigurableTextFieldAddonProps } from \"./types.js\";\n\nconst styles = bem(\"rmd-text-field-addon\");\n\n/** @since 6.0.0 */\nexport interface TextFieldAddonClassNameOptions {\n className?: string;\n\n /**\n * @defaultValue `false`\n */\n after?: boolean;\n\n /**\n *\n * @defaultValue `true`\n */\n presentational?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textFieldAddon(\n options: TextFieldAddonClassNameOptions = {}\n): string {\n const { className, after, presentational } = options;\n\n return cnb(\n styles({\n before: !after,\n after,\n presentational,\n }),\n box({ disablePadding: true }),\n className\n );\n}\n\n/**\n * @since 6.0.0 Split props into `ConfigurableTextFieldAddonProps`\n */\nexport interface TextFieldAddonProps extends ConfigurableTextFieldAddonProps {\n /**\n * @defaultValue `false`\n */\n after?: boolean;\n\n /**\n * Set this to `true` if the addon should not be wrapped in a `<span>` with some\n * additional styles.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * This component is used to add an an icon before or after the text field with\n * correct styling.\n */\nexport const TextFieldAddon = forwardRef<HTMLSpanElement, TextFieldAddonProps>(\n function TextFieldAddon(props, ref) {\n const {\n after,\n disabled,\n pointerEvents,\n children,\n className,\n ...remaining\n } = props;\n\n if (!children) {\n return null;\n }\n\n if (disabled) {\n return <>{children}</>;\n }\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={textFieldAddon({\n after,\n presentational: !pointerEvents,\n className,\n })}\n >\n {children}\n </span>\n );\n }\n);\n"],"names":["cnb","forwardRef","box","bem","styles","textFieldAddon","options","className","after","presentational","before","disablePadding","TextFieldAddon","props","ref","disabled","pointerEvents","children","remaining","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAQ,QAAQ;AACnC,SAASC,GAAG,QAAQ,mBAAmB;AACvC,SAASC,GAAG,QAAQ,kBAAkB;AAGtC,MAAMC,SAASD,IAAI;AAkBnB;;CAEC,GACD,OAAO,SAASE,eACdC,UAA0C,CAAC,CAAC;IAE5C,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAEC,cAAc,EAAE,GAAGH;IAE7C,OAAON,IACLI,OAAO;QACLM,QAAQ,CAACF;QACTA;QACAC;IACF,IACAP,IAAI;QAAES,gBAAgB;IAAK,IAC3BJ;AAEJ;AAoBA;;;;;CAKC,GACD,OAAO,MAAMK,+BAAiBX,WAC5B,SAASW,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EACJN,KAAK,EACLO,QAAQ,EACRC,aAAa,EACbC,QAAQ,EACRV,SAAS,EACT,GAAGW,WACJ,GAAGL;IAEJ,IAAI,CAACI,UAAU;QACb,OAAO;IACT;IAEA,IAAIF,UAAU;QACZ,qBAAO;sBAAGE;;IACZ;IAEA,qBACE,KAACE;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLP,WAAWF,eAAe;YACxBG;YACAC,gBAAgB,CAACO;YACjBT;QACF;kBAECU;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/TextFieldAddon.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef } from \"react\";\nimport { box } from \"../box/styles.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type ConfigurableTextFieldAddonProps } from \"./types.js\";\n\nconst styles = bem(\"rmd-text-field-addon\");\n\n/** @since 6.0.0 */\nexport interface TextFieldAddonClassNameOptions {\n className?: string;\n\n /**\n * @defaultValue `false`\n */\n after?: boolean;\n\n /**\n *\n * @defaultValue `true`\n */\n presentational?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textFieldAddon(\n options: TextFieldAddonClassNameOptions = {}\n): string {\n const { className, after, presentational } = options;\n\n return cnb(\n styles({\n before: !after,\n after,\n presentational,\n }),\n box({ disablePadding: true }),\n className\n );\n}\n\n/**\n * @since 6.0.0 Split props into `ConfigurableTextFieldAddonProps`\n */\nexport interface TextFieldAddonProps extends ConfigurableTextFieldAddonProps {\n /**\n * @defaultValue `false`\n */\n after?: boolean;\n\n /**\n * Set this to `true` if the addon should not be wrapped in a `<span>` with some\n * additional styles.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/**\n * This component is used to add an icon before or after the text field with\n * correct styling.\n */\nexport const TextFieldAddon = forwardRef<HTMLSpanElement, TextFieldAddonProps>(\n function TextFieldAddon(props, ref) {\n const {\n after,\n disabled,\n pointerEvents,\n children,\n className,\n ...remaining\n } = props;\n\n if (!children) {\n return null;\n }\n\n if (disabled) {\n return <>{children}</>;\n }\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={textFieldAddon({\n after,\n presentational: !pointerEvents,\n className,\n })}\n >\n {children}\n </span>\n );\n }\n);\n"],"names":["cnb","forwardRef","box","bem","styles","textFieldAddon","options","className","after","presentational","before","disablePadding","TextFieldAddon","props","ref","disabled","pointerEvents","children","remaining","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAQ,QAAQ;AACnC,SAASC,GAAG,QAAQ,mBAAmB;AACvC,SAASC,GAAG,QAAQ,kBAAkB;AAGtC,MAAMC,SAASD,IAAI;AAkBnB;;CAEC,GACD,OAAO,SAASE,eACdC,UAA0C,CAAC,CAAC;IAE5C,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAEC,cAAc,EAAE,GAAGH;IAE7C,OAAON,IACLI,OAAO;QACLM,QAAQ,CAACF;QACTA;QACAC;IACF,IACAP,IAAI;QAAES,gBAAgB;IAAK,IAC3BJ;AAEJ;AAoBA;;;CAGC,GACD,OAAO,MAAMK,+BAAiBX,WAC5B,SAASW,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EACJN,KAAK,EACLO,QAAQ,EACRC,aAAa,EACbC,QAAQ,EACRV,SAAS,EACT,GAAGW,WACJ,GAAGL;IAEJ,IAAI,CAACI,UAAU;QACb,OAAO;IACT;IAEA,IAAIF,UAAU;QACZ,qBAAO;sBAAGE;;IACZ;IAEA,qBACE,KAACE;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLP,WAAWF,eAAe;YACxBG;YACAC,gBAAgB,CAACO;YACjBT;QACF;kBAECU;;AAGP,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/TextFieldContainer.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { TextFieldAddon } from \"./TextFieldAddon.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { textFieldContainer } from \"./textFieldContainerStyles.js\";\nimport { type TextFieldContainerOptions } from \"./types.js\";\n\nexport interface TextFieldContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n TextFieldContainerOptions {\n /**\n * Set this to `true` if there is a floating label with the `TextField` or\n * `TextArea`.\n *\n * @defaultValue `false`\n */\n label?: boolean;\n}\n\n/**\n * **Client Component**\n * This might be able to become a server component if I remove the useFormTheme hook\n *\n * This component is used to add the additional `TextField`, `TextArea`, and\n * `Select` theme styles.\n *\n * @internal\n */\nexport const TextFieldContainer = forwardRef<\n HTMLDivElement,\n TextFieldContainerProps\n>(function TextFieldContainer(props, ref) {\n const {\n children,\n className,\n dense = false,\n error = false,\n label = false,\n active = false,\n inline = false,\n stretch = false,\n readOnly = false,\n disabled = false,\n leftAddon,\n leftAddonProps,\n disableLeftAddonStyles = false,\n rightAddon,\n rightAddonProps,\n disableRightAddonStyles = false,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n ...remaining\n } = props;\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={textFieldContainer({\n theme,\n dense,\n error,\n label,\n inline,\n active,\n stretch,\n readOnly,\n disabled,\n className,\n leftAddon: !!leftAddon && !disableLeftAddonStyles,\n rightAddon: !!rightAddon && !disableRightAddonStyles,\n underlineDirection,\n })}\n >\n <TextFieldAddon {...leftAddonProps} disabled={disableLeftAddonStyles}>\n {leftAddon}\n </TextFieldAddon>\n {children}\n <TextFieldAddon\n {...rightAddonProps}\n disabled={disableRightAddonStyles}\n after\n >\n {rightAddon}\n </TextFieldAddon>\n </div>\n );\n});\n"],"names":["forwardRef","TextFieldAddon","getFormConfig","textFieldContainer","TextFieldContainer","props","ref","children","className","dense","error","label","active","inline","stretch","readOnly","disabled","leftAddon","leftAddonProps","disableLeftAddonStyles","rightAddon","rightAddonProps","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","remaining","div","after"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,QAA6B,QAAQ;AACxD,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,kBAAkB,QAAQ,gCAAgC;AAenE;;;;;;;;CAQC,GACD,OAAO,MAAMC,mCAAqBJ,WAGhC,SAASI,mBAAmBC,KAAK,EAAEC,GAAG;IACtC,MAAM,EACJC,QAAQ,EACRC,SAAS,EACTC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,SAAS,KAAK,EACdC,UAAU,KAAK,EACfC,WAAW,KAAK,EAChBC,WAAW,KAAK,EAChBC,SAAS,EACTC,cAAc,EACdC,yBAAyB,KAAK,EAC9BC,UAAU,EACVC,eAAe,EACfC,0BAA0B,KAAK,EAC/BC,OAAOC,SAAS,EAChBC,oBAAoBC,sBAAsB,EAC1C,GAAGC,WACJ,GAAGtB;IACJ,MAAMkB,QAAQrB,cAAc,SAASsB;IACrC,MAAMC,qBAAqBvB,cACzB,sBACAwB;IAGF,qBACE,MAACE;QACE,GAAGD,SAAS;QACbrB,KAAKA;QACLE,WAAWL,mBAAmB;YAC5BoB;YACAd;YACAC;YACAC;YACAE;YACAD;YACAE;YACAC;YACAC;YACAR;YACAS,WAAW,CAAC,CAACA,aAAa,CAACE;YAC3BC,YAAY,CAAC,CAACA,cAAc,CAACE;YAC7BG;QACF;;0BAEA,KAACxB;gBAAgB,GAAGiB,cAAc;gBAAEF,UAAUG;0BAC3CF;;YAEFV;0BACD,KAACN;gBACE,GAAGoB,eAAe;gBACnBL,UAAUM;gBACVO,KAAK;0BAEJT;;;;AAIT,GAAG"}
1
+ {"version":3,"sources":["../../src/form/TextFieldContainer.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { TextFieldAddon } from \"./TextFieldAddon.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { textFieldContainer } from \"./textFieldContainerStyles.js\";\nimport { type TextFieldContainerOptions } from \"./types.js\";\n\nexport interface TextFieldContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n TextFieldContainerOptions {\n /**\n * Set this to `true` if there is a floating label with the `TextField` or\n * `TextArea`.\n *\n * @defaultValue `false`\n */\n label?: boolean;\n}\n\n/**\n * **Client Component**\n * This might be able to become a server component if I remove the useFormTheme hook\n *\n * This component is used to add the additional `TextField`, `TextArea`, and\n * `Select` theme styles.\n *\n * @internal\n */\nexport const TextFieldContainer = forwardRef<\n HTMLDivElement,\n TextFieldContainerProps\n>(function TextFieldContainer(props, ref) {\n const {\n children,\n className,\n dense = false,\n error = false,\n label = false,\n active = false,\n inline = false,\n stretch = false,\n readOnly = false,\n disabled = false,\n leftAddon,\n leftAddonProps,\n disableLeftAddonStyles = false,\n rightAddon,\n rightAddonProps,\n disableRightAddonStyles = false,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n ...remaining\n } = props;\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={textFieldContainer({\n theme,\n dense,\n error,\n label,\n inline,\n active,\n stretch,\n readOnly,\n disabled,\n className,\n leftAddon: !!leftAddon && !disableLeftAddonStyles,\n rightAddon: !!rightAddon && !disableRightAddonStyles,\n underlineDirection,\n })}\n >\n <TextFieldAddon {...leftAddonProps} disabled={disableLeftAddonStyles}>\n {leftAddon}\n </TextFieldAddon>\n {children}\n <TextFieldAddon\n {...rightAddonProps}\n disabled={disableRightAddonStyles}\n after\n >\n {rightAddon}\n </TextFieldAddon>\n </div>\n );\n});\n"],"names":["forwardRef","TextFieldAddon","getFormConfig","textFieldContainer","TextFieldContainer","props","ref","children","className","dense","error","label","active","inline","stretch","readOnly","disabled","leftAddon","leftAddonProps","disableLeftAddonStyles","rightAddon","rightAddonProps","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","remaining","div","after"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAA6B,QAAQ;AACxD,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,kBAAkB,QAAQ,gCAAgC;AAenE;;;;;;;;CAQC,GACD,OAAO,MAAMC,mCAAqBJ,WAGhC,SAASI,mBAAmBC,KAAK,EAAEC,GAAG;IACtC,MAAM,EACJC,QAAQ,EACRC,SAAS,EACTC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,SAAS,KAAK,EACdC,UAAU,KAAK,EACfC,WAAW,KAAK,EAChBC,WAAW,KAAK,EAChBC,SAAS,EACTC,cAAc,EACdC,yBAAyB,KAAK,EAC9BC,UAAU,EACVC,eAAe,EACfC,0BAA0B,KAAK,EAC/BC,OAAOC,SAAS,EAChBC,oBAAoBC,sBAAsB,EAC1C,GAAGC,WACJ,GAAGtB;IACJ,MAAMkB,QAAQrB,cAAc,SAASsB;IACrC,MAAMC,qBAAqBvB,cACzB,sBACAwB;IAGF,qBACE,MAACE;QACE,GAAGD,SAAS;QACbrB,KAAKA;QACLE,WAAWL,mBAAmB;YAC5BoB;YACAd;YACAC;YACAC;YACAE;YACAD;YACAE;YACAC;YACAC;YACAR;YACAS,WAAW,CAAC,CAACA,aAAa,CAACE;YAC3BC,YAAY,CAAC,CAACA,cAAc,CAACE;YAC7BG;QACF;;0BAEA,KAACxB;gBAAgB,GAAGiB,cAAc;gBAAEF,UAAUG;0BAC3CF;;YAEFV;0BACD,KAACN;gBACE,GAAGoB,eAAe;gBACnBL,UAAUM;gBACVO,KAAK;0BAEJT;;;;AAIT,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/fileUtils.ts"],"sourcesContent":["import { nanoid } from \"nanoid\";\nimport { type ChangeEventHandler, type DragEventHandler } from \"react\";\n\n/** @since 2.9.0 */\nexport interface BaseFileUploadStats {\n /**\n * A unique key associated with each upload generated by `nanoid`.\n */\n key: string;\n\n /**\n * The file instance that is being uploaded.\n */\n file: File;\n\n /**\n * The current upload progress as a percentage from 0 - 100 percent.\n */\n progress: number;\n}\n\n/** @since 2.9.0 */\nexport interface ProcessingFileUploadStats extends BaseFileUploadStats {\n status: \"pending\" | \"uploading\";\n}\n\n/** @since 2.9.0 */\nexport type FileReaderResult = FileReader[\"result\"];\n\n/** @since 2.9.0 */\nexport interface CompletedFileUploadStats extends BaseFileUploadStats {\n status: \"complete\";\n\n /**\n * The result after a `FileReader` has read a file completely.\n *\n * Note: This _should_ be an `ArrayBuffer` if the next step is to upload to a\n * server.\n *\n * @see {@link FileReaderParser}\n * @see {@link getFileParser}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/FileReader | FileReader}\n */\n result: FileReaderResult;\n}\n\n/** @since 2.9.0 */\nexport type FileUploadStats =\n | ProcessingFileUploadStats\n | CompletedFileUploadStats;\n\n/** @since 2.9.0 */\nexport type FileUploadStatus = FileUploadStats[\"status\"];\n\n/** @since 2.9.0 */\nexport interface FileUploadHandlers<E extends HTMLElement> {\n onDrop?: DragEventHandler<E>;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n}\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 {}>(\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 {}>(\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 {}>(\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 {}>(\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 {}>(\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/** @since 2.9.0 */\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 {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n }: FilesValidationOptions\n): ValidatedFilesResult<CustomError> {\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\n/**\n * This will first check if the mime-type of the file starts with `text/` and\n * fallback to checking a few file names or extensions that should be considered\n * text.\n *\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file should be considered as a text-content file.\n * @since 2.9.0\n */\nexport function isTextFile(file: File): boolean {\n return /\\.((j|t)sx?|json|lock|hbs|ya?ml|log|txt|md)$/i.test(file.name);\n}\n\n/**\n * This will first check if the mime-type of the file starts with `text\\/` and\n * fallback to checking a few file names or extensions that should be considered\n * text.\n *\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file should be considered as a text content file.\n * @since 2.9.0\n */\nexport function isImageFile(file: File): boolean {\n return /\\.(a?png|avif|svg|tiff|gifv?|jpe?g)/i.test(file.name);\n}\n\n/**\n * This will first check if the mime-type of the file starts with `audio/` and\n * fallback to checking a few file names or extensions that should be considered\n * audio.\n *\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file should be considered as a audio content file.\n * @since 2.9.0\n */\nexport function isAudioFile(file: File): boolean {\n return /\\.(mp3|wav|ogg|m4p|flac)$/i.test(file.name);\n}\n\n/**\n * This will first check if the mime-type of the file starts with `video/` and\n * fallback to checking a few file names or extensions that should be considered\n * video.\n *\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file should be considered as a video content file.\n * @since 2.9.0\n */\nexport function isVideoFile(file: File): boolean {\n return /\\.(mkv|mpe?g|mov|avi|flv|webm|mp4)$/i.test(file.name);\n}\n\n/**\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file matches an image, audio, or video file.\n * @since 2.9.0\n */\nexport function isMediaFile(file: File): boolean {\n return isImageFile(file) || isAudioFile(file) || isVideoFile(file);\n}\n\n/**\n * One of the function names from a `FileReader` to upload a file to the\n * client.\n *\n * Note: If this file does not need to be previewed in the browser and will\n * immediately be uploaded to a server, use `readAsArrayBuffer`.\n *\n * @since 2.9.0\n */\nexport type FileReaderParser =\n | \"readAsText\"\n | \"readAsDataURL\"\n | \"readAsBinaryString\"\n | \"readAsArrayBuffer\";\n\n/**\n * A function that should return one of the {@link FileReaderParser} functions\n * to start uploading a file to the browser.\n *\n * @example The Default File Upload Parser\n * ```ts\n * export const getFileParser: GetFileParser = (file) => {\n * if (isMediaFile(file)) {\n * return \"readAsDataURL\";\n * }\n *\n * if (isTextFile(file)) {\n * return \"readAsText\";\n * }\n *\n * return \"readAsArrayBuffer\";\n * };\n * ```\n *\n * @param file - The file to get a parser for\n * @returns the {@link FileReaderParser} string.\n * @since 2.9.0\n */\nexport type GetFileParser = (file: File) => FileReaderParser;\n\n/**\n * This function will attempt to read:\n * - media (image, audio, and video) files as a data url so they can be\n * previewed in `<img>`, `<audio>`, and `<video>` tags\n * - text files as plain text\n * - everything else as an `ArrayBuffer` which can be manually converted into a\n * data url if needed with `URL.createObjectURL`\n *\n * @since 2.9.0\n */\nexport const getFileParser: GetFileParser = (file) => {\n if (isMediaFile(file)) {\n return \"readAsDataURL\";\n }\n\n if (isTextFile(file)) {\n return \"readAsText\";\n }\n\n return \"readAsArrayBuffer\";\n};\n\n/** @since 2.9.0 */\nexport interface SplitFileUploads {\n readonly pending: readonly ProcessingFileUploadStats[];\n readonly uploading: readonly ProcessingFileUploadStats[];\n readonly complete: readonly CompletedFileUploadStats[];\n}\n\n/**\n * This util will split all the current upload stats by status.\n *\n * @param stats - The {@link FileUploadStats} list generally returned by the\n * {@link useFileUpload} hook.\n * @returns the {@link SplitFileUploads}.\n * @since 2.9.0\n */\nexport function getSplitFileUploads(\n stats: readonly FileUploadStats[]\n): SplitFileUploads {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n const complete: CompletedFileUploadStats[] = [];\n stats.forEach((stat) => {\n if (stat.status === \"pending\") {\n pending.push(stat);\n } else if (stat.status === \"uploading\") {\n uploading.push(stat);\n } else if (stat.status === \"complete\") {\n complete.push(stat);\n } else {\n /* istanbul ignore next */\n throw new Error(\"Invalid upload stat\");\n }\n });\n\n return { pending, uploading, complete };\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","maxFiles","minFileSize","maxFileSize","totalBytes","totalFiles","totalFileSize","errors","pending","extraFiles","extensionRegExp","length","RegExp","join","undefined","maxFilesReached","remainingBytes","extensionErrors","minErrors","maxErrors","totalSizeErrors","i","valid","size","push","isTextFile","isImageFile","isAudioFile","isVideoFile","isMediaFile","getFileParser","getSplitFileUploads","stats","uploading","complete","forEach","stat","status"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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OAAO,IAAIA,KAAKC,MAAM,KAAK,YAAY;YACrCH,SAASV,IAAI,CAACY;QAChB,OAAO;YACL,wBAAwB,GACxB,MAAM,IAAI5D,MAAM;QAClB;IACF;IAEA,OAAO;QAAEgC;QAASyB;QAAWC;IAAS;AACxC"}
1
+ {"version":3,"sources":["../../src/form/fileUtils.ts"],"sourcesContent":["import { nanoid } from \"nanoid\";\nimport { type ChangeEventHandler, type DragEventHandler } from \"react\";\n\n/** @since 2.9.0 */\nexport interface BaseFileUploadStats {\n /**\n * A unique key associated with each upload generated by `nanoid`.\n */\n key: string;\n\n /**\n * The file instance that is being uploaded.\n */\n file: File;\n\n /**\n * The current upload progress as a percentage from 0 - 100 percent.\n */\n progress: number;\n}\n\n/** @since 2.9.0 */\nexport interface ProcessingFileUploadStats extends BaseFileUploadStats {\n status: \"pending\" | \"uploading\";\n}\n\n/** @since 2.9.0 */\nexport type FileReaderResult = FileReader[\"result\"];\n\n/** @since 2.9.0 */\nexport interface CompletedFileUploadStats extends BaseFileUploadStats {\n status: \"complete\";\n\n /**\n * The result after a `FileReader` has read a file completely.\n *\n * Note: This _should_ be an `ArrayBuffer` if the next step is to upload to a\n * server.\n *\n * @see {@link FileReaderParser}\n * @see {@link getFileParser}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/FileReader | FileReader}\n */\n result: FileReaderResult;\n}\n\n/** @since 2.9.0 */\nexport type FileUploadStats =\n | ProcessingFileUploadStats\n | CompletedFileUploadStats;\n\n/** @since 2.9.0 */\nexport type FileUploadStatus = FileUploadStats[\"status\"];\n\n/** @since 2.9.0 */\nexport interface FileUploadHandlers<E extends HTMLElement> {\n onDrop?: DragEventHandler<E>;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n}\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 {}>(\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 {}>(\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 {}>(\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 {}>(\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 {}>(\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/** @since 2.9.0 */\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 {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n }: FilesValidationOptions\n): ValidatedFilesResult<CustomError> {\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\n/**\n * This will first check if the mime-type of the file starts with `text/` and\n * fallback to checking a few file names or extensions that should be considered\n * text.\n *\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file should be considered as a text-content file.\n * @since 2.9.0\n */\nexport function isTextFile(file: File): boolean {\n return /\\.((j|t)sx?|json|lock|hbs|ya?ml|log|txt|md)$/i.test(file.name);\n}\n\n/**\n * This will first check if the mime-type of the file starts with `text\\/` and\n * fallback to checking a few file names or extensions that should be considered\n * text.\n *\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file should be considered as a text content file.\n * @since 2.9.0\n */\nexport function isImageFile(file: File): boolean {\n return /\\.(a?png|avif|svg|tiff|gifv?|jpe?g)/i.test(file.name);\n}\n\n/**\n * This will first check if the mime-type of the file starts with `audio/` and\n * fallback to checking a few file names or extensions that should be considered\n * audio.\n *\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file should be considered as a audio content file.\n * @since 2.9.0\n */\nexport function isAudioFile(file: File): boolean {\n return /\\.(mp3|wav|ogg|m4p|flac)$/i.test(file.name);\n}\n\n/**\n * This will first check if the mime-type of the file starts with `video/` and\n * fallback to checking a few file names or extensions that should be considered\n * video.\n *\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file should be considered as a video content file.\n * @since 2.9.0\n */\nexport function isVideoFile(file: File): boolean {\n return /\\.(mkv|mpe?g|mov|avi|flv|webm|mp4)$/i.test(file.name);\n}\n\n/**\n * This function is not guaranteed to be 100% correct and is only useful if\n * trying to generate a preview of files uploaded to the browser.\n *\n * @param file - The file to check\n * @returns `true` if the file matches an image, audio, or video file.\n * @since 2.9.0\n */\nexport function isMediaFile(file: File): boolean {\n return isImageFile(file) || isAudioFile(file) || isVideoFile(file);\n}\n\n/**\n * One of the function names from a `FileReader` to upload a file to the\n * client.\n *\n * Note: If this file does not need to be previewed in the browser and will\n * immediately be uploaded to a server, use `readAsArrayBuffer`.\n *\n * @since 2.9.0\n */\nexport type FileReaderParser =\n | \"readAsText\"\n | \"readAsDataURL\"\n | \"readAsBinaryString\"\n | \"readAsArrayBuffer\";\n\n/**\n * A function that should return one of the {@link FileReaderParser} functions\n * to start uploading a file to the browser.\n *\n * @example The Default File Upload Parser\n * ```ts\n * export const getFileParser: GetFileParser = (file) => {\n * if (isMediaFile(file)) {\n * return \"readAsDataURL\";\n * }\n *\n * if (isTextFile(file)) {\n * return \"readAsText\";\n * }\n *\n * return \"readAsArrayBuffer\";\n * };\n * ```\n *\n * @param file - The file to get a parser for\n * @returns the {@link FileReaderParser} string.\n * @since 2.9.0\n */\nexport type GetFileParser = (file: File) => FileReaderParser;\n\n/**\n * This function will attempt to read:\n * - media (image, audio, and video) files as a data url so they can be\n * previewed in `<img>`, `<audio>`, and `<video>` tags\n * - text files as plain text\n * - everything else as an `ArrayBuffer` which can be manually converted into a\n * data url if needed with `URL.createObjectURL`\n *\n * @since 2.9.0\n */\nexport const getFileParser: GetFileParser = (file) => {\n if (isMediaFile(file)) {\n return \"readAsDataURL\";\n }\n\n if (isTextFile(file)) {\n return \"readAsText\";\n }\n\n return \"readAsArrayBuffer\";\n};\n\n/** @since 2.9.0 */\nexport interface SplitFileUploads {\n readonly pending: readonly ProcessingFileUploadStats[];\n readonly uploading: readonly ProcessingFileUploadStats[];\n readonly complete: readonly CompletedFileUploadStats[];\n}\n\n/**\n * This util will split all the current upload stats by status.\n *\n * @param stats - The {@link FileUploadStats} list generally returned by the\n * {@link useFileUpload} hook.\n * @returns the {@link SplitFileUploads}.\n * @since 2.9.0\n */\nexport function getSplitFileUploads(\n stats: readonly FileUploadStats[]\n): SplitFileUploads {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n const complete: CompletedFileUploadStats[] = [];\n stats.forEach((stat) => {\n if (stat.status === \"pending\") {\n pending.push(stat);\n } else if (stat.status === \"uploading\") {\n uploading.push(stat);\n } else if (stat.status === \"complete\") {\n complete.push(stat);\n } else {\n /* istanbul ignore next */\n throw new Error(\"Invalid upload stat\");\n }\n });\n\n return { pending, uploading, complete };\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","maxFiles","minFileSize","maxFileSize","totalBytes","totalFiles","totalFileSize","errors","pending","extraFiles","extensionRegExp","length","RegExp","join","undefined","maxFilesReached","remainingBytes","extensionErrors","minErrors","maxErrors","totalSizeErrors","i","valid","size","push","isTextFile","isImageFile","isAudioFile","isVideoFile","isMediaFile","getFileParser","getSplitFileUploads","stats","uploading","complete","forEach","stat","status"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,MAAM,QAAQ,SAAS;AA4DhC;;;;;;CAMC,GACD,OAAO,MAAMC,wBAAwBC;IAMnC;;;GAGC,GACDC,YAAYC,OAAgB,CAAE;QAC5B,KAAK,CAACA;QAVR;;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;;;QAdR;;GAEC,GACD,uBAAOJ,OAAP,KAAA;aAQSG,QAAAA;aACAC,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;;aAFNG,QAAAA;QAGP,IAAI,CAACL,IAAI,GAAG;IACd;AACF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AO;AACT,EAAE;AASF;;;;;;;CAOC,GACD,OAAO,SAASkC,oBACdC,KAAiC;IAEjC,MAAMxB,UAAuC,EAAE;IAC/C,MAAMyB,YAAyC,EAAE;IACjD,MAAMC,WAAuC,EAAE;IAC/CF,MAAMG,OAAO,CAAC,CAACC;QACb,IAAIA,KAAKC,MAAM,KAAK,WAAW;YAC7B7B,QAAQgB,IAAI,CAACY;QACf,OAAO,IAAIA,KAAKC,MAAM,KAAK,aAAa;YACtCJ,UAAUT,IAAI,CAACY;QACjB,OAAO,IAAIA,KAAKC,MAAM,KAAK,YAAY;YACrCH,SAASV,IAAI,CAACY;QAChB,OAAO;YACL,wBAAwB,GACxB,MAAM,IAAI5D,MAAM;QAClB;IACF;IAEA,OAAO;QAAEgC;QAASyB;QAAWC;IAAS;AACxC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/formConfig.ts"],"sourcesContent":["import { type FormConfiguration } from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport const FORM_CONFIG: FormConfiguration = {\n theme: \"outline\",\n underlineDirection: \"left\",\n uncontrolledToggles: true,\n};\n\n/**\n * @since 6.0.0\n */\nexport function getFormConfig<N extends keyof FormConfiguration>(\n name: N,\n override?: FormConfiguration[N]\n): FormConfiguration[N] {\n if (typeof override !== \"undefined\") {\n return override;\n }\n\n return FORM_CONFIG[name];\n}\n"],"names":["FORM_CONFIG","theme","underlineDirection","uncontrolledToggles","getFormConfig","name","override"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAEA;;CAEC,GACD,OAAO,MAAMA,cAAiC;IAC5CC,OAAO;IACPC,oBAAoB;IACpBC,qBAAqB;AACvB,EAAE;AAEF;;CAEC,GACD,OAAO,SAASC,cACdC,IAAO,EACPC,QAA+B;IAE/B,IAAI,OAAOA,aAAa,aAAa;QACnC,OAAOA;IACT;IAEA,OAAON,WAAW,CAACK,KAAK;AAC1B"}
1
+ {"version":3,"sources":["../../src/form/formConfig.ts"],"sourcesContent":["import { type FormConfiguration } from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport const FORM_CONFIG: FormConfiguration = {\n theme: \"outline\",\n underlineDirection: \"left\",\n uncontrolledToggles: true,\n};\n\n/**\n * @since 6.0.0\n */\nexport function getFormConfig<N extends keyof FormConfiguration>(\n name: N,\n override?: FormConfiguration[N]\n): FormConfiguration[N] {\n if (typeof override !== \"undefined\") {\n return override;\n }\n\n return FORM_CONFIG[name];\n}\n"],"names":["FORM_CONFIG","theme","underlineDirection","uncontrolledToggles","getFormConfig","name","override"],"mappings":"AAEA;;CAEC,GACD,OAAO,MAAMA,cAAiC;IAC5CC,OAAO;IACPC,oBAAoB;IACpBC,qBAAqB;AACvB,EAAE;AAEF;;CAEC,GACD,OAAO,SAASC,cACdC,IAAO,EACPC,QAA+B;IAE/B,IAAI,OAAOA,aAAa,aAAa;QACnC,OAAOA;IACT;IAEA,OAAON,WAAW,CAACK,KAAK;AAC1B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/formMessageStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type FormMessageClassNameOptions } from \"./types.js\";\n\nconst styles = bem(\"rmd-form-message\");\n\n/**\n * @since 6.0.0\n */\nexport function formMessage(options: FormMessageClassNameOptions = {}): string {\n const { className, error = false, theme = \"none\" } = options;\n\n return cnb(\n styles({ [theme]: theme !== \"none\" }),\n cssUtils({ textColor: error ? \"error\" : \"text-secondary\" }),\n className\n );\n}\n\n/** @since 6.0.0 */\nexport interface FormMessageTextClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function formMessageText(\n options: FormMessageTextClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"message\"), className);\n}\n\n/** @since 6.0.0 */\nexport interface FormMessageCounterClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function formMessageCounter(\n options: FormMessageCounterClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"counter\"), className);\n}\n"],"names":["cnb","cssUtils","bem","styles","formMessage","options","className","error","theme","textColor","formMessageText","formMessageCounter"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,kBAAkB;AAGtC,MAAMC,SAASD,IAAI;AAEnB;;CAEC,GACD,OAAO,SAASE,YAAYC,UAAuC,CAAC,CAAC;IACnE,MAAM,EAAEC,SAAS,EAAEC,QAAQ,KAAK,EAAEC,QAAQ,MAAM,EAAE,GAAGH;IAErD,OAAOL,IACLG,OAAO;QAAE,CAACK,MAAM,EAAEA,UAAU;IAAO,IACnCP,SAAS;QAAEQ,WAAWF,QAAQ,UAAU;IAAiB,IACzDD;AAEJ;AAOA;;CAEC,GACD,OAAO,SAASI,gBACdL,UAA2C,CAAC,CAAC;IAE7C,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOL,IAAIG,OAAO,YAAYG;AAChC;AAOA;;CAEC,GACD,OAAO,SAASK,mBACdN,UAA8C,CAAC,CAAC;IAEhD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOL,IAAIG,OAAO,YAAYG;AAChC"}
1
+ {"version":3,"sources":["../../src/form/formMessageStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type FormMessageClassNameOptions } from \"./types.js\";\n\nconst styles = bem(\"rmd-form-message\");\n\n/**\n * @since 6.0.0\n */\nexport function formMessage(options: FormMessageClassNameOptions = {}): string {\n const { className, error = false, theme = \"none\" } = options;\n\n return cnb(\n styles({ [theme]: theme !== \"none\" }),\n cssUtils({ textColor: error ? \"error\" : \"text-secondary\" }),\n className\n );\n}\n\n/** @since 6.0.0 */\nexport interface FormMessageTextClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function formMessageText(\n options: FormMessageTextClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"message\"), className);\n}\n\n/** @since 6.0.0 */\nexport interface FormMessageCounterClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function formMessageCounter(\n options: FormMessageCounterClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"counter\"), className);\n}\n"],"names":["cnb","cssUtils","bem","styles","formMessage","options","className","error","theme","textColor","formMessageText","formMessageCounter"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,kBAAkB;AAGtC,MAAMC,SAASD,IAAI;AAEnB;;CAEC,GACD,OAAO,SAASE,YAAYC,UAAuC,CAAC,CAAC;IACnE,MAAM,EAAEC,SAAS,EAAEC,QAAQ,KAAK,EAAEC,QAAQ,MAAM,EAAE,GAAGH;IAErD,OAAOL,IACLG,OAAO;QAAE,CAACK,MAAM,EAAEA,UAAU;IAAO,IACnCP,SAAS;QAAEQ,WAAWF,QAAQ,UAAU;IAAiB,IACzDD;AAEJ;AAOA;;CAEC,GACD,OAAO,SAASI,gBACdL,UAA2C,CAAC,CAAC;IAE7C,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOL,IAAIG,OAAO,YAAYG;AAChC;AAOA;;CAEC,GACD,OAAO,SAASK,mBACdN,UAA8C,CAAC,CAAC;IAEhD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOL,IAAIG,OAAO,YAAYG;AAChC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/inputToggleStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type FormComponentStates } from \"./types.js\";\n\nconst styles = bem(\"rmd-input-toggle\");\n\n/**\n * The size to use for the `Checkbox` or `Radio` component. Each of these values\n * except for `\"auto\"` map to Sass variables:\n * - `\"small\"` - `$input-toggle-small-size`\n * - `\"dense\"` - `$input-toggle-dense-size`\n * - `\"normal\"` - `$input-toggle-large-size`\n * - `\"large\"` - `$input-toggle-large-size`\n *\n * When this is set to `\"auto\"`, the size will be determined by the current\n * `font-size` of the `Label` element.\n *\n * @since 6.0.0\n */\nexport type InputToggleSize = \"auto\" | \"small\" | \"dense\" | \"normal\" | \"large\";\n\n/** @since 6.0.0 */\nexport interface InputToggleClassNameOptions\n extends Omit<FormComponentStates, \"readOnly\"> {\n className?: string;\n type: \"checkbox\" | \"radio\";\n\n /**\n * Set the icon size to `1em` to allow easy sizing through font size.\n *\n * @defaultValue `true`\n */\n em?: boolean;\n\n /**\n * @see {@link InputToggleSize}\n * @defaultValue `\"auto\"`\n */\n size?: InputToggleSize;\n\n uncontrolled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function inputToggle(options: InputToggleClassNameOptions): string {\n const {\n className,\n em = true,\n type,\n size = \"auto\",\n error,\n active = false,\n disabled = false,\n uncontrolled,\n } = options;\n\n return cnb(\n `rmd-${type}`,\n styles({\n em,\n active: active && !disabled,\n disabled,\n small: size === \"small\",\n dense: size === \"dense\",\n normal: size === \"normal\",\n large: size === \"large\",\n uncontrolled,\n }),\n cssUtils({\n textColor: disabled ? \"text-disabled\" : error ? \"error\" : undefined,\n }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","inputToggle","options","className","em","type","size","error","active","disabled","uncontrolled","small","dense","normal","large","textColor","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,kBAAkB;AAGtC,MAAMC,SAASD,IAAI;AAuCnB;;CAEC,GACD,OAAO,SAASE,YAAYC,OAAoC;IAC9D,MAAM,EACJC,SAAS,EACTC,KAAK,IAAI,EACTC,IAAI,EACJC,OAAO,MAAM,EACbC,KAAK,EACLC,SAAS,KAAK,EACdC,WAAW,KAAK,EAChBC,YAAY,EACb,GAAGR;IAEJ,OAAOL,IACL,CAAC,IAAI,EAAEQ,KAAK,CAAC,EACbL,OAAO;QACLI;QACAI,QAAQA,UAAU,CAACC;QACnBA;QACAE,OAAOL,SAAS;QAChBM,OAAON,SAAS;QAChBO,QAAQP,SAAS;QACjBQ,OAAOR,SAAS;QAChBI;IACF,IACAZ,SAAS;QACPiB,WAAWN,WAAW,kBAAkBF,QAAQ,UAAUS;IAC5D,IACAb;AAEJ"}
1
+ {"version":3,"sources":["../../src/form/inputToggleStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type FormComponentStates } from \"./types.js\";\n\nconst styles = bem(\"rmd-input-toggle\");\n\n/**\n * The size to use for the `Checkbox` or `Radio` component. Each of these values\n * except for `\"auto\"` map to Sass variables:\n * - `\"small\"` - `$input-toggle-small-size`\n * - `\"dense\"` - `$input-toggle-dense-size`\n * - `\"normal\"` - `$input-toggle-large-size`\n * - `\"large\"` - `$input-toggle-large-size`\n *\n * When this is set to `\"auto\"`, the size will be determined by the current\n * `font-size` of the `Label` element.\n *\n * @since 6.0.0\n */\nexport type InputToggleSize = \"auto\" | \"small\" | \"dense\" | \"normal\" | \"large\";\n\n/** @since 6.0.0 */\nexport interface InputToggleClassNameOptions\n extends Omit<FormComponentStates, \"readOnly\"> {\n className?: string;\n type: \"checkbox\" | \"radio\";\n\n /**\n * Set the icon size to `1em` to allow easy sizing through font size.\n *\n * @defaultValue `true`\n */\n em?: boolean;\n\n /**\n * @see {@link InputToggleSize}\n * @defaultValue `\"auto\"`\n */\n size?: InputToggleSize;\n\n uncontrolled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function inputToggle(options: InputToggleClassNameOptions): string {\n const {\n className,\n em = true,\n type,\n size = \"auto\",\n error,\n active = false,\n disabled = false,\n uncontrolled,\n } = options;\n\n return cnb(\n `rmd-${type}`,\n styles({\n em,\n active: active && !disabled,\n disabled,\n small: size === \"small\",\n dense: size === \"dense\",\n normal: size === \"normal\",\n large: size === \"large\",\n uncontrolled,\n }),\n cssUtils({\n textColor: disabled ? \"text-disabled\" : error ? \"error\" : undefined,\n }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","inputToggle","options","className","em","type","size","error","active","disabled","uncontrolled","small","dense","normal","large","textColor","undefined"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,kBAAkB;AAGtC,MAAMC,SAASD,IAAI;AAuCnB;;CAEC,GACD,OAAO,SAASE,YAAYC,OAAoC;IAC9D,MAAM,EACJC,SAAS,EACTC,KAAK,IAAI,EACTC,IAAI,EACJC,OAAO,MAAM,EACbC,KAAK,EACLC,SAAS,KAAK,EACdC,WAAW,KAAK,EAChBC,YAAY,EACb,GAAGR;IAEJ,OAAOL,IACL,CAAC,IAAI,EAAEQ,KAAK,CAAC,EACbL,OAAO;QACLI;QACAI,QAAQA,UAAU,CAACC;QACnBA;QACAE,OAAOL,SAAS;QAChBM,OAAON,SAAS;QAChBO,QAAQP,SAAS;QACjBQ,OAAOR,SAAS;QAChBI;IACF,IACAZ,SAAS;QACPiB,WAAWN,WAAW,kBAAkBF,QAAQ,UAAUS;IAC5D,IACAb;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/menuItemInputToggleStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-menu-item-input-toggle\");\n\n/** @since 6.0.0 */\nexport interface MenuItemInputToggleClassNameOptions {\n className?: string;\n type: \"radio\" | \"checkbox\" | \"switch\";\n}\n\n/**\n * @since 6.0.0\n */\nexport function menuItemInputToggle(\n options: MenuItemInputToggleClassNameOptions\n): string {\n const { className, type } = options;\n return cnb(\n `rmd-${type}-menu-item`,\n styles({ switch: type === \"switch\" }),\n className\n );\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemInputToggleTrackClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function menuItemInputToggleTrack(\n options: MenuItemInputToggleTrackClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"track\"), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemInputToggleBallClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function menuItemInputToggleBall(\n options: MenuItemInputToggleBallClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"ball\"), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemInputToggleIconClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function menuItemInputToggleIcon(\n options: MenuItemInputToggleIconClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"icon\"), className);\n}\n"],"names":["cnb","bem","styles","menuItemInputToggle","options","className","type","switch","menuItemInputToggleTrack","menuItemInputToggleBall","menuItemInputToggleIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAQnB;;CAEC,GACD,OAAO,SAASE,oBACdC,OAA4C;IAE5C,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAE,GAAGF;IAC5B,OAAOJ,IACL,CAAC,IAAI,EAAEM,KAAK,UAAU,CAAC,EACvBJ,OAAO;QAAEK,QAAQD,SAAS;IAAS,IACnCD;AAEJ;AASA;;CAEC,GACD,OAAO,SAASG,yBACdJ,UAAoD,CAAC,CAAC;IAEtD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,UAAUG;AAC9B;AASA;;CAEC,GACD,OAAO,SAASI,wBACdL,UAAmD,CAAC,CAAC;IAErD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,SAASG;AAC7B;AASA;;CAEC,GACD,OAAO,SAASK,wBACdN,UAAmD,CAAC,CAAC;IAErD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,SAASG;AAC7B"}
1
+ {"version":3,"sources":["../../src/form/menuItemInputToggleStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-menu-item-input-toggle\");\n\n/** @since 6.0.0 */\nexport interface MenuItemInputToggleClassNameOptions {\n className?: string;\n type: \"radio\" | \"checkbox\" | \"switch\";\n}\n\n/**\n * @since 6.0.0\n */\nexport function menuItemInputToggle(\n options: MenuItemInputToggleClassNameOptions\n): string {\n const { className, type } = options;\n return cnb(\n `rmd-${type}-menu-item`,\n styles({ switch: type === \"switch\" }),\n className\n );\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemInputToggleTrackClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function menuItemInputToggleTrack(\n options: MenuItemInputToggleTrackClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"track\"), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemInputToggleBallClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function menuItemInputToggleBall(\n options: MenuItemInputToggleBallClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"ball\"), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemInputToggleIconClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function menuItemInputToggleIcon(\n options: MenuItemInputToggleIconClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"icon\"), className);\n}\n"],"names":["cnb","bem","styles","menuItemInputToggle","options","className","type","switch","menuItemInputToggleTrack","menuItemInputToggleBall","menuItemInputToggleIcon"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAQnB;;CAEC,GACD,OAAO,SAASE,oBACdC,OAA4C;IAE5C,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAE,GAAGF;IAC5B,OAAOJ,IACL,CAAC,IAAI,EAAEM,KAAK,UAAU,CAAC,EACvBJ,OAAO;QAAEK,QAAQD,SAAS;IAAS,IACnCD;AAEJ;AASA;;CAEC,GACD,OAAO,SAASG,yBACdJ,UAAoD,CAAC,CAAC;IAEtD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,UAAUG;AAC9B;AASA;;CAEC,GACD,OAAO,SAASI,wBACdL,UAAmD,CAAC,CAAC;IAErD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,SAASG;AAC7B;AASA;;CAEC,GACD,OAAO,SAASK,wBACdN,UAAmD,CAAC,CAAC;IAErD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,SAASG;AAC7B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/nativeSelectStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-native-select\");\nconst containerStyles = bem(\"rmd-native-select-container\");\n\n/** @since 6.0.0 */\nexport interface NativeSelectClassNameOptions {\n className?: string;\n\n /**\n * Set to `true` if using a custom icon instead of the default `<select>`\n * appearance.\n *\n * @defaultValue `false`\n */\n icon?: boolean;\n}\n\n/** @since 6.0.0 */\nexport function nativeSelect(\n options: NativeSelectClassNameOptions = {}\n): string {\n const { className, icon = false } = options;\n\n return cnb(styles({ icon }), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface NativeSelectContainerClassNameOptions {\n className?: string;\n label?: boolean;\n multiple?: boolean;\n underlined?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function nativeSelectContainer(\n options: NativeSelectContainerClassNameOptions = {}\n): string {\n const { className, label, multiple, underlined } = options;\n\n return cnb(\n containerStyles({\n multi: multiple,\n padded: label && multiple && !underlined,\n underline: multiple && underlined,\n \"underline-padded\": label && multiple && underlined,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","containerStyles","nativeSelect","options","className","icon","nativeSelectContainer","label","multiple","underlined","multi","padded","underline"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AACnB,MAAME,kBAAkBF,IAAI;AAe5B,iBAAiB,GACjB,OAAO,SAASG,aACdC,UAAwC,CAAC,CAAC;IAE1C,MAAM,EAAEC,SAAS,EAAEC,OAAO,KAAK,EAAE,GAAGF;IAEpC,OAAOL,IAAIE,OAAO;QAAEK;IAAK,IAAID;AAC/B;AAYA;;CAEC,GACD,OAAO,SAASE,sBACdH,UAAiD,CAAC,CAAC;IAEnD,MAAM,EAAEC,SAAS,EAAEG,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGN;IAEnD,OAAOL,IACLG,gBAAgB;QACdS,OAAOF;QACPG,QAAQJ,SAASC,YAAY,CAACC;QAC9BG,WAAWJ,YAAYC;QACvB,oBAAoBF,SAASC,YAAYC;IAC3C,IACAL;AAEJ"}
1
+ {"version":3,"sources":["../../src/form/nativeSelectStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-native-select\");\nconst containerStyles = bem(\"rmd-native-select-container\");\n\n/** @since 6.0.0 */\nexport interface NativeSelectClassNameOptions {\n className?: string;\n\n /**\n * Set to `true` if using a custom icon instead of the default `<select>`\n * appearance.\n *\n * @defaultValue `false`\n */\n icon?: boolean;\n}\n\n/** @since 6.0.0 */\nexport function nativeSelect(\n options: NativeSelectClassNameOptions = {}\n): string {\n const { className, icon = false } = options;\n\n return cnb(styles({ icon }), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface NativeSelectContainerClassNameOptions {\n className?: string;\n label?: boolean;\n multiple?: boolean;\n underlined?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function nativeSelectContainer(\n options: NativeSelectContainerClassNameOptions = {}\n): string {\n const { className, label, multiple, underlined } = options;\n\n return cnb(\n containerStyles({\n multi: multiple,\n padded: label && multiple && !underlined,\n underline: multiple && underlined,\n \"underline-padded\": label && multiple && underlined,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","containerStyles","nativeSelect","options","className","icon","nativeSelectContainer","label","multiple","underlined","multi","padded","underline"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AACnB,MAAME,kBAAkBF,IAAI;AAe5B,iBAAiB,GACjB,OAAO,SAASG,aACdC,UAAwC,CAAC,CAAC;IAE1C,MAAM,EAAEC,SAAS,EAAEC,OAAO,KAAK,EAAE,GAAGF;IAEpC,OAAOL,IAAIE,OAAO;QAAEK;IAAK,IAAID;AAC/B;AAYA;;CAEC,GACD,OAAO,SAASE,sBACdH,UAAiD,CAAC,CAAC;IAEnD,MAAM,EAAEC,SAAS,EAAEG,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGN;IAEnD,OAAOL,IACLG,gBAAgB;QACdS,OAAOF;QACPG,QAAQJ,SAASC,YAAY,CAACC;QAC9BG,WAAWJ,YAAYC;QACvB,oBAAoBF,SAASC,YAAYC;IAC3C,IACAL;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/optionStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-option\");\n\n/**\n * @since 6.0.0\n */\nexport interface OptionClassNameOptions {\n className?: string;\n icon: boolean;\n selected: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function option(options: OptionClassNameOptions): string {\n const { className, icon, selected } = options;\n\n return cnb(styles({ icon, selected }), className);\n}\n"],"names":["cnb","bem","styles","option","options","className","icon","selected"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAWnB;;CAEC,GACD,OAAO,SAASE,OAAOC,OAA+B;IACpD,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGH;IAEtC,OAAOJ,IAAIE,OAAO;QAAEI;QAAMC;IAAS,IAAIF;AACzC"}
1
+ {"version":3,"sources":["../../src/form/optionStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-option\");\n\n/**\n * @since 6.0.0\n */\nexport interface OptionClassNameOptions {\n className?: string;\n icon: boolean;\n selected: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function option(options: OptionClassNameOptions): string {\n const { className, icon, selected } = options;\n\n return cnb(styles({ icon, selected }), className);\n}\n"],"names":["cnb","bem","styles","option","options","className","icon","selected"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAWnB;;CAEC,GACD,OAAO,SAASE,OAAOC,OAA+B;IACpD,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGH;IAEtC,OAAOJ,IAAIE,OAAO;QAAEI;QAAMC;IAAS,IAAIF;AACzC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/passwordStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-password\");\n\n/**\n * @since 6.0.0\n */\nexport interface PasswordClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function password(options: PasswordClassNameOptions = {}): string {\n const { className } = options;\n\n return cnb(styles(), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface PasswordInputClassNameOptions {\n className?: string;\n}\n\nexport function passwordInput(\n options: PasswordInputClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"input\"), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface PasswordInputToggleClassNameOptions {\n className?: string;\n}\n\nexport function passwordInputToggle(\n options: PasswordInputToggleClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"toggle\"), className);\n}\n"],"names":["cnb","bem","styles","password","options","className","passwordInput","passwordInputToggle"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AASnB;;CAEC,GACD,OAAO,SAASE,SAASC,UAAoC,CAAC,CAAC;IAC7D,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,UAAUG;AACvB;AASA,OAAO,SAASC,cACdF,UAAyC,CAAC,CAAC;IAE3C,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,UAAUG;AAC9B;AASA,OAAO,SAASE,oBACdH,UAA+C,CAAC,CAAC;IAEjD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,WAAWG;AAC/B"}
1
+ {"version":3,"sources":["../../src/form/passwordStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-password\");\n\n/**\n * @since 6.0.0\n */\nexport interface PasswordClassNameOptions {\n className?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport function password(options: PasswordClassNameOptions = {}): string {\n const { className } = options;\n\n return cnb(styles(), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface PasswordInputClassNameOptions {\n className?: string;\n}\n\nexport function passwordInput(\n options: PasswordInputClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"input\"), className);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface PasswordInputToggleClassNameOptions {\n className?: string;\n}\n\nexport function passwordInputToggle(\n options: PasswordInputToggleClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(\"toggle\"), className);\n}\n"],"names":["cnb","bem","styles","password","options","className","passwordInput","passwordInputToggle"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AASnB;;CAEC,GACD,OAAO,SAASE,SAASC,UAAoC,CAAC,CAAC;IAC7D,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,UAAUG;AACvB;AASA,OAAO,SAASC,cACdF,UAAyC,CAAC,CAAC;IAE3C,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,UAAUG;AAC9B;AASA,OAAO,SAASE,oBACdH,UAA+C,CAAC,CAAC;IAEjD,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,OAAO,WAAWG;AAC/B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/selectStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\nimport { type FormTheme } from \"./types.js\";\n\nconst styles = bem(\"rmd-select\");\n\n/**\n * @since 6.0.0\n */\nexport interface SelectClassNameOptions {\n className?: string;\n /**\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\n/**\n * @since 6.0.0\n */\nexport function select(options: SelectClassNameOptions = {}): string {\n const { className, theme = \"outline\" } = options;\n\n return cnb(\n styles({\n filled: theme === \"filled\",\n outline: theme === \"outline\",\n underline: theme === \"underline\",\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","select","options","className","theme","filled","outline","underline"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAGtC,MAAMC,SAASD,IAAI;AAanB;;CAEC,GACD,OAAO,SAASE,OAAOC,UAAkC,CAAC,CAAC;IACzD,MAAM,EAAEC,SAAS,EAAEC,QAAQ,SAAS,EAAE,GAAGF;IAEzC,OAAOJ,IACLE,OAAO;QACLK,QAAQD,UAAU;QAClBE,SAASF,UAAU;QACnBG,WAAWH,UAAU;IACvB,IACAD;AAEJ"}
1
+ {"version":3,"sources":["../../src/form/selectStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\nimport { type FormTheme } from \"./types.js\";\n\nconst styles = bem(\"rmd-select\");\n\n/**\n * @since 6.0.0\n */\nexport interface SelectClassNameOptions {\n className?: string;\n /**\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\n/**\n * @since 6.0.0\n */\nexport function select(options: SelectClassNameOptions = {}): string {\n const { className, theme = \"outline\" } = options;\n\n return cnb(\n styles({\n filled: theme === \"filled\",\n outline: theme === \"outline\",\n underline: theme === \"underline\",\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","select","options","className","theme","filled","outline","underline"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAGtC,MAAMC,SAASD,IAAI;AAanB;;CAEC,GACD,OAAO,SAASE,OAAOC,UAAkC,CAAC,CAAC;IACzD,MAAM,EAAEC,SAAS,EAAEC,QAAQ,SAAS,EAAE,GAAGF;IAEzC,OAAOJ,IACLE,OAAO;QACLK,QAAQD,UAAU;QAClBE,SAASF,UAAU;QACnBG,WAAWH,UAAU;IACvB,IACAD;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/selectUtils.ts"],"sourcesContent":["import { Children, isValidElement, type ReactNode } from \"react\";\nimport { type MenuItemProps } from \"../menu/MenuItem.js\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface SelectOption<Value extends string | number = string>\n extends MenuItemProps {\n value: Value;\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nfunction getLabelFromChildren(children: ReactNode): string {\n if (!children) {\n return \"\";\n }\n\n if (typeof children === \"string\" || typeof children === \"number\") {\n return `${children}`;\n }\n\n if (isValidElement<{ children: ReactNode; hidden?: boolean }>(children)) {\n if (children.props.hidden) {\n return \"\";\n }\n\n return getLabelFromChildren(children.props.children);\n }\n\n const childList = Children.toArray(children);\n for (const child of childList) {\n if (typeof child === \"string\" || typeof child === \"number\") {\n return `${child}`[0].toUpperCase();\n }\n\n if (\n isValidElement<{ children: ReactNode; hidden?: boolean }>(child) &&\n !child.props.hidden\n ) {\n return getLabelFromChildren(child.props.children);\n }\n }\n\n return \"\";\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\ninterface ExtractedOptions<Value extends string | number> {\n options: readonly Value[];\n currentOption: SelectOption<Value> | undefined;\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function extractOptionsFromChildren<Value extends string | number>(\n children: ReactNode,\n currentValue: Value | undefined\n): ExtractedOptions<Value> {\n let currentOption: SelectOption<Value> | undefined;\n\n const options: Value[] = [];\n const searchValues: string[] = [];\n Children.forEach(children, (child) => {\n if (!isValidElement<SelectOption<Value>>(child)) {\n return;\n }\n\n const { value, disabled, children } = child.props;\n if (typeof value !== \"undefined\") {\n if (\n value === currentValue ||\n (!currentOption && typeof currentValue === \"undefined\")\n ) {\n currentOption = child.props;\n }\n\n if (!disabled) {\n options.push(child.props.value);\n searchValues.push(getLabelFromChildren(children));\n }\n } else if (children) {\n const result = extractOptionsFromChildren(children, currentValue);\n if (!currentOption) {\n ({ currentOption } = result);\n }\n\n options.push(...result.options);\n }\n });\n\n return {\n options,\n currentOption,\n };\n}\n"],"names":["Children","isValidElement","getLabelFromChildren","children","props","hidden","childList","toArray","child","toUpperCase","extractOptionsFromChildren","currentValue","currentOption","options","searchValues","forEach","value","disabled","push","result"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,QAAwB,QAAQ;AAYjE;;;CAGC,GACD,SAASC,qBAAqBC,QAAmB;IAC/C,IAAI,CAACA,UAAU;QACb,OAAO;IACT;IAEA,IAAI,OAAOA,aAAa,YAAY,OAAOA,aAAa,UAAU;QAChE,OAAO,CAAC,EAAEA,SAAS,CAAC;IACtB;IAEA,IAAIF,eAA0DE,WAAW;QACvE,IAAIA,SAASC,KAAK,CAACC,MAAM,EAAE;YACzB,OAAO;QACT;QAEA,OAAOH,qBAAqBC,SAASC,KAAK,CAACD,QAAQ;IACrD;IAEA,MAAMG,YAAYN,SAASO,OAAO,CAACJ;IACnC,KAAK,MAAMK,SAASF,UAAW;QAC7B,IAAI,OAAOE,UAAU,YAAY,OAAOA,UAAU,UAAU;YAC1D,OAAO,CAAC,EAAEA,MAAM,CAAC,CAAC,EAAE,CAACC,WAAW;QAClC;QAEA,IACER,eAA0DO,UAC1D,CAACA,MAAMJ,KAAK,CAACC,MAAM,EACnB;YACA,OAAOH,qBAAqBM,MAAMJ,KAAK,CAACD,QAAQ;QAClD;IACF;IAEA,OAAO;AACT;AAWA;;;CAGC,GACD,OAAO,SAASO,2BACdP,QAAmB,EACnBQ,YAA+B;IAE/B,IAAIC;IAEJ,MAAMC,UAAmB,EAAE;IAC3B,MAAMC,eAAyB,EAAE;IACjCd,SAASe,OAAO,CAACZ,UAAU,CAACK;QAC1B,IAAI,CAACP,eAAoCO,QAAQ;YAC/C;QACF;QAEA,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEd,QAAQ,EAAE,GAAGK,MAAMJ,KAAK;QACjD,IAAI,OAAOY,UAAU,aAAa;YAChC,IACEA,UAAUL,gBACT,CAACC,iBAAiB,OAAOD,iBAAiB,aAC3C;gBACAC,gBAAgBJ,MAAMJ,KAAK;YAC7B;YAEA,IAAI,CAACa,UAAU;gBACbJ,QAAQK,IAAI,CAACV,MAAMJ,KAAK,CAACY,KAAK;gBAC9BF,aAAaI,IAAI,CAAChB,qBAAqBC;YACzC;QACF,OAAO,IAAIA,UAAU;YACnB,MAAMgB,SAAST,2BAA2BP,UAAUQ;YACpD,IAAI,CAACC,eAAe;gBACjB,CAAA,EAAEA,aAAa,EAAE,GAAGO,MAAK;YAC5B;YAEAN,QAAQK,IAAI,IAAIC,OAAON,OAAO;QAChC;IACF;IAEA,OAAO;QACLA;QACAD;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/form/selectUtils.ts"],"sourcesContent":["import { Children, isValidElement, type ReactNode } from \"react\";\nimport { type MenuItemProps } from \"../menu/MenuItem.js\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface SelectOption<Value extends string | number = string>\n extends MenuItemProps {\n value: Value;\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nfunction getLabelFromChildren(children: ReactNode): string {\n if (!children) {\n return \"\";\n }\n\n if (typeof children === \"string\" || typeof children === \"number\") {\n return `${children}`;\n }\n\n if (isValidElement<{ children: ReactNode; hidden?: boolean }>(children)) {\n if (children.props.hidden) {\n return \"\";\n }\n\n return getLabelFromChildren(children.props.children);\n }\n\n const childList = Children.toArray(children);\n for (const child of childList) {\n if (typeof child === \"string\" || typeof child === \"number\") {\n return `${child}`[0].toUpperCase();\n }\n\n if (\n isValidElement<{ children: ReactNode; hidden?: boolean }>(child) &&\n !child.props.hidden\n ) {\n return getLabelFromChildren(child.props.children);\n }\n }\n\n return \"\";\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\ninterface ExtractedOptions<Value extends string | number> {\n options: readonly Value[];\n currentOption: SelectOption<Value> | undefined;\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function extractOptionsFromChildren<Value extends string | number>(\n children: ReactNode,\n currentValue: Value | undefined\n): ExtractedOptions<Value> {\n let currentOption: SelectOption<Value> | undefined;\n\n const options: Value[] = [];\n const searchValues: string[] = [];\n Children.forEach(children, (child) => {\n if (!isValidElement<SelectOption<Value>>(child)) {\n return;\n }\n\n const { value, disabled, children } = child.props;\n if (typeof value !== \"undefined\") {\n if (\n value === currentValue ||\n (!currentOption && typeof currentValue === \"undefined\")\n ) {\n currentOption = child.props;\n }\n\n if (!disabled) {\n options.push(child.props.value);\n searchValues.push(getLabelFromChildren(children));\n }\n } else if (children) {\n const result = extractOptionsFromChildren(children, currentValue);\n if (!currentOption) {\n ({ currentOption } = result);\n }\n\n options.push(...result.options);\n }\n });\n\n return {\n options,\n currentOption,\n };\n}\n"],"names":["Children","isValidElement","getLabelFromChildren","children","props","hidden","childList","toArray","child","toUpperCase","extractOptionsFromChildren","currentValue","currentOption","options","searchValues","forEach","value","disabled","push","result"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,QAAwB,QAAQ;AAYjE;;;CAGC,GACD,SAASC,qBAAqBC,QAAmB;IAC/C,IAAI,CAACA,UAAU;QACb,OAAO;IACT;IAEA,IAAI,OAAOA,aAAa,YAAY,OAAOA,aAAa,UAAU;QAChE,OAAO,CAAC,EAAEA,SAAS,CAAC;IACtB;IAEA,IAAIF,eAA0DE,WAAW;QACvE,IAAIA,SAASC,KAAK,CAACC,MAAM,EAAE;YACzB,OAAO;QACT;QAEA,OAAOH,qBAAqBC,SAASC,KAAK,CAACD,QAAQ;IACrD;IAEA,MAAMG,YAAYN,SAASO,OAAO,CAACJ;IACnC,KAAK,MAAMK,SAASF,UAAW;QAC7B,IAAI,OAAOE,UAAU,YAAY,OAAOA,UAAU,UAAU;YAC1D,OAAO,CAAC,EAAEA,MAAM,CAAC,CAAC,EAAE,CAACC,WAAW;QAClC;QAEA,IACER,eAA0DO,UAC1D,CAACA,MAAMJ,KAAK,CAACC,MAAM,EACnB;YACA,OAAOH,qBAAqBM,MAAMJ,KAAK,CAACD,QAAQ;QAClD;IACF;IAEA,OAAO;AACT;AAWA;;;CAGC,GACD,OAAO,SAASO,2BACdP,QAAmB,EACnBQ,YAA+B;IAE/B,IAAIC;IAEJ,MAAMC,UAAmB,EAAE;IAC3B,MAAMC,eAAyB,EAAE;IACjCd,SAASe,OAAO,CAACZ,UAAU,CAACK;QAC1B,IAAI,CAACP,eAAoCO,QAAQ;YAC/C;QACF;QAEA,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEd,QAAQ,EAAE,GAAGK,MAAMJ,KAAK;QACjD,IAAI,OAAOY,UAAU,aAAa;YAChC,IACEA,UAAUL,gBACT,CAACC,iBAAiB,OAAOD,iBAAiB,aAC3C;gBACAC,gBAAgBJ,MAAMJ,KAAK;YAC7B;YAEA,IAAI,CAACa,UAAU;gBACbJ,QAAQK,IAAI,CAACV,MAAMJ,KAAK,CAACY,KAAK;gBAC9BF,aAAaI,IAAI,CAAChB,qBAAqBC;YACzC;QACF,OAAO,IAAIA,UAAU;YACnB,MAAMgB,SAAST,2BAA2BP,UAAUQ;YACpD,IAAI,CAACC,eAAe;gBACjB,CAAA,EAAEA,aAAa,EAAE,GAAGO,MAAK;YAC5B;YAEAN,QAAQK,IAAI,IAAIC,OAAON,OAAO;QAChC;IACF;IAEA,OAAO;QACLA;QACAD;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/sliderUtils.ts"],"sourcesContent":["import { type RefObject } from \"react\";\nimport {\n type DraggableEventHandlers,\n type DraggableImplementation,\n type DraggableMouseEventHandlers,\n type DraggableTouchEventHandlers,\n} from \"../draggable/useDraggable.js\";\nimport { type RenameKeysWithPrefix } from \"../types.js\";\nimport {\n getClientPosition,\n type ClientPositionEvent,\n} from \"../utils/getClientPosition.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { getRangeSteps } from \"../utils/getRangeSteps.js\";\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface JumpOptions {\n min: number;\n max: number;\n step: number;\n jump: number | undefined;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport const getJumpValue = (options: JumpOptions): number => {\n const { min, max, step, jump } = options;\n\n const steps = getRangeSteps({ min, max, step });\n const value = jump ?? (steps / 10) * step;\n if (Number.isInteger(step)) {\n return Math.ceil(value);\n }\n\n return value;\n};\n\n/**\n * @since 6.0.0\n * @internal\n */\ntype RequiredThumbProps = Pick<\n DraggableImplementation<HTMLElement>,\n | \"dragging\"\n | keyof DraggableMouseEventHandlers<HTMLElement>\n | keyof DraggableTouchEventHandlers<HTMLElement>\n> & { ref: RefObject<HTMLSpanElement> };\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type ClosestThumbEventHandlersOptions = RenameKeysWithPrefix<\n RequiredThumbProps,\n \"thumb1\"\n> &\n RenameKeysWithPrefix<RequiredThumbProps, \"thumb2\"> & {\n vertical: boolean;\n isRangeSlider: boolean;\n };\n\n/**\n * NOTE: I do not need the mousemove events for this one to work.\n *\n * @since 6.0.0\n * @internal\n */\nexport const getClosestThumbEventHandlers = (\n options: ClosestThumbEventHandlersOptions\n): DraggableEventHandlers<HTMLElement> => {\n const {\n thumb1Ref,\n thumb1Dragging,\n thumb1OnMouseUp,\n thumb1OnMouseDown,\n thumb1OnTouchStart,\n thumb1OnTouchMove,\n thumb2Ref,\n thumb2Dragging,\n thumb2OnMouseUp,\n thumb2OnMouseDown,\n thumb2OnTouchStart,\n thumb2OnTouchMove,\n isRangeSlider,\n vertical,\n } = options;\n\n if (!isRangeSlider) {\n return {\n onMouseDown: thumb1OnMouseDown,\n onMouseUp: thumb1OnMouseUp,\n onTouchStart: thumb1OnTouchStart,\n onTouchMove: thumb1OnTouchMove,\n };\n }\n\n const isThumbOneClosest = (event: ClientPositionEvent): boolean => {\n if (thumb2Dragging) {\n return false;\n }\n\n const thumb1 = thumb1Ref.current;\n const thumb2 = thumb2Ref.current;\n if (!thumb1Dragging && thumb1 && thumb2) {\n const clientPosition = getClientPosition({ event, vertical });\n const thumb1Rect = thumb1.getBoundingClientRect();\n const thumb2Rect = thumb2.getBoundingClientRect();\n const thumb1Position = vertical ? thumb1Rect.y : thumb1Rect.x;\n const thumb2Position = vertical ? thumb2Rect.y : thumb2Rect.x;\n\n return (\n Math.abs(clientPosition - thumb1Position) <\n Math.abs(clientPosition - thumb2Position)\n );\n }\n\n return true;\n };\n\n return {\n onMouseDown(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnMouseDown(event);\n } else {\n thumb2OnMouseDown(event);\n }\n },\n onMouseUp(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnMouseUp(event);\n } else {\n thumb2OnMouseUp(event);\n }\n },\n onTouchStart(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnTouchStart(event);\n } else {\n thumb2OnTouchStart(event);\n }\n },\n onTouchMove(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnTouchMove(event);\n } else {\n thumb2OnTouchMove(event);\n }\n },\n };\n};\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function getThumbOffset(\n offset: number | undefined,\n fallback: number\n): string | undefined {\n if (typeof offset !== \"number\") {\n return;\n }\n\n // the `offset` will be NaN when there are no possible steps to take because\n // the first thumb is at the maximum value or the second thumb is at the\n // minimum value\n const value = Number.isNaN(offset) ? fallback : offset;\n return `${value * 100}%`;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface ThumbOffsetsOptions {\n min: number;\n max: number;\n thumb1Value: number;\n thumb1Dragging: boolean;\n thumb1DragPercentage: number;\n thumb2Value: number;\n thumb2Dragging: boolean;\n thumb2DragPercentage: number;\n isRangeSlider: boolean;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface ThumbOffsets {\n \"--rmd-slider-offset-1\"?: string;\n \"--rmd-slider-offset-2\"?: string;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport const getThumbOffsets = (options: ThumbOffsetsOptions): ThumbOffsets => {\n const {\n min,\n max,\n thumb1Value,\n thumb1Dragging,\n thumb1DragPercentage,\n thumb2Value,\n thumb2Dragging,\n thumb2DragPercentage,\n isRangeSlider,\n } = options;\n let thumb1Percentage = thumb1Dragging\n ? thumb1DragPercentage\n : getPercentage({ min, max, value: thumb1Value });\n\n let thumb2Percentage: number | undefined;\n if (isRangeSlider) {\n const percentage = getPercentage({ min, max, value: thumb2Value });\n\n thumb1Percentage = Math.min(thumb1Percentage, percentage);\n thumb2Percentage = thumb2Dragging\n ? Math.max(thumb1Percentage, thumb2DragPercentage)\n : percentage;\n }\n\n return {\n \"--rmd-slider-offset-1\": getThumbOffset(thumb1Percentage, 0),\n \"--rmd-slider-offset-2\": getThumbOffset(thumb2Percentage, 1),\n };\n};\n"],"names":["getClientPosition","getPercentage","getRangeSteps","getJumpValue","options","min","max","step","jump","steps","value","Number","isInteger","Math","ceil","getClosestThumbEventHandlers","thumb1Ref","thumb1Dragging","thumb1OnMouseUp","thumb1OnMouseDown","thumb1OnTouchStart","thumb1OnTouchMove","thumb2Ref","thumb2Dragging","thumb2OnMouseUp","thumb2OnMouseDown","thumb2OnTouchStart","thumb2OnTouchMove","isRangeSlider","vertical","onMouseDown","onMouseUp","onTouchStart","onTouchMove","isThumbOneClosest","event","thumb1","current","thumb2","clientPosition","thumb1Rect","getBoundingClientRect","thumb2Rect","thumb1Position","y","x","thumb2Position","abs","getThumbOffset","offset","fallback","isNaN","getThumbOffsets","thumb1Value","thumb1DragPercentage","thumb2Value","thumb2DragPercentage","thumb1Percentage","thumb2Percentage","percentage"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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KI,OAAO6C;QAAY;QAEhEE,mBAAmB5C,KAAKR,GAAG,CAACoD,kBAAkBE;QAC9CD,mBAAmBnC,iBACfV,KAAKP,GAAG,CAACmD,kBAAkBD,wBAC3BG;IACN;IAEA,OAAO;QACL,yBAAyBX,eAAeS,kBAAkB;QAC1D,yBAAyBT,eAAeU,kBAAkB;IAC5D;AACF,EAAE"}
1
+ {"version":3,"sources":["../../src/form/sliderUtils.ts"],"sourcesContent":["import { type RefObject } from \"react\";\nimport {\n type DraggableEventHandlers,\n type DraggableImplementation,\n type DraggableMouseEventHandlers,\n type DraggableTouchEventHandlers,\n} from \"../draggable/useDraggable.js\";\nimport { type RenameKeysWithPrefix } from \"../types.js\";\nimport {\n getClientPosition,\n type ClientPositionEvent,\n} from \"../utils/getClientPosition.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { getRangeSteps } from \"../utils/getRangeSteps.js\";\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface JumpOptions {\n min: number;\n max: number;\n step: number;\n jump: number | undefined;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport const getJumpValue = (options: JumpOptions): number => {\n const { min, max, step, jump } = options;\n\n const steps = getRangeSteps({ min, max, step });\n const value = jump ?? (steps / 10) * step;\n if (Number.isInteger(step)) {\n return Math.ceil(value);\n }\n\n return value;\n};\n\n/**\n * @since 6.0.0\n * @internal\n */\ntype RequiredThumbProps = Pick<\n DraggableImplementation<HTMLElement>,\n | \"dragging\"\n | keyof DraggableMouseEventHandlers<HTMLElement>\n | keyof DraggableTouchEventHandlers<HTMLElement>\n> & { ref: RefObject<HTMLSpanElement> };\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type ClosestThumbEventHandlersOptions = RenameKeysWithPrefix<\n RequiredThumbProps,\n \"thumb1\"\n> &\n RenameKeysWithPrefix<RequiredThumbProps, \"thumb2\"> & {\n vertical: boolean;\n isRangeSlider: boolean;\n };\n\n/**\n * NOTE: I do not need the mousemove events for this one to work.\n *\n * @since 6.0.0\n * @internal\n */\nexport const getClosestThumbEventHandlers = (\n options: ClosestThumbEventHandlersOptions\n): DraggableEventHandlers<HTMLElement> => {\n const {\n thumb1Ref,\n thumb1Dragging,\n thumb1OnMouseUp,\n thumb1OnMouseDown,\n thumb1OnTouchStart,\n thumb1OnTouchMove,\n thumb2Ref,\n thumb2Dragging,\n thumb2OnMouseUp,\n thumb2OnMouseDown,\n thumb2OnTouchStart,\n thumb2OnTouchMove,\n isRangeSlider,\n vertical,\n } = options;\n\n if (!isRangeSlider) {\n return {\n onMouseDown: thumb1OnMouseDown,\n onMouseUp: thumb1OnMouseUp,\n onTouchStart: thumb1OnTouchStart,\n onTouchMove: thumb1OnTouchMove,\n };\n }\n\n const isThumbOneClosest = (event: ClientPositionEvent): boolean => {\n if (thumb2Dragging) {\n return false;\n }\n\n const thumb1 = thumb1Ref.current;\n const thumb2 = thumb2Ref.current;\n if (!thumb1Dragging && thumb1 && thumb2) {\n const clientPosition = getClientPosition({ event, vertical });\n const thumb1Rect = thumb1.getBoundingClientRect();\n const thumb2Rect = thumb2.getBoundingClientRect();\n const thumb1Position = vertical ? thumb1Rect.y : thumb1Rect.x;\n const thumb2Position = vertical ? thumb2Rect.y : thumb2Rect.x;\n\n return (\n Math.abs(clientPosition - thumb1Position) <\n Math.abs(clientPosition - thumb2Position)\n );\n }\n\n return true;\n };\n\n return {\n onMouseDown(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnMouseDown(event);\n } else {\n thumb2OnMouseDown(event);\n }\n },\n onMouseUp(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnMouseUp(event);\n } else {\n thumb2OnMouseUp(event);\n }\n },\n onTouchStart(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnTouchStart(event);\n } else {\n thumb2OnTouchStart(event);\n }\n },\n onTouchMove(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnTouchMove(event);\n } else {\n thumb2OnTouchMove(event);\n }\n },\n };\n};\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function getThumbOffset(\n offset: number | undefined,\n fallback: number\n): string | undefined {\n if (typeof offset !== \"number\") {\n return;\n }\n\n // the `offset` will be NaN when there are no possible steps to take because\n // the first thumb is at the maximum value or the second thumb is at the\n // minimum value\n const value = Number.isNaN(offset) ? fallback : offset;\n return `${value * 100}%`;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface ThumbOffsetsOptions {\n min: number;\n max: number;\n thumb1Value: number;\n thumb1Dragging: boolean;\n thumb1DragPercentage: number;\n thumb2Value: number;\n thumb2Dragging: boolean;\n thumb2DragPercentage: number;\n isRangeSlider: boolean;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface ThumbOffsets {\n \"--rmd-slider-offset-1\"?: string;\n \"--rmd-slider-offset-2\"?: string;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport const getThumbOffsets = (options: ThumbOffsetsOptions): ThumbOffsets => {\n const {\n min,\n max,\n thumb1Value,\n thumb1Dragging,\n thumb1DragPercentage,\n thumb2Value,\n thumb2Dragging,\n thumb2DragPercentage,\n isRangeSlider,\n } = options;\n let thumb1Percentage = thumb1Dragging\n ? thumb1DragPercentage\n : getPercentage({ min, max, value: thumb1Value });\n\n let thumb2Percentage: number | undefined;\n if (isRangeSlider) {\n const percentage = getPercentage({ min, max, value: thumb2Value });\n\n thumb1Percentage = Math.min(thumb1Percentage, percentage);\n thumb2Percentage = thumb2Dragging\n ? Math.max(thumb1Percentage, thumb2DragPercentage)\n : percentage;\n }\n\n return {\n \"--rmd-slider-offset-1\": getThumbOffset(thumb1Percentage, 0),\n \"--rmd-slider-offset-2\": getThumbOffset(thumb2Percentage, 1),\n };\n};\n"],"names":["getClientPosition","getPercentage","getRangeSteps","getJumpValue","options","min","max","step","jump","steps","value","Number","isInteger","Math","ceil","getClosestThumbEventHandlers","thumb1Ref","thumb1Dragging","thumb1OnMouseUp","thumb1OnMouseDown","thumb1OnTouchStart","thumb1OnTouchMove","thumb2Ref","thumb2Dragging","thumb2OnMouseUp","thumb2OnMouseDown","thumb2OnTouchStart","thumb2OnTouchMove","isRangeSlider","vertical","onMouseDown","onMouseUp","onTouchStart","onTouchMove","isThumbOneClosest","event","thumb1","current","thumb2","clientPosition","thumb1Rect","getBoundingClientRect","thumb2Rect","thumb1Position","y","x","thumb2Position","abs","getThumbOffset","offset","fallback","isNaN","getThumbOffsets","thumb1Value","thumb1DragPercentage","thumb2Value","thumb2DragPercentage","thumb1Percentage","thumb2Percentage","percentage"],"mappings":"AAQA,SACEA,iBAAiB,QAEZ,gCAAgC;AACvC,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,aAAa,QAAQ,4BAA4B;AAa1D;;;CAGC,GACD,OAAO,MAAMC,eAAe,CAACC;IAC3B,MAAM,EAAEC,GAAG,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAGJ;IAEjC,MAAMK,QAAQP,cAAc;QAAEG;QAAKC;QAAKC;IAAK;IAC7C,MAAMG,QAAQF,QAAQ,AAACC,QAAQ,KAAMF;IACrC,IAAII,OAAOC,SAAS,CAACL,OAAO;QAC1B,OAAOM,KAAKC,IAAI,CAACJ;IACnB;IAEA,OAAOA;AACT,EAAE;AA0BF;;;;;CAKC,GACD,OAAO,MAAMK,+BAA+B,CAC1CX;IAEA,MAAM,EACJY,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,aAAa,EACbC,QAAQ,EACT,GAAGzB;IAEJ,IAAI,CAACwB,eAAe;QAClB,OAAO;YACLE,aAAaX;YACbY,WAAWb;YACXc,cAAcZ;YACda,aAAaZ;QACf;IACF;IAEA,MAAMa,oBAAoB,CAACC;QACzB,IAAIZ,gBAAgB;YAClB,OAAO;QACT;QAEA,MAAMa,SAASpB,UAAUqB,OAAO;Q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9B,MAAM,EACJC,GAAG,EACHC,GAAG,EACH+C,WAAW,EACXpC,cAAc,EACdqC,oBAAoB,EACpBC,WAAW,EACXhC,cAAc,EACdiC,oBAAoB,EACpB5B,aAAa,EACd,GAAGxB;IACJ,IAAIqD,mBAAmBxC,iBACnBqC,uBACArD,cAAc;QAAEI;QAAKC;QAAKI,OAAO2C;IAAY;IAEjD,IAAIK;IACJ,IAAI9B,eAAe;QACjB,MAAM+B,aAAa1D,cAAc;YAAEI;YAAKC;YAAKI,OAAO6C;QAAY;QAEhEE,mBAAmB5C,KAAKR,GAAG,CAACoD,kBAAkBE;QAC9CD,mBAAmBnC,iBACfV,KAAKP,GAAG,CAACmD,kBAAkBD,wBAC3BG;IACN;IAEA,OAAO;QACL,yBAAyBX,eAAeS,kBAAkB;QAC1D,yBAAyBT,eAAeU,kBAAkB;IAC5D;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/switchStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-switch-track-background-color\"?: string;\n \"--rmd-switch-ball-background-color\"?: string;\n }\n}\n\nconst styles = bem(\"rmd-switch\");\n\n/**\n * @since 6.0.0\n */\nexport interface SwitchClassNameOptions {\n className?: string;\n clickable?: boolean;\n currentColor?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function switchStyles(options: SwitchClassNameOptions = {}): string {\n const { className, clickable, currentColor } = options;\n\n return cnb(styles({ \"current-color\": currentColor, clickable }), className);\n}\n"],"names":["cnb","bem","styles","switchStyles","options","className","clickable","currentColor"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAStC,MAAMC,SAASD,IAAI;AAWnB;;CAEC,GACD,OAAO,SAASE,aAAaC,UAAkC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,YAAY,EAAE,GAAGH;IAE/C,OAAOJ,IAAIE,OAAO;QAAE,iBAAiBK;QAAcD;IAAU,IAAID;AACnE"}
1
+ {"version":3,"sources":["../../src/form/switchStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-switch-track-background-color\"?: string;\n \"--rmd-switch-ball-background-color\"?: string;\n }\n}\n\nconst styles = bem(\"rmd-switch\");\n\n/**\n * @since 6.0.0\n */\nexport interface SwitchClassNameOptions {\n className?: string;\n clickable?: boolean;\n currentColor?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function switchStyles(options: SwitchClassNameOptions = {}): string {\n const { className, clickable, currentColor } = options;\n\n return cnb(styles({ \"current-color\": currentColor, clickable }), className);\n}\n"],"names":["cnb","bem","styles","switchStyles","options","className","clickable","currentColor"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAStC,MAAMC,SAASD,IAAI;AAWnB;;CAEC,GACD,OAAO,SAASE,aAAaC,UAAkC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,YAAY,EAAE,GAAGH;IAE/C,OAAOJ,IAAIE,OAAO;QAAE,iBAAiBK;QAAcD;IAAU,IAAID;AACnE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/textAreaStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\nimport {\n textField,\n type TextFieldClassNameOptions,\n} from \"./textFieldStyles.js\";\nimport { type TextAreaResize } from \"./useResizingTextArea.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-textarea-height\"?: string | number;\n \"--rmd-textarea-padding\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-textarea\");\nconst containerStyles = bem(\"rmd-textarea-container\");\n\n/**\n * @since 6.0.0\n */\nexport interface TextareaClassNameOptions extends TextFieldClassNameOptions {\n className?: string;\n\n /**\n * This should not be used externally and is only used for creating the hidden\n * textarea mask for the auto resizing behavior.\n *\n * @defaultValue `false`\n */\n mask?: boolean;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * Set this to `true` if the textarea should display a scrollbar.\n *\n * @defaultValue `false`\n */\n scrollable?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textArea(options: TextareaClassNameOptions = {}): string {\n const {\n className,\n mask,\n resize = \"auto\",\n scrollable,\n placeholderHidden,\n } = options;\n\n return cnb(\n textField({ placeholderHidden }),\n styles({\n rh: resize === \"horizontal\",\n rv: resize === \"vertical\",\n rn: resize === \"auto\" || resize === \"none\",\n mask,\n scrollable: scrollable || resize === \"none\",\n }),\n className\n );\n}\n\n/**\n * @since 6.0.0\n */\nexport interface TextareaContainerClassNameOptions {\n className?: string;\n height?: boolean;\n disabled?: boolean;\n animate?: boolean;\n underlineLabelled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textAreaContainer(\n options: TextareaContainerClassNameOptions = {}\n): string {\n const { className, height, animate, disabled, underlineLabelled } = options;\n\n return cnb(\n containerStyles({\n height,\n animate,\n cursor: !disabled,\n \"underline-labelled\": underlineLabelled,\n }),\n className\n );\n}\n"],"names":["cnb","bem","textField","styles","containerStyles","textArea","options","className","mask","resize","scrollable","placeholderHidden","rh","rv","rn","textAreaContainer","height","animate","disabled","underlineLabelled","cursor"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SACEC,SAAS,QAEJ,uBAAuB;AAU9B,MAAMC,SAASF,IAAI;AACnB,MAAMG,kBAAkBH,IAAI;AA8B5B;;CAEC,GACD,OAAO,SAASI,SAASC,UAAoC,CAAC,CAAC;IAC7D,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,SAAS,MAAM,EACfC,UAAU,EACVC,iBAAiB,EAClB,GAAGL;IAEJ,OAAON,IACLE,UAAU;QAAES;IAAkB,IAC9BR,OAAO;QACLS,IAAIH,WAAW;QACfI,IAAIJ,WAAW;QACfK,IAAIL,WAAW,UAAUA,WAAW;QACpCD;QACAE,YAAYA,cAAcD,WAAW;IACvC,IACAF;AAEJ;AAaA;;CAEC,GACD,OAAO,SAASQ,kBACdT,UAA6C,CAAC,CAAC;IAE/C,MAAM,EAAEC,SAAS,EAAES,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGb;IAEpE,OAAON,IACLI,gBAAgB;QACdY;QACAC;QACAG,QAAQ,CAACF;QACT,sBAAsBC;IACxB,IACAZ;AAEJ"}
1
+ {"version":3,"sources":["../../src/form/textAreaStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\nimport {\n textField,\n type TextFieldClassNameOptions,\n} from \"./textFieldStyles.js\";\nimport { type TextAreaResize } from \"./useResizingTextArea.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-textarea-height\"?: string | number;\n \"--rmd-textarea-padding\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-textarea\");\nconst containerStyles = bem(\"rmd-textarea-container\");\n\n/**\n * @since 6.0.0\n */\nexport interface TextareaClassNameOptions extends TextFieldClassNameOptions {\n className?: string;\n\n /**\n * This should not be used externally and is only used for creating the hidden\n * textarea mask for the auto resizing behavior.\n *\n * @defaultValue `false`\n */\n mask?: boolean;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * Set this to `true` if the textarea should display a scrollbar.\n *\n * @defaultValue `false`\n */\n scrollable?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textArea(options: TextareaClassNameOptions = {}): string {\n const {\n className,\n mask,\n resize = \"auto\",\n scrollable,\n placeholderHidden,\n } = options;\n\n return cnb(\n textField({ placeholderHidden }),\n styles({\n rh: resize === \"horizontal\",\n rv: resize === \"vertical\",\n rn: resize === \"auto\" || resize === \"none\",\n mask,\n scrollable: scrollable || resize === \"none\",\n }),\n className\n );\n}\n\n/**\n * @since 6.0.0\n */\nexport interface TextareaContainerClassNameOptions {\n className?: string;\n height?: boolean;\n disabled?: boolean;\n animate?: boolean;\n underlineLabelled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textAreaContainer(\n options: TextareaContainerClassNameOptions = {}\n): string {\n const { className, height, animate, disabled, underlineLabelled } = options;\n\n return cnb(\n containerStyles({\n height,\n animate,\n cursor: !disabled,\n \"underline-labelled\": underlineLabelled,\n }),\n className\n );\n}\n"],"names":["cnb","bem","textField","styles","containerStyles","textArea","options","className","mask","resize","scrollable","placeholderHidden","rh","rv","rn","textAreaContainer","height","animate","disabled","underlineLabelled","cursor"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SACEC,SAAS,QAEJ,uBAAuB;AAU9B,MAAMC,SAASF,IAAI;AACnB,MAAMG,kBAAkBH,IAAI;AA8B5B;;CAEC,GACD,OAAO,SAASI,SAASC,UAAoC,CAAC,CAAC;IAC7D,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,SAAS,MAAM,EACfC,UAAU,EACVC,iBAAiB,EAClB,GAAGL;IAEJ,OAAON,IACLE,UAAU;QAAES;IAAkB,IAC9BR,OAAO;QACLS,IAAIH,WAAW;QACfI,IAAIJ,WAAW;QACfK,IAAIL,WAAW,UAAUA,WAAW;QACpCD;QACAE,YAAYA,cAAcD,WAAW;IACvC,IACAF;AAEJ;AAaA;;CAEC,GACD,OAAO,SAASQ,kBACdT,UAA6C,CAAC,CAAC;IAE/C,MAAM,EAAEC,SAAS,EAAES,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGb;IAEpE,OAAON,IACLI,gBAAgB;QACdY;QACAC;QACAG,QAAQ,CAACF;QACT,sBAAsBC;IACxB,IACAZ;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/textFieldContainerStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type TextColor, type ThemeColor } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type FormComponentStates, type FormThemeOptions } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-text-field-height\"?: string | number;\n \"--rmd-text-field-padding-left\"?: string | number;\n \"--rmd-text-field-padding-right\"?: string | number;\n \"--rmd-text-field-padding-top\"?: string | number;\n \"--rmd-text-field-border-color\"?: string;\n \"--rmd-text-field-hover-border-color\"?: string;\n \"--rmd-text-field-filled-color\"?: string;\n \"--rmd-form-addon-top\"?: string | number;\n \"--rmd-form-addon-margin-top\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-text-field-container\");\n\n/** @since 6.0.0 */\nexport interface TextFieldContainerClassNameOptions\n extends FormThemeOptions,\n FormComponentStates {\n className?: string;\n\n /** @defaultValue `false` */\n dense?: boolean;\n\n /** @defaultValue `false` */\n inline?: boolean;\n\n /** @defaultValue `false` */\n stretch?: boolean;\n\n /** @defaultValue `false` */\n label?: boolean;\n\n /** @defaultValue `false` */\n leftAddon?: boolean;\n\n /** @defaultValue `false` */\n rightAddon?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textFieldContainer(\n options: TextFieldContainerClassNameOptions = {}\n): string {\n const {\n className,\n theme = \"outline\",\n dense = false,\n error = false,\n label = false,\n active = false,\n inline = false,\n stretch = false,\n readOnly = false,\n disabled = false,\n leftAddon = false,\n rightAddon = false,\n underlineDirection = \"left\",\n } = options;\n const underline = theme === \"underline\";\n const outline = theme === \"outline\";\n const filled = theme === \"filled\";\n const isUnderlined = underline || filled;\n const isOutlineActive = outline && active;\n\n let textColor: ThemeColor | TextColor | undefined;\n if (disabled) {\n textColor = \"text-disabled\";\n } else if (error) {\n textColor = \"error\";\n }\n\n return cnb(\n styles({\n error,\n inline,\n stretch,\n filled,\n outline,\n disabled: disabled || readOnly,\n hoverable: !disabled && !isOutlineActive,\n label: label && !dense,\n dense: !label && dense,\n \"dense-label\": label && dense,\n \"dense-placeholder\": !label && dense && isUnderlined,\n \"outline-active\": isOutlineActive,\n \"outline-error\": outline && error,\n \"outline-left\": outline && leftAddon,\n \"outline-right\": outline && rightAddon,\n underline: isUnderlined,\n \"underline-placeholder\": isUnderlined && !label,\n \"underline-placeholder-only\":\n isUnderlined && !label && !leftAddon && !rightAddon,\n \"underline-labelled\": isUnderlined && label,\n \"underline-active\": isUnderlined && active,\n [`underline-${underlineDirection}`]: isUnderlined,\n \"underline-left-addon\": isUnderlined && leftAddon,\n \"underline-right-addon\": isUnderlined && rightAddon,\n }),\n cssUtils({ textColor }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","textFieldContainer","options","className","theme","dense","error","label","active","inline","stretch","readOnly","disabled","leftAddon","rightAddon","underlineDirection","underline","outline","filled","isUnderlined","isOutlineActive","textColor","hoverable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAyC,iBAAiB;AAC3E,SAASC,GAAG,QAAQ,kBAAkB;AAiBtC,MAAMC,SAASD,IAAI;AA2BnB;;CAEC,GACD,OAAO,SAASE,mBACdC,UAA8C,CAAC,CAAC;IAEhD,MAAM,EACJC,SAAS,EACTC,QAAQ,SAAS,EACjBC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,SAAS,KAAK,EACdC,UAAU,KAAK,EACfC,WAAW,KAAK,EAChBC,WAAW,KAAK,EAChBC,YAAY,KAAK,EACjBC,aAAa,KAAK,EAClBC,qBAAqB,MAAM,EAC5B,GAAGb;IACJ,MAAMc,YAAYZ,UAAU;IAC5B,MAAMa,UAAUb,UAAU;IAC1B,MAAMc,SAASd,UAAU;IACzB,MAAMe,eAAeH,aAAaE;IAClC,MAAME,kBAAkBH,WAAWT;IAEnC,IAAIa;IACJ,IAAIT,UAAU;QACZS,YAAY;IACd,OAAO,IAAIf,OAAO;QAChBe,YAAY;IACd;IAEA,OAAOxB,IACLG,OAAO;QACLM;QACAG;QACAC;QACAQ;QACAD;QACAL,UAAUA,YAAYD;QACtBW,WAAW,CAACV,YAAY,CAACQ;QACzBb,OAAOA,SAAS,CAACF;QACjBA,OAAO,CAACE,SAASF;QACjB,eAAeE,SAASF;QACxB,qBAAqB,CAACE,SAASF,SAASc;QACxC,kBAAkBC;QAClB,iBAAiBH,WAAWX;QAC5B,gBAAgBW,WAAWJ;QAC3B,iBAAiBI,WAAWH;QAC5BE,WAAWG;QACX,yBAAyBA,gBAAgB,CAACZ;QAC1C,8BACEY,gBAAgB,CAACZ,SAAS,CAACM,aAAa,CAACC;QAC3C,sBAAsBK,gBAAgBZ;QACtC,oBAAoBY,gBAAgBX;QACpC,CAAC,CAAC,UAAU,EAAEO,mBAAmB,CAAC,CAAC,EAAEI;QACrC,wBAAwBA,gBAAgBN;QACxC,yBAAyBM,gBAAgBL;IAC3C,IACAhB,SAAS;QAAEuB;IAAU,IACrBlB;AAEJ"}
1
+ {"version":3,"sources":["../../src/form/textFieldContainerStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type TextColor, type ThemeColor } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type FormComponentStates, type FormThemeOptions } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-text-field-height\"?: string | number;\n \"--rmd-text-field-padding-left\"?: string | number;\n \"--rmd-text-field-padding-right\"?: string | number;\n \"--rmd-text-field-padding-top\"?: string | number;\n \"--rmd-text-field-border-color\"?: string;\n \"--rmd-text-field-hover-border-color\"?: string;\n \"--rmd-text-field-filled-color\"?: string;\n \"--rmd-form-addon-top\"?: string | number;\n \"--rmd-form-addon-margin-top\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-text-field-container\");\n\n/** @since 6.0.0 */\nexport interface TextFieldContainerClassNameOptions\n extends FormThemeOptions,\n FormComponentStates {\n className?: string;\n\n /** @defaultValue `false` */\n dense?: boolean;\n\n /** @defaultValue `false` */\n inline?: boolean;\n\n /** @defaultValue `false` */\n stretch?: boolean;\n\n /** @defaultValue `false` */\n label?: boolean;\n\n /** @defaultValue `false` */\n leftAddon?: boolean;\n\n /** @defaultValue `false` */\n rightAddon?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function textFieldContainer(\n options: TextFieldContainerClassNameOptions = {}\n): string {\n const {\n className,\n theme = \"outline\",\n dense = false,\n error = false,\n label = false,\n active = false,\n inline = false,\n stretch = false,\n readOnly = false,\n disabled = false,\n leftAddon = false,\n rightAddon = false,\n underlineDirection = \"left\",\n } = options;\n const underline = theme === \"underline\";\n const outline = theme === \"outline\";\n const filled = theme === \"filled\";\n const isUnderlined = underline || filled;\n const isOutlineActive = outline && active;\n\n let textColor: ThemeColor | TextColor | undefined;\n if (disabled) {\n textColor = \"text-disabled\";\n } else if (error) {\n textColor = \"error\";\n }\n\n return cnb(\n styles({\n error,\n inline,\n stretch,\n filled,\n outline,\n disabled: disabled || readOnly,\n hoverable: !disabled && !isOutlineActive,\n label: label && !dense,\n dense: !label && dense,\n \"dense-label\": label && dense,\n \"dense-placeholder\": !label && dense && isUnderlined,\n \"outline-active\": isOutlineActive,\n \"outline-error\": outline && error,\n \"outline-left\": outline && leftAddon,\n \"outline-right\": outline && rightAddon,\n underline: isUnderlined,\n \"underline-placeholder\": isUnderlined && !label,\n \"underline-placeholder-only\":\n isUnderlined && !label && !leftAddon && !rightAddon,\n \"underline-labelled\": isUnderlined && label,\n \"underline-active\": isUnderlined && active,\n [`underline-${underlineDirection}`]: isUnderlined,\n \"underline-left-addon\": isUnderlined && leftAddon,\n \"underline-right-addon\": isUnderlined && rightAddon,\n }),\n cssUtils({ textColor }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","textFieldContainer","options","className","theme","dense","error","label","active","inline","stretch","readOnly","disabled","leftAddon","rightAddon","underlineDirection","underline","outline","filled","isUnderlined","isOutlineActive","textColor","hoverable"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAyC,iBAAiB;AAC3E,SAASC,GAAG,QAAQ,kBAAkB;AAiBtC,MAAMC,SAASD,IAAI;AA2BnB;;CAEC,GACD,OAAO,SAASE,mBACdC,UAA8C,CAAC,CAAC;IAEhD,MAAM,EACJC,SAAS,EACTC,QAAQ,SAAS,EACjBC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,SAAS,KAAK,EACdC,UAAU,KAAK,EACfC,WAAW,KAAK,EAChBC,WAAW,KAAK,EAChBC,YAAY,KAAK,EACjBC,aAAa,KAAK,EAClBC,qBAAqB,MAAM,EAC5B,GAAGb;IACJ,MAAMc,YAAYZ,UAAU;IAC5B,MAAMa,UAAUb,UAAU;IAC1B,MAAMc,SAASd,UAAU;IACzB,MAAMe,eAAeH,aAAaE;IAClC,MAAME,kBAAkBH,WAAWT;IAEnC,IAAIa;IACJ,IAAIT,UAAU;QACZS,YAAY;IACd,OAAO,IAAIf,OAAO;QAChBe,YAAY;IACd;IAEA,OAAOxB,IACLG,OAAO;QACLM;QACAG;QACAC;QACAQ;QACAD;QACAL,UAAUA,YAAYD;QACtBW,WAAW,CAACV,YAAY,CAACQ;QACzBb,OAAOA,SAAS,CAACF;QACjBA,OAAO,CAACE,SAASF;QACjB,eAAeE,SAASF;QACxB,qBAAqB,CAACE,SAASF,SAASc;QACxC,kBAAkBC;QAClB,iBAAiBH,WAAWX;QAC5B,gBAAgBW,WAAWJ;QAC3B,iB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