@automattic/vip-design-system 0.9.5 → 0.10.1

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 (89) hide show
  1. package/.github/workflows/nodejs.yaml +1 -1
  2. package/.vscode/settings.json +3 -0
  3. package/README.md +4 -4
  4. package/build/system/Avatar/Avatar.js +9 -3
  5. package/build/system/Badge/Badge.js +9 -3
  6. package/build/system/BlankState/BlankState.js +8 -2
  7. package/build/system/Box/Box.js +12 -2
  8. package/build/system/Button/Button.js +6 -2
  9. package/build/system/Card/Card.js +8 -3
  10. package/build/system/Code/Code.js +8 -3
  11. package/build/system/ConfirmationDialog/ConfirmationDialog.js +8 -2
  12. package/build/system/Dialog/Dialog.js +1 -0
  13. package/build/system/Form/Select.js +1 -0
  14. package/build/system/Form/Toggle.js +8 -2
  15. package/build/system/Heading/Heading.js +9 -3
  16. package/build/system/Notice/Notice.js +9 -3
  17. package/build/system/Notification/Notification.js +1 -0
  18. package/build/system/OptionRow/OptionRow.js +16 -5
  19. package/build/system/OptionRow/OptionRow.test.js +84 -0
  20. package/build/system/Progress/Progress.js +9 -3
  21. package/build/system/ResourceList/ResourceList.js +1 -0
  22. package/build/system/Spinner/Spinner.js +9 -3
  23. package/build/system/Tabs/TabItem.js +1 -0
  24. package/build/system/Tabs/Tabs.js +10 -4
  25. package/build/system/Text/Text.js +9 -3
  26. package/build/system/Time/index.js +9 -3
  27. package/build/system/Timeline/Timeline.js +11 -3
  28. package/build/system/Wizard/Wizard.js +10 -2
  29. package/build/system/Wizard/WizardStep.js +6 -2
  30. package/build/system/Wizard/WizardStepHorizontal.js +6 -2
  31. package/package.json +2 -1
  32. package/src/system/Avatar/Avatar.js +4 -0
  33. package/src/system/Badge/Badge.js +4 -1
  34. package/src/system/BlankState/BlankState.js +4 -1
  35. package/src/system/Box/Box.js +6 -1
  36. package/src/system/Button/Button.js +3 -0
  37. package/src/system/Card/Card.js +4 -1
  38. package/src/system/Code/Code.js +4 -1
  39. package/src/system/ConfirmationDialog/ConfirmationDialog.js +4 -2
  40. package/src/system/Dialog/Dialog.js +1 -1
  41. package/src/system/Form/Select.js +1 -1
  42. package/src/system/Form/Toggle.js +4 -2
  43. package/src/system/Heading/Heading.js +4 -1
  44. package/src/system/Notice/Notice.js +4 -1
  45. package/src/system/Notification/Notification.js +1 -0
  46. package/src/system/OptionRow/OptionRow.js +11 -2
  47. package/src/system/OptionRow/OptionRow.stories.js +9 -0
  48. package/src/system/OptionRow/OptionRow.test.js +49 -0
  49. package/src/system/Progress/Progress.js +4 -1
  50. package/src/system/ResourceList/ResourceList.js +1 -1
  51. package/src/system/Spinner/Spinner.js +4 -1
  52. package/src/system/Tabs/TabItem.js +1 -0
  53. package/src/system/Tabs/Tabs.js +5 -2
  54. package/src/system/Text/Text.js +4 -1
  55. package/src/system/Time/index.js +4 -1
  56. package/src/system/Timeline/Timeline.js +5 -3
  57. package/src/system/Wizard/Wizard.js +6 -2
  58. package/src/system/Wizard/Wizard.stories.js +1 -1
  59. package/src/system/Wizard/WizardStep.js +5 -2
  60. package/src/system/Wizard/WizardStepHorizontal.js +4 -1
  61. package/build/system/Avatar/Avatar.stories.js +0 -31
  62. package/build/system/Badge/Badge.stories.js +0 -33
  63. package/build/system/BlankState/BlankState.stories.js +0 -41
  64. package/build/system/Box/Box.stories.js +0 -33
  65. package/build/system/Button/Button.stories.js +0 -44
  66. package/build/system/Card/Card.stories.js +0 -33
  67. package/build/system/Code/Code.stories.js +0 -33
  68. package/build/system/ConfirmationDialog/ConfirmationDialog.stories.js +0 -55
  69. package/build/system/Dialog/Dialog.stories.js +0 -83
  70. package/build/system/Flex/Flex.stories.js +0 -33
  71. package/build/system/Form/Input.stories.js +0 -33
  72. package/build/system/Form/MultiSelect.js +0 -38
  73. package/build/system/Form/Select.stories.js +0 -150
  74. package/build/system/Grid/Grid.stories.js +0 -33
  75. package/build/system/Heading/Heading.stories.js +0 -51
  76. package/build/system/Link/Link.stories.js +0 -35
  77. package/build/system/Notice/Notice.stories.js +0 -56
  78. package/build/system/Notification/Notification.stories.js +0 -34
  79. package/build/system/OptionRow/OptionRow.stories.js +0 -50
  80. package/build/system/Progress/Progress.stories.js +0 -36
  81. package/build/system/Spinner/Spinner.stories.js +0 -31
  82. package/build/system/Table/Table.stories.js +0 -72
  83. package/build/system/Tabs/Tabs.stories.js +0 -40
  84. package/build/system/Text/Text.stories.js +0 -33
  85. package/build/system/Timeline/Timeline.stories.js +0 -52
  86. package/build/system/Tooltip/Tooltip.stories.js +0 -51
  87. package/build/system/UsageChart/UsageChart.js +0 -60
  88. package/build/system/UsageChart/index.js +0 -7
  89. package/build/system/Wizard/Wizard.stories.js +0 -83
