@automattic/vip-design-system 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/.eslines.json +8 -8
  2. package/.eslintrc.json +9 -7
  3. package/.github/PULL_REQUEST_TEMPLATE.md +1 -1
  4. package/.github/workflows/nodejs.yaml +14 -14
  5. package/.prettierrc +1 -2
  6. package/.storybook/decorators/withBoundingBox.jsx +15 -0
  7. package/.storybook/decorators/withColorMode.jsx +45 -0
  8. package/.storybook/decorators/withThemeProvider.jsx +18 -0
  9. package/.storybook/main.js +7 -8
  10. package/.storybook/preview.js +10 -33
  11. package/README.md +1 -0
  12. package/babel.config.js +2 -3
  13. package/build/system/Avatar/Avatar.js +10 -10
  14. package/build/system/Avatar/Avatar.stories.js +23 -0
  15. package/build/system/Avatar/Avatar.test.js +16 -7
  16. package/build/system/Badge/Badge.js +9 -10
  17. package/build/system/Badge/Badge.stories.js +25 -0
  18. package/build/system/Badge/Badge.test.js +16 -7
  19. package/build/system/BlankState/BlankState.js +2 -2
  20. package/build/system/BlankState/BlankState.stories.js +33 -0
  21. package/build/system/BlankState/BlankState.test.js +28 -19
  22. package/build/system/Box/Box.js +9 -4
  23. package/build/system/Box/Box.stories.js +25 -0
  24. package/build/system/Button/Button.js +9 -10
  25. package/build/system/Button/Button.stories.js +44 -0
  26. package/build/system/Button/Button.test.js +14 -5
  27. package/build/system/Card/Card.js +9 -10
  28. package/build/system/Card/Card.stories.js +25 -0
  29. package/build/system/Card/Card.test.js +19 -12
  30. package/build/system/Code/Code.js +15 -11
  31. package/build/system/Code/Code.stories.js +45 -0
  32. package/build/system/Code/Code.test.js +45 -71
  33. package/build/system/ConfirmationDialog/ConfirmationDialog.js +8 -8
  34. package/build/system/ConfirmationDialog/ConfirmationDialog.stories.js +47 -0
  35. package/build/system/Dialog/Dialog.js +8 -8
  36. package/build/system/Dialog/Dialog.stories.js +75 -0
  37. package/build/system/Dialog/DialogButton.js +8 -9
  38. package/build/system/Dialog/DialogContent.js +11 -12
  39. package/build/system/Dialog/DialogDivider.js +5 -3
  40. package/build/system/Dialog/DialogMenu.js +5 -3
  41. package/build/system/Dialog/DialogMenuItem.js +8 -9
  42. package/build/system/Dialog/DialogTrigger.js +9 -2
  43. package/build/system/Flex/Flex.js +9 -2
  44. package/build/system/Flex/Flex.stories.js +25 -0
  45. package/build/system/Form/AsyncSearchSelect.js +8 -10
  46. package/build/system/Form/Checkbox.js +10 -11
  47. package/build/system/Form/InlineSelect.js +12 -14
  48. package/build/system/Form/Input.js +8 -9
  49. package/build/system/Form/Input.stories.js +27 -0
  50. package/build/system/Form/Label.js +9 -2
  51. package/build/system/Form/MultiSelect.js +58 -0
  52. package/build/system/Form/Radio.js +8 -9
  53. package/build/system/Form/RadioBoxGroup.js +8 -9
  54. package/build/system/Form/RadioBoxGroup.stories.js +53 -0
  55. package/build/system/Form/SearchSelect.js +15 -18
  56. package/build/system/Form/Select.js +9 -10
  57. package/build/system/Form/Select.stories.js +235 -0
  58. package/build/system/Form/Select.test.js +14 -5
  59. package/build/system/Form/Textarea.js +8 -9
  60. package/build/system/Form/Toggle.js +11 -12
  61. package/build/system/Form/ToggleGroup.js +8 -9
  62. package/build/system/Form/ToggleGroup.stories.js +50 -0
  63. package/build/system/Form/ToggleRow.js +9 -10
  64. package/build/system/Form/Validation.js +8 -9
  65. package/build/system/Grid/Grid.js +9 -2
  66. package/build/system/Grid/Grid.stories.js +25 -0
  67. package/build/system/Heading/Heading.js +9 -10
  68. package/build/system/Heading/Heading.stories.js +43 -0
  69. package/build/system/Link/Link.js +9 -10
  70. package/build/system/Link/Link.stories.js +27 -0
  71. package/build/system/Notice/Notice.js +9 -10
  72. package/build/system/Notice/Notice.stories.js +73 -0
  73. package/build/system/Notification/Notification.js +26 -17
  74. package/build/system/Notification/Notification.stories.js +36 -0
  75. package/build/system/OptionRow/OptionRow.js +32 -27
  76. package/build/system/OptionRow/OptionRow.stories.js +50 -0
  77. package/build/system/OptionRow/OptionRow.test.js +18 -9
  78. package/build/system/Progress/Progress.js +9 -10
  79. package/build/system/Progress/Progress.stories.js +28 -0
  80. package/build/system/ResourceList/ResourceItem.js +2 -2
  81. package/build/system/ResourceList/ResourceList.js +47 -29
  82. package/build/system/ResourceList/ResourceList.stories.js +379 -0
  83. package/build/system/ScreenReaderText/ScreenReader.test.js +37 -0
  84. package/build/system/ScreenReaderText/ScreenReaderText.js +49 -0
  85. package/build/system/ScreenReaderText/index.js +7 -0
  86. package/build/system/Spinner/Spinner.js +8 -9
  87. package/build/system/Spinner/Spinner.stories.js +23 -0
  88. package/build/system/Table/Table.js +21 -24
  89. package/build/system/Table/Table.stories.js +64 -0
  90. package/build/system/Table/TableRow.js +2 -2
  91. package/build/system/Tabs/TabItem.js +9 -10
  92. package/build/system/Tabs/Tabs.js +9 -10
  93. package/build/system/Tabs/Tabs.stories.js +32 -0
  94. package/build/system/Text/Text.js +9 -10
  95. package/build/system/Text/Text.stories.js +25 -0
  96. package/build/system/Time/Time.stories.js +52 -0
  97. package/build/system/Time/index.js +9 -11
  98. package/build/system/Timeline/Timeline.js +8 -9
  99. package/build/system/Timeline/Timeline.stories.js +46 -0
  100. package/build/system/Tooltip/Tooltip.js +10 -11
  101. package/build/system/Tooltip/Tooltip.stories.js +43 -0
  102. package/build/system/UsageChart/UsageChart.js +62 -0
  103. package/build/system/UsageChart/UsageChart.stories.js +20 -0
  104. package/build/system/UsageChart/index.js +7 -0
  105. package/build/system/Wizard/Wizard.js +8 -9
  106. package/build/system/Wizard/Wizard.stories.js +84 -0
  107. package/build/system/Wizard/WizardStep.js +2 -2
  108. package/build/system/Wizard/WizardStepHorizontal.js +2 -2
  109. package/build/system/index.js +3 -3
  110. package/build/system/theme/colors.js +1 -1
  111. package/build/system/theme/index.js +10 -5
  112. package/package.json +31 -16
  113. package/src/system/Avatar/Avatar.js +1 -0
  114. package/src/system/Avatar/{Avatar.stories.js → Avatar.stories.jsx} +0 -0
  115. package/src/system/Avatar/index.js +0 -1
  116. package/src/system/Badge/{Badge.stories.js → Badge.stories.jsx} +0 -0
  117. package/src/system/Badge/index.js +0 -1
  118. package/src/system/BlankState/BlankState.js +8 -5
  119. package/src/system/BlankState/BlankState.stories.jsx +24 -0
  120. package/src/system/BlankState/BlankState.test.js +4 -3
  121. package/src/system/BlankState/index.js +0 -1
  122. package/src/system/Box/Box.js +7 -1
  123. package/src/system/Box/{Box.stories.js → Box.stories.jsx} +0 -0
  124. package/src/system/Box/index.js +0 -1
  125. package/src/system/Button/Button.js +3 -3
  126. package/src/system/Button/{Button.stories.js → Button.stories.jsx} +2 -2
  127. package/src/system/Button/index.js +0 -1
  128. package/src/system/Card/Card.js +4 -4
  129. package/src/system/Card/{Card.stories.js → Card.stories.jsx} +0 -0
  130. package/src/system/Card/Card.test.js +1 -2
  131. package/src/system/Card/index.js +0 -1
  132. package/src/system/Code/Code.js +6 -2
  133. package/src/system/Code/{Code.stories.js → Code.stories.jsx} +10 -5
  134. package/src/system/Code/Code.test.js +3 -16
  135. package/src/system/ConfirmationDialog/ConfirmationDialog.js +8 -1
  136. package/src/system/ConfirmationDialog/{ConfirmationDialog.stories.js → ConfirmationDialog.stories.jsx} +0 -0
  137. package/src/system/Dialog/Dialog.js +17 -8
  138. package/src/system/Dialog/{Dialog.stories.js → Dialog.stories.jsx} +9 -13
  139. package/src/system/Dialog/DialogButton.js +18 -14
  140. package/src/system/Dialog/DialogDivider.js +1 -1
  141. package/src/system/Dialog/DialogMenu.js +1 -5
  142. package/src/system/Dialog/DialogMenuItem.js +4 -8
  143. package/src/system/Dialog/DialogTrigger.js +1 -1
  144. package/src/system/Dialog/index.js +0 -1
  145. package/src/system/Flex/Flex.js +1 -1
  146. package/src/system/Flex/{Flex.stories.js → Flex.stories.jsx} +0 -0
  147. package/src/system/Flex/index.js +0 -1
  148. package/src/system/Form/AsyncSearchSelect.js +3 -7
  149. package/src/system/Form/Checkbox.js +32 -28
  150. package/src/system/Form/InlineSelect.js +21 -17
  151. package/src/system/Form/Input.js +43 -45
  152. package/src/system/Form/{Input.stories.js → Input.stories.jsx} +0 -0
  153. package/src/system/Form/Label.js +2 -2
  154. package/src/system/Form/RadioBoxGroup.js +34 -32
  155. package/src/system/Form/{RadioBoxGroup.stories.js → RadioBoxGroup.stories.jsx} +8 -1
  156. package/src/system/Form/SearchSelect.js +7 -7
  157. package/src/system/Form/Select.js +21 -2
  158. package/src/system/Form/{Select.stories.js → Select.stories.jsx} +31 -34
  159. package/src/system/Form/Select.test.js +3 -8
  160. package/src/system/Form/Textarea.js +38 -40
  161. package/src/system/Form/Toggle.js +9 -11
  162. package/src/system/Form/ToggleGroup.js +29 -31
  163. package/src/system/Form/{ToggleGroup.stories.js → ToggleGroup.stories.jsx} +8 -1
  164. package/src/system/Form/ToggleRow.js +6 -1
  165. package/src/system/Form/Validation.js +6 -1
  166. package/src/system/Form/index.js +13 -1
  167. package/src/system/Grid/Grid.js +1 -1
  168. package/src/system/Grid/{Grid.stories.js → Grid.stories.jsx} +0 -0
  169. package/src/system/Grid/index.js +0 -1
  170. package/src/system/Heading/Heading.js +4 -4
  171. package/src/system/Heading/{Heading.stories.js → Heading.stories.jsx} +0 -0
  172. package/src/system/Heading/index.js +0 -1
  173. package/src/system/Link/{Link.stories.js → Link.stories.jsx} +0 -0
  174. package/src/system/Link/index.js +0 -1
  175. package/src/system/Notice/Notice.js +27 -13
  176. package/src/system/Notice/{Notice.stories.js → Notice.stories.jsx} +6 -8
  177. package/src/system/Notice/index.js +0 -1
  178. package/src/system/Notification/Notification.js +25 -20
  179. package/src/system/Notification/Notification.stories.jsx +16 -0
  180. package/src/system/Notification/index.js +0 -1
  181. package/src/system/OptionRow/OptionRow.js +46 -44
  182. package/src/system/OptionRow/OptionRow.stories.jsx +42 -0
  183. package/src/system/OptionRow/OptionRow.test.js +12 -11
  184. package/src/system/OptionRow/index.js +0 -1
  185. package/src/system/Progress/Progress.js +3 -1
  186. package/src/system/Progress/{Progress.stories.js → Progress.stories.jsx} +4 -4
  187. package/src/system/Progress/index.js +0 -1
  188. package/src/system/ResourceList/ResourceItem.js +15 -15
  189. package/src/system/ResourceList/ResourceList.js +28 -16
  190. package/src/system/ResourceList/{ResourceList.stories.js → ResourceList.stories.jsx} +77 -71
  191. package/src/system/ScreenReaderText/ScreenReader.test.js +22 -0
  192. package/src/system/ScreenReaderText/ScreenReaderText.js +40 -0
  193. package/src/system/ScreenReaderText/index.js +7 -0
  194. package/src/system/Spinner/Spinner.js +4 -4
  195. package/src/system/Spinner/{Spinner.stories.js → Spinner.stories.jsx} +0 -0
  196. package/src/system/Spinner/index.js +0 -1
  197. package/src/system/Table/Table.js +10 -9
  198. package/src/system/Table/{Table.stories.js → Table.stories.jsx} +10 -8
  199. package/src/system/Table/index.js +0 -1
  200. package/src/system/Tabs/Tabs.js +3 -3
  201. package/src/system/Tabs/{Tabs.stories.js → Tabs.stories.jsx} +0 -0
  202. package/src/system/Tabs/index.js +0 -1
  203. package/src/system/Text/Text.js +3 -3
  204. package/src/system/Text/Text.stories.jsx +18 -0
  205. package/src/system/Text/index.js +0 -1
  206. package/src/system/Time/{Time.stories.js → Time.stories.jsx} +2 -6
  207. package/src/system/Time/index.js +5 -5
  208. package/src/system/Timeline/Timeline.js +6 -12
  209. package/src/system/Timeline/{Timeline.stories.js → Timeline.stories.jsx} +3 -12
  210. package/src/system/Timeline/index.js +0 -1
  211. package/src/system/Tooltip/Tooltip.js +4 -8
  212. package/src/system/Tooltip/{Tooltip.stories.js → Tooltip.stories.jsx} +0 -0
  213. package/src/system/Wizard/Wizard.js +23 -21
  214. package/src/system/Wizard/{Wizard.stories.js → Wizard.stories.jsx} +7 -12
  215. package/src/system/Wizard/WizardStep.js +8 -8
  216. package/src/system/Wizard/WizardStepHorizontal.js +4 -4
  217. package/src/system/Wizard/index.js +0 -1
  218. package/src/system/theme/index.js +3 -4
  219. package/tokens/valet-color.json +1919 -0
  220. package/.vscode/settings.json +0 -3
  221. package/src/system/BlankState/BlankState.stories.js +0 -23
  222. package/src/system/Notification/Notification.stories.js +0 -16
  223. package/src/system/OptionRow/OptionRow.stories.js +0 -40
  224. package/src/system/Text/Text.stories.js +0 -20
