@automattic/vip-design-system 0.8.1 → 0.9.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 (90) hide show
  1. package/.eslines.json +10 -0
  2. package/.eslintignore +7 -0
  3. package/.eslintrc.json +23 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +22 -0
  5. package/.github/workflows/codeql-analysis.yml +71 -0
  6. package/.github/workflows/nodejs.yaml +29 -0
  7. package/.prettierrc +9 -0
  8. package/.storybook/preview.js +5 -0
  9. package/README.md +38 -1
  10. package/babel.config.js +10 -10
  11. package/build/system/Avatar/Avatar.js +1 -1
  12. package/build/system/Avatar/Avatar.test.js +54 -0
  13. package/build/system/Card/Card.js +8 -5
  14. package/build/system/Dialog/DialogButton.js +0 -2
  15. package/build/system/Dialog/DialogContent.js +1 -1
  16. package/build/system/Form/InlineSelect.js +2 -2
  17. package/build/system/Form/Input.js +8 -5
  18. package/build/system/Form/RadioBoxGroup.js +0 -2
  19. package/build/system/Form/SearchSelect.js +1 -1
  20. package/build/system/Form/Select.js +3 -3
  21. package/build/system/Form/Textarea.js +9 -6
  22. package/build/system/Form/ToggleGroup.js +0 -4
  23. package/build/system/Notice/Notice.js +50 -29
  24. package/build/system/ResourceList/ResourceItem.js +89 -0
  25. package/build/system/ResourceList/ResourceList.js +121 -0
  26. package/build/system/ResourceList/index.js +11 -0
  27. package/build/system/Time/index.js +91 -0
  28. package/build/system/Tooltip/Tooltip.js +4 -3
  29. package/build/system/index.js +7 -2
  30. package/package.json +47 -7
  31. package/src/system/Avatar/Avatar.js +1 -1
  32. package/src/system/Avatar/Avatar.stories.js +0 -5
  33. package/src/system/Avatar/Avatar.test.js +31 -0
  34. package/src/system/Badge/Badge.js +1 -1
  35. package/src/system/Badge/Badge.stories.js +0 -5
  36. package/src/system/BlankState/BlankState.js +2 -2
  37. package/src/system/BlankState/BlankState.stories.js +0 -5
  38. package/src/system/Box/Box.stories.js +0 -5
  39. package/src/system/Button/Button.js +1 -1
  40. package/src/system/Card/Card.js +6 -4
  41. package/src/system/Card/Card.stories.js +0 -5
  42. package/src/system/Code/Code.stories.js +4 -1
  43. package/src/system/ConfirmationDialog/ConfirmationDialog.stories.js +0 -5
  44. package/src/system/Dialog/Dialog.stories.js +0 -5
  45. package/src/system/Dialog/DialogButton.js +0 -1
  46. package/src/system/Dialog/DialogContent.js +14 -1
  47. package/src/system/Flex/Flex.stories.js +0 -5
  48. package/src/system/Form/InlineSelect.js +6 -6
  49. package/src/system/Form/Input.js +5 -3
  50. package/src/system/Form/Input.stories.js +0 -5
  51. package/src/system/Form/RadioBoxGroup.js +1 -2
  52. package/src/system/Form/RadioBoxGroup.stories.js +4 -5
  53. package/src/system/Form/SearchSelect.js +4 -4
  54. package/src/system/Form/Select.js +18 -18
  55. package/src/system/Form/Select.stories.js +1 -1
  56. package/src/system/Form/Textarea.js +6 -4
  57. package/src/system/Form/ToggleGroup.js +34 -37
  58. package/src/system/Form/ToggleGroup.stories.js +30 -32
  59. package/src/system/Form/ToggleRow.js +1 -1
  60. package/src/system/Grid/Grid.stories.js +0 -5
  61. package/src/system/Heading/Heading.stories.js +0 -5
  62. package/src/system/Link/Link.stories.js +0 -5
  63. package/src/system/Notice/Notice.js +30 -11
  64. package/src/system/Notification/Notification.js +2 -2
  65. package/src/system/Notification/Notification.stories.js +0 -5
  66. package/src/system/OptionRow/OptionRow.js +23 -23
  67. package/src/system/OptionRow/OptionRow.stories.js +0 -5
  68. package/src/system/Progress/Progress.stories.js +0 -5
  69. package/src/system/ResourceList/ResourceItem.js +66 -0
  70. package/src/system/ResourceList/ResourceList.js +96 -0
  71. package/src/system/ResourceList/ResourceList.stories.js +300 -0
  72. package/src/system/ResourceList/index.js +7 -0
  73. package/src/system/Spinner/Spinner.stories.js +0 -5
  74. package/src/system/Table/Table.stories.js +0 -5
  75. package/src/system/Table/TableRow.js +1 -1
  76. package/src/system/Tabs/Tabs.stories.js +0 -5
  77. package/src/system/Text/Text.stories.js +0 -5
  78. package/src/system/{Timeline/Timeline.stories.js → Time/Time.stories.js} +5 -5
  79. package/src/system/Time/index.js +62 -0
  80. package/src/system/Tooltip/Tooltip.js +5 -4
  81. package/src/system/Tooltip/Tooltip.stories.js +0 -5
  82. package/src/system/Wizard/Wizard.js +7 -7
  83. package/src/system/Wizard/WizardStep.js +5 -5
  84. package/src/system/Wizard/WizardStepHorizontal.js +1 -1
  85. package/src/system/index.js +27 -4
  86. package/src/system/theme/colors.js +1 -1
  87. package/src/system/theme/index.js +247 -247
  88. package/test/setupAfterEnv.js +13 -0
  89. package/test/setupTests.js +4 -0
  90. package/src/system/Timeline/index.js +0 -40
