@basic-ui/material 1.0.0-alpha.1 → 1.0.0-alpha.10
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 +248 -57
- 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/AppBar/AppBar.d.ts +3 -3
- package/build/esm/AppBar/AppBar.js +2 -2
- package/build/esm/AppBar/AppBar.js.map +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +1 -1
- package/build/esm/Badge/Badge.d.ts +1 -1
- package/build/esm/BaseLine/BaseLine.d.ts +1 -0
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +2 -2
- package/build/esm/BottomSheet/BottomSheetSurface.js +2 -2
- package/build/esm/BottomSheet/BottomSheetSurface.js.map +1 -1
- package/build/esm/Box/Box.d.ts +4 -4
- package/build/esm/Box/Box.js +1 -2
- package/build/esm/Box/Box.js.map +1 -1
- package/build/esm/Button/BaseButton.d.ts +3 -3
- package/build/esm/Button/BaseButton.js +0 -1
- package/build/esm/Button/BaseButton.js.map +1 -1
- package/build/esm/Button/Button.d.ts +4 -4
- package/build/esm/Button/Button.js +0 -1
- package/build/esm/Button/Button.js.map +1 -1
- package/build/esm/Button/ButtonGroup.d.ts +2 -2
- package/build/esm/Button/ButtonGroup.js +1 -1
- package/build/esm/Button/ButtonGroup.js.map +1 -1
- package/build/esm/Button/FilledButton.d.ts +1 -1
- package/build/esm/Button/FilledButton.js +6 -8
- package/build/esm/Button/FilledButton.js.map +1 -1
- package/build/esm/Button/OutlinedButton.d.ts +1 -1
- package/build/esm/Button/TransparentButton.d.ts +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +5 -5
- package/build/esm/CheckBox/CheckBox.js +0 -1
- package/build/esm/CheckBox/CheckBox.js.map +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +4 -4
- package/build/esm/CheckBox/CheckBoxIcon.js +2 -2
- package/build/esm/CheckBox/CheckBoxIcon.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +4 -4
- package/build/esm/Chip/ButtonChip.js +0 -1
- package/build/esm/Chip/ButtonChip.js.map +1 -1
- package/build/esm/Chip/ChipBase.d.ts +3 -3
- package/build/esm/Chip/ChipBase.js +0 -1
- package/build/esm/Chip/ChipBase.js.map +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +5 -5
- package/build/esm/Chip/ChoiceChip.js +0 -1
- package/build/esm/Chip/ChoiceChip.js.map +1 -1
- package/build/esm/ColorMode/ColorModeProvider.d.ts +3 -3
- package/build/esm/ColorMode/ColorModeProvider.js +0 -1
- package/build/esm/ColorMode/ColorModeProvider.js.map +1 -1
- package/build/esm/Combobox/Combobox.d.ts +13 -13
- package/build/esm/Combobox/Combobox.js +3 -3
- package/build/esm/Combobox/Combobox.js.map +1 -1
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +2 -2
- package/build/esm/Dialog/DialogBackdrop.js +0 -1
- package/build/esm/Dialog/DialogBackdrop.js.map +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +2 -2
- package/build/esm/Dialog/DialogSurface.js +0 -1
- package/build/esm/Dialog/DialogSurface.js.map +1 -1
- package/build/esm/Dialog/useDialogAnimation.js +3 -2
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +3 -3
- package/build/esm/Divider/Divider.js +0 -1
- package/build/esm/Divider/Divider.js.map +1 -1
- package/build/esm/FloatingLabel/FloatingLabel.d.ts +4 -4
- package/build/esm/FloatingLabel/FloatingLabel.js +3 -3
- package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +3 -3
- package/build/esm/LineRipple/LineRipple.js +2 -2
- package/build/esm/LineRipple/LineRipple.js.map +1 -1
- package/build/esm/Link/Link.d.ts +3 -3
- package/build/esm/Link/Link.js +0 -1
- package/build/esm/Link/Link.js.map +1 -1
- package/build/esm/List/List.d.ts +5 -5
- package/build/esm/List/List.js +0 -1
- package/build/esm/List/List.js.map +1 -1
- package/build/esm/ListItem/ListItem.d.ts +5 -5
- package/build/esm/ListItem/ListItem.js +3 -3
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/ListItem/ListItemText.d.ts +6 -6
- package/build/esm/ListItem/ListItemText.js +1 -2
- package/build/esm/ListItem/ListItemText.js.map +1 -1
- package/build/esm/Menu/Menu.d.ts +6 -6
- package/build/esm/Menu/Menu.js +5 -3
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/NavRail/NavRailItem.d.ts +15 -0
- package/build/esm/NavRail/NavRailItem.js +147 -0
- package/build/esm/NavRail/NavRailItem.js.map +1 -0
- package/build/esm/NavRail/index.d.ts +1 -0
- package/build/esm/NavRail/index.js +2 -0
- package/build/esm/NavRail/index.js.map +1 -0
- package/build/esm/NotchedOutline/NotchedOutline.d.ts +5 -5
- package/build/esm/NotchedOutline/NotchedOutline.js +0 -1
- package/build/esm/NotchedOutline/NotchedOutline.js.map +1 -1
- package/build/esm/NotchedOutline/styledComponents.d.ts +114 -1
- package/build/esm/NotchedOutline/styledComponents.js +3 -2
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Paper/Paper.d.ts +4 -4
- package/build/esm/Paper/Paper.js +0 -1
- package/build/esm/Paper/Paper.js.map +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.js +2 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.js.map +1 -1
- package/build/esm/RadioButton/RadioButton.js.map +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.d.ts +3 -3
- 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/Ripple/RippleBox.d.ts +1 -2
- package/build/esm/Ripple/RippleBox.js +0 -1
- package/build/esm/Ripple/RippleBox.js.map +1 -1
- package/build/esm/Ripple/useRippleHandlers.d.ts +3 -3
- package/build/esm/Ripple/useRippleHandlers.js.map +1 -1
- package/build/esm/Ripple/useRippleSurface.d.ts +5 -5
- package/build/esm/Ripple/useRippleSurface.js +61 -58
- package/build/esm/Ripple/useRippleSurface.js.map +1 -1
- package/build/esm/Select/Select.d.ts +6 -6
- package/build/esm/Select/Select.js +0 -1
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +3 -3
- package/build/esm/Select/SelectIcon.js +2 -2
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/Select/context.d.ts +2 -2
- package/build/esm/Select/context.js.map +1 -1
- package/build/esm/Select/defaultRender.d.ts +2 -1
- package/build/esm/Select/defaultRender.js.map +1 -1
- package/build/esm/Select/styledComponents.d.ts +9 -9
- package/build/esm/Select/styledComponents.js +0 -1
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +5 -5
- package/build/esm/SelectionControl/SelectionControlLabel.js +0 -1
- package/build/esm/SelectionControl/SelectionControlLabel.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +4 -4
- package/build/esm/SelectionControl/SelectionControlText.js +0 -1
- package/build/esm/SelectionControl/SelectionControlText.js.map +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +3 -3
- package/build/esm/Skeleton/DelayAppearance.js +0 -1
- package/build/esm/Skeleton/DelayAppearance.js.map +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +6 -6
- package/build/esm/Skeleton/Skeleton.js +0 -1
- package/build/esm/Skeleton/Skeleton.js.map +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +3 -3
- package/build/esm/Snackbar/Snackbar.js +1 -2
- package/build/esm/Snackbar/Snackbar.js.map +1 -1
- package/build/esm/Snackbar/Stack.d.ts +2 -3
- package/build/esm/Snackbar/Stack.js +0 -1
- package/build/esm/Snackbar/Stack.js.map +1 -1
- package/build/esm/Snackbar/useSnackbarAnimation.d.ts +2 -2
- package/build/esm/Snackbar/useSnackbarAnimation.js +2 -1
- package/build/esm/Snackbar/useSnackbarAnimation.js.map +1 -1
- package/build/esm/Switch/Switch.d.ts +4 -5
- package/build/esm/Switch/Switch.js +0 -1
- package/build/esm/Switch/Switch.js.map +1 -1
- package/build/esm/Switch/styledComponents.d.ts +1 -0
- package/build/esm/Switch/styledComponents.js +2 -1
- package/build/esm/Switch/styledComponents.js.map +1 -1
- package/build/esm/Tab/Tab.d.ts +3 -3
- package/build/esm/Tab/Tab.js +2 -3
- package/build/esm/Tab/Tab.js.map +1 -1
- package/build/esm/Tab/TabList.d.ts +1 -1
- package/build/esm/Tab/TabPanel.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.js +2 -1
- package/build/esm/TabIndicator/TabIndicator.js.map +1 -1
- package/build/esm/TabIndicator/context.d.ts +2 -2
- package/build/esm/TabIndicator/context.js.map +1 -1
- package/build/esm/Table/Table.d.ts +1 -1
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Table/TableRow.js +1 -1
- package/build/esm/Table/TableRow.js.map +1 -1
- package/build/esm/Text/LoremIpsum.js +1 -1
- package/build/esm/Text/LoremIpsum.js.map +1 -1
- package/build/esm/Text/Text.d.ts +8 -4
- package/build/esm/Text/Text.js +5 -2
- package/build/esm/Text/Text.js.map +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +4 -4
- package/build/esm/TextField/FilledContainer.js +0 -1
- package/build/esm/TextField/FilledContainer.js.map +1 -1
- package/build/esm/TextField/HelperText.d.ts +5 -5
- package/build/esm/TextField/HelperText.js +1 -2
- package/build/esm/TextField/HelperText.js.map +1 -1
- package/build/esm/TextField/IconContainer.d.ts +2 -3
- package/build/esm/TextField/IconContainer.js +0 -1
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/TextField/Input.d.ts +4 -4
- package/build/esm/TextField/Input.js +2 -1
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +4 -4
- package/build/esm/TextField/OutlinedContainer.js +0 -1
- package/build/esm/TextField/OutlinedContainer.js.map +1 -1
- package/build/esm/TextField/TextField.d.ts +5 -5
- package/build/esm/TextField/TextField.js +0 -1
- package/build/esm/TextField/TextField.js.map +1 -1
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +2 -2
- package/build/esm/ThemeExplorer/ThemeColors.js +1 -1
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -1
- package/build/esm/ThemeExplorer/components.d.ts +5 -6
- package/build/esm/ThemeExplorer/components.js +4 -3
- package/build/esm/ThemeExplorer/components.js.map +1 -1
- package/build/esm/ThemeExplorer/makeColorScheme.js +2 -1
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -1
- package/build/esm/ThemeExplorer/useDeferredColor.js +2 -1
- package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +3 -3
- package/build/esm/Tooltip/Tooltip.js +5 -8
- package/build/esm/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/color.d.ts +2 -0
- package/build/esm/color.js +8 -3
- package/build/esm/color.js.map +1 -1
- package/build/esm/index.d.ts +2 -0
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/motion.d.ts +7 -0
- package/build/esm/motion.js +8 -0
- package/build/esm/motion.js.map +1 -0
- package/build/esm/theme/theme.d.ts +114 -1
- package/build/esm/theme/theme.js +42 -7
- package/build/esm/theme/theme.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/Alert/Alert.tsx +1 -1
- package/src/AppBar/AppBar.tsx +4 -3
- package/src/BottomSheet/BottomSheetSurface.tsx +5 -4
- package/src/Box/Box.tsx +6 -8
- package/src/Button/BaseButton.tsx +3 -11
- package/src/Button/Button.story.tsx +21 -4
- package/src/Button/Button.tsx +4 -4
- package/src/Button/ButtonGroup.tsx +1 -1
- package/src/Button/FilledButton.tsx +4 -9
- package/src/Button/SpinnerButton.story.tsx +1 -1
- package/src/CheckBox/CheckBox.story.tsx +2 -2
- package/src/CheckBox/CheckBox.tsx +6 -10
- package/src/CheckBox/CheckBoxIcon.tsx +5 -5
- package/src/Chip/ButtonChip.tsx +3 -3
- package/src/Chip/Chip.story.tsx +1 -1
- package/src/Chip/ChipBase.tsx +2 -2
- package/src/Chip/ChoiceChip.tsx +7 -7
- package/src/ColorMode/ColorModeProvider.tsx +3 -3
- package/src/Combobox/Combobox.story.tsx +3 -3
- package/src/Combobox/Combobox.tsx +9 -10
- package/src/Dialog/DialogBackdrop.tsx +3 -3
- package/src/Dialog/DialogSurface.tsx +2 -4
- package/src/Dialog/useDialogAnimation.tsx +3 -4
- package/src/Divider/Divider.tsx +2 -2
- package/src/FloatingLabel/FloatingLabel.tsx +7 -6
- package/src/LineRipple/LineRipple.story.tsx +1 -1
- package/src/LineRipple/LineRipple.tsx +4 -4
- package/src/Link/Link.tsx +2 -5
- package/src/List/List.tsx +4 -4
- package/src/ListItem/ListItem.tsx +6 -6
- package/src/ListItem/ListItemText.tsx +6 -7
- package/src/Menu/Menu.tsx +5 -5
- package/src/NavRail/NavRail.story.tsx +190 -0
- package/src/NavRail/NavRailItem.tsx +176 -0
- package/src/NavRail/index.ts +1 -0
- package/src/NotchedOutline/NotchedOutline.tsx +4 -5
- package/src/NotchedOutline/styledComponents.ts +2 -1
- package/src/Paper/Paper.story.tsx +3 -3
- package/src/Paper/Paper.tsx +3 -3
- package/src/ProgressSpinner/ProgressSpinner.tsx +2 -2
- package/src/RadioButton/RadioButton.story.tsx +2 -2
- package/src/RadioButton/RadioButton.tsx +1 -1
- package/src/RadioButton/RadioButtonIcon.tsx +4 -5
- package/src/Ripple/Ripple.story.tsx +1 -1
- package/src/Ripple/RippleBox.tsx +1 -2
- package/src/Ripple/useRippleHandlers.ts +3 -3
- package/src/Ripple/useRippleSurface.ts +77 -61
- package/src/Select/Select.tsx +11 -6
- package/src/Select/SelectIcon.tsx +3 -4
- package/src/Select/context.ts +2 -1
- package/src/Select/defaultRender.ts +2 -1
- package/src/Select/styledComponents.tsx +13 -11
- package/src/SelectionControl/SelectionControlLabel.tsx +4 -8
- package/src/SelectionControl/SelectionControlText.tsx +3 -3
- package/src/Skeleton/DelayAppearance.tsx +2 -2
- package/src/Skeleton/Skeleton.story.tsx +2 -2
- package/src/Skeleton/Skeleton.tsx +6 -6
- package/src/Snackbar/Snackbar.tsx +3 -3
- package/src/Snackbar/Stack.tsx +6 -9
- package/src/Snackbar/useSnackbarAnimation.ts +4 -3
- package/src/Switch/Switch.tsx +6 -10
- package/src/Switch/styledComponents.tsx +2 -2
- package/src/Tab/Tab.tsx +3 -7
- package/src/TabIndicator/TabIndicator.tsx +2 -1
- package/src/TabIndicator/context.ts +2 -1
- package/src/Table/TableRow.tsx +1 -1
- package/src/Text/LoremIpsum.tsx +1 -1
- package/src/Text/Text.story.tsx +42 -7
- package/src/Text/Text.tsx +25 -5
- package/src/TextField/FilledContainer.tsx +3 -3
- package/src/TextField/HelperText.tsx +5 -5
- package/src/TextField/IconContainer.tsx +2 -3
- package/src/TextField/Input.tsx +5 -4
- package/src/TextField/OutlinedContainer.tsx +3 -3
- package/src/TextField/TextField.tsx +4 -4
- package/src/ThemeExplorer/ThemeBuilder.story.tsx +29 -25
- package/src/ThemeExplorer/ThemeColors.tsx +1 -1
- package/src/ThemeExplorer/components.tsx +8 -3
- package/src/ThemeExplorer/makeColorScheme.tsx +1 -1
- package/src/ThemeExplorer/useDeferredColor.tsx +1 -1
- package/src/Tooltip/Tooltip.story.tsx +1 -1
- package/src/Tooltip/Tooltip.tsx +9 -11
- package/src/color.ts +25 -4
- package/src/index.ts +2 -0
- package/src/motion.ts +7 -0
- package/src/theme/theme.ts +47 -6
- package/src/ThemeExplorer/ThemeExplorer.story.tsx +0 -43
|
@@ -17,6 +17,15 @@ const AppsIcon = (props) => (
|
|
|
17
17
|
</svg>
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
+
const NavigationIcon = (props) => (
|
|
21
|
+
<svg height={48} width={48} viewBox="0 0 48 48" {...props}>
|
|
22
|
+
<path
|
|
23
|
+
fill="currentColor"
|
|
24
|
+
d="m26.35 42-5.7-14.65L6 21.65V19.5L42 6 28.5 42Zm.9-5.7 9.6-25.15-25.1 9.6 11.2 4.3Zm-4.3-11.25Z"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
|
|
20
29
|
const Example = (props) => {
|
|
21
30
|
return (
|
|
22
31
|
<Box bg="surface">
|
|
@@ -44,15 +53,18 @@ const Example = (props) => {
|
|
|
44
53
|
</Box>
|
|
45
54
|
<Box p={3} display="flex" sx={{ gap: 2 }}>
|
|
46
55
|
<Button variant="fab-mini" elevation="floating" {...props}>
|
|
47
|
-
|
|
56
|
+
<NavigationIcon width="24px" height="24px" />
|
|
48
57
|
</Button>
|
|
49
58
|
<Button variant="fab" elevation="floating" {...props}>
|
|
50
|
-
|
|
59
|
+
<NavigationIcon width="24px" height="24px" />
|
|
51
60
|
</Button>
|
|
52
61
|
<Button variant="fab-large" elevation="floating" {...props}>
|
|
53
|
-
|
|
62
|
+
<NavigationIcon width="36px" height="36px" />
|
|
54
63
|
</Button>
|
|
55
64
|
<Button variant="fab-extended" elevation="floating" {...props}>
|
|
65
|
+
<Box mr={2} lineHeight={0}>
|
|
66
|
+
<NavigationIcon width="24px" height="24px" />
|
|
67
|
+
</Box>
|
|
56
68
|
Fab extended
|
|
57
69
|
</Button>
|
|
58
70
|
</Box>
|
|
@@ -87,7 +99,12 @@ export const DebugButtonClick = () => {
|
|
|
87
99
|
|
|
88
100
|
return (
|
|
89
101
|
<Box m={3}>
|
|
90
|
-
<Button
|
|
102
|
+
<Button
|
|
103
|
+
onClick={() => setCount((c) => c + 1)}
|
|
104
|
+
variant="filled"
|
|
105
|
+
elevation="none"
|
|
106
|
+
color="surface"
|
|
107
|
+
>
|
|
91
108
|
Click count: {count}
|
|
92
109
|
</Button>
|
|
93
110
|
</Box>
|
package/src/Button/Button.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ComponentType, ElementType, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import * as TransparentButton from './TransparentButton';
|
|
5
5
|
import * as FloatingActionButton from './FloatingActionButton';
|
|
@@ -46,8 +46,8 @@ const rippleMapping = {
|
|
|
46
46
|
export type ButtonColors = 'primary' | 'secondary' | string;
|
|
47
47
|
|
|
48
48
|
export interface ButtonProps extends BaseButtonProps {
|
|
49
|
-
as?:
|
|
50
|
-
children?:
|
|
49
|
+
as?: ElementType<any>;
|
|
50
|
+
children?: ReactNode;
|
|
51
51
|
variant?: ButtonVariants;
|
|
52
52
|
color?: ButtonColors;
|
|
53
53
|
disabled?: boolean;
|
|
@@ -78,7 +78,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
78
78
|
|
|
79
79
|
const theme = useTheme();
|
|
80
80
|
|
|
81
|
-
const Comp:
|
|
81
|
+
const Comp: ComponentType<any> = componentMapping[variant];
|
|
82
82
|
const getRippleProperties = rippleMapping[variant];
|
|
83
83
|
|
|
84
84
|
const rippleProps = useRippleSurface({
|
|
@@ -4,7 +4,7 @@ import { get, css } from '@styled-system/css';
|
|
|
4
4
|
|
|
5
5
|
import { BaseButton } from './BaseButton';
|
|
6
6
|
import type { Theme } from '../theme';
|
|
7
|
-
import { alpha,
|
|
7
|
+
import { alpha, mixColor } from '../color';
|
|
8
8
|
|
|
9
9
|
export const FilledButton = styled(BaseButton)(
|
|
10
10
|
({ color = 'primary', theme }) =>
|
|
@@ -29,14 +29,9 @@ export const FilledButton = styled(BaseButton)(
|
|
|
29
29
|
outlineOffset: '2px',
|
|
30
30
|
},
|
|
31
31
|
}),
|
|
32
|
-
({ color = 'primary'
|
|
33
|
-
color === 'surface' &&
|
|
34
|
-
|
|
35
|
-
theme,
|
|
36
|
-
get(theme, `buttons.elevations.${elevation}.boxShadow`, 0),
|
|
37
|
-
'primary'
|
|
38
|
-
),
|
|
39
|
-
},
|
|
32
|
+
({ color = 'primary' }) =>
|
|
33
|
+
color === 'surface' &&
|
|
34
|
+
css({ background: mixColor('surface', 'primary', 0.05) }),
|
|
40
35
|
({ color = 'primary', theme, isGroupedButton = false }) =>
|
|
41
36
|
isGroupedButton && {
|
|
42
37
|
'[data-button-group=""] &': {
|
|
@@ -2,7 +2,7 @@ import { useState, useRef } from 'react';
|
|
|
2
2
|
import { keyframes } from '@emotion/react';
|
|
3
3
|
import type { Keyframes } from '@emotion/serialize';
|
|
4
4
|
|
|
5
|
-
import { CheckBox, Box } from '../';
|
|
5
|
+
import { CheckBox, Box, EASING_STANDARD } from '../';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: 'components/CheckBox',
|
|
@@ -71,7 +71,7 @@ const HeartCheckBoxIcon = (props) => {
|
|
|
71
71
|
opacity: props.opacity,
|
|
72
72
|
color: props.borderColor,
|
|
73
73
|
animation: animation.current
|
|
74
|
-
? `${animation.current} .25s
|
|
74
|
+
? `${animation.current} .25s ${EASING_STANDARD}`
|
|
75
75
|
: undefined,
|
|
76
76
|
translate: 'scale(1)',
|
|
77
77
|
'& > svg': {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { InputHTMLAttributes } from 'react';
|
|
1
|
+
import type { ElementType, FC, InputHTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { forwardRef, cloneElement } from 'react';
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { rem } from 'polished';
|
|
5
4
|
import { CheckBox as _CheckBoxCore } from '@basic-ui/core';
|
|
6
5
|
|
|
@@ -16,20 +15,17 @@ import {
|
|
|
16
15
|
} from '../SelectionControl';
|
|
17
16
|
|
|
18
17
|
export interface CheckBoxProps
|
|
19
|
-
extends BoxProps<
|
|
20
|
-
|
|
21
|
-
React.InputHTMLAttributes<HTMLInputElement>
|
|
22
|
-
> {
|
|
23
|
-
as?: React.ElementType<any>;
|
|
18
|
+
extends BoxProps<HTMLInputElement, InputHTMLAttributes<HTMLInputElement>> {
|
|
19
|
+
as?: ElementType<any>;
|
|
24
20
|
checked?: boolean;
|
|
25
21
|
indeterminate?: boolean;
|
|
26
22
|
disabled?: boolean;
|
|
27
|
-
icon?:
|
|
23
|
+
icon?: ReactElement<{ checked?: boolean; disabled?: boolean }>;
|
|
28
24
|
}
|
|
29
25
|
|
|
30
|
-
const CheckBoxCore:
|
|
26
|
+
const CheckBoxCore: FC<
|
|
31
27
|
CheckBoxProps & {
|
|
32
|
-
innerAs?:
|
|
28
|
+
innerAs?: ElementType<any>;
|
|
33
29
|
}
|
|
34
30
|
> = _CheckBoxCore as any;
|
|
35
31
|
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import type { ElementType, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { rem } from 'polished';
|
|
4
4
|
|
|
5
5
|
import type { BoxProps } from '../Box';
|
|
6
6
|
import { Box } from '../Box';
|
|
7
7
|
import { CheckPath } from './CheckPath';
|
|
8
8
|
import { IndeterminatePath } from './IndeterminatePath';
|
|
9
|
+
import { EASING_STANDARD } from '../motion';
|
|
9
10
|
|
|
10
11
|
export interface CheckBoxIconProps extends BoxProps {
|
|
11
|
-
as?:
|
|
12
|
+
as?: ElementType<any>;
|
|
12
13
|
checked?: boolean;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
indeterminate?: boolean;
|
|
15
|
-
children?:
|
|
16
|
+
children?: ReactNode;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export const CheckBoxIcon = forwardRef<HTMLDivElement, CheckBoxIconProps>(
|
|
@@ -45,8 +46,7 @@ export const CheckBoxIcon = forwardRef<HTMLDivElement, CheckBoxIconProps>(
|
|
|
45
46
|
borderStyle: 'solid',
|
|
46
47
|
width: rem(18),
|
|
47
48
|
height: rem(18),
|
|
48
|
-
transition:
|
|
49
|
-
'background-color 90ms 0s cubic-bezier(0,0,.2,1), border-color 90ms 0s cubic-bezier(0,0,.2,1), opacity 90ms 0s cubic-bezier(0,0,.2,1)',
|
|
49
|
+
transition: `background-color 90ms 0s ${EASING_STANDARD}, border-color 90ms 0s ${EASING_STANDARD}, opacity 90ms 0s ${EASING_STANDARD}`,
|
|
50
50
|
'& > svg': {
|
|
51
51
|
display: 'block',
|
|
52
52
|
},
|
package/src/Chip/ButtonChip.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { rem } from 'polished';
|
|
4
4
|
|
|
5
5
|
import type { ChipBaseProps } from './ChipBase';
|
|
@@ -10,8 +10,8 @@ import { useTheme } from '../theme';
|
|
|
10
10
|
export type ButtonChipProps = ChipBaseProps & {
|
|
11
11
|
checked?: boolean;
|
|
12
12
|
disabled?: boolean;
|
|
13
|
-
leadingIcon?:
|
|
14
|
-
trailingIcon?:
|
|
13
|
+
leadingIcon?: ReactNode;
|
|
14
|
+
trailingIcon?: ReactNode;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
|
package/src/Chip/Chip.story.tsx
CHANGED
package/src/Chip/ChipBase.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { variant } from 'styled-system';
|
|
4
4
|
import { rem } from 'polished';
|
|
5
5
|
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
|
|
16
16
|
export type ChipBaseProps<
|
|
17
17
|
H = HTMLDivElement,
|
|
18
|
-
Attr =
|
|
18
|
+
Attr = HTMLAttributes<H>
|
|
19
19
|
> = BoxProps<H, Attr> & {
|
|
20
20
|
variant?: 'filled' | 'outlined';
|
|
21
21
|
backgroundColor?: string;
|
package/src/Chip/ChoiceChip.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { FC, InputHTMLAttributes, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { RadioButton, CheckBox } from '@basic-ui/core';
|
|
4
4
|
import { rem } from 'polished';
|
|
5
5
|
|
|
@@ -12,16 +12,16 @@ import { Box } from '../Box';
|
|
|
12
12
|
|
|
13
13
|
export type ChoiceChipProps = ChipBaseProps<
|
|
14
14
|
HTMLInputElement,
|
|
15
|
-
|
|
15
|
+
InputHTMLAttributes<HTMLInputElement>
|
|
16
16
|
> & {
|
|
17
17
|
checked?: boolean;
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
type: 'checkbox' | 'radio';
|
|
20
|
-
leadingIcon?:
|
|
21
|
-
trailingIcon?:
|
|
20
|
+
leadingIcon?: ReactNode;
|
|
21
|
+
trailingIcon?: ReactNode;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const InnerInput:
|
|
24
|
+
const InnerInput: FC<any> = forwardRef<HTMLInputElement, ChoiceChipProps>(
|
|
25
25
|
function InnerInput(props, forwardedRef) {
|
|
26
26
|
const {
|
|
27
27
|
type,
|
|
@@ -69,7 +69,7 @@ const InnerInput: React.FC<any> = forwardRef<HTMLInputElement, ChoiceChipProps>(
|
|
|
69
69
|
<RippleBox<
|
|
70
70
|
RippleBoxProps<
|
|
71
71
|
HTMLInputElement,
|
|
72
|
-
|
|
72
|
+
InputHTMLAttributes<HTMLInputElement>
|
|
73
73
|
>
|
|
74
74
|
>
|
|
75
75
|
as="input"
|
|
@@ -116,7 +116,7 @@ export const ChoiceChip = forwardRef<HTMLInputElement, ChoiceChipProps>(
|
|
|
116
116
|
function ChoiceChip(props, forwardedRef) {
|
|
117
117
|
const { type = 'checkbox', ...otherProps } = props;
|
|
118
118
|
|
|
119
|
-
const Comp:
|
|
119
|
+
const Comp: FC<ChoiceChipProps> = (
|
|
120
120
|
type === 'radio' ? RadioButton : CheckBox
|
|
121
121
|
) as any;
|
|
122
122
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
1
2
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { Global } from '@emotion/react';
|
|
4
4
|
|
|
5
5
|
import type { ColorMode } from './color-mode';
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from './constants';
|
|
12
12
|
|
|
13
13
|
interface ColorModeProviderProps {
|
|
14
|
-
children?:
|
|
14
|
+
children?: ReactNode;
|
|
15
15
|
styles: Record<string, Record<string, string>>;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -35,7 +35,7 @@ function saveColorMode(colorMode: ColorMode, saveToStorage = true) {
|
|
|
35
35
|
document.body.classList.replace(remove, add);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export const ColorModeProvider:
|
|
38
|
+
export const ColorModeProvider: FC<ColorModeProviderProps> = (props) => {
|
|
39
39
|
const { children, styles } = props;
|
|
40
40
|
const [colorMode, _setColorMode] = useState<ColorMode>();
|
|
41
41
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ChangeEvent } from 'react';
|
|
1
2
|
import { useMemo, useState } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
Combobox,
|
|
@@ -34,7 +34,7 @@ function UncontrolledClientSideExample({ initialValue = '' }) {
|
|
|
34
34
|
const [selected, setSelected] = useState(initialValue);
|
|
35
35
|
const results = useCityMatch(term);
|
|
36
36
|
|
|
37
|
-
const handleChange = (event:
|
|
37
|
+
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
38
38
|
setTerm(event.target.value);
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -92,7 +92,7 @@ function ControlledClientSideExample({ initialValue = '' }) {
|
|
|
92
92
|
const [selected, setSelected] = useState(initialValue);
|
|
93
93
|
const results = useCityMatch(term);
|
|
94
94
|
|
|
95
|
-
const handleChange = (event:
|
|
95
|
+
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
96
96
|
setTerm(event.target.value);
|
|
97
97
|
setSelected('');
|
|
98
98
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
1
|
+
import type { FC, HTMLAttributes, RefAttributes } from 'react';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import type {
|
|
5
4
|
ComboboxProps as ComboboxPropsCore,
|
|
6
5
|
ComboboxInputProps as ComboboxInputPropsCore,
|
|
@@ -37,6 +36,7 @@ import { Text } from '../Text';
|
|
|
37
36
|
import type { ButtonProps } from '../Button';
|
|
38
37
|
import { Button } from '../Button';
|
|
39
38
|
import { alpha } from '../color';
|
|
39
|
+
import { EASING_STANDARD } from '../motion';
|
|
40
40
|
|
|
41
41
|
export { useComboBoxContext } from '@basic-ui/core';
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ export { useComboBoxContext } from '@basic-ui/core';
|
|
|
44
44
|
// Combobox
|
|
45
45
|
|
|
46
46
|
export type ComboboxProps = Omit<
|
|
47
|
-
BoxProps<HTMLDivElement,
|
|
47
|
+
BoxProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>,
|
|
48
48
|
'onSelect'
|
|
49
49
|
> &
|
|
50
50
|
ComboboxPropsCore;
|
|
@@ -73,7 +73,7 @@ export type ComboboxInputProps = Omit<
|
|
|
73
73
|
ComboboxInputPropsCore & TextFieldProps,
|
|
74
74
|
'ref'
|
|
75
75
|
> &
|
|
76
|
-
|
|
76
|
+
RefAttributes<HTMLInputElement>;
|
|
77
77
|
|
|
78
78
|
const ComboboxInputCore: FC<ComboboxInputProps> = _ComboboxInputCore as any;
|
|
79
79
|
|
|
@@ -95,7 +95,7 @@ export const ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(
|
|
|
95
95
|
// ComboboxList
|
|
96
96
|
|
|
97
97
|
export type ComboboxListProps = Omit<ComboboxListPropsCore & ListProps, 'ref'> &
|
|
98
|
-
|
|
98
|
+
RefAttributes<HTMLUListElement>;
|
|
99
99
|
|
|
100
100
|
const ComboboxListCore: FC<ComboboxListProps> = _ComboboxListCore as any;
|
|
101
101
|
|
|
@@ -113,7 +113,7 @@ export const ComboboxList = forwardRef<HTMLUListElement, ComboboxListProps>(
|
|
|
113
113
|
__css={{
|
|
114
114
|
maxHeight: rem(300),
|
|
115
115
|
overflowY: 'auto',
|
|
116
|
-
borderRadius: '
|
|
116
|
+
borderRadius: 'extra-small',
|
|
117
117
|
'[data-popper-placement="top"] &': {
|
|
118
118
|
transformOrigin: 'bottom center',
|
|
119
119
|
},
|
|
@@ -180,7 +180,7 @@ export type ComboboxOptionProps = Omit<
|
|
|
180
180
|
ComboboxOptionPropsCore & ListItemProps,
|
|
181
181
|
'ref'
|
|
182
182
|
> &
|
|
183
|
-
|
|
183
|
+
RefAttributes<HTMLLIElement>;
|
|
184
184
|
|
|
185
185
|
const ComboboxOptionCore: FC<ComboboxOptionProps> = _ComboboxOptionCore as any;
|
|
186
186
|
|
|
@@ -205,7 +205,7 @@ export type ComboboxLabelProps = Omit<
|
|
|
205
205
|
ComboboxLabelPropsCore & TextProps,
|
|
206
206
|
'ref'
|
|
207
207
|
> &
|
|
208
|
-
|
|
208
|
+
RefAttributes<HTMLLabelElement>;
|
|
209
209
|
|
|
210
210
|
const ComboboxLabelCore: FC<ComboboxLabelProps> = _ComboboxLabelCore as any;
|
|
211
211
|
|
|
@@ -248,8 +248,7 @@ export const ComboboxButton = forwardRef<
|
|
|
248
248
|
height: rem(40),
|
|
249
249
|
px: 0,
|
|
250
250
|
'& > svg': {
|
|
251
|
-
transition:
|
|
252
|
-
'transform .15s cubic-bezier(.4,0,.2,1), color .15s cubic-bezier(.4,0,.2,1)',
|
|
251
|
+
transition: `transform .15s ${EASING_STANDARD}, color .15s ${EASING_STANDARD}`,
|
|
253
252
|
},
|
|
254
253
|
'&[aria-expanded="false"] > svg': {
|
|
255
254
|
color: alpha('on.surface', 0.54),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import type { FC, Ref } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import type { ModalBackdropProps } from '@basic-ui/core';
|
|
4
4
|
import { ModalBackdrop as _ModalBackdrop } from '@basic-ui/core';
|
|
5
5
|
|
|
6
6
|
import type { BoxProps } from '../Box';
|
|
7
7
|
import { Box } from '../Box';
|
|
8
8
|
|
|
9
|
-
const ModalBackdrop = _ModalBackdrop as
|
|
10
|
-
DialogBackdropProps & { ref?:
|
|
9
|
+
const ModalBackdrop = _ModalBackdrop as FC<
|
|
10
|
+
DialogBackdropProps & { ref?: Ref<HTMLDivElement> }
|
|
11
11
|
>;
|
|
12
12
|
|
|
13
13
|
export type DialogBackdropProps = ModalBackdropProps &
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { FC, Ref } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import type { ModalProps } from '@basic-ui/core';
|
|
4
4
|
import { Modal as _Modal } from '@basic-ui/core';
|
|
5
5
|
import { rem } from 'polished';
|
|
@@ -9,9 +9,7 @@ import type { PaperProps } from '../Paper';
|
|
|
9
9
|
import { Paper } from '../Paper';
|
|
10
10
|
import { useTheme } from '../theme';
|
|
11
11
|
|
|
12
|
-
const Modal = _Modal as
|
|
13
|
-
DialogSurfaceProps & { ref?: React.Ref<HTMLDivElement> }
|
|
14
|
-
>;
|
|
12
|
+
const Modal = _Modal as FC<DialogSurfaceProps & { ref?: Ref<HTMLDivElement> }>;
|
|
15
13
|
|
|
16
14
|
export type DialogSurfaceProps = ModalProps &
|
|
17
15
|
PaperProps & {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useAnimation } from '../hooks/useAnimation';
|
|
2
|
+
import { EASING_STANDARD } from '../motion';
|
|
2
3
|
|
|
3
4
|
const styles = {
|
|
4
5
|
slide: {
|
|
@@ -34,10 +35,8 @@ export function useDialogAnimation(opts: {
|
|
|
34
35
|
});
|
|
35
36
|
const scrimOpacity = state === 'open' ? 1 : 0;
|
|
36
37
|
|
|
37
|
-
const transition = `opacity ${timing}ms
|
|
38
|
-
const scrimTransition = `opacity ${
|
|
39
|
-
(timing * 0.4) | 0
|
|
40
|
-
}ms cubic-bezier(.4,0,.2,1)`;
|
|
38
|
+
const transition = `opacity ${timing}ms ${EASING_STANDARD},transform ${timing}ms ${EASING_STANDARD}`;
|
|
39
|
+
const scrimTransition = `opacity ${(timing * 0.4) | 0}ms ${EASING_STANDARD}`;
|
|
41
40
|
|
|
42
41
|
return {
|
|
43
42
|
containerStyle: { ...style, transition },
|
package/src/Divider/Divider.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { rem } from 'polished';
|
|
4
4
|
|
|
5
5
|
import type { BoxProps } from '../Box';
|
|
@@ -7,7 +7,7 @@ import { Box } from '../Box';
|
|
|
7
7
|
import { alpha } from '../color';
|
|
8
8
|
|
|
9
9
|
export interface DividerProps extends BoxProps {
|
|
10
|
-
as?:
|
|
10
|
+
as?: ElementType<any>;
|
|
11
11
|
direction?: 'vertical' | 'horizontal';
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { ComponentType, LabelHTMLAttributes, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { rem } from 'polished';
|
|
4
4
|
|
|
5
5
|
import { Text as _Text } from '../Text';
|
|
6
6
|
import { useNotchedOutlineContext } from '../NotchedOutline/context';
|
|
7
|
+
import { EASING_STANDARD } from '../motion';
|
|
7
8
|
|
|
8
9
|
export interface FloatingLabelProps
|
|
9
|
-
extends
|
|
10
|
-
children?:
|
|
10
|
+
extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
11
|
+
children?: ReactNode;
|
|
11
12
|
active?: boolean;
|
|
12
13
|
offsetX?: number;
|
|
13
14
|
height?: number;
|
|
@@ -36,7 +37,7 @@ export const FloatingLabel = forwardRef<HTMLLabelElement, FloatingLabelProps>(
|
|
|
36
37
|
const ctx = useNotchedOutlineContext();
|
|
37
38
|
const notchStart = ctx ? ctx.notchStart : 0;
|
|
38
39
|
|
|
39
|
-
const Text:
|
|
40
|
+
const Text: ComponentType<any> = _Text;
|
|
40
41
|
|
|
41
42
|
const translateX =
|
|
42
43
|
translateXProp !== undefined ? translateXProp : notchStart - offsetX;
|
|
@@ -50,7 +51,7 @@ export const FloatingLabel = forwardRef<HTMLLabelElement, FloatingLabelProps>(
|
|
|
50
51
|
return (
|
|
51
52
|
<Text
|
|
52
53
|
as="label"
|
|
53
|
-
variant="
|
|
54
|
+
variant="body-large"
|
|
54
55
|
ref={forwardedRef}
|
|
55
56
|
__css={{
|
|
56
57
|
position: 'absolute',
|
|
@@ -60,7 +61,7 @@ export const FloatingLabel = forwardRef<HTMLLabelElement, FloatingLabelProps>(
|
|
|
60
61
|
left: rem(offsetX),
|
|
61
62
|
height: typeof height === 'number' ? rem(height) : height,
|
|
62
63
|
transformOrigin: 'left center',
|
|
63
|
-
transition: `transform ${transitionTime}ms
|
|
64
|
+
transition: `transform ${transitionTime}ms ${EASING_STANDARD}, color ${transitionTime}ms ${EASING_STANDARD}`,
|
|
64
65
|
pointerEvents: 'none',
|
|
65
66
|
}}
|
|
66
67
|
style={{
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { rem } from 'polished';
|
|
5
4
|
|
|
6
5
|
import { useTheme } from '../theme';
|
|
7
6
|
import type { BoxProps } from '../Box';
|
|
8
7
|
import { Box } from '../Box';
|
|
8
|
+
import { EASING_STANDARD } from '../motion';
|
|
9
9
|
|
|
10
10
|
export interface LineRippleProps extends BoxProps {
|
|
11
11
|
active?: boolean;
|
|
12
12
|
transitionDuration?: number;
|
|
13
13
|
posx?: number;
|
|
14
|
-
children?:
|
|
14
|
+
children?: ReactNode;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const LineRipple = forwardRef<HTMLDivElement, LineRippleProps>(
|
|
@@ -70,7 +70,7 @@ export const LineRipple = forwardRef<HTMLDivElement, LineRippleProps>(
|
|
|
70
70
|
zIndex: 1,
|
|
71
71
|
transform: 'scaleX(0)',
|
|
72
72
|
transformOrigin: 'center center',
|
|
73
|
-
transition: `transform ${transitionDuration}ms
|
|
73
|
+
transition: `transform ${transitionDuration}ms ${EASING_STANDARD},opacity ${transitionDuration}ms ${EASING_STANDARD}`,
|
|
74
74
|
opacity: 0,
|
|
75
75
|
...__css,
|
|
76
76
|
}}
|
package/src/Link/Link.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { rem } from 'polished';
|
|
4
4
|
|
|
5
5
|
import type { BoxProps } from '../Box';
|
|
@@ -7,10 +7,7 @@ import { Box } from '../Box';
|
|
|
7
7
|
import { alpha } from '../color';
|
|
8
8
|
|
|
9
9
|
export interface LinkProps
|
|
10
|
-
extends BoxProps<
|
|
11
|
-
HTMLAnchorElement,
|
|
12
|
-
React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
13
|
-
> {
|
|
10
|
+
extends BoxProps<HTMLAnchorElement, AnchorHTMLAttributes<HTMLAnchorElement>> {
|
|
14
11
|
color?: string;
|
|
15
12
|
// ReachRouter Props
|
|
16
13
|
to?: string;
|
package/src/List/List.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import type { ElementType, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { PaperProps } from '../Paper';
|
|
5
5
|
import { Paper } from '../Paper';
|
|
6
6
|
|
|
7
7
|
export interface ListProps extends PaperProps {
|
|
8
|
-
as?:
|
|
9
|
-
innerAs?:
|
|
10
|
-
children?:
|
|
8
|
+
as?: ElementType<any>;
|
|
9
|
+
innerAs?: ElementType<any>;
|
|
10
|
+
children?: ReactNode;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const List = forwardRef<HTMLDivElement, ListProps>(function List(
|