@basic-ui/material 0.1.12 → 0.1.15

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 (114) hide show
  1. package/build/cjs/index.js +38 -27
  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/OutlinedButton.d.ts +1 -1
  13. package/build/esm/Button/TransparentButton.d.ts +1 -1
  14. package/build/esm/CheckBox/CheckBox.d.ts +1 -1
  15. package/build/esm/CheckBox/CheckBoxIcon.d.ts +1 -1
  16. package/build/esm/Chip/ButtonChip.d.ts +1 -1
  17. package/build/esm/Chip/ButtonChip.js +4 -0
  18. package/build/esm/Chip/ButtonChip.js.map +1 -1
  19. package/build/esm/Chip/ChipBase.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/DialogContainer.d.ts +1 -1
  27. package/build/esm/Dialog/DialogSurface.d.ts +1 -1
  28. package/build/esm/Dialog/Scrim.d.ts +1 -1
  29. package/build/esm/Dialog/useDialogAnimation.js +1 -1
  30. package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
  31. package/build/esm/Divider/Divider.d.ts +1 -1
  32. package/build/esm/LineRipple/LineRipple.d.ts +1 -1
  33. package/build/esm/Link/Link.d.ts +1 -1
  34. package/build/esm/List/List.d.ts +1 -1
  35. package/build/esm/ListItem/ListItem.d.ts +1 -1
  36. package/build/esm/Menu/Menu.d.ts +4 -4
  37. package/build/esm/Paper/Paper.d.ts +1 -1
  38. package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +1 -1
  39. package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
  40. package/build/esm/Select/Select.js +2 -2
  41. package/build/esm/Select/Select.js.map +1 -1
  42. package/build/esm/Select/SelectIcon.d.ts +1 -1
  43. package/build/esm/SelectItem/SelectItem.d.ts +1 -1
  44. package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
  45. package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
  46. package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
  47. package/build/esm/Skeleton/Skeleton.d.ts +1 -1
  48. package/build/esm/Snackbar/Snackbar.d.ts +1 -1
  49. package/build/esm/Switch/Switch.d.ts +1 -1
  50. package/build/esm/Tab/Tab.d.ts +1 -1
  51. package/build/esm/Tab/TabList.d.ts +1 -1
  52. package/build/esm/Tab/TabPanel.d.ts +1 -1
  53. package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
  54. package/build/esm/Table/Table.d.ts +1 -1
  55. package/build/esm/Table/TableBody.d.ts +1 -1
  56. package/build/esm/Table/TableCell.d.ts +1 -1
  57. package/build/esm/Table/TableHead.d.ts +1 -1
  58. package/build/esm/Table/TableRow.d.ts +1 -1
  59. package/build/esm/Text/LoremIpsum.d.ts +4 -4
  60. package/build/esm/Text/LoremIpsum.js.map +1 -1
  61. package/build/esm/Text/Text.d.ts +1 -1
  62. package/build/esm/TextField/FilledContainer.d.ts +1 -1
  63. package/build/esm/TextField/HelperText.d.ts +1 -1
  64. package/build/esm/TextField/Input.d.ts +1 -1
  65. package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
  66. package/build/esm/TextField/TextField.d.ts +1 -1
  67. package/build/esm/TextField/TextField.js +2 -2
  68. package/build/esm/TextField/TextField.js.map +1 -1
  69. package/build/esm/ThemeExplorer/TextFieldColorPicker.js +1 -1
  70. package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -1
  71. package/build/esm/ThemeExplorer/makeColorScheme.js +2 -2
  72. package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -1
  73. package/build/esm/Tooltip/Tooltip.d.ts +1 -1
  74. package/build/esm/hooks/useAnimation.js +22 -21
  75. package/build/esm/hooks/useAnimation.js.map +1 -1
  76. package/build/esm/theme/useTheme.d.ts +1 -425
  77. package/build/tsconfig.tsbuildinfo +1 -4757
  78. package/package.json +13 -13
  79. package/src/Alert/Alert.story.tsx +5 -6
  80. package/src/AppBar/AppBar.story.tsx +11 -20
  81. package/src/BottomSheet/BottomSheet.story.tsx +5 -6
  82. package/src/Button/Button.story.tsx +14 -14
  83. package/src/Button/SpinnerButton.story.tsx +6 -6
  84. package/src/CheckBox/CheckBox.story.tsx +7 -6
  85. package/src/Chip/ButtonChip.tsx +3 -1
  86. package/src/Chip/Chip.story.tsx +56 -6
  87. package/src/ColorMode/ColorModeProvider.tsx +9 -3
  88. package/src/Combobox/Combobox.story.tsx +12 -13
  89. package/src/Dialog/Dialog.story.tsx +7 -8
  90. package/src/Dialog/useDialogAnimation.tsx +1 -1
  91. package/src/Divider/Divider.story.tsx +6 -5
  92. package/src/FloatingLabel/FloatingLabel.story.tsx +10 -9
  93. package/src/LineRipple/LineRipple.story.tsx +5 -4
  94. package/src/Link/Link.story.tsx +3 -4
  95. package/src/ListItem/ListItem.story.tsx +6 -5
  96. package/src/Menu/Menu.story.tsx +8 -7
  97. package/src/NotchedOutline/NotchedOutline.story.tsx +5 -4
  98. package/src/Paper/Paper.story.tsx +5 -4
  99. package/src/ProgressSpinner/ProgressSpinner.story.tsx +5 -4
  100. package/src/RadioButton/RadioButton.story.tsx +12 -10
  101. package/src/Ripple/Ripple.story.tsx +5 -4
  102. package/src/Select/Select.story.tsx +8 -7
  103. package/src/Select/Select.tsx +1 -1
  104. package/src/Skeleton/Skeleton.story.tsx +7 -6
  105. package/src/Snackbar/Snackbar.story.tsx +7 -6
  106. package/src/Switch/Switch.story.tsx +5 -4
  107. package/src/Tab/Tab.story.tsx +7 -5
  108. package/src/Table/Table.story.tsx +5 -4
  109. package/src/Text/LoremIpsum.tsx +3 -1
  110. package/src/Text/Text.story.tsx +5 -4
  111. package/src/TextField/TextField.story.tsx +7 -6
  112. package/src/TextField/TextField.tsx +2 -2
  113. package/src/Tooltip/Tooltip.story.tsx +5 -4
  114. package/src/hooks/useAnimation.ts +42 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basic-ui/material",
