@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
package/src/Select/Select.tsx
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
forwardRef,
|
|
3
|
-
useState,
|
|
4
|
-
useRef,
|
|
5
|
-
ForwardRefExoticComponent,
|
|
6
|
-
RefAttributes,
|
|
7
|
-
useEffect,
|
|
8
|
-
} from 'react';
|
|
1
|
+
import { forwardRef, useState, useRef, useEffect, useId } from 'react';
|
|
9
2
|
|
|
10
3
|
import type * as React from 'react';
|
|
11
4
|
import {
|
|
12
5
|
wrapEvent,
|
|
13
|
-
useId,
|
|
14
6
|
assignMultipleRefs,
|
|
15
7
|
useControlledState,
|
|
16
8
|
} from '@basic-ui/core';
|
|
17
9
|
import { useTheme, Theme } from '../theme';
|
|
18
|
-
import {
|
|
19
|
-
Select as SelectComp,
|
|
20
|
-
SelectButton,
|
|
21
|
-
SelectProps as BaseSelectProps,
|
|
22
|
-
} from './styledComponents';
|
|
10
|
+
import { Select as SelectComp, SelectButton } from './styledComponents';
|
|
23
11
|
import { FilledContainer } from '../TextField/FilledContainer';
|
|
24
12
|
import { HelperText } from '../TextField/HelperText';
|
|
25
13
|
import { OutlinedContainer } from '../TextField/OutlinedContainer';
|
|
@@ -27,7 +15,7 @@ import { SelectProvider } from './context';
|
|
|
27
15
|
import { Menu, MenuPopover, MenuList } from '../Menu';
|
|
28
16
|
import { SelectIcon } from './SelectIcon';
|
|
29
17
|
import { makeDefaultRender } from './defaultRender';
|
|
30
|
-
import { Box } from '../Box';
|
|
18
|
+
import { Box, BoxProps } from '../Box';
|
|
31
19
|
import { IconContainer } from '../TextField/IconContainer';
|
|
32
20
|
|
|
33
21
|
const componentMap = {
|
|
@@ -37,7 +25,7 @@ const componentMap = {
|
|
|
37
25
|
|
|
38
26
|
export interface SelectProps
|
|
39
27
|
extends Omit<
|
|
40
|
-
React.SelectHTMLAttributes<HTMLSelectElement
|
|
28
|
+
BoxProps<HTMLSelectElement, React.SelectHTMLAttributes<HTMLSelectElement>>,
|
|
41
29
|
'value' | 'defaultValue' | 'onChange'
|
|
42
30
|
> {
|
|
43
31
|
variant?: 'outlined' | 'filled';
|
|
@@ -108,7 +96,10 @@ export const Select = forwardRef<
|
|
|
108
96
|
|
|
109
97
|
const handleOnChange = (e: any) => {
|
|
110
98
|
onChange &&
|
|
111
|
-
onChange(
|
|
99
|
+
onChange(
|
|
100
|
+
e as any,
|
|
101
|
+
native ? e.target.value : e.currentTarget.dataset.value
|
|
102
|
+
);
|
|
112
103
|
};
|
|
113
104
|
|
|
114
105
|
const hasError = Boolean(error);
|
|
@@ -122,9 +113,9 @@ export const Select = forwardRef<
|
|
|
122
113
|
|
|
123
114
|
const labelIsFloating = hasFocus || open || renderValue(value) !== undefined;
|
|
124
115
|
|
|
125
|
-
const Comp:
|
|
126
|
-
|
|
127
|
-
|
|
116
|
+
const Comp: React.ComponentType<any> = native
|
|
117
|
+
? (SelectComp as any)
|
|
118
|
+
: (SelectButton as any);
|
|
128
119
|
|
|
129
120
|
useEffect(() => {
|
|
130
121
|
// right after mounting, if the default value in the select element
|
|
@@ -170,6 +161,7 @@ export const Select = forwardRef<
|
|
|
170
161
|
aria-describedby={helperTextId}
|
|
171
162
|
hasLabel={!!label}
|
|
172
163
|
leadingIcon={Boolean(leadingIcon)}
|
|
164
|
+
trailingIcon={true}
|
|
173
165
|
{...otherProps}
|
|
174
166
|
>
|
|
175
167
|
{native ? children : renderValue(value)}
|
|
@@ -182,20 +174,6 @@ export const Select = forwardRef<
|
|
|
182
174
|
minWidth: buttonRef?.current?.offsetWidth,
|
|
183
175
|
}}
|
|
184
176
|
role="listbox"
|
|
185
|
-
__css={
|
|
186
|
-
variant === 'filled'
|
|
187
|
-
? {
|
|
188
|
-
"[data-popper-placement='top'] &": {
|
|
189
|
-
borderBottomLeftRadius: 0,
|
|
190
|
-
borderBottomRightRadius: 0,
|
|
191
|
-
},
|
|
192
|
-
"[data-popper-placement='bottom'] &": {
|
|
193
|
-
borderTopLeftRadius: 0,
|
|
194
|
-
borderTopRightRadius: 0,
|
|
195
|
-
},
|
|
196
|
-
}
|
|
197
|
-
: {}
|
|
198
|
-
}
|
|
199
177
|
>
|
|
200
178
|
{children}
|
|
201
179
|
</MenuList>
|
|
@@ -3,6 +3,7 @@ import type * as React from 'react';
|
|
|
3
3
|
import { Box, BoxProps } from '../Box';
|
|
4
4
|
import { rem } from 'polished';
|
|
5
5
|
import { alpha } from '../color';
|
|
6
|
+
import { PADDING_RIGHT_WITH_ICON } from '../TextField/consts';
|
|
6
7
|
|
|
7
8
|
export type SelectIconProps = BoxProps<
|
|
8
9
|
SVGElement,
|
|
@@ -22,7 +23,7 @@ export const SelectIcon = forwardRef<SVGElement, SelectIconProps>(
|
|
|
22
23
|
__css={{
|
|
23
24
|
position: 'absolute',
|
|
24
25
|
top: `calc(50% - ${rem(12)})`,
|
|
25
|
-
right: rem(
|
|
26
|
+
right: rem(PADDING_RIGHT_WITH_ICON),
|
|
26
27
|
width: rem(24),
|
|
27
28
|
height: rem(24),
|
|
28
29
|
color: open ? 'primary' : alpha('on.surface', 0.54),
|
|
@@ -26,17 +26,21 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
|
26
26
|
const SelectButtonInner = forwardRef<
|
|
27
27
|
HTMLButtonElement,
|
|
28
28
|
SelectProps & { innerAs?: React.ElementType<any> }
|
|
29
|
-
>(({ innerAs = '
|
|
29
|
+
>(({ innerAs = 'div', ...props }, forwardedRef) => {
|
|
30
30
|
const InputButton: React.FC<
|
|
31
31
|
SelectProps & React.RefAttributes<HTMLButtonElement>
|
|
32
32
|
> = Input as any;
|
|
33
33
|
|
|
34
|
-
return
|
|
34
|
+
return (
|
|
35
|
+
<InputButton as={innerAs} ref={forwardedRef} tabIndex={0} {...props} />
|
|
36
|
+
);
|
|
35
37
|
});
|
|
36
38
|
|
|
37
39
|
export const SelectButton = forwardRef<
|
|
38
40
|
HTMLButtonElement,
|
|
39
41
|
SelectProps & MenuButtonProps
|
|
40
|
-
>(({ as, ...props }, ref) => (
|
|
41
|
-
<BaseMenuButton as={SelectButtonInner} innerAs={as} ref={ref} {...props}
|
|
42
|
+
>(({ as, children, ...props }, ref) => (
|
|
43
|
+
<BaseMenuButton as={SelectButtonInner} innerAs={as} ref={ref} {...props}>
|
|
44
|
+
{children}
|
|
45
|
+
</BaseMenuButton>
|
|
42
46
|
));
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Skeleton } from './';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
2
|
import { Box } from '../Box';
|
|
4
3
|
import { Text } from '../Text';
|
|
5
4
|
import { DelayAppearance } from './DelayAppearance';
|
|
6
5
|
|
|
6
|
+
export default {
|
|
7
|
+
title: 'components/Skeleton',
|
|
8
|
+
};
|
|
9
|
+
|
|
7
10
|
const Skeletons = ({
|
|
8
11
|
animation = 'pulse',
|
|
9
12
|
}: {
|
|
@@ -17,11 +20,11 @@ const Skeletons = ({
|
|
|
17
20
|
animation={animation}
|
|
18
21
|
width={60}
|
|
19
22
|
height={60}
|
|
20
|
-
borderRadius="
|
|
23
|
+
borderRadius="full"
|
|
21
24
|
m={2}
|
|
22
25
|
/>
|
|
23
26
|
<Skeleton animation={animation} m={2}>
|
|
24
|
-
<Box width={60} height={60} borderRadius="
|
|
27
|
+
<Box width={60} height={60} borderRadius="full" />
|
|
25
28
|
</Skeleton>
|
|
26
29
|
</Box>
|
|
27
30
|
);
|
|
@@ -46,11 +49,9 @@ const Example = () => {
|
|
|
46
49
|
);
|
|
47
50
|
};
|
|
48
51
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
stories.add('controlled', () => <Example />);
|
|
52
|
-
stories.add('controlled, delayed appearance', () => (
|
|
52
|
+
export const Default = () => <Example />;
|
|
53
|
+
export const DelayedAppearance = () => (
|
|
53
54
|
<DelayAppearance>
|
|
54
55
|
<Example />
|
|
55
56
|
</DelayAppearance>
|
|
56
|
-
)
|
|
57
|
+
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Snackbar } from './';
|
|
3
|
-
import { storiesOf } from '@storybook/react';
|
|
4
3
|
import { Box } from '../Box';
|
|
5
4
|
import { Button } from '../Button';
|
|
6
5
|
import { Select } from '../Select';
|
|
@@ -9,6 +8,10 @@ import { Link } from '../Link';
|
|
|
9
8
|
import { StackProvider, useStack } from './Stack';
|
|
10
9
|
// import './styles.css';
|
|
11
10
|
|
|
11
|
+
export default {
|
|
12
|
+
title: 'components/Snackbar',
|
|
13
|
+
};
|
|
14
|
+
|
|
12
15
|
const Example = () => {
|
|
13
16
|
return (
|
|
14
17
|
<>
|
|
@@ -90,8 +93,6 @@ const SnackbarStackExample = () => {
|
|
|
90
93
|
);
|
|
91
94
|
};
|
|
92
95
|
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
stories.add('controlled', () => <ControlledExample />);
|
|
97
|
-
stories.add('snackbar stack', () => <SnackbarStackExample />);
|
|
96
|
+
export const Default = () => <Example />;
|
|
97
|
+
export const Controlled = () => <ControlledExample />;
|
|
98
|
+
export const SnackbarStack = () => <SnackbarStackExample />;
|
|
@@ -39,21 +39,21 @@ export const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(
|
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<Paper
|
|
42
|
-
elevation={
|
|
43
|
-
backgroundOverlay={
|
|
42
|
+
elevation={4}
|
|
43
|
+
backgroundOverlay={4}
|
|
44
44
|
className={
|
|
45
45
|
colorMode === 'default' ? DARK_THEME_CLASS : DEFAULT_THEME_CLASS
|
|
46
46
|
}
|
|
47
47
|
ref={assignMultipleRefs(forwardedRef, ref)}
|
|
48
48
|
__css={{
|
|
49
|
-
boxShadow:
|
|
49
|
+
boxShadow: 4,
|
|
50
50
|
py: rem(6),
|
|
51
51
|
pl: 3,
|
|
52
52
|
pr: 3,
|
|
53
53
|
display: 'inline-flex',
|
|
54
54
|
minWidth: `min(100%, ${rem(344)})`,
|
|
55
55
|
maxWidth: ['100%', 'unset'],
|
|
56
|
-
borderRadius:
|
|
56
|
+
borderRadius: 'extra-small',
|
|
57
57
|
color: 'on.surface',
|
|
58
58
|
flexDirection: 'row',
|
|
59
59
|
willChange: 'transform,opacity',
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Switch } from './';
|
|
2
2
|
import { Box } from '../';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'components/Switch',
|
|
6
|
+
};
|
|
4
7
|
|
|
5
8
|
const Example = () => {
|
|
6
9
|
return (
|
|
@@ -21,6 +24,4 @@ const Example = () => {
|
|
|
21
24
|
);
|
|
22
25
|
};
|
|
23
26
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
stories.add('controlled', () => <Example />);
|
|
27
|
+
export const Default = () => <Example />;
|
package/src/Switch/Switch.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import type * as React from 'react';
|
|
|
3
3
|
import { RippleBox, RippleBoxProps } from '../Ripple';
|
|
4
4
|
import { Box, BoxProps } from '../Box';
|
|
5
5
|
import { useTheme } from '../theme';
|
|
6
|
-
import { rem } from 'polished';
|
|
7
6
|
import { CheckBox as _CheckBoxCore } from '@basic-ui/core';
|
|
8
7
|
import {
|
|
9
8
|
SelectionControlLabel,
|
|
@@ -42,8 +41,8 @@ const SwitchInner = forwardRef<HTMLInputElement, SwitchProps>(
|
|
|
42
41
|
|
|
43
42
|
return (
|
|
44
43
|
<Box p={2} display="inline-block" minWidth="auto">
|
|
45
|
-
<Box position="relative"
|
|
46
|
-
<SwitchTrail checked={checked} />
|
|
44
|
+
<Box position="relative">
|
|
45
|
+
<SwitchTrail checked={checked} disabled={disabled} />
|
|
47
46
|
<SwitchThumb checked={checked}>
|
|
48
47
|
<RippleBox<
|
|
49
48
|
RippleBoxProps<
|
|
@@ -52,6 +51,7 @@ const SwitchInner = forwardRef<HTMLInputElement, SwitchProps>(
|
|
|
52
51
|
>
|
|
53
52
|
>
|
|
54
53
|
as={Comp}
|
|
54
|
+
role="switch"
|
|
55
55
|
type="checkbox"
|
|
56
56
|
checked={checked}
|
|
57
57
|
onChange={onChange}
|
|
@@ -64,20 +64,21 @@ const SwitchInner = forwardRef<HTMLInputElement, SwitchProps>(
|
|
|
64
64
|
focusOpacity={0.12}
|
|
65
65
|
center={true}
|
|
66
66
|
disabled={disabled}
|
|
67
|
+
data-switch-thumb=""
|
|
67
68
|
{...otherProps}
|
|
68
69
|
__css={{
|
|
69
70
|
top: '50%',
|
|
70
71
|
left: '50%',
|
|
71
72
|
backgroundColor: 'transparent',
|
|
72
73
|
transform: 'translate(-50%, -50%)',
|
|
73
|
-
width:
|
|
74
|
-
height:
|
|
74
|
+
width: '100%',
|
|
75
|
+
height: '100%',
|
|
75
76
|
appearance: 'none',
|
|
76
77
|
':focus': {
|
|
77
78
|
outline: 'none',
|
|
78
79
|
},
|
|
79
80
|
border: 'none',
|
|
80
|
-
borderRadius: '
|
|
81
|
+
borderRadius: 'full',
|
|
81
82
|
zIndex: 1,
|
|
82
83
|
position: 'absolute',
|
|
83
84
|
...__css,
|
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
import { rem } from 'polished';
|
|
2
2
|
import { Box } from '../Box';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const BORDER_WIDTH = 2;
|
|
5
|
+
const TRAIL_WIDTH = 52;
|
|
6
|
+
const TRAIL_HEIGHT = 32;
|
|
7
|
+
const CIRCLE_SIZE_INACTIVE_CHECKED = 24;
|
|
8
|
+
const CIRCLE_SIZE_ACTIVE_CHECKED = 28;
|
|
9
|
+
const CIRCLE_SIZE_INACTIVE_UNCHECKED = 16;
|
|
10
|
+
const CIRCLE_SIZE_ACTIVE_UNCHECKED = 28;
|
|
11
|
+
|
|
12
|
+
export const SwitchTrail = ({
|
|
13
|
+
checked = false,
|
|
14
|
+
disabled = false,
|
|
15
|
+
...otherProps
|
|
16
|
+
}) => (
|
|
5
17
|
<Box
|
|
6
18
|
__css={{
|
|
7
|
-
width: rem(
|
|
8
|
-
height: rem(
|
|
9
|
-
borderRadius: rem(
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
width: rem(TRAIL_WIDTH),
|
|
20
|
+
height: rem(TRAIL_HEIGHT),
|
|
21
|
+
borderRadius: rem(TRAIL_HEIGHT / 2),
|
|
22
|
+
borderWidth: rem(BORDER_WIDTH),
|
|
23
|
+
borderStyle: 'solid',
|
|
24
|
+
backgroundColor: checked ? 'primary' : 'surface-variant',
|
|
25
|
+
borderColor: checked ? 'primary' : 'outline',
|
|
26
|
+
...(disabled && {
|
|
27
|
+
opacity: 0.12,
|
|
28
|
+
backgroundColor: checked ? 'on.surface' : 'surface-variant',
|
|
29
|
+
borderColor: 'on.surface',
|
|
30
|
+
}),
|
|
12
31
|
}}
|
|
13
32
|
{...otherProps}
|
|
14
33
|
/>
|
|
15
34
|
);
|
|
16
35
|
|
|
36
|
+
const THUMB_SIZE = 40;
|
|
17
37
|
export const SwitchThumb = ({ checked = false, ...otherProps }) => (
|
|
18
38
|
<Box
|
|
19
39
|
position="absolute"
|
|
20
|
-
width={rem(
|
|
21
|
-
height={rem(
|
|
22
|
-
borderRadius=
|
|
23
|
-
left={
|
|
24
|
-
top={
|
|
40
|
+
width={rem(THUMB_SIZE)}
|
|
41
|
+
height={rem(THUMB_SIZE)}
|
|
42
|
+
borderRadius="full"
|
|
43
|
+
left={'50%'}
|
|
44
|
+
top={'50%'}
|
|
25
45
|
__css={{
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
transform: `translateX(calc(-50% ${checked ? '+' : '-'} ${rem(
|
|
47
|
+
(TRAIL_WIDTH - CIRCLE_SIZE_INACTIVE_CHECKED - BORDER_WIDTH * 4) / 2
|
|
48
|
+
)})) translateY(-50%)`,
|
|
28
49
|
WebkitTapHighlightColor: 'transparent',
|
|
29
50
|
transition:
|
|
30
|
-
'background-color 90ms cubic-bezier(.4,0,.2,1),border-color 90ms cubic-bezier(.4,0,.2,1),transform 90ms cubic-bezier(.4,0,.2,1)',
|
|
51
|
+
'background-color 90ms cubic-bezier(.4,0,.2,1),border-color 90ms cubic-bezier(.4,0,.2,1),transform 90ms cubic-bezier(.4,0,.2,1),height 90ms cubic-bezier(.4,0,.2,1),width 90ms cubic-bezier(.4,0,.2,1)',
|
|
52
|
+
'& > input': {
|
|
53
|
+
width: THUMB_SIZE,
|
|
54
|
+
height: THUMB_SIZE,
|
|
55
|
+
},
|
|
31
56
|
}}
|
|
32
57
|
{...otherProps}
|
|
33
58
|
/>
|
|
@@ -37,22 +62,44 @@ export const SwitchCircle = ({ checked = false, ...otherProps }) => (
|
|
|
37
62
|
<Box
|
|
38
63
|
__css={{
|
|
39
64
|
position: 'absolute',
|
|
40
|
-
width:
|
|
41
|
-
|
|
42
|
-
|
|
65
|
+
width: checked
|
|
66
|
+
? rem(CIRCLE_SIZE_INACTIVE_CHECKED)
|
|
67
|
+
: rem(CIRCLE_SIZE_INACTIVE_UNCHECKED),
|
|
68
|
+
height: checked
|
|
69
|
+
? rem(CIRCLE_SIZE_INACTIVE_CHECKED)
|
|
70
|
+
: rem(CIRCLE_SIZE_INACTIVE_UNCHECKED),
|
|
43
71
|
boxSizing: 'border-box',
|
|
44
|
-
|
|
45
|
-
borderStyle: 'solid',
|
|
46
|
-
borderRadius: '50%',
|
|
72
|
+
borderRadius: 'full',
|
|
47
73
|
pointerEvents: 'none',
|
|
48
74
|
zIndex: 1,
|
|
49
|
-
backgroundColor: checked ? 'primary' : '
|
|
50
|
-
borderColor: checked ? 'primary' : '#fff',
|
|
75
|
+
backgroundColor: checked ? 'on.primary' : 'outline',
|
|
51
76
|
top: '50%',
|
|
52
77
|
left: '50%',
|
|
53
78
|
transform: 'translate(-50%, -50%)',
|
|
54
79
|
transition: 'inherit',
|
|
80
|
+
'[data-switch-thumb=""]:active ~ &, [data-switch-thumb=""]:focus-visible ~ &, [data-switch-thumb=""]:hover ~ &': {
|
|
81
|
+
backgroundColor: checked ? 'primary-container' : 'on.surface-variant',
|
|
82
|
+
},
|
|
83
|
+
'[data-switch-thumb=""]:active ~ &, [data-switch-thumb=""]:focus-visible ~ &': {
|
|
84
|
+
height: checked
|
|
85
|
+
? CIRCLE_SIZE_ACTIVE_CHECKED
|
|
86
|
+
: CIRCLE_SIZE_ACTIVE_UNCHECKED,
|
|
87
|
+
width: checked
|
|
88
|
+
? CIRCLE_SIZE_ACTIVE_CHECKED
|
|
89
|
+
: CIRCLE_SIZE_ACTIVE_UNCHECKED,
|
|
90
|
+
},
|
|
91
|
+
'[data-switch-thumb=""]:disabled ~ &': {
|
|
92
|
+
opacity: checked ? 1 : 0.38,
|
|
93
|
+
backgroundColor: checked ? 'surface' : 'on.surface',
|
|
94
|
+
height: checked
|
|
95
|
+
? CIRCLE_SIZE_INACTIVE_CHECKED
|
|
96
|
+
: CIRCLE_SIZE_INACTIVE_UNCHECKED,
|
|
97
|
+
width: checked
|
|
98
|
+
? CIRCLE_SIZE_INACTIVE_CHECKED
|
|
99
|
+
: CIRCLE_SIZE_INACTIVE_UNCHECKED,
|
|
100
|
+
},
|
|
55
101
|
}}
|
|
102
|
+
data-switch-circle=""
|
|
56
103
|
role="presentation"
|
|
57
104
|
aria-hidden="true"
|
|
58
105
|
{...otherProps}
|
package/src/Tab/Tab.story.tsx
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Tabs, TabList, Tab, TabPanels, TabPanel } from './';
|
|
2
2
|
import { AppBar } from '../AppBar';
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
// import './styles.css';
|
|
5
5
|
|
|
6
|
+
export default {
|
|
7
|
+
title: 'components/Tab',
|
|
8
|
+
};
|
|
9
|
+
|
|
6
10
|
const Example = () => {
|
|
7
11
|
return (
|
|
8
12
|
<Tabs defaultIndex={0}>
|
|
@@ -45,7 +49,5 @@ const ExampleAppBar = () => {
|
|
|
45
49
|
);
|
|
46
50
|
};
|
|
47
51
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
stories.add('controlled', () => <Example />);
|
|
51
|
-
stories.add('with app bar', () => <ExampleAppBar />);
|
|
52
|
+
export const Controlled = () => <Example />;
|
|
53
|
+
export const WithAppBar = () => <ExampleAppBar />;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Table, TableRow, TableBody, TableHead, TableCell } from './';
|
|
2
2
|
import { Link } from '../Link';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'components/Table',
|
|
6
|
+
};
|
|
4
7
|
|
|
5
8
|
const data = {
|
|
6
9
|
items: [
|
|
@@ -221,6 +224,4 @@ const GitHubTable = () => {
|
|
|
221
224
|
);
|
|
222
225
|
};
|
|
223
226
|
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
stories.add('github table', () => <GitHubTable />);
|
|
227
|
+
export const Example = () => <GitHubTable />;
|
package/src/Table/Table.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { Paper, PaperProps } from '../Paper';
|
|
|
4
4
|
export type TableProps = PaperProps;
|
|
5
5
|
|
|
6
6
|
export const Table = forwardRef<HTMLDivElement, TableProps>((props, ref) => {
|
|
7
|
-
const { children, elevation =
|
|
7
|
+
const { children, elevation = 1, ...rest } = props;
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<Paper
|
package/src/Text/LoremIpsum.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { Text } from '.';
|
|
2
3
|
|
|
3
4
|
const phrase =
|
|
4
5
|
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tincidunt sem ut tincidunt eleifend. Cras eget sem nisi. Mauris at orci pretium, auctor ex non, vestibulum mauris. Etiam at nisi eu enim volutpat semper. Phasellus interdum tincidunt eleifend. Suspendisse potenti. Nulla dapibus felis in purus tristique pharetra. Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
export const LoremIpsum: FC<{ count: number }> = ({ count = 50 }) => {
|
|
6
8
|
const phrases = [];
|
|
7
9
|
for (let i = 0; i < count; i++) {
|
|
8
10
|
phrases.push(
|
package/src/Text/Text.story.tsx
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Text } from './';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
2
|
import { Box } from '../Box';
|
|
4
3
|
// import './styles.css';
|
|
5
4
|
|
|
5
|
+
export default {
|
|
6
|
+
title: 'components/Text',
|
|
7
|
+
};
|
|
8
|
+
|
|
6
9
|
const Example = () => {
|
|
7
10
|
const variantMapping = {
|
|
8
11
|
h1: 'Heading 1',
|
|
@@ -34,6 +37,4 @@ const Example = () => {
|
|
|
34
37
|
);
|
|
35
38
|
};
|
|
36
39
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
stories.add('all variants', () => <Example />);
|
|
40
|
+
export const AllVariants = () => <Example />;
|
|
@@ -7,6 +7,11 @@ import { LineRipple } from '../LineRipple';
|
|
|
7
7
|
import { rem } from 'polished';
|
|
8
8
|
import { alpha } from '../color';
|
|
9
9
|
import { Box, BoxProps } from '../Box';
|
|
10
|
+
import {
|
|
11
|
+
ICON_WIDTH,
|
|
12
|
+
PADDING_LEFT_WITHOUT_ICON,
|
|
13
|
+
PADDING_LEFT_WITH_ICON,
|
|
14
|
+
} from './consts';
|
|
10
15
|
|
|
11
16
|
const makeSelector = (
|
|
12
17
|
state:
|
|
@@ -33,7 +38,7 @@ const Overlay = (props: { forceActive?: boolean }) => {
|
|
|
33
38
|
right: 0,
|
|
34
39
|
backgroundColor: 'on.surface',
|
|
35
40
|
pointerEvents: 'none',
|
|
36
|
-
opacity: 0
|
|
41
|
+
opacity: 0,
|
|
37
42
|
[makeSelector('hover:not([disabled]):not(:focus)')]: !forceActive && {
|
|
38
43
|
opacity: get(theme, `buttons.overlays.filled.hover.opacity`),
|
|
39
44
|
},
|
|
@@ -99,7 +104,8 @@ export const FilledContainer = forwardRef<HTMLDivElement, FilledContainerProps>(
|
|
|
99
104
|
...otherProps
|
|
100
105
|
} = props;
|
|
101
106
|
|
|
102
|
-
const
|
|
107
|
+
const finalLabelHeight = 16;
|
|
108
|
+
const labelHeight = finalLabelHeight / 0.75;
|
|
103
109
|
const inputHeight = 56;
|
|
104
110
|
|
|
105
111
|
const color = error ? 'error' : colorProp;
|
|
@@ -112,25 +118,39 @@ export const FilledContainer = forwardRef<HTMLDivElement, FilledContainerProps>(
|
|
|
112
118
|
active={active || error}
|
|
113
119
|
__css={{
|
|
114
120
|
position: 'relative',
|
|
121
|
+
lineHeight: 0,
|
|
115
122
|
width: '100%',
|
|
116
|
-
backgroundColor: 'surface',
|
|
123
|
+
backgroundColor: 'surface-variant',
|
|
117
124
|
overflow: 'hidden',
|
|
118
125
|
boxSizing: 'border-box',
|
|
119
126
|
borderTopRightRadius: rem(4),
|
|
120
127
|
borderTopLeftRadius: rem(4),
|
|
121
|
-
color: alpha('on.surface', 0.
|
|
122
|
-
...(disabled && {
|
|
123
|
-
|
|
128
|
+
color: alpha('on.surface-variant', 0.87),
|
|
129
|
+
...(disabled && {
|
|
130
|
+
backgroundColor: alpha('on.surface-variant', 0.08),
|
|
131
|
+
color: alpha('on.surface-variant', 0.38),
|
|
132
|
+
}),
|
|
133
|
+
...(active && { color: 'primary' }),
|
|
124
134
|
}}
|
|
125
135
|
{...otherProps}
|
|
126
136
|
>
|
|
127
137
|
{label && (
|
|
128
138
|
<FloatingLabel
|
|
129
|
-
height={
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
height={inputHeight}
|
|
140
|
+
offsetX={
|
|
141
|
+
leadingIcon
|
|
142
|
+
? PADDING_LEFT_WITH_ICON +
|
|
143
|
+
ICON_WIDTH +
|
|
144
|
+
PADDING_LEFT_WITHOUT_ICON
|
|
145
|
+
: PADDING_LEFT_WITHOUT_ICON
|
|
146
|
+
}
|
|
132
147
|
translateX={0}
|
|
133
|
-
translateY={
|
|
148
|
+
translateY={
|
|
149
|
+
// To debug, delete these lines one by one to see it doing its work
|
|
150
|
+
-(inputHeight * 0.5) + // Put it at the top, crossing middle label
|
|
151
|
+
labelHeight * 0.75 * 0.5 + // Put it at position 0
|
|
152
|
+
8 // Add a 8px padding to the top
|
|
153
|
+
}
|
|
134
154
|
active={labelIsFloating}
|
|
135
155
|
htmlFor={inputId}
|
|
136
156
|
color={active || error ? color : undefined}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { rem } from 'polished';
|
|
2
|
-
import {
|
|
2
|
+
import { FC } from 'react';
|
|
3
3
|
import type * as React from 'react';
|
|
4
4
|
import { Box } from '../Box';
|
|
5
5
|
import { alpha } from '../color';
|
|
6
|
+
import { ICON_WIDTH, PADDING_LEFT_WITH_ICON } from './consts';
|
|
6
7
|
|
|
7
|
-
export const IconContainer:
|
|
8
|
+
export const IconContainer: FC<{
|
|
8
9
|
children?: React.ReactNode;
|
|
9
10
|
position: 'start' | 'end';
|
|
10
11
|
}> = ({ position, children }) => (
|
|
@@ -12,8 +13,8 @@ export const IconContainer: VFC<{
|
|
|
12
13
|
position="absolute"
|
|
13
14
|
__css={{
|
|
14
15
|
top: 0,
|
|
15
|
-
[position === 'start' ? 'left' : 'right']:
|
|
16
|
-
minWidth: rem(
|
|
16
|
+
[position === 'start' ? 'left' : 'right']: rem(PADDING_LEFT_WITH_ICON),
|
|
17
|
+
minWidth: rem(ICON_WIDTH),
|
|
17
18
|
display: 'inline-flex',
|
|
18
19
|
alignItems: 'center',
|
|
19
20
|
justifyContent: 'center',
|