@basic-ui/material 1.0.0-alpha.52 → 1.0.0-alpha.54
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/README.md +3 -3
- package/build/cjs/index.js +515 -441
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +5 -6
- package/build/esm/Alert/Alert.js +14 -16
- package/build/esm/Alert/Alert.js.map +1 -1
- package/build/esm/Alert/index.d.ts +1 -1
- package/build/esm/Alert/index.js.map +1 -1
- package/build/esm/AppBar/AppBar.d.ts +9 -9
- package/build/esm/AppBar/AppBar.js +25 -34
- package/build/esm/AppBar/AppBar.js.map +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +3 -4
- package/build/esm/AppBar/AppBarButton.js +12 -14
- package/build/esm/AppBar/AppBarButton.js.map +1 -1
- package/build/esm/AppBar/context.d.ts +4 -5
- package/build/esm/AppBar/context.js +8 -6
- package/build/esm/AppBar/context.js.map +1 -1
- package/build/esm/AppBar/index.d.ts +3 -3
- package/build/esm/AppBar/index.js.map +1 -1
- package/build/esm/Badge/Badge.d.ts +5 -6
- package/build/esm/Badge/Badge.js +25 -26
- package/build/esm/Badge/Badge.js.map +1 -1
- package/build/esm/Badge/index.d.ts +1 -1
- package/build/esm/Badge/index.js.map +1 -1
- package/build/esm/BaseLine/BaseLine.d.ts +1 -1
- package/build/esm/BaseLine/BaseLine.js +4 -6
- package/build/esm/BaseLine/BaseLine.js.map +1 -1
- package/build/esm/BaseLine/index.d.ts +1 -1
- package/build/esm/BaseLine/index.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +6 -7
- package/build/esm/BottomSheet/BottomSheet.js +17 -21
- package/build/esm/BottomSheet/BottomSheet.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +4 -5
- package/build/esm/BottomSheet/BottomSheetSurface.js +14 -14
- package/build/esm/BottomSheet/BottomSheetSurface.js.map +1 -1
- package/build/esm/BottomSheet/index.d.ts +1 -1
- package/build/esm/BottomSheet/index.js.map +1 -1
- package/build/esm/Box/Box.d.ts +23 -23
- package/build/esm/Box/Box.js +26 -26
- package/build/esm/Box/Box.js.map +1 -1
- package/build/esm/Box/index.d.ts +1 -1
- package/build/esm/Box/index.js.map +1 -1
- package/build/esm/Button/BaseButton.d.ts +14 -7
- package/build/esm/Button/BaseButton.js +107 -36
- package/build/esm/Button/BaseButton.js.map +1 -1
- package/build/esm/Button/Button.d.ts +14 -13
- package/build/esm/Button/Button.js +66 -48
- package/build/esm/Button/Button.js.map +1 -1
- package/build/esm/Button/ButtonGroup.d.ts +4 -5
- package/build/esm/Button/ButtonGroup.js +119 -21
- package/build/esm/Button/ButtonGroup.js.map +1 -1
- package/build/esm/Button/FilledButton.d.ts +10 -11
- package/build/esm/Button/FilledButton.js +18 -60
- package/build/esm/Button/FilledButton.js.map +1 -1
- package/build/esm/Button/FloatingActionButton.d.ts +9 -7
- package/build/esm/Button/FloatingActionButton.js +5 -4
- package/build/esm/Button/FloatingActionButton.js.map +1 -1
- package/build/esm/Button/IconButton.d.ts +8 -8
- package/build/esm/Button/IconButton.js +3 -3
- package/build/esm/Button/IconButton.js.map +1 -1
- package/build/esm/Button/IconFilledButton.d.ts +2 -0
- package/build/esm/Button/IconFilledButton.js +3 -0
- package/build/esm/Button/IconFilledButton.js.map +1 -0
- package/build/esm/Button/IconOutlinedButton.d.ts +2 -0
- package/build/esm/Button/IconOutlinedButton.js +3 -0
- package/build/esm/Button/IconOutlinedButton.js.map +1 -0
- package/build/esm/Button/OutlinedButton.d.ts +3 -4
- package/build/esm/Button/OutlinedButton.js +3 -43
- package/build/esm/Button/OutlinedButton.js.map +1 -1
- package/build/esm/Button/SplitButton.d.ts +9 -0
- package/build/esm/Button/SplitButton.js +32 -0
- package/build/esm/Button/SplitButton.js.map +1 -0
- package/build/esm/Button/TransparentButton.d.ts +10 -11
- package/build/esm/Button/TransparentButton.js +11 -54
- package/build/esm/Button/TransparentButton.js.map +1 -1
- package/build/esm/Button/context.d.ts +9 -8
- package/build/esm/Button/context.js +5 -4
- package/build/esm/Button/context.js.map +1 -1
- package/build/esm/Button/index.d.ts +3 -2
- package/build/esm/Button/index.js +1 -0
- package/build/esm/Button/index.js.map +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +13 -13
- package/build/esm/CheckBox/CheckBox.js +45 -61
- package/build/esm/CheckBox/CheckBox.js.map +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +10 -10
- package/build/esm/CheckBox/CheckBoxIcon.js +19 -24
- package/build/esm/CheckBox/CheckBoxIcon.js.map +1 -1
- package/build/esm/CheckBox/CheckPath.d.ts +3 -3
- package/build/esm/CheckBox/CheckPath.js +15 -16
- package/build/esm/CheckBox/CheckPath.js.map +1 -1
- package/build/esm/CheckBox/IndeterminatePath.d.ts +3 -3
- package/build/esm/CheckBox/IndeterminatePath.js +14 -16
- package/build/esm/CheckBox/IndeterminatePath.js.map +1 -1
- package/build/esm/CheckBox/index.d.ts +1 -1
- package/build/esm/CheckBox/index.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +9 -9
- package/build/esm/Chip/ButtonChip.js +20 -24
- package/build/esm/Chip/ButtonChip.js.map +1 -1
- package/build/esm/Chip/Chip.d.ts +4 -4
- package/build/esm/Chip/Chip.js.map +1 -1
- package/build/esm/Chip/ChipBase.d.ts +10 -10
- package/build/esm/Chip/ChipBase.js +50 -54
- package/build/esm/Chip/ChipBase.js.map +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +10 -10
- package/build/esm/Chip/ChoiceChip.js +34 -38
- package/build/esm/Chip/ChoiceChip.js.map +1 -1
- package/build/esm/Chip/index.d.ts +2 -2
- package/build/esm/Chip/index.js.map +1 -1
- package/build/esm/Combobox/Combobox.d.ts +23 -23
- package/build/esm/Combobox/Combobox.js +126 -107
- package/build/esm/Combobox/Combobox.js.map +1 -1
- package/build/esm/Combobox/index.d.ts +1 -1
- package/build/esm/Combobox/index.js.map +1 -1
- package/build/esm/Dialog/Dialog.d.ts +19 -20
- package/build/esm/Dialog/Dialog.js +38 -42
- package/build/esm/Dialog/Dialog.js.map +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +6 -7
- package/build/esm/Dialog/DialogBackdrop.js +18 -17
- package/build/esm/Dialog/DialogBackdrop.js.map +1 -1
- package/build/esm/Dialog/DialogContainer.d.ts +3 -4
- package/build/esm/Dialog/DialogContainer.js +12 -12
- package/build/esm/Dialog/DialogContainer.js.map +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +6 -7
- package/build/esm/Dialog/DialogSurface.js +26 -26
- package/build/esm/Dialog/DialogSurface.js.map +1 -1
- package/build/esm/Dialog/Scrim.d.ts +3 -4
- package/build/esm/Dialog/Scrim.js +12 -12
- package/build/esm/Dialog/Scrim.js.map +1 -1
- package/build/esm/Dialog/index.d.ts +2 -2
- package/build/esm/Dialog/index.js.map +1 -1
- package/build/esm/Dialog/useDialogAnimation.d.ts +57 -824
- package/build/esm/Dialog/useDialogAnimation.js +23 -24
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +7 -7
- package/build/esm/Divider/Divider.js +27 -28
- package/build/esm/Divider/Divider.js.map +1 -1
- package/build/esm/Divider/index.d.ts +1 -1
- package/build/esm/Divider/index.js.map +1 -1
- package/build/esm/FloatingLabel/FloatingLabel.d.ts +13 -13
- package/build/esm/FloatingLabel/FloatingLabel.js +27 -33
- package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
- package/build/esm/FloatingLabel/index.d.ts +1 -1
- package/build/esm/FloatingLabel/index.js.map +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +9 -9
- package/build/esm/LineRipple/LineRipple.js +30 -38
- package/build/esm/LineRipple/LineRipple.js.map +1 -1
- package/build/esm/LineRipple/index.d.ts +1 -1
- package/build/esm/LineRipple/index.js.map +1 -1
- package/build/esm/Link/Link.d.ts +9 -9
- package/build/esm/Link/Link.js +15 -17
- package/build/esm/Link/Link.js.map +1 -1
- package/build/esm/Link/index.d.ts +1 -1
- package/build/esm/Link/index.js.map +1 -1
- package/build/esm/List/List.d.ts +8 -8
- package/build/esm/List/List.js +19 -26
- package/build/esm/List/List.js.map +1 -1
- package/build/esm/List/index.d.ts +1 -1
- package/build/esm/List/index.js.map +1 -1
- package/build/esm/ListItem/ListItem.d.ts +14 -14
- package/build/esm/ListItem/ListItem.js +28 -31
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/ListItem/ListItemText.d.ts +7 -7
- package/build/esm/ListItem/ListItemText.js +12 -16
- package/build/esm/ListItem/ListItemText.js.map +1 -1
- package/build/esm/ListItem/index.d.ts +2 -2
- package/build/esm/ListItem/index.js.map +1 -1
- package/build/esm/Menu/Menu.d.ts +18 -18
- package/build/esm/Menu/Menu.js +70 -60
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/Menu/animation.d.ts +2 -2
- package/build/esm/Menu/animation.js +3 -3
- package/build/esm/Menu/animation.js.map +1 -1
- package/build/esm/Menu/index.d.ts +2 -2
- package/build/esm/Menu/index.js.map +1 -1
- package/build/esm/NavRail/NavRailItem.d.ts +15 -15
- package/build/esm/NavRail/NavRailItem.js +82 -86
- package/build/esm/NavRail/NavRailItem.js.map +1 -1
- package/build/esm/NavRail/icons/test-icons.d.ts +4 -4
- package/build/esm/NavRail/icons/test-icons.js +33 -40
- package/build/esm/NavRail/icons/test-icons.js.map +1 -1
- package/build/esm/NavRail/index.d.ts +1 -1
- package/build/esm/NavRail/index.js.map +1 -1
- package/build/esm/NotchedOutline/NotchedOutline.d.ts +14 -14
- package/build/esm/NotchedOutline/NotchedOutline.js +26 -34
- package/build/esm/NotchedOutline/NotchedOutline.js.map +1 -1
- package/build/esm/NotchedOutline/context.d.ts +5 -6
- package/build/esm/NotchedOutline/context.js +8 -7
- package/build/esm/NotchedOutline/context.js.map +1 -1
- package/build/esm/NotchedOutline/index.d.ts +1 -1
- package/build/esm/NotchedOutline/index.js.map +1 -1
- package/build/esm/NotchedOutline/styledComponents.d.ts +15 -575
- package/build/esm/NotchedOutline/styledComponents.js +65 -64
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Paper/Paper.d.ts +11 -11
- package/build/esm/Paper/Paper.js +25 -25
- package/build/esm/Paper/Paper.js.map +1 -1
- package/build/esm/Paper/index.d.ts +1 -1
- package/build/esm/Paper/index.js.map +1 -1
- package/build/esm/Popover/Popover.d.ts +13 -14
- package/build/esm/Popover/Popover.js +33 -39
- package/build/esm/Popover/Popover.js.map +1 -1
- package/build/esm/Popover/PopoverContainer.d.ts +3 -4
- package/build/esm/Popover/PopoverContainer.js +12 -12
- package/build/esm/Popover/PopoverContainer.js.map +1 -1
- package/build/esm/Popover/PopoverSurface.d.ts +4 -5
- package/build/esm/Popover/PopoverSurface.js +15 -15
- package/build/esm/Popover/PopoverSurface.js.map +1 -1
- package/build/esm/Popover/index.d.ts +1 -1
- package/build/esm/Popover/index.js.map +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +7 -8
- package/build/esm/ProgressSpinner/ProgressSpinner.js +31 -33
- package/build/esm/ProgressSpinner/ProgressSpinner.js.map +1 -1
- package/build/esm/ProgressSpinner/index.d.ts +1 -1
- package/build/esm/ProgressSpinner/index.js.map +1 -1
- package/build/esm/RadioButton/RadioButton.d.ts +3 -4
- package/build/esm/RadioButton/RadioButton.js +29 -32
- package/build/esm/RadioButton/RadioButton.js.map +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.d.ts +6 -6
- package/build/esm/RadioButton/RadioButtonIcon.js +10 -12
- package/build/esm/RadioButton/RadioButtonIcon.js.map +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +4 -5
- package/build/esm/RadioButton/RadioGroup.js +9 -11
- package/build/esm/RadioButton/RadioGroup.js.map +1 -1
- package/build/esm/RadioButton/index.d.ts +2 -2
- package/build/esm/RadioButton/index.js.map +1 -1
- package/build/esm/Ripple/Ripple.d.ts +10 -11
- package/build/esm/Ripple/Ripple.js +12 -10
- package/build/esm/Ripple/Ripple.js.map +1 -1
- package/build/esm/Ripple/RippleBox.d.ts +5 -5
- package/build/esm/Ripple/RippleBox.js +32 -29
- package/build/esm/Ripple/RippleBox.js.map +1 -1
- package/build/esm/Ripple/constants.d.ts +7 -7
- package/build/esm/Ripple/constants.js +7 -7
- package/build/esm/Ripple/constants.js.map +1 -1
- package/build/esm/Ripple/index.d.ts +5 -5
- package/build/esm/Ripple/index.js.map +1 -1
- package/build/esm/Ripple/keyframes.d.ts +4 -4
- package/build/esm/Ripple/keyframes.js +7 -7
- package/build/esm/Ripple/keyframes.js.map +1 -1
- package/build/esm/Ripple/useRipple.d.ts +14 -14
- package/build/esm/Ripple/useRipple.js +79 -84
- package/build/esm/Ripple/useRipple.js.map +1 -1
- package/build/esm/Ripple/useRippleHandlers.d.ts +8 -8
- package/build/esm/Ripple/useRippleHandlers.js +21 -30
- package/build/esm/Ripple/useRippleHandlers.js.map +1 -1
- package/build/esm/Ripple/useRippleSurface.d.ts +22 -787
- package/build/esm/Ripple/useRippleSurface.js +87 -88
- package/build/esm/Ripple/useRippleSurface.js.map +1 -1
- package/build/esm/SearchBar/SearchBar.d.ts +15 -15
- package/build/esm/SearchBar/SearchBar.js +44 -57
- package/build/esm/SearchBar/SearchBar.js.map +1 -1
- package/build/esm/SearchBar/index.d.ts +1 -1
- package/build/esm/SearchBar/index.js.map +1 -1
- package/build/esm/Select/CustomContainerExample.d.ts +2 -3
- package/build/esm/Select/CustomContainerExample.js +29 -34
- package/build/esm/Select/CustomContainerExample.js.map +1 -1
- package/build/esm/Select/Select.d.ts +33 -32
- package/build/esm/Select/Select.js +68 -113
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +6 -6
- package/build/esm/Select/SelectIcon.js +11 -13
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/Select/context.d.ts +9 -9
- package/build/esm/Select/context.js +10 -8
- package/build/esm/Select/context.js.map +1 -1
- package/build/esm/Select/defaultRender.d.ts +3 -3
- package/build/esm/Select/defaultRender.js +33 -38
- package/build/esm/Select/defaultRender.js.map +1 -1
- package/build/esm/Select/index.d.ts +1 -1
- package/build/esm/Select/index.js.map +1 -1
- package/build/esm/Select/styledComponents.d.ts +15 -15
- package/build/esm/Select/styledComponents.js +20 -23
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +11 -11
- package/build/esm/SelectItem/SelectItem.js +37 -47
- package/build/esm/SelectItem/SelectItem.js.map +1 -1
- package/build/esm/SelectItem/index.d.ts +1 -1
- package/build/esm/SelectItem/index.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +7 -7
- package/build/esm/SelectionControl/SelectionControlLabel.js +13 -14
- package/build/esm/SelectionControl/SelectionControlLabel.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +8 -8
- package/build/esm/SelectionControl/SelectionControlText.js +20 -20
- package/build/esm/SelectionControl/SelectionControlText.js.map +1 -1
- package/build/esm/SelectionControl/index.d.ts +2 -2
- package/build/esm/SelectionControl/index.js.map +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +13 -13
- package/build/esm/Skeleton/DelayAppearance.js +18 -20
- package/build/esm/Skeleton/DelayAppearance.js.map +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +9 -9
- package/build/esm/Skeleton/Skeleton.js +18 -19
- package/build/esm/Skeleton/Skeleton.js.map +1 -1
- package/build/esm/Skeleton/animation.d.ts +8 -8
- package/build/esm/Skeleton/animation.js +11 -11
- package/build/esm/Skeleton/animation.js.map +1 -1
- package/build/esm/Skeleton/index.d.ts +2 -2
- package/build/esm/Skeleton/index.js.map +1 -1
- package/build/esm/Slider/Slider.d.ts +17 -17
- package/build/esm/Slider/Slider.js +93 -85
- package/build/esm/Slider/Slider.js.map +1 -1
- package/build/esm/Slider/index.d.ts +1 -1
- package/build/esm/Slider/index.js.map +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +10 -8
- package/build/esm/Snackbar/Snackbar.js +33 -33
- package/build/esm/Snackbar/Snackbar.js.map +1 -1
- package/build/esm/Snackbar/Stack.d.ts +31 -31
- package/build/esm/Snackbar/Stack.js +74 -106
- package/build/esm/Snackbar/Stack.js.map +1 -1
- package/build/esm/Snackbar/index.d.ts +3 -3
- package/build/esm/Snackbar/index.js.map +1 -1
- package/build/esm/Snackbar/useSnackbarAnimation.d.ts +6 -6
- package/build/esm/Snackbar/useSnackbarAnimation.js +103 -132
- package/build/esm/Snackbar/useSnackbarAnimation.js.map +1 -1
- package/build/esm/Switch/Switch.d.ts +13 -13
- package/build/esm/Switch/Switch.js +59 -56
- package/build/esm/Switch/Switch.js.map +1 -1
- package/build/esm/Switch/index.d.ts +1 -1
- package/build/esm/Switch/index.js.map +1 -1
- package/build/esm/Switch/styledComponents.d.ts +13 -13
- package/build/esm/Switch/styledComponents.js +47 -47
- package/build/esm/Switch/styledComponents.js.map +1 -1
- package/build/esm/Tab/Tab.d.ts +5 -5
- package/build/esm/Tab/Tab.js +47 -55
- package/build/esm/Tab/Tab.js.map +1 -1
- package/build/esm/Tab/TabList.d.ts +9 -10
- package/build/esm/Tab/TabList.js +28 -32
- package/build/esm/Tab/TabList.js.map +1 -1
- package/build/esm/Tab/TabPanel.d.ts +4 -5
- package/build/esm/Tab/TabPanel.js +18 -19
- package/build/esm/Tab/TabPanel.js.map +1 -1
- package/build/esm/Tab/TabPanels.d.ts +4 -4
- package/build/esm/Tab/TabPanels.js.map +1 -1
- package/build/esm/Tab/Tabs.d.ts +4 -4
- package/build/esm/Tab/Tabs.js.map +1 -1
- package/build/esm/Tab/context.d.ts +8 -9
- package/build/esm/Tab/context.js +8 -7
- package/build/esm/Tab/context.js.map +1 -1
- package/build/esm/Tab/index.d.ts +5 -5
- package/build/esm/Tab/index.js.map +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +9 -9
- package/build/esm/TabIndicator/TabIndicator.js +69 -86
- package/build/esm/TabIndicator/TabIndicator.js.map +1 -1
- package/build/esm/TabIndicator/context.d.ts +6 -6
- package/build/esm/TabIndicator/context.js +8 -7
- package/build/esm/TabIndicator/context.js.map +1 -1
- package/build/esm/TabIndicator/index.d.ts +2 -2
- package/build/esm/TabIndicator/index.js.map +1 -1
- package/build/esm/Table/Table.d.ts +3 -4
- package/build/esm/Table/Table.js +13 -14
- package/build/esm/Table/Table.js.map +1 -1
- package/build/esm/Table/TableBody.d.ts +3 -4
- package/build/esm/Table/TableBody.js +9 -11
- package/build/esm/Table/TableBody.js.map +1 -1
- package/build/esm/Table/TableCell.d.ts +3 -4
- package/build/esm/Table/TableCell.js +14 -15
- package/build/esm/Table/TableCell.js.map +1 -1
- package/build/esm/Table/TableHead.d.ts +3 -4
- package/build/esm/Table/TableHead.js +13 -14
- package/build/esm/Table/TableHead.js.map +1 -1
- package/build/esm/Table/TableRow.d.ts +3 -4
- package/build/esm/Table/TableRow.js +13 -14
- package/build/esm/Table/TableRow.js.map +1 -1
- package/build/esm/Table/context.d.ts +2 -3
- package/build/esm/Table/context.js +7 -7
- package/build/esm/Table/context.js.map +1 -1
- package/build/esm/Table/index.d.ts +5 -5
- package/build/esm/Table/index.js.map +1 -1
- package/build/esm/Text/LoremIpsum.d.ts +4 -4
- package/build/esm/Text/LoremIpsum.js +10 -12
- package/build/esm/Text/LoremIpsum.js.map +1 -1
- package/build/esm/Text/Text.d.ts +10 -11
- package/build/esm/Text/Text.js +15 -19
- package/build/esm/Text/Text.js.map +1 -1
- package/build/esm/Text/index.d.ts +1 -1
- package/build/esm/Text/index.js.map +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +18 -18
- package/build/esm/TextField/FilledContainer.js +75 -80
- package/build/esm/TextField/FilledContainer.js.map +1 -1
- package/build/esm/TextField/HelperText.d.ts +10 -10
- package/build/esm/TextField/HelperText.js +19 -26
- package/build/esm/TextField/HelperText.js.map +1 -1
- package/build/esm/TextField/IconContainer.d.ts +5 -5
- package/build/esm/TextField/IconContainer.js +21 -9
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/TextField/Input.d.ts +11 -11
- package/build/esm/TextField/Input.js +39 -40
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +17 -17
- package/build/esm/TextField/OutlinedContainer.js +30 -47
- package/build/esm/TextField/OutlinedContainer.js.map +1 -1
- package/build/esm/TextField/TextField.d.ts +19 -19
- package/build/esm/TextField/TextField.js +50 -77
- package/build/esm/TextField/TextField.js.map +1 -1
- package/build/esm/TextField/consts.d.ts +5 -5
- package/build/esm/TextField/consts.js +5 -5
- package/build/esm/TextField/consts.js.map +1 -1
- package/build/esm/TextField/index.d.ts +4 -4
- package/build/esm/TextField/index.js.map +1 -1
- package/build/esm/ThemeExplorer/BorderSlider.d.ts +7 -7
- package/build/esm/ThemeExplorer/BorderSlider.js +8 -14
- package/build/esm/ThemeExplorer/BorderSlider.js.map +1 -1
- package/build/esm/ThemeExplorer/ColorPicker.d.ts +8 -8
- package/build/esm/ThemeExplorer/ColorPicker.js +19 -24
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/ColorSchemePicker.d.ts +10 -10
- package/build/esm/ThemeExplorer/ColorSchemePicker.js +16 -21
- package/build/esm/ThemeExplorer/ColorSchemePicker.js.map +1 -1
- package/build/esm/ThemeExplorer/FontAutoComplete.d.ts +9 -9
- package/build/esm/ThemeExplorer/FontAutoComplete.js +28 -48
- package/build/esm/ThemeExplorer/FontAutoComplete.js.map +1 -1
- package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +8 -9
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +29 -60
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/ThemeBuilder.d.ts +11 -11
- package/build/esm/ThemeExplorer/ThemeBuilder.js +155 -184
- package/build/esm/ThemeExplorer/ThemeBuilder.js.map +1 -1
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +4 -5
- package/build/esm/ThemeExplorer/ThemeColors.js +54 -54
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -1
- package/build/esm/ThemeExplorer/components.d.ts +31 -31
- package/build/esm/ThemeExplorer/components.js +52 -61
- package/build/esm/ThemeExplorer/components.js.map +1 -1
- package/build/esm/ThemeExplorer/googleFonts.d.ts +1 -1
- package/build/esm/ThemeExplorer/googleFonts.js +1 -1
- package/build/esm/ThemeExplorer/googleFonts.js.map +1 -1
- package/build/esm/ThemeExplorer/index.d.ts +1 -1
- package/build/esm/ThemeExplorer/index.js.map +1 -1
- package/build/esm/ThemeExplorer/makeColorScheme.d.ts +98 -98
- package/build/esm/ThemeExplorer/makeColorScheme.js +0 -1
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -1
- package/build/esm/ThemeExplorer/makeTailwindTheme.d.ts +2 -2
- package/build/esm/ThemeExplorer/makeTailwindTheme.js +20 -20
- package/build/esm/ThemeExplorer/makeTailwindTheme.js.map +1 -1
- package/build/esm/ThemeExplorer/updateGoogleFonts.js +23 -64
- package/build/esm/ThemeExplorer/updateGoogleFonts.js.map +1 -1
- package/build/esm/ThemeExplorer/useDeferredColor.d.ts +3 -3
- package/build/esm/ThemeExplorer/useDeferredColor.js +2 -9
- package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -1
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.d.ts +1 -1
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +2 -10
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +8 -8
- package/build/esm/Tooltip/Tooltip.js +21 -25
- package/build/esm/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/Tooltip/index.d.ts +1 -1
- package/build/esm/Tooltip/index.js.map +1 -1
- package/build/esm/color.d.ts +8 -8
- package/build/esm/color.js +23 -31
- package/build/esm/color.js.map +1 -1
- package/build/esm/css.d.ts +1 -1
- package/build/esm/css.js.map +1 -1
- package/build/esm/hooks/useAnimation.d.ts +20 -20
- package/build/esm/hooks/useAnimation.js +42 -53
- package/build/esm/hooks/useAnimation.js.map +1 -1
- package/build/esm/index.d.ts +42 -42
- package/build/esm/index.js.map +1 -1
- package/build/esm/motion.d.ts +7 -7
- package/build/esm/motion.js +7 -7
- package/build/esm/motion.js.map +1 -1
- package/build/esm/tailwind/extendColors.d.ts +5 -5
- package/build/esm/tailwind/extendColors.js +17 -29
- package/build/esm/tailwind/extendColors.js.map +1 -1
- package/build/esm/tailwind/index.d.ts +8 -8
- package/build/esm/tailwind/index.js +17 -29
- package/build/esm/tailwind/index.js.map +1 -1
- package/build/esm/theme/index.d.ts +2 -2
- package/build/esm/theme/index.js.map +1 -1
- package/build/esm/theme/theme.d.ts +590 -562
- package/build/esm/theme/theme.js +49 -22
- package/build/esm/theme/theme.js.map +1 -1
- package/build/esm/theme/typography-raleway.d.ts +112 -112
- package/build/esm/theme/typography-raleway.js +1 -1
- package/build/esm/theme/typography-raleway.js.map +1 -1
- package/build/esm/theme/typography-roboto.d.ts +111 -111
- package/build/esm/theme/typography-roboto.js +1 -1
- package/build/esm/theme/typography-roboto.js.map +1 -1
- package/build/esm/theme/useTheme.d.ts +594 -566
- package/build/esm/theme/useTheme.js +1 -3
- package/build/esm/theme/useTheme.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -1
- package/package.json +12 -11
- package/src/Alert/index.ts +1 -1
- package/src/AppBar/AppBar.story.tsx +69 -69
- package/src/AppBar/AppBar.tsx +85 -85
- package/src/AppBar/AppBarButton.tsx +25 -25
- package/src/AppBar/context.ts +13 -13
- package/src/AppBar/index.ts +3 -3
- package/src/Badge/Badge.story.tsx +68 -68
- package/src/Badge/Badge.tsx +47 -47
- package/src/Badge/index.ts +1 -1
- package/src/BaseLine/BaseLine.tsx +100 -100
- package/src/BaseLine/index.ts +1 -1
- package/src/BottomSheet/BottomSheet.story.tsx +35 -35
- package/src/BottomSheet/BottomSheet.tsx +39 -39
- package/src/BottomSheet/BottomSheetSurface.tsx +49 -49
- package/src/BottomSheet/index.ts +1 -1
- package/src/Box/Box.tsx +133 -127
- package/src/Box/index.ts +1 -1
- package/src/Button/BaseButton.tsx +123 -18
- package/src/Button/Button.story.tsx +236 -72
- package/src/Button/Button.tsx +44 -15
- package/src/Button/ButtonGroup.story.tsx +263 -101
- package/src/Button/ButtonGroup.tsx +103 -7
- package/src/Button/FilledButton.tsx +2 -43
- package/src/Button/FloatingActionButton.tsx +14 -9
- package/src/Button/IconFilledButton.tsx +3 -0
- package/src/Button/IconOutlinedButton.tsx +3 -0
- package/src/Button/OutlinedButton.tsx +2 -41
- package/src/Button/SpinnerButton.story.tsx +91 -91
- package/src/Button/SplitButton.story.tsx +110 -0
- package/src/Button/SplitButton.tsx +40 -0
- package/src/Button/TransparentButton.tsx +1 -43
- package/src/Button/context.tsx +19 -17
- package/src/Button/index.ts +3 -2
- package/src/CheckBox/CheckBox.story.tsx +155 -155
- package/src/CheckBox/CheckBox.tsx +170 -170
- package/src/CheckBox/CheckBoxIcon.tsx +63 -64
- package/src/CheckBox/CheckPath.tsx +18 -18
- package/src/CheckBox/IndeterminatePath.tsx +16 -16
- package/src/CheckBox/index.ts +1 -1
- package/src/Chip/ButtonChip.tsx +86 -86
- package/src/Chip/Chip.story.tsx +242 -242
- package/src/Chip/Chip.tsx +5 -5
- package/src/Chip/ChipBase.tsx +141 -141
- package/src/Chip/ChoiceChip.tsx +127 -127
- package/src/Chip/index.ts +2 -2
- package/src/Combobox/Combobox.tsx +274 -274
- package/src/Combobox/index.ts +1 -1
- package/src/Dialog/Dialog.story.tsx +53 -53
- package/src/Dialog/Dialog.tsx +73 -73
- package/src/Dialog/DialogBackdrop.tsx +42 -42
- package/src/Dialog/DialogContainer.tsx +31 -31
- package/src/Dialog/DialogSurface.tsx +55 -55
- package/src/Dialog/Scrim.tsx +35 -35
- package/src/Dialog/index.ts +2 -2
- package/src/Dialog/useDialogAnimation.tsx +59 -49
- package/src/Divider/Divider.story.tsx +39 -39
- package/src/Divider/Divider.tsx +48 -48
- package/src/Divider/index.ts +1 -1
- package/src/FloatingLabel/FloatingLabel.story.tsx +55 -55
- package/src/FloatingLabel/FloatingLabel.tsx +77 -77
- package/src/FloatingLabel/index.ts +1 -1
- package/src/LineRipple/LineRipple.story.tsx +43 -43
- package/src/LineRipple/LineRipple.tsx +81 -81
- package/src/LineRipple/index.ts +1 -1
- package/src/Link/Link.story.tsx +14 -14
- package/src/Link/Link.tsx +65 -65
- package/src/Link/index.ts +1 -1
- package/src/List/List.tsx +46 -46
- package/src/List/index.ts +1 -1
- package/src/ListItem/ListItem.story.tsx +43 -43
- package/src/ListItem/ListItem.tsx +104 -104
- package/src/ListItem/ListItemText.tsx +35 -35
- package/src/ListItem/index.ts +2 -2
- package/src/Menu/ContextMenu.story.tsx +34 -34
- package/src/Menu/Menu.story.tsx +54 -54
- package/src/Menu/Menu.tsx +124 -124
- package/src/Menu/animation.ts +16 -16
- package/src/Menu/index.ts +2 -2
- package/src/NavRail/NavRail.story.tsx +146 -146
- package/src/NavRail/NavRailItem.tsx +176 -175
- package/src/NavRail/icons/test-icons.tsx +46 -46
- package/src/NavRail/index.ts +1 -1
- package/src/NotchedOutline/NotchedOutline.story.tsx +99 -99
- package/src/NotchedOutline/NotchedOutline.tsx +80 -80
- package/src/NotchedOutline/context.ts +12 -12
- package/src/NotchedOutline/index.ts +1 -1
- package/src/NotchedOutline/styledComponents.ts +122 -122
- package/src/Paper/Paper.story.tsx +50 -50
- package/src/Paper/Paper.tsx +67 -67
- package/src/Paper/index.ts +1 -1
- package/src/Popover/PopoverSurface.tsx +51 -51
- package/src/Popover/index.ts +1 -1
- package/src/ProgressSpinner/ProgressSpinner.story.tsx +35 -35
- package/src/ProgressSpinner/ProgressSpinner.tsx +119 -119
- package/src/ProgressSpinner/index.ts +1 -1
- package/src/RadioButton/RadioButton.story.tsx +109 -109
- package/src/RadioButton/RadioButton.tsx +112 -112
- package/src/RadioButton/RadioButtonIcon.tsx +44 -44
- package/src/RadioButton/RadioGroup.tsx +26 -27
- package/src/RadioButton/index.ts +2 -2
- package/src/Ripple/Ripple.story.tsx +78 -78
- package/src/Ripple/Ripple.tsx +33 -33
- package/src/Ripple/RippleBox.tsx +52 -52
- package/src/Ripple/constants.ts +15 -15
- package/src/Ripple/index.ts +5 -5
- package/src/Ripple/keyframes.ts +36 -36
- package/src/Ripple/useRipple.ts +209 -209
- package/src/Ripple/useRippleHandlers.ts +54 -54
- package/src/Ripple/useRippleSurface.ts +162 -155
- package/src/Select/CustomContainerExample.tsx +59 -59
- package/src/Select/PaymentMethodSelect.story.tsx +320 -316
- package/src/Select/Select.story.tsx +225 -225
- package/src/Select/Select.tsx +284 -283
- package/src/Select/SelectIcon.tsx +43 -43
- package/src/Select/SelectMultiple.story.tsx +214 -215
- package/src/Select/context.ts +22 -22
- package/src/Select/defaultRender.tsx +60 -49
- package/src/Select/index.ts +1 -1
- package/src/Select/styledComponents.tsx +38 -38
- package/src/SelectItem/SelectItem.tsx +92 -92
- package/src/SelectItem/index.ts +1 -1
- package/src/SelectionControl/SelectionControlLabel.tsx +34 -34
- package/src/SelectionControl/SelectionControlText.tsx +37 -37
- package/src/SelectionControl/index.ts +2 -2
- package/src/Skeleton/DelayAppearance.tsx +41 -41
- package/src/Skeleton/Skeleton.story.tsx +57 -57
- package/src/Skeleton/Skeleton.tsx +40 -40
- package/src/Skeleton/animation.ts +54 -54
- package/src/Skeleton/index.ts +2 -2
- package/src/Slider/Slider.story.tsx +36 -36
- package/src/Slider/Slider.tsx +275 -275
- package/src/Slider/index.ts +1 -1
- package/src/Snackbar/Snackbar.story.tsx +99 -99
- package/src/Snackbar/Snackbar.tsx +19 -16
- package/src/Switch/Switch.story.tsx +97 -98
- package/src/Switch/Switch.tsx +170 -170
- package/src/Switch/index.ts +1 -1
- package/src/Switch/styledComponents.tsx +117 -117
- package/src/Tab/Tab.story.tsx +209 -209
- package/src/Tab/Tab.tsx +120 -120
- package/src/Tab/TabList.tsx +61 -61
- package/src/Tab/TabPanel.tsx +31 -31
- package/src/Tab/TabPanels.tsx +5 -5
- package/src/Tab/Tabs.tsx +5 -5
- package/src/Tab/context.ts +17 -17
- package/src/Tab/index.ts +5 -5
- package/src/TabIndicator/TabIndicator.tsx +146 -146
- package/src/TabIndicator/context.ts +13 -13
- package/src/TabIndicator/index.ts +2 -2
- package/src/Table/context.ts +6 -6
- package/src/Text/LoremIpsum.tsx +18 -18
- package/src/Text/Text.story.tsx +79 -75
- package/src/Text/Text.tsx +84 -84
- package/src/Text/index.ts +1 -1
- package/src/TextField/FilledContainer.tsx +173 -173
- package/src/TextField/HelperText.tsx +63 -63
- package/src/TextField/OutlinedContainer.tsx +116 -116
- package/src/TextField/consts.ts +7 -7
- package/src/TextField/index.ts +4 -4
- package/src/ThemeExplorer/BorderSlider.tsx +73 -73
- package/src/ThemeExplorer/ColorPicker.tsx +104 -104
- package/src/ThemeExplorer/ColorSchemePicker.tsx +55 -55
- package/src/ThemeExplorer/FontAutoComplete.tsx +139 -139
- package/src/ThemeExplorer/TextFieldColorPicker.tsx +112 -115
- package/src/ThemeExplorer/ThemeBuilder.story.tsx +8 -8
- package/src/ThemeExplorer/ThemeBuilder.tsx +437 -353
- package/src/ThemeExplorer/ThemeColors.tsx +122 -118
- package/src/ThemeExplorer/components.tsx +195 -195
- package/src/ThemeExplorer/googleFonts.ts +1436 -1436
- package/src/ThemeExplorer/index.ts +1 -1
- package/src/ThemeExplorer/makeColorScheme.tsx +111 -111
- package/src/ThemeExplorer/makeTailwindTheme.ts +44 -44
- package/src/ThemeExplorer/updateGoogleFonts.js +32 -33
- package/src/ThemeExplorer/useDeferredColor.tsx +21 -21
- package/src/ThemeExplorer/useLocalStorageCachedState.ts +18 -18
- package/src/Tooltip/Tooltip.story.tsx +35 -35
- package/src/Tooltip/Tooltip.tsx +67 -67
- package/src/Tooltip/index.ts +1 -1
- package/src/css.ts +2 -2
- package/src/hooks/useAnimation.ts +111 -111
- package/src/motion.ts +7 -7
- package/src/tailwind/extendColors.ts +51 -51
- package/src/tailwind/index.ts +57 -56
- package/src/tailwind/tests/extendColors.test.ts +123 -123
- package/src/theme/index.ts +2 -2
- package/src/theme/theme.ts +36 -8
- package/src/theme/typography-raleway.ts +114 -114
- package/src/theme/typography-roboto.ts +113 -113
- package/src/theme/useTheme.ts +17 -18
- package/tailwind/package.json +5 -5
- package/theme-explorer/package.json +5 -5
|
@@ -1,23 +1,85 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["__css", "variant", "elevation"];
|
|
4
1
|
import { forwardRef } from 'react';
|
|
5
2
|
import { useTheme } from '@emotion/react';
|
|
6
|
-
import { variant } from 'styled-system';
|
|
7
3
|
import { Box } from '../Box';
|
|
8
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
const sizeStyles = {
|
|
6
|
+
xs: {
|
|
7
|
+
height: "2rem",
|
|
8
|
+
iconSize: "1.25rem",
|
|
9
|
+
contentPaddingInline: "0.75rem",
|
|
10
|
+
standardInnerRadius: "0.75rem",
|
|
11
|
+
connectedInnerRadius: "0.25rem",
|
|
12
|
+
splitInnerRadius: "0.25rem"
|
|
13
|
+
},
|
|
14
|
+
sm: {
|
|
15
|
+
height: "2.5rem",
|
|
16
|
+
iconSize: "1.5rem",
|
|
17
|
+
contentPaddingInline: "1rem",
|
|
18
|
+
standardInnerRadius: "0.75rem",
|
|
19
|
+
connectedInnerRadius: "0.5rem",
|
|
20
|
+
splitInnerRadius: "0.25rem"
|
|
21
|
+
},
|
|
22
|
+
md: {
|
|
23
|
+
height: "3.5rem",
|
|
24
|
+
iconSize: "1.5rem",
|
|
25
|
+
contentPaddingInline: "1.5rem",
|
|
26
|
+
standardInnerRadius: "1rem",
|
|
27
|
+
connectedInnerRadius: "0.5rem",
|
|
28
|
+
splitInnerRadius: "0.25rem"
|
|
29
|
+
},
|
|
30
|
+
lg: {
|
|
31
|
+
height: "6rem",
|
|
32
|
+
iconSize: "2rem",
|
|
33
|
+
contentPaddingInline: "3rem",
|
|
34
|
+
standardInnerRadius: "1.75rem",
|
|
35
|
+
connectedInnerRadius: "1rem",
|
|
36
|
+
splitInnerRadius: "0.5rem"
|
|
37
|
+
},
|
|
38
|
+
xl: {
|
|
39
|
+
height: "8.5rem",
|
|
40
|
+
iconSize: "2.5rem",
|
|
41
|
+
contentPaddingInline: "4rem",
|
|
42
|
+
standardInnerRadius: "1.75rem",
|
|
43
|
+
connectedInnerRadius: "1.25rem",
|
|
44
|
+
splitInnerRadius: "0.75rem"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function getTypographyVariant(size) {
|
|
48
|
+
if (size === 'md') return 'text.title-medium';
|
|
49
|
+
if (size === 'lg') return 'text.headline-small';
|
|
50
|
+
if (size === 'xl') return 'text.headline-large';
|
|
51
|
+
return 'text.label-large';
|
|
52
|
+
}
|
|
53
|
+
function getSquareRadius(size) {
|
|
54
|
+
if (size === 'md') return 'large';
|
|
55
|
+
if (size === 'lg' || size === 'xl') return 'extra-large';
|
|
56
|
+
return 'medium';
|
|
57
|
+
}
|
|
58
|
+
function isIconVariant(variant) {
|
|
59
|
+
return variant === 'icon' || variant === 'icon-filled' || variant === 'icon-outlined' || variant === 'fab';
|
|
60
|
+
}
|
|
61
|
+
export const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
62
|
+
const theme = useTheme();
|
|
63
|
+
const {
|
|
64
|
+
__css,
|
|
65
|
+
variant: variantProp = 'text',
|
|
66
|
+
elevation = 'none',
|
|
67
|
+
size = 'sm',
|
|
68
|
+
shape = 'rounded',
|
|
69
|
+
isGroupedButton,
|
|
70
|
+
...otherProps
|
|
71
|
+
} = props;
|
|
72
|
+
const sizeStyle = sizeStyles[size];
|
|
73
|
+
const iconOnly = isIconVariant(variantProp);
|
|
74
|
+
const contentButton = !iconOnly;
|
|
75
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
18
76
|
as: "button",
|
|
19
77
|
ref: ref,
|
|
20
|
-
|
|
78
|
+
variant: variantProp,
|
|
79
|
+
"data-button-grouped": isGroupedButton ? '' : undefined,
|
|
80
|
+
"data-button-shape": shape,
|
|
81
|
+
"data-button-size": size,
|
|
82
|
+
__css: {
|
|
21
83
|
boxSizing: 'border-box',
|
|
22
84
|
position: 'relative',
|
|
23
85
|
appearance: 'none',
|
|
@@ -29,34 +91,43 @@ export var BaseButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
29
91
|
textDecoration: 'none',
|
|
30
92
|
fontSize: 'inherit',
|
|
31
93
|
border: 0,
|
|
94
|
+
boxShadow: 'none',
|
|
32
95
|
overflow: 'hidden',
|
|
33
96
|
WebkitTapHighlightColor: 'transparent',
|
|
34
97
|
touchAction: 'manipulation',
|
|
35
98
|
userSelect: 'none',
|
|
36
|
-
minWidth: '
|
|
99
|
+
minWidth: 'fit-content',
|
|
37
100
|
whiteSpace: 'nowrap',
|
|
101
|
+
cursor: 'pointer',
|
|
102
|
+
outline: 'none',
|
|
103
|
+
py: 0,
|
|
104
|
+
variant: getTypographyVariant(size),
|
|
105
|
+
height: sizeStyle.height,
|
|
106
|
+
borderRadius: shape === 'square' ? getSquareRadius(size) : 'full',
|
|
107
|
+
...(contentButton && {
|
|
108
|
+
px: sizeStyle.contentPaddingInline
|
|
109
|
+
}),
|
|
110
|
+
...(iconOnly && {
|
|
111
|
+
width: sizeStyle.height,
|
|
112
|
+
maxWidth: sizeStyle.height,
|
|
113
|
+
maxHeight: sizeStyle.height,
|
|
114
|
+
px: `calc((${sizeStyle.height} - ${sizeStyle.iconSize}) / 2)`
|
|
115
|
+
}),
|
|
116
|
+
'--btn-pill-radius': `calc(${sizeStyle.height} / 2)`,
|
|
117
|
+
'--btn-standard-inner-radius': sizeStyle.standardInnerRadius,
|
|
118
|
+
'--btn-connected-inner-radius': sizeStyle.connectedInnerRadius,
|
|
119
|
+
'--btn-split-inner-radius': sizeStyle.splitInnerRadius,
|
|
120
|
+
'& svg': {
|
|
121
|
+
width: sizeStyle.iconSize,
|
|
122
|
+
height: sizeStyle.iconSize
|
|
123
|
+
},
|
|
38
124
|
'&::-moz-focus-inner': {
|
|
39
125
|
border: 0
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
})({
|
|
48
|
-
variant: variantProp,
|
|
49
|
-
theme: theme
|
|
50
|
-
})), variant({
|
|
51
|
-
scale: 'buttons.elevations',
|
|
52
|
-
prop: 'elevation',
|
|
53
|
-
variants: {
|
|
54
|
-
none: {}
|
|
55
|
-
}
|
|
56
|
-
})({
|
|
57
|
-
elevation: elevation,
|
|
58
|
-
theme: theme
|
|
59
|
-
})), __css)
|
|
60
|
-
}, otherProps));
|
|
126
|
+
},
|
|
127
|
+
...(theme.buttons.elevations[elevation] ?? {}),
|
|
128
|
+
...__css
|
|
129
|
+
},
|
|
130
|
+
...otherProps
|
|
131
|
+
});
|
|
61
132
|
});
|
|
62
133
|
//# sourceMappingURL=BaseButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton.js","names":["forwardRef","useTheme","
|
|
1
|
+
{"version":3,"file":"BaseButton.js","names":["forwardRef","useTheme","Box","jsx","_jsx","sizeStyles","xs","height","iconSize","contentPaddingInline","standardInnerRadius","connectedInnerRadius","splitInnerRadius","sm","md","lg","xl","getTypographyVariant","size","getSquareRadius","isIconVariant","variant","BaseButton","props","ref","theme","__css","variantProp","elevation","shape","isGroupedButton","otherProps","sizeStyle","iconOnly","contentButton","as","undefined","boxSizing","position","appearance","display","alignItems","justifyContent","textAlign","lineHeight","textDecoration","fontSize","border","boxShadow","overflow","WebkitTapHighlightColor","touchAction","userSelect","minWidth","whiteSpace","cursor","outline","py","borderRadius","px","width","maxWidth","maxHeight","buttons","elevations"],"sources":["../../../src/Button/BaseButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { useTheme } from '@emotion/react';\nimport { rem } from 'polished';\n\nimport type { BoxProps } from '../Box';\nimport { Box } from '../Box';\nimport type { ButtonVariants } from './Button';\n\nexport type ButtonElevation =\n | 'none'\n | 'default'\n | 'elevated'\n | 'floating'\n | 'contained';\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type ButtonShape = 'rounded' | 'square';\n\nexport interface BaseButtonProps\n extends BoxProps<HTMLButtonElement, ButtonHTMLAttributes<HTMLButtonElement>> {\n elevation?: ButtonElevation;\n size?: ButtonSize;\n shape?: ButtonShape;\n isGroupedButton?: boolean;\n variant?: ButtonVariants;\n}\n\nconst sizeStyles = {\n xs: {\n height: rem(32),\n iconSize: rem(20),\n contentPaddingInline: rem(12),\n standardInnerRadius: rem(12),\n connectedInnerRadius: rem(4),\n splitInnerRadius: rem(4),\n },\n sm: {\n height: rem(40),\n iconSize: rem(24),\n contentPaddingInline: rem(16),\n standardInnerRadius: rem(12),\n connectedInnerRadius: rem(8),\n splitInnerRadius: rem(4),\n },\n md: {\n height: rem(56),\n iconSize: rem(24),\n contentPaddingInline: rem(24),\n standardInnerRadius: rem(16),\n connectedInnerRadius: rem(8),\n splitInnerRadius: rem(4),\n },\n lg: {\n height: rem(96),\n iconSize: rem(32),\n contentPaddingInline: rem(48),\n standardInnerRadius: rem(28),\n connectedInnerRadius: rem(16),\n splitInnerRadius: rem(8),\n },\n xl: {\n height: rem(136),\n iconSize: rem(40),\n contentPaddingInline: rem(64),\n standardInnerRadius: rem(28),\n connectedInnerRadius: rem(20),\n splitInnerRadius: rem(12),\n },\n};\n\nfunction getTypographyVariant(size: ButtonSize) {\n if (size === 'md') return 'text.title-medium';\n if (size === 'lg') return 'text.headline-small';\n if (size === 'xl') return 'text.headline-large';\n return 'text.label-large';\n}\n\nfunction getSquareRadius(size: ButtonSize) {\n if (size === 'md') return 'large';\n if (size === 'lg' || size === 'xl') return 'extra-large';\n return 'medium';\n}\n\nfunction isIconVariant(variant?: ButtonVariants) {\n return (\n variant === 'icon' ||\n variant === 'icon-filled' ||\n variant === 'icon-outlined' ||\n variant === 'fab'\n );\n}\n\nexport const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(\n (props, ref) => {\n const theme = useTheme();\n const {\n __css,\n variant: variantProp = 'text',\n elevation = 'none',\n size = 'sm',\n shape = 'rounded',\n isGroupedButton,\n ...otherProps\n } = props;\n const sizeStyle = sizeStyles[size];\n const iconOnly = isIconVariant(variantProp);\n const contentButton = !iconOnly;\n\n return (\n <Box<BoxProps<HTMLButtonElement, ButtonHTMLAttributes<HTMLButtonElement>>>\n as=\"button\"\n ref={ref}\n variant={variantProp}\n data-button-grouped={isGroupedButton ? '' : undefined}\n data-button-shape={shape}\n data-button-size={size}\n __css={{\n boxSizing: 'border-box',\n position: 'relative',\n appearance: 'none',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n lineHeight: 'inherit',\n textDecoration: 'none',\n fontSize: 'inherit',\n border: 0,\n boxShadow: 'none',\n overflow: 'hidden',\n WebkitTapHighlightColor: 'transparent',\n touchAction: 'manipulation',\n userSelect: 'none',\n minWidth: 'fit-content',\n whiteSpace: 'nowrap',\n cursor: 'pointer',\n outline: 'none',\n py: 0,\n variant: getTypographyVariant(size),\n height: sizeStyle.height,\n borderRadius: shape === 'square' ? getSquareRadius(size) : 'full',\n ...(contentButton && {\n px: sizeStyle.contentPaddingInline,\n }),\n ...(iconOnly && {\n width: sizeStyle.height,\n maxWidth: sizeStyle.height,\n maxHeight: sizeStyle.height,\n px: `calc((${sizeStyle.height} - ${sizeStyle.iconSize}) / 2)`,\n }),\n '--btn-pill-radius': `calc(${sizeStyle.height} / 2)`,\n '--btn-standard-inner-radius': sizeStyle.standardInnerRadius,\n '--btn-connected-inner-radius': sizeStyle.connectedInnerRadius,\n '--btn-split-inner-radius': sizeStyle.splitInnerRadius,\n '& svg': {\n width: sizeStyle.iconSize,\n height: sizeStyle.iconSize,\n },\n '&::-moz-focus-inner': {\n border: 0,\n },\n ...((theme.buttons.elevations as Record<string, object>)[elevation] ??\n {}),\n ...__css,\n }}\n {...otherProps}\n />\n );\n }\n);\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,QAAQ,QAAQ,gBAAgB;AAIzC,SAASC,GAAG,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAqB7B,MAAMC,UAAU,GAAG;EACjBC,EAAE,EAAE;IACFC,MAAM,QAAS;IACfC,QAAQ,WAAS;IACjBC,oBAAoB,WAAS;IAC7BC,mBAAmB,WAAS;IAC5BC,oBAAoB,WAAQ;IAC5BC,gBAAgB;EAClB,CAAC;EACDC,EAAE,EAAE;IACFN,MAAM,UAAS;IACfC,QAAQ,UAAS;IACjBC,oBAAoB,QAAS;IAC7BC,mBAAmB,WAAS;IAC5BC,oBAAoB,UAAQ;IAC5BC,gBAAgB;EAClB,CAAC;EACDE,EAAE,EAAE;IACFP,MAAM,UAAS;IACfC,QAAQ,UAAS;IACjBC,oBAAoB,UAAS;IAC7BC,mBAAmB,QAAS;IAC5BC,oBAAoB,UAAQ;IAC5BC,gBAAgB;EAClB,CAAC;EACDG,EAAE,EAAE;IACFR,MAAM,QAAS;IACfC,QAAQ,QAAS;IACjBC,oBAAoB,QAAS;IAC7BC,mBAAmB,WAAS;IAC5BC,oBAAoB,QAAS;IAC7BC,gBAAgB;EAClB,CAAC;EACDI,EAAE,EAAE;IACFT,MAAM,UAAU;IAChBC,QAAQ,UAAS;IACjBC,oBAAoB,QAAS;IAC7BC,mBAAmB,WAAS;IAC5BC,oBAAoB,WAAS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oB;MAC9D,0BAA0B,EAAEqB,SAAS,CAACpB,gBAAgB;MACtD,OAAO,EAAE;QACPgD,KAAK,EAAE5B,SAAS,CAACxB,QAAQ;QACzBD,MAAM,EAAEyB,SAAS,CAACxB;MACpB,CAAC;MACD,qBAAqB,EAAE;QACrBuC,MAAM,EAAE;MACV,CAAC;MACD,IAAKtB,KAAK,CAACsC,OAAO,CAACC,UAAU,CAA4BpC,SAAS,CAAC,IACjE,CAAC,CAAC,CAAC;MACL,GAAGF;IACL,CAAE;IAAA,GACEK;EAAU,CACf,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { ElementType, ReactNode } from 'react';
|
|
2
|
-
import type { BaseButtonProps } from './BaseButton';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import type { ElementType, ReactNode } from 'react';
|
|
2
|
+
import type { BaseButtonProps, ButtonShape, ButtonSize } from './BaseButton';
|
|
3
|
+
export type { ButtonShape, ButtonSize };
|
|
4
|
+
export type ButtonVariants = 'text' | 'outlined' | 'filled' | 'fab' | 'fab-extended' | 'icon' | 'icon-filled' | 'icon-outlined';
|
|
5
|
+
export type ButtonColors = 'primary' | 'secondary' | string;
|
|
6
|
+
export interface ButtonProps extends BaseButtonProps {
|
|
7
|
+
as?: ElementType<any>;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
variant?: ButtonVariants;
|
|
10
|
+
color?: ButtonColors;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
elevation?: 'none' | 'default' | 'contained' | 'floating' | 'elevated';
|
|
13
|
+
}
|
|
14
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,85 +1,103 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "variant", "onPointerDown", "onKeyDown", "color", "disabled", "elevation", "style"];
|
|
4
1
|
import { forwardRef } from 'react';
|
|
5
2
|
import * as TransparentButton from './TransparentButton';
|
|
6
3
|
import * as FloatingActionButton from './FloatingActionButton';
|
|
7
4
|
import * as FilledButton from './FilledButton';
|
|
8
5
|
import * as OutlinedButton from './OutlinedButton';
|
|
9
6
|
import * as IconButton from './IconButton';
|
|
7
|
+
import * as IconFilledButton from './IconFilledButton';
|
|
8
|
+
import * as IconOutlinedButton from './IconOutlinedButton';
|
|
10
9
|
import { useTheme } from '../theme';
|
|
11
10
|
import { useRippleSurface } from '../Ripple';
|
|
12
11
|
import { useButtonGroupContext } from './context';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
|
|
13
|
+
const componentMapping = {
|
|
15
14
|
text: TransparentButton.TransparentButton,
|
|
16
15
|
outlined: OutlinedButton.OutlinedButton,
|
|
17
16
|
filled: FilledButton.FilledButton,
|
|
18
|
-
fab:
|
|
19
|
-
'fab-mini': FilledButton.FilledButton,
|
|
20
|
-
'fab-large': FilledButton.FilledButton,
|
|
17
|
+
fab: FloatingActionButton.FloatingActionButton,
|
|
21
18
|
'fab-extended': FilledButton.FilledButton,
|
|
22
|
-
icon: TransparentButton.TransparentButton
|
|
19
|
+
icon: TransparentButton.TransparentButton,
|
|
20
|
+
'icon-filled': IconFilledButton.IconFilledButton,
|
|
21
|
+
'icon-outlined': IconOutlinedButton.IconOutlinedButton
|
|
23
22
|
};
|
|
24
|
-
|
|
23
|
+
const rippleMapping = {
|
|
25
24
|
text: TransparentButton.getRippleProperties,
|
|
26
25
|
outlined: TransparentButton.getRippleProperties,
|
|
27
26
|
filled: FilledButton.getRippleProperties,
|
|
28
27
|
fab: FloatingActionButton.getRippleProperties,
|
|
29
|
-
'fab-
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
icon: IconButton.getRippleProperties
|
|
28
|
+
'fab-extended': FloatingActionButton.getRippleProperties,
|
|
29
|
+
icon: IconButton.getRippleProperties,
|
|
30
|
+
'icon-filled': IconButton.getRippleProperties,
|
|
31
|
+
'icon-outlined': IconButton.getRippleProperties
|
|
33
32
|
};
|
|
34
|
-
|
|
35
33
|
function getFallbackElevation() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return 'none';
|
|
34
|
+
let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'text';
|
|
35
|
+
if (variant === 'fab' || variant === 'fab-extended') {
|
|
36
|
+
return 'floating';
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
if (variant === 'filled') {
|
|
39
|
+
return 'default';
|
|
40
|
+
}
|
|
41
|
+
return 'none';
|
|
42
|
+
}
|
|
43
|
+
function getFallbackSize() {
|
|
44
|
+
let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'text';
|
|
45
|
+
if (variant === 'fab-extended') {
|
|
46
|
+
return 'md';
|
|
47
|
+
}
|
|
48
|
+
return 'sm';
|
|
49
|
+
}
|
|
50
|
+
function getFallbackShape() {
|
|
51
|
+
let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'text';
|
|
52
|
+
if (variant === 'fab' || variant === 'fab-extended') {
|
|
53
|
+
return 'square';
|
|
54
|
+
}
|
|
55
|
+
return 'rounded';
|
|
43
56
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var getRippleProperties = rippleMapping[variant];
|
|
65
|
-
var rippleProps = useRippleSurface(_extends(_extends({}, getRippleProperties(theme)), {}, {
|
|
57
|
+
export const Button = /*#__PURE__*/forwardRef(function Button(props, forwardedRef) {
|
|
58
|
+
const buttonGroup = useButtonGroupContext();
|
|
59
|
+
const {
|
|
60
|
+
children,
|
|
61
|
+
variant = buttonGroup?.buttonVariant || 'text',
|
|
62
|
+
onPointerDown: onPointerDownProp,
|
|
63
|
+
onKeyDown: onKeyDownProp,
|
|
64
|
+
color = 'primary',
|
|
65
|
+
disabled = false,
|
|
66
|
+
size = getFallbackSize(props.variant),
|
|
67
|
+
shape = getFallbackShape(props.variant),
|
|
68
|
+
elevation = getFallbackElevation(props.variant),
|
|
69
|
+
style: styleProp,
|
|
70
|
+
...otherProps
|
|
71
|
+
} = props;
|
|
72
|
+
const theme = useTheme();
|
|
73
|
+
const Comp = componentMapping[variant];
|
|
74
|
+
const getRippleProperties = rippleMapping[variant];
|
|
75
|
+
const rippleProps = useRippleSurface({
|
|
76
|
+
...(getRippleProperties?.(theme) ?? {}),
|
|
66
77
|
rippleColor: 'currentColor',
|
|
67
|
-
disabled
|
|
78
|
+
disabled,
|
|
68
79
|
style: styleProp,
|
|
69
80
|
onKeyDown: onKeyDownProp,
|
|
70
81
|
onPointerDown: onPointerDownProp
|
|
71
|
-
})
|
|
72
|
-
|
|
82
|
+
});
|
|
83
|
+
if (!Comp || !getRippleProperties) {
|
|
84
|
+
console.warn(`Unsupported button variant: ${variant}.`);
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return /*#__PURE__*/_jsx(Comp, {
|
|
73
88
|
ref: forwardedRef,
|
|
74
89
|
variant: variant,
|
|
75
90
|
theme: theme,
|
|
76
91
|
disabled: disabled,
|
|
77
92
|
"aria-disabled": disabled ? 'true' : undefined,
|
|
78
93
|
color: color,
|
|
94
|
+
size: size,
|
|
95
|
+
shape: shape,
|
|
79
96
|
elevation: elevation,
|
|
80
|
-
isGroupedButton: Boolean(buttonGroup)
|
|
81
|
-
|
|
97
|
+
isGroupedButton: Boolean(buttonGroup),
|
|
98
|
+
...rippleProps,
|
|
99
|
+
...otherProps,
|
|
82
100
|
children: children
|
|
83
|
-
})
|
|
101
|
+
});
|
|
84
102
|
});
|
|
85
103
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["forwardRef","TransparentButton","FloatingActionButton","FilledButton","OutlinedButton","IconButton","useTheme","useRippleSurface","useButtonGroupContext","componentMapping","text","outlined","filled","fab","icon","rippleMapping","getRippleProperties","getFallbackElevation","variant","Button","props","forwardedRef","buttonGroup","children","
|
|
1
|
+
{"version":3,"file":"Button.js","names":["forwardRef","TransparentButton","FloatingActionButton","FilledButton","OutlinedButton","IconButton","IconFilledButton","IconOutlinedButton","useTheme","useRippleSurface","useButtonGroupContext","jsx","_jsx","componentMapping","text","outlined","filled","fab","icon","rippleMapping","getRippleProperties","getFallbackElevation","variant","arguments","length","undefined","getFallbackSize","getFallbackShape","Button","props","forwardedRef","buttonGroup","children","buttonVariant","onPointerDown","onPointerDownProp","onKeyDown","onKeyDownProp","color","disabled","size","shape","elevation","style","styleProp","otherProps","theme","Comp","rippleProps","rippleColor","console","warn","ref","isGroupedButton","Boolean"],"sources":["../../../src/Button/Button.tsx"],"sourcesContent":["import type { ComponentType, ElementType, ReactNode } from 'react';\nimport { forwardRef } from 'react';\n\nimport * as TransparentButton from './TransparentButton';\nimport * as FloatingActionButton from './FloatingActionButton';\nimport * as FilledButton from './FilledButton';\nimport * as OutlinedButton from './OutlinedButton';\nimport * as IconButton from './IconButton';\nimport * as IconFilledButton from './IconFilledButton';\nimport * as IconOutlinedButton from './IconOutlinedButton';\nimport { useTheme } from '../theme';\nimport { useRippleSurface } from '../Ripple';\nimport type { BaseButtonProps, ButtonShape, ButtonSize } from './BaseButton';\nexport type { ButtonShape, ButtonSize };\nimport { useButtonGroupContext } from './context';\n\nexport type ButtonVariants =\n | 'text'\n | 'outlined'\n | 'filled'\n | 'fab'\n | 'fab-extended'\n | 'icon'\n | 'icon-filled'\n | 'icon-outlined';\n\nconst componentMapping = {\n text: TransparentButton.TransparentButton,\n outlined: OutlinedButton.OutlinedButton,\n filled: FilledButton.FilledButton,\n fab: FloatingActionButton.FloatingActionButton,\n 'fab-extended': FilledButton.FilledButton,\n icon: TransparentButton.TransparentButton,\n 'icon-filled': IconFilledButton.IconFilledButton,\n 'icon-outlined': IconOutlinedButton.IconOutlinedButton,\n};\n\nconst rippleMapping = {\n text: TransparentButton.getRippleProperties,\n outlined: TransparentButton.getRippleProperties,\n filled: FilledButton.getRippleProperties,\n fab: FloatingActionButton.getRippleProperties,\n 'fab-extended': FloatingActionButton.getRippleProperties,\n icon: IconButton.getRippleProperties,\n 'icon-filled': IconButton.getRippleProperties,\n 'icon-outlined': IconButton.getRippleProperties,\n};\n\nexport type ButtonColors = 'primary' | 'secondary' | string;\n\nexport interface ButtonProps extends BaseButtonProps {\n as?: ElementType<any>;\n children?: ReactNode;\n variant?: ButtonVariants;\n color?: ButtonColors;\n disabled?: boolean;\n elevation?: 'none' | 'default' | 'contained' | 'floating' | 'elevated';\n}\n\nfunction getFallbackElevation(variant: ButtonVariants = 'text') {\n if (variant === 'fab' || variant === 'fab-extended') {\n return 'floating';\n }\n if (variant === 'filled') {\n return 'default';\n }\n return 'none';\n}\n\nfunction getFallbackSize(variant: ButtonVariants = 'text'): ButtonSize {\n if (variant === 'fab-extended') {\n return 'md';\n }\n return 'sm';\n}\n\nfunction getFallbackShape(variant: ButtonVariants = 'text'): ButtonShape {\n if (variant === 'fab' || variant === 'fab-extended') {\n return 'square';\n }\n return 'rounded';\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(props, forwardedRef) {\n const buttonGroup = useButtonGroupContext();\n const {\n children,\n variant = buttonGroup?.buttonVariant || 'text',\n onPointerDown: onPointerDownProp,\n onKeyDown: onKeyDownProp,\n color = 'primary',\n disabled = false,\n size = getFallbackSize(props.variant),\n shape = getFallbackShape(props.variant),\n elevation = getFallbackElevation(props.variant),\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const Comp: ComponentType<any> = componentMapping[variant];\n const getRippleProperties = rippleMapping[variant];\n\n const rippleProps = useRippleSurface({\n ...(getRippleProperties?.(theme) ?? {}),\n rippleColor: 'currentColor',\n disabled,\n style: styleProp,\n onKeyDown: onKeyDownProp,\n onPointerDown: onPointerDownProp,\n });\n\n if (!Comp || !getRippleProperties) {\n console.warn(`Unsupported button variant: ${variant}.`);\n return null;\n }\n\n return (\n <Comp\n ref={forwardedRef}\n variant={variant}\n theme={theme}\n disabled={disabled}\n aria-disabled={disabled ? 'true' : undefined}\n color={color}\n size={size}\n shape={shape}\n elevation={elevation}\n isGroupedButton={Boolean(buttonGroup)}\n {...rippleProps}\n {...otherProps}\n >\n {children}\n </Comp>\n );\n }\n);\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,OAAO;AAElC,OAAO,KAAKC,iBAAiB,MAAM,qBAAqB;AACxD,OAAO,KAAKC,oBAAoB,MAAM,wBAAwB;AAC9D,OAAO,KAAKC,YAAY,MAAM,gBAAgB;AAC9C,OAAO,KAAKC,cAAc,MAAM,kBAAkB;AAClD,OAAO,KAAKC,UAAU,MAAM,cAAc;AAC1C,OAAO,KAAKC,gBAAgB,MAAM,oBAAoB;AACtD,OAAO,KAAKC,kBAAkB,MAAM,sBAAsB;AAC1D,SAASC,QAAQ,QAAQ,UAAU;AACnC,SAASC,gBAAgB,QAAQ,WAAW;AAG5C,SAASC,qBAAqB,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAYlD,MAAMC,gBAAgB,GAAG;EACvBC,IAAI,EAAEb,iBAAiB,CAACA,iBAAiB;EACzCc,QAAQ,EAAEX,cAAc,CAACA,cAAc;EACvCY,MAAM,EAAEb,YAAY,CAACA,YAAY;EACjCc,GAAG,EAAEf,oBAAoB,CAACA,oBAAoB;EAC9C,cAAc,EAAEC,Y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R,OAAO,EAAEA,OAAQ;IACjBwB,KAAK,EAAEA,KAAM;IACbP,QAAQ,EAAEA,QAAS;IACnB,iBAAeA,QAAQ,GAAG,MAAM,GAAGd,SAAU;IAC7Ca,KAAK,EAAEA,KAAM;IACbE,IAAI,EAAEA,IAAK;IACXC,KAAK,EAAEA,KAAM;IACbC,SAAS,EAAEA,SAAU;IACrBW,eAAe,EAAEC,OAAO,CAACvB,WAAW,CAAE;IAAA,GAClCiB,WAAW;IAAA,GACXH,UAAU;IAAAb,QAAA,EAEbA;EAAQ,CACL,CAAC;AAEX,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
export declare const ButtonGroup: import("react").ForwardRefExoticComponent<Pick<ButtonGroupProps, "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "color" | "direction" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "form" | "slot" | "style" | "title" | "hidden" | "as" | "sx" | "__css" | "variant" | "tx" | "theme" | "size" | "borderX" | "borderY" | "gridGap" | "gridColumnGap" | "gridRowGap" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "elevation" | "isGroupedButton" | "key"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import type { ButtonGroupContextProps } from './context';
|
|
2
|
+
import { type BoxProps } from '../Box';
|
|
3
|
+
export type ButtonGroupProps = BoxProps & ButtonGroupContextProps;
|
|
4
|
+
export declare const ButtonGroup: import("react").ForwardRefExoticComponent<Omit<ButtonGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|