@@ -29,10 +29,10 @@ const selectStyles = {
29
29
  paddingBottom: vipTheme.space[ 1 ],
30
30
  paddingLeft: vipTheme.space[ 2 ],
31
31
  } ),
32
- menu: () => ( { boxShadow: 'none', borderTop: `1px solid` } ),
32
+ menu: () => ( { boxShadow: 'none', borderTop: '1px solid' } ),
33
33
  };
34
34
 
35
- const InlineSelect = ( { label, value, options, noneLabel = 'All', position = "left", ...props } ) => {
35
+ const InlineSelect = ( { label, value, options, noneLabel = 'All', position = 'left', ...props } ) => {
36
36
  let valueLabel = noneLabel;
37
37
 
38
38
  if ( Array.isArray( value ) && value.length ) {
@@ -74,14 +74,14 @@ const InlineSelect = ( { label, value, options, noneLabel = 'All', position = "l
74
74
  bg: 'grey.10',
75
75
  '&:hover': {
76
76
  bg: 'grey.10',
77
- }
77
+ },
78
78
  },
79
79
  '.select__option--is-focused': {
80
80
  bg: 'grey.10',
81
81
  },
82
82
  '.select__menu': {
83
83
  borderColor: 'border',
84
- }
84
+ },
85
85
  } }
86
86
  {...props}
87
87
  />