package/.eslines.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
- "branches": {
3
- "default": ["downgrade-unmodified-lines"]
4
- },
5
- "processors": {
6
- "downgrade-unmodified-lines": {
7
- "remote": "origin/master"
8
- }
9
- }
2
+ "branches": {
3
+ "default": [ "downgrade-unmodified-lines" ]
4
+ },
5
+ "processors": {
6
+ "downgrade-unmodified-lines": {
7
+ "remote": "origin/master"
8
+ }
9
+ }
10
10
  }
package/.eslintrc.json CHANGED
@@ -2,18 +2,20 @@
2
2
  "parser": "@babel/eslint-parser",
3
3
  "parserOptions": {
4
4
  "babelOptions": {
5
- "presets": ["@babel/preset-react"]
5
+ "presets": [ "@babel/preset-react" ]
6
6
  }
7
7
  },
8
- "extends": [ "wpvip" ],
9
- "plugins": [
10
- "react",
11
- "jsx-a11y"
12
- ],
8
+ "extends": [ "plugin:storybook/recommended", "prettier", "wpvip" ],
9
+ "plugins": [ "react", "jsx-a11y", "prettier" ],
13
10
  "rules": {
14
11
  "id-length": 0,
15
12
  "react/jsx-uses-react": "off",
16
- "react/react-in-jsx-scope": "off"
13
+ "react/react-in-jsx-scope": "off",
14
+ "no-use-before-define": "off",
15
+ "prettier/prettier": "error",
16
+ "@typescript-eslint/no-empty-function": "off",
17
+ "@typescript-eslint/no-var-requires": "off",
18
+ "@typescript-eslint/no-explicit-any": "off"
17
19
  },
