@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.
Files changed (121) hide show
  1. package/build/cjs/index.js +33 -28
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/esm/Alert/Alert.d.ts +1 -1
  4. package/build/esm/AppBar/AppBar.d.ts +1 -1
  5. package/build/esm/AppBar/AppBarButton.d.ts +1 -1
  6. package/build/esm/Badge/Badge.d.ts +1 -1
  7. package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
  8. package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
  9. package/build/esm/Button/BaseButton.d.ts +1 -1
  10. package/build/esm/Button/Button.d.ts +1 -1
  11. package/build/esm/Button/FilledButton.d.ts +1 -1
  12. package/build/esm/Button/FloatingActionButton.d.ts +7 -0
  13. package/build/esm/Button/FloatingActionButton.js +8 -0
  14. package/build/esm/Button/FloatingActionButton.js.map +1 -0
  15. package/build/esm/Button/OutlinedButton.d.ts +1 -1
  16. package/build/esm/Button/TransparentButton.d.ts +1 -1
  17. package/build/esm/CheckBox/CheckBox.d.ts +1 -1
  18. package/build/esm/CheckBox/CheckBoxIcon.d.ts +1 -1
  19. package/build/esm/Chip/ButtonChip.d.ts +1 -1
  20. package/build/esm/Chip/ChoiceChip.d.ts +1 -1
  21. package/build/esm/ColorMode/ColorModeProvider.js +10 -3
  22. package/build/esm/ColorMode/ColorModeProvider.js.map +1 -1
  23. package/build/esm/Combobox/Combobox.d.ts +7 -7
  24. package/build/esm/Dialog/Dialog.d.ts +1 -1
  25. package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
  26. package/build/esm/Dialog/DialogSurface.d.ts +1 -1
  27. package/build/esm/Dialog/useDialogAnimation.js +1 -1
  28. package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
  29. package/build/esm/Divider/Divider.d.ts +1 -1
  30. package/build/esm/LineRipple/LineRipple.d.ts +1 -1
  31. package/build/esm/Link/Link.d.ts +1 -1
  32. package/build/esm/List/List.d.ts +1 -1
  33. package/build/esm/ListItem/ListItem.d.ts +1 -1
  34. package/build/esm/Menu/Menu.d.ts +4 -4
  35. package/build/esm/Paper/Paper.d.ts +1 -1
  36. package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
  37. package/build/esm/Ripple/keyframes.js +0 -2
  38. package/build/esm/Ripple/keyframes.js.map +1 -1
  39. package/build/esm/Ripple/useRipple.js +1 -1
  40. package/build/esm/Ripple/useRipple.js.map +1 -1
  41. package/build/esm/Select/SelectIcon.d.ts +1 -1
  42. package/build/esm/SelectItem/SelectItem.d.ts +1 -1
  43. package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
  44. package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
  45. package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
  46. package/build/esm/Skeleton/Skeleton.d.ts +1 -1
  47. package/build/esm/Snackbar/Snackbar.d.ts +1 -1
  48. package/build/esm/Switch/Switch.d.ts +1 -1
  49. package/build/esm/Tab/Tab.d.ts +1 -1
  50. package/build/esm/Tab/TabList.d.ts +1 -1
  51. package/build/esm/Tab/TabPanel.d.ts +1 -1
  52. package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
  53. package/build/esm/Table/Table.d.ts +1 -1
  54. package/build/esm/Table/TableHead.d.ts +1 -1
  55. package/build/esm/Table/TableRow.d.ts +1 -1
  56. package/build/esm/Text/Text.d.ts +1 -1
  57. package/build/esm/TextField/FilledContainer.d.ts +1 -1
  58. package/build/esm/TextField/HelperText.d.ts +1 -1
  59. package/build/esm/TextField/Input.d.ts +1 -1
  60. package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
  61. package/build/esm/TextField/TextField.d.ts +1 -1
  62. package/build/esm/ThemeExplorer/ColorPicker.d.ts +8 -0
  63. package/build/esm/ThemeExplorer/ColorPicker.js +76 -0
  64. package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -0
  65. package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +9 -0
  66. package/build/esm/ThemeExplorer/TextFieldColorPicker.js +100 -0
  67. package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -0
  68. package/build/esm/ThemeExplorer/ThemeColors.d.ts +5 -0
  69. package/build/esm/ThemeExplorer/ThemeColors.js +80 -0
  70. package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -0
  71. package/build/esm/ThemeExplorer/components.d.ts +31 -0
  72. package/build/esm/ThemeExplorer/components.js +184 -0
  73. package/build/esm/ThemeExplorer/components.js.map +1 -0
  74. package/build/esm/ThemeExplorer/makeColorScheme.d.ts +66 -0
  75. package/build/esm/ThemeExplorer/makeColorScheme.js +66 -0
  76. package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -0
  77. package/build/esm/ThemeExplorer/useDeferredColor.d.ts +3 -0
  78. package/build/esm/ThemeExplorer/useDeferredColor.js +11 -0
  79. package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -0
  80. package/build/esm/ThemeExplorer/useLocalStorageCachedState.d.ts +1 -0
  81. package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +11 -0
  82. package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -0
  83. package/build/esm/Tooltip/Tooltip.d.ts +1 -1
  84. package/build/esm/hooks/useAnimation.js +22 -21
  85. package/build/esm/hooks/useAnimation.js.map +1 -1
  86. package/build/tsconfig.tsbuildinfo +54 -54
  87. package/package.json +3 -3
  88. package/src/Alert/Alert.story.tsx +5 -6
  89. package/src/AppBar/AppBar.story.tsx +11 -20
  90. package/src/BottomSheet/BottomSheet.story.tsx +5 -6
  91. package/src/Button/Button.story.tsx +14 -14
  92. package/src/Button/SpinnerButton.story.tsx +6 -6
  93. package/src/CheckBox/CheckBox.story.tsx +7 -6
  94. package/src/Chip/Chip.story.tsx +5 -7
  95. package/src/ColorMode/ColorModeProvider.tsx +9 -3
  96. package/src/Combobox/Combobox.story.tsx +12 -10
  97. package/src/Dialog/Dialog.story.tsx +7 -8
  98. package/src/Dialog/useDialogAnimation.tsx +1 -1
  99. package/src/Divider/Divider.story.tsx +6 -5
  100. package/src/FloatingLabel/FloatingLabel.story.tsx +10 -9
  101. package/src/LineRipple/LineRipple.story.tsx +5 -4
  102. package/src/Link/Link.story.tsx +3 -4
  103. package/src/ListItem/ListItem.story.tsx +6 -5
  104. package/src/Menu/Menu.story.tsx +8 -7
  105. package/src/NotchedOutline/NotchedOutline.story.tsx +5 -4
  106. package/src/Paper/Paper.story.tsx +5 -4
  107. package/src/ProgressSpinner/ProgressSpinner.story.tsx +5 -4
  108. package/src/RadioButton/RadioButton.story.tsx +12 -10
  109. package/src/Ripple/Ripple.story.tsx +5 -4
  110. package/src/Ripple/keyframes.ts +0 -2
  111. package/src/Ripple/useRipple.ts +3 -1
  112. package/src/Select/Select.story.tsx +8 -7
  113. package/src/Skeleton/Skeleton.story.tsx +7 -6
  114. package/src/Snackbar/Snackbar.story.tsx +7 -6
  115. package/src/Switch/Switch.story.tsx +5 -4
  116. package/src/Tab/Tab.story.tsx +7 -5
  117. package/src/Table/Table.story.tsx +5 -4
  118. package/src/Text/Text.story.tsx +5 -4
  119. package/src/TextField/TextField.story.tsx +7 -6
  120. package/src/Tooltip/Tooltip.story.tsx +5 -4
  121. package/src/hooks/useAnimation.ts +42 -32