@@ -100,10 +100,10 @@ const InlineSelect = ( { label, value, options, noneLabel = 'All', position = "l
100
100
  InlineSelect.propTypes = {
101
101
  label: PropTypes.string,
102
102
  // https://react-select.com/props
103
- value: PropTypes.oneOfType([
103
+ value: PropTypes.oneOfType( [
104
104
  PropTypes.array,
105
105
  PropTypes.object,
106
- ]),
106
+ ] ),
107
107
  options: PropTypes.array,
108
108
  position: PropTypes.string,
109
109
  noneLabel: PropTypes.string,
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
11
11
  */
12
12
  import { Validation, Label } from '../';
13
13
 
14
- const Input = React.forwardRef( ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
14
+ const InputComponent = ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
15
15
  <React.Fragment>
16
16
  { label &&
17
17
  <Label htmlFor={ forLabel }>
@@ -55,9 +55,9 @@ const Input = React.forwardRef( ( { variant, label, forLabel, hasError, required
55
55
  <Validation>{ errorMessage }</Validation>
56
56
  }
57
57
  </React.Fragment>
58
- ) );
58
+ );
59
59
 
60
- Input.propTypes = {
60
+ InputComponent.propTypes = {
61
61
  variant: PropTypes.string,
62
62
  label: PropTypes.string,
63
63
  hasError: PropTypes.bool,
@@ -66,4 +66,6 @@ Input.propTypes = {
66
66
  errorMessage: PropTypes.string,
67
67
  };
68
68
 
69
+ const Input = React.forwardRef( InputComponent );
70
+
69
71
  export { Input };
@@ -1,10 +1,5 @@
1
1
  /** @jsxImportSource theme-ui */
2
2
 
3
- /**
4
- * External dependencies
5
- */
6
- import React from 'react';
7
-
8
3
  /**
9
4
  * Internal dependencies
10
5
  */
@@ -3,7 +3,6 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
- import React from 'react';
7
6
  import PropTypes from 'prop-types';
8
7
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
9
8
  import { MdCheckCircle } from 'react-icons/md';
@@ -21,7 +20,7 @@ const RadioBoxGroup = ( { onChange, groupLabel, value, options, ...props } ) =>
21
20
  sx={ {
22
21
  display: 'flex',
23
22
  gap: 2,
24
-
23
+
25
24
  } }
26
25
  { ...props }
27
26
  >
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import React, { useState } from 'react';
4
+ import { useState } from 'react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -32,7 +32,6 @@ const options = [
32
32
  ];
33
33
 
34
34
  export const Default = () => {
35
- const [ value, setValue ] = useState('one');
36
- return <RadioBoxGroup value={ value } onChange={ newValue => setValue( newValue ) } groupLabel="group" options={ options } />
37
-
38
- }
35
+ const [ value, setValue ] = useState( 'one' );
36
+ return <RadioBoxGroup value={ value } onChange={ newValue => setValue( newValue ) } groupLabel="group" options={ options } />;
37
+ };
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
- import { theme as vipTheme, Flex, Text } from '..';
13
+ import { Flex, Text } from '..';
14
14
 
15
15
  export const Option = ( { label, isSelected, ...props } ) => (
16
16
  <components.Option {...props}>
@@ -50,7 +50,7 @@ const SearchSelect = props => (
50
50
  '.select__control': {
51
51
  background: 'none',
52
52
  color: 'heading',
53
- border: `1px solid`,
53
+ border: '1px solid',
54
54
  borderColor: 'border',
55
55
  margin: 0,
56
56
  padding: 0,
@@ -73,11 +73,11 @@ const SearchSelect = props => (
73
73
  bg: 'hover',
74
74
  '&:hover': {
75
75
  bg: 'hover',
76
- }
76
+ },
77
77
  },
78
78
  '.select__option--is-focused': {
79
79
  bg: 'hover',
80
- }
80
+ },
81
81
  } }
82
82
  />
83
83
  );
@@ -3,27 +3,27 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
- import PropTypes from 'prop-types';
6
+ import PropTypes from 'prop-types';
7
7
 
8
- /**
8
+ /**
9
9
  * Internal dependencies
10
10
  */
11
- import { SearchSelect } from './SearchSelect';
12
- import { InlineSelect } from './InlineSelect';
11
+ import { SearchSelect } from './SearchSelect';
12
+ import { InlineSelect } from './InlineSelect';
13
13
 
14
- const Select = ( { isMulti = false, isInline, options, label, isSearch, ...props } ) => {
15
- if ( isInline ) {
16
- return <InlineSelect isMulti={ isMulti } label={ label } options={ options } { ...props } />;
17
- }
18
- return <SearchSelect isMulti={ isMulti } label={ label } options={ options } { ...props } />;
19
- };
14
+ const Select = ( { isMulti = false, isInline, options, label, isSearch, ...props } ) => {
15
+ if ( isInline ) {
16
+ return <InlineSelect isMulti={ isMulti } label={ label } options={ options } { ...props } />;
17
+ }
18
+ return <SearchSelect isMulti={ isMulti } label={ label } options={ options } { ...props } />;
19
+ };
20
20
 
21
- Select.propTypes = {
22
- isMulti: PropTypes.bool,
23
- isInline: PropTypes.bool,
24
- isSearch: PropTypes.bool,
25
- options: PropTypes.array,
26
- label: PropTypes.string,
27
- };
21
+ Select.propTypes = {
22
+ isInline: PropTypes.bool,
23
+ isMulti: PropTypes.bool,
24
+ isSearch: PropTypes.bool,
25
+ label: PropTypes.string,
26
+ options: PropTypes.array,
27
+ };
28
28
 
29
- export { Select };
29
+ export { Select };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import React, { useState } from 'react';
4
+ import { useState } from 'react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -11,10 +11,10 @@ import PropTypes from 'prop-types';
11
11
  */
12
12
  import { Validation, Label } from '../';
13
13
 
14
- const Textarea = React.forwardRef( ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
14
+ const TextareaComponent = ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
15
15
  <React.Fragment>
16
16
  { label &&
17
- <Label for={ forLabel }>
17
+ <Label htmlFor={ forLabel }>
18
18
  { label }
19
19
  { required &&
20
20
  '*'
@@ -50,9 +50,9 @@ const Textarea = React.forwardRef( ( { variant, label, forLabel, hasError, requi
50
50
  <Validation>{ errorMessage }</Validation>
51
51
  }
52
52
  </React.Fragment>
53
- ) );
53
+ );
54
54
 
55
- Textarea.propTypes = {
55
+ TextareaComponent.propTypes = {
56
56
  variant: PropTypes.string,
57
57
  label: PropTypes.string,
58
58
  hasError: PropTypes.bool,
@@ -61,4 +61,6 @@ Textarea.propTypes = {
61
61
  errorMessage: PropTypes.string,
62
62
  };
63
63
 
64
+ const Textarea = React.forwardRef( TextareaComponent );
65
+
64
66
  export { Textarea };
@@ -3,31 +3,29 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
- import React from 'react';
7
- import PropTypes from 'prop-types';
8
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
9
- import { MdCheckCircle } from "react-icons/md";
10
-
11
- const ToggleGroup = ( { onChange, groupLabel, value, options, ...props } ) => (
12
- <RadioGroupPrimitive.Root
13
- onValueChange={ onChange }
14
- value={ value }
15
- aria-label={ groupLabel }
16
- sx={ {
6
+ import PropTypes from 'prop-types';
7
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
8
+
9
+ const ToggleGroup = ( { onChange, groupLabel, value, options, ...props } ) => (
10
+ <RadioGroupPrimitive.Root
11
+ onValueChange={ onChange }
12
+ value={ value }
13
+ aria-label={ groupLabel }
14
+ sx={ {
17
15
  bg: 'backgroundSecondary',
18
16
  p: 1,
19
17
  display: 'flex',
20
18
  alignItems: 'center',
21
19
  } }
22
- { ...props }
23
- >
24
- {
25
- options.map( ( option, index ) => (
26
- <RadioGroupPrimitive.Item
27
- key={ option.value }
28
- value={ option.value }
29
- id={ `o${ index }` }
30
- sx={ {
20
+ { ...props }
21
+ >
22
+ {
23
+ options.map( ( option, index ) => (
24
+ <RadioGroupPrimitive.Item
25
+ key={ option.value }
26
+ value={ option.value }
27
+ id={ `o${ index }` }
28
+ sx={ {
31
29
  fontSize: 1,
32
30
  color: 'muted',
33
31
  background: 'none',
@@ -47,20 +45,19 @@
47
45
  color: 'heading',
48
46
  },
49
47
  } }
50
- >
51
- { option.label }
52
- </RadioGroupPrimitive.Item>
53
- ) )
54
- }
55
- </RadioGroupPrimitive.Root>
56
- );
57
-
58
- ToggleGroup.propTypes = {
59
- onChange: PropTypes.func,
60
- options: PropTypes.array,
61
- value: PropTypes.string,
62
- groupLabel: PropTypes.string,
63
- };
64
-
65
- export { ToggleGroup };
66
-
48
+ >
49
+ { option.label }
50
+ </RadioGroupPrimitive.Item>
51
+ ) )
52
+ }
53
+ </RadioGroupPrimitive.Root>
54
+ );
55
+
56
+ ToggleGroup.propTypes = {
57
+ onChange: PropTypes.func,
58
+ options: PropTypes.array,
59
+ value: PropTypes.string,
60
+ groupLabel: PropTypes.string,
61
+ };
62
+
63
+ export { ToggleGroup };
@@ -1,36 +1,34 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import React, { useState } from 'react';
4
+ import { useState } from 'react';
5
5
 
6
- /**
7
- * Internal dependencies
8
- */
9
- import { ToggleGroup } from '..';
10
-
11
- export default {
12
- title: 'ToggleGroup',
13
- component: ToggleGroup,
14
- };
15
-
16
- const options = [
17
- {
18
- label: 'One',
19
- value: 'one',
20
- },
21
- {
22
- label: 'Two',
23
- value: 'two',
24
- },
25
- {
26
- label: 'Three',
27
- value: 'three',
28
- },
29
- ];
30
-
31
- export const Default = () => {
32
- const [ value, setValue ] = useState('one');
33
- return <ToggleGroup value={ value } onChange={ newValue => setValue( newValue ) } groupLabel="group" options={ options } />
34
-
35
- }
36
-
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { ToggleGroup } from '..';
10
+
11
+ export default {
12
+ title: 'ToggleGroup',
13
+ component: ToggleGroup,
14
+ };
15
+
16
+ const options = [
17
+ {
18
+ label: 'One',
19
+ value: 'one',
20
+ },
21
+ {
22
+ label: 'Two',
23
+ value: 'two',
24
+ },
25
+ {
26
+ label: 'Three',
27
+ value: 'three',
28
+ },
29
+ ];
30
+
31
+ export const Default = () => {
32
+ const [ value, setValue ] = useState( 'one' );
33
+ return <ToggleGroup value={ value } onChange={ newValue => setValue( newValue ) } groupLabel="group" options={ options } />;
34
+ };
@@ -57,7 +57,7 @@ const ToggleRow = ( { image, badge, title, subTitle, body, meta, sx, ...props }
57
57
  );
58
58
 
59
59
  ToggleRow.propTypes = {
60
- image: PropTypes.oneOfType([ PropTypes.object, PropTypes.string ]),
60
+ image: PropTypes.oneOfType( [ PropTypes.object, PropTypes.string ] ),
61
61
  badge: PropTypes.string,
62
62
  title: PropTypes.node,
63
63
  subTitle: PropTypes.node,
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
@@ -11,28 +11,45 @@ import { MdError, MdWarning, MdCheckCircle, MdInfo } from 'react-icons/md';
11
11
  */
12
12
  import { Box, Flex, Heading, Card } from '../';
13
13
 
14
- const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}, ...props } ) => {
15
- let color = 'yellow';
14
+ const NoticeIcon = ( { color, variant } ) => {
16
15
  let Icon = MdWarning;
17
16
 
18
17
  switch ( variant ) {
19
18
  case 'info':
20
- color = 'blue';
21
19
  Icon = MdInfo;
22
20
  break;
23
21
  case 'alert':
24
- color = 'red';
25
22
  Icon = MdError;
26
23
  break;
27
24
  case 'success':
28
- color = 'green';
29
25
  Icon = MdCheckCircle;
30
26
  break;
31
27
  }
32
28
 
33
- const NoticeIcon = ({ color }) => (
29
+ return (
34
30
  <Icon sx={ { marginRight: 2, color, flex: '0 0 auto' } }/>
35
31
  );
32
+ };
33
+
34
+ NoticeIcon.propTypes = {
35
+ color: PropTypes.string,
36
+ variant: PropTypes.string,
37
+ };
38
+
39
+ const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}, ...props } ) => {
40
+ let color = 'yellow';
41
+
42
+ switch ( variant ) {
43
+ case 'info':
44
+ color = 'blue';
45
+ break;
46
+ case 'alert':
47
+ color = 'red';
48
+ break;
49
+ case 'success':
50
+ color = 'green';
51
+ break;
52
+ }
36
53
 
37
54
  return (
38
55
  <Card
@@ -41,7 +58,7 @@ const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}
41
58
  borderRadius: 2,
42
59
  bg: inline ? 'transparent' : `${ color }.10`,
43
60
  p: inline ? 0 : 3,
44
- color: `${color}.90`,
61
+ color: `${ color }.90`,
45
62
  a: {
46
63
  color: `${ color }.90`,
47
64
  textDecoration: 'underline',
@@ -57,7 +74,7 @@ const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}
57
74
  <Flex sx={ {
58
75
  alignItems: 'center',
59
76
  } }>
60
- <NoticeIcon color={`${ color }.100`} />
77
+ <NoticeIcon color={`${ color }.100`} variant={ variant } />
61
78
  </Flex>
62
79
 
63
80
  <Box sx={ { ml: 23 } }>
@@ -70,10 +87,12 @@ const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}
70
87
  };
71
88
 
72
89
  Notice.propTypes = {
73
- variant: PropTypes.string,
74
- title: PropTypes.node,
75
- inline: PropTypes.bool,
76
90
  children: PropTypes.node,
91
+ color: PropTypes.string,
92
+ inline: PropTypes.bool,
93
+ sx: PropTypes.object,
94
+ title: PropTypes.node,
95
+ variant: PropTypes.string,
77
96
  };
78
97
 
79
98
  export { Notice };
@@ -11,13 +11,13 @@ import PropTypes from 'prop-types';
11
11
  */
12
12
  import { Box, Button, Card, Flex, Heading, Text } from '../';
13
13
 
14
- const Notification = ({ title, body, status = 'success', onClose }) => (
14
+ const Notification = ( { title, body, status = 'success', onClose } ) => (
15
15
  <Card
16
16
  sx={{
17
17
  boxShadow: 'medium',
18
18
  width: 320,
19
19
  position: 'relative',
20
- variant: `notification.${status}`,
20
+ variant: `notification.${ status }`,
21
21
  }}
22
22
  >
23
23
  <Button
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
@@ -10,9 +10,9 @@ import PropTypes from 'prop-types';
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
- import { Badge, Box, Card, Grid, Heading, Text } from '..';
13
+ import { Badge, Box, Grid, Heading, Text } from '..';
14
14
 
15
- const OptionRow = ({
15
+ const OptionRow = ( {
16
16
  image,
17
17
  icon,
18
18
  badge,
@@ -25,34 +25,34 @@ const OptionRow = ({
25
25
  small = false,
26
26
  disabled = false,
27
27
  ...props
28
- }) => {
28
+ } ) => {
29
29
  const mergedCard = disabled
30
30
  ? {
31
- border: '1px solid',
32
- borderColor: 'border',
33
- background: 'none',
34
- boxShadow: 'none',
35
- color: 'grey.70'
36
- }
31
+ border: '1px solid',
32
+ borderColor: 'border',
33
+ background: 'none',
34
+ boxShadow: 'none',
35
+ color: 'grey.70',
36
+ }
37
37
  : {};
38
38
 
39
39
  const inlineStyles = inline
40
40
  ? {
41
- py: 2,
42
- px: 2,
43
- mx: -2,
44
- }
41
+ py: 2,
42
+ px: 2,
43
+ mx: -2,
44
+ }
45
45
  : {
46
- py: 3,
47
- px: [3, 3, small ? 3 : 5],
48
- borderBottom: '1px solid',
49
- borderColor: 'border',
50
- };
46
+ py: 3,
47
+ px: [ 3, 3, small ? 3 : 5 ],
48
+ borderBottom: '1px solid',
49
+ borderColor: 'border',
50
+ };
51
51
  return (
52
52
  <Grid
53
53
  to={to}
54
- columns={[1, 1, 'auto 1fr auto']}
55
- gap={[3, 3, `${small ? 3 : 4}`]}
54
+ columns={[ 1, 1, 'auto 1fr auto' ]}
55
+ gap={[ 3, 3, `${ small ? 3 : 4 }` ]}
56
56
  {...props}
57
57
  sx={{
58
58
  alignItems: 'center',
@@ -69,7 +69,7 @@ const OptionRow = ({
69
69
  {image ? (
70
70
  <Box
71
71
  sx={{
72
- display: ['inline-block', 'inline-block', 'block'],
72
+ display: [ 'inline-block', 'inline-block', 'block' ],
73
73
  p: small ? 12 : 20,
74
74
  flex: '0 0 auto',
75
75
  bg: 'brand.70',
@@ -78,7 +78,7 @@ const OptionRow = ({
78
78
  ...mergedCard,
79
79
  }}
80
80
  >
81
- {React.isValidElement(image) ? (
81
+ {React.isValidElement( image ) ? (
82
82
  image
83
83
  ) : (
84
84
  <img
@@ -108,7 +108,7 @@ const OptionRow = ({
108
108
  };
109
109
 
110
110
  OptionRow.propTypes = {
111
- image: PropTypes.oneOfType([ PropTypes.object, PropTypes.string ]),
111
+ image: PropTypes.oneOfType( [ PropTypes.object, PropTypes.string ] ),
112
112
  icon: PropTypes.node,
113
113
  badge: PropTypes.string,
114
114
  label: PropTypes.node,
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */