@automattic/vip-design-system 0.10.1 → 0.10.2

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 (137) hide show
  1. package/.eslintrc.json +2 -5
  2. package/.storybook/decorators/withBoundingBox.jsx +15 -0
  3. package/.storybook/decorators/withColorMode.jsx +45 -0
  4. package/.storybook/decorators/withThemeProvider.jsx +18 -0
  5. package/.storybook/main.js +7 -8
  6. package/.storybook/preview.js +13 -32
  7. package/babel.config.js +2 -3
  8. package/build/system/Avatar/Avatar.js +8 -9
  9. package/build/system/Avatar/Avatar.stories.js +23 -0
  10. package/build/system/Avatar/Avatar.test.js +16 -7
  11. package/build/system/Badge/Badge.js +9 -10
  12. package/build/system/Badge/Badge.stories.js +25 -0
  13. package/build/system/Badge/Badge.test.js +16 -7
  14. package/build/system/BlankState/BlankState.js +2 -2
  15. package/build/system/BlankState/BlankState.stories.js +33 -0
  16. package/build/system/BlankState/BlankState.test.js +26 -17
  17. package/build/system/Box/Box.js +9 -4
  18. package/build/system/Box/Box.stories.js +25 -0
  19. package/build/system/Button/Button.js +9 -10
  20. package/build/system/Button/Button.stories.js +44 -0
  21. package/build/system/Button/Button.test.js +14 -5
  22. package/build/system/Card/Card.js +9 -10
  23. package/build/system/Card/Card.stories.js +25 -0
  24. package/build/system/Card/Card.test.js +19 -10
  25. package/build/system/Code/Code.js +8 -9
  26. package/build/system/Code/Code.stories.js +45 -0
  27. package/build/system/Code/Code.test.js +29 -20
  28. package/build/system/ConfirmationDialog/ConfirmationDialog.js +8 -8
  29. package/build/system/ConfirmationDialog/ConfirmationDialog.stories.js +47 -0
  30. package/build/system/Dialog/Dialog.js +8 -8
  31. package/build/system/Dialog/Dialog.stories.js +75 -0
  32. package/build/system/Dialog/DialogButton.js +8 -9
  33. package/build/system/Dialog/DialogContent.js +11 -12
  34. package/build/system/Dialog/DialogDivider.js +5 -3
  35. package/build/system/Dialog/DialogMenu.js +5 -3
  36. package/build/system/Dialog/DialogMenuItem.js +8 -9
  37. package/build/system/Dialog/DialogTrigger.js +9 -2
  38. package/build/system/Flex/Flex.js +9 -2
  39. package/build/system/Flex/Flex.stories.js +25 -0
  40. package/build/system/Form/AsyncSearchSelect.js +8 -10
  41. package/build/system/Form/Checkbox.js +10 -11
  42. package/build/system/Form/InlineSelect.js +12 -14
  43. package/build/system/Form/Input.js +8 -9
  44. package/build/system/Form/Input.stories.js +27 -0
  45. package/build/system/Form/Label.js +9 -2
  46. package/build/system/Form/MultiSelect.js +38 -0
  47. package/build/system/Form/Radio.js +8 -9
  48. package/build/system/Form/RadioBoxGroup.js +8 -9
  49. package/build/system/Form/RadioBoxGroup.stories.js +53 -0
  50. package/build/system/Form/SearchSelect.js +15 -18
  51. package/build/system/Form/Select.js +9 -10
  52. package/build/system/Form/Select.stories.js +236 -0
  53. package/build/system/Form/Select.test.js +14 -5
  54. package/build/system/Form/Textarea.js +8 -9
  55. package/build/system/Form/Toggle.js +11 -12
  56. package/build/system/Form/ToggleGroup.js +8 -9
  57. package/build/system/Form/ToggleGroup.stories.js +50 -0
  58. package/build/system/Form/ToggleRow.js +9 -10
  59. package/build/system/Form/Validation.js +8 -9
  60. package/build/system/Grid/Grid.js +9 -2
  61. package/build/system/Grid/Grid.stories.js +25 -0
  62. package/build/system/Heading/Heading.js +9 -10
  63. package/build/system/Heading/Heading.stories.js +43 -0
  64. package/build/system/Link/Link.js +9 -10
  65. package/build/system/Link/Link.stories.js +27 -0
  66. package/build/system/Notice/Notice.js +9 -10
  67. package/build/system/Notice/Notice.stories.js +73 -0
  68. package/build/system/Notification/Notification.js +2 -2
  69. package/build/system/Notification/Notification.stories.js +26 -0
  70. package/build/system/OptionRow/OptionRow.js +10 -11
  71. package/build/system/OptionRow/OptionRow.stories.js +50 -0
  72. package/build/system/OptionRow/OptionRow.test.js +16 -7
  73. package/build/system/Progress/Progress.js +9 -10
  74. package/build/system/Progress/Progress.stories.js +28 -0
  75. package/build/system/ResourceList/ResourceItem.js +2 -2
  76. package/build/system/ResourceList/ResourceList.js +13 -4
  77. package/build/system/ResourceList/ResourceList.stories.js +377 -0
  78. package/build/system/Spinner/Spinner.js +8 -9
  79. package/build/system/Spinner/Spinner.stories.js +23 -0
  80. package/build/system/Table/Table.js +10 -13
  81. package/build/system/Table/Table.stories.js +64 -0
  82. package/build/system/Table/TableRow.js +2 -2
  83. package/build/system/Tabs/TabItem.js +9 -10
  84. package/build/system/Tabs/Tabs.js +9 -10
  85. package/build/system/Tabs/Tabs.stories.js +32 -0
  86. package/build/system/Text/Text.js +9 -10
  87. package/build/system/Text/Text.stories.js +25 -0
  88. package/build/system/Time/Time.stories.js +52 -0
  89. package/build/system/Time/index.js +8 -10
  90. package/build/system/Timeline/Timeline.js +8 -9
  91. package/build/system/Timeline/Timeline.stories.js +46 -0
  92. package/build/system/Tooltip/Tooltip.js +10 -11
  93. package/build/system/Tooltip/Tooltip.stories.js +43 -0
  94. package/build/system/UsageChart/UsageChart.js +60 -0
  95. package/build/system/UsageChart/UsageChart.stories.js +20 -0
  96. package/build/system/UsageChart/index.js +7 -0
  97. package/build/system/Wizard/Wizard.js +8 -9
  98. package/build/system/Wizard/Wizard.stories.js +84 -0
  99. package/build/system/Wizard/WizardStep.js +2 -2
  100. package/build/system/Wizard/WizardStepHorizontal.js +2 -2
  101. package/build/system/index.js +3 -3
  102. package/build/system/theme/colors.js +1 -1
  103. package/build/system/theme/index.js +10 -5
  104. package/package.json +24 -13
  105. package/src/system/Avatar/{Avatar.stories.js → Avatar.stories.jsx} +0 -0
  106. package/src/system/Badge/{Badge.stories.js → Badge.stories.jsx} +0 -0
  107. package/src/system/BlankState/{BlankState.stories.js → BlankState.stories.jsx} +0 -0
  108. package/src/system/BlankState/BlankState.test.js +23 -22
  109. package/src/system/Box/{Box.stories.js → Box.stories.jsx} +0 -0
  110. package/src/system/Button/{Button.stories.js → Button.stories.jsx} +0 -0
  111. package/src/system/Card/{Card.stories.js → Card.stories.jsx} +0 -0
  112. package/src/system/Code/{Code.stories.js → Code.stories.jsx} +0 -0
  113. package/src/system/ConfirmationDialog/{ConfirmationDialog.stories.js → ConfirmationDialog.stories.jsx} +0 -0
  114. package/src/system/Dialog/{Dialog.stories.js → Dialog.stories.jsx} +0 -0
  115. package/src/system/Flex/{Flex.stories.js → Flex.stories.jsx} +0 -0
  116. package/src/system/Form/{Input.stories.js → Input.stories.jsx} +0 -0
  117. package/src/system/Form/{RadioBoxGroup.stories.js → RadioBoxGroup.stories.jsx} +0 -0
  118. package/src/system/Form/{Select.stories.js → Select.stories.jsx} +0 -0
  119. package/src/system/Form/{ToggleGroup.stories.js → ToggleGroup.stories.jsx} +0 -0
  120. package/src/system/Grid/{Grid.stories.js → Grid.stories.jsx} +0 -0
  121. package/src/system/Heading/{Heading.stories.js → Heading.stories.jsx} +0 -0
  122. package/src/system/Link/{Link.stories.js → Link.stories.jsx} +0 -0
  123. package/src/system/Notice/{Notice.stories.js → Notice.stories.jsx} +0 -0
  124. package/src/system/Notification/{Notification.stories.js → Notification.stories.jsx} +0 -0
  125. package/src/system/OptionRow/{OptionRow.stories.js → OptionRow.stories.jsx} +0 -0
  126. package/src/system/Progress/{Progress.stories.js → Progress.stories.jsx} +0 -0
  127. package/src/system/ResourceList/{ResourceList.stories.js → ResourceList.stories.jsx} +0 -0
  128. package/src/system/Spinner/{Spinner.stories.js → Spinner.stories.jsx} +0 -0
  129. package/src/system/Table/Table.js +1 -1
  130. package/src/system/Table/{Table.stories.js → Table.stories.jsx} +0 -0
  131. package/src/system/Tabs/{Tabs.stories.js → Tabs.stories.jsx} +0 -0
  132. package/src/system/Text/{Text.stories.js → Text.stories.jsx} +0 -0
  133. package/src/system/Time/{Time.stories.js → Time.stories.jsx} +0 -0
  134. package/src/system/Timeline/{Timeline.stories.js → Timeline.stories.jsx} +0 -0
  135. package/src/system/Tooltip/{Tooltip.stories.js → Tooltip.stories.jsx} +0 -0
  136. package/src/system/Wizard/{Wizard.stories.js → Wizard.stories.jsx} +0 -0
  137. package/.vscode/settings.json +0 -3
