@basic-ui/material 0.1.13 → 1.0.0-alpha.0
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 +634 -371
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +1 -1
- package/build/esm/Alert/Alert.js +1 -1
- package/build/esm/Alert/Alert.js.map +1 -1
- package/build/esm/Alert/index.d.ts +0 -0
- package/build/esm/Alert/index.js.map +0 -0
- package/build/esm/AppBar/AppBar.d.ts +1 -1
- package/build/esm/AppBar/AppBar.js +1 -2
- package/build/esm/AppBar/AppBar.js.map +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +1 -1
- package/build/esm/AppBar/AppBarButton.js.map +0 -0
- package/build/esm/AppBar/context.d.ts +0 -0
- package/build/esm/AppBar/context.js.map +0 -0
- package/build/esm/AppBar/index.d.ts +0 -0
- package/build/esm/AppBar/index.js.map +0 -0
- package/build/esm/Badge/Badge.d.ts +1 -1
- package/build/esm/Badge/Badge.js.map +0 -0
- package/build/esm/Badge/index.d.ts +0 -0
- package/build/esm/Badge/index.js.map +0 -0
- package/build/esm/BaseLine/BaseLine.d.ts +0 -1
- package/build/esm/BaseLine/BaseLine.js.map +0 -0
- package/build/esm/BaseLine/index.d.ts +0 -0
- package/build/esm/BaseLine/index.js.map +0 -0
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheet.js.map +0 -0
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.js +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.js.map +1 -1
- package/build/esm/BottomSheet/index.d.ts +0 -0
- package/build/esm/BottomSheet/index.js.map +0 -0
- package/build/esm/Box/Box.d.ts +0 -0
- package/build/esm/Box/Box.js.map +0 -0
- package/build/esm/Box/index.d.ts +0 -0
- package/build/esm/Box/index.js.map +0 -0
- package/build/esm/Button/BaseButton.d.ts +2 -1
- package/build/esm/Button/BaseButton.js.map +1 -1
- package/build/esm/Button/Button.d.ts +3 -3
- package/build/esm/Button/Button.js +22 -6
- package/build/esm/Button/Button.js.map +1 -1
- package/build/esm/Button/ButtonGroup.d.ts +5 -0
- package/build/esm/Button/ButtonGroup.js +28 -0
- package/build/esm/Button/ButtonGroup.js.map +1 -0
- package/build/esm/Button/FilledButton.d.ts +2 -1
- package/build/esm/Button/FilledButton.js +36 -3
- package/build/esm/Button/FilledButton.js.map +1 -1
- package/build/esm/Button/IconButton.d.ts +1 -0
- 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 +32 -2
- package/build/esm/Button/OutlinedButton.js.map +1 -1
- package/build/esm/Button/TransparentButton.d.ts +2 -1
- package/build/esm/Button/TransparentButton.js +32 -2
- package/build/esm/Button/TransparentButton.js.map +1 -1
- package/build/esm/Button/context.d.ts +8 -0
- package/build/esm/Button/context.js +5 -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 +1 -1
- package/build/esm/CheckBox/CheckBox.js +1 -1
- package/build/esm/CheckBox/CheckBox.js.map +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.js.map +0 -0
- package/build/esm/CheckBox/CheckPath.d.ts +0 -0
- package/build/esm/CheckBox/CheckPath.js.map +0 -0
- package/build/esm/CheckBox/IndeterminatePath.d.ts +0 -0
- package/build/esm/CheckBox/IndeterminatePath.js.map +0 -0
- package/build/esm/CheckBox/index.d.ts +0 -0
- package/build/esm/CheckBox/index.js.map +0 -0
- package/build/esm/Chip/ButtonChip.d.ts +3 -3
- package/build/esm/Chip/ButtonChip.js +41 -53
- package/build/esm/Chip/ButtonChip.js.map +1 -1
- package/build/esm/Chip/Chip.d.ts +0 -0
- package/build/esm/Chip/Chip.js.map +0 -0
- package/build/esm/Chip/ChipBase.d.ts +1 -1
- package/build/esm/Chip/ChipBase.js +23 -15
- package/build/esm/Chip/ChipBase.js.map +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +3 -2
- package/build/esm/Chip/ChoiceChip.js +18 -24
- package/build/esm/Chip/ChoiceChip.js.map +1 -1
- package/build/esm/Chip/index.d.ts +0 -0
- package/build/esm/Chip/index.js.map +0 -0
- package/build/esm/ColorMode/ColorModeProvider.d.ts +0 -0
- package/build/esm/ColorMode/ColorModeProvider.js.map +0 -0
- package/build/esm/ColorMode/color-mode.d.ts +0 -0
- package/build/esm/ColorMode/color-mode.js.map +0 -0
- package/build/esm/ColorMode/color-vars.d.ts +0 -0
- package/build/esm/ColorMode/color-vars.js.map +0 -0
- package/build/esm/ColorMode/constants.d.ts +0 -0
- package/build/esm/ColorMode/constants.js.map +0 -0
- package/build/esm/ColorMode/index.d.ts +0 -0
- package/build/esm/ColorMode/index.js.map +0 -0
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- package/build/esm/Combobox/Combobox.js +2 -1
- package/build/esm/Combobox/Combobox.js.map +1 -1
- package/build/esm/Combobox/index.d.ts +0 -0
- package/build/esm/Combobox/index.js.map +0 -0
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/Dialog.js.map +0 -0
- package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.js.map +0 -0
- package/build/esm/Dialog/DialogContainer.d.ts +1 -1
- package/build/esm/Dialog/DialogContainer.js.map +0 -0
- package/build/esm/Dialog/DialogSurface.d.ts +4 -2
- package/build/esm/Dialog/DialogSurface.js +19 -7
- package/build/esm/Dialog/DialogSurface.js.map +1 -1
- package/build/esm/Dialog/Scrim.d.ts +1 -1
- package/build/esm/Dialog/Scrim.js.map +0 -0
- package/build/esm/Dialog/index.d.ts +0 -0
- package/build/esm/Dialog/index.js.map +0 -0
- package/build/esm/Dialog/useDialogAnimation.d.ts +0 -0
- package/build/esm/Dialog/useDialogAnimation.js.map +0 -0
- package/build/esm/Divider/Divider.d.ts +1 -1
- package/build/esm/Divider/Divider.js.map +0 -0
- package/build/esm/Divider/index.d.ts +0 -0
- package/build/esm/Divider/index.js.map +0 -0
- package/build/esm/FloatingLabel/FloatingLabel.d.ts +0 -1
- package/build/esm/FloatingLabel/FloatingLabel.js +1 -3
- package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
- package/build/esm/FloatingLabel/index.d.ts +0 -0
- package/build/esm/FloatingLabel/index.js.map +0 -0
- package/build/esm/LineRipple/LineRipple.d.ts +1 -1
- package/build/esm/LineRipple/LineRipple.js.map +0 -0
- package/build/esm/LineRipple/index.d.ts +0 -0
- package/build/esm/LineRipple/index.js.map +0 -0
- package/build/esm/Link/Link.d.ts +1 -1
- package/build/esm/Link/Link.js.map +0 -0
- package/build/esm/Link/index.d.ts +0 -0
- package/build/esm/Link/index.js.map +0 -0
- package/build/esm/List/List.d.ts +1 -1
- package/build/esm/List/List.js.map +0 -0
- package/build/esm/List/index.d.ts +0 -0
- package/build/esm/List/index.js.map +0 -0
- package/build/esm/ListItem/ListItem.d.ts +1 -1
- package/build/esm/ListItem/ListItem.js +52 -33
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/ListItem/ListItemText.d.ts +0 -0
- package/build/esm/ListItem/ListItemText.js +2 -7
- package/build/esm/ListItem/ListItemText.js.map +1 -1
- package/build/esm/ListItem/context.d.ts +0 -0
- package/build/esm/ListItem/context.js.map +0 -0
- package/build/esm/ListItem/index.d.ts +0 -0
- package/build/esm/ListItem/index.js.map +0 -0
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/Menu/Menu.js +2 -2
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/Menu/animation.d.ts +0 -0
- package/build/esm/Menu/animation.js.map +0 -0
- package/build/esm/Menu/index.d.ts +0 -0
- package/build/esm/Menu/index.js.map +0 -0
- package/build/esm/NotchedOutline/NotchedOutline.d.ts +0 -0
- package/build/esm/NotchedOutline/NotchedOutline.js.map +0 -0
- package/build/esm/NotchedOutline/context.d.ts +0 -0
- package/build/esm/NotchedOutline/context.js.map +0 -0
- package/build/esm/NotchedOutline/index.d.ts +0 -0
- package/build/esm/NotchedOutline/index.js.map +0 -0
- package/build/esm/NotchedOutline/styledComponents.d.ts +96 -50
- package/build/esm/NotchedOutline/styledComponents.js +7 -7
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Paper/Paper.d.ts +1 -1
- package/build/esm/Paper/Paper.js +2 -2
- package/build/esm/Paper/Paper.js.map +1 -1
- package/build/esm/Paper/index.d.ts +0 -0
- package/build/esm/Paper/index.js.map +0 -0
- package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.js.map +0 -0
- package/build/esm/ProgressSpinner/index.d.ts +0 -0
- package/build/esm/ProgressSpinner/index.js.map +0 -0
- package/build/esm/RadioButton/RadioButton.d.ts +0 -0
- package/build/esm/RadioButton/RadioButton.js +1 -1
- package/build/esm/RadioButton/RadioButton.js.map +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.d.ts +0 -0
- package/build/esm/RadioButton/RadioButtonIcon.js +2 -2
- package/build/esm/RadioButton/RadioButtonIcon.js.map +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/RadioButton/RadioGroup.js.map +0 -0
- package/build/esm/RadioButton/index.d.ts +0 -0
- package/build/esm/RadioButton/index.js.map +0 -0
- package/build/esm/Ripple/Ripple.d.ts +0 -0
- package/build/esm/Ripple/Ripple.js +2 -2
- package/build/esm/Ripple/Ripple.js.map +1 -1
- package/build/esm/Ripple/RippleBox.d.ts +0 -0
- package/build/esm/Ripple/RippleBox.js +1 -1
- package/build/esm/Ripple/RippleBox.js.map +1 -1
- package/build/esm/Ripple/constants.d.ts +0 -0
- package/build/esm/Ripple/constants.js.map +0 -0
- package/build/esm/Ripple/index.d.ts +0 -0
- package/build/esm/Ripple/index.js.map +0 -0
- package/build/esm/Ripple/keyframes.d.ts +0 -0
- package/build/esm/Ripple/keyframes.js.map +0 -0
- package/build/esm/Ripple/useRipple.d.ts +0 -0
- package/build/esm/Ripple/useRipple.js.map +0 -0
- package/build/esm/Ripple/useRippleHandlers.d.ts +0 -0
- package/build/esm/Ripple/useRippleHandlers.js.map +0 -0
- package/build/esm/Ripple/useRippleSurface.d.ts +5 -4
- package/build/esm/Ripple/useRippleSurface.js +30 -8
- package/build/esm/Ripple/useRippleSurface.js.map +1 -1
- package/build/esm/Select/Select.d.ts +3 -3
- package/build/esm/Select/Select.js +5 -14
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +1 -1
- package/build/esm/Select/SelectIcon.js +3 -1
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/Select/context.d.ts +0 -0
- package/build/esm/Select/context.js.map +0 -0
- package/build/esm/Select/defaultRender.d.ts +0 -0
- package/build/esm/Select/defaultRender.js.map +0 -0
- package/build/esm/Select/index.d.ts +0 -0
- package/build/esm/Select/index.js.map +0 -0
- package/build/esm/Select/styledComponents.d.ts +0 -0
- package/build/esm/Select/styledComponents.js +9 -5
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectItem/SelectItem.js.map +0 -0
- package/build/esm/SelectItem/index.d.ts +0 -0
- package/build/esm/SelectItem/index.js.map +0 -0
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.js.map +0 -0
- package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlText.js.map +0 -0
- package/build/esm/SelectionControl/index.d.ts +0 -0
- package/build/esm/SelectionControl/index.js.map +0 -0
- package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
- package/build/esm/Skeleton/DelayAppearance.js.map +0 -0
- package/build/esm/Skeleton/Skeleton.d.ts +1 -1
- package/build/esm/Skeleton/Skeleton.js.map +0 -0
- package/build/esm/Skeleton/animation.d.ts +0 -0
- package/build/esm/Skeleton/animation.js.map +0 -0
- package/build/esm/Skeleton/index.d.ts +0 -0
- package/build/esm/Skeleton/index.js.map +0 -0
- package/build/esm/Snackbar/Snackbar.d.ts +1 -1
- package/build/esm/Snackbar/Snackbar.js +4 -4
- package/build/esm/Snackbar/Snackbar.js.map +1 -1
- package/build/esm/Snackbar/Stack.d.ts +0 -0
- package/build/esm/Snackbar/Stack.js.map +0 -0
- package/build/esm/Snackbar/index.d.ts +0 -0
- package/build/esm/Snackbar/index.js.map +0 -0
- package/build/esm/Snackbar/useSnackbarAnimation.d.ts +0 -0
- package/build/esm/Snackbar/useSnackbarAnimation.js.map +0 -0
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Switch/Switch.js +8 -6
- package/build/esm/Switch/Switch.js.map +1 -1
- package/build/esm/Switch/index.d.ts +0 -0
- package/build/esm/Switch/index.js.map +0 -0
- package/build/esm/Switch/styledComponents.d.ts +2 -2
- package/build/esm/Switch/styledComponents.js +54 -26
- package/build/esm/Switch/styledComponents.js.map +1 -1
- package/build/esm/Tab/Tab.d.ts +1 -1
- package/build/esm/Tab/Tab.js.map +0 -0
- package/build/esm/Tab/TabList.d.ts +1 -1
- package/build/esm/Tab/TabList.js.map +0 -0
- package/build/esm/Tab/TabPanel.d.ts +1 -1
- package/build/esm/Tab/TabPanel.js.map +0 -0
- package/build/esm/Tab/TabPanels.d.ts +0 -0
- package/build/esm/Tab/TabPanels.js.map +0 -0
- package/build/esm/Tab/Tabs.d.ts +0 -0
- package/build/esm/Tab/Tabs.js.map +0 -0
- package/build/esm/Tab/context.d.ts +0 -0
- package/build/esm/Tab/context.js.map +0 -0
- package/build/esm/Tab/index.d.ts +0 -0
- package/build/esm/Tab/index.js.map +0 -0
- package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.js.map +0 -0
- package/build/esm/TabIndicator/context.d.ts +0 -0
- package/build/esm/TabIndicator/context.js.map +0 -0
- package/build/esm/TabIndicator/index.d.ts +0 -0
- package/build/esm/TabIndicator/index.js.map +0 -0
- package/build/esm/Table/Table.d.ts +1 -1
- package/build/esm/Table/Table.js +1 -1
- package/build/esm/Table/Table.js.map +1 -1
- package/build/esm/Table/TableBody.d.ts +1 -1
- package/build/esm/Table/TableBody.js.map +0 -0
- package/build/esm/Table/TableCell.d.ts +1 -1
- package/build/esm/Table/TableCell.js.map +0 -0
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableHead.js.map +0 -0
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Table/TableRow.js.map +0 -0
- package/build/esm/Table/context.d.ts +0 -0
- package/build/esm/Table/context.js.map +0 -0
- package/build/esm/Table/index.d.ts +0 -0
- package/build/esm/Table/index.js.map +0 -0
- package/build/esm/Text/LoremIpsum.d.ts +4 -4
- package/build/esm/Text/LoremIpsum.js.map +1 -1
- package/build/esm/Text/Text.d.ts +1 -1
- package/build/esm/Text/Text.js.map +0 -0
- package/build/esm/Text/index.d.ts +0 -0
- package/build/esm/Text/index.js.map +0 -0
- package/build/esm/TextField/FilledContainer.d.ts +1 -1
- package/build/esm/TextField/FilledContainer.js +17 -10
- package/build/esm/TextField/FilledContainer.js.map +1 -1
- package/build/esm/TextField/HelperText.d.ts +1 -1
- package/build/esm/TextField/HelperText.js.map +0 -0
- package/build/esm/TextField/IconContainer.d.ts +2 -2
- package/build/esm/TextField/IconContainer.js +4 -2
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/TextField/Input.d.ts +1 -1
- package/build/esm/TextField/Input.js +18 -10
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
- package/build/esm/TextField/OutlinedContainer.js +7 -4
- package/build/esm/TextField/OutlinedContainer.js.map +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/TextField/TextField.js +2 -2
- package/build/esm/TextField/TextField.js.map +1 -1
- package/build/esm/TextField/consts.d.ts +5 -0
- package/build/esm/TextField/consts.js +6 -0
- package/build/esm/TextField/consts.js.map +1 -0
- package/build/esm/TextField/index.d.ts +0 -0
- package/build/esm/TextField/index.js.map +0 -0
- package/build/esm/ThemeExplorer/ColorPicker.js +2 -2
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +5 -5
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/esm/Tooltip/Tooltip.js.map +0 -0
- package/build/esm/Tooltip/index.d.ts +0 -0
- package/build/esm/Tooltip/index.js.map +0 -0
- package/build/esm/color.d.ts +2 -1
- package/build/esm/color.js +10 -6
- package/build/esm/color.js.map +1 -1
- package/build/esm/css.d.ts +0 -0
- package/build/esm/css.js.map +0 -0
- package/build/esm/hooks/useAnimation.d.ts +0 -0
- package/build/esm/hooks/useAnimation.js.map +0 -0
- package/build/esm/index.d.ts +0 -0
- package/build/esm/index.js.map +0 -0
- package/build/esm/theme/index.d.ts +0 -0
- package/build/esm/theme/index.js.map +0 -0
- package/build/esm/theme/theme.d.ts +96 -50
- package/build/esm/theme/theme.js +133 -93
- package/build/esm/theme/theme.js.map +1 -1
- package/build/esm/theme/typography-raleway.d.ts +0 -0
- package/build/esm/theme/typography-raleway.js.map +0 -0
- package/build/esm/theme/typography-roboto.d.ts +0 -0
- package/build/esm/theme/typography-roboto.js.map +0 -0
- package/build/esm/theme/useTheme.d.ts +471 -1
- package/build/esm/theme/useTheme.js.map +0 -0
- package/build/tsconfig.tsbuildinfo +1 -4757
- package/package.json +15 -14
- package/src/Alert/Alert.story.tsx +5 -6
- package/src/Alert/Alert.tsx +1 -1
- package/src/AppBar/AppBar.story.tsx +11 -20
- package/src/AppBar/AppBar.tsx +5 -6
- package/src/BottomSheet/BottomSheet.story.tsx +5 -6
- package/src/BottomSheet/BottomSheetSurface.tsx +1 -1
- package/src/Button/BaseButton.tsx +1 -0
- package/src/Button/Button.story.tsx +34 -47
- package/src/Button/Button.tsx +20 -6
- package/src/Button/ButtonGroup.story.tsx +106 -0
- package/src/Button/ButtonGroup.tsx +33 -0
- package/src/Button/FilledButton.tsx +38 -4
- package/src/Button/FloatingActionButton.tsx +9 -0
- package/src/Button/IconButton.tsx +1 -0
- package/src/Button/OutlinedButton.tsx +30 -2
- package/src/Button/SpinnerButton.story.tsx +7 -7
- package/src/Button/TransparentButton.tsx +32 -1
- package/src/Button/context.tsx +16 -0
- package/src/Button/index.ts +1 -0
- package/src/CheckBox/CheckBox.story.tsx +7 -6
- package/src/CheckBox/CheckBox.tsx +1 -1
- package/src/Chip/ButtonChip.tsx +42 -46
- package/src/Chip/Chip.story.tsx +98 -26
- package/src/Chip/ChipBase.tsx +40 -12
- package/src/Chip/ChoiceChip.tsx +18 -17
- package/src/Combobox/Combobox.story.tsx +12 -13
- package/src/Combobox/Combobox.tsx +2 -1
- package/src/Dialog/Dialog.story.tsx +7 -8
- package/src/Dialog/DialogSurface.tsx +20 -5
- package/src/Divider/Divider.story.tsx +6 -5
- package/src/FloatingLabel/FloatingLabel.story.tsx +10 -9
- package/src/FloatingLabel/FloatingLabel.tsx +0 -3
- package/src/LineRipple/LineRipple.story.tsx +5 -4
- package/src/Link/Link.story.tsx +3 -4
- package/src/ListItem/ListItem.story.tsx +6 -5
- package/src/ListItem/ListItem.tsx +55 -32
- package/src/ListItem/ListItemText.tsx +2 -4
- package/src/Menu/Menu.story.tsx +8 -7
- package/src/Menu/Menu.tsx +2 -2
- package/src/NotchedOutline/NotchedOutline.story.tsx +6 -5
- package/src/NotchedOutline/styledComponents.ts +6 -6
- package/src/Paper/Paper.story.tsx +21 -7
- package/src/Paper/Paper.tsx +6 -2
- package/src/ProgressSpinner/ProgressSpinner.story.tsx +5 -4
- package/src/RadioButton/RadioButton.story.tsx +12 -10
- package/src/RadioButton/RadioButton.tsx +1 -1
- package/src/RadioButton/RadioButtonIcon.tsx +2 -2
- package/src/Ripple/Ripple.story.tsx +6 -5
- package/src/Ripple/Ripple.tsx +1 -1
- package/src/Ripple/RippleBox.tsx +1 -0
- package/src/Ripple/useRippleSurface.ts +31 -7
- package/src/Select/PaymentMethodSelect.story.tsx +321 -0
- package/src/Select/Select.story.tsx +34 -8
- package/src/Select/Select.tsx +12 -34
- package/src/Select/SelectIcon.tsx +2 -1
- package/src/Select/styledComponents.tsx +8 -4
- package/src/Skeleton/Skeleton.story.tsx +9 -8
- package/src/Snackbar/Snackbar.story.tsx +7 -6
- package/src/Snackbar/Snackbar.tsx +4 -4
- package/src/Switch/Switch.story.tsx +5 -4
- package/src/Switch/Switch.tsx +7 -6
- package/src/Switch/styledComponents.tsx +69 -22
- package/src/Tab/Tab.story.tsx +7 -5
- package/src/Table/Table.story.tsx +5 -4
- package/src/Table/Table.tsx +1 -1
- package/src/Text/LoremIpsum.tsx +3 -1
- package/src/Text/Text.story.tsx +5 -4
- package/src/TextField/FilledContainer.tsx +30 -10
- package/src/TextField/IconContainer.tsx +5 -4
- package/src/TextField/Input.tsx +33 -10
- package/src/TextField/OutlinedContainer.tsx +18 -4
- package/src/TextField/TextField.story.tsx +21 -7
- package/src/TextField/TextField.tsx +2 -2
- package/src/TextField/consts.ts +7 -0
- package/src/ThemeExplorer/ColorPicker.tsx +101 -0
- package/src/ThemeExplorer/TextFieldColorPicker.tsx +112 -0
- package/src/ThemeExplorer/ThemeBuilder.story.tsx +169 -0
- package/src/ThemeExplorer/ThemeColors.tsx +88 -0
- package/src/ThemeExplorer/ThemeExplorer.story.tsx +42 -0
- package/src/ThemeExplorer/components.tsx +208 -0
- package/src/ThemeExplorer/makeColorScheme.tsx +73 -0
- package/src/ThemeExplorer/useDeferredColor.tsx +24 -0
- package/src/ThemeExplorer/useLocalStorageCachedState.ts +18 -0
- package/src/Tooltip/Tooltip.story.tsx +5 -4
- package/src/color.ts +18 -13
- package/src/theme/theme.ts +131 -92
- package/src/ListItem/context.ts +0 -13
|
@@ -8,11 +8,39 @@ export const OutlinedButton = styled(TransparentButton)(
|
|
|
8
8
|
css({
|
|
9
9
|
borderStyle: 'solid',
|
|
10
10
|
borderWidth: rem(1),
|
|
11
|
-
borderColor:
|
|
11
|
+
borderColor: 'outline',
|
|
12
|
+
boxShadow: 0,
|
|
13
|
+
'&:focus,:&active,:&hover': { boxShadow: 0 },
|
|
14
|
+
'&:focus-visible,&:active': {
|
|
15
|
+
borderColor: 'currentColor',
|
|
16
|
+
},
|
|
12
17
|
'&:disabled': {
|
|
13
18
|
color: alpha('on.surface', 0.38),
|
|
14
19
|
borderColor: alpha('on.surface', 0.12),
|
|
15
20
|
cursor: 'default',
|
|
16
21
|
},
|
|
17
|
-
})
|
|
22
|
+
}),
|
|
23
|
+
({ isGroupedButton = false }) =>
|
|
24
|
+
isGroupedButton && {
|
|
25
|
+
'[data-button-group=""] &': {
|
|
26
|
+
':first-of-type': {
|
|
27
|
+
borderTopRightRadius: 0,
|
|
28
|
+
borderBottomRightRadius: 0,
|
|
29
|
+
},
|
|
30
|
+
':not(:first-of-type):not(:last-of-type)': {
|
|
31
|
+
borderRadius: 0,
|
|
32
|
+
borderRightWidth: 0,
|
|
33
|
+
borderLeftWidth: 0,
|
|
34
|
+
},
|
|
35
|
+
':last-of-type': {
|
|
36
|
+
borderTopLeftRadius: 0,
|
|
37
|
+
borderBottomLeftRadius: 0,
|
|
38
|
+
borderLeftStyle: 'solid',
|
|
39
|
+
borderLeftWidth: rem(1),
|
|
40
|
+
},
|
|
41
|
+
':last-of-type:nth-of-type(2)': {
|
|
42
|
+
borderLeftWidth: 0,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}
|
|
18
46
|
);
|
|
@@ -5,12 +5,15 @@ import {
|
|
|
5
5
|
SpinnerProps,
|
|
6
6
|
SpinnerButtonProps,
|
|
7
7
|
} from '@basic-ui/core';
|
|
8
|
-
import { storiesOf } from '@storybook/react';
|
|
9
8
|
import { Button, Box, Text } from '../';
|
|
10
9
|
import { alpha } from '../color';
|
|
11
10
|
import { useTheme } from '../theme';
|
|
12
11
|
import { BoxProps } from '../Box';
|
|
13
12
|
|
|
13
|
+
export default {
|
|
14
|
+
title: 'components/SpinnerButton',
|
|
15
|
+
};
|
|
16
|
+
|
|
14
17
|
const Spinner: FC<
|
|
15
18
|
Omit<BoxProps, 'onChange'> & SpinnerProps
|
|
16
19
|
> = SpinnerBase as any;
|
|
@@ -18,8 +21,6 @@ const SpinnerButton: FC<
|
|
|
18
21
|
BoxProps & SpinnerButtonProps
|
|
19
22
|
> = SpinnerButtonBase as any;
|
|
20
23
|
|
|
21
|
-
const stories = storiesOf('OtherComponents/SpinnerButton', module);
|
|
22
|
-
|
|
23
24
|
function AddIcon(props) {
|
|
24
25
|
return (
|
|
25
26
|
<svg viewBox="0 0 24 24" width={24} height={24} {...props}>
|
|
@@ -53,7 +54,7 @@ const Example = ({ vertical = false }) => {
|
|
|
53
54
|
display: 'inline-flex',
|
|
54
55
|
alignItems: 'center',
|
|
55
56
|
flexDirection: vertical ? 'column-reverse' : 'row',
|
|
56
|
-
borderRadius: '
|
|
57
|
+
borderRadius: 'full',
|
|
57
58
|
'&:focus': {
|
|
58
59
|
outline: 'none',
|
|
59
60
|
boxShadow: `0px 0px 10px 0px ${alpha('primary', 0.6)(theme)}`,
|
|
@@ -87,6 +88,5 @@ const Example = ({ vertical = false }) => {
|
|
|
87
88
|
);
|
|
88
89
|
};
|
|
89
90
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
stories.add('vertical', () => <Example vertical={true} />);
|
|
91
|
+
export const Horizontal = () => <Example />;
|
|
92
|
+
export const Vertical = () => <Example vertical={true} />;
|
|
@@ -4,6 +4,7 @@ import { BaseButton } from './BaseButton';
|
|
|
4
4
|
import { Theme } from '../theme';
|
|
5
5
|
import { css } from '@styled-system/css';
|
|
6
6
|
import { alpha } from '../color';
|
|
7
|
+
import { rem } from 'polished';
|
|
7
8
|
|
|
8
9
|
export const TransparentButton = styled(BaseButton)(
|
|
9
10
|
({ theme, color = 'primary' }) =>
|
|
@@ -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,16 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import type { ButtonProps } from './Button';
|
|
3
|
+
|
|
4
|
+
// ButtonGroup Component
|
|
5
|
+
export type ButtonGroupContextProps = {
|
|
6
|
+
variant?: ButtonProps['variant'];
|
|
7
|
+
direction?: 'row' | 'column';
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const ButtonGroupContext = createContext<ButtonGroupContextProps | null>(
|
|
11
|
+
null
|
|
12
|
+
);
|
|
13
|
+
ButtonGroupContext.displayName = 'ButtonGroupContext';
|
|
14
|
+
|
|
15
|
+
export const useButtonGroupContext = (): ButtonGroupContextProps | null =>
|
|
16
|
+
useContext(ButtonGroupContext);
|
package/src/Button/index.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { useState, useRef } from 'react';
|
|
2
2
|
import { CheckBox, Box } from '../';
|
|
3
|
-
import { storiesOf } from '@storybook/react';
|
|
4
3
|
import { keyframes } from '@emotion/react';
|
|
5
4
|
import { Keyframes } from '@emotion/serialize';
|
|
6
5
|
|
|
6
|
+
export default {
|
|
7
|
+
title: 'components/CheckBox',
|
|
8
|
+
};
|
|
9
|
+
|
|
7
10
|
const HeartOutline = (props) => {
|
|
8
11
|
return (
|
|
9
12
|
<svg height={24} viewBox="0 0 24 24" width={24} {...props}>
|
|
@@ -28,7 +31,7 @@ const HeartFilled = (props) => {
|
|
|
28
31
|
);
|
|
29
32
|
};
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
const settingIn: Keyframes = keyframes({
|
|
32
35
|
'0%': {
|
|
33
36
|
transform: `scale(1)`,
|
|
34
37
|
},
|
|
@@ -40,7 +43,7 @@ export const settingIn: Keyframes = keyframes({
|
|
|
40
43
|
},
|
|
41
44
|
});
|
|
42
45
|
|
|
43
|
-
|
|
46
|
+
const settingOut: Keyframes = keyframes({
|
|
44
47
|
'0%': {
|
|
45
48
|
transform: `scale(1)`,
|
|
46
49
|
},
|
|
@@ -147,6 +150,4 @@ const Example = () => {
|
|
|
147
150
|
);
|
|
148
151
|
};
|
|
149
152
|
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
stories.add('controlled', () => <Example />);
|
|
153
|
+
export const Controlled = () => <Example />;
|
package/src/Chip/ButtonChip.tsx
CHANGED
|
@@ -3,25 +3,26 @@ import type * as React from 'react';
|
|
|
3
3
|
import { ChipBaseProps, ChipBase } from './ChipBase';
|
|
4
4
|
import { RippleBox } from '../Ripple';
|
|
5
5
|
import { useTheme } from '../theme';
|
|
6
|
-
import { Box } from '../Box';
|
|
7
6
|
import { rem } from 'polished';
|
|
8
7
|
|
|
9
8
|
export type ButtonChipProps = ChipBaseProps & {
|
|
10
9
|
checked?: boolean;
|
|
11
10
|
disabled?: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
leadingIcon?: React.ReactNode;
|
|
12
|
+
trailingIcon?: React.ReactNode;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
|
|
17
16
|
function ButtonChip(props, forwardedRef) {
|
|
18
17
|
const {
|
|
19
|
-
as = '
|
|
18
|
+
as = 'div',
|
|
20
19
|
onClick,
|
|
21
20
|
disabled: disabledProp,
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
leadingIcon,
|
|
22
|
+
trailingIcon,
|
|
24
23
|
children,
|
|
24
|
+
color = 'surface',
|
|
25
|
+
__css,
|
|
25
26
|
...otherProps
|
|
26
27
|
} = props;
|
|
27
28
|
|
|
@@ -30,58 +31,53 @@ export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
|
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
33
|
<ChipBase
|
|
33
|
-
as="
|
|
34
|
+
as="div"
|
|
34
35
|
onClick={isClickable ? onClick : undefined}
|
|
35
36
|
disabled={disabledProp}
|
|
37
|
+
color="on.surface"
|
|
38
|
+
backgroundColor="surface"
|
|
39
|
+
__css={__css}
|
|
36
40
|
{...otherProps}
|
|
37
41
|
>
|
|
38
|
-
<
|
|
39
|
-
as=
|
|
42
|
+
<RippleBox
|
|
43
|
+
as={as}
|
|
44
|
+
role={isClickable ? 'button' : undefined}
|
|
45
|
+
tabIndex={isClickable ? 0 : undefined}
|
|
46
|
+
theme={theme}
|
|
47
|
+
ref={forwardedRef}
|
|
48
|
+
rippleColor={'currentColor'}
|
|
49
|
+
baseOpacity={0}
|
|
50
|
+
hoverOpacity={0.12}
|
|
51
|
+
focusOpacity={0.24}
|
|
52
|
+
center={false}
|
|
53
|
+
disabled={!isClickable}
|
|
54
|
+
aria-disabled={!isClickable}
|
|
40
55
|
__css={{
|
|
56
|
+
bg: 'transparent',
|
|
57
|
+
color: 'inherit',
|
|
58
|
+
padding: `0`,
|
|
59
|
+
pl: leadingIcon ? rem(8) : rem(12),
|
|
60
|
+
pr: trailingIcon ? rem(8) : rem(12),
|
|
61
|
+
gap: rem(8),
|
|
41
62
|
width: '100%',
|
|
63
|
+
minWidth: 'auto',
|
|
42
64
|
height: '100%',
|
|
65
|
+
appearance: 'none',
|
|
66
|
+
':focus': {
|
|
67
|
+
outline: 'none',
|
|
68
|
+
},
|
|
43
69
|
border: 'none',
|
|
70
|
+
borderRadius: 0,
|
|
71
|
+
position: 'relative',
|
|
44
72
|
display: 'inline-flex',
|
|
45
73
|
alignItems: 'center',
|
|
46
|
-
|
|
74
|
+
cursor: isClickable ? 'pointer' : 'default',
|
|
47
75
|
}}
|
|
48
76
|
>
|
|
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">{children}</Box>
|
|
81
|
-
<Box as="span" pl={rem(6)} pr={rem(6)}>
|
|
82
|
-
{rightIcon}
|
|
83
|
-
</Box>
|
|
84
|
-
</Box>
|
|
77
|
+
{leadingIcon}
|
|
78
|
+
{children}
|
|
79
|
+
{trailingIcon}
|
|
80
|
+
</RippleBox>
|
|
85
81
|
</ChipBase>
|
|
86
82
|
);
|
|
87
83
|
}
|
package/src/Chip/Chip.story.tsx
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { Chip } from './';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
2
|
import { Box } from '../Box';
|
|
4
3
|
import { Text } from '../Text';
|
|
5
4
|
import { alpha } from '../color';
|
|
6
5
|
import { RadioGroup } from '../RadioButton';
|
|
7
6
|
import { ChoiceChip } from './ChoiceChip';
|
|
8
|
-
|
|
7
|
+
import { LoremIpsum } from '../Text/LoremIpsum';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'components/Chip',
|
|
11
|
+
};
|
|
9
12
|
|
|
10
13
|
const CloseIcon = (props) => (
|
|
11
14
|
<Box
|
|
15
|
+
role="button"
|
|
16
|
+
tabIndex={0}
|
|
12
17
|
display="flex"
|
|
13
18
|
width={20}
|
|
14
19
|
height={20}
|
|
15
|
-
borderRadius="50%"
|
|
16
20
|
alignItems="center"
|
|
17
21
|
justifyContent="center"
|
|
18
22
|
sx={{
|
|
19
|
-
bg: alpha('on.surface', 0.24),
|
|
20
|
-
color: alpha('surface', 0.6),
|
|
21
23
|
'& > svg': { display: 'block' },
|
|
22
24
|
}}
|
|
23
25
|
>
|
|
@@ -36,11 +38,12 @@ const LeftIcon = ({ color }) => (
|
|
|
36
38
|
display="flex"
|
|
37
39
|
width={24}
|
|
38
40
|
height={24}
|
|
39
|
-
borderRadius="
|
|
41
|
+
borderRadius="full"
|
|
40
42
|
alignItems="center"
|
|
41
43
|
justifyContent="center"
|
|
42
44
|
bg={color}
|
|
43
45
|
color={`on.${color}`}
|
|
46
|
+
ml="-4px"
|
|
44
47
|
>
|
|
45
48
|
L
|
|
46
49
|
</Box>
|
|
@@ -56,34 +59,38 @@ const Example = ({ variant, color = 'default' }) => {
|
|
|
56
59
|
<Text variant="h6" mb={2}>
|
|
57
60
|
Variant: {variant}, Color: {color}
|
|
58
61
|
</Text>
|
|
59
|
-
<Box my={2}>
|
|
62
|
+
<Box my={2} display="flex" sx={{ gap: 2 }}>
|
|
60
63
|
<Text as="span" mr={2}>
|
|
61
64
|
Non clickable
|
|
62
65
|
</Text>
|
|
63
|
-
<Chip variant={variant}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
<Chip variant={variant} color={color}>
|
|
67
|
+
Buy now
|
|
68
|
+
</Chip>
|
|
69
|
+
<Chip variant={variant} color={color}>
|
|
70
|
+
Close door
|
|
71
|
+
</Chip>
|
|
72
|
+
<Chip variant={variant} disabled color={color}>
|
|
66
73
|
Nothing
|
|
67
74
|
</Chip>
|
|
68
75
|
</Box>
|
|
69
|
-
<Box my={2}>
|
|
76
|
+
<Box my={2} display="flex" sx={{ gap: 2 }}>
|
|
70
77
|
<Text as="span" mr={2}>
|
|
71
78
|
Button
|
|
72
79
|
</Text>
|
|
73
|
-
<Chip variant={variant} onClick={noop}>
|
|
80
|
+
<Chip variant={variant} onClick={noop} color={color}>
|
|
74
81
|
John
|
|
75
82
|
</Chip>
|
|
76
|
-
<Chip variant={variant} onClick={noop}>
|
|
83
|
+
<Chip variant={variant} onClick={noop} color={color}>
|
|
77
84
|
Max
|
|
78
85
|
</Chip>
|
|
79
|
-
<Chip variant={variant} onClick={noop}>
|
|
86
|
+
<Chip variant={variant} onClick={noop} color={color}>
|
|
80
87
|
Jane
|
|
81
88
|
</Chip>
|
|
82
|
-
<Chip variant={variant} onClick={noop} disabled>
|
|
89
|
+
<Chip variant={variant} onClick={noop} disabled color={color}>
|
|
83
90
|
Off
|
|
84
91
|
</Chip>
|
|
85
92
|
</Box>
|
|
86
|
-
<Box my={2}>
|
|
93
|
+
<Box my={2} display="flex" sx={{ gap: 2 }}>
|
|
87
94
|
<Text as="span" mr={2}>
|
|
88
95
|
CheckBox
|
|
89
96
|
</Text>
|
|
@@ -100,7 +107,12 @@ const Example = ({ variant, color = 'default' }) => {
|
|
|
100
107
|
Disabled
|
|
101
108
|
</ChoiceChip>
|
|
102
109
|
</Box>
|
|
103
|
-
<RadioGroup
|
|
110
|
+
<RadioGroup
|
|
111
|
+
name={`test-radio-${variant}-${color}`}
|
|
112
|
+
my={2}
|
|
113
|
+
display="flex"
|
|
114
|
+
sx={{ gap: 2 }}
|
|
115
|
+
>
|
|
104
116
|
<Text as="span" mr={2}>
|
|
105
117
|
RadioGroup
|
|
106
118
|
</Text>
|
|
@@ -123,21 +135,21 @@ const Example = ({ variant, color = 'default' }) => {
|
|
|
123
135
|
Disabled
|
|
124
136
|
</ChoiceChip>
|
|
125
137
|
</RadioGroup>
|
|
126
|
-
<Box my={2} display="flex">
|
|
138
|
+
<Box my={2} display="flex" sx={{ gap: 2 }}>
|
|
127
139
|
<Text as="span" mr={2}>
|
|
128
140
|
With icons
|
|
129
141
|
</Text>
|
|
130
142
|
<Chip variant={variant}>Hello please</Chip>
|
|
131
|
-
<Chip variant={variant}
|
|
143
|
+
<Chip variant={variant} leadingIcon={<LeftIcon color={color} />}>
|
|
132
144
|
Hello please
|
|
133
145
|
</Chip>
|
|
134
|
-
<Chip variant={variant}
|
|
146
|
+
<Chip variant={variant} trailingIcon={<CloseIcon />}>
|
|
135
147
|
Hello please
|
|
136
148
|
</Chip>
|
|
137
149
|
<Chip
|
|
138
150
|
variant={variant}
|
|
139
|
-
|
|
140
|
-
|
|
151
|
+
leadingIcon={<LeftIcon color={color} />}
|
|
152
|
+
trailingIcon={<CloseIcon />}
|
|
141
153
|
>
|
|
142
154
|
Hello please
|
|
143
155
|
</Chip>
|
|
@@ -157,7 +169,7 @@ const AllColors = ({ variant }) => (
|
|
|
157
169
|
</>
|
|
158
170
|
);
|
|
159
171
|
|
|
160
|
-
const AllVariants = () => {
|
|
172
|
+
export const AllVariants = () => {
|
|
161
173
|
return (
|
|
162
174
|
<>
|
|
163
175
|
<AllColors variant="filled" />
|
|
@@ -166,6 +178,66 @@ const AllVariants = () => {
|
|
|
166
178
|
);
|
|
167
179
|
};
|
|
168
180
|
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
181
|
+
export const HorizontallyScrollableExample = () => {
|
|
182
|
+
const texts = [
|
|
183
|
+
'Temakis',
|
|
184
|
+
'Sushis',
|
|
185
|
+
'Beers',
|
|
186
|
+
'Wine',
|
|
187
|
+
'Soft drinks',
|
|
188
|
+
'Cold drinks',
|
|
189
|
+
];
|
|
190
|
+
return (
|
|
191
|
+
<Box maxWidth="300px" sx={{ backgroundColor: '#ccc' }}>
|
|
192
|
+
<Box
|
|
193
|
+
as="nav"
|
|
194
|
+
sx={{
|
|
195
|
+
position: 'sticky',
|
|
196
|
+
top: 0,
|
|
197
|
+
overflowX: 'auto',
|
|
198
|
+
bg: 'surface',
|
|
199
|
+
py: 3,
|
|
200
|
+
zIndex: 1,
|
|
201
|
+
borderColor: '#aeaeae',
|
|
202
|
+
borderWidth: '1px',
|
|
203
|
+
borderStyle: 'solid',
|
|
204
|
+
scrollbarWidth: 'none',
|
|
205
|
+
MsOverflowStyle: 'none',
|
|
206
|
+
'::-webkit-scrollbar': {
|
|
207
|
+
display: 'none',
|
|
208
|
+
},
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
<RadioGroup
|
|
212
|
+
sx={{
|
|
213
|
+
px: 3,
|
|
214
|
+
display: 'flex',
|
|
215
|
+
minWidth: 'auto',
|
|
216
|
+
overflow: 'visible',
|
|
217
|
+
'& > :not(:first-of-type)': {
|
|
218
|
+
marginLeft: 2,
|
|
219
|
+
},
|
|
220
|
+
}}
|
|
221
|
+
>
|
|
222
|
+
{texts.map((text) => (
|
|
223
|
+
<Box key={text} sx={{ minWidth: 'auto' }}>
|
|
224
|
+
<ChoiceChip
|
|
225
|
+
type="radio"
|
|
226
|
+
value={text}
|
|
227
|
+
key={text}
|
|
228
|
+
onClick={() => {
|
|
229
|
+
/* noop */
|
|
230
|
+
}}
|
|
231
|
+
>
|
|
232
|
+
{text}
|
|
233
|
+
</ChoiceChip>
|
|
234
|
+
</Box>
|
|
235
|
+
))}
|
|
236
|
+
</RadioGroup>
|
|
237
|
+
</Box>
|
|
238
|
+
<Box>
|
|
239
|
+
<LoremIpsum count={20} />
|
|
240
|
+
</Box>
|
|
241
|
+
</Box>
|
|
242
|
+
);
|
|
243
|
+
};
|
package/src/Chip/ChipBase.tsx
CHANGED
|
@@ -2,8 +2,12 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
import { variant } from 'styled-system';
|
|
4
4
|
import { Box, BoxProps } from '../Box';
|
|
5
|
-
import { useTheme } from '../theme';
|
|
6
|
-
import {
|
|
5
|
+
import { Theme, useTheme } from '../theme';
|
|
6
|
+
import {
|
|
7
|
+
alpha,
|
|
8
|
+
getDarkThemeBackgroundOverlay,
|
|
9
|
+
getColorOverlay,
|
|
10
|
+
} from '../color';
|
|
7
11
|
import { rem } from 'polished';
|
|
8
12
|
|
|
9
13
|
export type ChipBaseProps<
|
|
@@ -17,15 +21,25 @@ export type ChipBaseProps<
|
|
|
17
21
|
disabled?: boolean;
|
|
18
22
|
};
|
|
19
23
|
|
|
20
|
-
function getFilledCSS(
|
|
24
|
+
function getFilledCSS(
|
|
25
|
+
theme: Theme,
|
|
26
|
+
bg: string,
|
|
27
|
+
color: string,
|
|
28
|
+
disabled: boolean
|
|
29
|
+
) {
|
|
21
30
|
return {
|
|
22
|
-
bg
|
|
23
|
-
|
|
31
|
+
...(!disabled && bg !== 'surface'
|
|
32
|
+
? { bg }
|
|
33
|
+
: {
|
|
34
|
+
...getColorOverlay(theme, 'surface', 'primary', 0.05),
|
|
35
|
+
...getDarkThemeBackgroundOverlay(theme, 2),
|
|
36
|
+
}),
|
|
37
|
+
color,
|
|
24
38
|
'&::before': {
|
|
25
39
|
backgroundColor: 'currentColor',
|
|
26
40
|
position: 'absolute',
|
|
27
41
|
content: '""',
|
|
28
|
-
opacity: 0
|
|
42
|
+
opacity: 0,
|
|
29
43
|
pointerEvents: 'none',
|
|
30
44
|
top: 0,
|
|
31
45
|
right: 0,
|
|
@@ -38,13 +52,19 @@ function getFilledCSS(bg: string, color: string) {
|
|
|
38
52
|
'& > *': {
|
|
39
53
|
zIndex: 1,
|
|
40
54
|
},
|
|
55
|
+
...(disabled && { boxShadow: 0, bg: alpha('on.surface', 0.32) }),
|
|
41
56
|
};
|
|
42
57
|
}
|
|
43
58
|
|
|
44
|
-
function getOutlinedCSS(
|
|
59
|
+
function getOutlinedCSS(
|
|
60
|
+
theme: Theme,
|
|
61
|
+
bg: string,
|
|
62
|
+
color: string,
|
|
63
|
+
borderOpacity: number
|
|
64
|
+
) {
|
|
45
65
|
return {
|
|
46
|
-
bg,
|
|
47
|
-
color:
|
|
66
|
+
...(bg !== 'surface' ? { bg } : getDarkThemeBackgroundOverlay(theme, 2)),
|
|
67
|
+
color: color,
|
|
48
68
|
borderColor: alpha(color, borderOpacity),
|
|
49
69
|
borderStyle: 'solid',
|
|
50
70
|
borderWidth: rem(1),
|
|
@@ -71,6 +91,7 @@ export const ChipBase = forwardRef<HTMLDivElement, ChipBaseProps>(function Chip(
|
|
|
71
91
|
return (
|
|
72
92
|
<Box
|
|
73
93
|
as={as}
|
|
94
|
+
data-disabled={disabled ? '' : undefined}
|
|
74
95
|
ref={forwardedRef}
|
|
75
96
|
__css={{
|
|
76
97
|
boxSizing: 'border-box',
|
|
@@ -84,9 +105,11 @@ export const ChipBase = forwardRef<HTMLDivElement, ChipBaseProps>(function Chip(
|
|
|
84
105
|
fontSize: 'inherit',
|
|
85
106
|
border: 0,
|
|
86
107
|
overflow: 'hidden',
|
|
108
|
+
whiteSpace: 'nowrap',
|
|
87
109
|
cursor: 'default',
|
|
88
110
|
WebkitTapHighlightColor: 'transparent',
|
|
89
111
|
willChange: 'transform,opacity',
|
|
112
|
+
minWidth: 'auto',
|
|
90
113
|
'&::-moz-focus-inner': {
|
|
91
114
|
border: 0,
|
|
92
115
|
},
|
|
@@ -98,9 +121,14 @@ export const ChipBase = forwardRef<HTMLDivElement, ChipBaseProps>(function Chip(
|
|
|
98
121
|
},
|
|
99
122
|
})({ variant: variantProp, theme }),
|
|
100
123
|
...(variantProp === 'filled'
|
|
101
|
-
? getFilledCSS(backgroundColorProp, colorProp)
|
|
102
|
-
: getOutlinedCSS(
|
|
103
|
-
|
|
124
|
+
? getFilledCSS(theme, backgroundColorProp, colorProp, disabled)
|
|
125
|
+
: getOutlinedCSS(
|
|
126
|
+
theme,
|
|
127
|
+
backgroundColorProp,
|
|
128
|
+
colorProp,
|
|
129
|
+
borderOpacityProp
|
|
130
|
+
)),
|
|
131
|
+
opacity: disabled ? 0.38 : 1,
|
|
104
132
|
...__css,
|
|
105
133
|
}}
|
|
106
134
|
{...otherProps}
|