3
- "version": "0.1.12",
3
+ "version": "0.1.15",
4
4
  "description": "Accessible React Components used as building blocks for UI patterns",
5
5
  "author": "Lucas Terra <lucasterra7@gmail.com>",
6
6
  "license": "MIT",
@@ -14,20 +14,20 @@
14
14
  ],
15
15
  "sideEffects": false,
16
16
  "scripts": {
17
- "build": "concurrently \"yarn:build:*\"",
18
- "build:dts": "tsc -p ./tsconfig.json --isolatedModules false --declaration --emitDeclarationOnly",
19
- "build:cjs": "rollup -c ../../rollup.config.js",
20
- "build:esm": "cross-env NODE_ENV=production BABEL_ENV=esm babel --config-file ../../babel.config.js ./src --extensions \".ts,.tsx,.js,.jsx\" --source-maps --out-dir ./build/esm --ignore \"**/*.story.tsx,**/*.story.ts,**/*.test.tsx,**/*.test.ts\"",
21
- "build-storybook": "build-storybook -c ../../scripts/storybook -o .out",
22
- "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
23
- "format": "prettier --write '**/*.js'",
24
- "start": "yarn run -T start-storybook -p 9001 -c ./scripts/storybook",
25
- "serve": "http-server .out",
26
- "typecheck": "tsc --noEmit",
17
+ "build": "run -T concurrently \"yarn:build:*\"",
18
+ "build:dts": "run -T tsc -p ./tsconfig.json --isolatedModules false --declaration --emitDeclarationOnly",
19
+ "build:cjs": "run -T rollup -c ../../rollup.config.js",
20
+ "build:esm": "run -T cross-env NODE_ENV=production BABEL_ENV=esm run -T babel --config-file ../../babel.config.js ./src --extensions \".ts,.tsx,.js,.jsx\" --source-maps --out-dir ./build/esm --ignore \"**/*.story.tsx,**/*.story.ts,**/*.test.tsx,**/*.test.ts\"",
21
+ "build-storybook": "run -T build-storybook -c ../../scripts/storybook -o .out",
22
+ "lint": "run -T eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
23
+ "format": "run -T prettier --write '**/*.js'",
24
+ "start": "run -T start-storybook -p 9001 -c ./scripts/storybook",
25
+ "serve": "run -T http-server .out",
26
+ "typecheck": "run -T tsc --noEmit -p ./tsconfig.json",
27
27
  "test": "echo \"Error: no test specified\" && exit 1"
28
28
  },