@@ -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.Wizard = 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 _react = _interopRequireDefault(require("react"));
7
13
 
8
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -17,12 +23,6 @@ var _jsxRuntime = require("theme-ui/jsx-runtime");
17
23
 
18
24
  var _excluded = ["steps", "activeStep", "variant", "completed", "className"];
19
25
 
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
-
22
- 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); }
23
-
24
- 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; }
25
-
26
26
  var Wizard = function Wizard(_ref) {
27
27
  var steps = _ref.steps,
28
28
  activeStep = _ref.activeStep,
@@ -31,12 +31,11 @@ var Wizard = function Wizard(_ref) {
31
31
  completed = _ref$completed === void 0 ? [] : _ref$completed,
32
32
  _ref$className = _ref.className,
33
33
  className = _ref$className === void 0 ? null : _ref$className,
34
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
35
-
34
+ props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
36
35
  return (0, _jsxRuntime.jsx)(_.Box, {
37
36
  className: (0, _classnames["default"])('vip-wizard-component', className),
38
37
  children: variant === 'horizontal' ? (0, _jsxRuntime.jsxs)(_.Box, {
39
- children: [(0, _jsxRuntime.jsx)(_.Flex, _extends({
38
+ children: [(0, _jsxRuntime.jsx)(_.Flex, (0, _extends2["default"])({
40
39
  sx: {
41
40
  flex: '0 0 auto'
42
41
  }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports["default"] = exports.Default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _ = require("..");
11
+
12
+ var _jsxRuntime = require("theme-ui/jsx-runtime");
13
+
14
+ /**
15
+ * External dependencies
16
+ */
17
+
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+ var _default = {
22
+ title: 'Wizard',
23
+ component: _.Wizard
24
+ };
25
+ exports["default"] = _default;
26
+
27
+ var Default = function Default() {
28
+ var steps = [{
29
+ title: 'Choose Domain',
30
+ subTitle: 'You can bring a domain name you already own, or buy a new one.',
31
+ children: (0, _jsxRuntime.jsxs)(_.Box, {
32
+ children: [(0, _jsxRuntime.jsx)(_.Label, {
33
+ children: "Domain"
34
+ }), (0, _jsxRuntime.jsx)(_.Input, {
35
+ autoFocus: true,
36
+ placeholder: "yourdomain.com"
37
+ }), (0, _jsxRuntime.jsx)(_.Button, {
38
+ children: "Continue"
39
+ })]
40
+ })
41
+ }, {
42
+ title: 'Configure DNS'
43
+ }, {
44
+ title: 'Configure Certificate'
45
+ }, {
46
+ title: 'Verify Domain'
47
+ }];
48
+ return (0, _jsxRuntime.jsxs)(_react["default"].Fragment, {
49
+ children: [(0, _jsxRuntime.jsx)(_.Flex, {
50
+ sx: {
51
+ alignItems: 'center'
52
+ },
53
+ children: (0, _jsxRuntime.jsx)(_.Box, {
54
+ sx: {
55
+ flex: '1 1 auto'
56
+ },
57
+ children: (0, _jsxRuntime.jsxs)(_.Heading, {
58
+ variant: "h1",
59
+ sx: {
60
+ display: 'flex',
61
+ alignItems: 'center',
62
+ mb: 1
63
+ },
64
+ children: ["Add Domain:", ' ', (0, _jsxRuntime.jsx)("span", {
65
+ sx: {
66
+ color: 'muted',
67
+ ml: 2
68
+ },
69
+ children: "Production"
70
+ })]
71
+ })
72
+ })
73
+ }), (0, _jsxRuntime.jsx)(_.Box, {
74
+ mt: 4,
75
+ children: (0, _jsxRuntime.jsx)(_.Wizard, {
76
+ activeStep: 0,
77
+ steps: steps,
78
+ className: "vip-wizard-xyz"
79
+ })
80
+ })]
81
+ });
82
+ };
83
+
84
+ exports.Default = Default;
@@ -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.WizardStep = 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
  /**
@@ -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.WizardStepHorizontal = 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
  /**
@@ -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
 
5
7
  var _Avatar = require("./Avatar");
@@ -133,6 +135,4 @@ var _Wizard = require("./Wizard");
133
135
 
134
136
  exports.Wizard = _Wizard.Wizard;
135
137
  exports.WizardStep = _Wizard.WizardStep;
136
- exports.WizardStepHorizontal = _Wizard.WizardStepHorizontal;
137
-
138
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
138
+ exports.WizardStepHorizontal = _Wizard.WizardStepHorizontal;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports["default"] = exports.dark = exports.light = void 0;
4
+ exports.light = exports["default"] = exports.dark = void 0;
5
5
 
6
6
  /** @jsxImportSource theme-ui */
7
7
 
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  exports.__esModule = true;
4
6
  exports["default"] = void 0;
5
7
 
6
- var _colors = require("./colors");
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
9
 
8
- 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); }
10
+ var _colors = require("./colors");
9
11
 
12
+ /**
13
+ * Internal dependencies
14
+ */
10
15
  var textStyles = {
11
16
  h1: {
12
17
  fontSize: 5,
@@ -80,7 +85,7 @@ var _default = {
80
85
  useColorSchemeMediaQuery: false
81
86
  },
82
87
  initialColorModeName: 'light',
83
- colors: _extends({
88
+ colors: (0, _extends2["default"])({
84
89
  text: _colors.light.grey['90'],
85
90
  heading: _colors.light.grey['100'],
86
91
  background: '#fdfdfd',
@@ -105,7 +110,7 @@ var _default = {
105
110
  backgroundMuted: _colors.light.grey['5']
106
111
  }, _colors.light, {
107
112
  modes: {
108
- dark: _extends({
113
+ dark: (0, _extends2["default"])({
109
114
  text: _colors.dark.grey['90'],
110
115
  heading: _colors.dark.grey['100'],
111
116
  background: _colors.dark.grey['5'],
@@ -281,7 +286,7 @@ var _default = {
281
286
  }
282
287
  },
283
288
  styles: {
284
- root: _extends({
289
+ root: (0, _extends2["default"])({
285
290
  fontFamily: 'body',
286
291
  lineHeight: 'body',
287
292
  fontWeight: 'body',
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@automattic/vip-design-system",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "main": "build/system/index.js",
5
5
  "scripts": {
6
6
  "build-storybook": "build-storybook",
7
7
  "build": "cross-env NODE_ENV=production babel src --out-dir build",
8
8
  "format": "eslint . --fix",
9
- "jest": "NODE_ENV=test jest --detectOpenHandles",
9
+ "jest": "NODE_ENV=test jest --detectOpenHandles --env=jsdom",
10
10
  "jest:coverage": "npm run jest && open-cli ./coverage/index.html",
11
11
  "jest:watch": "npm run jest --watch",
12
12
  "lint": "eslint . -f json | eslines --quiet",
13
13
  "storybook": "start-storybook -p 6006",
14
+ "dev": "npm run storybook",
14
15
  "test": "npm run lint && npm run jest",
15
16
  "watch": "npm run build -- --watch"
16
17
  },
@@ -42,7 +43,9 @@
42
43
  "json",
43
44
  "html"
44
45
  ],
45
- "testURL": "http://localhost",
46
+ "testEnvironmentOptions": {
47
+ "url": "http://localhost"
48
+ },
46
49
  "roots": [
47
50
  "<rootDir>/src",
48
51
  "<rootDir>/test"
@@ -54,14 +57,14 @@
54
57
  "<rootDir>/test/setupAfterEnv.js"
55
58
  ],
56
59
  "transformIgnorePatterns": [
57
- ".*.stories.js$"
60
+ "\\.stories.jsx$"
58
61
  ],
59
62
  "transform": {
60
63
  "\\.[jt]sx?$": "babel-jest"
61
64
  }
62
65
  },
63
66
  "devDependencies": {
64
- "@axe-core/react": "4.3.2",
67
+ "@axe-core/react": "4.4.3",
65
68
  "@babel/cli": "^7.14.3",
66
69
  "@babel/core": "7.14.0",
67
70
  "@babel/eslint-parser": "7.15.7",
@@ -71,16 +74,17 @@
71
74
  "@babel/plugin-syntax-class-static-block": "^7.14.5",
72
75
  "@babel/plugin-syntax-private-property-in-object": "^7.14.5",
73
76
  "@babel/plugin-transform-react-display-name": "^7.15.1",
77
+ "@babel/plugin-transform-runtime": "^7.18.5",
74
78
  "@babel/preset-env": "^7.14.1",
75
79
  "@babel/preset-flow": "7.13.13",
76
80
  "@babel/preset-react": "^7.12.13",
77
81
  "@babel/runtime": "7.14.0",
78
- "@storybook/addon-actions": "5.3.21",
79
- "@storybook/addon-links": "5.3.21",
80
- "@storybook/addons": "5.3.21",
81
- "@storybook/node-logger": "^6.4.0",
82
- "@storybook/preset-create-react-app": "^3.2.0",
83
- "@storybook/react": "5.3.21",
82
+ "@mdx-js/react": "^2.1.1",
83
+ "@storybook/addon-a11y": "^6.5.9",
84
+ "@storybook/addon-actions": "^6.5.9",
85
+ "@storybook/addon-essentials": "^6.5.9",
86
+ "@storybook/addon-links": "^6.5.9",
87
+ "@storybook/react": "^6.5.9",
84
88
  "@testing-library/dom": "^8.11.1",
85
89
  "@testing-library/jest-dom": "^5.15.0",
86
90
  "@testing-library/react": "^12.1.2",
@@ -95,13 +99,20 @@
95
99
  "eslint-plugin-jsx-a11y": "6.4.1",
96
100
  "eslint-plugin-no-async-foreach": "0.1.1",
97
101
  "eslint-plugin-react": "7.25.3",
102
+ "eslint-plugin-storybook": "^0.5.12",
98
103
  "eslint-plugin-wpcalypso": "4.1.0",
99
104
  "immer": ">=9.0.6",
100
- "jest-axe": "5.0.1",
105
+ "jest": "^28.1.1",
106
+ "jest-axe": "6.0.0",
107
+ "jest-environment-jsdom": "^28.1.1",
108
+ "jsdom": "19.0.0",
109
+ "jsdom-global": "3.0.2",
101
110
  "open-cli": "^7.0.1",
102
111
  "optimize-css-assets-webpack-plugin": "^6.0.1",
112
+ "react": "^17.0.2",
113
+ "react-dom": "^17.0.2",
103
114
  "react-input-autosize": "^3.0.0",
104
115
  "react-refresh": "^0.9.0",
105
- "react-scripts": "^4.0.3"
116
+ "theme-ui": "0.10.0"
106
117
  }
107
118
  }
@@ -12,47 +12,48 @@ import { BlankState } from './BlankState';
12
12
  import { Link } from '../Link';
13
13
 
14
14
  // eslint-disable-next-line max-len
15
- const image = "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";
15
+ const image =
16
+ "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";
16
17
 
17
18
  const defaultProps = {
18
- body: 'Sorry, there\'s nothing here yet.',
19
+ body: "Sorry, there's nothing here yet.",
19
20
  cta: <Link as="a">Explore add-ons →</Link>,
20
21
  image,
21
22
  imageAlt: 'This is the image alt',
22
23
  title: 'Power up your application',
23
24
  };
24
25
 
25
- describe( '<BlankState />', () => {
26
- it( 'renders the BlankState component', async () => {
27
- const { container } = render( <BlankState { ...defaultProps } /> );
26
+ describe('<BlankState />', () => {
27
+ it('renders the BlankState component', async () => {
28
+ const { container } = render(<BlankState {...defaultProps} />);
28
29
 
29
- expect( screen.getByText( defaultProps.body ) ).toBeInTheDocument();
30
- expect( screen.getByText( defaultProps.title ) ).toBeInTheDocument();
31
- expect( screen.getByText( 'Explore add-ons →' ) ).toBeInTheDocument();
32
- expect( screen.getByAltText( defaultProps.imageAlt ) ).toBeInTheDocument();
30
+ expect(screen.getByText(defaultProps.body)).toBeInTheDocument();
31
+ expect(screen.getByText(defaultProps.title)).toBeInTheDocument();
32
+ expect(screen.getByText('Explore add-ons →')).toBeInTheDocument();
33
+ expect(screen.getByAltText(defaultProps.imageAlt)).toBeInTheDocument();
33
34
 
34
35
  // Check for accessibility issues
35
- await expect( await axe( container ) ).toHaveNoViolations();
36
- } );
36
+ await expect(await axe(container)).toHaveNoViolations();
37
+ });
37
38
 
38
- it( 'renders the BlankState component with default alt text for the given image', async () => {
39
+ it('renders the BlankState component with default alt text for the given image', async () => {
39
40
  const props = { ...defaultProps, imageAlt: undefined };
40
- const { container } = render( <BlankState { ...props } /> );
41
+ const { container } = render(<BlankState {...props} />);
41
42
 
42
- expect( screen.getByAltText( 'Image representing the blank state' ) ).toBeInTheDocument();
43
+ expect(screen.getByAltText('Image representing the blank state')).toBeInTheDocument();
43
44
 
44
45
  // Check for accessibility issues
45
- await expect( await axe( container ) ).toHaveNoViolations();
46
- } );
46
+ await expect(await axe(container)).toHaveNoViolations();
47
+ });
47
48
 
48
- it( 'renders the BlankState component with an icon', async () => {
49
+ it('renders the BlankState component with an icon', async () => {
49
50
  const icon = <MdContentCopy title="this is an icon" />;
50
51
  const props = { ...defaultProps, icon };
51
- const { container } = render( <BlankState { ...props } /> );
52
+ const { container } = render(<BlankState {...props} />);
52
53
 
53
- expect( screen.getByTitle( 'this is an icon' ) ).toBeInTheDocument();
54
+ expect(screen.getByTitle('this is an icon')).toBeInTheDocument();
54
55
 
55
56
  // Check for accessibility issues
56
- await expect( await axe( container ) ).toHaveNoViolations();
57
- } );
58
- } );
57
+ await expect(await axe(container)).toHaveNoViolations();
58
+ });
59
+ });
@@ -6,7 +6,7 @@
6
6
  import PropTypes from 'prop-types';
7
7
 
8
8
  const Table = ( { sx, ...props } ) => (
9
- <div sx={ { overflowX: 'auto', pb: 300, mb: -300 } }>
9
+ <div sx={ { overflowX: 'auto' } }>
10
10
  <table
11
11
  sx={ { width: '100%', minWidth: 1024, ...sx } }
12
12
  cellPadding={ 0 }
@@ -1,3 +0,0 @@
1
- {
2
- "prettier.enable": false,
3
- }