18
20
  "settings": {
19
21
  "react": {
@@ -1,6 +1,6 @@
1
1
  ## Description
2
2
 
3
- A few sentences describing the overall goals of the pull request. Any special considerations and decisions.
3
+ A few sentences describing the overall goals of the pull request. Any special considerations and decisions.
4
4
 
5
5
  Also include any references to relevant discussions and documentation.
6
6
 
@@ -4,7 +4,6 @@ on: [push]
4
4
 
5
5
  jobs:
6
6
  build:
7
-
8
7
  runs-on: ubuntu-latest
9
8
 
10
9
  timeout-minutes: 5
@@ -14,16 +13,17 @@ jobs:
14
13
  node-version: [14.x]
15
14
 
16
15
  steps:
17
- - uses: actions/checkout@v2
18
- with:
19
- persist-credentials: false
20
- - name: Use Node.js ${{ matrix.node-version }}
21
- uses: actions/setup-node@v1
22
- with:
23
- node-version: ${{ matrix.node-version }}
24
- - run: npm install -g npm@7.24.2
25
- - run: npm install
26
- - run: npm run test
27
- - run: npm run build
28
- env:
29
- CI: true
16
+ - uses: actions/checkout@v2
17
+ with:
18
+ persist-credentials: false
19
+ - name: Use Node.js ${{ matrix.node-version }}
20
+ uses: actions/setup-node@v1
21
+ with:
22
+ node-version: ${{ matrix.node-version }}
23
+ - run: npm install -g npm@7.24.2
24
+ - run: npm install
25
+ - run: npm run format:check
26
+ - run: npm run test
27
+ - run: npm run build
28
+ env:
29
+ CI: true
package/.prettierrc CHANGED
@@ -1,6 +1,5 @@
1
- arrowParens: "avoid"
1
+ arrowParens: 'avoid'
2
2
  bracketSpacing: true
3
- jsxBracketSameLine: false
4
3
  printWidth: 100
5
4
  parenSpacing: true
6
5
  semi: true
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { makeDecorator } from '@storybook/addons';
3
+ import { Box } from "../../src/system";
4
+
5
+ export default makeDecorator( {
6
+ name: 'withBoundingBox',
7
+ parameterName: 'colorMode2',
8
+ wrapper: ( storyFn, context ) => {
9
+ return (
10
+ <Box sx={{ p: 4, height: "100vh" }}>
11
+ {storyFn()}
12
+ </Box>
13
+ );
14
+ }
15
+ } );
@@ -0,0 +1,45 @@
1
+ import React, { useEffect } from 'react';
2
+ import { makeDecorator } from '@storybook/addons';
3
+ import { useColorMode } from 'theme-ui';
4
+
5
+ // These need to be updated to import VIP design tokens;
6
+ const lightBackground = '#ffffff';
7
+ const darkBackground = '#333333';
8
+
9
+ export const backgrounds = {
10
+ default: 'Light',
11
+ values: [
12
+ {
13
+ name: 'Light',
14
+ value: lightBackground,
15
+ },
16
+ {
17
+ name: 'Dark',
18
+ value: darkBackground,
19
+ },
20
+ ],
21
+ };
22
+
23
+ function ThemeChanger( { background } ) {
24
+ const [colorMode, setColorMode] = useColorMode();
25
+ const newColorMode = darkBackground === background ? 'dark' : 'default';
26
+
27
+ useEffect( () => {
28
+ setColorMode( newColorMode );
29
+ }, [ newColorMode ] );
30
+
31
+ return null;
32
+ };
33
+
34
+ export default makeDecorator( {
35
+ name: 'withColorMode',
36
+ parameterName: 'colorMode',
37
+ wrapper: ( storyFn, context ) => {
38
+ return (
39
+ <>
40
+ <ThemeChanger background={context.globals?.backgrounds?.value} />
41
+ {storyFn()}
42
+ </>
43
+ );
44
+ }
45
+ } );
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { makeDecorator } from '@storybook/addons';
3
+ import { ThemeProvider } from 'theme-ui';
4
+ import { Box, theme } from "../../src/system";
5
+
6
+ export default makeDecorator( {
7
+ name: 'withThemeProvider',
8
+ parameterName: 'themeUi',
9
+ wrapper: ( storyFn, context ) => {
10
+ return (
11
+ <ThemeProvider theme={theme}>
12
+ <Box sx={{ p: 4, height: "100vh" }}>
13
+ {storyFn( context )}
14
+ </Box>
15
+ </ThemeProvider>
16
+ );
17
+ }
18
+ } );
@@ -1,10 +1,9 @@
1
1
  module.exports = {
2
- presets: ["@storybook/preset-create-react-app"],
3
- stories: ["../src/**/*.stories.js"],
4
- addons: ["@storybook/addon-actions", "@storybook/addon-links"],
5
- webpackFinal: async (config) => {
6
- // do mutation to the config
7
-
8
- return config;
9
- },
2
+ stories: [ '../src/**/*.stories.jsx' ],
3
+ addons: [
4
+ '@storybook/addon-a11y',
5
+ '@storybook/addon-docs',
6
+ '@storybook/addon-essentials',
7
+ '@storybook/addon-links',
8
+ ],
10
9
  };
@@ -1,38 +1,15 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
- import { ThemeProvider, useColorMode } from "theme-ui";
4
- import { addDecorator } from "@storybook/react";
5
- import { Button, Box, theme, Link } from "../src/system";
6
- import axe from '@axe-core/react'
3
+ import axe from '@axe-core/react';
4
+ import withBoundingBox from './decorators/withBoundingBox';
5
+ import withColorMode, { backgrounds } from './decorators/withColorMode';
6
+ import withThemeProvider from './decorators/withThemeProvider';
7
7
 
8
- const ThemeChanger = () => {
9
- const [colorMode, setColorMode] = useColorMode();
8
+ axe( React, ReactDOM, 1000 );
10
9
 
11
- const setDarkMode = (isDark) => setColorMode(isDark ? "dark" : "default");
10
+ export const decorators = [ withBoundingBox, withColorMode, withThemeProvider ];
12
11
 
13
- return (
14
- <Link
15
- href="#!"
16
- onClick={(e) => {
17
- e.preventDefault();
18
- setDarkMode(colorMode == "dark" ? false : true);
19
- }}
20
- >
21
- <Button sx={{ position: "fixed", right: 106, top: 36 }}>
22
- Toggle
23
- </Button>
24
- </Link>
25
- );
12
+ export const parameters = {
13
+ actions: { argTypesRegex: '^on[A-Z].*' },
14
+ backgrounds,
26
15
  };
27
-
28
-
29
- axe( React, ReactDOM, 1000 );
30
-
31
- addDecorator((story) => (
32
- <React.Fragment>
33
- <ThemeProvider theme={theme}>
34
- <ThemeChanger />
35
- <Box sx={{ p: 4, height: "100vh" }}>{story()}</Box>
36
- </ThemeProvider>
37
- </React.Fragment>
38
- ));
package/README.md CHANGED
@@ -61,6 +61,7 @@ npm run build
61
61
  ```
62
62
 
63
63
  6. Publish the application
64
+
64
65
  ```
65
66
  npm publish
66
67
  ```
package/babel.config.js CHANGED
@@ -1,7 +1,6 @@
1
1
  module.exports = {
2
- ignore: [
3
- '**/*.stories.js',
4
- ],
2
+ ignore: [],
3
+ plugins: [ '@babel/plugin-transform-runtime' ],
5
4
  presets: [
6
5
  [
7
6
  '@babel/preset-env',
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  exports.__esModule = true;
4
6
  exports.Avatar = void 0;
5
7
 
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
+
6
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
7
13
 
8
14
  var _themeUi = require("theme-ui");
@@ -15,12 +21,6 @@ var _jsxRuntime = require("theme-ui/jsx-runtime");
15
21
 
16
22
  var _excluded = ["isVIP", "name", "size", "src", "className"];
17
23
 
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
-
20
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
-
22
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
23
-
24
24
  var Avatar = function Avatar(_ref) {
25
25
  var _ref$isVIP = _ref.isVIP,
26
26
  isVIP = _ref$isVIP === void 0 ? false : _ref$isVIP,
@@ -32,9 +32,8 @@ var Avatar = function Avatar(_ref) {
32
32
  src = _ref$src === void 0 ? null : _ref$src,
33
33
  _ref$className = _ref.className,
34
34
  className = _ref$className === void 0 ? null : _ref$className,
35
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
36
-
37
- return (0, _jsxRuntime.jsx)(_.Box, _extends({
35
+ props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
36
+ return (0, _jsxRuntime.jsx)(_.Box, (0, _extends2["default"])({
38
37
  sx: {
39
38
  borderRadius: 9999,
40
39
  height: size + 2,
@@ -52,7 +51,8 @@ var Avatar = function Avatar(_ref) {
52
51
  padding: '1px',
53
52
  textAlign: 'center'
54
53
  },
55
- className: (0, _classnames["default"])('vip-avatar-component', className)
54
+ className: (0, _classnames["default"])('vip-avatar-component', className),
55
+ "aria-hidden": "true"
56
56
  }, props, {
57
57
  children: src ? (0, _jsxRuntime.jsx)(_themeUi.Image, {
58
58
  src: src,
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports["default"] = exports.Default = void 0;
5
+
6
+ var _ = require("..");
7
+
8
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ var _default = {
14
+ title: 'Avatar',
15
+ component: _.Avatar
16
+ };
17
+ exports["default"] = _default;
18
+
19
+ var Default = function Default() {
20
+ return (0, _jsxRuntime.jsx)(_.Avatar, {});
21
+ };
22
+
23
+ exports.Default = Default;
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
+
7
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
+
3
9
  var _react = require("@testing-library/react");
4
10
 
5
11
  var _jestAxe = require("jest-axe");
@@ -8,15 +14,18 @@ var _Avatar = require("./Avatar");
8
14
 
9
15
  var _jsxRuntime = require("theme-ui/jsx-runtime");
10
16
 
11
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
-
13
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
17
+ /**
18
+ * External dependencies
19
+ */
14
20
 
21
+ /**
22
+ * Internal dependencies
23
+ */
15
24
  describe('<Avatar />', function () {
16
- it('renders the Avatar without an image', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
25
+ it('renders the Avatar without an image', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
17
26
  var _render, container;
18
27
 
19
- return regeneratorRuntime.wrap(function _callee$(_context) {
28
+ return _regenerator["default"].wrap(function _callee$(_context) {
20
29
  while (1) {
21
30
  switch (_context.prev = _context.next) {
22
31
  case 0:
@@ -41,10 +50,10 @@ describe('<Avatar />', function () {
41
50
  }
42
51
  }, _callee);
43
52
  })));
44
- it('renders the Avatar with image', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
53
+ it('renders the Avatar with image', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
45
54
  var _render2, container;
46
55
 
47
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
56
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
48
57
  while (1) {
49
58
  switch (_context2.prev = _context2.next) {
50
59
  case 0:
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  exports.__esModule = true;
4
6
  exports.Badge = void 0;
5
7
 
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
+
6
12
  var _classnames = _interopRequireDefault(require("classnames"));
7
13
 
8
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -13,23 +19,16 @@ var _jsxRuntime = require("theme-ui/jsx-runtime");
13
19
 
14
20
  var _excluded = ["variant", "sx", "className"];
15
21
 
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
-
18
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
-
20
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
-
22
22
  var Badge = function Badge(_ref) {
23
23
  var _ref$variant = _ref.variant,
24
24
  variant = _ref$variant === void 0 ? 'blue' : _ref$variant,
25
25
  sx = _ref.sx,
26
26
  _ref$className = _ref.className,
27
27
  className = _ref$className === void 0 ? null : _ref$className,
28
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
29
-
30
- return (0, _jsxRuntime.jsx)(_.Text, _extends({
28
+ props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
29
+ return (0, _jsxRuntime.jsx)(_.Text, (0, _extends2["default"])({
31
30
  as: "span",
32
- sx: _extends({
31
+ sx: (0, _extends2["default"])({
33
32
  fontSize: 0,
34
33
  padding: 0,
35
34
  bg: variant + ".20",
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports["default"] = exports.Default = void 0;
5
+
6
+ var _ = require("..");
7
+
8
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ var _default = {
14
+ title: 'Badge',
15
+ component: _.Badge
16
+ };
17
+ exports["default"] = _default;
18
+
19
+ var Default = function Default() {
20
+ return (0, _jsxRuntime.jsx)(_.Badge, {
21
+ children: "Badge"
22
+ });
23
+ };
24
+
25
+ exports.Default = Default;
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
+
7
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
+
3
9
  var _react = require("@testing-library/react");
4
10
 
5
11
  var _jestAxe = require("jest-axe");
@@ -8,15 +14,18 @@ var _Badge = require("./Badge");
8
14
 
9
15
  var _jsxRuntime = require("theme-ui/jsx-runtime");
10
16
 
11
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
-
13
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
17
+ /**
18
+ * External dependencies
19
+ */
14
20
 
21
+ /**
22
+ * Internal dependencies
23
+ */
15
24
  describe('<Badge />', function () {
16
- it('renders the Badge component', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
25
+ it('renders the Badge component', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
17
26
  var _render, container;
18
27
 
19
- return regeneratorRuntime.wrap(function _callee$(_context) {
28
+ return _regenerator["default"].wrap(function _callee$(_context) {
20
29
  while (1) {
21
30
  switch (_context.prev = _context.next) {
22
31
  case 0:
@@ -41,10 +50,10 @@ describe('<Badge />', function () {
41
50
  }
42
51
  }, _callee);
43
52
  })));
44
- it('renders the Badge component with a different variant', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
53
+ it('renders the Badge component with a different variant', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
45
54
  var _render2, container;
46
55
 
47
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
56
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
48
57
  while (1) {
49
58
  switch (_context2.prev = _context2.next) {
50
59
  case 0:
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  exports.__esModule = true;
4
6
  exports.BlankState = void 0;
5
7
 
@@ -11,8 +13,6 @@ var _ = require("..");
11
13
 
12
14
  var _jsxRuntime = require("theme-ui/jsx-runtime");
13
15
 
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
16
  /** @jsxImportSource theme-ui */
17
17
 
18
18
  /**
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports["default"] = exports.Default = void 0;
5
+
6
+ var _ = require("..");
7
+
8
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ var _default = {
14
+ title: 'BlankState',
15
+ component: _.BlankState
16
+ };
17
+ exports["default"] = _default;
18
+ var image2 = // eslint-disable-next-line max-len
19
+ "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='79' height='79' viewBox='0 0 79 79' fill='none'%3E%3Cpath d='M66.3001 15.9C66.3001 15.9 66.3 15.8 66.2 15.8C66.1 15.7 66 15.5 65.9001 15.4C65.9001 15.4 65.9001 15.4 65.9001 15.3L44.4001 0.2C44.3001 0.0999998 44.2 0.0999994 44.1 0.0999994C44 0.0999994 44.0001 0 43.9001 0H43.3C43.2 0 43.1 0.0999994 43.1 0.0999994C43 0.0999994 42.9 0.2 42.8 0.2L28.2001 10.3C28.1 10.4 28.0001 10.5 27.9001 10.6C27.9001 10.6 27.9001 10.6 27.9001 10.7C27.8001 10.8 27.7001 11 27.7001 11.2C27.7001 11.2 27.7001 11.2 27.7001 11.3V31.1L13.9 40.8L13.7001 41C13.6001 41.1 13.6 41.1 13.6 41.2L13.5 41.3C13.5 41.4 13.4 41.5 13.4 41.5V41.6C13.4 41.7 13.3 41.8 13.3 42V62.2C13.3 62.4 13.3 62.6 13.4 62.7V62.8C13.5 62.9 13.6001 63.1 13.7001 63.2C13.7001 63.2 13.7 63.2 13.8 63.3L13.9 63.4L35.3 78.6H35.4001C35.4001 78.6 35.5 78.6 35.5 78.7H35.6C35.8 78.8 36 78.8 36.2001 78.8C36.3001 78.8 36.5 78.8 36.6 78.7H36.7001C36.8001 78.7 36.8001 78.7 36.9001 78.6C36.9001 78.6 37 78.6 37 78.5H37.1L66 58.3C66.1 58.2 66.2001 58.1 66.3001 58V15.9ZM34.6 74.5L16.1 61.3V44.7L34.6 57.8V74.5ZM36 55.3L17.2001 41.9L29 33.5L47.9001 46.9L36 55.3ZM49 44.1L30.5 31V14.4L49 27.5V44.1ZM50.5 24.9L31.6 11.5L43.5 3.2L62.4001 16.6L50.5 24.9Z' fill='%23BD9D70'/%3E%3C/svg%3E";
20
+
21
+ var Default = function Default() {
22
+ return (0, _jsxRuntime.jsx)(_.BlankState, {
23
+ image: image2,
24
+ title: "Power up your application",
25
+ body: "Add-ons give you the ability to bolt on extra capabilities to\nyour application, including logging, analytics and performance\nmonitoring.",
26
+ cta: (0, _jsxRuntime.jsx)(_.Link, {
27
+ as: "a",
28
+ children: "Explore add-ons \u2192"
29
+ })
30
+ });
31
+ };
32
+
33
+ exports.Default = Default;