@react-md/core 1.0.0-next.0 → 1.0.0-next.1
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/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-lint.log +12 -0
- package/.turbo/turbo-test.log +166 -0
- package/.turbo/turbo-typecheck.log +4 -0
- package/CHANGELOG.md +57 -0
- package/coverage/clover.xml +3 -1118
- package/coverage/coverage-final.json +1 -7
- package/coverage/lcov-report/CircularProgress.tsx.html +799 -0
- package/coverage/lcov-report/Dialog.tsx.html +1309 -0
- package/coverage/lcov-report/DialogContent.tsx.html +178 -0
- package/coverage/lcov-report/DialogFooter.tsx.html +169 -0
- package/coverage/lcov-report/LinearProgress.tsx.html +658 -0
- package/coverage/lcov-report/MaterialIcon.tsx.html +36 -42
- package/coverage/lcov-report/MaterialSymbol.tsx.html +240 -222
- package/coverage/lcov-report/MenuItemInputToggle.tsx.html +979 -0
- package/coverage/lcov-report/MenuItemSeparator.tsx.html +223 -0
- package/coverage/lcov-report/MenuItemTextField.tsx.html +289 -0
- package/coverage/lcov-report/Switch.tsx.html +535 -0
- package/coverage/lcov-report/SwitchTrack.tsx.html +262 -0
- package/coverage/lcov-report/Table.tsx.html +457 -0
- package/coverage/lcov-report/TableCell.tsx.html +982 -0
- package/coverage/lcov-report/TableCheckbox.tsx.html +709 -0
- package/coverage/lcov-report/TableContainer.tsx.html +220 -0
- package/coverage/lcov-report/TableFooter.tsx.html +502 -0
- package/coverage/lcov-report/TableHeader.tsx.html +541 -0
- package/coverage/lcov-report/TableRadio.tsx.html +670 -0
- package/coverage/lcov-report/TableRow.tsx.html +289 -0
- package/coverage/lcov-report/Tooltip.tsx.html +98 -155
- package/coverage/lcov-report/avatar/Avatar.tsx.html +37 -31
- package/coverage/lcov-report/avatar/index.html +22 -7
- package/coverage/lcov-report/avatar/styles.ts.html +268 -0
- package/coverage/lcov-report/button/AsyncButton.tsx.html +217 -10
- package/coverage/lcov-report/button/Button.tsx.html +95 -83
- package/coverage/lcov-report/button/index.html +12 -12
- package/coverage/lcov-report/config.ts.html +33 -18
- package/coverage/lcov-report/cssUtils.ts.html +143 -65
- package/coverage/lcov-report/dialog/Dialog.tsx.html +170 -167
- package/coverage/lcov-report/dialog/DialogContent.tsx.html +178 -0
- package/coverage/lcov-report/dialog/DialogFooter.tsx.html +169 -0
- package/coverage/lcov-report/dialog/DialogHeader.tsx.html +148 -0
- package/coverage/lcov-report/dialog/DialogTitle.tsx.html +256 -0
- package/coverage/lcov-report/dialog/index.html +18 -33
- package/coverage/lcov-report/dialog/styles.ts.html +439 -0
- package/coverage/lcov-report/form/MenuItemInputToggle.tsx.html +36 -24
- package/coverage/lcov-report/form/MenuItemTextField.tsx.html +12 -9
- package/coverage/lcov-report/form/SliderValueTooltip.tsx.html +319 -0
- package/coverage/lcov-report/form/Switch.tsx.html +310 -385
- package/coverage/lcov-report/form/SwitchTrack.tsx.html +98 -71
- package/coverage/lcov-report/form/index.html +20 -245
- package/coverage/lcov-report/form/switchStyles.ts.html +172 -0
- package/coverage/lcov-report/form/useRadioGroup.ts.html +79 -79
- package/coverage/lcov-report/hoverMode/index.html +116 -0
- package/coverage/lcov-report/hoverMode/useHoverMode.ts.html +676 -0
- package/coverage/lcov-report/icon/FontIcon.tsx.html +37 -46
- package/coverage/lcov-report/icon/index.html +12 -12
- package/coverage/lcov-report/icon/styles.ts.html +41 -104
- package/coverage/lcov-report/iconConfig.tsx.html +973 -0
- package/coverage/lcov-report/index.html +11 -101
- package/coverage/lcov-report/link/Link.tsx.html +358 -0
- package/coverage/lcov-report/link/index.html +20 -20
- package/coverage/lcov-report/list/ListItemLink.tsx.html +29 -35
- package/coverage/lcov-report/list/index.html +8 -38
- package/coverage/lcov-report/materialConfig.ts.html +703 -0
- package/coverage/lcov-report/media-queries/appSize.ts.html +1 -1
- package/coverage/lcov-report/media-queries/index.html +10 -10
- package/coverage/lcov-report/menu/DropdownMenu.tsx.html +976 -0
- package/coverage/lcov-report/menu/Menu.tsx.html +111 -60
- package/coverage/lcov-report/menu/MenuConfigurationProvider.tsx.html +637 -0
- package/coverage/lcov-report/menu/MenuSheet.tsx.html +37 -13
- package/coverage/lcov-report/menu/index.html +35 -65
- package/coverage/lcov-report/menu/menuConfig.ts.html +118 -0
- package/coverage/lcov-report/progress/CircularProgress.tsx.html +799 -0
- package/coverage/lcov-report/progress/LinearProgress.tsx.html +100 -94
- package/coverage/lcov-report/progress/index.html +22 -7
- package/coverage/lcov-report/src/CoreProviders.tsx.html +20 -20
- package/coverage/lcov-report/src/NoSsr.tsx.html +1 -1
- package/coverage/lcov-report/src/SsrProvider.tsx.html +10 -10
- package/coverage/lcov-report/src/app-bar/AppBar.tsx.html +65 -65
- package/coverage/lcov-report/src/app-bar/AppBarTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/app-bar/index.html +20 -5
- package/coverage/lcov-report/src/avatar/Avatar.tsx.html +36 -27
- package/coverage/lcov-report/src/avatar/index.html +22 -7
- package/coverage/lcov-report/src/avatar/styles.ts.html +77 -8
- package/coverage/lcov-report/src/badge/Badge.tsx.html +1 -1
- package/coverage/lcov-report/src/badge/index.html +1 -1
- package/coverage/lcov-report/src/box/Box.tsx.html +1 -1
- package/coverage/lcov-report/src/box/index.html +10 -25
- package/coverage/lcov-report/src/box/styles.ts.html +103 -49
- package/coverage/lcov-report/src/button/AsyncButton.tsx.html +833 -284
- package/coverage/lcov-report/src/button/Button.tsx.html +87 -87
- package/coverage/lcov-report/src/button/ButtonUnstyled.tsx.html +1 -1
- package/coverage/lcov-report/src/button/FloatingActionButton.tsx.html +39 -39
- package/coverage/lcov-report/src/button/buttonStyles.ts.html +59 -59
- package/coverage/lcov-report/src/button/buttonUnstyledStyles.ts.html +1 -1
- package/coverage/lcov-report/src/button/index.html +23 -8
- package/coverage/lcov-report/src/card/Card.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardContent.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardFooter.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardSubtitle.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/card/index.html +95 -5
- package/coverage/lcov-report/src/card/styles.ts.html +1 -1
- package/coverage/lcov-report/src/chip/Chip.tsx.html +1 -1
- package/coverage/lcov-report/src/chip/index.html +1 -1
- package/coverage/lcov-report/src/chip/styles.ts.html +1 -1
- package/coverage/lcov-report/src/cssUtils.ts.html +68 -59
- package/coverage/lcov-report/src/delegateEvent.ts.html +84 -84
- package/coverage/lcov-report/src/dialog/Dialog.tsx.html +158 -155
- package/coverage/lcov-report/src/dialog/DialogContainer.tsx.html +27 -27
- package/coverage/lcov-report/src/dialog/DialogContent.tsx.html +72 -72
- package/coverage/lcov-report/src/dialog/DialogFooter.tsx.html +14 -14
- package/coverage/lcov-report/src/dialog/DialogHeader.tsx.html +9 -9
- package/coverage/lcov-report/src/dialog/DialogTitle.tsx.html +124 -124
- package/coverage/lcov-report/src/dialog/FixedDialog.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/NestedDialogProvider.ts.html +3 -3
- package/coverage/lcov-report/src/dialog/index.html +21 -21
- package/coverage/lcov-report/src/dialog/styles.ts.html +61 -61
- package/coverage/lcov-report/src/divider/Divider.tsx.html +24 -24
- package/coverage/lcov-report/src/divider/index.html +21 -6
- package/coverage/lcov-report/src/divider/styles.ts.html +11 -11
- package/coverage/lcov-report/src/draggable/index.html +5 -5
- package/coverage/lcov-report/src/draggable/useDraggable.ts.html +322 -322
- package/coverage/lcov-report/src/draggable/utils.ts.html +81 -81
- package/coverage/lcov-report/src/expansion-panel/ExpansionList.tsx.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/ExpansionPanel.tsx.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/ExpansionPanelHeader.tsx.html +11 -20
- package/coverage/lcov-report/src/expansion-panel/index.html +25 -10
- package/coverage/lcov-report/src/expansion-panel/useExpansionList.ts.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/useExpansionPanels.ts.html +1 -1
- package/coverage/lcov-report/src/focus/index.html +23 -23
- package/coverage/lcov-report/src/focus/useFocusContainer.ts.html +142 -121
- package/coverage/lcov-report/src/focus/utils.ts.html +37 -37
- package/coverage/lcov-report/src/form/Checkbox.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Fieldset.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FileInput.tsx.html +133 -139
- package/coverage/lcov-report/src/form/Form.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FormMessage.tsx.html +126 -264
- package/coverage/lcov-report/src/form/FormMessageContainer.tsx.html +42 -45
- package/coverage/lcov-report/src/form/FormMessageCounter.tsx.html +1 -1
- package/coverage/lcov-report/src/form/InputToggle.tsx.html +7 -16
- package/coverage/lcov-report/src/form/InputToggleIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Label.tsx.html +102 -102
- package/coverage/lcov-report/src/form/Legend.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemCheckbox.tsx.html +11 -5
- package/coverage/lcov-report/src/form/MenuItemFileInput.tsx.html +3 -3
- package/coverage/lcov-report/src/form/MenuItemInputToggle.tsx.html +21 -9
- package/coverage/lcov-report/src/form/MenuItemRadio.tsx.html +11 -5
- package/coverage/lcov-report/src/form/MenuItemSwitch.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemTextField.tsx.html +13 -4
- package/coverage/lcov-report/src/form/NativeSelect.tsx.html +20 -5
- package/coverage/lcov-report/src/form/OptGroup.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Option.tsx.html +4 -4
- package/coverage/lcov-report/src/form/Password.tsx.html +3 -3
- package/coverage/lcov-report/src/form/Radio.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Select.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SelectValue.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Slider.tsx.html +129 -9
- package/coverage/lcov-report/src/form/SliderContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderMark.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderMarkLabel.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderThumb.tsx.html +43 -7
- package/coverage/lcov-report/src/form/SliderTrack.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderValueMarks.tsx.html +11 -5
- package/coverage/lcov-report/src/form/SliderValueTooltip.tsx.html +2 -2
- package/coverage/lcov-report/src/form/Switch.tsx.html +310 -373
- package/coverage/lcov-report/src/form/SwitchTrack.tsx.html +99 -69
- package/coverage/lcov-report/src/form/TextArea.tsx.html +21 -9
- package/coverage/lcov-report/src/form/TextField.tsx.html +16 -10
- package/coverage/lcov-report/src/form/TextFieldAddon.tsx.html +14 -26
- package/coverage/lcov-report/src/form/TextFieldContainer.tsx.html +28 -10
- package/coverage/lcov-report/src/form/TextFieldContainerStyles.ts.html +17 -8
- package/coverage/lcov-report/src/form/fileUtils.ts.html +3 -3
- package/coverage/lcov-report/src/form/formConfig.ts.html +18 -18
- package/coverage/lcov-report/src/form/formMessageStyles.ts.html +40 -40
- package/coverage/lcov-report/src/form/index.html +14 -164
- package/coverage/lcov-report/src/form/inputToggleStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/nativeSelectStyles.ts.html +34 -7
- package/coverage/lcov-report/src/form/optionStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/passwordStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/selectStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/selectUtils.ts.html +6 -9
- package/coverage/lcov-report/src/form/sliderUtils.ts.html +20 -14
- package/coverage/lcov-report/src/form/switchStyles.ts.html +68 -68
- package/coverage/lcov-report/src/form/textAreaStyles.ts.html +3 -3
- package/coverage/lcov-report/src/form/textFieldStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/useCheckboxGroup.ts.html +2 -2
- package/coverage/lcov-report/src/form/useFileUpload.ts.html +28 -19
- package/coverage/lcov-report/src/form/useListboxProvider.ts.html +5 -8
- package/coverage/lcov-report/src/form/useNumberField.ts.html +10 -10
- package/coverage/lcov-report/src/form/useRadioGroup.ts.html +22 -7
- package/coverage/lcov-report/src/form/useRangeSlider.ts.html +3 -3
- package/coverage/lcov-report/src/form/useResizingTextArea.ts.html +523 -0
- package/coverage/lcov-report/src/form/useSlider.ts.html +2 -2
- package/coverage/lcov-report/src/form/useTextField.ts.html +32 -26
- package/coverage/lcov-report/src/form/utils.ts.html +2 -2
- package/coverage/lcov-report/src/form/validation.ts.html +2 -2
- package/coverage/lcov-report/src/hoverMode/index.html +1 -1
- package/coverage/lcov-report/src/hoverMode/useHoverMode.ts.html +95 -95
- package/coverage/lcov-report/src/hoverMode/useHoverModeProvider.ts.html +3 -3
- package/coverage/lcov-report/src/icon/FontIcon.tsx.html +34 -43
- package/coverage/lcov-report/src/icon/IconRotator.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/MaterialIcon.tsx.html +36 -42
- package/coverage/lcov-report/src/icon/MaterialSymbol.tsx.html +240 -222
- package/coverage/lcov-report/src/icon/SVGIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/TextIconSpacing.tsx.html +33 -33
- package/coverage/lcov-report/src/icon/iconConfig.tsx.html +973 -0
- package/coverage/lcov-report/src/icon/index.html +149 -14
- package/coverage/lcov-report/src/icon/material.ts.html +748 -58
- package/coverage/lcov-report/src/icon/materialConfig.ts.html +703 -0
- package/coverage/lcov-report/src/icon/styles.ts.html +47 -110
- package/coverage/lcov-report/src/index.html +8 -8
- package/coverage/lcov-report/src/interaction/Ripple.tsx.html +60 -60
- package/coverage/lcov-report/src/interaction/RippleContainer.tsx.html +41 -47
- package/coverage/lcov-report/src/interaction/UserInteractionModeProvider.tsx.html +240 -240
- package/coverage/lcov-report/src/interaction/config.ts.html +7 -7
- package/coverage/lcov-report/src/interaction/index.html +100 -10
- package/coverage/lcov-report/src/interaction/useElementInteraction.tsx.html +146 -146
- package/coverage/lcov-report/src/interaction/useHigherContrastChildren.tsx.html +17 -17
- package/coverage/lcov-report/src/interaction/utils.ts.html +171 -171
- package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/LayoutNav.tsx.html +60 -60
- package/coverage/lcov-report/src/layout/LayoutWindowSplitter.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/Main.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/index.html +200 -5
- package/coverage/lcov-report/src/layout/layoutNavStyles.ts.html +5 -5
- package/coverage/lcov-report/src/layout/layoutWindowSplitterStyles.ts.html +1 -1
- package/coverage/lcov-report/src/layout/mainStyles.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useExpandableLayout.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useHorizontalLayoutTransition.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutAppBarHeight.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutTree.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutWindowSplitter.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useMainTabIndex.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useResizableLayout.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useTemporaryLayout.ts.html +3 -3
- package/coverage/lcov-report/src/link/Link.tsx.html +39 -9
- package/coverage/lcov-report/src/link/SkipToMainContent.tsx.html +1 -1
- package/coverage/lcov-report/src/link/index.html +16 -16
- package/coverage/lcov-report/src/link/styles.ts.html +1 -1
- package/coverage/lcov-report/src/list/List.tsx.html +33 -33
- package/coverage/lcov-report/src/list/ListItem.tsx.html +534 -534
- package/coverage/lcov-report/src/list/ListItemAddon.tsx.html +33 -33
- package/coverage/lcov-report/src/list/ListItemChildren.tsx.html +77 -77
- package/coverage/lcov-report/src/list/ListItemLink.tsx.html +2 -2
- package/coverage/lcov-report/src/list/ListItemText.tsx.html +35 -35
- package/coverage/lcov-report/src/list/ListSubheader.tsx.html +1 -1
- package/coverage/lcov-report/src/list/getListItemHeight.ts.html +33 -33
- package/coverage/lcov-report/src/list/index.html +128 -8
- package/coverage/lcov-report/src/list/listItemStyles.ts.html +1 -1
- package/coverage/lcov-report/src/media-queries/AppSizeProvider.tsx.html +59 -59
- package/coverage/lcov-report/src/media-queries/appSize.ts.html +1 -1
- package/coverage/lcov-report/src/media-queries/index.html +20 -5
- package/coverage/lcov-report/src/media-queries/useMediaQuery.ts.html +24 -24
- package/coverage/lcov-report/src/menu/DropdownMenu.tsx.html +73 -16
- package/coverage/lcov-report/src/menu/Menu.tsx.html +66 -33
- package/coverage/lcov-report/src/menu/MenuBar.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuButton.tsx.html +3 -3
- package/coverage/lcov-report/src/menu/MenuConfigurationProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItem.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemButton.tsx.html +3 -3
- package/coverage/lcov-report/src/menu/MenuItemGroup.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemSeparator.tsx.html +6 -36
- package/coverage/lcov-report/src/menu/MenuSheet.tsx.html +34 -7
- package/coverage/lcov-report/src/menu/MenuVisibilityProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuWidget.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuWidgetKeyboardProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/index.html +69 -24
- package/coverage/lcov-report/src/menu/useContextMenu.ts.html +1 -1
- package/coverage/lcov-report/src/menu/useMenuBarProvider.ts.html +1 -1
- package/coverage/lcov-report/src/menu/utils.ts.html +10 -10
- package/coverage/lcov-report/src/movement/constants.ts.html +1 -1
- package/coverage/lcov-report/src/movement/findMatchIndex.ts.html +1 -1
- package/coverage/lcov-report/src/movement/index.html +53 -8
- package/coverage/lcov-report/src/movement/useKeyboardMovementProvider.ts.html +92 -92
- package/coverage/lcov-report/src/movement/utils.ts.html +1 -1
- package/coverage/lcov-report/src/overlay/Overlay.tsx.html +64 -64
- package/coverage/lcov-report/src/overlay/index.html +1 -1
- package/coverage/lcov-report/src/overlay/overlayStyles.ts.html +28 -28
- package/coverage/lcov-report/src/portal/Portal.tsx.html +9 -9
- package/coverage/lcov-report/src/portal/PortalContainerProvider.tsx.html +29 -29
- package/coverage/lcov-report/src/portal/index.html +20 -5
- package/coverage/lcov-report/src/positioning/constants.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/createHorizontalPosition.ts.html +63 -63
- package/coverage/lcov-report/src/positioning/createVerticalPosition.ts.html +65 -65
- package/coverage/lcov-report/src/positioning/getFixedPosition.ts.html +94 -94
- package/coverage/lcov-report/src/positioning/index.html +70 -10
- package/coverage/lcov-report/src/positioning/useFixedPositioning.ts.html +200 -200
- package/coverage/lcov-report/src/positioning/utils.ts.html +111 -111
- package/coverage/lcov-report/src/progress/CircularProgress.tsx.html +501 -456
- package/coverage/lcov-report/src/progress/LinearProgress.tsx.html +419 -338
- package/coverage/lcov-report/src/progress/getProgressA11y.ts.html +1 -1
- package/coverage/lcov-report/src/progress/index.html +32 -32
- package/coverage/lcov-report/src/responsive-item/ResponsiveItemContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/responsive-item/ResponsiveItemOverlay.tsx.html +1 -1
- package/coverage/lcov-report/src/responsive-item/index.html +20 -5
- package/coverage/lcov-report/src/responsive-item/styles.ts.html +1 -1
- package/coverage/lcov-report/src/scroll/ScrollLock.tsx.html +1 -1
- package/coverage/lcov-report/src/scroll/getScrollbarWidth.ts.html +25 -25
- package/coverage/lcov-report/src/scroll/index.html +5 -5
- package/coverage/lcov-report/src/scroll/useScrollLock.ts.html +27 -27
- package/coverage/lcov-report/src/segmented-button/SegmentedButton.tsx.html +4 -4
- package/coverage/lcov-report/src/segmented-button/SegmentedButtonContainer.tsx.html +29 -8
- package/coverage/lcov-report/src/segmented-button/index.html +50 -5
- package/coverage/lcov-report/src/segmented-button/segmentedButtonContainerStyles.ts.html +15 -6
- package/coverage/lcov-report/src/segmented-button/segmentedButtonStyles.ts.html +1 -1
- package/coverage/lcov-report/src/sheet/Sheet.tsx.html +1 -1
- package/coverage/lcov-report/src/sheet/index.html +20 -5
- package/coverage/lcov-report/src/sheet/styles.ts.html +28 -28
- package/coverage/lcov-report/src/snackbar/DefaultToastRenderer.tsx.html +8 -5
- package/coverage/lcov-report/src/snackbar/Snackbar.tsx.html +7 -133
- package/coverage/lcov-report/src/snackbar/Toast.tsx.html +2 -2
- package/coverage/lcov-report/src/snackbar/ToastActionButton.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastCloseButton.tsx.html +3 -3
- package/coverage/lcov-report/src/snackbar/ToastContent.tsx.html +7 -115
- package/coverage/lcov-report/src/snackbar/ToastManager.tsx.html +1783 -0
- package/coverage/lcov-report/src/snackbar/ToastManagerProvider.tsx.html +16 -1696
- package/coverage/lcov-report/src/snackbar/index.html +159 -9
- package/coverage/lcov-report/src/snackbar/snackbarStyles.ts.html +214 -0
- package/coverage/lcov-report/src/snackbar/toastContentStyles.ts.html +196 -0
- package/coverage/lcov-report/src/snackbar/toastStyles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/useCurrentToastActions.ts.html +1 -1
- package/coverage/lcov-report/src/suspense/CircularProgressSuspense.tsx.html +57 -6
- package/coverage/lcov-report/src/suspense/NullSuspense.tsx.html +1 -1
- package/coverage/lcov-report/src/suspense/index.html +7 -22
- package/coverage/lcov-report/src/table/Table.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableBody.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableCell.tsx.html +20 -35
- package/coverage/lcov-report/src/table/TableCellContent.tsx.html +2 -2
- package/coverage/lcov-report/src/table/TableCheckbox.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableConfigurationProvider.tsx.html +6 -12
- package/coverage/lcov-report/src/table/TableContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableContainerProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableFooter.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableRow.tsx.html +1 -1
- package/coverage/lcov-report/src/table/index.html +113 -8
- package/coverage/lcov-report/src/tabs/Tab.tsx.html +69 -69
- package/coverage/lcov-report/src/tabs/TabList.tsx.html +92 -92
- package/coverage/lcov-report/src/tabs/TabListScrollButton.tsx.html +61 -61
- package/coverage/lcov-report/src/tabs/index.html +143 -8
- package/coverage/lcov-report/src/tabs/tabIndicatorStyles.ts.html +157 -0
- package/coverage/lcov-report/src/tabs/tabListScrollButtonStyles.ts.html +226 -0
- package/coverage/lcov-report/src/tabs/tabListStyles.ts.html +241 -0
- package/coverage/lcov-report/src/tabs/tabStyles.ts.html +17 -17
- package/coverage/lcov-report/src/tabs/useTabList.ts.html +94 -94
- package/coverage/lcov-report/src/tabs/useTabs.ts.html +54 -54
- package/coverage/lcov-report/src/tabs/utils.ts.html +3 -3
- package/coverage/lcov-report/src/test-utils/IntersectionObserver.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/ResizeObserver.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/data-testid.ts.html +100 -0
- package/coverage/lcov-report/src/test-utils/drag.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/index.html +114 -9
- package/coverage/lcov-report/src/test-utils/jest-setup.ts.html +21 -9
- package/coverage/lcov-report/src/test-utils/matchMedia.ts.html +4 -4
- package/coverage/lcov-report/src/test-utils/polyfills/IntersectionObserver.ts.html +4 -4
- package/coverage/lcov-report/src/test-utils/polyfills/ResizeObserver.ts.html +3 -3
- package/coverage/lcov-report/src/test-utils/polyfills/index.html +1 -1
- package/coverage/lcov-report/src/test-utils/polyfills/matchMedia.ts.html +6 -6
- package/coverage/lcov-report/src/test-utils/polyfills/offsetParent.ts.html +14 -14
- package/coverage/lcov-report/src/test-utils/polyfills/scrollIntoView.ts.html +5 -5
- package/coverage/lcov-report/src/test-utils/render.tsx.html +21 -21
- package/coverage/lcov-report/src/test-utils/timers.ts.html +1 -1
- package/coverage/lcov-report/src/theme/LocalStorageColorSchemeProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/theme/ThemeProvider.tsx.html +22 -4
- package/coverage/lcov-report/src/theme/colors.ts.html +1 -1
- package/coverage/lcov-report/src/theme/cssVars.ts.html +1 -1
- package/coverage/lcov-report/src/theme/index.html +71 -11
- package/coverage/lcov-report/src/theme/useCSSVariables.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorScheme.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorSchemeMetaTag.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorSchemeProvider.ts.html +1 -1
- package/coverage/lcov-report/src/theme/usePrefersColorScheme.ts.html +1 -1
- package/coverage/lcov-report/src/theme/utils.ts.html +58 -58
- package/coverage/lcov-report/src/tooltip/Tooltip.tsx.html +98 -74
- package/coverage/lcov-report/src/tooltip/TooltipHoverModeProvider.tsx.html +60 -6
- package/coverage/lcov-report/src/tooltip/constants.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/index.html +72 -27
- package/coverage/lcov-report/src/tooltip/tooltipStyles.ts.html +18 -18
- package/coverage/lcov-report/src/tooltip/useOverflowTooltip.ts.html +196 -196
- package/coverage/lcov-report/src/tooltip/useTooltip.ts.html +511 -211
- package/coverage/lcov-report/src/tooltip/useTooltipPosition.ts.html +29 -29
- package/coverage/lcov-report/src/tooltip/utils.ts.html +23 -23
- package/coverage/lcov-report/src/transition/CSSTransition.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/Collapse.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/CrossFade.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/ScaleTransition.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/SkeletonPlaceholder.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/Slide.tsx.html +46 -46
- package/coverage/lcov-report/src/transition/SlideContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/collapseStyles.ts.html +13 -13
- package/coverage/lcov-report/src/transition/config.ts.html +187 -0
- package/coverage/lcov-report/src/transition/index.html +295 -10
- package/coverage/lcov-report/src/transition/maxWidthTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCSSTransition.ts.html +69 -69
- package/coverage/lcov-report/src/transition/useCarousel.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCollapseTransition.ts.html +99 -99
- package/coverage/lcov-report/src/transition/useCrossFadeTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useMaxWidthTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useScaleTransition.ts.html +18 -18
- package/coverage/lcov-report/src/transition/useSkeletonPlaceholder.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useSlideTransition.ts.html +20 -20
- package/coverage/lcov-report/src/transition/useTransition.ts.html +277 -250
- package/coverage/lcov-report/src/transition/utils.ts.html +68 -68
- package/coverage/lcov-report/src/tree/DefaultTreeItemRenderer.tsx.html +2 -2
- package/coverage/lcov-report/src/tree/Tree.tsx.html +24 -36
- package/coverage/lcov-report/src/tree/TreeGroup.tsx.html +45 -45
- package/coverage/lcov-report/src/tree/TreeItem.tsx.html +213 -216
- package/coverage/lcov-report/src/tree/TreeItemExpander.tsx.html +3 -3
- package/coverage/lcov-report/src/tree/TreeProvider.tsx.html +29 -11
- package/coverage/lcov-report/src/tree/index.html +114 -9
- package/coverage/lcov-report/src/tree/styles.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTree.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeExpansion.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeItems.ts.html +10 -13
- package/coverage/lcov-report/src/tree/useTreeMovement.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeSelection.ts.html +1 -1
- package/coverage/lcov-report/src/tree/utils.ts.html +1 -1
- package/coverage/lcov-report/src/typography/SrOnly.tsx.html +26 -26
- package/coverage/lcov-report/src/typography/TextContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/typography/Typography.tsx.html +71 -71
- package/coverage/lcov-report/src/typography/WritingDirectionProvider.tsx.html +75 -75
- package/coverage/lcov-report/src/typography/index.html +64 -19
- package/coverage/lcov-report/src/useAsyncAction.ts.html +25 -25
- package/coverage/lcov-report/src/useDebouncedFunction.ts.html +1 -1
- package/coverage/lcov-report/src/useDropzone.ts.html +1 -1
- package/coverage/lcov-report/src/useEnsuredId.ts.html +8 -8
- package/coverage/lcov-report/src/useEnsuredRef.ts.html +22 -19
- package/coverage/lcov-report/src/useEnsuredState.ts.html +18 -18
- package/coverage/lcov-report/src/useHtmlClassName.ts.html +1 -1
- package/coverage/lcov-report/src/useIntersectionObserver.ts.html +32 -32
- package/coverage/lcov-report/src/useIsomorphicLayoutEffect.ts.html +1 -1
- package/coverage/lcov-report/src/useLocalStorage.ts.html +225 -225
- package/coverage/lcov-report/src/useOrientation.ts.html +32 -32
- package/coverage/lcov-report/src/usePageInactive.ts.html +25 -25
- package/coverage/lcov-report/src/useResizeListener.ts.html +1 -1
- package/coverage/lcov-report/src/useResizeObserver.ts.html +28 -28
- package/coverage/lcov-report/src/useThrottledFunction.ts.html +1 -1
- package/coverage/lcov-report/src/useToggle.ts.html +18 -18
- package/coverage/lcov-report/src/useUnmounted.ts.html +11 -11
- package/coverage/lcov-report/src/useWindowSize.ts.html +1 -1
- package/coverage/lcov-report/src/utils/RenderRecursively.tsx.html +1 -1
- package/coverage/lcov-report/src/utils/alphaNumericSort.ts.html +1 -1
- package/coverage/lcov-report/src/utils/applyRef.ts.html +11 -11
- package/coverage/lcov-report/src/utils/bem.ts.html +50 -50
- package/coverage/lcov-report/src/utils/filters.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getClientPosition.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getPercentage.ts.html +36 -36
- package/coverage/lcov-report/src/utils/getRangeDefaultValue.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getRangeSteps.ts.html +1 -1
- package/coverage/lcov-report/src/utils/identity.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +212 -17
- package/coverage/lcov-report/src/utils/isElementVisible.ts.html +14 -14
- package/coverage/lcov-report/src/utils/loop.ts.html +1 -1
- package/coverage/lcov-report/src/utils/nearest.ts.html +1 -1
- package/coverage/lcov-report/src/utils/parseCssLengthUnit.ts.html +41 -41
- package/coverage/lcov-report/src/utils/randomInt.ts.html +1 -1
- package/coverage/lcov-report/src/utils/wait.ts.html +1 -1
- package/coverage/lcov-report/src/utils/withinRange.ts.html +1 -1
- package/coverage/lcov-report/src/window-splitter/WindowSplitter.tsx.html +1 -1
- package/coverage/lcov-report/src/window-splitter/index.html +1 -1
- package/coverage/lcov-report/src/window-splitter/useWindowSplitter.ts.html +1 -1
- package/coverage/lcov-report/styles.ts.html +134 -320
- package/coverage/lcov-report/switchStyles.ts.html +172 -0
- package/coverage/lcov-report/table/Table.tsx.html +526 -0
- package/coverage/lcov-report/table/TableBody.tsx.html +280 -0
- package/coverage/lcov-report/table/TableCell.tsx.html +159 -168
- package/coverage/lcov-report/table/TableCheckbox.tsx.html +10 -13
- package/coverage/lcov-report/table/TableRadio.tsx.html +670 -0
- package/coverage/lcov-report/table/TableRow.tsx.html +370 -0
- package/coverage/lcov-report/table/index.html +62 -32
- package/coverage/lcov-report/tableCellStyles.ts.html +334 -0
- package/coverage/lcov-report/tableContainerStyles.ts.html +142 -0
- package/coverage/lcov-report/tableFooterStyles.ts.html +157 -0
- package/coverage/lcov-report/tableHeaderStyles.ts.html +163 -0
- package/coverage/lcov-report/tableRowStyles.ts.html +169 -0
- package/coverage/lcov-report/tableStyles.ts.html +157 -0
- package/coverage/lcov-report/tabs/Tab.tsx.html +502 -0
- package/coverage/lcov-report/tabs/TabList.tsx.html +796 -0
- package/coverage/lcov-report/tabs/index.html +62 -17
- package/coverage/lcov-report/tabs/useTabs.ts.html +1567 -0
- package/coverage/lcov-report/tabs/utils.ts.html +337 -0
- package/coverage/lcov-report/test-utils/index.html +20 -20
- package/coverage/lcov-report/test-utils/jest-setup.ts.html +124 -0
- package/coverage/lcov-report/tooltip/Tooltip.tsx.html +98 -74
- package/coverage/lcov-report/tooltip/TooltipHoverModeProvider.tsx.html +167 -11
- package/coverage/lcov-report/tooltip/constants.ts.html +1 -1
- package/coverage/lcov-report/tooltip/index.html +32 -17
- package/coverage/lcov-report/tooltip/tooltipStyles.ts.html +181 -0
- package/coverage/lcov-report/tooltip/useTooltip.ts.html +490 -190
- package/coverage/lcov-report/tooltipStyles.ts.html +181 -0
- package/coverage/lcov-report/transition/config.ts.html +187 -0
- package/coverage/lcov-report/transition/index.html +9 -24
- package/coverage/lcov-report/transition/useTransition.ts.html +943 -0
- package/coverage/lcov-report/tree/Tree.tsx.html +24 -36
- package/coverage/lcov-report/tree/TreeItem.tsx.html +213 -216
- package/coverage/lcov-report/tree/TreeProvider.tsx.html +55 -10
- package/coverage/lcov-report/tree/index.html +14 -59
- package/coverage/lcov-report/typography/WritingDirectionProvider.tsx.html +781 -0
- package/coverage/lcov-report/typography/index.html +8 -8
- package/coverage/lcov-report/useTooltip.ts.html +651 -375
- package/coverage/lcov-report/useTransition.ts.html +934 -0
- package/coverage/lcov-report/utils/index.html +24 -39
- package/coverage/lcov-report/utils/isElementVisible.ts.html +14 -14
- package/coverage/lcov-report/utils/parseCssLengthUnit.ts.html +19 -19
- package/coverage/lcov.info +0 -1176
- package/dist/_core.scss +5 -1
- package/dist/avatar/Avatar.d.ts +2 -15
- package/dist/avatar/Avatar.js +3 -2
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/avatar/_avatar.scss +4 -2
- package/dist/avatar/styles.d.ts +20 -2
- package/dist/avatar/styles.js +4 -1
- package/dist/avatar/styles.js.map +1 -1
- package/dist/button/AsyncButton.d.ts +29 -0
- package/dist/button/AsyncButton.js +14 -1
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/chip/_chip.scss +0 -16
- package/dist/chip/styles.d.ts +1 -1
- package/dist/chip/styles.js +3 -4
- package/dist/chip/styles.js.map +1 -1
- package/dist/cssUtils.d.ts +1 -0
- package/dist/cssUtils.js +1 -1
- package/dist/cssUtils.js.map +1 -1
- package/dist/dialog/Dialog.d.ts +1 -1
- package/dist/dialog/Dialog.js +2 -1
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/focus/useFocusContainer.d.ts +8 -8
- package/dist/focus/useFocusContainer.js +11 -10
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/form/MenuItemInputToggle.js +2 -2
- package/dist/form/MenuItemInputToggle.js.map +1 -1
- package/dist/form/MenuItemTextField.d.ts +2 -0
- package/dist/form/MenuItemTextField.js.map +1 -1
- package/dist/form/Slider.d.ts +41 -5
- package/dist/form/Slider.js +2 -1
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderThumb.d.ts +7 -2
- package/dist/form/SliderThumb.js +4 -2
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderValueMarks.js +1 -1
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/SliderValueTooltip.js +1 -1
- package/dist/form/SliderValueTooltip.js.map +1 -1
- package/dist/form/Switch.d.ts +3 -2
- package/dist/form/Switch.js +7 -26
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/SwitchTrack.d.ts +2 -1
- package/dist/form/SwitchTrack.js +8 -4
- package/dist/form/SwitchTrack.js.map +1 -1
- package/dist/form/_form.scss +41 -34
- package/dist/form/switchStyles.d.ts +1 -0
- package/dist/form/switchStyles.js +2 -1
- package/dist/form/switchStyles.js.map +1 -1
- package/dist/hoverMode/useHoverMode.d.ts +2 -2
- package/dist/hoverMode/useHoverMode.js +1 -1
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +2 -1
- package/dist/icon/FontIcon.js +4 -5
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/MaterialIcon.d.ts +2 -2
- package/dist/icon/MaterialIcon.js +3 -6
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.d.ts +15 -8
- package/dist/icon/MaterialSymbol.js +15 -11
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/icon/material.d.ts +1 -1
- package/dist/icon/material.js.map +1 -1
- package/dist/icon/materialConfig.d.ts +156 -0
- package/dist/icon/materialConfig.js +29 -0
- package/dist/icon/materialConfig.js.map +1 -0
- package/dist/icon/styles.d.ts +0 -15
- package/dist/icon/styles.js +2 -4
- package/dist/icon/styles.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/link/Link.d.ts +12 -6
- package/dist/link/Link.js +1 -2
- package/dist/link/Link.js.map +1 -1
- package/dist/list/ListItemLink.d.ts +1 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/menu/DropdownMenu.d.ts +12 -1
- package/dist/menu/DropdownMenu.js +13 -4
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.d.ts +8 -0
- package/dist/menu/Menu.js +2 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuItemSeparator.d.ts +1 -2
- package/dist/menu/MenuItemSeparator.js +2 -8
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuSheet.d.ts +6 -1
- package/dist/menu/MenuSheet.js.map +1 -1
- package/dist/menu/menuConfig.d.ts +60 -0
- package/dist/progress/CircularProgress.d.ts +5 -4
- package/dist/progress/CircularProgress.js +3 -3
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +7 -5
- package/dist/progress/LinearProgress.js +4 -3
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/segmented-button/_segmented-button.scss +5 -0
- package/dist/suspense/CircularProgressSuspense.d.ts +4 -0
- package/dist/suspense/CircularProgressSuspense.js +3 -1
- package/dist/suspense/CircularProgressSuspense.js.map +1 -1
- package/dist/table/Table.d.ts +0 -12
- package/dist/table/Table.js +1 -12
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableCell.d.ts +13 -38
- package/dist/table/TableCell.js +7 -15
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCellContent.d.ts +9 -0
- package/dist/table/TableCellContent.js +2 -1
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.d.ts +2 -2
- package/dist/table/TableCheckbox.js +3 -3
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableContainer.d.ts +0 -6
- package/dist/table/TableContainer.js +1 -6
- package/dist/table/TableContainer.js.map +1 -1
- package/dist/table/TableFooter.d.ts +7 -1
- package/dist/table/TableFooter.js +17 -16
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.d.ts +7 -14
- package/dist/table/TableHeader.js +6 -14
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.d.ts +106 -0
- package/dist/table/TableRadio.js +106 -0
- package/dist/table/TableRadio.js.map +1 -0
- package/dist/table/TableRow.d.ts +0 -10
- package/dist/table/TableRow.js +1 -12
- package/dist/table/TableRow.js.map +1 -1
- package/dist/table/_table.scss +16 -18
- package/dist/table/tableCellStyles.d.ts +33 -0
- package/dist/table/tableCellStyles.js +15 -0
- package/dist/table/tableCellStyles.js.map +1 -0
- package/dist/table/tableContainerStyles.d.ts +10 -0
- package/dist/table/tableContainerStyles.js +9 -0
- package/dist/table/tableContainerStyles.js.map +1 -0
- package/dist/table/tableFooterStyles.d.ts +10 -0
- package/dist/table/tableFooterStyles.js +12 -0
- package/dist/table/tableFooterStyles.js.map +1 -0
- package/dist/table/tableHeaderStyles.d.ts +10 -0
- package/dist/table/tableHeaderStyles.js +13 -0
- package/dist/table/tableHeaderStyles.js.map +1 -0
- package/dist/table/tableRowStyles.d.ts +10 -0
- package/dist/table/tableRowStyles.js +14 -0
- package/dist/table/tableRowStyles.js.map +1 -0
- package/dist/table/tableStyles.d.ts +12 -0
- package/dist/table/tableStyles.js +14 -0
- package/dist/table/tableStyles.js.map +1 -0
- package/dist/table/types.d.ts +28 -15
- package/dist/table/types.js.map +1 -1
- package/dist/tabs/_tabs.scss +2 -0
- package/dist/test-utils/data-testid.js +2 -0
- package/dist/test-utils/data-testid.js.map +1 -0
- package/dist/test-utils/jest-setup.js +3 -0
- package/dist/test-utils/jest-setup.js.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +5 -0
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/tooltip/Tooltip.d.ts +13 -6
- package/dist/tooltip/Tooltip.js +2 -2
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.d.ts +15 -0
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
- package/dist/tooltip/_tooltip.scss +1 -0
- package/dist/tooltip/tooltipStyles.d.ts +2 -1
- package/dist/tooltip/tooltipStyles.js +2 -2
- package/dist/tooltip/tooltipStyles.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +71 -8
- package/dist/tooltip/useTooltip.js +68 -7
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/transition/config.d.ts +22 -0
- package/dist/transition/config.js +16 -0
- package/dist/transition/config.js.map +1 -0
- package/dist/transition/useTransition.js +15 -6
- package/dist/transition/useTransition.js.map +1 -1
- package/dist/tree/DefaultTreeItemRenderer.d.ts +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
- package/dist/tree/Tree.d.ts +1 -1
- package/dist/tree/Tree.js +18 -21
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/TreeItem.js +1 -3
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeProvider.d.ts +2 -0
- package/dist/tree/TreeProvider.js +3 -1
- package/dist/tree/TreeProvider.js.map +1 -1
- package/package.json +20 -17
- package/src/__tests__/NoSsr.tsx +5 -5
- package/src/__tests__/useAsyncAction.tsx +14 -6
- package/src/__tests__/useDebouncedFunction.tsx +6 -3
- package/src/__tests__/useDropzone.tsx +10 -10
- package/src/__tests__/useEnsuredId.tsx +5 -5
- package/src/__tests__/useEnsuredState.tsx +1 -2
- package/src/__tests__/useLocalStorage.tsx +21 -21
- package/src/__tests__/useResizeObserver.tsx +2 -0
- package/src/__tests__/useThrottledFunction.tsx +9 -8
- package/src/__tests__/useToggle.tsx +10 -10
- package/src/_core.scss +5 -1
- package/src/app-bar/__tests__/AppBar.tsx +15 -15
- package/src/app-bar/__tests__/AppBarTitle.tsx +3 -5
- package/src/avatar/Avatar.tsx +12 -20
- package/src/avatar/__tests__/Avatar.tsx +6 -6
- package/src/avatar/_avatar.scss +4 -2
- package/src/avatar/styles.ts +27 -4
- package/src/badge/__tests__/Badge.tsx +3 -3
- package/src/button/AsyncButton.tsx +71 -4
- package/src/button/__tests__/AsyncButton.tsx +2 -0
- package/src/button/__tests__/Button.tsx +12 -12
- package/src/button/__tests__/ButtonUnstyled.tsx +3 -3
- package/src/button/__tests__/__snapshots__/AsyncButton.tsx.snap +31 -8
- package/src/card/__tests__/Card.tsx +3 -3
- package/src/card/__tests__/CardContent.tsx +3 -3
- package/src/card/__tests__/CardFooter.tsx +3 -3
- package/src/card/__tests__/CardHeader.tsx +5 -5
- package/src/card/__tests__/CardSubtitle.tsx +3 -3
- package/src/card/__tests__/CardTitle.tsx +3 -3
- package/src/chip/__tests__/Chip.tsx +20 -22
- package/src/chip/__tests__/__snapshots__/Chip.tsx.snap +3 -3
- package/src/chip/__tests__/__snapshots__/styles.ts.snap +1 -1
- package/src/chip/_chip.scss +0 -16
- package/src/chip/styles.ts +4 -5
- package/src/cssUtils.ts +4 -1
- package/src/dialog/Dialog.tsx +5 -4
- package/src/dialog/__tests__/Dialog.tsx +316 -0
- package/src/dialog/__tests__/DialogContent.tsx +53 -0
- package/src/dialog/__tests__/DialogFooter.tsx +70 -0
- package/src/dialog/__tests__/DialogHeader.tsx +37 -0
- package/src/dialog/__tests__/DialogTitle.tsx +41 -0
- package/src/dialog/__tests__/__snapshots__/Dialog.tsx.snap +84 -0
- package/src/dialog/__tests__/__snapshots__/DialogContent.tsx.snap +36 -0
- package/src/dialog/__tests__/__snapshots__/DialogFooter.tsx.snap +186 -0
- package/src/dialog/__tests__/__snapshots__/DialogHeader.tsx.snap +18 -0
- package/src/dialog/__tests__/__snapshots__/DialogTitle.tsx.snap +26 -0
- package/src/divider/__tests__/Divider.tsx +3 -3
- package/src/draggable/__tests__/useDraggable.tsx +35 -39
- package/src/expansion-panel/__tests__/ExpansionPanel.tsx +28 -23
- package/src/focus/__tests__/useFocusContainer.tsx +280 -0
- package/src/focus/useFocusContainer.ts +17 -10
- package/src/form/MenuItemInputToggle.tsx +6 -2
- package/src/form/MenuItemTextField.tsx +3 -0
- package/src/form/Slider.tsx +45 -5
- package/src/form/SliderThumb.tsx +15 -3
- package/src/form/SliderValueMarks.tsx +3 -1
- package/src/form/SliderValueTooltip.tsx +1 -1
- package/src/form/Switch.tsx +6 -27
- package/src/form/SwitchTrack.tsx +12 -2
- package/src/form/__tests__/Checkbox.tsx +5 -5
- package/src/form/__tests__/Fieldset.tsx +3 -3
- package/src/form/__tests__/FileInput.tsx +2 -2
- package/src/form/__tests__/Label.tsx +3 -3
- package/src/form/__tests__/Legend.tsx +3 -3
- package/src/form/__tests__/Radio.tsx +3 -3
- package/src/form/__tests__/Switch.tsx +152 -0
- package/src/form/__tests__/__snapshots__/Switch.tsx.snap +428 -0
- package/src/form/__tests__/__snapshots__/useCheckboxGroup.tsx.snap +1 -1
- package/src/form/__tests__/__snapshots__/useRadioGroup.tsx.snap +1 -1
- package/src/form/__tests__/useCheckboxGroup.tsx +33 -33
- package/src/form/__tests__/useFileUpload.tsx +41 -33
- package/src/form/__tests__/useRadioGroup.tsx +25 -25
- package/src/form/_form.scss +41 -34
- package/src/form/switchStyles.ts +3 -3
- package/src/hoverMode/useHoverMode.ts +4 -4
- package/src/icon/FontIcon.tsx +2 -5
- package/src/icon/MaterialIcon.tsx +4 -6
- package/src/icon/MaterialSymbol.tsx +18 -12
- package/src/icon/__tests__/FontIcon.tsx +7 -11
- package/src/icon/__tests__/IconRotator.tsx +4 -4
- package/src/icon/__tests__/MaterialIcon.tsx +79 -0
- package/src/icon/__tests__/MaterialSymbol.tsx +100 -0
- package/src/icon/__tests__/SVGIcon.tsx +6 -5
- package/src/icon/__tests__/TextIconSpacing.tsx +15 -17
- package/src/icon/__tests__/__snapshots__/IconRotator.tsx.snap +6 -6
- package/src/icon/__tests__/__snapshots__/MaterialIcon.tsx.snap +82 -0
- package/src/icon/__tests__/__snapshots__/MaterialSymbol.tsx.snap +42 -0
- package/src/icon/iconConfig.tsx +1 -0
- package/src/icon/material.ts +284 -54
- package/src/icon/{MaterialSymbolsProvider.tsx → materialConfig.ts} +49 -67
- package/src/icon/styles.ts +0 -21
- package/src/index.ts +8 -6
- package/src/interaction/__tests__/UserInteractionModeProvider.tsx +3 -3
- package/src/layout/__tests__/useExpandableLayout.tsx +12 -1
- package/src/layout/__tests__/useLayoutTree.tsx +6 -1
- package/src/layout/__tests__/useResizableLayout.tsx +13 -1
- package/src/layout/__tests__/useTemporaryLayout.tsx +6 -1
- package/src/link/Link.tsx +15 -5
- package/src/link/__tests__/Link.tsx +3 -3
- package/src/link/__tests__/SkipToMainContent.tsx +11 -14
- package/src/list/ListItemLink.tsx +1 -1
- package/src/list/__tests__/List.tsx +7 -7
- package/src/list/__tests__/ListItem.tsx +17 -16
- package/src/list/__tests__/ListItemLink.tsx +7 -7
- package/src/list/__tests__/ListSubheader.tsx +5 -5
- package/src/menu/DropdownMenu.tsx +23 -4
- package/src/menu/Menu.tsx +11 -0
- package/src/menu/MenuItemSeparator.tsx +2 -12
- package/src/menu/MenuSheet.tsx +10 -1
- package/src/menu/__tests__/DropdownMenu.tsx +74 -65
- package/src/menu/__tests__/MenuBar.tsx +57 -48
- package/src/menu/__tests__/MenuVisibilityProvider.tsx +3 -3
- package/src/overlay/__tests__/Overlay.tsx +37 -35
- package/src/portal/__tests__/PortalContainerProvider.node.tsx +1 -0
- package/src/portal/__tests__/PortalContainerProvider.tsx +9 -9
- package/src/positioning/__tests__/useFixedPositioning.tsx +20 -14
- package/src/progress/CircularProgress.tsx +5 -4
- package/src/progress/LinearProgress.tsx +88 -86
- package/src/progress/__tests__/CircularProgress.tsx +49 -27
- package/src/progress/__tests__/LinearProgress.tsx +40 -25
- package/src/progress/__tests__/__snapshots__/CircularProgress.tsx.snap +21 -0
- package/src/progress/__tests__/__snapshots__/LinearProgress.tsx.snap +20 -0
- package/src/segmented-button/_segmented-button.scss +5 -0
- package/src/snackbar/__tests__/Snackbar.tsx +2 -2
- package/src/snackbar/__tests__/Toast.tsx +8 -3
- package/src/snackbar/__tests__/ToastActionButton.tsx +2 -2
- package/src/snackbar/__tests__/ToastCloseButton.tsx +2 -2
- package/src/snackbar/__tests__/ToastManagerProvider.tsx +8 -0
- package/src/suspense/CircularProgressSuspense.tsx +19 -2
- package/src/table/Table.tsx +1 -24
- package/src/table/TableCell.tsx +22 -85
- package/src/table/TableCellContent.tsx +20 -2
- package/src/table/TableCheckbox.tsx +3 -3
- package/src/table/TableContainer.tsx +1 -8
- package/src/table/TableFooter.tsx +30 -23
- package/src/table/TableHeader.tsx +23 -40
- package/src/table/TableRadio.tsx +195 -0
- package/src/table/TableRow.tsx +1 -28
- package/src/table/__tests__/Table.tsx +4 -10
- package/src/table/__tests__/TableBody.tsx +3 -3
- package/src/table/__tests__/TableCheckbox.tsx +10 -11
- package/src/table/__tests__/TableContainer.tsx +3 -3
- package/src/table/__tests__/TableRadio.tsx +112 -0
- package/src/table/__tests__/TableRow.tsx +4 -10
- package/src/table/__tests__/__snapshots__/Table.tsx.snap +249 -251
- package/src/table/__tests__/__snapshots__/TableBody.tsx.snap +3 -3
- package/src/table/__tests__/__snapshots__/TableCheckbox.tsx.snap +4 -4
- package/src/table/__tests__/__snapshots__/TableRadio.tsx.snap +138 -0
- package/src/table/__tests__/__snapshots__/TableRow.tsx.snap +4 -6
- package/src/table/__tests__/__snapshots__/tableContainerStyles.ts.snap +3 -0
- package/src/table/__tests__/__snapshots__/tableRowStyles.ts.snap +3 -0
- package/src/table/__tests__/__snapshots__/tableStyles.ts.snap +3 -0
- package/src/table/__tests__/tableContainerStyles.ts +8 -0
- package/src/table/__tests__/tableRowStyles.ts +8 -0
- package/src/table/__tests__/tableStyles.ts +8 -0
- package/src/table/_table.scss +16 -18
- package/src/table/tableCellStyles.ts +83 -0
- package/src/table/tableContainerStyles.ts +19 -0
- package/src/table/tableFooterStyles.ts +27 -0
- package/src/table/tableHeaderStyles.ts +29 -0
- package/src/table/tableRowStyles.ts +28 -0
- package/src/table/tableStyles.ts +24 -0
- package/src/table/types.ts +33 -15
- package/src/tabs/__tests__/Tab.tsx +3 -3
- package/src/tabs/__tests__/TabList.tsx +50 -40
- package/src/tabs/__tests__/useTabs.tsx +27 -24
- package/src/tabs/_tabs.scss +2 -0
- package/src/test-utils/data-testid.ts +5 -0
- package/src/test-utils/jest-setup.ts +4 -0
- package/src/theme/ThemeProvider.tsx +6 -0
- package/src/theme/__tests__/LocalStorageColorSchemeProvider.tsx +4 -4
- package/src/theme/__tests__/useCSSVariables.tsx +4 -4
- package/src/tooltip/Tooltip.tsx +17 -9
- package/src/tooltip/TooltipHoverModeProvider.tsx +18 -0
- package/src/tooltip/__tests__/Tooltip.tsx +147 -104
- package/src/tooltip/__tests__/TooltipHoverModeProvider.tsx +8 -3
- package/src/tooltip/__tests__/__snapshots__/Tooltip.tsx.snap +0 -33
- package/src/tooltip/_tooltip.scss +1 -0
- package/src/tooltip/tooltipStyles.ts +4 -4
- package/src/tooltip/useTooltip.ts +119 -19
- package/src/transition/__tests__/CSSTransition.tsx +12 -6
- package/src/transition/__tests__/Collapse.tsx +19 -17
- package/src/transition/__tests__/CrossFade.tsx +20 -17
- package/src/transition/__tests__/ScaleTransition.tsx +18 -14
- package/src/transition/__tests__/useCSSTransition.tsx +18 -14
- package/src/transition/__tests__/useCollapseTransition.tsx +25 -21
- package/src/transition/__tests__/useCrossFadeTransition.tsx +20 -16
- package/src/transition/__tests__/useScaleTransition.tsx +18 -12
- package/src/transition/__tests__/useTransition.tsx +165 -68
- package/src/transition/config.ts +34 -0
- package/src/transition/useTransition.ts +15 -6
- package/src/tree/DefaultTreeItemRenderer.tsx +1 -1
- package/src/tree/Tree.tsx +20 -24
- package/src/tree/TreeItem.tsx +2 -3
- package/src/tree/TreeProvider.tsx +6 -0
- package/src/tree/__tests__/Tree.tsx +7 -2
- package/src/tree/__tests__/TreeGroup.tsx +1 -0
- package/src/tree/__tests__/TreeItemExpander.tsx +1 -0
- package/src/typography/__tests__/TextContainer.tsx +3 -3
- package/src/typography/__tests__/Typography.tsx +10 -12
- package/src/typography/__tests__/WritingDirectionProvider.tsx +7 -7
- package/dist/divider/VerticalDivider.js +0 -40
- package/dist/divider/VerticalDivider.js.map +0 -1
- package/dist/divider/useVerticalDividerHeight.js +0 -40
- package/dist/divider/useVerticalDividerHeight.js.map +0 -1
- package/dist/link/LinkProvider.js +0 -26
- package/dist/link/LinkProvider.js.map +0 -1
- package/dist/tooltip/useOverflowTooltip.js +0 -71
- package/dist/tooltip/useOverflowTooltip.js.map +0 -1
- package/src/divider/VerticalDivider.tsx +0 -50
- package/src/divider/__tests__/VerticalDivider.tsx +0 -35
- package/src/divider/__tests__/__snapshots__/VerticalDivider.tsx.snap +0 -41
- package/src/divider/useVerticalDividerHeight.ts +0 -72
- package/src/icon/MaterialIconsProvider.ts +0 -23
- package/src/link/LinkProvider.tsx +0 -51
- package/src/tooltip/__tests__/useOverflowTooltip.tsx +0 -77
- package/src/tooltip/useOverflowTooltip.ts +0 -93
package/dist/_core.scss
CHANGED
|
@@ -267,7 +267,11 @@ $_layer-order: (
|
|
|
267
267
|
|
|
268
268
|
@each $alignment in typography.$text-alignments {
|
|
269
269
|
.rmd-align-#{$alignment} {
|
|
270
|
-
|
|
270
|
+
@if $alignment != center {
|
|
271
|
+
@include utils.auto-rtl(text-align, $alignment);
|
|
272
|
+
} @else {
|
|
273
|
+
text-align: $alignment;
|
|
274
|
+
}
|
|
271
275
|
}
|
|
272
276
|
}
|
|
273
277
|
|
package/dist/avatar/Avatar.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ImgHTMLAttributes } from "react";
|
|
2
2
|
import { type PropsWithRef } from "../types.js";
|
|
3
|
+
import { type AvatarClassNameOptions } from "./styles.js";
|
|
3
4
|
declare module "react" {
|
|
4
5
|
interface CSSProperties {
|
|
5
6
|
"--rmd-avatar-background-color"?: string;
|
|
@@ -11,7 +12,7 @@ declare module "react" {
|
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
export type AvatarImgAttributes = ImgHTMLAttributes<HTMLImageElement>;
|
|
14
|
-
export interface AvatarProps extends HTMLAttributes<HTMLSpanElement
|
|
15
|
+
export interface AvatarProps extends HTMLAttributes<HTMLSpanElement>, AvatarClassNameOptions {
|
|
15
16
|
/**
|
|
16
17
|
* This should be an image `src` attribute to create an avatar from. When this
|
|
17
18
|
* prop is defined, you should not add any children to the avatar as the
|
|
@@ -51,20 +52,6 @@ export interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
51
52
|
* @remarks \@since 2.2.0
|
|
52
53
|
*/
|
|
53
54
|
imgProps?: PropsWithRef<AvatarImgAttributes, HTMLImageElement>;
|
|
54
|
-
/**
|
|
55
|
-
* An optional color to apply to the avatar. This will apply a className of
|
|
56
|
-
* `rmd-avatar--${color}`, so only the keys from the `$rmd-avatar-colors` Map
|
|
57
|
-
* are supported by default. It is recommended to create custom colors using
|
|
58
|
-
* the `rmd-avatar-theme-update-var` mixin with custom class names if the
|
|
59
|
-
* default colors aren't extensive enough.
|
|
60
|
-
*
|
|
61
|
-
* @defaultValue `""`
|
|
62
|
-
*/
|
|
63
|
-
color?: string;
|
|
64
|
-
/**
|
|
65
|
-
* @defaultValue `"avatar"`
|
|
66
|
-
*/
|
|
67
|
-
size?: "avatar" | "icon";
|
|
68
55
|
}
|
|
69
56
|
/**
|
|
70
57
|
* **Server Component**
|
package/dist/avatar/Avatar.js
CHANGED
|
@@ -20,7 +20,7 @@ import { avatar, avatarImage } from "./styles.js";
|
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*/ export const Avatar = /*#__PURE__*/ forwardRef(function Avatar(props, ref) {
|
|
23
|
-
const { className, children, src,
|
|
23
|
+
const { className, children, src, alt = "", size = "avatar", color = "", theme, imgProps, referrerPolicy, ...remaining } = props;
|
|
24
24
|
let img;
|
|
25
25
|
if (src || imgProps) {
|
|
26
26
|
img = /*#__PURE__*/ _jsx("img", {
|
|
@@ -38,8 +38,9 @@ import { avatar, avatarImage } from "./styles.js";
|
|
|
38
38
|
ref: ref,
|
|
39
39
|
role: "presentation",
|
|
40
40
|
className: avatar({
|
|
41
|
-
color,
|
|
42
41
|
size,
|
|
42
|
+
color,
|
|
43
|
+
theme,
|
|
43
44
|
className
|
|
44
45
|
}),
|
|
45
46
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ImgHTMLAttributes } from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { avatar, avatarImage } from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-avatar-background-color\"?: string;\n \"--rmd-avatar-color\"?: string;\n \"--rmd-avatar-border-color\"?: string;\n \"--rmd-avatar-border-radius\"?: string | number;\n \"--rmd-avatar-size\"?: string | number;\n \"--rmd-avatar-font-size\"?: string | number;\n }\n}\n\nexport type AvatarImgAttributes = ImgHTMLAttributes<HTMLImageElement>;\n\nexport interface AvatarProps
|
|
1
|
+
{"version":3,"sources":["../../src/avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ImgHTMLAttributes } from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { avatar, avatarImage, type AvatarClassNameOptions } from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-avatar-background-color\"?: string;\n \"--rmd-avatar-color\"?: string;\n \"--rmd-avatar-border-color\"?: string;\n \"--rmd-avatar-border-radius\"?: string | number;\n \"--rmd-avatar-size\"?: string | number;\n \"--rmd-avatar-font-size\"?: string | number;\n }\n}\n\nexport type AvatarImgAttributes = ImgHTMLAttributes<HTMLImageElement>;\n\nexport interface AvatarProps\n extends HTMLAttributes<HTMLSpanElement>,\n AvatarClassNameOptions {\n /**\n * This should be an image `src` attribute to create an avatar from. When this\n * prop is defined, you should not add any children to the avatar as the\n * positioning will break.\n */\n src?: string;\n\n /**\n * An optional alt tag to display on the `<img>` when the `src` prop is also\n * applied.\n *\n * For accessibility and screen readers, you normally do not want to actually\n * provide this prop. This should only be used if the `Avatar` is not\n * accompanied by some other component or main content as it will be extra\n * noise for screen readers.\n *\n * @defaultValue `\"\"`\n */\n alt?: string;\n\n /**\n * An optional `referrerPolicy` to provide to the `<img>` element if the `src`\n * or `imgProps` props are provided.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-referrerpolicy|Referrer Policy}\n *\n * @remarks \\@since 2.2.0\n */\n referrerPolicy?: AvatarImgAttributes[\"referrerPolicy\"];\n\n /**\n * An optional object of image props and ref that can be used to create an\n * image within the `Avatar`. This can be useful to add a custom `style`\n * or`className` to the `<img>` element if that additional customization is\n * needed.\n *\n * Note: The values in this object will override the `src`, `alt`, and\n * `referrerPolicy` root level avatar props if they exist on this object.\n *\n * @remarks \\@since 2.2.0\n */\n imgProps?: PropsWithRef<AvatarImgAttributes, HTMLImageElement>;\n}\n\n/**\n * **Server Component**\n *\n * An `Avatar` is generally used to represent objects or people within your app.\n * The avatar can consist of an image, an icon, or some text to display. When\n * the avatar is not an image, different themes can be applied to make the\n * avatar more unique.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { Avatar } from \"@react-md/core\";\n * import { type ReactElement } from \"react\";\n *\n * export function Example(): ReactElement {\n * return <Avatar src=\"/path-to-img.png\" />;\n * }\n * ```\n */\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(\n function Avatar(props, ref) {\n const {\n className,\n children,\n src,\n alt = \"\",\n size = \"avatar\",\n color = \"\",\n theme,\n imgProps,\n referrerPolicy,\n ...remaining\n } = props;\n\n let img;\n if (src || imgProps) {\n img = (\n <img\n src={src}\n alt={alt}\n referrerPolicy={referrerPolicy}\n {...imgProps}\n className={avatarImage({ className: imgProps?.className })}\n />\n );\n }\n\n return (\n <span\n {...remaining}\n ref={ref}\n role=\"presentation\"\n className={avatar({\n size,\n color,\n theme,\n className,\n })}\n >\n {img}\n {children}\n </span>\n );\n }\n);\n"],"names":["forwardRef","avatar","avatarImage","Avatar","props","ref","className","children","src","alt","size","color","theme","imgProps","referrerPolicy","remaining","img","span","role"],"mappings":";AAAA,SAASA,UAAU,QAAqD,QAAQ;AAEhF,SAASC,MAAM,EAAEC,WAAW,QAAqC,cAAc;AA8D/E;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,MAAMC,uBAASH,WACpB,SAASG,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EACJC,SAAS,EACTC,QAAQ,EACRC,GAAG,EACHC,MAAM,EAAE,EACRC,OAAO,QAAQ,EACfC,QAAQ,EAAE,EACVC,KAAK,EACLC,QAAQ,EACRC,cAAc,EACd,GAAGC,WACJ,GAAGX;IAEJ,IAAIY;IACJ,IAAIR,OAAOK,UAAU;QACnBG,oBACE,KAACA;YACCR,KAAKA;YACLC,KAAKA;YACLK,gBAAgBA;YACf,GAAGD,QAAQ;YACZP,WAAWJ,YAAY;gBAAEI,WAAWO,UAAUP;YAAU;;IAG9D;IAEA,qBACE,MAACW;QACE,GAAGF,SAAS;QACbV,KAAKA;QACLa,MAAK;QACLZ,WAAWL,OAAO;YAChBS;YACAC;YACAC;YACAN;QACF;;YAECU;YACAT;;;AAGP,GACA"}
|
package/dist/avatar/_avatar.scss
CHANGED
|
@@ -20,7 +20,7 @@ $font-size: 1.5rem !default;
|
|
|
20
20
|
$icon-sized-size: icon.get-var(size) !default;
|
|
21
21
|
$icon-sized-font-size: 0.75rem !default;
|
|
22
22
|
|
|
23
|
-
$colors: (
|
|
23
|
+
$default-colors: (
|
|
24
24
|
red: colors.$red-a-700 colors.$red-50,
|
|
25
25
|
pink: colors.$pink-600 colors.$white,
|
|
26
26
|
purple: colors.$purple-700 colors.$purple-100,
|
|
@@ -40,7 +40,9 @@ $colors: (
|
|
|
40
40
|
brown: colors.$brown-500 colors.$brown-50,
|
|
41
41
|
grey: colors.$grey-700 colors.$grey-100,
|
|
42
42
|
blue-grey: colors.$blue-grey-700 colors.$blue-grey-50,
|
|
43
|
-
)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
$colors: $default-colors !default;
|
|
44
46
|
|
|
45
47
|
$var-lookup: (
|
|
46
48
|
background-color: (
|
package/dist/avatar/styles.d.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
import { type ThemeColor } from "../cssUtils.js";
|
|
1
2
|
/** @remarks \@since 6.0.0 */
|
|
2
3
|
export interface AvatarClassNameOptions {
|
|
3
4
|
className?: string;
|
|
4
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* An optional color to apply to the avatar. This will apply a className of
|
|
7
|
+
* `rmd-avatar--${color}`, so only the keys from the `$rmd-avatar-colors` Map
|
|
8
|
+
* are supported by default. It is recommended to create custom colors using
|
|
9
|
+
* the `rmd-avatar-theme-update-var` mixin with custom class names if the
|
|
10
|
+
* default colors aren't extensive enough.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link theme}
|
|
13
|
+
* @defaultValue `""`
|
|
14
|
+
*/
|
|
5
15
|
color?: string;
|
|
6
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @defaultValue `"avatar"`
|
|
18
|
+
*/
|
|
7
19
|
size?: "avatar" | "icon";
|
|
20
|
+
/**
|
|
21
|
+
* This can be used instead of {@link color} to set the background color to one of
|
|
22
|
+
* the theme colors. This will also set the text color to either be `#000` or
|
|
23
|
+
* `#fff` automatically to enforce the correct aspect ratio.
|
|
24
|
+
*/
|
|
25
|
+
theme?: ThemeColor;
|
|
8
26
|
}
|
|
9
27
|
/**
|
|
10
28
|
* @remarks \@since 6.0.0
|
package/dist/avatar/styles.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { cnb } from "cnbuilder";
|
|
2
|
+
import { cssUtils } from "../cssUtils.js";
|
|
2
3
|
import { bem } from "../utils/bem.js";
|
|
3
4
|
const styles = bem("rmd-avatar");
|
|
4
5
|
/**
|
|
5
6
|
* @remarks \@since 6.0.0
|
|
6
7
|
*/ export function avatar(options) {
|
|
7
|
-
const { className, color = "", size } = options;
|
|
8
|
+
const { className, color = "", size, theme } = options;
|
|
8
9
|
return cnb(styles({
|
|
9
10
|
[color]: color,
|
|
10
11
|
icon: size === "icon"
|
|
12
|
+
}), cssUtils({
|
|
13
|
+
backgroundColor: theme
|
|
11
14
|
}), className);
|
|
12
15
|
}
|
|
13
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/avatar/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-avatar\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface AvatarClassNameOptions {\n className?: string;\n\n
|
|
1
|
+
{"version":3,"sources":["../../src/avatar/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type ThemeColor } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-avatar\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface AvatarClassNameOptions {\n className?: string;\n\n /**\n * An optional color to apply to the avatar. This will apply a className of\n * `rmd-avatar--${color}`, so only the keys from the `$rmd-avatar-colors` Map\n * are supported by default. It is recommended to create custom colors using\n * the `rmd-avatar-theme-update-var` mixin with custom class names if the\n * default colors aren't extensive enough.\n *\n * @see {@link theme}\n * @defaultValue `\"\"`\n */\n color?: string;\n\n /**\n * @defaultValue `\"avatar\"`\n */\n size?: \"avatar\" | \"icon\";\n\n /**\n * This can be used instead of {@link color} to set the background color to one of\n * the theme colors. This will also set the text color to either be `#000` or\n * `#fff` automatically to enforce the correct aspect ratio.\n */\n theme?: ThemeColor;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function avatar(options: AvatarClassNameOptions): string {\n const { className, color = \"\", size, theme } = options;\n\n return cnb(\n styles({ [color]: color, icon: size === \"icon\" }),\n cssUtils({ backgroundColor: theme }),\n className\n );\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface AvatarImageClassNameOptions {\n className?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function avatarImage(options: AvatarImageClassNameOptions = {}): string {\n const { className } = options;\n\n return cnb(styles(\"image\"), className);\n}\n"],"names":["cnb","cssUtils","bem","styles","avatar","options","className","color","size","theme","icon","backgroundColor","avatarImage"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAyB,iBAAiB;AAC3D,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA+BnB;;CAEC,GACD,OAAO,SAASE,OAAOC,OAA+B;IACpD,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ;IAE/C,OAAOL,IACLG,OAAO;QAAE,CAACI,MAAM,EAAEA;QAAOG,MAAMF,SAAS;IAAO,IAC/CP,SAAS;QAAEU,iBAAiBF;IAAM,IAClCH;AAEJ;AAOA;;CAEC,GACD,OAAO,SAASM,YAAYP,UAAuC,CAAC,CAAC;IACnE,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOL,IAAIG,OAAO,UAAUG;AAC9B"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type MouseEvent, type ReactNode } from "react";
|
|
2
|
+
import { type CircularProgressProps } from "../progress/CircularProgress.js";
|
|
3
|
+
import { type LinearProgressProps } from "../progress/LinearProgress.js";
|
|
4
|
+
import { type PropsWithRef } from "../types.js";
|
|
2
5
|
import { type ButtonProps } from "./Button.js";
|
|
3
6
|
/**
|
|
4
7
|
* @remarks \@since 6.0.0
|
|
@@ -8,6 +11,11 @@ export type AsyncButtonLoadingType = "circular-before" | "circular-after" | "cir
|
|
|
8
11
|
* @remarks \@since 6.0.0
|
|
9
12
|
*/
|
|
10
13
|
export interface AsyncButtonProps extends ButtonProps {
|
|
14
|
+
/**
|
|
15
|
+
* @see {@link progressAriaLabelledBy}
|
|
16
|
+
* @defaultValue `"async-button" + useId()`
|
|
17
|
+
*/
|
|
18
|
+
id?: string;
|
|
11
19
|
/**
|
|
12
20
|
* When this is defined and returns a `Promise`, the loading indicator will
|
|
13
21
|
* display until the promise has resolved.
|
|
@@ -63,6 +71,27 @@ export interface AsyncButtonProps extends ButtonProps {
|
|
|
63
71
|
* the button, and the loading indicator should replace the icon.
|
|
64
72
|
*/
|
|
65
73
|
afterAddon?: ReactNode;
|
|
74
|
+
/**
|
|
75
|
+
* An optional label to provide to the progressbar.
|
|
76
|
+
*
|
|
77
|
+
* @see {@link progressAriaLabelledBy}
|
|
78
|
+
*/
|
|
79
|
+
progressAriaLabel?: string;
|
|
80
|
+
/**
|
|
81
|
+
* @see {@link id}
|
|
82
|
+
* @defaultValue `id`
|
|
83
|
+
*/
|
|
84
|
+
progressAriaLabelledBy?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Any additional props to pass to the `CircularProgress` bar when the
|
|
87
|
+
* {@link loadingType} is one of the circular types.
|
|
88
|
+
*/
|
|
89
|
+
linearProgressProps?: PropsWithRef<LinearProgressProps, HTMLDivElement>;
|
|
90
|
+
/**
|
|
91
|
+
* Any additional props to pass to the `LinearProgress` bar when the
|
|
92
|
+
* {@link loadingType} is one of the linear types.
|
|
93
|
+
*/
|
|
94
|
+
circularProgressProps?: PropsWithRef<CircularProgressProps, HTMLSpanElement>;
|
|
66
95
|
}
|
|
67
96
|
/**
|
|
68
97
|
* **Client Component**
|
|
@@ -6,6 +6,7 @@ import { overlay } from "../overlay/overlayStyles.js";
|
|
|
6
6
|
import { CircularProgress } from "../progress/CircularProgress.js";
|
|
7
7
|
import { LinearProgress } from "../progress/LinearProgress.js";
|
|
8
8
|
import { useAsyncAction } from "../useAsyncAction.js";
|
|
9
|
+
import { useEnsuredId } from "../useEnsuredId.js";
|
|
9
10
|
import { Button } from "./Button.js";
|
|
10
11
|
const noop = ()=>{
|
|
11
12
|
// do nothing
|
|
@@ -72,7 +73,8 @@ const noop = ()=>{
|
|
|
72
73
|
*
|
|
73
74
|
* @remarks \@since 6.0.0
|
|
74
75
|
*/ export const AsyncButton = /*#__PURE__*/ forwardRef(function AsyncButton(props, ref) {
|
|
75
|
-
const { onClick = noop, children, floating = null, theme = floating ? "secondary" : "clear", themeType = floating ? "contained" : "flat", buttonType = floating ? "icon" : "text", className, disabled, loading: propLoading = false, loadingType = "circular-overlay", loadingChildren, loadingDisabledTheme = false, afterAddon: propAfterAddon, beforeAddon: propBeforeAddon, ...remaining } = props;
|
|
76
|
+
const { id: propId, onClick = noop, children, floating = null, theme = floating ? "secondary" : "clear", themeType = floating ? "contained" : "flat", buttonType = floating ? "icon" : "text", className, disabled, loading: propLoading = false, loadingType = "circular-overlay", loadingChildren, loadingDisabledTheme = false, afterAddon: propAfterAddon, beforeAddon: propBeforeAddon, linearProgressProps, circularProgressProps, progressAriaLabel, progressAriaLabelledBy: propProgressAriaLabelledBy, ...remaining } = props;
|
|
77
|
+
const id = useEnsuredId(propId, "async-button");
|
|
76
78
|
const { handleAsync, pending } = useAsyncAction({
|
|
77
79
|
disabled
|
|
78
80
|
});
|
|
@@ -81,9 +83,19 @@ const noop = ()=>{
|
|
|
81
83
|
if (theme === "clear" || theme === "disabled") {
|
|
82
84
|
progressTheme = "primary";
|
|
83
85
|
}
|
|
86
|
+
let progressAriaLabelledBy = propProgressAriaLabelledBy;
|
|
87
|
+
if (!progressAriaLabel && !linearProgressProps?.["aria-label"] && !linearProgressProps?.["aria-labelledby"] && !circularProgressProps?.["aria-label"] && !circularProgressProps?.["aria-labelledby"]) {
|
|
88
|
+
progressAriaLabelledBy = id;
|
|
89
|
+
}
|
|
84
90
|
const progress = loadingType.includes("linear") ? /*#__PURE__*/ _jsx(LinearProgress, {
|
|
91
|
+
"aria-label": progressAriaLabel,
|
|
92
|
+
"aria-labelledby": progressAriaLabelledBy,
|
|
93
|
+
...linearProgressProps,
|
|
85
94
|
theme: progressTheme
|
|
86
95
|
}) : /*#__PURE__*/ _jsx(CircularProgress, {
|
|
96
|
+
"aria-label": progressAriaLabel,
|
|
97
|
+
"aria-labelledby": progressAriaLabelledBy,
|
|
98
|
+
...circularProgressProps,
|
|
87
99
|
theme: progressTheme
|
|
88
100
|
});
|
|
89
101
|
let afterAddon = propAfterAddon;
|
|
@@ -124,6 +136,7 @@ const noop = ()=>{
|
|
|
124
136
|
return /*#__PURE__*/ _jsxs(Button, {
|
|
125
137
|
...remaining,
|
|
126
138
|
"aria-disabled": loading || undefined,
|
|
139
|
+
id: id,
|
|
127
140
|
ref: ref,
|
|
128
141
|
disabled: disabled,
|
|
129
142
|
floating: floating,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/AsyncButton.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, type MouseEvent, type ReactNode } from \"react\";\nimport { type BoxAlignItems } from \"../box/styles.js\";\nimport { overlay } from \"../overlay/overlayStyles.js\";\nimport { CircularProgress } from \"../progress/CircularProgress.js\";\nimport { LinearProgress } from \"../progress/LinearProgress.js\";\nimport { type ProgressTheme } from \"../progress/types.js\";\nimport { useAsyncAction } from \"../useAsyncAction.js\";\nimport { Button, type ButtonProps } from \"./Button.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type AsyncButtonLoadingType =\n | \"circular-before\"\n | \"circular-after\"\n | \"circular-overlay\"\n | \"linear-above\"\n | \"linear-below\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface AsyncButtonProps extends ButtonProps {\n /**\n * When this is defined and returns a `Promise`, the loading indicator will\n * display until the promise has resolved.\n *\n * @defaultValue `() => {}`\n */\n onClick?(event: MouseEvent<HTMLButtonElement>): Promise<void> | void;\n\n /**\n * Set this to `true` to manually display a loading spinner.\n *\n * @defaultValue `false`\n */\n loading?: boolean;\n\n /**\n * - `\"circular-overlay\"` - Covers and hides the button content with a\n * centered circular progress\n * - `\"circular-before\"` - Renders a circular progress bar before the button\n * content which is useful when rendering an icon before the button text.\n * See {@link beforeAddon} as well.\n * - `\"circular-after\"` - Renders a circular progress bar before the button\n * content which is useful when rendering an icon after the button text.\n * See {@link afterAddon} as well.\n * - `\"linear-above\"` - Renders a linear progress bar at the top of the button\n * while still displaying the button contents. Usually looks good for\n * outlined buttons.\n * - `\"linear-below\"` - Renders a linear progress bar at the bottom of the\n * button while still displaying the button contents. Usually looks good for\n * outlined buttons.\n *\n * @defaultValue `\"circular-overlay\"`\n */\n loadingType?: AsyncButtonLoadingType;\n\n /**\n * Optional content to display instead of the default `children` while\n * loading.\n */\n loadingChildren?: ReactNode;\n\n /**\n * Set this to `true` to use the `disabled` theme while loading.\n *\n * @defaultValue `false`\n */\n loadingDisabledTheme?: boolean;\n\n /**\n * This should be used when the {@link loadingType} is set to\n * `\"circular-before\"`, an icon should appear before the other content in\n * the button, and the loading indicator should replace the icon.\n */\n beforeAddon?: ReactNode;\n\n /**\n * This should be used when the {@link loadingType} is set to\n * `\"circular-after\"`, an icon should appear before the other content in\n * the button, and the loading indicator should replace the icon.\n */\n afterAddon?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * The async button can be used to render a loading indicator within a button\n * during an async task. The loading spinner can be shown either by enabling the\n * `loading` prop or returning a promise from the `onClick` event which will\n * continue to show the loading indicator until the promise has been resolved.\n *\n * @example\n * Async onClick\n * ```tsx\n * import { AsyncButton } from \"@react-md/core\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const [data, setData] = useState(null);\n * return (\n * <AsyncButton\n * type=\"submit\"\n * onClick={async () => {\n * const response = await fetch(\"/my-api\");\n * const json = await response.json();\n * setData(json);\n * }}\n * >\n * Submit\n * </AsyncButton>\n * );\n * }\n * ```\n *\n * @example\n * Manual Loading State\n * ```tsx\n * import { AsyncButton } from \"@react-md/core\";\n * import { useMutation } from \"@tanstack/query\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { isLoading, mutate } = useMutation({\n * mutationFn: (newTodo) => fetch('/todos', {\n * method: \"POST\",\n * body: JSON.stringify(newTodo),\n * }),\n * });\n *\n * return (\n * <AsyncButton\n * type=\"submit\"\n * loading={isLoading}\n * onClick={() => {\n * mutate({ id: Date.now(), title: \"Create example\" });\n * }}\n * >\n * Create Todo\n * </AsyncButton>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const AsyncButton = forwardRef<HTMLButtonElement, AsyncButtonProps>(\n function AsyncButton(props, ref) {\n const {\n onClick = noop,\n children,\n floating = null,\n theme = floating ? \"secondary\" : \"clear\",\n themeType = floating ? \"contained\" : \"flat\",\n buttonType = floating ? \"icon\" : \"text\",\n className,\n disabled,\n loading: propLoading = false,\n loadingType = \"circular-overlay\",\n loadingChildren,\n loadingDisabledTheme = false,\n afterAddon: propAfterAddon,\n beforeAddon: propBeforeAddon,\n ...remaining\n } = props;\n const { handleAsync, pending } = useAsyncAction({ disabled });\n const loading = pending || propLoading;\n\n let progressTheme: ProgressTheme = \"current-color\";\n if (theme === \"clear\" || theme === \"disabled\") {\n progressTheme = \"primary\";\n }\n\n const progress = loadingType.includes(\"linear\") ? (\n <LinearProgress theme={progressTheme} />\n ) : (\n <CircularProgress theme={progressTheme} />\n );\n\n let afterAddon = propAfterAddon;\n let beforeAddon = propBeforeAddon;\n let overlayElement: ReactNode;\n let isOverlayCover = false;\n switch (loadingType) {\n case \"circular-before\":\n beforeAddon = loading ? progress : propBeforeAddon;\n break;\n case \"circular-after\":\n afterAddon = loading ? progress : propAfterAddon;\n break;\n case \"circular-overlay\":\n case \"linear-above\":\n case \"linear-below\": {\n let alignItems: BoxAlignItems = \"center\";\n if (loadingType === \"linear-above\") {\n alignItems = \"start\";\n } else if (loadingType === \"linear-below\") {\n alignItems = \"end\";\n } else {\n isOverlayCover = true;\n }\n\n overlayElement = loading && (\n <span\n className={overlay({\n active: true,\n visible: true,\n absolute: true,\n align: alignItems,\n })}\n >\n {progress}\n </span>\n );\n break;\n }\n }\n\n return (\n <Button\n {...remaining}\n aria-disabled={loading || undefined}\n ref={ref}\n disabled={disabled}\n floating={floating}\n className={cnb(\n \"rmd-button--async\",\n loading && isOverlayCover && \"rmd-button--async-overlay\",\n className\n )}\n theme={loading && loadingDisabledTheme ? \"disabled\" : theme}\n themeType={themeType}\n buttonType={buttonType}\n onClick={handleAsync((event) => Promise.resolve(onClick(event)))}\n >\n {beforeAddon}\n {loading && typeof loadingChildren !== \"undefined\"\n ? loadingChildren\n : children}\n {afterAddon}\n {overlayElement}\n </Button>\n );\n }\n);\n"],"names":["cnb","forwardRef","overlay","CircularProgress","LinearProgress","useAsyncAction","Button","noop","AsyncButton","props","ref","onClick","children","floating","theme","themeType","buttonType","className","disabled","loading","propLoading","loadingType","loadingChildren","loadingDisabledTheme","afterAddon","propAfterAddon","beforeAddon","propBeforeAddon","remaining","handleAsync","pending","progressTheme","progress","includes","overlayElement","isOverlayCover","alignItems","span","active","visible","absolute","align","aria-disabled","undefined","event","Promise","resolve"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAyC,QAAQ;AAEpE,SAASC,OAAO,QAAQ,8BAA8B;AACtD,SAASC,gBAAgB,QAAQ,kCAAkC;AACnE,SAASC,cAAc,QAAQ,gCAAgC;AAE/D,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,MAAM,QAA0B,cAAc;AAEvD,MAAMC,OAAO;AACX,aAAa;AACf;AA+EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DC,GACD,OAAO,MAAMC,4BAAcP,WACzB,SAASO,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,UAAUJ,IAAI,EACdK,QAAQ,EACRC,WAAW,IAAI,EACfC,QAAQD,WAAW,cAAc,OAAO,EACxCE,YAAYF,WAAW,cAAc,MAAM,EAC3CG,aAAaH,WAAW,SAAS,MAAM,EACvCI,SAAS,EACTC,QAAQ,EACRC,SAASC,cAAc,KAAK,EAC5BC,cAAc,kBAAkB,EAChCC,eAAe,EACfC,uBAAuB,KAAK,EAC5BC,YAAYC,cAAc,EAC1BC,aAAaC,eAAe,EAC5B,GAAGC,WACJ,GAAGnB;IACJ,MAAM,EAAEoB,WAAW,EAAEC,OAAO,EAAE,GAAGzB,eAAe;QAAEa;IAAS;IAC3D,MAAMC,UAAUW,WAAWV;IAE3B,IAAIW,gBAA+B;IACnC,IAAIjB,UAAU,WAAWA,UAAU,YAAY;QAC7CiB,gBAAgB;IAClB;IAEA,MAAMC,WAAWX,YAAYY,QAAQ,CAAC,0BACpC,KAAC7B;QAAeU,OAAOiB;uBAEvB,KAAC5B;QAAiBW,OAAOiB;;IAG3B,IAAIP,aAAaC;IACjB,IAAIC,cAAcC;IAClB,IAAIO;IACJ,IAAIC,iBAAiB;IACrB,OAAQd;QACN,KAAK;YACHK,cAAcP,UAAUa,WAAWL;YACnC;QACF,KAAK;YACHH,aAAaL,UAAUa,WAAWP;YAClC;QACF,KAAK;QACL,KAAK;QACL,KAAK;YAAgB;gBACnB,IAAIW,aAA4B;gBAChC,IAAIf,gBAAgB,gBAAgB;oBAClCe,aAAa;gBACf,OAAO,IAAIf,gBAAgB,gBAAgB;oBACzCe,aAAa;gBACf,OAAO;oBACLD,iBAAiB;gBACnB;gBAEAD,iBAAiBf,yBACf,KAACkB;oBACCpB,WAAWf,QAAQ;wBACjBoC,QAAQ;wBACRC,SAAS;wBACTC,UAAU;wBACVC,OAAOL;oBACT;8BAECJ;;gBAGL;YACF;IACF;IAEA,qBACE,MAAC1B;QACE,GAAGsB,SAAS;QACbc,iBAAevB,WAAWwB;QAC1BjC,KAAKA;QACLQ,UAAUA;QACVL,UAAUA;QACVI,WAAWjB,IACT,qBACAmB,WAAWgB,kBAAkB,6BAC7BlB;QAEFH,OAAOK,WAAWI,uBAAuB,aAAaT;QACtDC,WAAWA;QACXC,YAAYA;QACZL,SAASkB,YAAY,CAACe,QAAUC,QAAQC,OAAO,CAACnC,QAAQiC;;YAEvDlB;YACAP,WAAW,OAAOG,oBAAoB,cACnCA,kBACAV;YACHY;YACAU;;;AAGP,GACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/button/AsyncButton.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, type MouseEvent, type ReactNode } from \"react\";\nimport { type BoxAlignItems } from \"../box/styles.js\";\nimport { overlay } from \"../overlay/overlayStyles.js\";\nimport {\n CircularProgress,\n type CircularProgressProps,\n} from \"../progress/CircularProgress.js\";\nimport {\n LinearProgress,\n type LinearProgressProps,\n} from \"../progress/LinearProgress.js\";\nimport { type ProgressTheme } from \"../progress/types.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useAsyncAction } from \"../useAsyncAction.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { Button, type ButtonProps } from \"./Button.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type AsyncButtonLoadingType =\n | \"circular-before\"\n | \"circular-after\"\n | \"circular-overlay\"\n | \"linear-above\"\n | \"linear-below\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface AsyncButtonProps extends ButtonProps {\n /**\n * @see {@link progressAriaLabelledBy}\n * @defaultValue `\"async-button\" + useId()`\n */\n id?: string;\n\n /**\n * When this is defined and returns a `Promise`, the loading indicator will\n * display until the promise has resolved.\n *\n * @defaultValue `() => {}`\n */\n onClick?(event: MouseEvent<HTMLButtonElement>): Promise<void> | void;\n\n /**\n * Set this to `true` to manually display a loading spinner.\n *\n * @defaultValue `false`\n */\n loading?: boolean;\n\n /**\n * - `\"circular-overlay\"` - Covers and hides the button content with a\n * centered circular progress\n * - `\"circular-before\"` - Renders a circular progress bar before the button\n * content which is useful when rendering an icon before the button text.\n * See {@link beforeAddon} as well.\n * - `\"circular-after\"` - Renders a circular progress bar before the button\n * content which is useful when rendering an icon after the button text.\n * See {@link afterAddon} as well.\n * - `\"linear-above\"` - Renders a linear progress bar at the top of the button\n * while still displaying the button contents. Usually looks good for\n * outlined buttons.\n * - `\"linear-below\"` - Renders a linear progress bar at the bottom of the\n * button while still displaying the button contents. Usually looks good for\n * outlined buttons.\n *\n * @defaultValue `\"circular-overlay\"`\n */\n loadingType?: AsyncButtonLoadingType;\n\n /**\n * Optional content to display instead of the default `children` while\n * loading.\n */\n loadingChildren?: ReactNode;\n\n /**\n * Set this to `true` to use the `disabled` theme while loading.\n *\n * @defaultValue `false`\n */\n loadingDisabledTheme?: boolean;\n\n /**\n * This should be used when the {@link loadingType} is set to\n * `\"circular-before\"`, an icon should appear before the other content in\n * the button, and the loading indicator should replace the icon.\n */\n beforeAddon?: ReactNode;\n\n /**\n * This should be used when the {@link loadingType} is set to\n * `\"circular-after\"`, an icon should appear before the other content in\n * the button, and the loading indicator should replace the icon.\n */\n afterAddon?: ReactNode;\n\n /**\n * An optional label to provide to the progressbar.\n *\n * @see {@link progressAriaLabelledBy}\n */\n progressAriaLabel?: string;\n\n /**\n * @see {@link id}\n * @defaultValue `id`\n */\n progressAriaLabelledBy?: string;\n\n /**\n * Any additional props to pass to the `CircularProgress` bar when the\n * {@link loadingType} is one of the circular types.\n */\n linearProgressProps?: PropsWithRef<LinearProgressProps, HTMLDivElement>;\n\n /**\n * Any additional props to pass to the `LinearProgress` bar when the\n * {@link loadingType} is one of the linear types.\n */\n circularProgressProps?: PropsWithRef<CircularProgressProps, HTMLSpanElement>;\n}\n\n/**\n * **Client Component**\n *\n * The async button can be used to render a loading indicator within a button\n * during an async task. The loading spinner can be shown either by enabling the\n * `loading` prop or returning a promise from the `onClick` event which will\n * continue to show the loading indicator until the promise has been resolved.\n *\n * @example\n * Async onClick\n * ```tsx\n * import { AsyncButton } from \"@react-md/core\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const [data, setData] = useState(null);\n * return (\n * <AsyncButton\n * type=\"submit\"\n * onClick={async () => {\n * const response = await fetch(\"/my-api\");\n * const json = await response.json();\n * setData(json);\n * }}\n * >\n * Submit\n * </AsyncButton>\n * );\n * }\n * ```\n *\n * @example\n * Manual Loading State\n * ```tsx\n * import { AsyncButton } from \"@react-md/core\";\n * import { useMutation } from \"@tanstack/query\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { isLoading, mutate } = useMutation({\n * mutationFn: (newTodo) => fetch('/todos', {\n * method: \"POST\",\n * body: JSON.stringify(newTodo),\n * }),\n * });\n *\n * return (\n * <AsyncButton\n * type=\"submit\"\n * loading={isLoading}\n * onClick={() => {\n * mutate({ id: Date.now(), title: \"Create example\" });\n * }}\n * >\n * Create Todo\n * </AsyncButton>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const AsyncButton = forwardRef<HTMLButtonElement, AsyncButtonProps>(\n function AsyncButton(props, ref) {\n const {\n id: propId,\n onClick = noop,\n children,\n floating = null,\n theme = floating ? \"secondary\" : \"clear\",\n themeType = floating ? \"contained\" : \"flat\",\n buttonType = floating ? \"icon\" : \"text\",\n className,\n disabled,\n loading: propLoading = false,\n loadingType = \"circular-overlay\",\n loadingChildren,\n loadingDisabledTheme = false,\n afterAddon: propAfterAddon,\n beforeAddon: propBeforeAddon,\n linearProgressProps,\n circularProgressProps,\n progressAriaLabel,\n progressAriaLabelledBy: propProgressAriaLabelledBy,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"async-button\");\n const { handleAsync, pending } = useAsyncAction({ disabled });\n const loading = pending || propLoading;\n\n let progressTheme: ProgressTheme = \"current-color\";\n if (theme === \"clear\" || theme === \"disabled\") {\n progressTheme = \"primary\";\n }\n\n let progressAriaLabelledBy = propProgressAriaLabelledBy;\n if (\n !progressAriaLabel &&\n !linearProgressProps?.[\"aria-label\"] &&\n !linearProgressProps?.[\"aria-labelledby\"] &&\n !circularProgressProps?.[\"aria-label\"] &&\n !circularProgressProps?.[\"aria-labelledby\"]\n ) {\n progressAriaLabelledBy = id;\n }\n\n const progress = loadingType.includes(\"linear\") ? (\n <LinearProgress\n aria-label={progressAriaLabel}\n aria-labelledby={progressAriaLabelledBy as string}\n {...linearProgressProps}\n theme={progressTheme}\n />\n ) : (\n <CircularProgress\n aria-label={progressAriaLabel}\n aria-labelledby={progressAriaLabelledBy as string}\n {...circularProgressProps}\n theme={progressTheme}\n />\n );\n\n let afterAddon = propAfterAddon;\n let beforeAddon = propBeforeAddon;\n let overlayElement: ReactNode;\n let isOverlayCover = false;\n switch (loadingType) {\n case \"circular-before\":\n beforeAddon = loading ? progress : propBeforeAddon;\n break;\n case \"circular-after\":\n afterAddon = loading ? progress : propAfterAddon;\n break;\n case \"circular-overlay\":\n case \"linear-above\":\n case \"linear-below\": {\n let alignItems: BoxAlignItems = \"center\";\n if (loadingType === \"linear-above\") {\n alignItems = \"start\";\n } else if (loadingType === \"linear-below\") {\n alignItems = \"end\";\n } else {\n isOverlayCover = true;\n }\n\n overlayElement = loading && (\n <span\n className={overlay({\n active: true,\n visible: true,\n absolute: true,\n align: alignItems,\n })}\n >\n {progress}\n </span>\n );\n break;\n }\n }\n\n return (\n <Button\n {...remaining}\n aria-disabled={loading || undefined}\n id={id}\n ref={ref}\n disabled={disabled}\n floating={floating}\n className={cnb(\n \"rmd-button--async\",\n loading && isOverlayCover && \"rmd-button--async-overlay\",\n className\n )}\n theme={loading && loadingDisabledTheme ? \"disabled\" : theme}\n themeType={themeType}\n buttonType={buttonType}\n onClick={handleAsync((event) => Promise.resolve(onClick(event)))}\n >\n {beforeAddon}\n {loading && typeof loadingChildren !== \"undefined\"\n ? loadingChildren\n : children}\n {afterAddon}\n {overlayElement}\n </Button>\n );\n }\n);\n"],"names":["cnb","forwardRef","overlay","CircularProgress","LinearProgress","useAsyncAction","useEnsuredId","Button","noop","AsyncButton","props","ref","id","propId","onClick","children","floating","theme","themeType","buttonType","className","disabled","loading","propLoading","loadingType","loadingChildren","loadingDisabledTheme","afterAddon","propAfterAddon","beforeAddon","propBeforeAddon","linearProgressProps","circularProgressProps","progressAriaLabel","progressAriaLabelledBy","propProgressAriaLabelledBy","remaining","handleAsync","pending","progressTheme","progress","includes","aria-label","aria-labelledby","overlayElement","isOverlayCover","alignItems","span","active","visible","absolute","align","aria-disabled","undefined","event","Promise","resolve"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAyC,QAAQ;AAEpE,SAASC,OAAO,QAAQ,8BAA8B;AACtD,SACEC,gBAAgB,QAEX,kCAAkC;AACzC,SACEC,cAAc,QAET,gCAAgC;AAGvC,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,MAAM,QAA0B,cAAc;AAEvD,MAAMC,OAAO;AACX,aAAa;AACf;AA8GA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DC,GACD,OAAO,MAAMC,4BAAcR,WACzB,SAASQ,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,IAAIC,MAAM,EACVC,UAAUN,IAAI,EACdO,QAAQ,EACRC,WAAW,IAAI,EACfC,QAAQD,WAAW,cAAc,OAAO,EACxCE,YAAYF,WAAW,cAAc,MAAM,EAC3CG,aAAaH,WAAW,SAAS,MAAM,EACvCI,SAAS,EACTC,QAAQ,EACRC,SAASC,cAAc,KAAK,EAC5BC,cAAc,kBAAkB,EAChCC,eAAe,EACfC,uBAAuB,KAAK,EAC5BC,YAAYC,cAAc,EAC1BC,aAAaC,eAAe,EAC5BC,mBAAmB,EACnBC,qBAAqB,EACrBC,iBAAiB,EACjBC,wBAAwBC,0BAA0B,EAClD,GAAGC,WACJ,GAAG1B;IACJ,MAAME,KAAKN,aAAaO,QAAQ;IAChC,MAAM,EAAEwB,WAAW,EAAEC,OAAO,EAAE,GAAGjC,eAAe;QAAEgB;IAAS;IAC3D,MAAMC,UAAUgB,WAAWf;IAE3B,IAAIgB,gBAA+B;IACnC,IAAItB,UAAU,WAAWA,UAAU,YAAY;QAC7CsB,gBAAgB;IAClB;IAEA,IAAIL,yBAAyBC;IAC7B,IACE,CAACF,qBACD,CAACF,qBAAqB,CAAC,aAAa,IACpC,CAACA,qBAAqB,CAAC,kBAAkB,IACzC,CAACC,uBAAuB,CAAC,aAAa,IACtC,CAACA,uBAAuB,CAAC,kBAAkB,EAC3C;QACAE,yBAAyBtB;IAC3B;IAEA,MAAM4B,WAAWhB,YAAYiB,QAAQ,CAAC,0BACpC,KAACrC;QACCsC,cAAYT;QACZU,mBAAiBT;QAChB,GAAGH,mBAAmB;QACvBd,OAAOsB;uBAGT,KAACpC;QACCuC,cAAYT;QACZU,mBAAiBT;QAChB,GAAGF,qBAAqB;QACzBf,OAAOsB;;IAIX,IAAIZ,aAAaC;IACjB,IAAIC,cAAcC;IAClB,IAAIc;IACJ,IAAIC,iBAAiB;IACrB,OAAQrB;QACN,KAAK;YACHK,cAAcP,UAAUkB,WAAWV;YACnC;QACF,KAAK;YACHH,aAAaL,UAAUkB,WAAWZ;YAClC;QACF,KAAK;QACL,KAAK;QACL,KAAK;YAAgB;gBACnB,IAAIkB,aAA4B;gBAChC,IAAItB,gBAAgB,gBAAgB;oBAClCsB,aAAa;gBACf,OAAO,IAAItB,gBAAgB,gBAAgB;oBACzCsB,aAAa;gBACf,OAAO;oBACLD,iBAAiB;gBACnB;gBAEAD,iBAAiBtB,yBACf,KAACyB;oBACC3B,WAAWlB,QAAQ;wBACjB8C,QAAQ;wBACRC,SAAS;wBACTC,UAAU;wBACVC,OAAOL;oBACT;8BAECN;;gBAGL;YACF;IACF;IAEA,qBACE,MAACjC;QACE,GAAG6B,SAAS;QACbgB,iBAAe9B,WAAW+B;QAC1BzC,IAAIA;QACJD,KAAKA;QACLU,UAAUA;QACVL,UAAUA;QACVI,WAAWpB,IACT,qBACAsB,WAAWuB,kBAAkB,6BAC7BzB;QAEFH,OAAOK,WAAWI,uBAAuB,aAAaT;QACtDC,WAAWA;QACXC,YAAYA;QACZL,SAASuB,YAAY,CAACiB,QAAUC,QAAQC,OAAO,CAAC1C,QAAQwC;;YAEvDzB;YACAP,WAAW,OAAOG,oBAAoB,cACnCA,kBACAV;YACHY;YACAiB;;;AAGP,GACA"}
|
package/dist/chip/_chip.scss
CHANGED
|
@@ -23,7 +23,6 @@ $disable-outline-theme: $disable-everything !default;
|
|
|
23
23
|
$disable-outline-raisable: false !default;
|
|
24
24
|
$disable-left-addon: false !default;
|
|
25
25
|
$disable-right-addon: false !default;
|
|
26
|
-
$disable-both-addons: $disable-left-addon and $disable-right-addon !default;
|
|
27
26
|
$disable-selected-theme: false !default;
|
|
28
27
|
$disable-selected-icon-transition: false !default;
|
|
29
28
|
|
|
@@ -324,21 +323,6 @@ $var-lookup: (
|
|
|
324
323
|
}
|
|
325
324
|
}
|
|
326
325
|
|
|
327
|
-
@if not $disable-both-addons {
|
|
328
|
-
&--surrounded {
|
|
329
|
-
@include utils.auto-rtl(
|
|
330
|
-
padding-left,
|
|
331
|
-
$addon-left-padding,
|
|
332
|
-
$addon-right-padding
|
|
333
|
-
);
|
|
334
|
-
@include utils.auto-rtl(
|
|
335
|
-
padding-right,
|
|
336
|
-
$addon-right-padding,
|
|
337
|
-
$addon-left-padding
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
326
|
@if not $disable-content {
|
|
343
327
|
&__content {
|
|
344
328
|
@include typography.text-overflow;
|
package/dist/chip/styles.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface ChipClassNameOptions {
|
|
|
41
41
|
selected?: boolean;
|
|
42
42
|
/** @defaultValue `false` */
|
|
43
43
|
selectedThemed?: boolean;
|
|
44
|
-
/** @defaultValue `
|
|
44
|
+
/** @defaultValue `true` */
|
|
45
45
|
noninteractive?: boolean;
|
|
46
46
|
/** @defaultValue `false` */
|
|
47
47
|
leftAddon?: boolean;
|
package/dist/chip/styles.js
CHANGED
|
@@ -5,16 +5,15 @@ const styles = bem("rmd-chip");
|
|
|
5
5
|
/**
|
|
6
6
|
* @remarks \@since 6.0.0
|
|
7
7
|
*/ export function chip(options = {}) {
|
|
8
|
-
const { className, theme = "solid", pressed = false, disabled = false, selected = false, selectedThemed = false, selectedClassName, noninteractive =
|
|
8
|
+
const { className, theme = "solid", pressed = false, disabled = false, selected = false, selectedThemed = false, selectedClassName, noninteractive = true, pressedClassName, leftAddon = false, rightAddon = false, backgroundColor } = options;
|
|
9
9
|
return cnb(styles({
|
|
10
10
|
themed: !disabled && selected && selectedThemed,
|
|
11
11
|
selected: !disabled && selected && !selectedThemed,
|
|
12
12
|
solid: theme === "solid",
|
|
13
13
|
outline: theme === "outline",
|
|
14
14
|
disabled,
|
|
15
|
-
"left-addon": leftAddon
|
|
16
|
-
"right-addon":
|
|
17
|
-
surrounded: leftAddon && rightAddon,
|
|
15
|
+
"left-addon": leftAddon,
|
|
16
|
+
"right-addon": rightAddon,
|
|
18
17
|
pressed
|
|
19
18
|
}), selected && selectedClassName, pressedClassName, cssUtils({
|
|
20
19
|
surface: !noninteractive,
|
package/dist/chip/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/chip/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type BackgroundColor, cssUtils } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-chip\");\n\n/**\n * @remarks \\@since 6.0.0\n *\n * Note for the future: Once Firefox supports the `:has` selector, the\n * `leftAddon` and `rightAddon` can be removed. The styles would automatically\n * apply the padding instead:\n *\n * ```scss\n * &:has(.rmd-icon:first-child, .rmd-avatar:first-child) {\n * @include core.auto-rtl(\n * padding-left,\n * $addon-left-padding,\n * $horizontal-padding\n * );\n * }\n *\n * $index: if(\n * not core.$interaction-mode or core.$interaction-mode == press,\n * 1,\n * 2 // last child is always the `.rmd-ripple-container`\n * );\n * &:has(.rmd-icon:nth-last-child(#{$index})) {\n * @include core.auto-rtl(\n * padding-right,\n * $addon-right-padding,\n * $horizontal-padding\n * );\n * }\n * ```\n */\nexport interface ChipClassNameOptions {\n className?: string;\n selectedClassName?: string;\n\n /** @defaultValue `\"solid\"` */\n theme?: \"outline\" | \"solid\";\n\n backgroundColor?: BackgroundColor;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n selected?: boolean;\n\n /** @defaultValue `false` */\n selectedThemed?: boolean;\n\n /** @defaultValue `
|
|
1
|
+
{"version":3,"sources":["../../src/chip/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type BackgroundColor, cssUtils } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-chip\");\n\n/**\n * @remarks \\@since 6.0.0\n *\n * Note for the future: Once Firefox supports the `:has` selector, the\n * `leftAddon` and `rightAddon` can be removed. The styles would automatically\n * apply the padding instead:\n *\n * ```scss\n * &:has(.rmd-icon:first-child, .rmd-avatar:first-child) {\n * @include core.auto-rtl(\n * padding-left,\n * $addon-left-padding,\n * $horizontal-padding\n * );\n * }\n *\n * $index: if(\n * not core.$interaction-mode or core.$interaction-mode == press,\n * 1,\n * 2 // last child is always the `.rmd-ripple-container`\n * );\n * &:has(.rmd-icon:nth-last-child(#{$index})) {\n * @include core.auto-rtl(\n * padding-right,\n * $addon-right-padding,\n * $horizontal-padding\n * );\n * }\n * ```\n */\nexport interface ChipClassNameOptions {\n className?: string;\n selectedClassName?: string;\n\n /** @defaultValue `\"solid\"` */\n theme?: \"outline\" | \"solid\";\n\n backgroundColor?: BackgroundColor;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n selected?: boolean;\n\n /** @defaultValue `false` */\n selectedThemed?: boolean;\n\n /** @defaultValue `true` */\n noninteractive?: boolean;\n\n /** @defaultValue `false` */\n leftAddon?: boolean;\n\n /** @defaultValue `false` */\n rightAddon?: boolean;\n\n /** @defaultValue `false` */\n pressed?: boolean;\n pressedClassName?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function chip(options: ChipClassNameOptions = {}): string {\n const {\n className,\n theme = \"solid\",\n pressed = false,\n disabled = false,\n selected = false,\n selectedThemed = false,\n selectedClassName,\n noninteractive = true,\n pressedClassName,\n leftAddon = false,\n rightAddon = false,\n backgroundColor,\n } = options;\n\n return cnb(\n styles({\n themed: !disabled && selected && selectedThemed,\n selected: !disabled && selected && !selectedThemed,\n solid: theme === \"solid\",\n outline: theme === \"outline\",\n disabled,\n \"left-addon\": leftAddon,\n \"right-addon\": rightAddon,\n pressed,\n }),\n selected && selectedClassName,\n pressedClassName,\n cssUtils({\n surface: !noninteractive,\n textColor: disabled ? \"text-disabled\" : undefined,\n backgroundColor,\n }),\n className\n );\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ChipContentClassNameOptions {\n className?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function chipContent(options: ChipContentClassNameOptions = {}): string {\n const { className } = options;\n\n return cnb(styles(\"content\"), className);\n}\n"],"names":["cnb","cssUtils","bem","styles","chip","options","className","theme","pressed","disabled","selected","selectedThemed","selectedClassName","noninteractive","pressedClassName","leftAddon","rightAddon","backgroundColor","themed","solid","outline","surface","textColor","undefined","chipContent"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAA+BC,QAAQ,QAAQ,iBAAiB;AAChE,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAgEnB;;CAEC,GACD,OAAO,SAASE,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EACJC,SAAS,EACTC,QAAQ,OAAO,EACfC,UAAU,KAAK,EACfC,WAAW,KAAK,EAChBC,WAAW,KAAK,EAChBC,iBAAiB,KAAK,EACtBC,iBAAiB,EACjBC,iBAAiB,IAAI,EACrBC,gBAAgB,EAChBC,YAAY,KAAK,EACjBC,aAAa,KAAK,EAClBC,eAAe,EAChB,GAAGZ;IAEJ,OAAOL,IACLG,OAAO;QACLe,QAAQ,CAACT,YAAYC,YAAYC;QACjCD,UAAU,CAACD,YAAYC,YAAY,CAACC;QACpCQ,OAAOZ,UAAU;QACjBa,SAASb,UAAU;QACnBE;QACA,cAAcM;QACd,eAAeC;QACfR;IACF,IACAE,YAAYE,mBACZE,kBACAb,SAAS;QACPoB,SAAS,CAACR;QACVS,WAAWb,WAAW,kBAAkBc;QACxCN;IACF,IACAX;AAEJ;AASA;;CAEC,GACD,OAAO,SAASkB,YAAYnB,UAAuC,CAAC,CAAC;IACnE,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOL,IAAIG,OAAO,YAAYG;AAChC"}
|
package/dist/cssUtils.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export type FontWeight = "thin" | "light" | "regular" | "medium" | "bold" | "sem
|
|
|
57
57
|
export type Margin = "none" | "top" | "bottom" | "centered";
|
|
58
58
|
/** @remarks \@since 6.0.0 */
|
|
59
59
|
export type TextOverflow = "allow" | "nowrap" | "ellipsis";
|
|
60
|
+
/** @remarks \@since 6.0.0 */
|
|
60
61
|
export interface TextCssUtilsOptions {
|
|
61
62
|
textColor?: ThemeColor | TextColor;
|
|
62
63
|
textAlign?: TextAlign;
|
package/dist/cssUtils.js
CHANGED
|
@@ -13,7 +13,7 @@ import { cnb } from "cnbuilder";
|
|
|
13
13
|
const { className, srOnly, textColor, outlineColor, backgroundColor, surface, surfaceColor, margin, fontStyle, fontWeight, textAlign, textDecoration, textTransform, textOverflow } = options;
|
|
14
14
|
const isMarginTop = margin === "top";
|
|
15
15
|
const isTextColor = textColor === "text-primary" || textColor === "text-secondary" || textColor === "text-hint" || textColor === "text-disabled";
|
|
16
|
-
return cnb(!backgroundColor && !isTextColor && textColor && `rmd-${textColor}-color`, !backgroundColor && isTextColor && `rmd-${textColor}-color`, backgroundColor && "rmd-background-container", backgroundColor && `rmd-${backgroundColor}-container`, outlineColor && "rmd-outline", outlineColor && `rmd-${outlineColor}-outline`, (isMarginTop || margin === "bottom") && `rmd-no-margin-${isMarginTop ? "bottom" : "top"}`, margin === "none" && "rmd-no-margin", margin === "centered" && "rmd-centered", textAlign && `rmd-align-${textAlign}`, textDecoration && `rmd-${textDecoration}`, textTransform && `rmd-${textTransform}`, fontStyle && `rmd-${fontStyle}`, fontWeight && `rmd-${fontWeight}`, srOnly && srOnly !== "phone" && "rmd-sr-only", srOnly === "phone" && "rmd-phone-sr-only", srOnly === "focusable" && "rmd-sr-only--focusable", surfaceColor === "light" && "rmd-light-surface", surfaceColor === "dark" && "rmd-dark-surface", textOverflow && textOverflow !== "allow" && "rmd-nowrap", textOverflow === "ellipsis" && "rmd-ellipsis", surface && "rmd-interaction-surface", className);
|
|
16
|
+
return cnb(!backgroundColor && !isTextColor && textColor && `rmd-${textColor}-color`, !backgroundColor && isTextColor && `rmd-${textColor}-color`, backgroundColor && "rmd-background-container", backgroundColor && backgroundColor !== "current-color" && `rmd-${backgroundColor}-container`, outlineColor && "rmd-outline", outlineColor && `rmd-${outlineColor}-outline`, (isMarginTop || margin === "bottom") && `rmd-no-margin-${isMarginTop ? "bottom" : "top"}`, margin === "none" && "rmd-no-margin", margin === "centered" && "rmd-centered", textAlign && `rmd-align-${textAlign}`, textDecoration && `rmd-${textDecoration}`, textTransform && `rmd-${textTransform}`, fontStyle && `rmd-${fontStyle}`, fontWeight && `rmd-${fontWeight}`, srOnly && srOnly !== "phone" && "rmd-sr-only", srOnly === "phone" && "rmd-phone-sr-only", srOnly === "focusable" && "rmd-sr-only--focusable", surfaceColor === "light" && "rmd-light-surface", surfaceColor === "dark" && "rmd-dark-surface", textOverflow && textOverflow !== "allow" && "rmd-nowrap", textOverflow === "ellipsis" && "rmd-ellipsis", surface && "rmd-interaction-surface", className);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
//# sourceMappingURL=cssUtils.js.map
|
package/dist/cssUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cssUtils.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\n\n/**\n * - `primary -> $primary-color`\n * - `secondary -> $secondary-color`\n * - `warning -> $warning-color`\n * - `success -> $success-color`\n * - `error -> $error-color`\n *\n * @remarks \\@since 6.0.0\n */\nexport type ThemeColor =\n | \"primary\"\n | \"secondary\"\n | \"warning\"\n | \"success\"\n | \"error\";\n\n/**\n * - `text-primary -> $text-primary-color`\n * - `text-secondary -> $text-secondary-color`\n * - `text-hint -> $text-hint-color`\n * - `text-disabled -> $text-disabled-color`\n *\n * @remarks \\@since 6.0.0\n */\nexport type TextColor =\n | \"text-primary\"\n | \"text-secondary\"\n | \"text-hint\"\n | \"text-disabled\"\n | `on-${ThemeColor}`;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type OutlineColor = ThemeColor | \"greyscale\" | \"current-color\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type BackgroundColor = ThemeColor | \"surface\" | \"current-color\";\n\nexport type TextAlign = \"left\" | \"center\" | \"right\";\nexport type TextDecoration = \"underline\" | \"overline\" | \"line-through\" | \"none\";\nexport type TextTransform = \"capitalize\" | \"uppercase\" | \"lowercase\";\nexport type FontStyle = \"italic\" | \"oblique\" | \"normal\";\n\n/**\n * The supported css `font-weight` values.\n *\n * Note: You will need to ensure that you are using a web safe font for all the\n * font weights to work, use variable fonts, or load all font weights for your\n * custom font.\n *\n * @see {@link https://www.google.com/search?q=web+safe+fonts | Web Safe Fonts}\n * @see {@link https://www.google.com/search?q=variable+fonts | Variable FOnts}\n * @remarks \\@since 6.0.0 This was `TextWeight` beforehand.\n */\nexport type FontWeight =\n | \"thin\"\n | \"light\"\n | \"regular\"\n | \"medium\"\n | \"bold\"\n | \"semi-bold\"\n | \"black\";\n\n/**\n * Since the typography within react-md tries to not modify base elements, the\n * default margin applied to heading tags (h1-h6) and paragraph (p) might have\n * large margin that you don't want applied when using this component. You can\n * disable:\n *\n * - only the top margin by setting this prop to `\"bottom\"`\n * - only the bottom margin by setting this prop to `\"top\"`\n * - top and bottom margin by setting this prop to `\"none\"`\n * - or keep the initial behavior: `\"initial\"`\n *\n * @remarks \\@since 6.0.0\n */\nexport type Margin = \"none\" | \"top\" | \"bottom\" | \"centered\";\n\n/** @remarks \\@since 6.0.0 */\nexport type TextOverflow = \"allow\" | \"nowrap\" | \"ellipsis\";\n\nexport interface TextCssUtilsOptions {\n textColor?: ThemeColor | TextColor;\n\n textAlign?: TextAlign;\n\n textDecoration?: TextDecoration;\n\n textTransform?: TextTransform;\n\n fontWeight?: FontWeight;\n\n fontStyle?: FontStyle;\n\n /**\n * This can be used to remove margin from an element (usually typography\n * elements since the browser applies default margin for those elements).\n *\n * @see {@link Margin}\n */\n margin?: Margin;\n\n /**\n * Set this to `\"nowrap\"` to only prevent line wrap behavior or `\"ellipsis\"`\n * to also hide additional text with ellipsis.\n *\n * @defaultValue `\"allow\"`\n */\n textOverflow?: TextOverflow;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface CssUtilsOptions extends TextCssUtilsOptions {\n className?: string;\n\n /**\n * Set this to `true` to allow the content to only be visible for screen\n * readers. Set this to `\"focusable\"` to allow the content to be visible to\n * screen readers and once focused. Set this to `\"phone\"` to only render the\n * the content as screen reader only text on phones.\n *\n * @defaultValue `false`\n */\n srOnly?: boolean | \"focusable\" | \"phone\";\n\n /**\n * Set this to `\"current-color\"` to inherit the current text color or a\n * specific theme color as the outline `box-shadow`.\n */\n outlineColor?: OutlineColor;\n\n /**\n * When this is defined, a specific theme background-color will be applied\n * along with updating the text color be either `#000` or `#fff` depending on\n * which has the highest contrast ratio.\n */\n backgroundColor?: BackgroundColor;\n\n /**\n * Set this to `true` if the element should act as an interaction surface\n * which will:\n * - display a pointer while hovered\n * - increase the z-index of children to enable higher contrast when\n * `core.$interaction-disable-higher-contrast` is not `true`\n * - add a `::before` pseudo element that will:\n * - gain the focus shadow while `:focus`-ed\n * - add a background-color while `:hover`-ed\n * - show no hover/focus styles while `:disabled` or `[aria-disabled=\"true\"]`\n *\n * @defaultValue `false`\n */\n surface?: boolean;\n\n /**\n * Set this to `\"light\"` or `\"dark\"` to update the hover, focus, press,\n * selected, and ripple colors for the surface type. `\"light\"` surfaces will\n * use `#000` while `\"dark\"` will use `#fff`.\n */\n surfaceColor?: \"light\" | \"dark\";\n}\n\n/**\n * This is used to apply css utility functions to any element within your\n * application such as:\n * - specific theme colors as background, text, or outline color\n * - removing margin\n * - screen reader visible only text\n * - text-align, text-decoration, text-transform, font-style, font-weight\n * - disable line wrap\n *\n * @remarks \\@since 6.0.0\n */\nexport function cssUtils(options: CssUtilsOptions): string {\n const {\n className,\n srOnly,\n textColor,\n outlineColor,\n backgroundColor,\n surface,\n surfaceColor,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textDecoration,\n textTransform,\n textOverflow,\n } = options;\n\n const isMarginTop = margin === \"top\";\n const isTextColor =\n textColor === \"text-primary\" ||\n textColor === \"text-secondary\" ||\n textColor === \"text-hint\" ||\n textColor === \"text-disabled\";\n\n return cnb(\n !backgroundColor && !isTextColor && textColor && `rmd-${textColor}-color`,\n !backgroundColor && isTextColor && `rmd-${textColor}-color`,\n backgroundColor && \"rmd-background-container\",\n backgroundColor
|
|
1
|
+
{"version":3,"sources":["../src/cssUtils.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\n\n/**\n * - `primary -> $primary-color`\n * - `secondary -> $secondary-color`\n * - `warning -> $warning-color`\n * - `success -> $success-color`\n * - `error -> $error-color`\n *\n * @remarks \\@since 6.0.0\n */\nexport type ThemeColor =\n | \"primary\"\n | \"secondary\"\n | \"warning\"\n | \"success\"\n | \"error\";\n\n/**\n * - `text-primary -> $text-primary-color`\n * - `text-secondary -> $text-secondary-color`\n * - `text-hint -> $text-hint-color`\n * - `text-disabled -> $text-disabled-color`\n *\n * @remarks \\@since 6.0.0\n */\nexport type TextColor =\n | \"text-primary\"\n | \"text-secondary\"\n | \"text-hint\"\n | \"text-disabled\"\n | `on-${ThemeColor}`;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type OutlineColor = ThemeColor | \"greyscale\" | \"current-color\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type BackgroundColor = ThemeColor | \"surface\" | \"current-color\";\n\nexport type TextAlign = \"left\" | \"center\" | \"right\";\nexport type TextDecoration = \"underline\" | \"overline\" | \"line-through\" | \"none\";\nexport type TextTransform = \"capitalize\" | \"uppercase\" | \"lowercase\";\nexport type FontStyle = \"italic\" | \"oblique\" | \"normal\";\n\n/**\n * The supported css `font-weight` values.\n *\n * Note: You will need to ensure that you are using a web safe font for all the\n * font weights to work, use variable fonts, or load all font weights for your\n * custom font.\n *\n * @see {@link https://www.google.com/search?q=web+safe+fonts | Web Safe Fonts}\n * @see {@link https://www.google.com/search?q=variable+fonts | Variable FOnts}\n * @remarks \\@since 6.0.0 This was `TextWeight` beforehand.\n */\nexport type FontWeight =\n | \"thin\"\n | \"light\"\n | \"regular\"\n | \"medium\"\n | \"bold\"\n | \"semi-bold\"\n | \"black\";\n\n/**\n * Since the typography within react-md tries to not modify base elements, the\n * default margin applied to heading tags (h1-h6) and paragraph (p) might have\n * large margin that you don't want applied when using this component. You can\n * disable:\n *\n * - only the top margin by setting this prop to `\"bottom\"`\n * - only the bottom margin by setting this prop to `\"top\"`\n * - top and bottom margin by setting this prop to `\"none\"`\n * - or keep the initial behavior: `\"initial\"`\n *\n * @remarks \\@since 6.0.0\n */\nexport type Margin = \"none\" | \"top\" | \"bottom\" | \"centered\";\n\n/** @remarks \\@since 6.0.0 */\nexport type TextOverflow = \"allow\" | \"nowrap\" | \"ellipsis\";\n\n/** @remarks \\@since 6.0.0 */\nexport interface TextCssUtilsOptions {\n textColor?: ThemeColor | TextColor;\n\n textAlign?: TextAlign;\n\n textDecoration?: TextDecoration;\n\n textTransform?: TextTransform;\n\n fontWeight?: FontWeight;\n\n fontStyle?: FontStyle;\n\n /**\n * This can be used to remove margin from an element (usually typography\n * elements since the browser applies default margin for those elements).\n *\n * @see {@link Margin}\n */\n margin?: Margin;\n\n /**\n * Set this to `\"nowrap\"` to only prevent line wrap behavior or `\"ellipsis\"`\n * to also hide additional text with ellipsis.\n *\n * @defaultValue `\"allow\"`\n */\n textOverflow?: TextOverflow;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface CssUtilsOptions extends TextCssUtilsOptions {\n className?: string;\n\n /**\n * Set this to `true` to allow the content to only be visible for screen\n * readers. Set this to `\"focusable\"` to allow the content to be visible to\n * screen readers and once focused. Set this to `\"phone\"` to only render the\n * the content as screen reader only text on phones.\n *\n * @defaultValue `false`\n */\n srOnly?: boolean | \"focusable\" | \"phone\";\n\n /**\n * Set this to `\"current-color\"` to inherit the current text color or a\n * specific theme color as the outline `box-shadow`.\n */\n outlineColor?: OutlineColor;\n\n /**\n * When this is defined, a specific theme background-color will be applied\n * along with updating the text color be either `#000` or `#fff` depending on\n * which has the highest contrast ratio.\n */\n backgroundColor?: BackgroundColor;\n\n /**\n * Set this to `true` if the element should act as an interaction surface\n * which will:\n * - display a pointer while hovered\n * - increase the z-index of children to enable higher contrast when\n * `core.$interaction-disable-higher-contrast` is not `true`\n * - add a `::before` pseudo element that will:\n * - gain the focus shadow while `:focus`-ed\n * - add a background-color while `:hover`-ed\n * - show no hover/focus styles while `:disabled` or `[aria-disabled=\"true\"]`\n *\n * @defaultValue `false`\n */\n surface?: boolean;\n\n /**\n * Set this to `\"light\"` or `\"dark\"` to update the hover, focus, press,\n * selected, and ripple colors for the surface type. `\"light\"` surfaces will\n * use `#000` while `\"dark\"` will use `#fff`.\n */\n surfaceColor?: \"light\" | \"dark\";\n}\n\n/**\n * This is used to apply css utility functions to any element within your\n * application such as:\n * - specific theme colors as background, text, or outline color\n * - removing margin\n * - screen reader visible only text\n * - text-align, text-decoration, text-transform, font-style, font-weight\n * - disable line wrap\n *\n * @remarks \\@since 6.0.0\n */\nexport function cssUtils(options: CssUtilsOptions): string {\n const {\n className,\n srOnly,\n textColor,\n outlineColor,\n backgroundColor,\n surface,\n surfaceColor,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textDecoration,\n textTransform,\n textOverflow,\n } = options;\n\n const isMarginTop = margin === \"top\";\n const isTextColor =\n textColor === \"text-primary\" ||\n textColor === \"text-secondary\" ||\n textColor === \"text-hint\" ||\n textColor === \"text-disabled\";\n\n return cnb(\n !backgroundColor && !isTextColor && textColor && `rmd-${textColor}-color`,\n !backgroundColor && isTextColor && `rmd-${textColor}-color`,\n backgroundColor && \"rmd-background-container\",\n backgroundColor &&\n backgroundColor !== \"current-color\" &&\n `rmd-${backgroundColor}-container`,\n outlineColor && \"rmd-outline\",\n outlineColor && `rmd-${outlineColor}-outline`,\n (isMarginTop || margin === \"bottom\") &&\n `rmd-no-margin-${isMarginTop ? \"bottom\" : \"top\"}`,\n margin === \"none\" && \"rmd-no-margin\",\n margin === \"centered\" && \"rmd-centered\",\n textAlign && `rmd-align-${textAlign}`,\n textDecoration && `rmd-${textDecoration}`,\n textTransform && `rmd-${textTransform}`,\n fontStyle && `rmd-${fontStyle}`,\n fontWeight && `rmd-${fontWeight}`,\n srOnly && srOnly !== \"phone\" && \"rmd-sr-only\",\n srOnly === \"phone\" && \"rmd-phone-sr-only\",\n srOnly === \"focusable\" && \"rmd-sr-only--focusable\",\n surfaceColor === \"light\" && \"rmd-light-surface\",\n surfaceColor === \"dark\" && \"rmd-dark-surface\",\n textOverflow && textOverflow !== \"allow\" && \"rmd-nowrap\",\n textOverflow === \"ellipsis\" && \"rmd-ellipsis\",\n surface && \"rmd-interaction-surface\",\n className\n );\n}\n"],"names":["cnb","cssUtils","options","className","srOnly","textColor","outlineColor","backgroundColor","surface","surfaceColor","margin","fontStyle","fontWeight","textAlign","textDecoration","textTransform","textOverflow","isMarginTop","isTextColor"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAyKhC;;;;;;;;;;CAUC,GACD,OAAO,SAASC,SAASC,OAAwB;IAC/C,MAAM,EACJC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,YAAY,EACZC,eAAe,EACfC,OAAO,EACPC,YAAY,EACZC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,YAAY,EACb,GAAGd;IAEJ,MAAMe,cAAcP,WAAW;IAC/B,MAAMQ,cACJb,cAAc,kBACdA,cAAc,oBACdA,cAAc,eACdA,cAAc;IAEhB,OAAOL,IACL,CAACO,mBAAmB,CAACW,eAAeb,aAAa,CAAC,IAAI,EAAEA,UAAU,MAAM,CAAC,EACzE,CAACE,mBAAmBW,eAAe,CAAC,IAAI,EAAEb,UAAU,MAAM,CAAC,EAC3DE,mBAAmB,4BACnBA,mBACEA,oBAAoB,mBACpB,CAAC,IAAI,EAAEA,gBAAgB,UAAU,CAAC,EACpCD,gBAAgB,eAChBA,gBAAgB,CAAC,IAAI,EAAEA,aAAa,QAAQ,CAAC,EAC7C,AAACW,CAAAA,eAAeP,WAAW,QAAO,KAChC,CAAC,cAAc,EAAEO,cAAc,WAAW,MAAM,CAAC,EACnDP,WAAW,UAAU,iBACrBA,WAAW,cAAc,gBACzBG,aAAa,CAAC,UAAU,EAAEA,UAAU,CAAC,EACrCC,kBAAkB,CAAC,IAAI,EAAEA,eAAe,CAAC,EACzCC,iBAAiB,CAAC,IAAI,EAAEA,cAAc,CAAC,EACvCJ,aAAa,CAAC,IAAI,EAAEA,UAAU,CAAC,EAC/BC,cAAc,CAAC,IAAI,EAAEA,WAAW,CAAC,EACjCR,UAAUA,WAAW,WAAW,eAChCA,WAAW,WAAW,qBACtBA,WAAW,eAAe,0BAC1BK,iBAAiB,WAAW,qBAC5BA,iBAAiB,UAAU,oBAC3BO,gBAAgBA,iBAAiB,WAAW,cAC5CA,iBAAiB,cAAc,gBAC/BR,WAAW,2BACXL;AAEJ"}
|
package/dist/dialog/Dialog.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare const DEFAULT_DIALOG_CLASSNAMES: Readonly<CSSTransitionClassNames
|
|
|
23
23
|
export declare const DEFAULT_DIALOG_TIMEOUT: Readonly<TransitionTimeout>;
|
|
24
24
|
export interface BaseDialogProps extends HTMLAttributes<HTMLDivElement>, CSSTransitionComponentProps, TransitionActions, FocusContainerComponentProps {
|
|
25
25
|
/**
|
|
26
|
-
* @defaultValue `
|
|
26
|
+
* @defaultValue `"dialog-" + useId()`
|
|
27
27
|
*/
|
|
28
28
|
id?: string;
|
|
29
29
|
/**
|
package/dist/dialog/Dialog.js
CHANGED
|
@@ -83,7 +83,7 @@ const noopBool = ()=>false;
|
|
|
83
83
|
* within once it becomes visible. You must manually add `autoFocus` to a
|
|
84
84
|
* element instead.
|
|
85
85
|
*/ export const Dialog = /*#__PURE__*/ forwardRef(function Dialog(props, ref) {
|
|
86
|
-
const { id: propId, role = "dialog", type = "centered", tabIndex = -1, visible, onRequestClose, containerProps, temporary = true, className, timeout = DEFAULT_DIALOG_TIMEOUT, classNames = DEFAULT_DIALOG_CLASSNAMES, disableTransition = false, appear, enter, exit, onEnter = noop, onEntering = noop, onEntered, onExit = noop, onExiting = noop, onExited, exitedHidden = true,
|
|
86
|
+
const { id: propId, fixed = false, modal = false, role = modal ? "alertdialog" : "dialog", type = "centered", tabIndex = -1, visible, onRequestClose, containerProps, temporary = true, className, timeout = DEFAULT_DIALOG_TIMEOUT, classNames = DEFAULT_DIALOG_CLASSNAMES, disableTransition = false, appear, enter, exit, onEnter = noop, onEntering = noop, onEntered, onExit = noop, onExiting = noop, onExited, exitedHidden = true, disableOverlay = false, overlayProps, overlayHidden, onKeyDown = noop, isFocusTypeDisabled = noopBool, disablePortal: propDisablePortal, disableScrollLock = false, disableEscapeClose = modal, disableFocusOutline = type === "full-page", children, ...remaining } = props;
|
|
87
87
|
const id = useEnsuredId(propId, "dialog");
|
|
88
88
|
const ssr = useSsr();
|
|
89
89
|
const setChildVisible = useNestedDialogContext();
|
|
@@ -158,6 +158,7 @@ const noopBool = ()=>false;
|
|
|
158
158
|
className: cnb(containerProps?.className, !temporary && exitedHidden && stage === "exited" && DISPLAY_NONE_CLASS),
|
|
159
159
|
enabled: type === "centered",
|
|
160
160
|
children: /*#__PURE__*/ _jsx("div", {
|
|
161
|
+
"aria-modal": modal || undefined,
|
|
161
162
|
...remaining,
|
|
162
163
|
...elementProps,
|
|
163
164
|
...eventHandlers,
|