@@ -83,6 +83,7 @@ var ResourceList = function ResourceList(_ref) {
83
83
  m: 0,
84
84
  p: 0
85
85
  },
86
+ className: "vip-resource-list-component",
86
87
  children: groupedByDay ? Object.keys(groupedItems).map(function (groupName, index) {
87
88
  return (0, _jsxRuntime.jsxs)(_.Box, {
88
89
  sx: {
@@ -7,9 +7,11 @@ var _themeUi = require("theme-ui");
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
10
12
  var _jsxRuntime = require("theme-ui/jsx-runtime");
11
13
 
12
- var _excluded = ["sx"];
14
+ var _excluded = ["sx", "className"];
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
17
 
@@ -19,6 +21,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
19
21
 
20
22
  var Spinner = function Spinner(_ref) {
21
23
  var sx = _ref.sx,
24
+ _ref$className = _ref.className,
25
+ className = _ref$className === void 0 ? null : _ref$className,
22
26
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
23
27
 
24
28
  return (0, _jsxRuntime.jsx)(_themeUi.Spinner, _extends({
@@ -26,11 +30,13 @@ var Spinner = function Spinner(_ref) {
26
30
  sx: {
27
31
  fill: 'none',
28
32
  color: 'primary'
29
- }
33
+ },
34
+ className: (0, _classnames["default"])('vip-spinner-component', className)
30
35
  }, props));
31
36
  };
32
37
 
33
38
  exports.Spinner = Spinner;
34
39
  Spinner.propTypes = {
35
- sx: _propTypes["default"].object
40
+ sx: _propTypes["default"].object,
41
+ className: _propTypes["default"].any
36
42
  };
@@ -27,6 +27,7 @@ var TabItem = function TabItem(_ref) {
27
27
  variant: "h4",
28
28
  as: "button",
29
29
  tabIndex: "0",
30
+ "data-active": active || undefined,
30
31
  sx: _extends({
31
32
  cursor: 'pointer',
32
33
  background: 'none',
@@ -3,13 +3,15 @@
3
3
  exports.__esModule = true;
4
4
  exports.Tabs = void 0;
5
5
 
6
+ var _classnames = _interopRequireDefault(require("classnames"));
7
+
6
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
7
9
 
8
10
  var _ = require("..");
9
11
 
10
12
  var _jsxRuntime = require("theme-ui/jsx-runtime");
11
13
 
12
- var _excluded = ["sx"];
14
+ var _excluded = ["className", "sx"];
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
17
 
@@ -18,10 +20,13 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
18
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; }
19
21
 
20
22
  var Tabs = function Tabs(_ref) {
21
- var sx = _ref.sx,
23
+ var _ref$className = _ref.className,
24
+ className = _ref$className === void 0 ? null : _ref$className,
25
+ sx = _ref.sx,
22
26
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
23
27
 
24
28
  return (0, _jsxRuntime.jsx)(_.Flex, _extends({
29
+ className: (0, _classnames["default"])('vip-tabs-component', className),
25
30
  sx: _extends({
26
31
  borderBottom: '1px solid',
27
32
  borderColor: 'border',
@@ -34,6 +39,7 @@ var Tabs = function Tabs(_ref) {
34
39
 
35
40
  exports.Tabs = Tabs;
36
41
  Tabs.propTypes = {
37
- variant: _propTypes["default"].string,
38
- sx: _propTypes["default"].object
42
+ className: _propTypes["default"].any,
43
+ sx: _propTypes["default"].object,
44
+ variant: _propTypes["default"].string
39
45
  };
@@ -7,9 +7,11 @@ var _themeUi = require("theme-ui");
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
10
12
  var _jsxRuntime = require("theme-ui/jsx-runtime");
11
13
 
12
- var _excluded = ["sx"];
14
+ var _excluded = ["sx", "className"];
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
17
 
@@ -19,6 +21,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
19
21
 
20
22
  var Text = function Text(_ref) {
21
23
  var sx = _ref.sx,
24
+ _ref$className = _ref.className,
25
+ className = _ref$className === void 0 ? null : _ref$className,
22
26
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
23
27
 
24
28
  return (0, _jsxRuntime.jsx)(_themeUi.Text, _extends({
@@ -26,11 +30,13 @@ var Text = function Text(_ref) {
26
30
  sx: _extends({
27
31
  lineHeight: 1.5,
28
32
  marginBottom: 2
29
- }, sx)
33
+ }, sx),
34
+ className: (0, _classnames["default"])('vip-text-component', className)
30
35
  }, props));
31
36
  };
32
37
 
33
38
  exports.Text = Text;
34
39
  Text.propTypes = {
35
- sx: _propTypes["default"].object
40
+ sx: _propTypes["default"].object,
41
+ className: _propTypes["default"].any
36
42
  };
@@ -7,9 +7,11 @@ var _themeUi = require("theme-ui");
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
10
12
  var _jsxRuntime = require("theme-ui/jsx-runtime");
11
13
 
12
- var _excluded = ["time", "relativeTime", "timeOnly"];
14
+ var _excluded = ["time", "relativeTime", "timeOnly", "className"];
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
17
 
@@ -60,6 +62,8 @@ var Time = function Time(_ref) {
60
62
  relativeTime = _ref$relativeTime === void 0 ? false : _ref$relativeTime,
61
63
  _ref$timeOnly = _ref.timeOnly,
62
64
  timeOnly = _ref$timeOnly === void 0 ? false : _ref$timeOnly,
65
+ _ref$className = _ref.className,
66
+ className = _ref$className === void 0 ? null : _ref$className,
63
67
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
64
68
 
65
69
  var formattedTime;
@@ -77,7 +81,8 @@ var Time = function Time(_ref) {
77
81
  timeZoneName: 'short'
78
82
  }),
79
83
  datetime: time,
80
- as: "time"
84
+ as: "time",
85
+ className: (0, _classnames["default"])('vip-time-component', className)
81
86
  }, props, {
82
87
  children: formattedTime
83
88
  }));
@@ -87,5 +92,6 @@ exports.Time = Time;
87
92
  Time.propTypes = {
88
93
  time: _propTypes["default"].string,
89
94
  timeOnly: _propTypes["default"].bool,
90
- relativeTime: _propTypes["default"].bool
95
+ relativeTime: _propTypes["default"].bool,
96
+ className: _propTypes["default"].any
91
97
  };
@@ -9,9 +9,11 @@ var _md = require("react-icons/md");
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
12
14
  var _jsxRuntime = require("theme-ui/jsx-runtime");
13
15
 
14
- var _excluded = ["time", "first", "last"];
16
+ var _excluded = ["time", "first", "last", "className"];
15
17
 
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
19
 
@@ -36,9 +38,13 @@ var Timeline = function Timeline(_ref) {
36
38
  first = _ref$first === void 0 ? false : _ref$first,
37
39
  _ref$last = _ref.last,
38
40
  last = _ref$last === void 0 ? false : _ref$last,
41
+ _ref$className = _ref.className,
42
+ className = _ref$className === void 0 ? null : _ref$className,
39
43
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
40
44
 
41
- return (0, _jsxRuntime.jsxs)(_themeUi.Flex, _extends({}, props, {
45
+ return (0, _jsxRuntime.jsxs)(_themeUi.Flex, _extends({
46
+ className: (0, _classnames["default"])('vip-timeline-component', className)
47
+ }, props, {
42
48
  children: [(0, _jsxRuntime.jsxs)(_themeUi.Flex, {
43
49
  sx: {
44
50
  flexDirection: 'column',
@@ -46,6 +52,7 @@ var Timeline = function Timeline(_ref) {
46
52
  alignItems: 'center'
47
53
  },
48
54
  children: [!first && (0, _jsxRuntime.jsx)(VerticalLine, {}), (0, _jsxRuntime.jsx)(_md.MdWatchLater, {
55
+ "aria-hidden": true,
49
56
  sx: {
50
57
  color: 'border'
51
58
  },
@@ -65,5 +72,6 @@ exports.Timeline = Timeline;
65
72
  Timeline.propTypes = {
66
73
  first: _propTypes["default"].bool,
67
74
  time: _propTypes["default"].node,
68
- last: _propTypes["default"].bool
75
+ last: _propTypes["default"].bool,
76
+ className: _propTypes["default"].any
69
77
  };
@@ -7,13 +7,15 @@ var _react = _interopRequireDefault(require("react"));
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
10
12
  var _md = require("react-icons/md");
11
13
 
12
14
  var _ = require("..");
13
15
 
14
16
  var _jsxRuntime = require("theme-ui/jsx-runtime");
15
17
 
16
- var _excluded = ["steps", "activeStep", "variant", "completed"];
18
+ var _excluded = ["steps", "activeStep", "variant", "completed", "className"];
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
21
 
@@ -27,9 +29,12 @@ var Wizard = function Wizard(_ref) {
27
29
  variant = _ref.variant,
28
30
  _ref$completed = _ref.completed,
29
31
  completed = _ref$completed === void 0 ? [] : _ref$completed,
32
+ _ref$className = _ref.className,
33
+ className = _ref$className === void 0 ? null : _ref$className,
30
34
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
31
35
 
32
36
  return (0, _jsxRuntime.jsx)(_.Box, {
37
+ className: (0, _classnames["default"])('vip-wizard-component', className),
33
38
  children: variant === 'horizontal' ? (0, _jsxRuntime.jsxs)(_.Box, {
34
39
  children: [(0, _jsxRuntime.jsx)(_.Flex, _extends({
35
40
  sx: {
@@ -41,6 +46,7 @@ var Wizard = function Wizard(_ref) {
41
46
  subTitle = _ref2.subTitle;
42
47
  return (0, _jsxRuntime.jsxs)(_react["default"].Fragment, {
43
48
  children: [(0, _jsxRuntime.jsx)(_.WizardStepHorizontal, {
49
+ order: index + 1,
44
50
  active: index === activeStep,
45
51
  title: title,
46
52
  subTitle: subTitle
@@ -62,6 +68,7 @@ var Wizard = function Wizard(_ref) {
62
68
  title: title,
63
69
  subTitle: subTitle,
64
70
  complete: completed.includes(index),
71
+ order: index + 1,
65
72
  children: children
66
73
  }, index);
67
74
  })
@@ -73,5 +80,6 @@ Wizard.propTypes = {
73
80
  steps: _propTypes["default"].array,
74
81
  activeStep: _propTypes["default"].number,
75
82
  variant: _propTypes["default"].string,
76
- completed: _propTypes["default"].array
83
+ completed: _propTypes["default"].array,
84
+ className: _propTypes["default"].any
77
85
  };
@@ -28,7 +28,8 @@ var WizardStep = function WizardStep(_ref) {
28
28
  _ref$complete = _ref.complete,
29
29
  complete = _ref$complete === void 0 ? false : _ref$complete,
30
30
  children = _ref.children,
31
- active = _ref.active;
31
+ active = _ref.active,
32
+ order = _ref.order;
32
33
  var borderLeftColor = 'border';
33
34
 
34
35
  if (complete) {
@@ -60,6 +61,8 @@ var WizardStep = function WizardStep(_ref) {
60
61
  borderColor: active ? 'primary' : 'border',
61
62
  borderLeftColor: borderLeftColor
62
63
  },
64
+ "data-step": order,
65
+ "data-active": active || undefined,
63
66
  children: [(0, _jsxRuntime.jsxs)(_.Heading, {
64
67
  variant: "h4",
65
68
  sx: {
@@ -88,5 +91,6 @@ WizardStep.propTypes = {
88
91
  subTitle: _propTypes["default"].node,
89
92
  complete: _propTypes["default"].bool,
90
93
  active: _propTypes["default"].bool,
91
- children: _propTypes["default"].node.isRequired
94
+ children: _propTypes["default"].node,
95
+ order: _propTypes["default"].number.isRequired
92
96
  };
@@ -24,7 +24,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
24
24
  */
25
25
  var WizardStepHorizontal = function WizardStepHorizontal(_ref) {
26
26
  var title = _ref.title,
27
- active = _ref.active;
27
+ active = _ref.active,
28
+ order = _ref.order;
28
29
  return (0, _jsxRuntime.jsxs)(_.Heading, {
29
30
  variant: "h4",
30
31
  sx: {
@@ -33,6 +34,8 @@ var WizardStepHorizontal = function WizardStepHorizontal(_ref) {
33
34
  alignItems: 'center',
34
35
  color: active ? 'heading' : 'muted'
35
36
  },
37
+ "data-step": order,
38
+ "data-active": active || undefined,
36
39
  children: [(0, _jsxRuntime.jsx)(_md.MdCheckCircle, {
37
40
  sx: {
38
41
  mr: 2
@@ -45,5 +48,6 @@ exports.WizardStepHorizontal = WizardStepHorizontal;
45
48
  WizardStepHorizontal.propTypes = {
46
49
  title: _propTypes["default"].node,
47
50
  subTitle: _propTypes["default"].node,
48
- active: _propTypes["default"].bool
51
+ active: _propTypes["default"].bool,
52
+ order: _propTypes["default"].number.isRequired
49
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip-design-system",
3
- "version": "0.9.5",
3
+ "version": "0.10.1",
4
4
  "main": "build/system/index.js",
5
5
  "scripts": {
6
6
  "build-storybook": "build-storybook",
@@ -19,6 +19,7 @@
19
19
  "@radix-ui/react-radio-group": "^0.1.0",
20
20
  "@radix-ui/react-tooltip": "^0.1.0",
21
21
  "babel-loader": "^8.2.2",
22
+ "classnames": "^2.3.1",
22
23
  "framer-motion": "^3.9.1",
23
24
  "react-icons": "^4.2.0",
24
25
  "react-select": "^4.3.1",
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import PropTypes from 'prop-types';
7
7
  import { Image } from 'theme-ui';
8
+ import classNames from 'classnames';
8
9
 
9
10
  /**
10
11
  * Internal dependencies
@@ -16,6 +17,7 @@ const Avatar = ( {
16
17
  name = null,
17
18
  size = 32,
18
19
  src = null,
20
+ className = null,
19
21
  ...props
20
22
  } ) => (
21
23
  <Box
@@ -34,6 +36,7 @@ const Avatar = ( {
34
36
  padding: '1px',
35
37
  textAlign: 'center',
36
38
  } }
39
+ className={ classNames( 'vip-avatar-component', className ) }
37
40
  { ...props }
38
41
  >
39
42
  { src ? (
@@ -68,6 +71,7 @@ Avatar.propTypes = {
68
71
  size: PropTypes.number,
69
72
  src: PropTypes.string,
70
73
  name: PropTypes.string,
74
+ className: PropTypes.any,
71
75
  };
72
76
 
73
77
  export { Avatar };
@@ -3,6 +3,7 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import classNames from 'classnames';
6
7
  import PropTypes from 'prop-types';
7
8
 
8
9
  /**
@@ -10,7 +11,7 @@ import PropTypes from 'prop-types';
10
11
  */
11
12
  import { Text } from '../';
12
13
 
13
- const Badge = ( { variant = 'blue', sx, ...props } ) => (
14
+ const Badge = ( { variant = 'blue', sx, className = null, ...props } ) => (
14
15
  <Text
15
16
  as="span"
16
17
  sx={ {
@@ -26,6 +27,7 @@ const Badge = ( { variant = 'blue', sx, ...props } ) => (
26
27
  fontWeight: 'heading',
27
28
  ...sx,
28
29
  } }
30
+ className={ classNames( 'vip-badge-component', className ) }
29
31
  { ...props }
30
32
  />
31
33
  );
@@ -33,6 +35,7 @@ const Badge = ( { variant = 'blue', sx, ...props } ) => (
33
35
  Badge.propTypes = {
34
36
  variant: PropTypes.string,
35
37
  sx: PropTypes.object,
38
+ className: PropTypes.any,
36
39
  };
37
40
 
38
41
  export { Badge };
@@ -3,6 +3,7 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import classNames from 'classnames';
6
7
  import PropTypes from 'prop-types';
7
8
 
8
9
  /**
@@ -17,9 +18,10 @@ const BlankState = ( {
17
18
  image,
18
19
  imageAlt = 'Image representing the blank state',
19
20
  title,
21
+ className = null,
20
22
  } ) => {
21
23
  return (
22
- <Box sx={{ textAlign: 'center', padding: 5 }}>
24
+ <Box sx={{ textAlign: 'center', padding: 5 }} className={ classNames( 'vip-blank-state-component', className ) }>
23
25
  {icon ? icon : <img src={image} sx={{ mb: 3 }} alt={imageAlt} />}
24
26
  <Heading variant="h4">{title}</Heading>
25
27
  <Text>{body}</Text>
@@ -35,6 +37,7 @@ BlankState.propTypes = {
35
37
  image: PropTypes.oneOfType( [ PropTypes.object, PropTypes.string ] ),
36
38
  imageAlt: PropTypes.string,
37
39
  title: PropTypes.node,
40
+ className: PropTypes.any,
38
41
  };
39
42
 
40
43
  export { BlankState };
@@ -3,11 +3,16 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import PropTypes from 'prop-types';
7
+ import classNames from 'classnames';
6
8
  import { forwardRef } from 'react';
7
9
  import { Box as ThemeBox } from 'theme-ui';
8
10
 
9
- const Box = forwardRef( ( props, ref ) => <ThemeBox ref={ref} {...props} /> );
11
+ const Box = forwardRef( ( props, ref ) => <ThemeBox ref={ref} className={ classNames( 'vip-box-component', props.className ) } {...props} /> );
10
12
 
11
13
  Box.displayName = 'Box';
14
+ Box.propTypes = {
15
+ className: PropTypes.any,
16
+ };
12
17
 
13
18
  export { Box };
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { Button as ThemeButton } from 'theme-ui';
7
7
  import PropTypes from 'prop-types';
8
+ import classNames from 'classnames';
8
9
 
9
10
  const Button = ( { sx, ...props } ) => (
10
11
  <ThemeButton
@@ -22,12 +23,14 @@ const Button = ( { sx, ...props } ) => (
22
23
  },
23
24
  ...sx,
24
25
  }}
26
+ className={ classNames( 'vip-button-component', props.className ) }
25
27
  {...props}
26
28
  />
27
29
  );
28
30
 
29
31
  Button.propTypes = {
30
32
  sx: PropTypes.object,
33
+ className: PropTypes.any,
31
34
  };
32
35
 
33
36
  export { Button };
@@ -10,8 +10,9 @@ import PropTypes from 'prop-types';
10
10
  * Internal dependencies
11
11
  */
12
12
  import { Box } from '..';
13
+ import classNames from 'classnames';
13
14
 
14
- const Card = React.forwardRef( ( { variant = 'primary', sx = {}, ...props }, ref ) => {
15
+ const Card = React.forwardRef( ( { variant = 'primary', sx = {}, className, ...props }, ref ) => {
15
16
  return (
16
17
  <Box
17
18
  ref={ref}
@@ -21,6 +22,7 @@ const Card = React.forwardRef( ( { variant = 'primary', sx = {}, ...props }, ref
21
22
  overflow: 'hidden',
22
23
  ...sx,
23
24
  }}
25
+ className={ classNames( 'vip-card-component', className ) }
24
26
  {...props}
25
27
  />
26
28
  );
@@ -29,6 +31,7 @@ const Card = React.forwardRef( ( { variant = 'primary', sx = {}, ...props }, ref
29
31
  Card.propTypes = {
30
32
  variant: PropTypes.string,
31
33
  sx: PropTypes.object,
34
+ className: PropTypes.any,
32
35
  };
33
36
 
34
37
  Card.displayName = 'Card';
@@ -3,11 +3,12 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import classNames from 'classnames';
6
7
  import PropTypes from 'prop-types';
7
8
  import { useRef, useState } from 'react';
8
9
  import { MdContentCopy } from 'react-icons/md';
9
10
 
10
- const Code = ( { prompt = false, showCopy = false, onCopy = null, ...props } ) => {
11
+ const Code = ( { prompt = false, showCopy = false, onCopy = null, className, ...props } ) => {
11
12
  const ref = useRef();
12
13
 
13
14
  const codeDom = (
@@ -29,6 +30,7 @@ const Code = ( { prompt = false, showCopy = false, onCopy = null, ...props } ) =
29
30
  userSelect: 'none',
30
31
  },
31
32
  } }
33
+ className={ classNames( 'vip-code-component', className ) }
32
34
  { ...props }
33
35
  />
34
36
  );
@@ -88,6 +90,7 @@ Code.propTypes = {
88
90
  prompt: PropTypes.bool,
89
91
  showCopy: PropTypes.bool,
90
92
  onCopy: PropTypes.func,
93
+ className: PropTypes.any,
91
94
  };
92
95
 
93
96
  export { Code };
@@ -3,6 +3,7 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import classNames from 'classnames';
6
7
  import PropTypes from 'prop-types';
7
8
  import React from 'react';
8
9
 
@@ -11,8 +12,8 @@ import React from 'react';
11
12
  */
12
13
  import { Dialog, Box, Heading, Text, Flex, Button } from '../';
13
14
 
14
- const ConfirmationDialogContent = ( { title, body, onClose, label = 'Confirm', onConfirm } ) => (
15
- <Box p={ 4 }>
15
+ const ConfirmationDialogContent = ( { title, body, onClose, label = 'Confirm', onConfirm, className = null } ) => (
16
+ <Box p={ 4 } className={ classNames( 'vip-confirmation-dialog-component', className ) }>
16
17
  <Heading variant="h3" sx={ { mb: 2 } }>
17
18
  { title }
18
19
  </Heading>
@@ -40,6 +41,7 @@ ConfirmationDialogContent.propTypes = {
40
41
  label: PropTypes.string,
41
42
  onClose: PropTypes.func,
42
43
  onConfirm: PropTypes.func,
44
+ className: PropTypes.any,
43
45
  };
44
46
 
45
47
  const ConfirmationDialog = ( { trigger, onConfirm, needsConfirm = true, ...props } ) => {
@@ -46,7 +46,7 @@ const Dialog = ( { trigger, position = 'left', startOpen = false, content, disab
46
46
  };
47
47
 
48
48
  return (
49
- <div onClick={ e => e.stopPropagation() } sx={ { position: 'relative' } } ref={ dialogRef }>
49
+ <div onClick={ e => e.stopPropagation() } sx={ { position: 'relative' } } ref={ dialogRef } className="vip-dialog-component">
50
50
  <DialogTrigger
51
51
  tabIndex="0"
52
52
  sx={ { display: 'inline' } }
@@ -36,7 +36,7 @@ const Select = ( { isMulti = false, isInline, isAsync, options, label, isSearch,
36
36
  break;
37
37
  }
38
38
 
39
- return <div ref={selectRef}><Component isMulti={isMulti} label={label} options={options} {...portalProps} {...props} /></div>;
39
+ return <div ref={selectRef} className="vip-select-component"><Component isMulti={isMulti} label={label} options={options} {...portalProps} {...props} /></div>;
40
40
  };
41
41
 
42
42
  Select.propTypes = {
@@ -3,10 +3,11 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import classNames from 'classnames';
6
7
  import PropTypes from 'prop-types';
7
8
 
8
- const Toggle = ( { name = 'toggle', ...props } ) => (
9
- <CheckBoxWrapper>
9
+ const Toggle = ( { name = 'toggle', className = null, ...props } ) => (
10
+ <CheckBoxWrapper className={ classNames( 'vip-checkbox-component', className ) }>
10
11
  <CheckBox name={name} id={name} type="checkbox" {...props} />
11
12
  <CheckBoxLabel htmlFor={name} />
12
13
  </CheckBoxWrapper>
@@ -14,6 +15,7 @@ const Toggle = ( { name = 'toggle', ...props } ) => (
14
15
 
15
16
  Toggle.propTypes = {
16
17
  name: PropTypes.string,
18
+ className: PropTypes.any,
17
19
  };
18
20
 
19
21
  export { Toggle };
@@ -5,8 +5,9 @@
5
5
  */
6
6
  import { Heading as ThemeHeading } from 'theme-ui';
7
7
  import PropTypes from 'prop-types';
8
+ import classNames from 'classnames';
8
9
 
9
- const Heading = ( { variant = 'h3', sx, ...props } ) => (
10
+ const Heading = ( { variant = 'h3', sx, className = null, ...props } ) => (
10
11
  <ThemeHeading
11
12
  as={variant}
12
13
  sx={{
@@ -15,6 +16,7 @@ const Heading = ( { variant = 'h3', sx, ...props } ) => (
15
16
  variant: `text.${ variant }`,
16
17
  ...sx,
17
18
  }}
19
+ className={ classNames( 'vip-heading-component', className ) }
18
20
  {...props}
19
21
  />
20
22
  );
@@ -22,6 +24,7 @@ const Heading = ( { variant = 'h3', sx, ...props } ) => (
22
24
  Heading.propTypes = {
23
25
  variant: PropTypes.string,
24
26
  sx: PropTypes.object,
27
+ className: PropTypes.any,
25
28
  };
26
29
 
27
30
  export { Heading };
@@ -3,6 +3,7 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import classNames from 'classnames';
6
7
  import PropTypes from 'prop-types';
7
8
  import { MdError, MdWarning, MdCheckCircle, MdInfo } from 'react-icons/md';
8
9
 
@@ -36,7 +37,7 @@ NoticeIcon.propTypes = {
36
37
  variant: PropTypes.string,
37
38
  };
38
39
 
39
- const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}, ...props } ) => {
40
+ const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}, className = null, ...props } ) => {
40
41
  let color = 'yellow';
41
42
 
42
43
  switch ( variant ) {
@@ -66,6 +67,7 @@ const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}
66
67
  },
67
68
  ...sx,
68
69
  } }
70
+ className={ classNames( 'vip-notice-component', className ) }
69
71
  { ...props }
70
72
  >
71
73
  <Flex sx={ {
@@ -93,6 +95,7 @@ Notice.propTypes = {
93
95
  sx: PropTypes.object,
94
96
  title: PropTypes.node,
95
97
  variant: PropTypes.string,
98
+ className: PropTypes.any,
96
99
  };
97
100
 
98
101
  export { Notice };
@@ -13,6 +13,7 @@ import { Box, Button, Card, Flex, Heading, Text } from '../';
13
13
 
14
14
  const Notification = ( { title, body, status = 'success', onClose } ) => (
15
15
  <Card
16
+ className="vip-notification-component"
16
17
  sx={{
17
18
  boxShadow: 'medium',
18
19
  width: 320,