@basic-ui/material 0.1.11 → 0.1.14
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 +33 -28
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +1 -1
- package/build/esm/AppBar/AppBar.d.ts +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +1 -1
- package/build/esm/Badge/Badge.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/Button/BaseButton.d.ts +1 -1
- package/build/esm/Button/Button.d.ts +1 -1
- package/build/esm/Button/FilledButton.d.ts +1 -1
- package/build/esm/Button/FloatingActionButton.d.ts +7 -0
- package/build/esm/Button/FloatingActionButton.js +8 -0
- package/build/esm/Button/FloatingActionButton.js.map +1 -0
- 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 +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +1 -1
- package/build/esm/ColorMode/ColorModeProvider.js +10 -3
- package/build/esm/ColorMode/ColorModeProvider.js.map +1 -1
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +1 -1
- package/build/esm/Dialog/useDialogAnimation.js +1 -1
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +1 -1
- package/build/esm/Link/Link.d.ts +1 -1
- package/build/esm/List/List.d.ts +1 -1
- package/build/esm/ListItem/ListItem.d.ts +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/Paper/Paper.d.ts +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/Ripple/keyframes.js +0 -2
- package/build/esm/Ripple/keyframes.js.map +1 -1
- package/build/esm/Ripple/useRipple.js +1 -1
- package/build/esm/Ripple/useRipple.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +1 -1
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Tab/Tab.d.ts +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/Table/Table.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Text/Text.d.ts +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +1 -1
- package/build/esm/TextField/HelperText.d.ts +1 -1
- package/build/esm/TextField/Input.d.ts +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/ThemeExplorer/ColorPicker.d.ts +8 -0
- package/build/esm/ThemeExplorer/ColorPicker.js +76 -0
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +9 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +100 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -0
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +5 -0
- package/build/esm/ThemeExplorer/ThemeColors.js +80 -0
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -0
- package/build/esm/ThemeExplorer/components.d.ts +31 -0
- package/build/esm/ThemeExplorer/components.js +184 -0
- package/build/esm/ThemeExplorer/components.js.map +1 -0
- package/build/esm/ThemeExplorer/makeColorScheme.d.ts +66 -0
- package/build/esm/ThemeExplorer/makeColorScheme.js +66 -0
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -0
- package/build/esm/ThemeExplorer/useDeferredColor.d.ts +3 -0
- package/build/esm/ThemeExplorer/useDeferredColor.js +11 -0
- package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.d.ts +1 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +11 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -0
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/esm/hooks/useAnimation.js +22 -21
- package/build/esm/hooks/useAnimation.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +54 -54
- package/package.json +3 -3
- package/src/Alert/Alert.story.tsx +5 -6
- package/src/AppBar/AppBar.story.tsx +11 -20
- package/src/BottomSheet/BottomSheet.story.tsx +5 -6
- package/src/Button/Button.story.tsx +14 -14
- package/src/Button/SpinnerButton.story.tsx +6 -6
- package/src/CheckBox/CheckBox.story.tsx +7 -6
- package/src/Chip/Chip.story.tsx +5 -7
- package/src/ColorMode/ColorModeProvider.tsx +9 -3
- package/src/Combobox/Combobox.story.tsx +12 -10
- package/src/Dialog/Dialog.story.tsx +7 -8
- package/src/Dialog/useDialogAnimation.tsx +1 -1
- package/src/Divider/Divider.story.tsx +6 -5
- package/src/FloatingLabel/FloatingLabel.story.tsx +10 -9
- 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/Menu/Menu.story.tsx +8 -7
- package/src/NotchedOutline/NotchedOutline.story.tsx +5 -4
- package/src/Paper/Paper.story.tsx +5 -4
- package/src/ProgressSpinner/ProgressSpinner.story.tsx +5 -4
- package/src/RadioButton/RadioButton.story.tsx +12 -10
- package/src/Ripple/Ripple.story.tsx +5 -4
- package/src/Ripple/keyframes.ts +0 -2
- package/src/Ripple/useRipple.ts +3 -1
- package/src/Select/Select.story.tsx +8 -7
- package/src/Skeleton/Skeleton.story.tsx +7 -6
- package/src/Snackbar/Snackbar.story.tsx +7 -6
- package/src/Switch/Switch.story.tsx +5 -4
- package/src/Tab/Tab.story.tsx +7 -5
- package/src/Table/Table.story.tsx +5 -4
- package/src/Text/Text.story.tsx +5 -4
- package/src/TextField/TextField.story.tsx +7 -6
- package/src/Tooltip/Tooltip.story.tsx +5 -4
- package/src/hooks/useAnimation.ts +42 -32
|
@@ -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/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 />;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
import { TextField } from './';
|
|
3
|
-
import { storiesOf } from '@storybook/react';
|
|
4
2
|
import { Box } from '../Box';
|
|
5
3
|
import { CheckBox } from '../CheckBox';
|
|
6
4
|
import { Select, SelectItem } from '../';
|
|
7
5
|
import { Button } from '../Button';
|
|
8
6
|
import { alpha } from '../color';
|
|
7
|
+
import { TextField } from './';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'components/TextField',
|
|
11
|
+
};
|
|
9
12
|
|
|
10
13
|
const Example = ({ variant }) => {
|
|
11
14
|
const [error, setError] = useState<boolean | string>(false);
|
|
@@ -220,7 +223,5 @@ const Example = ({ variant }) => {
|
|
|
220
223
|
);
|
|
221
224
|
};
|
|
222
225
|
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
stories.add('filled', () => <Example variant="filled" />);
|
|
226
|
-
stories.add('outlined', () => <Example variant="outlined" />);
|
|
226
|
+
export const Filled = () => <Example variant="filled" />;
|
|
227
|
+
export const Outlined = () => <Example variant="outlined" />;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Tooltip } from './';
|
|
3
3
|
import { Button } from '../Button';
|
|
4
|
-
import { storiesOf } from '@storybook/react';
|
|
5
4
|
// import './styles.css';
|
|
6
5
|
|
|
6
|
+
export default {
|
|
7
|
+
title: 'components/Tooltip',
|
|
8
|
+
};
|
|
9
|
+
|
|
7
10
|
const Example = () => {
|
|
8
11
|
const buttonRef = useRef();
|
|
9
12
|
const [counter, setCounter] = useState(0);
|
|
@@ -28,6 +31,4 @@ const Example = () => {
|
|
|
28
31
|
);
|
|
29
32
|
};
|
|
30
33
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
stories.add('controlled', () => <Example />);
|
|
34
|
+
export const Default = () => <Example />;
|
|
@@ -43,51 +43,61 @@ export function useAnimation<
|
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
const handleClose = useCallback(() => {
|
|
46
|
-
setAnimation((animation) =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
style: animationStyle.closed,
|
|
57
|
-
open: false,
|
|
58
|
-
timing: closeTimeoutInMilliseconds,
|
|
59
|
-
});
|
|
60
|
-
}, closeTimeoutInMilliseconds);
|
|
46
|
+
setAnimation((animation) =>
|
|
47
|
+
animation.state === 'closed'
|
|
48
|
+
? animation
|
|
49
|
+
: {
|
|
50
|
+
...animation,
|
|
51
|
+
state: 'close',
|
|
52
|
+
style: animationStyle.close || animationStyle.closed,
|
|
53
|
+
timing: closeTimeoutInMilliseconds,
|
|
54
|
+
}
|
|
55
|
+
);
|
|
61
56
|
}, [animationStyle, closeTimeoutInMilliseconds]);
|
|
62
57
|
|
|
63
58
|
const handleOpen = useCallback(() => {
|
|
64
|
-
setAnimation((animation) =>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
59
|
+
setAnimation((animation) =>
|
|
60
|
+
animation.state === 'open'
|
|
61
|
+
? animation
|
|
62
|
+
: {
|
|
63
|
+
...animation,
|
|
64
|
+
open: true,
|
|
65
|
+
state: 'opening',
|
|
66
|
+
style: animationStyle.opening || animationStyle.closed,
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}, [animationStyle]);
|
|
70
|
+
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (state === 'opening') {
|
|
71
73
|
setAnimation((animation) => ({
|
|
72
74
|
...animation,
|
|
73
75
|
state: 'open',
|
|
74
76
|
style: animationStyle.open,
|
|
75
77
|
timing: openTimeoutInMilliseconds,
|
|
76
78
|
}));
|
|
77
|
-
}
|
|
78
|
-
}, [animationStyle, openTimeoutInMilliseconds]);
|
|
79
|
+
}
|
|
80
|
+
}, [animationStyle.open, openTimeoutInMilliseconds, state]);
|
|
81
|
+
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (state === 'close') {
|
|
84
|
+
const timeout = setTimeout(() => {
|
|
85
|
+
setAnimation({
|
|
86
|
+
state: 'closed',
|
|
87
|
+
style: animationStyle.closed,
|
|
88
|
+
open: false,
|
|
89
|
+
timing: closeTimeoutInMilliseconds,
|
|
90
|
+
});
|
|
91
|
+
}, closeTimeoutInMilliseconds);
|
|
92
|
+
return () => clearTimeout(timeout);
|
|
93
|
+
}
|
|
94
|
+
}, [animationStyle.closed, closeTimeoutInMilliseconds, state]);
|
|
79
95
|
|
|
80
96
|
useEffect(() => {
|
|
81
97
|
if (openProp) {
|
|
82
|
-
|
|
83
|
-
return () => {
|
|
84
|
-
cancelAnimationFrame(frameHandler);
|
|
85
|
-
};
|
|
98
|
+
handleOpen();
|
|
86
99
|
} else {
|
|
87
|
-
|
|
88
|
-
return () => {
|
|
89
|
-
clearTimeout(timeoutHandler);
|
|
90
|
-
};
|
|
100
|
+
handleClose();
|
|
91
101
|
}
|
|
92
102
|
}, [handleClose, handleOpen, openProp]);
|
|
93
103
|
|