@react-md/core 1.0.0-next.16 → 1.0.0-next.18
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.
- package/dist/_box-shadows.scss +76 -0
- package/dist/_colors.scss +279 -277
- package/dist/_core.scss +107 -16
- package/dist/_object-fit.scss +86 -0
- package/dist/_utils.scss +246 -72
- package/dist/app-bar/AppBar.d.ts +1 -90
- package/dist/app-bar/AppBar.js +1 -40
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.d.ts +1 -27
- package/dist/app-bar/AppBarTitle.js +1 -15
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/app-bar/_app-bar.scss +156 -25
- package/dist/app-bar/styles.d.ts +117 -0
- package/dist/app-bar/styles.js +55 -0
- package/dist/app-bar/styles.js.map +1 -0
- package/dist/autocomplete/Autocomplete.d.ts +8 -79
- package/dist/autocomplete/Autocomplete.js +112 -83
- package/dist/autocomplete/Autocomplete.js.map +1 -1
- package/dist/autocomplete/AutocompleteChip.d.ts +8 -0
- package/dist/autocomplete/AutocompleteChip.js +34 -0
- package/dist/autocomplete/AutocompleteChip.js.map +1 -0
- package/dist/autocomplete/AutocompleteCircularProgress.d.ts +5 -11
- package/dist/autocomplete/AutocompleteCircularProgress.js +4 -0
- package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
- package/dist/autocomplete/AutocompleteClearButton.d.ts +9 -0
- package/dist/autocomplete/AutocompleteClearButton.js +29 -0
- package/dist/autocomplete/AutocompleteClearButton.js.map +1 -0
- package/dist/autocomplete/AutocompleteDropdownButton.d.ts +4 -26
- package/dist/autocomplete/AutocompleteDropdownButton.js +5 -1
- package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
- package/dist/autocomplete/AutocompleteListboxChildren.d.ts +22 -0
- package/dist/autocomplete/AutocompleteListboxChildren.js +37 -0
- package/dist/autocomplete/AutocompleteListboxChildren.js.map +1 -0
- package/dist/autocomplete/_autocomplete.scss +362 -34
- package/dist/autocomplete/autocompleteStyles.d.ts +22 -0
- package/dist/autocomplete/autocompleteStyles.js +17 -8
- package/dist/autocomplete/autocompleteStyles.js.map +1 -1
- package/dist/autocomplete/defaults.d.ts +9 -9
- package/dist/autocomplete/defaults.js +13 -13
- package/dist/autocomplete/defaults.js.map +1 -1
- package/dist/autocomplete/types.d.ts +554 -56
- package/dist/autocomplete/types.js.map +1 -1
- package/dist/autocomplete/useAutocomplete.d.ts +22 -0
- package/dist/autocomplete/useAutocomplete.js +281 -0
- package/dist/autocomplete/useAutocomplete.js.map +1 -0
- package/dist/autocomplete/utils.d.ts +81 -0
- package/dist/autocomplete/utils.js +108 -0
- package/dist/autocomplete/utils.js.map +1 -0
- package/dist/avatar/_avatar.scss +93 -2
- package/dist/badge/Badge.d.ts +1 -20
- package/dist/badge/Badge.js +1 -14
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/_badge.scss +90 -3
- package/dist/badge/styles.d.ts +26 -0
- package/dist/badge/styles.js +18 -0
- package/dist/badge/styles.js.map +1 -0
- package/dist/box/Box.js +2 -1
- package/dist/box/Box.js.map +1 -1
- package/dist/box/_box.scss +130 -17
- package/dist/box/styles.d.ts +6 -0
- package/dist/box/styles.js +2 -1
- package/dist/box/styles.js.map +1 -1
- package/dist/button/AsyncButton.d.ts +1 -1
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.d.ts +2 -1
- package/dist/button/Button.js +2 -1
- package/dist/button/Button.js.map +1 -1
- package/dist/button/_button.scss +157 -25
- package/dist/card/Card.d.ts +16 -0
- package/dist/card/Card.js +11 -3
- package/dist/card/Card.js.map +1 -1
- package/dist/card/ClickableCard.d.ts +2 -1
- package/dist/card/ClickableCard.js +5 -2
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/card/_card.scss +90 -19
- package/dist/card/styles.d.ts +0 -7
- package/dist/card/styles.js +2 -3
- package/dist/card/styles.js.map +1 -1
- package/dist/chip/Chip.d.ts +2 -1
- package/dist/chip/Chip.js +2 -1
- package/dist/chip/Chip.js.map +1 -1
- package/dist/chip/_chip.scss +45 -22
- package/dist/chip/styles.d.ts +12 -10
- package/dist/chip/styles.js.map +1 -1
- package/dist/cssUtils.js.map +1 -1
- package/dist/delegateEvent.d.ts +2 -2
- package/dist/delegateEvent.js.map +1 -1
- package/dist/dialog/Dialog.d.ts +8 -21
- package/dist/dialog/Dialog.js +27 -27
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/FixedDialog.d.ts +1 -3
- package/dist/dialog/FixedDialog.js +0 -8
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/dialog/_dialog.scss +67 -13
- package/dist/dialog/styles.d.ts +56 -0
- package/dist/dialog/styles.js +29 -2
- package/dist/dialog/styles.js.map +1 -1
- package/dist/divider/Divider.d.ts +0 -11
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/_divider.scss +7 -1
- package/dist/divider/styles.d.ts +11 -0
- package/dist/divider/styles.js.map +1 -1
- package/dist/draggable/useDraggable.d.ts +6 -6
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.d.ts +3 -3
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanel.d.ts +1 -1
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/_expansion-panel.scss +5 -1
- package/dist/expansion-panel/useExpansionPanels.js +12 -24
- package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
- package/dist/{form → files}/FileInput.d.ts +3 -6
- package/dist/{form → files}/FileInput.js +3 -6
- package/dist/files/FileInput.js.map +1 -0
- package/dist/files/_files.scss +22 -0
- package/dist/files/styles.d.ts +5 -0
- package/dist/files/styles.js +7 -0
- package/dist/files/styles.js.map +1 -0
- package/dist/{form → files}/useFileUpload.d.ts +7 -9
- package/dist/{form → files}/useFileUpload.js +5 -7
- package/dist/files/useFileUpload.js.map +1 -0
- package/dist/files/utils.d.ts +169 -0
- package/dist/files/utils.js +114 -0
- package/dist/files/utils.js.map +1 -0
- package/dist/{form/fileUtils.d.ts → files/validation.d.ts} +11 -176
- package/dist/{form/fileUtils.js → files/validation.js} +10 -135
- package/dist/files/validation.js.map +1 -0
- package/dist/focus/useFocusContainer.d.ts +2 -2
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/focus/utils.js.map +1 -1
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.js +4 -2
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/InputToggle.d.ts +2 -1
- package/dist/form/InputToggle.js +2 -1
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/InputToggleIcon.js.map +1 -1
- package/dist/form/Label.js +2 -2
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Listbox.d.ts +24 -0
- package/dist/form/Listbox.js +46 -0
- package/dist/form/Listbox.js.map +1 -0
- package/dist/form/ListboxProvider.d.ts +21 -0
- package/dist/form/{useListboxProvider.js → ListboxProvider.js} +1 -1
- package/dist/form/ListboxProvider.js.map +1 -0
- package/dist/form/MenuItemTextField.js +1 -2
- package/dist/form/MenuItemTextField.js.map +1 -1
- package/dist/form/NativeSelect.js +7 -4
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/Option.d.ts +49 -10
- package/dist/form/Option.js +11 -9
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Select.d.ts +2 -2
- package/dist/form/Select.js +81 -85
- package/dist/form/Select.js.map +1 -1
- package/dist/form/SelectedOption.js +2 -1
- package/dist/form/SelectedOption.js.map +1 -1
- package/dist/form/Slider.d.ts +4 -4
- package/dist/form/Slider.js +6 -2
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderThumb.d.ts +3 -3
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderValueMarks.d.ts +2 -2
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/SliderValueTooltip.js.map +1 -1
- package/dist/form/TextArea.js +1 -2
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.js +1 -2
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldContainer.js +1 -2
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/_form.scss +193 -124
- package/dist/form/formMessageContainerStyles.d.ts +10 -0
- package/dist/form/formMessageContainerStyles.js +11 -0
- package/dist/form/formMessageContainerStyles.js.map +1 -0
- package/dist/form/inputToggleStyles.js.map +1 -1
- package/dist/form/optionStyles.d.ts +1 -0
- package/dist/form/optionStyles.js +2 -2
- package/dist/form/optionStyles.js.map +1 -1
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/sliderUtils.d.ts +1 -1
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/textFieldContainerStyles.d.ts +0 -2
- package/dist/form/textFieldContainerStyles.js +1 -2
- package/dist/form/textFieldContainerStyles.js.map +1 -1
- package/dist/form/types.d.ts +3 -10
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCheckboxGroup.d.ts +17 -17
- package/dist/form/useCheckboxGroup.js +9 -17
- package/dist/form/useCheckboxGroup.js.map +1 -1
- package/dist/form/useCombobox.d.ts +56 -21
- package/dist/form/useCombobox.js +19 -4
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useEditableCombobox.d.ts +24 -4
- package/dist/form/useEditableCombobox.js +5 -0
- package/dist/form/useEditableCombobox.js.map +1 -1
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useRadioGroup.d.ts +6 -6
- package/dist/form/useRadioGroup.js.map +1 -1
- package/dist/form/useResizingTextArea.js.map +1 -1
- package/dist/form/useSelectCombobox.d.ts +3 -4
- package/dist/form/useSelectCombobox.js.map +1 -1
- package/dist/form/useTextField.d.ts +1 -1
- package/dist/form/useTextField.js.map +1 -1
- package/dist/form/useTextFieldContainerAddons.js.map +1 -1
- package/dist/hoverMode/useHoverMode.d.ts +3 -3
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/hoverMode/useHoverModeProvider.d.ts +4 -4
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +4 -2
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/TextIconSpacing.d.ts +3 -1
- package/dist/icon/TextIconSpacing.js.map +1 -1
- package/dist/icon/_icon.scss +151 -2
- package/dist/icon/iconConfig.d.ts +10 -0
- package/dist/icon/iconConfig.js +7 -0
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/icon/materialConfig.js.map +1 -1
- package/dist/icon/styles.js.map +1 -1
- package/dist/interaction/UserInteractionModeProvider.d.ts +5 -5
- package/dist/interaction/UserInteractionModeProvider.js +12 -8
- package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
- package/dist/interaction/types.d.ts +20 -2
- package/dist/interaction/types.js.map +1 -1
- package/dist/interaction/useElementInteraction.d.ts +7 -1
- package/dist/interaction/useElementInteraction.js +1 -2
- package/dist/interaction/useElementInteraction.js.map +1 -1
- package/dist/interaction/utils.d.ts +2 -2
- package/dist/interaction/utils.js +2 -2
- package/dist/interaction/utils.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/_layout.scss +23 -10
- package/dist/layout/useExpandableLayout.d.ts +3 -3
- package/dist/layout/useExpandableLayout.js.map +1 -1
- package/dist/layout/useLayoutAppBarHeight.d.ts +2 -3
- package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
- package/dist/layout/useTemporaryLayout.d.ts +2 -2
- package/dist/layout/useTemporaryLayout.js.map +1 -1
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/list/ListItem.d.ts +2 -1
- package/dist/list/ListItem.js +2 -1
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemChildren.js.map +1 -1
- package/dist/list/ListItemLink.d.ts +2 -1
- package/dist/list/ListItemLink.js +2 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/_list.scss +6 -5
- package/dist/media-queries/_media-queries.scss +12 -0
- package/dist/media-queries/appSize.js.map +1 -1
- package/dist/media-queries/useMediaQuery.js +3 -1
- package/dist/media-queries/useMediaQuery.js.map +1 -1
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.d.ts +8 -3
- package/dist/menu/Menu.js +2 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuItemButton.js +6 -2
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/useContextMenu.d.ts +3 -3
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/movement/types.d.ts +5 -5
- package/dist/movement/types.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.d.ts +5 -3
- package/dist/navigation/CollapsibleNavGroup.js +3 -4
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
- package/dist/navigation/DefaultNavigationRenderer.d.ts +1 -2
- package/dist/navigation/DefaultNavigationRenderer.js +6 -2
- package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
- package/dist/navigation/NavItemButton.d.ts +1 -1
- package/dist/navigation/NavItemButton.js +1 -0
- package/dist/navigation/NavItemButton.js.map +1 -1
- package/dist/navigation/NavItemLink.d.ts +3 -2
- package/dist/navigation/NavItemLink.js +6 -2
- package/dist/navigation/NavItemLink.js.map +1 -1
- package/dist/navigation/NavSubheader.d.ts +2 -3
- package/dist/navigation/NavSubheader.js.map +1 -1
- package/dist/navigation/Navigation.d.ts +1 -1
- package/dist/navigation/Navigation.js.map +1 -1
- package/dist/navigation/_navigation.scss +6 -5
- package/dist/navigation/types.d.ts +54 -6
- package/dist/navigation/types.js.map +1 -1
- package/dist/navigation/useActiveHeadingId.d.ts +1 -1
- package/dist/navigation/useActiveHeadingId.js.map +1 -1
- package/dist/navigation/useNavigationExpansion.d.ts +104 -0
- package/dist/navigation/useNavigationExpansion.js +77 -0
- package/dist/navigation/useNavigationExpansion.js.map +1 -0
- package/dist/navigation/utils.d.ts +13 -0
- package/dist/navigation/utils.js +36 -0
- package/dist/navigation/utils.js.map +1 -0
- package/dist/objectFit.d.ts +69 -0
- package/dist/objectFit.js +52 -0
- package/dist/objectFit.js.map +1 -0
- package/dist/overlay/_overlay.scss +2 -1
- package/dist/positioning/useFixedPositioning.d.ts +17 -4
- package/dist/positioning/useFixedPositioning.js +10 -5
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/positioning/utils.js.map +1 -1
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/_progress.scss +20 -14
- package/dist/responsive-item/ResponsiveItem.d.ts +64 -0
- package/dist/responsive-item/ResponsiveItem.js +68 -0
- package/dist/responsive-item/ResponsiveItem.js.map +1 -0
- package/dist/responsive-item/ResponsiveItemOverlay.d.ts +1 -19
- package/dist/responsive-item/ResponsiveItemOverlay.js +1 -12
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/responsive-item/_responsive-item.scss +110 -133
- package/dist/responsive-item/responsiveItemOverlayStyles.d.ts +19 -0
- package/dist/responsive-item/responsiveItemOverlayStyles.js +14 -0
- package/dist/responsive-item/responsiveItemOverlayStyles.js.map +1 -0
- package/dist/responsive-item/responsiveItemStyles.d.ts +52 -0
- package/dist/responsive-item/responsiveItemStyles.js +15 -0
- package/dist/responsive-item/responsiveItemStyles.js.map +1 -0
- package/dist/scroll/useScrollLock.d.ts +5 -0
- package/dist/scroll/useScrollLock.js.map +1 -1
- package/dist/searching/utils.d.ts +2 -2
- package/dist/searching/utils.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.d.ts +2 -1
- package/dist/segmented-button/SegmentedButton.js +2 -1
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/_segmented-button.scss +6 -6
- package/dist/sheet/_sheet.scss +18 -6
- package/dist/snackbar/ToastManager.js +15 -5
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/_snackbar.scss +30 -17
- package/dist/snackbar/useCurrentToastActions.d.ts +5 -5
- package/dist/snackbar/useCurrentToastActions.js.map +1 -1
- package/dist/table/_table.scss +15 -3
- package/dist/table/tableCellStyles.d.ts +7 -3
- package/dist/table/tableCellStyles.js +2 -2
- package/dist/table/tableCellStyles.js.map +1 -1
- package/dist/tabs/Tab.d.ts +2 -1
- package/dist/tabs/Tab.js +2 -1
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/TabList.d.ts +2 -2
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.d.ts +1 -1
- package/dist/tabs/TabListScrollButton.js +1 -1
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/_tabs.scss +30 -9
- package/dist/tabs/getTabListScrollToOptions.d.ts +18 -0
- package/dist/tabs/getTabListScrollToOptions.js +19 -0
- package/dist/tabs/getTabListScrollToOptions.js.map +1 -0
- package/dist/tabs/tabStyles.d.ts +3 -0
- package/dist/tabs/tabStyles.js.map +1 -1
- package/dist/tabs/useTabList.d.ts +1 -8
- package/dist/tabs/useTabList.js +1 -0
- package/dist/tabs/useTabList.js.map +1 -1
- package/dist/tabs/useTabs.d.ts +6 -6
- package/dist/tabs/useTabs.js.map +1 -1
- package/dist/tabs/utils.d.ts +0 -18
- package/dist/tabs/utils.js +0 -15
- package/dist/tabs/utils.js.map +1 -1
- package/dist/test-utils/ResizeObserver.d.ts +11 -12
- package/dist/test-utils/ResizeObserver.js +11 -12
- package/dist/test-utils/ResizeObserver.js.map +1 -1
- package/dist/test-utils/matchMedia.d.ts +3 -3
- package/dist/test-utils/matchMedia.js +6 -6
- package/dist/test-utils/matchMedia.js.map +1 -1
- package/dist/test-utils/polyfills/TextDecoder.js +0 -1
- package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
- package/dist/test-utils/timers.d.ts +9 -5
- package/dist/test-utils/timers.js +5 -5
- package/dist/test-utils/timers.js.map +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.d.ts +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.js +2 -1
- package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
- package/dist/theme/ThemeProvider.js +3 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/_a11y.scss +86 -13
- package/dist/theme/_colors.scss +279 -277
- package/dist/theme/_theme.scss +308 -37
- package/dist/theme/isColorScheme.d.ts +16 -0
- package/dist/theme/isColorScheme.js +19 -0
- package/dist/theme/isColorScheme.js.map +1 -0
- package/dist/theme/types.d.ts +53 -1
- package/dist/theme/types.js +1 -23
- package/dist/theme/types.js.map +1 -1
- package/dist/theme/useCSSVariables.d.ts +2 -19
- package/dist/theme/useCSSVariables.js.map +1 -1
- package/dist/theme/useColorScheme.d.ts +1 -35
- package/dist/theme/useColorScheme.js.map +1 -1
- package/dist/theme/useColorSchemeMetaTag.d.ts +1 -1
- package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
- package/dist/theme/useColorSchemeProvider.d.ts +1 -1
- package/dist/theme/useColorSchemeProvider.js +1 -1
- package/dist/theme/useColorSchemeProvider.js.map +1 -1
- package/dist/theme/{usePrefersColorScheme.js → usePrefersDarkScheme.js} +1 -1
- package/dist/theme/usePrefersDarkScheme.js.map +1 -0
- package/dist/theme/utils.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +14 -9
- package/dist/tooltip/useTooltip.js +2 -1
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/transition/_transition.scss +16 -9
- package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
- package/dist/transition/types.d.ts +1 -1
- package/dist/transition/types.js.map +1 -1
- package/dist/transition/useCarousel.d.ts +3 -3
- package/dist/transition/useCarousel.js.map +1 -1
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/useTransition.js +1 -0
- package/dist/transition/useTransition.js.map +1 -1
- package/dist/transition/utils.js.map +1 -1
- package/dist/tree/TreeItem.d.ts +2 -1
- package/dist/tree/TreeItem.js +4 -3
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeItemExpander.js.map +1 -1
- package/dist/tree/_tree.scss +8 -6
- package/dist/tree/useTreeExpansion.d.ts +1 -1
- package/dist/tree/useTreeExpansion.js +6 -18
- package/dist/tree/useTreeExpansion.js.map +1 -1
- package/dist/tree/useTreeSelection.d.ts +1 -1
- package/dist/tree/useTreeSelection.js +7 -25
- package/dist/tree/useTreeSelection.js.map +1 -1
- package/dist/tree/utils.d.ts +1 -1
- package/dist/tree/utils.js.map +1 -1
- package/dist/types.d.ts +12 -4
- package/dist/types.js.map +1 -1
- package/dist/typography/WritingDirectionProvider.d.ts +1 -1
- package/dist/typography/WritingDirectionProvider.js.map +1 -1
- package/dist/typography/_typography.scss +94 -37
- package/dist/typography/typographyStyles.js.map +1 -1
- package/dist/useDebouncedFunction.d.ts +1 -5
- package/dist/useDebouncedFunction.js +3 -1
- package/dist/useDebouncedFunction.js.map +1 -1
- package/dist/useDropzone.d.ts +4 -4
- package/dist/useDropzone.js.map +1 -1
- package/dist/useEnsuredId.js.map +1 -1
- package/dist/useIntersectionObserver.d.ts +5 -5
- package/dist/useIntersectionObserver.js.map +1 -1
- package/dist/useLocalStorage.d.ts +3 -3
- package/dist/useLocalStorage.js +1 -1
- package/dist/useLocalStorage.js.map +1 -1
- package/dist/useMutationObserver.d.ts +1 -1
- package/dist/useMutationObserver.js.map +1 -1
- package/dist/useOrientation.js +3 -1
- package/dist/useOrientation.js.map +1 -1
- package/dist/usePageInactive.d.ts +2 -2
- package/dist/usePageInactive.js.map +1 -1
- package/dist/useReadonlySet.d.ts +76 -0
- package/dist/useReadonlySet.js +72 -0
- package/dist/useReadonlySet.js.map +1 -0
- package/dist/useResizeListener.d.ts +1 -1
- package/dist/useResizeListener.js.map +1 -1
- package/dist/useResizeObserver.d.ts +19 -0
- package/dist/useResizeObserver.js +19 -0
- package/dist/useResizeObserver.js.map +1 -1
- package/dist/useThrottledFunction.d.ts +1 -5
- package/dist/useThrottledFunction.js +3 -1
- package/dist/useThrottledFunction.js.map +1 -1
- package/dist/useToggle.d.ts +3 -3
- package/dist/useToggle.js.map +1 -1
- package/dist/utils/RenderRecursively.d.ts +2 -2
- package/dist/utils/RenderRecursively.js.map +1 -1
- package/dist/utils/alphaNumericSort.d.ts +5 -5
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/dist/utils/bem.d.ts +1 -1
- package/dist/utils/bem.js +1 -1
- package/dist/utils/bem.js.map +1 -1
- package/dist/utils/debounce.d.ts +5 -0
- package/dist/utils/debounce.js +17 -0
- package/dist/utils/debounce.js.map +1 -0
- package/dist/utils/nearest.js.map +1 -1
- package/dist/utils/parseCssLengthUnit.js.map +1 -1
- package/dist/utils/throttle.d.ts +5 -0
- package/dist/utils/throttle.js +30 -0
- package/dist/utils/throttle.js.map +1 -0
- package/dist/utils/wait.js +3 -1
- package/dist/utils/wait.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.d.ts +37 -15
- package/dist/window-splitter/WindowSplitter.js +38 -17
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/dist/window-splitter/_window-splitter.scss +32 -14
- package/dist/window-splitter/styles.d.ts +14 -0
- package/dist/window-splitter/styles.js +18 -0
- package/dist/window-splitter/styles.js.map +1 -0
- package/package.json +25 -24
- package/src/app-bar/AppBar.tsx +1 -170
- package/src/app-bar/AppBarTitle.tsx +1 -44
- package/src/app-bar/styles.ts +206 -0
- package/src/autocomplete/Autocomplete.tsx +194 -211
- package/src/autocomplete/AutocompleteChip.tsx +48 -0
- package/src/autocomplete/AutocompleteCircularProgress.tsx +6 -17
- package/src/autocomplete/AutocompleteClearButton.tsx +44 -0
- package/src/autocomplete/AutocompleteDropdownButton.tsx +16 -37
- package/src/autocomplete/AutocompleteListboxChildren.tsx +68 -0
- package/src/autocomplete/autocompleteStyles.ts +48 -9
- package/src/autocomplete/defaults.ts +26 -17
- package/src/autocomplete/types.ts +744 -61
- package/src/autocomplete/useAutocomplete.ts +428 -0
- package/src/autocomplete/utils.ts +211 -0
- package/src/badge/Badge.tsx +1 -39
- package/src/badge/styles.ts +45 -0
- package/src/box/Box.tsx +11 -9
- package/src/box/styles.ts +14 -5
- package/src/button/AsyncButton.tsx +1 -1
- package/src/button/Button.tsx +5 -1
- package/src/card/Card.tsx +35 -4
- package/src/card/ClickableCard.tsx +9 -2
- package/src/card/styles.ts +1 -10
- package/src/chip/Chip.tsx +6 -1
- package/src/chip/styles.ts +12 -10
- package/src/delegateEvent.ts +5 -5
- package/src/dialog/Dialog.tsx +48 -61
- package/src/dialog/FixedDialog.tsx +1 -11
- package/src/dialog/styles.ts +97 -0
- package/src/divider/Divider.tsx +0 -12
- package/src/divider/styles.ts +12 -0
- package/src/draggable/useDraggable.ts +17 -10
- package/src/draggable/utils.ts +3 -3
- package/src/expansion-panel/ExpansionPanel.tsx +1 -1
- package/src/expansion-panel/useExpansionPanels.ts +18 -27
- package/src/{form → files}/FileInput.tsx +7 -15
- package/src/files/styles.ts +10 -0
- package/src/{form → files}/useFileUpload.ts +30 -34
- package/src/files/utils.ts +234 -0
- package/src/{form/fileUtils.ts → files/validation.ts} +15 -244
- package/src/focus/useFocusContainer.ts +16 -8
- package/src/form/FormMessageContainer.tsx +2 -2
- package/src/form/InputToggle.tsx +5 -1
- package/src/form/Label.tsx +18 -18
- package/src/form/Listbox.tsx +87 -0
- package/src/form/ListboxProvider.ts +37 -0
- package/src/form/MenuItemTextField.tsx +1 -2
- package/src/form/NativeSelect.tsx +14 -10
- package/src/form/Option.tsx +74 -22
- package/src/form/Select.tsx +89 -85
- package/src/form/SelectedOption.tsx +2 -0
- package/src/form/Slider.tsx +14 -11
- package/src/form/SliderThumb.tsx +4 -4
- package/src/form/SliderValueMarks.tsx +4 -4
- package/src/form/TextArea.tsx +6 -8
- package/src/form/TextField.tsx +0 -2
- package/src/form/TextFieldContainer.tsx +9 -11
- package/src/form/formMessageContainerStyles.ts +22 -0
- package/src/form/optionStyles.ts +7 -2
- package/src/form/sliderUtils.ts +1 -1
- package/src/form/textFieldContainerStyles.ts +9 -14
- package/src/form/types.ts +3 -11
- package/src/form/useCheckboxGroup.ts +28 -36
- package/src/form/useCombobox.ts +86 -38
- package/src/form/useEditableCombobox.ts +43 -8
- package/src/form/useRadioGroup.ts +6 -6
- package/src/form/useSelectCombobox.ts +4 -4
- package/src/form/useTextField.ts +1 -1
- package/src/hoverMode/useHoverMode.ts +3 -3
- package/src/hoverMode/useHoverModeProvider.ts +4 -4
- package/src/icon/FontIcon.tsx +4 -2
- package/src/icon/TextIconSpacing.tsx +1 -1
- package/src/icon/iconConfig.tsx +12 -0
- package/src/interaction/UserInteractionModeProvider.tsx +12 -8
- package/src/interaction/types.ts +21 -2
- package/src/interaction/useElementInteraction.tsx +9 -2
- package/src/interaction/utils.ts +7 -7
- package/src/layout/useExpandableLayout.ts +3 -3
- package/src/layout/useLayoutAppBarHeight.ts +3 -4
- package/src/layout/useTemporaryLayout.ts +2 -2
- package/src/list/ListItem.tsx +5 -1
- package/src/list/ListItemLink.tsx +5 -1
- package/src/media-queries/useMediaQuery.ts +2 -1
- package/src/menu/Menu.tsx +11 -3
- package/src/menu/MenuItemButton.tsx +7 -1
- package/src/menu/useContextMenu.ts +3 -3
- package/src/movement/types.ts +5 -5
- package/src/navigation/CollapsibleNavGroup.tsx +16 -8
- package/src/navigation/DefaultNavigationRenderer.tsx +8 -6
- package/src/navigation/NavItemButton.tsx +2 -1
- package/src/navigation/NavItemLink.tsx +11 -3
- package/src/navigation/NavSubheader.tsx +1 -1
- package/src/navigation/Navigation.tsx +1 -1
- package/src/navigation/types.ts +60 -10
- package/src/navigation/useActiveHeadingId.ts +1 -1
- package/src/navigation/useNavigationExpansion.ts +170 -0
- package/src/navigation/utils.ts +47 -0
- package/src/objectFit.ts +88 -0
- package/src/positioning/useFixedPositioning.ts +34 -11
- package/src/responsive-item/ResponsiveItem.tsx +96 -0
- package/src/responsive-item/ResponsiveItemOverlay.tsx +6 -46
- package/src/responsive-item/responsiveItemOverlayStyles.ts +46 -0
- package/src/responsive-item/responsiveItemStyles.ts +81 -0
- package/src/scroll/useScrollLock.ts +6 -0
- package/src/searching/utils.ts +3 -3
- package/src/segmented-button/SegmentedButton.tsx +5 -1
- package/src/snackbar/ToastManager.tsx +16 -5
- package/src/snackbar/useCurrentToastActions.ts +5 -5
- package/src/table/tableCellStyles.ts +10 -6
- package/src/tabs/Tab.tsx +4 -1
- package/src/tabs/TabList.tsx +2 -2
- package/src/tabs/TabListScrollButton.tsx +4 -4
- package/src/tabs/getTabListScrollToOptions.ts +37 -0
- package/src/tabs/tabStyles.ts +4 -0
- package/src/tabs/useTabList.ts +2 -9
- package/src/tabs/useTabs.ts +6 -6
- package/src/tabs/utils.ts +0 -38
- package/src/test-utils/ResizeObserver.ts +11 -12
- package/src/test-utils/matchMedia.ts +7 -7
- package/src/test-utils/polyfills/TextDecoder.ts +0 -1
- package/src/test-utils/timers.ts +10 -7
- package/src/theme/LocalStorageColorSchemeProvider.tsx +4 -4
- package/src/theme/ThemeProvider.tsx +3 -3
- package/src/theme/isColorScheme.ts +22 -0
- package/src/theme/types.ts +67 -1
- package/src/theme/useCSSVariables.ts +7 -30
- package/src/theme/useColorScheme.ts +1 -40
- package/src/theme/useColorSchemeMetaTag.ts +1 -1
- package/src/theme/useColorSchemeProvider.ts +2 -2
- package/src/tooltip/useTooltip.ts +17 -9
- package/src/transition/types.ts +1 -1
- package/src/transition/useCarousel.ts +3 -3
- package/src/transition/useTransition.ts +1 -0
- package/src/tree/TreeItem.tsx +7 -1
- package/src/tree/TreeItemExpander.tsx +1 -1
- package/src/tree/useTreeExpansion.ts +7 -25
- package/src/tree/useTreeSelection.ts +8 -32
- package/src/tree/utils.ts +6 -2
- package/src/types.ts +20 -4
- package/src/typography/WritingDirectionProvider.tsx +1 -1
- package/src/useDebouncedFunction.ts +4 -9
- package/src/useDropzone.ts +4 -4
- package/src/useIntersectionObserver.ts +5 -5
- package/src/useLocalStorage.ts +6 -6
- package/src/useMutationObserver.ts +1 -1
- package/src/useOrientation.ts +3 -1
- package/src/usePageInactive.ts +2 -2
- package/src/useReadonlySet.ts +122 -0
- package/src/useResizeListener.ts +1 -1
- package/src/useResizeObserver.ts +19 -0
- package/src/useThrottledFunction.ts +6 -9
- package/src/useToggle.ts +3 -3
- package/src/utils/RenderRecursively.tsx +2 -2
- package/src/utils/alphaNumericSort.ts +5 -5
- package/src/utils/bem.ts +1 -1
- package/src/utils/debounce.ts +22 -0
- package/src/utils/throttle.ts +38 -0
- package/src/utils/wait.ts +5 -1
- package/src/window-splitter/WindowSplitter.tsx +38 -43
- package/src/window-splitter/styles.ts +42 -0
- package/dist/autocomplete/FilterAutocompleteOptions.d.ts +0 -8
- package/dist/autocomplete/FilterAutocompleteOptions.js +0 -57
- package/dist/autocomplete/FilterAutocompleteOptions.js.map +0 -1
- package/dist/dialog/DialogContainer.d.ts +0 -14
- package/dist/dialog/DialogContainer.js +0 -20
- package/dist/dialog/DialogContainer.js.map +0 -1
- package/dist/form/FileInput.js.map +0 -1
- package/dist/form/fileUtils.js.map +0 -1
- package/dist/form/useFileUpload.js.map +0 -1
- package/dist/form/useListboxProvider.d.ts +0 -31
- package/dist/form/useListboxProvider.js.map +0 -1
- package/dist/navigation/getHrefFromParents.d.ts +0 -5
- package/dist/navigation/getHrefFromParents.js +0 -13
- package/dist/navigation/getHrefFromParents.js.map +0 -1
- package/dist/responsive-item/ResponsiveItemContainer.d.ts +0 -115
- package/dist/responsive-item/ResponsiveItemContainer.js +0 -80
- package/dist/responsive-item/ResponsiveItemContainer.js.map +0 -1
- package/dist/responsive-item/styles.d.ts +0 -34
- package/dist/responsive-item/styles.js +0 -17
- package/dist/responsive-item/styles.js.map +0 -1
- package/dist/theme/usePrefersColorScheme.js.map +0 -1
- package/src/autocomplete/FilterAutocompleteOptions.tsx +0 -86
- package/src/dialog/DialogContainer.tsx +0 -28
- package/src/form/useListboxProvider.ts +0 -45
- package/src/navigation/getHrefFromParents.ts +0 -15
- package/src/responsive-item/ResponsiveItemContainer.tsx +0 -174
- package/src/responsive-item/styles.ts +0 -58
- /package/dist/theme/{usePrefersColorScheme.d.ts → usePrefersDarkScheme.d.ts} +0 -0
- /package/src/theme/{usePrefersColorScheme.ts → usePrefersDarkScheme.ts} +0 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { type ChangeEventHandler, type DragEventHandler } from "react";
|
|
2
|
+
|
|
3
|
+
/** @since 2.9.0 */
|
|
4
|
+
export interface BaseFileUploadStats {
|
|
5
|
+
/**
|
|
6
|
+
* A unique key associated with each upload generated by `nanoid`.
|
|
7
|
+
*/
|
|
8
|
+
key: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The file instance that is being uploaded.
|
|
12
|
+
*/
|
|
13
|
+
file: File;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The current upload progress as a percentage from 0 - 100 percent.
|
|
17
|
+
*/
|
|
18
|
+
progress: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** @since 2.9.0 */
|
|
22
|
+
export interface ProcessingFileUploadStats extends BaseFileUploadStats {
|
|
23
|
+
status: "pending" | "uploading";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** @since 2.9.0 */
|
|
27
|
+
export type FileReaderResult = FileReader["result"];
|
|
28
|
+
|
|
29
|
+
/** @since 2.9.0 */
|
|
30
|
+
export interface CompletedFileUploadStats extends BaseFileUploadStats {
|
|
31
|
+
status: "complete";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The result after a `FileReader` has read a file completely.
|
|
35
|
+
*
|
|
36
|
+
* Note: This _should_ be an `ArrayBuffer` if the next step is to upload to a
|
|
37
|
+
* server.
|
|
38
|
+
*
|
|
39
|
+
* @see {@link FileReaderParser}
|
|
40
|
+
* @see {@link getFileParser}
|
|
41
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/FileReader | FileReader}
|
|
42
|
+
*/
|
|
43
|
+
result: FileReaderResult;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** @since 2.9.0 */
|
|
47
|
+
export type FileUploadStats =
|
|
48
|
+
| ProcessingFileUploadStats
|
|
49
|
+
| CompletedFileUploadStats;
|
|
50
|
+
|
|
51
|
+
/** @since 2.9.0 */
|
|
52
|
+
export type FileUploadStatus = FileUploadStats["status"];
|
|
53
|
+
|
|
54
|
+
/** @since 2.9.0 */
|
|
55
|
+
export interface FileUploadHandlers<E extends HTMLElement> {
|
|
56
|
+
onDrop?: DragEventHandler<E>;
|
|
57
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* This will first check if the mime-type of the file starts with `text/` and
|
|
62
|
+
* fallback to checking a few file names or extensions that should be considered
|
|
63
|
+
* text.
|
|
64
|
+
*
|
|
65
|
+
* This function is not guaranteed to be 100% correct and is only useful if
|
|
66
|
+
* trying to generate a preview of files uploaded to the browser.
|
|
67
|
+
*
|
|
68
|
+
* @param file - The file to check
|
|
69
|
+
* @returns `true` if the file should be considered as a text-content file.
|
|
70
|
+
* @since 2.9.0
|
|
71
|
+
*/
|
|
72
|
+
export function isTextFile(file: File): boolean {
|
|
73
|
+
return /\.((j|t)sx?|json|lock|hbs|ya?ml|log|txt|md)$/i.test(file.name);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* This will first check if the mime-type of the file starts with `text\/` and
|
|
78
|
+
* fallback to checking a few file names or extensions that should be considered
|
|
79
|
+
* text.
|
|
80
|
+
*
|
|
81
|
+
* This function is not guaranteed to be 100% correct and is only useful if
|
|
82
|
+
* trying to generate a preview of files uploaded to the browser.
|
|
83
|
+
*
|
|
84
|
+
* @param file - The file to check
|
|
85
|
+
* @returns `true` if the file should be considered as a text content file.
|
|
86
|
+
* @since 2.9.0
|
|
87
|
+
*/
|
|
88
|
+
export function isImageFile(file: File): boolean {
|
|
89
|
+
return /\.(a?png|avif|svg|tiff|gifv?|jpe?g)/i.test(file.name);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* This will first check if the mime-type of the file starts with `audio/` and
|
|
94
|
+
* fallback to checking a few file names or extensions that should be considered
|
|
95
|
+
* audio.
|
|
96
|
+
*
|
|
97
|
+
* This function is not guaranteed to be 100% correct and is only useful if
|
|
98
|
+
* trying to generate a preview of files uploaded to the browser.
|
|
99
|
+
*
|
|
100
|
+
* @param file - The file to check
|
|
101
|
+
* @returns `true` if the file should be considered as a audio content file.
|
|
102
|
+
* @since 2.9.0
|
|
103
|
+
*/
|
|
104
|
+
export function isAudioFile(file: File): boolean {
|
|
105
|
+
return /\.(mp3|wav|ogg|m4p|flac)$/i.test(file.name);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* This will first check if the mime-type of the file starts with `video/` and
|
|
110
|
+
* fallback to checking a few file names or extensions that should be considered
|
|
111
|
+
* video.
|
|
112
|
+
*
|
|
113
|
+
* This function is not guaranteed to be 100% correct and is only useful if
|
|
114
|
+
* trying to generate a preview of files uploaded to the browser.
|
|
115
|
+
*
|
|
116
|
+
* @param file - The file to check
|
|
117
|
+
* @returns `true` if the file should be considered as a video content file.
|
|
118
|
+
* @since 2.9.0
|
|
119
|
+
*/
|
|
120
|
+
export function isVideoFile(file: File): boolean {
|
|
121
|
+
return /\.(mkv|mpe?g|mov|avi|flv|webm|mp4)$/i.test(file.name);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* This function is not guaranteed to be 100% correct and is only useful if
|
|
126
|
+
* trying to generate a preview of files uploaded to the browser.
|
|
127
|
+
*
|
|
128
|
+
* @param file - The file to check
|
|
129
|
+
* @returns `true` if the file matches an image, audio, or video file.
|
|
130
|
+
* @since 2.9.0
|
|
131
|
+
*/
|
|
132
|
+
export function isMediaFile(file: File): boolean {
|
|
133
|
+
return isImageFile(file) || isAudioFile(file) || isVideoFile(file);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* One of the function names from a `FileReader` to upload a file to the
|
|
138
|
+
* client.
|
|
139
|
+
*
|
|
140
|
+
* Note: If this file does not need to be previewed in the browser and will
|
|
141
|
+
* immediately be uploaded to a server, use `readAsArrayBuffer`.
|
|
142
|
+
*
|
|
143
|
+
* @since 2.9.0
|
|
144
|
+
* @since 6.0.0 Removed `"readAsBinaryString` since it is deprecated
|
|
145
|
+
* {@see https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsBinaryString}
|
|
146
|
+
*/
|
|
147
|
+
export type FileReaderParser =
|
|
148
|
+
| "readAsText"
|
|
149
|
+
| "readAsDataURL"
|
|
150
|
+
| "readAsArrayBuffer";
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A function that should return one of the {@link FileReaderParser} functions
|
|
154
|
+
* to start uploading a file to the browser.
|
|
155
|
+
*
|
|
156
|
+
* @example The Default File Upload Parser
|
|
157
|
+
* ```ts
|
|
158
|
+
* export const getFileParser: GetFileParser = (file) => {
|
|
159
|
+
* if (isMediaFile(file)) {
|
|
160
|
+
* return "readAsDataURL";
|
|
161
|
+
* }
|
|
162
|
+
*
|
|
163
|
+
* if (isTextFile(file)) {
|
|
164
|
+
* return "readAsText";
|
|
165
|
+
* }
|
|
166
|
+
*
|
|
167
|
+
* return "readAsArrayBuffer";
|
|
168
|
+
* };
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @param file - The file to get a parser for
|
|
172
|
+
* @returns the {@link FileReaderParser} string.
|
|
173
|
+
* @since 2.9.0
|
|
174
|
+
*/
|
|
175
|
+
export type GetFileParser = (file: File) => FileReaderParser;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* This function will attempt to read:
|
|
179
|
+
* - media (image, audio, and video) files as a data url so they can be
|
|
180
|
+
* previewed in `<img>`, `<audio>`, and `<video>` tags
|
|
181
|
+
* - text files as plain text
|
|
182
|
+
* - everything else as an `ArrayBuffer` which can be manually converted into a
|
|
183
|
+
* data url if needed with `URL.createObjectURL`
|
|
184
|
+
*
|
|
185
|
+
* @since 2.9.0
|
|
186
|
+
*/
|
|
187
|
+
export const getFileParser: GetFileParser = (file) => {
|
|
188
|
+
if (isMediaFile(file)) {
|
|
189
|
+
return "readAsDataURL";
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (isTextFile(file)) {
|
|
193
|
+
return "readAsText";
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return "readAsArrayBuffer";
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/** @since 2.9.0 */
|
|
200
|
+
export interface SplitFileUploads {
|
|
201
|
+
readonly pending: readonly ProcessingFileUploadStats[];
|
|
202
|
+
readonly uploading: readonly ProcessingFileUploadStats[];
|
|
203
|
+
readonly complete: readonly CompletedFileUploadStats[];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* This util will split all the current upload stats by status.
|
|
208
|
+
*
|
|
209
|
+
* @param stats - The {@link FileUploadStats} list generally returned by the
|
|
210
|
+
* {@link useFileUpload} hook.
|
|
211
|
+
* @returns the {@link SplitFileUploads}.
|
|
212
|
+
* @since 2.9.0
|
|
213
|
+
*/
|
|
214
|
+
export function getSplitFileUploads(
|
|
215
|
+
stats: readonly FileUploadStats[]
|
|
216
|
+
): SplitFileUploads {
|
|
217
|
+
const pending: ProcessingFileUploadStats[] = [];
|
|
218
|
+
const uploading: ProcessingFileUploadStats[] = [];
|
|
219
|
+
const complete: CompletedFileUploadStats[] = [];
|
|
220
|
+
stats.forEach((stat) => {
|
|
221
|
+
if (stat.status === "pending") {
|
|
222
|
+
pending.push(stat);
|
|
223
|
+
} else if (stat.status === "uploading") {
|
|
224
|
+
uploading.push(stat);
|
|
225
|
+
} else if (stat.status === "complete") {
|
|
226
|
+
complete.push(stat);
|
|
227
|
+
} else {
|
|
228
|
+
/* istanbul ignore next */
|
|
229
|
+
throw new Error("Invalid upload stat");
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
return { pending, uploading, complete };
|
|
234
|
+
}
|
|
@@ -1,62 +1,4 @@
|
|
|
1
1
|
import { nanoid } from "nanoid";
|
|
2
|
-
import { type ChangeEventHandler, type DragEventHandler } from "react";
|
|
3
|
-
|
|
4
|
-
/** @since 2.9.0 */
|
|
5
|
-
export interface BaseFileUploadStats {
|
|
6
|
-
/**
|
|
7
|
-
* A unique key associated with each upload generated by `nanoid`.
|
|
8
|
-
*/
|
|
9
|
-
key: string;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The file instance that is being uploaded.
|
|
13
|
-
*/
|
|
14
|
-
file: File;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The current upload progress as a percentage from 0 - 100 percent.
|
|
18
|
-
*/
|
|
19
|
-
progress: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** @since 2.9.0 */
|
|
23
|
-
export interface ProcessingFileUploadStats extends BaseFileUploadStats {
|
|
24
|
-
status: "pending" | "uploading";
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** @since 2.9.0 */
|
|
28
|
-
export type FileReaderResult = FileReader["result"];
|
|
29
|
-
|
|
30
|
-
/** @since 2.9.0 */
|
|
31
|
-
export interface CompletedFileUploadStats extends BaseFileUploadStats {
|
|
32
|
-
status: "complete";
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The result after a `FileReader` has read a file completely.
|
|
36
|
-
*
|
|
37
|
-
* Note: This _should_ be an `ArrayBuffer` if the next step is to upload to a
|
|
38
|
-
* server.
|
|
39
|
-
*
|
|
40
|
-
* @see {@link FileReaderParser}
|
|
41
|
-
* @see {@link getFileParser}
|
|
42
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/FileReader | FileReader}
|
|
43
|
-
*/
|
|
44
|
-
result: FileReaderResult;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** @since 2.9.0 */
|
|
48
|
-
export type FileUploadStats =
|
|
49
|
-
| ProcessingFileUploadStats
|
|
50
|
-
| CompletedFileUploadStats;
|
|
51
|
-
|
|
52
|
-
/** @since 2.9.0 */
|
|
53
|
-
export type FileUploadStatus = FileUploadStats["status"];
|
|
54
|
-
|
|
55
|
-
/** @since 2.9.0 */
|
|
56
|
-
export interface FileUploadHandlers<E extends HTMLElement> {
|
|
57
|
-
onDrop?: DragEventHandler<E>;
|
|
58
|
-
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
59
|
-
}
|
|
60
2
|
|
|
61
3
|
/**
|
|
62
4
|
* An error that will be created if a user tries dragging and dropping files
|
|
@@ -197,7 +139,7 @@ export type FileValidationError<E = GenericFileError> =
|
|
|
197
139
|
* @param error - The error to check
|
|
198
140
|
* @returns true if the error is a {@link FileAccessError}
|
|
199
141
|
*/
|
|
200
|
-
export function isGenericFileError<CustomError extends
|
|
142
|
+
export function isGenericFileError<CustomError extends object>(
|
|
201
143
|
error: FileValidationError<CustomError>
|
|
202
144
|
): error is GenericFileError {
|
|
203
145
|
return "name" in error && error.name === "GenericFileError";
|
|
@@ -211,7 +153,7 @@ export function isGenericFileError<CustomError extends {}>(
|
|
|
211
153
|
* @param error - The error to check
|
|
212
154
|
* @returns true if the error is a {@link FileAccessError}
|
|
213
155
|
*/
|
|
214
|
-
export function isFileAccessError<CustomError extends
|
|
156
|
+
export function isFileAccessError<CustomError extends object>(
|
|
215
157
|
error: FileValidationError<CustomError>
|
|
216
158
|
): error is FileAccessError {
|
|
217
159
|
return "name" in error && error.name === "FileAccessError";
|
|
@@ -225,7 +167,7 @@ export function isFileAccessError<CustomError extends {}>(
|
|
|
225
167
|
* @param error - The error to check
|
|
226
168
|
* @returns true if the error is a {@link TooManyFilesError}
|
|
227
169
|
*/
|
|
228
|
-
export function isTooManyFilesError<CustomError extends
|
|
170
|
+
export function isTooManyFilesError<CustomError extends object>(
|
|
229
171
|
error: FileValidationError<CustomError>
|
|
230
172
|
): error is TooManyFilesError {
|
|
231
173
|
return "name" in error && error.name === "TooManyFilesError";
|
|
@@ -239,7 +181,7 @@ export function isTooManyFilesError<CustomError extends {}>(
|
|
|
239
181
|
* @param error - The error to check
|
|
240
182
|
* @returns true if the error is a {@link FileSizeError}
|
|
241
183
|
*/
|
|
242
|
-
export function isFileSizeError<CustomError extends
|
|
184
|
+
export function isFileSizeError<CustomError extends object>(
|
|
243
185
|
error: FileValidationError<CustomError>
|
|
244
186
|
): error is FileSizeError {
|
|
245
187
|
return "name" in error && error.name === "FileSizeError";
|
|
@@ -253,7 +195,7 @@ export function isFileSizeError<CustomError extends {}>(
|
|
|
253
195
|
* @param error - The error to check
|
|
254
196
|
* @returns true if the error is a {@link FileExtensionError}
|
|
255
197
|
*/
|
|
256
|
-
export function isFileExtensionError<CustomError extends
|
|
198
|
+
export function isFileExtensionError<CustomError extends object>(
|
|
257
199
|
error: FileValidationError<CustomError>
|
|
258
200
|
): error is FileExtensionError {
|
|
259
201
|
return "name" in error && error.name === "FileExtensionError";
|
|
@@ -359,7 +301,9 @@ export interface FilesValidationOptions
|
|
|
359
301
|
totalFiles: number;
|
|
360
302
|
}
|
|
361
303
|
|
|
362
|
-
/**
|
|
304
|
+
/**
|
|
305
|
+
* @since 2.9.0
|
|
306
|
+
*/
|
|
363
307
|
export interface ValidatedFilesResult<CustomError> {
|
|
364
308
|
/**
|
|
365
309
|
* A filtered list of files that have been validated and can be queued for the
|
|
@@ -403,7 +347,7 @@ export interface ValidatedFilesResult<CustomError> {
|
|
|
403
347
|
* };
|
|
404
348
|
* ```
|
|
405
349
|
*
|
|
406
|
-
* @
|
|
350
|
+
* @typeParam E - An optional custom file validation error.
|
|
407
351
|
* @param files - The list of files to check
|
|
408
352
|
* @param options - The {@link FilesValidationOptions}
|
|
409
353
|
* @returns the {@link ValidatedFilesResult}
|
|
@@ -420,7 +364,7 @@ export type FilesValidator<CustomError = never> = (
|
|
|
420
364
|
* {@link useFileUpload} that ensures the {@link FilesValidationOptions} are
|
|
421
365
|
* enforced before allowing a file to be uploaded.
|
|
422
366
|
*
|
|
423
|
-
* @
|
|
367
|
+
* @typeParam E - An optional custom file validation error.
|
|
424
368
|
* @param files - The list of files to check
|
|
425
369
|
* @param options - The {@link FilesValidationOptions}
|
|
426
370
|
* @returns the {@link ValidatedFilesResult}
|
|
@@ -428,7 +372,9 @@ export type FilesValidator<CustomError = never> = (
|
|
|
428
372
|
*/
|
|
429
373
|
export function validateFiles<CustomError>(
|
|
430
374
|
files: readonly File[],
|
|
431
|
-
|
|
375
|
+
options: FilesValidationOptions
|
|
376
|
+
): ValidatedFilesResult<CustomError> {
|
|
377
|
+
const {
|
|
432
378
|
maxFiles,
|
|
433
379
|
extensions,
|
|
434
380
|
minFileSize,
|
|
@@ -437,8 +383,8 @@ export function validateFiles<CustomError>(
|
|
|
437
383
|
totalFiles,
|
|
438
384
|
totalFileSize,
|
|
439
385
|
isValidFileName,
|
|
440
|
-
}
|
|
441
|
-
|
|
386
|
+
} = options;
|
|
387
|
+
|
|
442
388
|
const errors: FileValidationError<CustomError>[] = [];
|
|
443
389
|
const pending: File[] = [];
|
|
444
390
|
const extraFiles: File[] = [];
|
|
@@ -510,178 +456,3 @@ export function validateFiles<CustomError>(
|
|
|
510
456
|
|
|
511
457
|
return { pending, errors };
|
|
512
458
|
}
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* This will first check if the mime-type of the file starts with `text/` and
|
|
516
|
-
* fallback to checking a few file names or extensions that should be considered
|
|
517
|
-
* text.
|
|
518
|
-
*
|
|
519
|
-
* This function is not guaranteed to be 100% correct and is only useful if
|
|
520
|
-
* trying to generate a preview of files uploaded to the browser.
|
|
521
|
-
*
|
|
522
|
-
* @param file - The file to check
|
|
523
|
-
* @returns `true` if the file should be considered as a text-content file.
|
|
524
|
-
* @since 2.9.0
|
|
525
|
-
*/
|
|
526
|
-
export function isTextFile(file: File): boolean {
|
|
527
|
-
return /\.((j|t)sx?|json|lock|hbs|ya?ml|log|txt|md)$/i.test(file.name);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* This will first check if the mime-type of the file starts with `text\/` and
|
|
532
|
-
* fallback to checking a few file names or extensions that should be considered
|
|
533
|
-
* text.
|
|
534
|
-
*
|
|
535
|
-
* This function is not guaranteed to be 100% correct and is only useful if
|
|
536
|
-
* trying to generate a preview of files uploaded to the browser.
|
|
537
|
-
*
|
|
538
|
-
* @param file - The file to check
|
|
539
|
-
* @returns `true` if the file should be considered as a text content file.
|
|
540
|
-
* @since 2.9.0
|
|
541
|
-
*/
|
|
542
|
-
export function isImageFile(file: File): boolean {
|
|
543
|
-
return /\.(a?png|avif|svg|tiff|gifv?|jpe?g)/i.test(file.name);
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
/**
|
|
547
|
-
* This will first check if the mime-type of the file starts with `audio/` and
|
|
548
|
-
* fallback to checking a few file names or extensions that should be considered
|
|
549
|
-
* audio.
|
|
550
|
-
*
|
|
551
|
-
* This function is not guaranteed to be 100% correct and is only useful if
|
|
552
|
-
* trying to generate a preview of files uploaded to the browser.
|
|
553
|
-
*
|
|
554
|
-
* @param file - The file to check
|
|
555
|
-
* @returns `true` if the file should be considered as a audio content file.
|
|
556
|
-
* @since 2.9.0
|
|
557
|
-
*/
|
|
558
|
-
export function isAudioFile(file: File): boolean {
|
|
559
|
-
return /\.(mp3|wav|ogg|m4p|flac)$/i.test(file.name);
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* This will first check if the mime-type of the file starts with `video/` and
|
|
564
|
-
* fallback to checking a few file names or extensions that should be considered
|
|
565
|
-
* video.
|
|
566
|
-
*
|
|
567
|
-
* This function is not guaranteed to be 100% correct and is only useful if
|
|
568
|
-
* trying to generate a preview of files uploaded to the browser.
|
|
569
|
-
*
|
|
570
|
-
* @param file - The file to check
|
|
571
|
-
* @returns `true` if the file should be considered as a video content file.
|
|
572
|
-
* @since 2.9.0
|
|
573
|
-
*/
|
|
574
|
-
export function isVideoFile(file: File): boolean {
|
|
575
|
-
return /\.(mkv|mpe?g|mov|avi|flv|webm|mp4)$/i.test(file.name);
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* This function is not guaranteed to be 100% correct and is only useful if
|
|
580
|
-
* trying to generate a preview of files uploaded to the browser.
|
|
581
|
-
*
|
|
582
|
-
* @param file - The file to check
|
|
583
|
-
* @returns `true` if the file matches an image, audio, or video file.
|
|
584
|
-
* @since 2.9.0
|
|
585
|
-
*/
|
|
586
|
-
export function isMediaFile(file: File): boolean {
|
|
587
|
-
return isImageFile(file) || isAudioFile(file) || isVideoFile(file);
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
* One of the function names from a `FileReader` to upload a file to the
|
|
592
|
-
* client.
|
|
593
|
-
*
|
|
594
|
-
* Note: If this file does not need to be previewed in the browser and will
|
|
595
|
-
* immediately be uploaded to a server, use `readAsArrayBuffer`.
|
|
596
|
-
*
|
|
597
|
-
* @since 2.9.0
|
|
598
|
-
*/
|
|
599
|
-
export type FileReaderParser =
|
|
600
|
-
| "readAsText"
|
|
601
|
-
| "readAsDataURL"
|
|
602
|
-
| "readAsBinaryString"
|
|
603
|
-
| "readAsArrayBuffer";
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* A function that should return one of the {@link FileReaderParser} functions
|
|
607
|
-
* to start uploading a file to the browser.
|
|
608
|
-
*
|
|
609
|
-
* @example The Default File Upload Parser
|
|
610
|
-
* ```ts
|
|
611
|
-
* export const getFileParser: GetFileParser = (file) => {
|
|
612
|
-
* if (isMediaFile(file)) {
|
|
613
|
-
* return "readAsDataURL";
|
|
614
|
-
* }
|
|
615
|
-
*
|
|
616
|
-
* if (isTextFile(file)) {
|
|
617
|
-
* return "readAsText";
|
|
618
|
-
* }
|
|
619
|
-
*
|
|
620
|
-
* return "readAsArrayBuffer";
|
|
621
|
-
* };
|
|
622
|
-
* ```
|
|
623
|
-
*
|
|
624
|
-
* @param file - The file to get a parser for
|
|
625
|
-
* @returns the {@link FileReaderParser} string.
|
|
626
|
-
* @since 2.9.0
|
|
627
|
-
*/
|
|
628
|
-
export type GetFileParser = (file: File) => FileReaderParser;
|
|
629
|
-
|
|
630
|
-
/**
|
|
631
|
-
* This function will attempt to read:
|
|
632
|
-
* - media (image, audio, and video) files as a data url so they can be
|
|
633
|
-
* previewed in `<img>`, `<audio>`, and `<video>` tags
|
|
634
|
-
* - text files as plain text
|
|
635
|
-
* - everything else as an `ArrayBuffer` which can be manually converted into a
|
|
636
|
-
* data url if needed with `URL.createObjectURL`
|
|
637
|
-
*
|
|
638
|
-
* @since 2.9.0
|
|
639
|
-
*/
|
|
640
|
-
export const getFileParser: GetFileParser = (file) => {
|
|
641
|
-
if (isMediaFile(file)) {
|
|
642
|
-
return "readAsDataURL";
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
if (isTextFile(file)) {
|
|
646
|
-
return "readAsText";
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
return "readAsArrayBuffer";
|
|
650
|
-
};
|
|
651
|
-
|
|
652
|
-
/** @since 2.9.0 */
|
|
653
|
-
export interface SplitFileUploads {
|
|
654
|
-
readonly pending: readonly ProcessingFileUploadStats[];
|
|
655
|
-
readonly uploading: readonly ProcessingFileUploadStats[];
|
|
656
|
-
readonly complete: readonly CompletedFileUploadStats[];
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* This util will split all the current upload stats by status.
|
|
661
|
-
*
|
|
662
|
-
* @param stats - The {@link FileUploadStats} list generally returned by the
|
|
663
|
-
* {@link useFileUpload} hook.
|
|
664
|
-
* @returns the {@link SplitFileUploads}.
|
|
665
|
-
* @since 2.9.0
|
|
666
|
-
*/
|
|
667
|
-
export function getSplitFileUploads(
|
|
668
|
-
stats: readonly FileUploadStats[]
|
|
669
|
-
): SplitFileUploads {
|
|
670
|
-
const pending: ProcessingFileUploadStats[] = [];
|
|
671
|
-
const uploading: ProcessingFileUploadStats[] = [];
|
|
672
|
-
const complete: CompletedFileUploadStats[] = [];
|
|
673
|
-
stats.forEach((stat) => {
|
|
674
|
-
if (stat.status === "pending") {
|
|
675
|
-
pending.push(stat);
|
|
676
|
-
} else if (stat.status === "uploading") {
|
|
677
|
-
uploading.push(stat);
|
|
678
|
-
} else if (stat.status === "complete") {
|
|
679
|
-
complete.push(stat);
|
|
680
|
-
} else {
|
|
681
|
-
/* istanbul ignore next */
|
|
682
|
-
throw new Error("Invalid upload stat");
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
|
|
686
|
-
return { pending, uploading, complete };
|
|
687
|
-
}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
useEffect,
|
|
4
|
+
useRef,
|
|
5
|
+
type KeyboardEventHandler,
|
|
6
|
+
type Ref,
|
|
7
|
+
type RefObject,
|
|
8
|
+
} from "react";
|
|
4
9
|
import { TRANSITION_CONFIG } from "../transition/config.js";
|
|
5
|
-
import
|
|
6
|
-
TransitionCallbacks,
|
|
7
|
-
TransitionEnterHandler,
|
|
8
|
-
TransitionExitHandler,
|
|
10
|
+
import {
|
|
11
|
+
type TransitionCallbacks,
|
|
12
|
+
type TransitionEnterHandler,
|
|
13
|
+
type TransitionExitHandler,
|
|
9
14
|
} from "../transition/types.js";
|
|
10
15
|
import { useEnsuredRef } from "../useEnsuredRef.js";
|
|
11
|
-
import
|
|
12
|
-
|
|
16
|
+
import {
|
|
17
|
+
focusElementWithin,
|
|
18
|
+
getFocusableElements,
|
|
19
|
+
type FocusElementWithinType,
|
|
20
|
+
} from "./utils.js";
|
|
13
21
|
|
|
14
22
|
const noop = (): void => {
|
|
15
23
|
// do nothing
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { cnb } from "cnbuilder";
|
|
2
1
|
import { forwardRef, type HTMLAttributes } from "react";
|
|
3
2
|
import { type PropsWithRef } from "../types.js";
|
|
4
3
|
import { FormMessage } from "./FormMessage.js";
|
|
4
|
+
import { formMessageContainer } from "./formMessageContainerStyles.js";
|
|
5
5
|
import { type FormMessageProps } from "./types.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -36,7 +36,7 @@ export const FormMessageContainer = forwardRef<
|
|
|
36
36
|
<div
|
|
37
37
|
{...remaining}
|
|
38
38
|
ref={ref}
|
|
39
|
-
className={
|
|
39
|
+
className={formMessageContainer({ className })}
|
|
40
40
|
>
|
|
41
41
|
{children}
|
|
42
42
|
<FormMessage {...messageProps} />
|
package/src/form/InputToggle.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type LabelHTMLAttributes,
|
|
9
9
|
type ReactNode,
|
|
10
10
|
} from "react";
|
|
11
|
+
import { type ComponentWithRippleProps } from "../interaction/types.js";
|
|
11
12
|
import { useElementInteraction } from "../interaction/useElementInteraction.js";
|
|
12
13
|
import { type PropsWithRef } from "../types.js";
|
|
13
14
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
@@ -151,7 +152,8 @@ export interface BaseInputToggleProps
|
|
|
151
152
|
FormMessageContainerExtension,
|
|
152
153
|
FormComponentStates,
|
|
153
154
|
InputToggleIconProps,
|
|
154
|
-
InputToggleLabelProps
|
|
155
|
+
InputToggleLabelProps,
|
|
156
|
+
ComponentWithRippleProps {
|
|
155
157
|
/**
|
|
156
158
|
* @see https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing
|
|
157
159
|
* @defaultValue `type === "checkbox" ? "off" : undefined`
|
|
@@ -262,12 +264,14 @@ export const InputToggle = forwardRef<HTMLInputElement, InputToggleProps>(
|
|
|
262
264
|
onTouchEnd,
|
|
263
265
|
onTouchMove,
|
|
264
266
|
onTouchStart,
|
|
267
|
+
disableRipple,
|
|
265
268
|
...remaining
|
|
266
269
|
} = props as CheckboxInputToggleProps;
|
|
267
270
|
const { disabled = false, checked } = props;
|
|
268
271
|
|
|
269
272
|
const id = useEnsuredId(propId, type);
|
|
270
273
|
const { pressedClassName, ripples, handlers } = useElementInteraction({
|
|
274
|
+
mode: disableRipple ? "none" : undefined,
|
|
271
275
|
disabled,
|
|
272
276
|
onBlur,
|
|
273
277
|
onClick,
|
package/src/form/Label.tsx
CHANGED
|
@@ -22,15 +22,15 @@ const labelStyles = bem("rmd-label");
|
|
|
22
22
|
export function label(options: LabelClassNameOptions): string {
|
|
23
23
|
const {
|
|
24
24
|
className,
|
|
25
|
-
gap
|
|
26
|
-
error
|
|
27
|
-
dense
|
|
28
|
-
active
|
|
29
|
-
stacked
|
|
30
|
-
reversed
|
|
31
|
-
disabled
|
|
32
|
-
floating
|
|
33
|
-
inactive
|
|
25
|
+
gap,
|
|
26
|
+
error,
|
|
27
|
+
dense,
|
|
28
|
+
active,
|
|
29
|
+
stacked,
|
|
30
|
+
reversed,
|
|
31
|
+
disabled,
|
|
32
|
+
floating,
|
|
33
|
+
inactive,
|
|
34
34
|
floatingActive = active,
|
|
35
35
|
} = options;
|
|
36
36
|
|
|
@@ -76,15 +76,15 @@ export function label(options: LabelClassNameOptions): string {
|
|
|
76
76
|
export const Label = forwardRef<HTMLLabelElement, LabelProps>(
|
|
77
77
|
function Label(props, ref) {
|
|
78
78
|
const {
|
|
79
|
-
gap
|
|
80
|
-
error
|
|
81
|
-
dense
|
|
82
|
-
active
|
|
83
|
-
stacked
|
|
84
|
-
reversed
|
|
85
|
-
disabled
|
|
86
|
-
floating
|
|
87
|
-
inactive
|
|
79
|
+
gap,
|
|
80
|
+
error,
|
|
81
|
+
dense,
|
|
82
|
+
active,
|
|
83
|
+
stacked,
|
|
84
|
+
reversed,
|
|
85
|
+
disabled,
|
|
86
|
+
floating,
|
|
87
|
+
inactive,
|
|
88
88
|
floatingActive = active,
|
|
89
89
|
className,
|
|
90
90
|
children,
|