@basic-ui/material 0.1.16 → 1.0.0-alpha.2
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/build/cjs/index.js +586 -337
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +2 -2
- package/build/esm/Alert/Alert.js +9 -9
- package/build/esm/Alert/Alert.js.map +1 -1
- package/build/esm/AppBar/AppBar.d.ts +3 -3
- package/build/esm/AppBar/AppBar.js +25 -18
- package/build/esm/AppBar/AppBar.js.map +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +2 -2
- package/build/esm/AppBar/AppBarButton.js +8 -9
- package/build/esm/AppBar/AppBarButton.js.map +1 -1
- package/build/esm/AppBar/context.d.ts +1 -1
- package/build/esm/AppBar/context.js +6 -5
- package/build/esm/AppBar/context.js.map +1 -1
- package/build/esm/Badge/Badge.d.ts +2 -2
- package/build/esm/Badge/Badge.js +2 -2
- package/build/esm/Badge/Badge.js.map +1 -1
- package/build/esm/BaseLine/BaseLine.d.ts +0 -1
- package/build/esm/BaseLine/BaseLine.js +4 -4
- package/build/esm/BaseLine/BaseLine.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +2 -2
- package/build/esm/BottomSheet/BottomSheet.js +11 -13
- package/build/esm/BottomSheet/BottomSheet.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +4 -4
- package/build/esm/BottomSheet/BottomSheetSurface.js +9 -9
- package/build/esm/BottomSheet/BottomSheetSurface.js.map +1 -1
- package/build/esm/Box/Box.d.ts +5 -5
- package/build/esm/Box/Box.js +27 -19
- package/build/esm/Box/Box.js.map +1 -1
- package/build/esm/Button/BaseButton.d.ts +4 -3
- package/build/esm/Button/BaseButton.js +11 -12
- package/build/esm/Button/BaseButton.js.map +1 -1
- package/build/esm/Button/Button.d.ts +5 -5
- package/build/esm/Button/Button.js +45 -24
- package/build/esm/Button/Button.js.map +1 -1
- package/build/esm/Button/ButtonGroup.d.ts +5 -0
- package/build/esm/Button/ButtonGroup.js +31 -0
- package/build/esm/Button/ButtonGroup.js.map +1 -0
- package/build/esm/Button/FilledButton.d.ts +3 -2
- package/build/esm/Button/FilledButton.js +62 -21
- package/build/esm/Button/FilledButton.js.map +1 -1
- package/build/esm/Button/FloatingActionButton.d.ts +1 -1
- package/build/esm/Button/FloatingActionButton.js.map +1 -1
- package/build/esm/Button/IconButton.d.ts +2 -1
- package/build/esm/Button/IconButton.js +2 -1
- package/build/esm/Button/IconButton.js.map +1 -1
- package/build/esm/Button/OutlinedButton.d.ts +1 -1
- package/build/esm/Button/OutlinedButton.js +36 -4
- package/build/esm/Button/OutlinedButton.js.map +1 -1
- package/build/esm/Button/TransparentButton.d.ts +3 -2
- package/build/esm/Button/TransparentButton.js +49 -15
- package/build/esm/Button/TransparentButton.js.map +1 -1
- package/build/esm/Button/context.d.ts +8 -0
- package/build/esm/Button/context.js +7 -0
- package/build/esm/Button/context.js.map +1 -0
- package/build/esm/Button/index.d.ts +1 -0
- package/build/esm/Button/index.js +1 -0
- package/build/esm/Button/index.js.map +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +3 -3
- package/build/esm/CheckBox/CheckBox.js +43 -36
- package/build/esm/CheckBox/CheckBox.js.map +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +3 -3
- package/build/esm/CheckBox/CheckBoxIcon.js +15 -13
- package/build/esm/CheckBox/CheckBoxIcon.js.map +1 -1
- package/build/esm/CheckBox/CheckPath.js +15 -14
- package/build/esm/CheckBox/CheckPath.js.map +1 -1
- package/build/esm/CheckBox/IndeterminatePath.js +14 -13
- package/build/esm/CheckBox/IndeterminatePath.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +5 -5
- package/build/esm/Chip/ButtonChip.js +49 -65
- package/build/esm/Chip/ButtonChip.js.map +1 -1
- package/build/esm/Chip/ChipBase.d.ts +2 -2
- package/build/esm/Chip/ChipBase.js +42 -29
- package/build/esm/Chip/ChipBase.js.map +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +5 -4
- package/build/esm/Chip/ChoiceChip.js +38 -45
- package/build/esm/Chip/ChoiceChip.js.map +1 -1
- package/build/esm/ColorMode/ColorModeProvider.d.ts +1 -1
- package/build/esm/ColorMode/ColorModeProvider.js +32 -19
- package/build/esm/ColorMode/ColorModeProvider.js.map +1 -1
- package/build/esm/ColorMode/color-mode.js +3 -3
- package/build/esm/ColorMode/color-mode.js.map +1 -1
- package/build/esm/ColorMode/color-vars.js +20 -12
- package/build/esm/ColorMode/color-vars.js.map +1 -1
- package/build/esm/ColorMode/constants.js +3 -3
- package/build/esm/ColorMode/constants.js.map +1 -1
- package/build/esm/Combobox/Combobox.d.ts +15 -15
- package/build/esm/Combobox/Combobox.js +51 -57
- package/build/esm/Combobox/Combobox.js.map +1 -1
- package/build/esm/Dialog/Dialog.d.ts +5 -5
- package/build/esm/Dialog/Dialog.js +22 -23
- package/build/esm/Dialog/Dialog.js.map +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +4 -4
- package/build/esm/Dialog/DialogBackdrop.js +10 -11
- package/build/esm/Dialog/DialogBackdrop.js.map +1 -1
- package/build/esm/Dialog/DialogContainer.d.ts +1 -1
- package/build/esm/Dialog/DialogContainer.js +4 -6
- package/build/esm/Dialog/DialogContainer.js.map +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +7 -5
- package/build/esm/Dialog/DialogSurface.js +24 -12
- package/build/esm/Dialog/DialogSurface.js.map +1 -1
- package/build/esm/Dialog/Scrim.d.ts +1 -1
- package/build/esm/Dialog/Scrim.js +4 -6
- package/build/esm/Dialog/Scrim.js.map +1 -1
- package/build/esm/Dialog/useDialogAnimation.js +19 -20
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +3 -3
- package/build/esm/Divider/Divider.js +9 -8
- package/build/esm/Divider/Divider.js.map +1 -1
- package/build/esm/FloatingLabel/FloatingLabel.d.ts +1 -1
- package/build/esm/FloatingLabel/FloatingLabel.js +26 -22
- package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +3 -3
- package/build/esm/LineRipple/LineRipple.js +27 -18
- package/build/esm/LineRipple/LineRipple.js.map +1 -1
- package/build/esm/Link/Link.d.ts +3 -3
- package/build/esm/Link/Link.js +10 -9
- package/build/esm/Link/Link.js.map +1 -1
- package/build/esm/List/List.d.ts +3 -3
- package/build/esm/List/List.js +20 -13
- package/build/esm/List/List.js.map +1 -1
- package/build/esm/ListItem/ListItem.d.ts +3 -3
- package/build/esm/ListItem/ListItem.js +72 -50
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/ListItem/ListItemText.d.ts +1 -1
- package/build/esm/ListItem/ListItemText.js +10 -15
- package/build/esm/ListItem/ListItemText.js.map +1 -1
- package/build/esm/Menu/Menu.d.ts +10 -10
- package/build/esm/Menu/Menu.js +23 -27
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/Menu/animation.d.ts +1 -1
- package/build/esm/Menu/animation.js +1 -1
- package/build/esm/Menu/animation.js.map +1 -1
- package/build/esm/NotchedOutline/NotchedOutline.d.ts +1 -1
- package/build/esm/NotchedOutline/NotchedOutline.js +25 -21
- package/build/esm/NotchedOutline/NotchedOutline.js.map +1 -1
- package/build/esm/NotchedOutline/context.js +6 -5
- package/build/esm/NotchedOutline/context.js.map +1 -1
- package/build/esm/NotchedOutline/styledComponents.d.ts +96 -50
- package/build/esm/NotchedOutline/styledComponents.js +58 -63
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Paper/Paper.d.ts +4 -3
- package/build/esm/Paper/Paper.js +15 -13
- package/build/esm/Paper/Paper.js.map +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.js +16 -16
- package/build/esm/ProgressSpinner/ProgressSpinner.js.map +1 -1
- package/build/esm/RadioButton/RadioButton.d.ts +1 -1
- package/build/esm/RadioButton/RadioButton.js +17 -20
- package/build/esm/RadioButton/RadioButton.js.map +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.d.ts +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.js +7 -8
- package/build/esm/RadioButton/RadioButtonIcon.js.map +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +3 -3
- package/build/esm/RadioButton/RadioGroup.js +5 -4
- package/build/esm/RadioButton/RadioGroup.js.map +1 -1
- package/build/esm/Ripple/Ripple.d.ts +1 -1
- package/build/esm/Ripple/Ripple.js +21 -20
- package/build/esm/Ripple/Ripple.js.map +1 -1
- package/build/esm/Ripple/RippleBox.d.ts +4 -4
- package/build/esm/Ripple/RippleBox.js +22 -15
- package/build/esm/Ripple/RippleBox.js.map +1 -1
- package/build/esm/Ripple/constants.js +7 -7
- package/build/esm/Ripple/constants.js.map +1 -1
- package/build/esm/Ripple/keyframes.d.ts +1 -1
- package/build/esm/Ripple/keyframes.js +3 -3
- package/build/esm/Ripple/keyframes.js.map +1 -1
- package/build/esm/Ripple/useRipple.js +55 -48
- package/build/esm/Ripple/useRipple.js.map +1 -1
- package/build/esm/Ripple/useRippleHandlers.d.ts +1 -1
- package/build/esm/Ripple/useRippleHandlers.js +13 -15
- package/build/esm/Ripple/useRippleHandlers.js.map +1 -1
- package/build/esm/Ripple/useRippleSurface.d.ts +6 -5
- package/build/esm/Ripple/useRippleSurface.js +60 -37
- package/build/esm/Ripple/useRippleSurface.js.map +1 -1
- package/build/esm/Select/Select.d.ts +4 -4
- package/build/esm/Select/Select.js +69 -47
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +3 -3
- package/build/esm/Select/SelectIcon.js +6 -7
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/Select/context.js +7 -6
- package/build/esm/Select/context.js.map +1 -1
- package/build/esm/Select/defaultRender.js +12 -10
- package/build/esm/Select/defaultRender.js.map +1 -1
- package/build/esm/Select/styledComponents.d.ts +2 -2
- package/build/esm/Select/styledComponents.js +16 -19
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +2 -2
- package/build/esm/SelectItem/SelectItem.js +18 -19
- package/build/esm/SelectItem/SelectItem.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +3 -3
- package/build/esm/SelectionControl/SelectionControlLabel.js +7 -7
- package/build/esm/SelectionControl/SelectionControlLabel.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +3 -3
- package/build/esm/SelectionControl/SelectionControlText.js +8 -8
- package/build/esm/SelectionControl/SelectionControlText.js.map +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +4 -4
- package/build/esm/Skeleton/DelayAppearance.js +9 -9
- package/build/esm/Skeleton/DelayAppearance.js.map +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +3 -3
- package/build/esm/Skeleton/Skeleton.js +11 -10
- package/build/esm/Skeleton/Skeleton.js.map +1 -1
- package/build/esm/Skeleton/animation.d.ts +2 -2
- package/build/esm/Skeleton/animation.js +25 -22
- package/build/esm/Skeleton/animation.js.map +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +3 -3
- package/build/esm/Snackbar/Snackbar.js +24 -24
- package/build/esm/Snackbar/Snackbar.js.map +1 -1
- package/build/esm/Snackbar/Stack.d.ts +2 -3
- package/build/esm/Snackbar/Stack.js +78 -65
- package/build/esm/Snackbar/Stack.js.map +1 -1
- package/build/esm/Snackbar/useSnackbarAnimation.d.ts +1 -1
- package/build/esm/Snackbar/useSnackbarAnimation.js +113 -78
- package/build/esm/Snackbar/useSnackbarAnimation.js.map +1 -1
- package/build/esm/Switch/Switch.d.ts +3 -3
- package/build/esm/Switch/Switch.js +29 -28
- package/build/esm/Switch/Switch.js.map +1 -1
- package/build/esm/Switch/styledComponents.d.ts +2 -2
- package/build/esm/Switch/styledComponents.js +66 -40
- package/build/esm/Switch/styledComponents.js.map +1 -1
- package/build/esm/Tab/Tab.d.ts +4 -4
- package/build/esm/Tab/Tab.js +17 -19
- package/build/esm/Tab/Tab.js.map +1 -1
- package/build/esm/Tab/TabList.d.ts +3 -3
- package/build/esm/Tab/TabList.js +18 -19
- package/build/esm/Tab/TabList.js.map +1 -1
- package/build/esm/Tab/TabPanel.d.ts +3 -3
- package/build/esm/Tab/TabPanel.js +8 -11
- package/build/esm/Tab/TabPanel.js.map +1 -1
- package/build/esm/Tab/context.js +6 -5
- package/build/esm/Tab/context.js.map +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +2 -2
- package/build/esm/TabIndicator/TabIndicator.js +22 -21
- package/build/esm/TabIndicator/TabIndicator.js.map +1 -1
- package/build/esm/TabIndicator/context.js +6 -5
- package/build/esm/TabIndicator/context.js.map +1 -1
- package/build/esm/Table/Table.d.ts +2 -2
- package/build/esm/Table/Table.js +8 -8
- package/build/esm/Table/Table.js.map +1 -1
- package/build/esm/Table/TableBody.d.ts +1 -1
- package/build/esm/Table/TableBody.js +4 -6
- package/build/esm/Table/TableBody.js.map +1 -1
- package/build/esm/Table/TableCell.d.ts +1 -1
- package/build/esm/Table/TableCell.js +6 -8
- package/build/esm/Table/TableCell.js.map +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableHead.js +5 -7
- package/build/esm/Table/TableHead.js.map +1 -1
- package/build/esm/Table/TableRow.d.ts +2 -2
- package/build/esm/Table/TableRow.js +5 -7
- package/build/esm/Table/TableRow.js.map +1 -1
- package/build/esm/Table/context.js +6 -5
- package/build/esm/Table/context.js.map +1 -1
- package/build/esm/Text/LoremIpsum.d.ts +1 -1
- package/build/esm/Text/LoremIpsum.js +6 -6
- package/build/esm/Text/LoremIpsum.js.map +1 -1
- package/build/esm/Text/Text.d.ts +3 -3
- package/build/esm/Text/Text.js +9 -9
- package/build/esm/Text/Text.js.map +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +3 -3
- package/build/esm/TextField/FilledContainer.js +61 -57
- package/build/esm/TextField/FilledContainer.js.map +1 -1
- package/build/esm/TextField/HelperText.d.ts +3 -3
- package/build/esm/TextField/HelperText.js +14 -13
- package/build/esm/TextField/HelperText.js.map +1 -1
- package/build/esm/TextField/IconContainer.d.ts +2 -2
- package/build/esm/TextField/IconContainer.js +15 -23
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/TextField/Input.d.ts +3 -3
- package/build/esm/TextField/Input.js +14 -14
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +4 -4
- package/build/esm/TextField/OutlinedContainer.js +28 -22
- package/build/esm/TextField/OutlinedContainer.js.map +1 -1
- package/build/esm/TextField/TextField.d.ts +4 -4
- package/build/esm/TextField/TextField.js +59 -41
- package/build/esm/TextField/TextField.js.map +1 -1
- package/build/esm/TextField/consts.js +5 -5
- package/build/esm/TextField/consts.js.map +1 -1
- package/build/esm/ThemeExplorer/ColorPicker.d.ts +4 -4
- package/build/esm/ThemeExplorer/ColorPicker.js +16 -16
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +2 -2
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +49 -29
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +1 -1
- package/build/esm/ThemeExplorer/ThemeColors.js +3 -3
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -1
- package/build/esm/ThemeExplorer/components.d.ts +2 -1
- package/build/esm/ThemeExplorer/components.js +64 -56
- package/build/esm/ThemeExplorer/components.js.map +1 -1
- package/build/esm/ThemeExplorer/makeColorScheme.d.ts +1 -1
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -1
- package/build/esm/ThemeExplorer/useDeferredColor.d.ts +1 -1
- package/build/esm/ThemeExplorer/useDeferredColor.js +10 -3
- package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -1
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +9 -2
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +3 -3
- package/build/esm/Tooltip/Tooltip.js +7 -8
- package/build/esm/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/color.d.ts +5 -4
- package/build/esm/color.js +26 -16
- package/build/esm/color.js.map +1 -1
- package/build/esm/hooks/useAnimation.d.ts +1 -1
- package/build/esm/hooks/useAnimation.js +54 -41
- package/build/esm/hooks/useAnimation.js.map +1 -1
- package/build/esm/theme/theme.d.ts +96 -50
- package/build/esm/theme/theme.js +134 -94
- package/build/esm/theme/theme.js.map +1 -1
- 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.js +1 -1
- package/build/esm/theme/typography-roboto.js.map +1 -1
- package/build/esm/theme/useTheme.d.ts +1 -1
- package/build/esm/theme/useTheme.js +1 -1
- package/build/esm/theme/useTheme.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -4
- package/src/Alert/Alert.tsx +4 -2
- package/src/AppBar/AppBar.story.tsx +7 -6
- package/src/AppBar/AppBar.tsx +10 -9
- package/src/AppBar/AppBarButton.tsx +3 -1
- package/src/AppBar/context.ts +2 -1
- package/src/Badge/Badge.tsx +3 -1
- package/src/BaseLine/BaseLine.tsx +15 -11
- package/src/BottomSheet/BottomSheet.story.tsx +1 -0
- package/src/BottomSheet/BottomSheet.tsx +2 -1
- package/src/BottomSheet/BottomSheetSurface.tsx +9 -5
- package/src/Box/Box.tsx +21 -18
- package/src/Button/BaseButton.tsx +5 -2
- package/src/Button/Button.story.tsx +35 -35
- package/src/Button/Button.tsx +23 -8
- package/src/Button/ButtonGroup.story.tsx +106 -0
- package/src/Button/ButtonGroup.tsx +35 -0
- package/src/Button/FilledButton.tsx +41 -6
- package/src/Button/FloatingActionButton.tsx +9 -0
- package/src/Button/IconButton.tsx +2 -1
- package/src/Button/OutlinedButton.tsx +33 -4
- package/src/Button/SpinnerButton.story.tsx +10 -11
- package/src/Button/TransparentButton.tsx +35 -4
- package/src/Button/context.tsx +17 -0
- package/src/Button/index.ts +1 -0
- package/src/CheckBox/CheckBox.story.tsx +3 -2
- package/src/CheckBox/CheckBox.tsx +10 -6
- package/src/CheckBox/CheckBoxIcon.tsx +4 -2
- package/src/Chip/ButtonChip.tsx +47 -51
- package/src/Chip/Chip.story.tsx +48 -27
- package/src/Chip/ChipBase.tsx +44 -14
- package/src/Chip/ChoiceChip.tsx +28 -24
- package/src/ColorMode/ColorModeProvider.tsx +4 -2
- package/src/Combobox/Combobox.story.tsx +2 -1
- package/src/Combobox/Combobox.tsx +30 -18
- package/src/Dialog/Dialog.story.tsx +3 -1
- package/src/Dialog/Dialog.tsx +9 -4
- package/src/Dialog/DialogBackdrop.tsx +6 -6
- package/src/Dialog/DialogContainer.tsx +3 -1
- package/src/Dialog/DialogSurface.tsx +26 -9
- package/src/Dialog/Scrim.tsx +3 -1
- package/src/Divider/Divider.tsx +4 -2
- package/src/FloatingLabel/FloatingLabel.story.tsx +1 -0
- package/src/FloatingLabel/FloatingLabel.tsx +3 -2
- package/src/LineRipple/LineRipple.story.tsx +1 -0
- package/src/LineRipple/LineRipple.tsx +6 -3
- package/src/Link/Link.tsx +4 -2
- package/src/List/List.tsx +5 -2
- package/src/ListItem/ListItem.story.tsx +1 -0
- package/src/ListItem/ListItem.tsx +59 -34
- package/src/ListItem/ListItemText.tsx +4 -5
- package/src/Menu/Menu.tsx +21 -14
- package/src/Menu/animation.ts +1 -1
- package/src/NotchedOutline/NotchedOutline.story.tsx +3 -2
- package/src/NotchedOutline/NotchedOutline.tsx +2 -1
- package/src/NotchedOutline/styledComponents.ts +8 -7
- package/src/Paper/Paper.story.tsx +17 -3
- package/src/Paper/Paper.tsx +22 -5
- package/src/ProgressSpinner/ProgressSpinner.story.tsx +1 -0
- package/src/ProgressSpinner/ProgressSpinner.tsx +5 -2
- package/src/RadioButton/RadioButton.story.tsx +2 -1
- package/src/RadioButton/RadioButton.tsx +10 -8
- package/src/RadioButton/RadioButtonIcon.tsx +4 -3
- package/src/RadioButton/RadioGroup.tsx +5 -5
- package/src/Ripple/Ripple.story.tsx +9 -3
- package/src/Ripple/Ripple.tsx +3 -2
- package/src/Ripple/RippleBox.tsx +9 -4
- package/src/Ripple/keyframes.ts +2 -1
- package/src/Ripple/useRipple.ts +1 -0
- package/src/Ripple/useRippleHandlers.ts +3 -1
- package/src/Ripple/useRippleSurface.ts +39 -13
- package/src/Select/PaymentMethodSelect.story.tsx +3 -1
- package/src/Select/Select.story.tsx +1 -0
- package/src/Select/Select.tsx +6 -4
- package/src/Select/SelectIcon.tsx +6 -3
- package/src/Select/defaultRender.ts +13 -13
- package/src/Select/styledComponents.tsx +5 -3
- package/src/SelectItem/SelectItem.tsx +4 -2
- package/src/SelectionControl/SelectionControlLabel.tsx +6 -3
- package/src/SelectionControl/SelectionControlText.tsx +4 -2
- package/src/Skeleton/DelayAppearance.tsx +5 -3
- package/src/Skeleton/Skeleton.story.tsx +2 -2
- package/src/Skeleton/Skeleton.tsx +4 -2
- package/src/Skeleton/animation.ts +3 -2
- package/src/Snackbar/Snackbar.story.tsx +1 -0
- package/src/Snackbar/Snackbar.tsx +8 -6
- package/src/Snackbar/Stack.tsx +3 -3
- package/src/Snackbar/useSnackbarAnimation.ts +3 -1
- package/src/Switch/Switch.tsx +16 -11
- package/src/Switch/styledComponents.tsx +72 -22
- package/src/Tab/Tab.tsx +8 -4
- package/src/Tab/TabList.tsx +5 -5
- package/src/Tab/TabPanel.tsx +5 -5
- package/src/TabIndicator/TabIndicator.tsx +6 -3
- package/src/Table/Table.tsx +5 -2
- package/src/Table/TableBody.tsx +3 -1
- package/src/Table/TableCell.tsx +3 -1
- package/src/Table/TableHead.tsx +4 -2
- package/src/Table/TableRow.tsx +4 -2
- package/src/Text/LoremIpsum.tsx +2 -1
- package/src/Text/Text.tsx +4 -2
- package/src/TextField/FilledContainer.tsx +13 -8
- package/src/TextField/HelperText.tsx +3 -2
- package/src/TextField/IconContainer.tsx +3 -2
- package/src/TextField/Input.tsx +9 -4
- package/src/TextField/OutlinedContainer.tsx +5 -3
- package/src/TextField/TextField.story.tsx +1 -0
- package/src/TextField/TextField.tsx +6 -3
- package/src/ThemeExplorer/ColorPicker.tsx +104 -0
- package/src/ThemeExplorer/TextFieldColorPicker.tsx +115 -0
- package/src/ThemeExplorer/ThemeBuilder.story.tsx +165 -0
- package/src/ThemeExplorer/ThemeColors.tsx +89 -0
- package/src/ThemeExplorer/ThemeExplorer.story.tsx +43 -0
- package/src/ThemeExplorer/components.tsx +195 -0
- package/src/ThemeExplorer/makeColorScheme.tsx +74 -0
- package/src/ThemeExplorer/useDeferredColor.tsx +25 -0
- package/src/ThemeExplorer/useLocalStorageCachedState.ts +18 -0
- package/src/Tooltip/Tooltip.story.tsx +1 -0
- package/src/Tooltip/Tooltip.tsx +8 -4
- package/src/color.ts +36 -29
- package/src/hooks/useAnimation.ts +2 -1
- package/src/theme/theme.ts +131 -92
- package/src/theme/useTheme.ts +3 -1
- package/src/ListItem/context.ts +0 -13
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { ButtonProps } from './Button';
|
|
4
|
+
import type { ButtonGroupContextProps } from './context';
|
|
5
|
+
import { ButtonGroupContext } from './context';
|
|
6
|
+
|
|
7
|
+
export type ButtonGroupProps = ButtonProps & ButtonGroupContextProps;
|
|
8
|
+
|
|
9
|
+
export const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
|
|
10
|
+
function ButtonGroup(props, forwardedRef) {
|
|
11
|
+
const {
|
|
12
|
+
as: Comp = 'div',
|
|
13
|
+
variant = 'text',
|
|
14
|
+
direction = 'row',
|
|
15
|
+
...otherProps
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
const value: ButtonGroupContextProps = useMemo(
|
|
19
|
+
() => ({ direction, variant }),
|
|
20
|
+
[direction, variant]
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<ButtonGroupContext.Provider value={value}>
|
|
25
|
+
<Comp
|
|
26
|
+
ref={forwardedRef}
|
|
27
|
+
role="group"
|
|
28
|
+
data-button-group=""
|
|
29
|
+
data-button-group-direction={direction}
|
|
30
|
+
{...otherProps}
|
|
31
|
+
/>
|
|
32
|
+
</ButtonGroupContext.Provider>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import { readableColor } from 'polished';
|
|
3
|
-
import { BaseButton } from './BaseButton';
|
|
4
|
-
import { Theme } from '../theme';
|
|
5
|
-
import { alpha, getDarkThemeBackgroundOverlay } from '../color';
|
|
2
|
+
import { readableColor, rem } from 'polished';
|
|
6
3
|
import { get, css } from '@styled-system/css';
|
|
7
4
|
|
|
5
|
+
import { BaseButton } from './BaseButton';
|
|
6
|
+
import type { Theme } from '../theme';
|
|
7
|
+
import { alpha, getBackgroundOverlay } from '../color';
|
|
8
|
+
|
|
8
9
|
export const FilledButton = styled(BaseButton)(
|
|
9
10
|
({ color = 'primary', theme }) =>
|
|
10
11
|
css({
|
|
@@ -21,13 +22,46 @@ export const FilledButton = styled(BaseButton)(
|
|
|
21
22
|
backgroundBlendMode: 'overlay',
|
|
22
23
|
cursor: 'default',
|
|
23
24
|
},
|
|
25
|
+
'&:focus-visible': {
|
|
26
|
+
outlineColor: get(theme, `colors.${String(color)}`) || color,
|
|
27
|
+
outlineWidth: 2,
|
|
28
|
+
outlineStyle: 'auto',
|
|
29
|
+
outlineOffset: '2px',
|
|
30
|
+
},
|
|
24
31
|
}),
|
|
25
32
|
({ color = 'primary', elevation = 'none', theme }) =>
|
|
26
33
|
color === 'surface' && {
|
|
27
|
-
...
|
|
34
|
+
...getBackgroundOverlay(
|
|
28
35
|
theme,
|
|
29
|
-
get(theme, `buttons.elevations.${elevation}.boxShadow`, 0)
|
|
36
|
+
get(theme, `buttons.elevations.${elevation}.boxShadow`, 0),
|
|
37
|
+
'primary'
|
|
30
38
|
),
|
|
39
|
+
},
|
|
40
|
+
({ color = 'primary', theme, isGroupedButton = false }) =>
|
|
41
|
+
isGroupedButton && {
|
|
42
|
+
'[data-button-group=""] &': {
|
|
43
|
+
borderColor:
|
|
44
|
+
get(theme, `colors.on.${String(color)}`) ||
|
|
45
|
+
(typeof color === 'string' ? readableColor(color) : undefined),
|
|
46
|
+
':first-of-type': {
|
|
47
|
+
borderTopRightRadius: 0,
|
|
48
|
+
borderBottomRightRadius: 0,
|
|
49
|
+
borderRightStyle: 'solid',
|
|
50
|
+
borderRightWidth: rem(1),
|
|
51
|
+
},
|
|
52
|
+
':not(:first-of-type):not(:last-of-type)': {
|
|
53
|
+
borderRadius: 0,
|
|
54
|
+
},
|
|
55
|
+
':last-of-type': {
|
|
56
|
+
borderTopLeftRadius: 0,
|
|
57
|
+
borderBottomLeftRadius: 0,
|
|
58
|
+
borderLeftStyle: 'solid',
|
|
59
|
+
borderLeftWidth: rem(1),
|
|
60
|
+
},
|
|
61
|
+
':last-of-type:nth-of-type(2)': {
|
|
62
|
+
borderLeftWidth: 0,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
31
65
|
}
|
|
32
66
|
);
|
|
33
67
|
|
|
@@ -36,5 +70,6 @@ export function getRippleProperties(theme: Theme) {
|
|
|
36
70
|
hoverOpacity: get(theme, `buttons.overlays.filled.hover.opacity`),
|
|
37
71
|
focusOpacity: get(theme, `buttons.overlays.filled.focus.opacity`),
|
|
38
72
|
pressedOpacity: get(theme, `buttons.overlays.filled.pressed.opacity`),
|
|
73
|
+
rippleEnabled: false,
|
|
39
74
|
};
|
|
40
75
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getRippleProperties as filledButtonGetProperties } from './FilledButton';
|
|
2
|
-
import { Theme } from '../theme';
|
|
2
|
+
import type { Theme } from '../theme';
|
|
3
3
|
|
|
4
4
|
export function getRippleProperties(theme: Theme) {
|
|
5
5
|
return {
|
|
6
6
|
...filledButtonGetProperties(theme),
|
|
7
7
|
center: true,
|
|
8
|
+
rippleEnabled: true,
|
|
8
9
|
};
|
|
9
10
|
}
|
|
@@ -1,18 +1,47 @@
|
|
|
1
|
-
import { TransparentButton } from './TransparentButton';
|
|
2
1
|
import styled from '@emotion/styled';
|
|
3
2
|
import { css } from '@styled-system/css';
|
|
4
|
-
import { alpha } from '../color';
|
|
5
3
|
import { rem } from 'polished';
|
|
6
4
|
|
|
5
|
+
import { alpha } from '../color';
|
|
6
|
+
import { TransparentButton } from './TransparentButton';
|
|
7
|
+
|
|
7
8
|
export const OutlinedButton = styled(TransparentButton)(
|
|
8
9
|
css({
|
|
9
10
|
borderStyle: 'solid',
|
|
10
11
|
borderWidth: rem(1),
|
|
11
|
-
borderColor:
|
|
12
|
+
borderColor: 'outline',
|
|
13
|
+
boxShadow: 0,
|
|
14
|
+
'&:focus,:&active,:&hover': { boxShadow: 0 },
|
|
15
|
+
'&:focus-visible,&:active': {
|
|
16
|
+
borderColor: 'currentColor',
|
|
17
|
+
},
|
|
12
18
|
'&:disabled': {
|
|
13
19
|
color: alpha('on.surface', 0.38),
|
|
14
20
|
borderColor: alpha('on.surface', 0.12),
|
|
15
21
|
cursor: 'default',
|
|
16
22
|
},
|
|
17
|
-
})
|
|
23
|
+
}),
|
|
24
|
+
({ isGroupedButton = false }) =>
|
|
25
|
+
isGroupedButton && {
|
|
26
|
+
'[data-button-group=""] &': {
|
|
27
|
+
':first-of-type': {
|
|
28
|
+
borderTopRightRadius: 0,
|
|
29
|
+
borderBottomRightRadius: 0,
|
|
30
|
+
},
|
|
31
|
+
':not(:first-of-type):not(:last-of-type)': {
|
|
32
|
+
borderRadius: 0,
|
|
33
|
+
borderRightWidth: 0,
|
|
34
|
+
borderLeftWidth: 0,
|
|
35
|
+
},
|
|
36
|
+
':last-of-type': {
|
|
37
|
+
borderTopLeftRadius: 0,
|
|
38
|
+
borderBottomLeftRadius: 0,
|
|
39
|
+
borderLeftStyle: 'solid',
|
|
40
|
+
borderLeftWidth: rem(1),
|
|
41
|
+
},
|
|
42
|
+
':last-of-type:nth-of-type(2)': {
|
|
43
|
+
borderLeftWidth: 0,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}
|
|
18
47
|
);
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import type { SpinnerProps, SpinnerButtonProps } from '@basic-ui/core';
|
|
2
4
|
import {
|
|
3
5
|
Spinner as SpinnerBase,
|
|
4
6
|
SpinnerButton as SpinnerButtonBase,
|
|
5
|
-
SpinnerProps,
|
|
6
|
-
SpinnerButtonProps,
|
|
7
7
|
} from '@basic-ui/core';
|
|
8
|
+
|
|
8
9
|
import { Button, Box, Text } from '../';
|
|
9
10
|
import { alpha } from '../color';
|
|
10
11
|
import { useTheme } from '../theme';
|
|
11
|
-
import { BoxProps } from '../Box';
|
|
12
|
+
import type { BoxProps } from '../Box';
|
|
12
13
|
|
|
13
14
|
export default {
|
|
14
15
|
title: 'components/SpinnerButton',
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
const Spinner: FC<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
BoxProps & SpinnerButtonProps
|
|
22
|
-
> = SpinnerButtonBase as any;
|
|
18
|
+
const Spinner: FC<Omit<BoxProps, 'onChange'> & SpinnerProps> =
|
|
19
|
+
SpinnerBase as any;
|
|
20
|
+
const SpinnerButton: FC<BoxProps & SpinnerButtonProps> =
|
|
21
|
+
SpinnerButtonBase as any;
|
|
23
22
|
|
|
24
23
|
function AddIcon(props) {
|
|
25
24
|
return (
|
|
@@ -54,7 +53,7 @@ const Example = ({ vertical = false }) => {
|
|
|
54
53
|
display: 'inline-flex',
|
|
55
54
|
alignItems: 'center',
|
|
56
55
|
flexDirection: vertical ? 'column-reverse' : 'row',
|
|
57
|
-
borderRadius: '
|
|
56
|
+
borderRadius: 'full',
|
|
58
57
|
'&:focus': {
|
|
59
58
|
outline: 'none',
|
|
60
59
|
boxShadow: `0px 0px 10px 0px ${alpha('primary', 0.6)(theme)}`,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import { get } from '@styled-system/css';
|
|
2
|
+
import { get, css } from '@styled-system/css';
|
|
3
|
+
import { rem } from 'polished';
|
|
4
|
+
|
|
3
5
|
import { BaseButton } from './BaseButton';
|
|
4
|
-
import { Theme } from '../theme';
|
|
5
|
-
import { css } from '@styled-system/css';
|
|
6
|
+
import type { Theme } from '../theme';
|
|
6
7
|
import { alpha } from '../color';
|
|
7
8
|
|
|
8
9
|
export const TransparentButton = styled(BaseButton)(
|
|
@@ -14,7 +15,36 @@ export const TransparentButton = styled(BaseButton)(
|
|
|
14
15
|
color: alpha('on.surface', 0.38),
|
|
15
16
|
cursor: 'default',
|
|
16
17
|
},
|
|
17
|
-
|
|
18
|
+
'&:focus-visible': {
|
|
19
|
+
outline: 'none',
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
({ theme, color = 'primary', isGroupedButton = false }) =>
|
|
23
|
+
isGroupedButton && {
|
|
24
|
+
'[data-button-group=""] &': {
|
|
25
|
+
borderColor:
|
|
26
|
+
get(theme, `colors.${String(color)}`) ||
|
|
27
|
+
(typeof color === 'string' ? color : undefined),
|
|
28
|
+
':first-of-type': {
|
|
29
|
+
borderTopRightRadius: 0,
|
|
30
|
+
borderBottomRightRadius: 0,
|
|
31
|
+
borderRightStyle: 'solid',
|
|
32
|
+
borderRightWidth: rem(1),
|
|
33
|
+
},
|
|
34
|
+
':not(:first-of-type):not(:last-of-type)': {
|
|
35
|
+
borderRadius: 0,
|
|
36
|
+
},
|
|
37
|
+
':last-of-type': {
|
|
38
|
+
borderTopLeftRadius: 0,
|
|
39
|
+
borderBottomLeftRadius: 0,
|
|
40
|
+
borderLeftStyle: 'solid',
|
|
41
|
+
borderLeftWidth: rem(1),
|
|
42
|
+
},
|
|
43
|
+
':last-of-type:nth-of-type(2)': {
|
|
44
|
+
borderLeftWidth: 0,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
}
|
|
18
48
|
);
|
|
19
49
|
|
|
20
50
|
export function getRippleProperties(theme: Theme) {
|
|
@@ -22,5 +52,6 @@ export function getRippleProperties(theme: Theme) {
|
|
|
22
52
|
hoverOpacity: get(theme, `buttons.overlays.transparent.hover.opacity`),
|
|
23
53
|
focusOpacity: get(theme, `buttons.overlays.transparent.focus.opacity`),
|
|
24
54
|
pressedOpacity: get(theme, `buttons.overlays.transparent.pressed.opacity`),
|
|
55
|
+
rippleEnabled: false,
|
|
25
56
|
};
|
|
26
57
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { ButtonProps } from './Button';
|
|
4
|
+
|
|
5
|
+
// ButtonGroup Component
|
|
6
|
+
export type ButtonGroupContextProps = {
|
|
7
|
+
variant?: ButtonProps['variant'];
|
|
8
|
+
direction?: 'row' | 'column';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const ButtonGroupContext = createContext<ButtonGroupContextProps | null>(
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
ButtonGroupContext.displayName = 'ButtonGroupContext';
|
|
15
|
+
|
|
16
|
+
export const useButtonGroupContext = (): ButtonGroupContextProps | null =>
|
|
17
|
+
useContext(ButtonGroupContext);
|
package/src/Button/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useState, useRef } from 'react';
|
|
2
|
-
import { CheckBox, Box } from '../';
|
|
3
2
|
import { keyframes } from '@emotion/react';
|
|
4
|
-
import { Keyframes } from '@emotion/serialize';
|
|
3
|
+
import type { Keyframes } from '@emotion/serialize';
|
|
4
|
+
|
|
5
|
+
import { CheckBox, Box } from '../';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: 'components/CheckBox',
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Box, BoxProps } from '../Box';
|
|
5
|
-
import { useTheme } from '../theme';
|
|
1
|
+
import type { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { forwardRef, cloneElement } from 'react';
|
|
3
|
+
import * as React from 'react';
|
|
6
4
|
import { rem } from 'polished';
|
|
7
5
|
import { CheckBox as _CheckBoxCore } from '@basic-ui/core';
|
|
6
|
+
|
|
7
|
+
import type { RippleBoxProps } from '../Ripple';
|
|
8
|
+
import { RippleBox } from '../Ripple';
|
|
9
|
+
import type { BoxProps } from '../Box';
|
|
10
|
+
import { Box } from '../Box';
|
|
11
|
+
import { useTheme } from '../theme';
|
|
8
12
|
import { CheckBoxIcon } from './CheckBoxIcon';
|
|
9
13
|
import {
|
|
10
14
|
SelectionControlLabel,
|
|
@@ -98,7 +102,7 @@ const CheckBoxInner = forwardRef<HTMLInputElement, CheckBoxProps>(
|
|
|
98
102
|
outline: 'none',
|
|
99
103
|
},
|
|
100
104
|
border: 'none',
|
|
101
|
-
borderRadius: '
|
|
105
|
+
borderRadius: 'full',
|
|
102
106
|
zIndex: 1,
|
|
103
107
|
position: 'absolute',
|
|
104
108
|
...__css,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { Box, BoxProps } from '../Box';
|
|
2
|
+
import * as React from 'react';
|
|
4
3
|
import { rem } from 'polished';
|
|
4
|
+
|
|
5
|
+
import type { BoxProps } from '../Box';
|
|
6
|
+
import { Box } from '../Box';
|
|
5
7
|
import { CheckPath } from './CheckPath';
|
|
6
8
|
import { IndeterminatePath } from './IndeterminatePath';
|
|
7
9
|
|
package/src/Chip/ButtonChip.tsx
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { rem } from 'polished';
|
|
4
|
+
|
|
5
|
+
import type { ChipBaseProps } from './ChipBase';
|
|
6
|
+
import { ChipBase } from './ChipBase';
|
|
4
7
|
import { RippleBox } from '../Ripple';
|
|
5
8
|
import { useTheme } from '../theme';
|
|
6
|
-
import { Box } from '../Box';
|
|
7
|
-
import { rem } from 'polished';
|
|
8
9
|
|
|
9
10
|
export type ButtonChipProps = ChipBaseProps & {
|
|
10
11
|
checked?: boolean;
|
|
11
12
|
disabled?: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
leadingIcon?: React.ReactNode;
|
|
14
|
+
trailingIcon?: React.ReactNode;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
|
|
17
18
|
function ButtonChip(props, forwardedRef) {
|
|
18
19
|
const {
|
|
19
|
-
as = '
|
|
20
|
+
as = 'div',
|
|
20
21
|
onClick,
|
|
21
22
|
disabled: disabledProp,
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
leadingIcon,
|
|
24
|
+
trailingIcon,
|
|
24
25
|
children,
|
|
26
|
+
color,
|
|
27
|
+
__css,
|
|
25
28
|
...otherProps
|
|
26
29
|
} = props;
|
|
27
30
|
|
|
@@ -30,60 +33,53 @@ export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
|
|
|
30
33
|
|
|
31
34
|
return (
|
|
32
35
|
<ChipBase
|
|
33
|
-
as="
|
|
36
|
+
as="div"
|
|
34
37
|
onClick={isClickable ? onClick : undefined}
|
|
35
38
|
disabled={disabledProp}
|
|
39
|
+
color="on.surface"
|
|
40
|
+
backgroundColor="surface"
|
|
41
|
+
__css={__css}
|
|
36
42
|
{...otherProps}
|
|
37
43
|
>
|
|
38
|
-
<
|
|
39
|
-
as=
|
|
44
|
+
<RippleBox
|
|
45
|
+
as={as}
|
|
46
|
+
role={isClickable ? 'button' : undefined}
|
|
47
|
+
tabIndex={isClickable ? 0 : undefined}
|
|
48
|
+
theme={theme}
|
|
49
|
+
ref={forwardedRef}
|
|
50
|
+
rippleColor={'currentColor'}
|
|
51
|
+
baseOpacity={0}
|
|
52
|
+
hoverOpacity={0.12}
|
|
53
|
+
focusOpacity={0.24}
|
|
54
|
+
center={false}
|
|
55
|
+
disabled={!isClickable}
|
|
56
|
+
aria-disabled={!isClickable}
|
|
40
57
|
__css={{
|
|
58
|
+
bg: 'transparent',
|
|
59
|
+
color: 'inherit',
|
|
60
|
+
padding: `0`,
|
|
61
|
+
pl: leadingIcon ? rem(8) : rem(12),
|
|
62
|
+
pr: trailingIcon ? rem(8) : rem(12),
|
|
63
|
+
gap: rem(8),
|
|
41
64
|
width: '100%',
|
|
65
|
+
minWidth: 'auto',
|
|
42
66
|
height: '100%',
|
|
67
|
+
appearance: 'none',
|
|
68
|
+
':focus': {
|
|
69
|
+
outline: 'none',
|
|
70
|
+
},
|
|
43
71
|
border: 'none',
|
|
72
|
+
borderRadius: 0,
|
|
73
|
+
position: 'relative',
|
|
44
74
|
display: 'inline-flex',
|
|
45
75
|
alignItems: 'center',
|
|
46
|
-
|
|
76
|
+
cursor: isClickable ? 'pointer' : 'default',
|
|
47
77
|
}}
|
|
48
78
|
>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
rippleColor={'currentColor'}
|
|
54
|
-
baseOpacity={0}
|
|
55
|
-
hoverOpacity={0.12}
|
|
56
|
-
focusOpacity={0.24}
|
|
57
|
-
center={false}
|
|
58
|
-
disabled={!isClickable}
|
|
59
|
-
aria-disabled={!isClickable}
|
|
60
|
-
__css={{
|
|
61
|
-
backgroundColor: 'rgba(0,0,0,0)',
|
|
62
|
-
top: 0,
|
|
63
|
-
left: 0,
|
|
64
|
-
width: '100%',
|
|
65
|
-
height: '100%',
|
|
66
|
-
appearance: 'none',
|
|
67
|
-
':focus': {
|
|
68
|
-
outline: 'none',
|
|
69
|
-
},
|
|
70
|
-
border: 'none',
|
|
71
|
-
borderRadius: 0,
|
|
72
|
-
position: 'absolute',
|
|
73
|
-
color: 'inherit',
|
|
74
|
-
cursor: isClickable ? 'pointer' : 'default',
|
|
75
|
-
}}
|
|
76
|
-
/>
|
|
77
|
-
<Box as="span" pl={rem(4)} pr={rem(8)}>
|
|
78
|
-
{leftIcon}
|
|
79
|
-
</Box>
|
|
80
|
-
<Box as="span" __css={{ minWidth: 'auto', whiteSpace: 'nowrap' }}>
|
|
81
|
-
{children}
|
|
82
|
-
</Box>
|
|
83
|
-
<Box as="span" pl={rem(6)} pr={rem(6)}>
|
|
84
|
-
{rightIcon}
|
|
85
|
-
</Box>
|
|
86
|
-
</Box>
|
|
79
|
+
{leadingIcon}
|
|
80
|
+
{children}
|
|
81
|
+
{trailingIcon}
|
|
82
|
+
</RippleBox>
|
|
87
83
|
</ChipBase>
|
|
88
84
|
);
|
|
89
85
|
}
|
package/src/Chip/Chip.story.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Chip } from './';
|
|
2
2
|
import { Box } from '../Box';
|
|
3
3
|
import { Text } from '../Text';
|
|
4
|
-
import { alpha } from '../color';
|
|
5
4
|
import { RadioGroup } from '../RadioButton';
|
|
6
5
|
import { ChoiceChip } from './ChoiceChip';
|
|
7
6
|
import { LoremIpsum } from '../Text/LoremIpsum';
|
|
@@ -12,15 +11,14 @@ export default {
|
|
|
12
11
|
|
|
13
12
|
const CloseIcon = (props) => (
|
|
14
13
|
<Box
|
|
14
|
+
role="button"
|
|
15
|
+
tabIndex={0}
|
|
15
16
|
display="flex"
|
|
16
17
|
width={20}
|
|
17
18
|
height={20}
|
|
18
|
-
borderRadius="50%"
|
|
19
19
|
alignItems="center"
|
|
20
20
|
justifyContent="center"
|
|
21
21
|
sx={{
|
|
22
|
-
bg: alpha('on.surface', 0.24),
|
|
23
|
-
color: alpha('surface', 0.6),
|
|
24
22
|
'& > svg': { display: 'block' },
|
|
25
23
|
}}
|
|
26
24
|
>
|
|
@@ -39,11 +37,12 @@ const LeftIcon = ({ color }) => (
|
|
|
39
37
|
display="flex"
|
|
40
38
|
width={24}
|
|
41
39
|
height={24}
|
|
42
|
-
borderRadius="
|
|
40
|
+
borderRadius="full"
|
|
43
41
|
alignItems="center"
|
|
44
42
|
justifyContent="center"
|
|
45
43
|
bg={color}
|
|
46
44
|
color={`on.${color}`}
|
|
45
|
+
ml="-4px"
|
|
47
46
|
>
|
|
48
47
|
L
|
|
49
48
|
</Box>
|
|
@@ -59,34 +58,38 @@ const Example = ({ variant, color = 'default' }) => {
|
|
|
59
58
|
<Text variant="h6" mb={2}>
|
|
60
59
|
Variant: {variant}, Color: {color}
|
|
61
60
|
</Text>
|
|
62
|
-
<Box my={2}>
|
|
61
|
+
<Box my={2} display="flex" sx={{ gap: 2 }}>
|
|
63
62
|
<Text as="span" mr={2}>
|
|
64
63
|
Non clickable
|
|
65
64
|
</Text>
|
|
66
|
-
<Chip variant={variant}
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
<Chip variant={variant} color={color}>
|
|
66
|
+
Buy now
|
|
67
|
+
</Chip>
|
|
68
|
+
<Chip variant={variant} color={color}>
|
|
69
|
+
Close door
|
|
70
|
+
</Chip>
|
|
71
|
+
<Chip variant={variant} disabled color={color}>
|
|
69
72
|
Nothing
|
|
70
73
|
</Chip>
|
|
71
74
|
</Box>
|
|
72
|
-
<Box my={2}>
|
|
75
|
+
<Box my={2} display="flex" sx={{ gap: 2 }}>
|
|
73
76
|
<Text as="span" mr={2}>
|
|
74
77
|
Button
|
|
75
78
|
</Text>
|
|
76
|
-
<Chip variant={variant} onClick={noop}>
|
|
79
|
+
<Chip variant={variant} onClick={noop} color={color}>
|
|
77
80
|
John
|
|
78
81
|
</Chip>
|
|
79
|
-
<Chip variant={variant} onClick={noop}>
|
|
82
|
+
<Chip variant={variant} onClick={noop} color={color}>
|
|
80
83
|
Max
|
|
81
84
|
</Chip>
|
|
82
|
-
<Chip variant={variant} onClick={noop}>
|
|
85
|
+
<Chip variant={variant} onClick={noop} color={color}>
|
|
83
86
|
Jane
|
|
84
87
|
</Chip>
|
|
85
|
-
<Chip variant={variant} onClick={noop} disabled>
|
|
88
|
+
<Chip variant={variant} onClick={noop} disabled color={color}>
|
|
86
89
|
Off
|
|
87
90
|
</Chip>
|
|
88
91
|
</Box>
|
|
89
|
-
<Box my={2}>
|
|
92
|
+
<Box my={2} display="flex" sx={{ gap: 2 }}>
|
|
90
93
|
<Text as="span" mr={2}>
|
|
91
94
|
CheckBox
|
|
92
95
|
</Text>
|
|
@@ -103,7 +106,12 @@ const Example = ({ variant, color = 'default' }) => {
|
|
|
103
106
|
Disabled
|
|
104
107
|
</ChoiceChip>
|
|
105
108
|
</Box>
|
|
106
|
-
<RadioGroup
|
|
109
|
+
<RadioGroup
|
|
110
|
+
name={`test-radio-${variant}-${color}`}
|
|
111
|
+
my={2}
|
|
112
|
+
display="flex"
|
|
113
|
+
sx={{ gap: 2 }}
|
|
114
|
+
>
|
|
107
115
|
<Text as="span" mr={2}>
|
|
108
116
|
RadioGroup
|
|
109
117
|
</Text>
|
|
@@ -126,21 +134,21 @@ const Example = ({ variant, color = 'default' }) => {
|
|
|
126
134
|
Disabled
|
|
127
135
|
</ChoiceChip>
|
|
128
136
|
</RadioGroup>
|
|
129
|
-
<Box my={2} display="flex">
|
|
137
|
+
<Box my={2} display="flex" sx={{ gap: 2 }}>
|
|
130
138
|
<Text as="span" mr={2}>
|
|
131
139
|
With icons
|
|
132
140
|
</Text>
|
|
133
141
|
<Chip variant={variant}>Hello please</Chip>
|
|
134
|
-
<Chip variant={variant}
|
|
142
|
+
<Chip variant={variant} leadingIcon={<LeftIcon color={color} />}>
|
|
135
143
|
Hello please
|
|
136
144
|
</Chip>
|
|
137
|
-
<Chip variant={variant}
|
|
145
|
+
<Chip variant={variant} trailingIcon={<CloseIcon />}>
|
|
138
146
|
Hello please
|
|
139
147
|
</Chip>
|
|
140
148
|
<Chip
|
|
141
149
|
variant={variant}
|
|
142
|
-
|
|
143
|
-
|
|
150
|
+
leadingIcon={<LeftIcon color={color} />}
|
|
151
|
+
trailingIcon={<CloseIcon />}
|
|
144
152
|
>
|
|
145
153
|
Hello please
|
|
146
154
|
</Chip>
|
|
@@ -192,26 +200,39 @@ export const HorizontallyScrollableExample = () => {
|
|
|
192
200
|
borderColor: '#aeaeae',
|
|
193
201
|
borderWidth: '1px',
|
|
194
202
|
borderStyle: 'solid',
|
|
203
|
+
scrollbarWidth: 'none',
|
|
204
|
+
MsOverflowStyle: 'none',
|
|
205
|
+
'::-webkit-scrollbar': {
|
|
206
|
+
display: 'none',
|
|
207
|
+
},
|
|
195
208
|
}}
|
|
196
209
|
>
|
|
197
|
-
<
|
|
210
|
+
<RadioGroup
|
|
198
211
|
sx={{
|
|
199
212
|
px: 3,
|
|
200
213
|
display: 'flex',
|
|
201
214
|
minWidth: 'auto',
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
'& > :not(first-of-type)': {
|
|
215
|
+
overflow: 'visible',
|
|
216
|
+
'& > :not(:first-of-type)': {
|
|
205
217
|
marginLeft: 2,
|
|
206
218
|
},
|
|
207
219
|
}}
|
|
208
220
|
>
|
|
209
221
|
{texts.map((text) => (
|
|
210
222
|
<Box key={text} sx={{ minWidth: 'auto' }}>
|
|
211
|
-
<
|
|
223
|
+
<ChoiceChip
|
|
224
|
+
type="radio"
|
|
225
|
+
value={text}
|
|
226
|
+
key={text}
|
|
227
|
+
onClick={() => {
|
|
228
|
+
/* noop */
|
|
229
|
+
}}
|
|
230
|
+
>
|
|
231
|
+
{text}
|
|
232
|
+
</ChoiceChip>
|
|
212
233
|
</Box>
|
|
213
234
|
))}
|
|
214
|
-
</
|
|
235
|
+
</RadioGroup>
|
|
215
236
|
</Box>
|
|
216
237
|
<Box>
|
|
217
238
|
<LoremIpsum count={20} />
|