@@ -1,9 +1,12 @@
1
1
  import { useState, useRef } from 'react';
2
2
  import { CheckBox, Box } from '../';
3
- import { storiesOf } from '@storybook/react';
4
3
  import { keyframes } from '@emotion/react';
5
4
  import { Keyframes } from '@emotion/serialize';
6
5
 
6
+ export default {
7
+ title: 'components/CheckBox',
8
+ };
9
+
7
10
  const HeartOutline = (props) => {
8
11
  return (
9
12
  <svg height={24} viewBox="0 0 24 24" width={24} {...props}>
@@ -28,7 +31,7 @@ const HeartFilled = (props) => {
28
31
  );
29
32
  };
30
33
 
31
- export const settingIn: Keyframes = keyframes({
34
+ const settingIn: Keyframes = keyframes({
32
35
  '0%': {
33
36
  transform: `scale(1)`,
34
37
  },
@@ -40,7 +43,7 @@ export const settingIn: Keyframes = keyframes({
40
43
  },
41
44
  });
42
45
 
43
- export const settingOut: Keyframes = keyframes({
46
+ const settingOut: Keyframes = keyframes({
44
47
  '0%': {
45
48
  transform: `scale(1)`,
46
49
  },
@@ -147,6 +150,4 @@ const Example = () => {
147
150
  );
148
151
  };
149
152
 
150
- const stories = storiesOf('Components/CheckBox', module);
151
-
152
- stories.add('controlled', () => <Example />);
153
+ export const Controlled = () => <Example />;
@@ -1,11 +1,13 @@
1
1
  import { Chip } from './';
2
- import { storiesOf } from '@storybook/react';
3
2
  import { Box } from '../Box';
4
3
  import { Text } from '../Text';
5
4
  import { alpha } from '../color';
6
5
  import { RadioGroup } from '../RadioButton';
7
6
  import { ChoiceChip } from './ChoiceChip';
8
- // import './styles.css';
7
+
8
+ export default {
9
+ title: 'components/Chip',
10
+ };
9
11
 
10
12
  const CloseIcon = (props) => (
11
13
  <Box
@@ -157,7 +159,7 @@ const AllColors = ({ variant }) => (
157
159
  </>
158
160
  );
159
161
 
160
- const AllVariants = () => {
162
+ export const AllVariants = () => {
161
163
  return (
162
164
  <>
163
165
  <AllColors variant="filled" />
@@ -165,7 +167,3 @@ const AllVariants = () => {
165
167
  </>
166
168
  );
167
169
  };
168
-
169
- const stories = storiesOf('Components/Chip', module);
170
-
171
- stories.add('choice chip', () => <AllVariants />);
@@ -65,14 +65,20 @@ export const ColorModeProvider: React.FC<ColorModeProviderProps> = (props) => {
65
65
  }, [setColorMode]);
66
66
 
67
67
  const globalStyles = useMemo(() => {
68
- const ret = { body: styles['default'] || {} };
69
- ret[`.${DEFAULT_THEME_CLASS}`] = styles['default'] || {};
68
+ const ret = {
69
+ body: { colorScheme: 'light', ...(styles['default'] || {}) },
70
+ };
71
+
72
+ ret[`.${DEFAULT_THEME_CLASS}`] = {
73
+ colorScheme: 'light',
74
+ ...(styles['default'] || {}),
75
+ };
70
76
 
71
77
  for (const key in styles) {
72
78
  if (key === 'default') {
73
79
  continue;
74
80
  }
75
- ret[`.${DARK_THEME_CLASS}`] = styles[key];
81
+ ret[`.${DARK_THEME_CLASS}`] = { colorScheme: 'dark', ...styles[key] };
76
82
  }
77
83
 
78
84
  return ret;
@@ -1,6 +1,5 @@
1
1
  import { useMemo, useState } from 'react';
2
2
  import type * as React from 'react';
3
- import { storiesOf } from '@storybook/react';
4
3
  import {
5
4
  Combobox,
6
5
  ComboboxLabel,
@@ -13,7 +12,9 @@ import {
13
12
  import { Box } from '../Box';
14
13
  import cities from '../../../core/src/ComboBox/cities';
15
14
 
16
- const stories = storiesOf('Components/Combobox', module);
15
+ export default {
16
+ title: 'components/Combobox',
17
+ };
17
18
 
18
19
  function useCityMatch(searchTerm: string) {
19
20
  return useMemo(() => {
@@ -28,7 +29,7 @@ function useCityMatch(searchTerm: string) {
28
29
  }, [searchTerm]);
29
30
  }
30
31
 
31
- export function UncontrolledClientSideExample({ initialValue = '' }) {
32
+ function UncontrolledClientSideExample({ initialValue = '' }) {
32
33
  const [term, setTerm] = useState(initialValue);
33
34
  const [selected, setSelected] = useState(initialValue);
34
35
  const results = useCityMatch(term);
@@ -86,7 +87,7 @@ export function UncontrolledClientSideExample({ initialValue = '' }) {
86
87
  );
87
88
  }
88
89
 
89
- export function ControlledClientSideExample({ initialValue = '' }) {
90
+ function ControlledClientSideExample({ initialValue = '' }) {
90
91
  const [term, setTerm] = useState(initialValue);
91
92
  const [selected, setSelected] = useState(initialValue);
92
93
  const results = useCityMatch(term);
@@ -147,11 +148,12 @@ export function ControlledClientSideExample({ initialValue = '' }) {
147
148
  );
148
149
  }
149
150
 
150
- stories.add('Uncontrolled Clientside', () => <UncontrolledClientSideExample />);
151
- stories.add('Uncontrolled Clientside - Initial', () => (
151
+ export const UncontrolledClientSide = () => <UncontrolledClientSideExample />;
152
+ export const UncontrolledClientSideInitial = () => (
152
153
  <UncontrolledClientSideExample initialValue="Aberdeen" />
153
- ));
154
- stories.add('Controlled Clientside', () => <ControlledClientSideExample />);
155
- stories.add('Controlled Clientside - Initial', () => (
154
+ );
155
+
156
+ export const ControlledClientSide = () => <ControlledClientSideExample />;
157
+ export const ControlledClientSideInitial = () => (
156
158
  <ControlledClientSideExample initialValue="Aberdeen" />
157
- ));
159
+ );
@@ -1,6 +1,5 @@
1
1
  import { useState } from 'react';
2
2
  import { Dialog, DialogAnimationModes } from './';
3
- import { storiesOf } from '@storybook/react';
4
3
  import { Button } from '../Button';
5
4
  import { LoremIpsum } from '../Text/LoremIpsum';
6
5
  import { Box } from '../Box';
@@ -8,6 +7,10 @@ import { Switch } from '../Switch';
8
7
  import { Select } from '../Select';
9
8
  import { SelectItem } from '../SelectItem';
10
9
 
10
+ export default {
11
+ title: 'components/Dialog',
12
+ };
13
+
11
14
  const Example = ({ animationMode = 'slide' as DialogAnimationModes }) => {
12
15
  const [open, setOpen] = useState(false);
13
16
  const [long, setLong] = useState(false);
@@ -43,10 +46,6 @@ const Example = ({ animationMode = 'slide' as DialogAnimationModes }) => {
43
46
  );
44
47
  };
45
48
 
46
- const stories = storiesOf('Components/Dialog', module);
47
-
48
- stories.add('dialog, slide', () => <Example />);
49
- stories.add('dialog, grow', () => <Example animationMode={'grow'} />);
50
- stories.add('dialog, slide-grow', () => (
51
- <Example animationMode={'slide-grow'} />
52
- ));
49
+ export const DialogSlide = () => <Example />;
50
+ export const DialogGrow = () => <Example animationMode={'grow'} />;
51
+ export const DialogSlideGrow = () => <Example animationMode={'slide-grow'} />;
@@ -4,7 +4,7 @@ const styles = {
4
4
  slide: {
5
5
  closed: { opacity: 0.6, transform: 'translateY(100%)' },
6
6
  open: { opacity: 1, transform: 'translateY(0%)' },
7
- close: { opacity: 0, transform: 'translateY(100%)' },
7
+ close: { opacity: 0, transform: 'translateY(10%)' },
8
8
  },
9
9
  grow: {
10
10
  closed: { opacity: 0.8, transform: 'scale(0.8)' },
@@ -1,9 +1,12 @@
1
1
  import { Divider } from './';
2
- import { storiesOf } from '@storybook/react';
3
2
  import { Text } from '../Text';
4
3
  import { Box } from '../Box';
5
4
  // import './styles.css';
6
5
 
6
+ export default {
7
+ title: 'components/Divider',
8
+ };
9
+
7
10
  const ExampleHorizontal = () => {
8
11
  return (
9
12
  <Box bg="surface">
@@ -32,7 +35,5 @@ const ExampleVertical = () => {
32
35
  );
33
36
  };
34
37
 
35
- const stories = storiesOf('Components/Divider', module);
36
-
37
- stories.add('horizontal', () => <ExampleHorizontal />);
38
- stories.add('vertical', () => <ExampleVertical />);
38
+ export const Horizontal = () => <ExampleHorizontal />;
39
+ export const Vertical = () => <ExampleVertical />;
@@ -1,8 +1,11 @@
1
1
  import { useRef, useState } from 'react';
2
- import { FloatingLabel } from './FloatingLabel';
2
+ import { FloatingLabel as FloatingLabelComponent } from './FloatingLabel';
3
3
  import { Box } from '../Box';
4
4
  import { Button } from '../Button';
5
- import { storiesOf } from '@storybook/react';
5
+
6
+ export default {
7
+ title: 'helper components/FloatingLabel',
8
+ };
6
9
 
7
10
  const Example = () => {
8
11
  const ref = useRef<HTMLDivElement>();
@@ -22,9 +25,9 @@ const Example = () => {
22
25
  mb={2}
23
26
  bg="#eee"
24
27
  >
25
- <FloatingLabel active={active} height={50}>
28
+ <FloatingLabelComponent active={active} height={50}>
26
29
  Standard
27
- </FloatingLabel>
30
+ </FloatingLabelComponent>
28
31
  </Box>
29
32
  <Box
30
33
  display="flex"
@@ -38,9 +41,9 @@ const Example = () => {
38
41
  mb={2}
39
42
  bg="#eee"
40
43
  >
41
- <FloatingLabel active={active} height={50} offsetX={16}>
44
+ <FloatingLabelComponent active={active} height={50} offsetX={16}>
42
45
  Standard
43
- </FloatingLabel>
46
+ </FloatingLabelComponent>
44
47
  </Box>
45
48
  <Button onClick={() => setActive(true)}>Activate</Button>
46
49
  <Button onClick={() => setActive(false)}>Deactivate</Button>
@@ -48,6 +51,4 @@ const Example = () => {
48
51
  );
49
52
  };
50
53
 
51
- const stories = storiesOf('Helper Components/FloatingLabel', module);
52
-
53
- stories.add('floating label', () => <Example />);
54
+ export const FloatingLabel = () => <Example />;
@@ -3,7 +3,10 @@ import { LineRipple } from './';
3
3
  import { Box } from '../Box';
4
4
  import { Text } from '../Text';
5
5
  import { Button } from '../Button';
6
- import { storiesOf } from '@storybook/react';
6
+
7
+ export default {
8
+ title: 'helper components/LineRipple',
9
+ };
7
10
 
8
11
  const Example = () => {
9
12
  const ref = useRef<HTMLDivElement>();
@@ -36,6 +39,4 @@ const Example = () => {
36
39
  );
37
40
  };
38
41
 
39
- const stories = storiesOf('Helper Components/LineRipple', module);
40
-
41
- stories.add('controlled', () => <Example />);
42
+ export const Controlled = () => <Example />;
@@ -1,6 +1,7 @@
1
1
  import { Link } from './';
2
2
  import { Text } from '../Text';
3
- import { storiesOf } from '@storybook/react';
3
+
4
+ export default { title: 'components/Link' };
4
5
 
5
6
  const Example = () => {
6
7
  return (
@@ -10,6 +11,4 @@ const Example = () => {
10
11
  );
11
12
  };
12
13
 
13
- const stories = storiesOf('Components/Link', module);
14
-
15
- stories.add('simple', () => <Example />);
14
+ export const Simple = () => <Example />;
@@ -1,9 +1,12 @@
1
1
  import { useState } from 'react';
2
2
  import { ListItem, ListItemText } from './';
3
3
  import { List } from '../List';
4
- import { storiesOf } from '@storybook/react';
5
4
  // import './styles.css';
6
5
 
6
+ export default {
7
+ title: 'components/ListItem',
8
+ };
9
+
7
10
  const Example = ({ selectable = false }) => {
8
11
  const [selectedItem, setSelectedItem] = useState(selectable ? '0' : '-1');
9
12
 
@@ -35,7 +38,5 @@ const Example = ({ selectable = false }) => {
35
38
  );
36
39
  };
37
40
 
38
- const stories = storiesOf('Components/ListItem', module);
39
-
40
- stories.add('normal', () => <Example />);
41
- stories.add('selectable', () => <Example selectable={true} />);
41
+ export const Normal = () => <Example />;
42
+ export const Selectable = () => <Example selectable={true} />;
@@ -1,9 +1,12 @@
1
1
  import { Menu, MenuButton, MenuList, MenuItem, MenuPopover } from '.';
2
2
  import { Divider } from '../Divider';
3
- import { storiesOf } from '@storybook/react';
4
3
  import { Box } from '../Box';
5
4
  // import './styles.css';
6
5
 
6
+ export default {
7
+ title: 'components/Menu',
8
+ };
9
+
7
10
  const MenuUncontrolled = ({ disabled }) => {
8
11
  return (
9
12
  <Box px={5}>
@@ -44,10 +47,8 @@ const MenuUncontrolledWithLinks = ({ disabled }) => {
44
47
  );
45
48
  };
46
49
 
47
- const stories = storiesOf('Components/Menu', module);
48
-
49
- stories.add('uncontrolled', () => <MenuUncontrolled disabled={undefined} />);
50
- stories.add('uncontrolled, with links', () => (
50
+ export const Uncontrolled = () => <MenuUncontrolled disabled={undefined} />;
51
+ export const UncontrolledWithLinks = () => (
51
52
  <MenuUncontrolledWithLinks disabled={undefined} />
52
- ));
53
- stories.add('disabled', () => <MenuUncontrolled disabled={true} />);
53
+ );
54
+ export const Disabled = () => <MenuUncontrolled disabled={true} />;
@@ -1,11 +1,14 @@
1
1
  import {} from './';
2
- import { storiesOf } from '@storybook/react';
3
2
  import { NotchedOutline } from './NotchedOutline';
4
3
  import { Box } from '../Box';
5
4
  import { FloatingLabel } from '../FloatingLabel';
6
5
  import { rem } from 'polished';
7
6
  // import './styles.css';
8
7
 
8
+ export default {
9
+ title: 'helper components/NotchedOutline',
10
+ };
11
+
9
12
  const Example = () => {
10
13
  const labelWidth = 68.27;
11
14
 
@@ -92,6 +95,4 @@ const Example = () => {
92
95
  );
93
96
  };
94
97
 
95
- const stories = storiesOf('Helper Components/NotchedOutline', module);
96
-
97
- stories.add('controlled', () => <Example />);
98
+ export const Controlled = () => <Example />;
@@ -1,9 +1,12 @@
1
1
  import { useState } from 'react';
2
2
  import { Paper } from './';
3
- import { storiesOf } from '@storybook/react';
4
3
  import { Text } from '../Text';
5
4
  import { Box } from '../Box';
6
5
 
6
+ export default {
7
+ title: 'components/Paper',
8
+ };
9
+
7
10
  const Example = ({}) => {
8
11
  const [elevation, setElevation] = useState(0);
9
12
 
@@ -30,6 +33,4 @@ const Example = ({}) => {
30
33
  );
31
34
  };
32
35
 
33
- const stories = storiesOf('Components/Paper', module);
34
-
35
- stories.add('paper', () => <Example />);
36
+ export const Default = () => <Example />;
@@ -1,8 +1,11 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { ProgressSpinner } from './';
3
- import { storiesOf } from '@storybook/react';
4
3
  import { Box } from '../Box';
5
4
 
5
+ export default {
6
+ title: 'components/ProgressSpinner',
7
+ };
8
+
6
9
  const Example = () => {
7
10
  const steps = [0, 25, 50, 75, 100];
8
11
  const [currentProgress, setCurrentProgress] = useState(0);
@@ -28,6 +31,4 @@ const Example = () => {
28
31
  );
29
32
  };
30
33
 
31
- const stories = storiesOf('Components/ProgressSpinner', module);
32
-
33
- stories.add('controlled', () => <Example />);
34
+ export const Default = () => <Example />;
@@ -1,9 +1,12 @@
1
1
  import { useState } from 'react';
2
2
  import type * as React from 'react';
3
3
  import { RadioButton, RadioGroup, Box } from '../';
4
- import { storiesOf } from '@storybook/react';
5
4
  // import './styles.css';
6
5
 
6
+ export default {
7
+ title: 'components/RadioButton',
8
+ };
9
+
7
10
  const Example = (props) => {
8
11
  return (
9
12
  <>
@@ -29,7 +32,7 @@ const Example = (props) => {
29
32
  );
30
33
  };
31
34
 
32
- const Standalone = (props) => {
35
+ const StandaloneExample = (props) => {
33
36
  const [selectedValue, setSelectedValue] = useState('a');
34
37
  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
35
38
  setSelectedValue(e.target.value);
@@ -90,17 +93,16 @@ const Standalone = (props) => {
90
93
  );
91
94
  };
92
95
 
93
- const stories = storiesOf('Components/RadioButton', module);
94
-
95
- stories.add('controlled', () => (
96
+ export const Controlled = () => (
96
97
  <>
97
98
  <Example name="demo-1" />
98
99
  <Example name="demo-2" />
99
100
  </>
100
- ));
101
- stories.add('standalone', () => (
101
+ );
102
+
103
+ export const Standalone = () => (
102
104
  <>
103
- <Standalone name="demo-1" />
104
- <Standalone name="demo-2" />
105
+ <StandaloneExample name="demo-1" />
106
+ <StandaloneExample name="demo-2" />
105
107
  </>
106
- ));
108
+ );
@@ -3,10 +3,13 @@ import { Ripple, useRipple } from './';
3
3
  import { Box } from '../Box';
4
4
  import { Text } from '../Text';
5
5
  import { Button } from '../Button';
6
- import { storiesOf } from '@storybook/react';
7
6
  import { useTheme } from '../theme';
8
7
  import { get } from '@styled-system/css';
9
8
 
9
+ export default {
10
+ title: 'helper components/Ripple',
11
+ };
12
+
10
13
  const Example = () => {
11
14
  const theme = useTheme();
12
15
  const ref = useRef<HTMLDivElement>();
@@ -66,6 +69,4 @@ const Example = () => {
66
69
  );
67
70
  };
68
71
 
69
- const stories = storiesOf('Helper Components/Ripple', module);
70
-
71
- stories.add('controlled', () => <Example />);
72
+ export const Controlled = () => <Example />;
@@ -27,11 +27,9 @@ export const opacityIn: Keyframes = keyframes({
27
27
 
28
28
  export const opacityOut: Keyframes = keyframes({
29
29
  from: {
30
- transform: `translate(var(${RIPPLE_TRANSLATE_END}, 0)) scale(var(${RIPPLE_SCALE_END}, 1))`,
31
30
  opacity: `var(${RIPPLE_OPACITY_END})`,
32
31
  },
33
32
  to: {
34
- transform: `translate(var(${RIPPLE_TRANSLATE_END}, 0)) scale(var(${RIPPLE_SCALE_END}, 1))`,
35
33
  opacity: '0',
36
34
  },
37
35
  });
@@ -175,7 +175,9 @@ export const useRipple = (opts: RippleOptions) => {
175
175
  `${opacityIn} ${enterDuration / 3}ms forwards`;
176
176
  break;
177
177
  case 'leaving':
178
- animation = `${opacityOut} ${leaveDuration}ms forwards`;
178
+ animation =
179
+ `${radiusIn} ${enterDuration}ms forwards,` +
180
+ `${opacityOut} ${leaveDuration}ms forwards`;
179
181
  break;
180
182
  }
181
183
 
@@ -1,11 +1,14 @@
1
1
  import { useState } from 'react';
2
2
  import { Select } from './';
3
3
  import { SelectItem } from '../SelectItem';
4
- import { storiesOf } from '@storybook/react';
5
4
  import { Box } from '../Box';
6
5
  import { CheckBox } from '../CheckBox';
7
6
  // import './styles.css';
8
7
 
8
+ export default {
9
+ title: 'components/Select',
10
+ };
11
+
9
12
  const Example = ({ variant, native = false }) => {
10
13
  const [error, setError] = useState<boolean | string>(false);
11
14
  const [color, setColor] = useState<'primary' | 'secondary'>('primary');
@@ -191,9 +194,7 @@ const Example = ({ variant, native = false }) => {
191
194
  );
192
195
  };
193
196
 
194
- const stories = storiesOf('Components/Select', module);
195
-
196
- stories.add('filled', () => <Example variant="filled" />);
197
- stories.add('outlined', () => <Example variant="outlined" />);
198
- stories.add('filled, native', () => <Example variant="filled" native />);
199
- stories.add('outlined, native', () => <Example variant="outlined" native />);
197
+ export const Filled = () => <Example variant="filled" />;
198
+ export const Outlined = () => <Example variant="outlined" />;
199
+ export const FilledNative = () => <Example variant="filled" native />;
200
+ export const OutlinedNative = () => <Example variant="outlined" native />;
@@ -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
  }: {
@@ -46,11 +49,9 @@ const Example = () => {
46
49
  );
47
50
  };
48
51
 
49
- const stories = storiesOf('Components/Skeleton', module);
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 stories = storiesOf('Components/Snackbar', module);
94
-
95
- stories.add('simple', () => <Example />);
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 />;
@@ -1,6 +1,9 @@
1
1
  import { Switch } from './';
2
2
  import { Box } from '../';
3
- import { storiesOf } from '@storybook/react';
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 stories = storiesOf('Components/Switch', module);
25
-
26
- stories.add('controlled', () => <Example />);
27
+ export const Default = () => <Example />;
@@ -1,8 +1,12 @@
1
1
  import { Tabs, TabList, Tab, TabPanels, TabPanel } from './';
2
2
  import { AppBar } from '../AppBar';
3
- import { storiesOf } from '@storybook/react';
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 stories = storiesOf('Components/Tab', module);
49
-
50
- stories.add('controlled', () => <Example />);
51
- stories.add('with app bar', () => <ExampleAppBar />);
52
+ export const Controlled = () => <Example />;
53
+ export const WithAppBar = () => <ExampleAppBar />;