29
29
  "dependencies": {
30
- "@basic-ui/core": "^0.0.36",
30
+ "@basic-ui/core": "^0.0.38",
31
31
  "@styled-system/should-forward-prop": "5.1.5",
32
32
  "@types/styled-system": "^5.1.10",
33
33
  "@types/styled-system__css": "^5.0.14",
@@ -50,5 +50,5 @@
50
50
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0",
51
51
  "react-spring": "^9.0.0"
52
52
  },
53
- "gitHead": "b38f03ef63550fa2c1b3b0012129f31cb192e9fe"
53
+ "gitHead": "f3a2affbe87fb4f5e59f5528f9e3af53fc311120"
54
54
  }
@@ -1,9 +1,12 @@
1
1
  import { Alert } from './';
2
2
  import { Link } from '../Link';
3
- import { storiesOf } from '@storybook/react';
4
3
  // import './styles.css';
5
4
 
6
- const Example = () => {
5
+ export default {
6
+ title: 'Components/Alert',
7
+ };
8
+
9
+ export const Controlled = () => {
7
10
  const color = ['primary', 'secondary', 'error'];
8
11
  return (
9
12
  <>
@@ -23,7 +26,3 @@ const Example = () => {
23
26
  </>
24
27
  );
25
28
  };
26
-
27
- const stories = storiesOf('Components/Alert', module);
28
-
29
- stories.add('controlled', () => <Example />);
@@ -1,11 +1,14 @@
1
1
  import { useState } from 'react';
2
2
  import { AppBar, AppBarButton, AppBarProps } from './';
3
- import { storiesOf } from '@storybook/react';
4
3
  import { Box } from '../Box';
5
4
  import { LoremIpsum } from '../Text/LoremIpsum';
6
5
  import { Button } from '../Button';
7
6
  import { BaseLine } from '../BaseLine';
8
7
 
8
+ export default {
9
+ title: 'Components/AppBar',
10
+ };
11
+
9
12
  const MenuIcon = (props) => (
10
13
  <svg width={24} height={24} {...props}>
11
14
  <path d="M0 0h24v24H0z" fill="none" />
@@ -54,24 +57,12 @@ const Example = ({ variant, size }) => {
54
57
  );
55
58
  };
56
59
 
57
- const stories = storiesOf('Components/AppBar', module);
60
+ export const Default = () => <Example variant="default" size="default" />;
61
+ export const Primary = () => <Example variant="primary" size="default" />;
62
+ export const Secondary = () => <Example variant="secondary" size="default" />;
58
63
 
59
- stories.add('default appbar', () => (
60
- <Example variant="default" size="default" />
61
- ));
62
- stories.add('primary appbar', () => (
63
- <Example variant="primary" size="default" />
64
- ));
65
- stories.add('secondary appbar', () => (
66
- <Example variant="secondary" size="default" />
67
- ));
68
-
69
- stories.add('default appbar, dense', () => (
70
- <Example variant="default" size="dense" />
71
- ));
72
- stories.add('primary appbar, dense', () => (
73
- <Example variant="primary" size="dense" />
74
- ));
75
- stories.add('secondary appbar, dense', () => (
64
+ export const DefaultDense = () => <Example variant="default" size="dense" />;
65
+ export const PrimaryDense = () => <Example variant="primary" size="dense" />;
66
+ export const SecondaryDense = () => (
76
67
  <Example variant="secondary" size="dense" />
77
- ));
68
+ );
@@ -1,12 +1,15 @@
1
1
  import { useState } from 'react';
2
2
  import { BottomSheet } 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';
7
6
  import { Switch } from '../Switch';
8
7
 
9
- const Example = () => {
8
+ export default {
9
+ title: 'components/BottomSheet',
10
+ };
11
+
12
+ export const Default = () => {
10
13
  const [open, setOpen] = useState(false);
11
14
  const [long, setLong] = useState(false);
12
15
 
@@ -29,7 +32,3 @@ const Example = () => {
29
32
  </Box>
30
33
  );
31
34
  };
32
-
33
- const stories = storiesOf('Components/BottomSheet', module);
34
-
35
- stories.add('bottomsheet', () => <Example />);
@@ -1,8 +1,11 @@
1
1
  import { useState } from 'react';
2
2
  import { Button } from './';
3
- import { storiesOf } from '@storybook/react';
4
3
  import { Box } from '../Box';
5
4
 
5
+ export default {
6
+ title: 'components/Button',
7
+ };
8
+
6
9
  const AppsIcon = (props) => (
7
10
  <svg width={24} height={24} {...props}>
8
11
  <path
@@ -87,12 +90,11 @@ const Example = (props) => {
87
90
  );
88
91
  };
89
92
 
90
- const stories = storiesOf('Components/Button', module);
91
93
  const onClick = (e) => {
92
94
  console.log('I got clicked', e.target.innerText);
93
95
  };
94
96
 
95
- const ButtonDebug = () => {
97
+ export const DebugButtonClick = () => {
96
98
  const [count, setCount] = useState(0);
97
99
 
98
100
  return (
@@ -104,22 +106,20 @@ const ButtonDebug = () => {
104
106
  );
105
107
  };
106
108
 
107
- stories.add('debug button click', () => <ButtonDebug />);
108
-
109
- stories.add('default', () => (
109
+ export const Default = () => (
110
110
  <Example color="surface" colorTransparent="on.surface" onClick={onClick} />
111
- ));
111
+ );
112
112
 
113
- stories.add('primary', () => <Example color="primary" onClick={onClick} />);
113
+ export const Primary = () => <Example color="primary" onClick={onClick} />;
114
114
 
115
- stories.add('secondary', () => <Example color="secondary" onClick={onClick} />);
115
+ export const Secondary = () => <Example color="secondary" onClick={onClick} />;
116
116
 
117
- stories.add('error', () => <Example color="error" onClick={onClick} />);
117
+ export const Error = () => <Example color="error" onClick={onClick} />;
118
118
 
119
- stories.add('disabled', () => (
119
+ export const Disabled = () => (
120
120
  <Example color="primary" disabled={true} onClick={onClick} />
121
- ));
121
+ );
122
122
 
123
- stories.add('disabled, secondary', () => (
123
+ export const DisabledSecondary = () => (
124
124
  <Example color="secondary" disabled={true} onClick={onClick} />
125
- ));
125
+ );
@@ -5,12 +5,15 @@ import {
5
5
  SpinnerProps,
6
6
  SpinnerButtonProps,
7
7
  } from '@basic-ui/core';
8
- import { storiesOf } from '@storybook/react';
9
8
  import { Button, Box, Text } from '../';
10
9
  import { alpha } from '../color';
11
10
  import { useTheme } from '../theme';
12
11
  import { BoxProps } from '../Box';
13
12
 
13
+ export default {
14
+ title: 'components/SpinnerButton',
15
+ };
16
+
14
17
  const Spinner: FC<
15
18
  Omit<BoxProps, 'onChange'> & SpinnerProps
16
19
  > = SpinnerBase as any;
@@ -18,8 +21,6 @@ const SpinnerButton: FC<
18
21
  BoxProps & SpinnerButtonProps
19
22
  > = SpinnerButtonBase as any;
20
23
 
21
- const stories = storiesOf('OtherComponents/SpinnerButton', module);
22
-
23
24
  function AddIcon(props) {
24
25
  return (
25
26
  <svg viewBox="0 0 24 24" width={24} height={24} {...props}>
@@ -87,6 +88,5 @@ const Example = ({ vertical = false }) => {
87
88
  );
88
89
  };
89
90
 
90
- stories.add('horizontal', () => <Example />);
91
-
92
- stories.add('vertical', () => <Example vertical={true} />);
91
+ export const Horizontal = () => <Example />;
92
+ export const Vertical = () => <Example vertical={true} />;
@@ -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 />;
@@ -77,7 +77,9 @@ export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
77
77
  <Box as="span" pl={rem(4)} pr={rem(8)}>
78
78
  {leftIcon}
79
79
  </Box>
80
- <Box as="span">{children}</Box>
80
+ <Box as="span" __css={{ minWidth: 'auto', whiteSpace: 'nowrap' }}>
81
+ {children}
82
+ </Box>
81
83
  <Box as="span" pl={rem(6)} pr={rem(6)}>
82
84
  {rightIcon}
83
85
  </Box>
@@ -1,11 +1,14 @@
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
+ import { LoremIpsum } from '../Text/LoremIpsum';
8
+
9
+ export default {
10
+ title: 'components/Chip',
11
+ };
9
12
 
10
13
  const CloseIcon = (props) => (
11
14
  <Box
@@ -157,7 +160,7 @@ const AllColors = ({ variant }) => (
157
160
  </>
158
161
  );
159
162
 
160
- const AllVariants = () => {
163
+ export const AllVariants = () => {
161
164
  return (
162
165
  <>
163
166
  <AllColors variant="filled" />
@@ -166,6 +169,53 @@ const AllVariants = () => {
166
169
  );
167
170
  };
168
171
 
169
- const stories = storiesOf('Components/Chip', module);
170
-
171
- stories.add('choice chip', () => <AllVariants />);
172
+ export const HorizontallyScrollableExample = () => {
173
+ const texts = [
174
+ 'Temakis',
175
+ 'Sushis',
176
+ 'Beers',
177
+ 'Wine',
178
+ 'Soft drinks',
179
+ 'Cold drinks',
180
+ ];
181
+ return (
182
+ <Box maxWidth="300px" sx={{ backgroundColor: '#ccc' }}>
183
+ <Box
184
+ as="nav"
185
+ sx={{
186
+ position: 'sticky',
187
+ top: 0,
188
+ overflowX: 'auto',
189
+ bg: 'surface',
190
+ py: 3,
191
+ zIndex: 1,
192
+ borderColor: '#aeaeae',
193
+ borderWidth: '1px',
194
+ borderStyle: 'solid',
195
+ }}
196
+ >
197
+ <Box
198
+ sx={{
199
+ px: 3,
200
+ display: 'flex',
201
+ minWidth: 'auto',
202
+ width: 'auto',
203
+ scrollbarWidth: 'none',
204
+ '& > :not(first-of-type)': {
205
+ marginLeft: 2,
206
+ },
207
+ }}
208
+ >
209
+ {texts.map((text) => (
210
+ <Box key={text} sx={{ minWidth: 'auto' }}>
211
+ <Chip key={text}>{text}</Chip>
212
+ </Box>
213
+ ))}
214
+ </Box>
215
+ </Box>
216
+ <Box>
217
+ <LoremIpsum count={20} />
218
+ </Box>
219
+ </Box>
220
+ );
221
+ };
@@ -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,9 +1,7 @@
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
- ComboboxLabel,
7
5
  ComboboxOption,
8
6
  ComboboxList,
9
7
  ComboboxPopover,
@@ -13,7 +11,9 @@ import {
13
11
  import { Box } from '../Box';
14
12
  import cities from '../../../core/src/ComboBox/cities';
15
13
 
16
- const stories = storiesOf('Components/Combobox', module);
14
+ export default {
15
+ title: 'components/Combobox',
16
+ };
17
17
 
18
18
  function useCityMatch(searchTerm: string) {
19
19
  return useMemo(() => {
@@ -28,7 +28,7 @@ function useCityMatch(searchTerm: string) {
28
28
  }, [searchTerm]);
29
29
  }
30
30
 
31
- export function UncontrolledClientSideExample({ initialValue = '' }) {
31
+ function UncontrolledClientSideExample({ initialValue = '' }) {
32
32
  const [term, setTerm] = useState(initialValue);
33
33
  const [selected, setSelected] = useState(initialValue);
34
34
  const results = useCityMatch(term);
@@ -86,7 +86,7 @@ export function UncontrolledClientSideExample({ initialValue = '' }) {
86
86
  );
87
87
  }
88
88
 
89
- export function ControlledClientSideExample({ initialValue = '' }) {
89
+ function ControlledClientSideExample({ initialValue = '' }) {
90
90
  const [term, setTerm] = useState(initialValue);
91
91
  const [selected, setSelected] = useState(initialValue);
92
92
  const results = useCityMatch(term);
@@ -106,8 +106,6 @@ export function ControlledClientSideExample({ initialValue = '' }) {
106
106
  <p>Selection: {selected}</p>
107
107
  <p>Term: {term}</p>
108
108
  <Combobox onSelect={handleSelect} selectOnBlur>
109
- <ComboboxLabel>Enter a city name</ComboboxLabel>
110
- <br />
111
109
  <Box position="relative">
112
110
  <ComboboxInput
113
111
  onChange={handleChange}
@@ -147,11 +145,12 @@ export function ControlledClientSideExample({ initialValue = '' }) {
147
145
  );
148
146
  }
149
147
 
150
- stories.add('Uncontrolled Clientside', () => <UncontrolledClientSideExample />);
151
- stories.add('Uncontrolled Clientside - Initial', () => (
148
+ export const UncontrolledClientSide = () => <UncontrolledClientSideExample />;
149
+ export const UncontrolledClientSideInitial = () => (
152
150
  <UncontrolledClientSideExample initialValue="Aberdeen" />
153
- ));
154
- stories.add('Controlled Clientside', () => <ControlledClientSideExample />);
155
- stories.add('Controlled Clientside - Initial', () => (
151
+ );
152
+
153
+ export const ControlledClientSide = () => <ControlledClientSideExample />;
154
+ export const ControlledClientSideInitial = () => (
156
155
  <ControlledClientSideExample initialValue="Aberdeen" />
157
- ));
156
+ );
@@ -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} />;