@automattic/vip-design-system 0.10.2 → 0.11.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 (134) hide show
  1. package/.eslines.json +8 -8
  2. package/.eslintrc.json +9 -4
  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/main.js +1 -1
  7. package/.storybook/preview.js +4 -8
  8. package/README.md +1 -0
  9. package/babel.config.js +1 -1
  10. package/build/system/Avatar/Avatar.js +2 -1
  11. package/build/system/BlankState/BlankState.stories.js +3 -3
  12. package/build/system/BlankState/BlankState.test.js +2 -2
  13. package/build/system/Card/Card.test.js +0 -2
  14. package/build/system/Code/Code.js +7 -2
  15. package/build/system/Code/Code.test.js +22 -57
  16. package/build/system/Form/Select.stories.js +3 -4
  17. package/build/system/Form/Select.test.js +2 -2
  18. package/build/system/Notification/Notification.js +24 -15
  19. package/build/system/Notification/Notification.stories.js +14 -4
  20. package/build/system/OptionRow/OptionRow.js +23 -17
  21. package/build/system/OptionRow/OptionRow.stories.js +5 -5
  22. package/build/system/OptionRow/OptionRow.test.js +4 -4
  23. package/build/system/ResourceList/ResourceList.js +34 -25
  24. package/build/system/ResourceList/ResourceList.stories.js +2 -0
  25. package/build/system/ScreenReaderText/ScreenReader.test.js +37 -0
  26. package/build/system/ScreenReaderText/ScreenReaderText.js +49 -0
  27. package/build/system/ScreenReaderText/index.js +7 -0
  28. package/build/system/Table/Table.js +15 -15
  29. package/build/system/Table/Table.stories.js +46 -3
  30. package/build/system/Table/TableCell.js +57 -0
  31. package/build/system/Table/TableRow.js +12 -57
  32. package/build/system/Table/index.js +5 -1
  33. package/build/system/Time/index.js +1 -1
  34. package/build/system/Wizard/Wizard.stories.js +1 -1
  35. package/build/system/index.js +1 -0
  36. package/package.json +8 -4
  37. package/src/system/Avatar/Avatar.js +1 -0
  38. package/src/system/Avatar/index.js +0 -1
  39. package/src/system/Badge/index.js +0 -1
  40. package/src/system/BlankState/BlankState.js +8 -5
  41. package/src/system/BlankState/BlankState.stories.jsx +5 -4
  42. package/src/system/BlankState/BlankState.test.js +21 -21
  43. package/src/system/BlankState/index.js +0 -1
  44. package/src/system/Box/Box.js +7 -1
  45. package/src/system/Box/index.js +0 -1
  46. package/src/system/Button/Button.js +3 -3
  47. package/src/system/Button/Button.stories.jsx +2 -2
  48. package/src/system/Button/index.js +0 -1
  49. package/src/system/Card/Card.js +4 -4
  50. package/src/system/Card/Card.test.js +1 -2
  51. package/src/system/Card/index.js +0 -1
  52. package/src/system/Code/Code.js +6 -2
  53. package/src/system/Code/Code.stories.jsx +10 -5
  54. package/src/system/Code/Code.test.js +3 -16
  55. package/src/system/ConfirmationDialog/ConfirmationDialog.js +8 -1
  56. package/src/system/Dialog/Dialog.js +17 -8
  57. package/src/system/Dialog/Dialog.stories.jsx +9 -13
  58. package/src/system/Dialog/DialogButton.js +18 -14
  59. package/src/system/Dialog/DialogDivider.js +1 -1
  60. package/src/system/Dialog/DialogMenu.js +1 -5
  61. package/src/system/Dialog/DialogMenuItem.js +4 -8
  62. package/src/system/Dialog/DialogTrigger.js +1 -1
  63. package/src/system/Dialog/index.js +0 -1
  64. package/src/system/Flex/Flex.js +1 -1
  65. package/src/system/Flex/index.js +0 -1
  66. package/src/system/Form/AsyncSearchSelect.js +3 -7
  67. package/src/system/Form/Checkbox.js +32 -28
  68. package/src/system/Form/InlineSelect.js +21 -17
  69. package/src/system/Form/Input.js +43 -45
  70. package/src/system/Form/Label.js +2 -2
  71. package/src/system/Form/RadioBoxGroup.js +34 -32
  72. package/src/system/Form/RadioBoxGroup.stories.jsx +8 -1
  73. package/src/system/Form/SearchSelect.js +7 -7
  74. package/src/system/Form/Select.js +21 -2
  75. package/src/system/Form/Select.stories.jsx +31 -34
  76. package/src/system/Form/Select.test.js +3 -8
  77. package/src/system/Form/Textarea.js +38 -40
  78. package/src/system/Form/Toggle.js +9 -11
  79. package/src/system/Form/ToggleGroup.js +29 -31
  80. package/src/system/Form/ToggleGroup.stories.jsx +8 -1
  81. package/src/system/Form/ToggleRow.js +6 -1
  82. package/src/system/Form/Validation.js +6 -1
  83. package/src/system/Form/index.js +13 -1
  84. package/src/system/Grid/Grid.js +1 -1
  85. package/src/system/Grid/index.js +0 -1
  86. package/src/system/Heading/Heading.js +4 -4
  87. package/src/system/Heading/index.js +0 -1
  88. package/src/system/Link/index.js +0 -1
  89. package/src/system/Notice/Notice.js +27 -13
  90. package/src/system/Notice/Notice.stories.jsx +6 -8
  91. package/src/system/Notice/index.js +0 -1
  92. package/src/system/Notification/Notification.js +25 -20
  93. package/src/system/Notification/Notification.stories.jsx +4 -4
  94. package/src/system/Notification/index.js +0 -1
  95. package/src/system/OptionRow/OptionRow.js +46 -44
  96. package/src/system/OptionRow/OptionRow.stories.jsx +10 -8
  97. package/src/system/OptionRow/OptionRow.test.js +12 -11
  98. package/src/system/OptionRow/index.js +0 -1
  99. package/src/system/Progress/Progress.js +3 -1
  100. package/src/system/Progress/Progress.stories.jsx +4 -4
  101. package/src/system/Progress/index.js +0 -1
  102. package/src/system/ResourceList/ResourceItem.js +15 -15
  103. package/src/system/ResourceList/ResourceList.js +28 -16
  104. package/src/system/ResourceList/ResourceList.stories.jsx +77 -71
  105. package/src/system/ScreenReaderText/ScreenReader.test.js +22 -0
  106. package/src/system/ScreenReaderText/ScreenReaderText.js +40 -0
  107. package/src/system/ScreenReaderText/index.js +7 -0
  108. package/src/system/Spinner/Spinner.js +4 -4
  109. package/src/system/Spinner/index.js +0 -1
  110. package/src/system/Table/Table.js +10 -9
  111. package/src/system/Table/Table.stories.jsx +39 -9
  112. package/src/system/Table/TableCell.js +48 -0
  113. package/src/system/Table/TableRow.js +10 -47
  114. package/src/system/Table/index.js +2 -2
  115. package/src/system/Tabs/Tabs.js +3 -3
  116. package/src/system/Tabs/index.js +0 -1
  117. package/src/system/Text/Text.js +3 -3
  118. package/src/system/Text/Text.stories.jsx +4 -6
  119. package/src/system/Text/index.js +0 -1
  120. package/src/system/Time/Time.stories.jsx +2 -6
  121. package/src/system/Time/index.js +5 -5
  122. package/src/system/Timeline/Timeline.js +6 -12
  123. package/src/system/Timeline/Timeline.stories.jsx +3 -12
  124. package/src/system/Timeline/index.js +0 -1
  125. package/src/system/Tooltip/Tooltip.js +4 -8
  126. package/src/system/Wizard/Wizard.js +23 -21
  127. package/src/system/Wizard/Wizard.stories.jsx +7 -12
  128. package/src/system/Wizard/WizardStep.js +8 -8
  129. package/src/system/Wizard/WizardStepHorizontal.js +4 -4
  130. package/src/system/Wizard/index.js +0 -1
  131. package/src/system/index.js +2 -1
  132. package/src/system/theme/index.js +3 -4
  133. package/tokens/valet-color.json +1919 -0
  134. package/build/system/UsageChart/UsageChart.stories.js +0 -20
@@ -19,37 +19,35 @@ const ToggleGroup = ( { onChange, groupLabel, value, options, ...props } ) => (
19
19
  } }
20
20
  { ...props }
21
21
  >
22
- {
23
- options.map( ( option, index ) => (
24
- <RadioGroupPrimitive.Item
25
- key={ option.value }
26
- value={ option.value }
27
- id={ `o${ index }` }
28
- sx={ {
29
- fontSize: 1,
30
- color: 'muted',
31
- background: 'none',
32
- border: 'none',
33
- cursor: 'pointer',
34
- borderRadius: 1,
35
- py: 1,
36
- px: 2,
37
- flex: '1 1 auto',
38
- textAlign: 'center',
39
- '&:hover': {
40
- color: 'heading',
41
- },
42
- '&[data-state=checked]': {
43
- backgroundColor: 'card',
44
- boxShadow: 'low',
45
- color: 'heading',
46
- },
47
- } }
48
- >
49
- { option.label }
50
- </RadioGroupPrimitive.Item>
51
- ) )
52
- }
22
+ { options.map( ( option, index ) => (
23
+ <RadioGroupPrimitive.Item
24
+ key={ option.value }
25
+ value={ option.value }
26
+ id={ `o${ index }` }
27
+ sx={ {
28
+ fontSize: 1,
29
+ color: 'muted',
30
+ background: 'none',
31
+ border: 'none',
32
+ cursor: 'pointer',
33
+ borderRadius: 1,
34
+ py: 1,
35
+ px: 2,
36
+ flex: '1 1 auto',
37
+ textAlign: 'center',
38
+ '&:hover': {
39
+ color: 'heading',
40
+ },
41
+ '&[data-state=checked]': {
42
+ backgroundColor: 'card',
43
+ boxShadow: 'low',
44
+ color: 'heading',
45
+ },
46
+ } }
47
+ >
48
+ { option.label }
49
+ </RadioGroupPrimitive.Item>
50
+ ) ) }
53
51
  </RadioGroupPrimitive.Root>
54
52
  );
55
53
 
@@ -30,5 +30,12 @@ const options = [
30
30
 
31
31
  export const Default = () => {
32
32
  const [ value, setValue ] = useState( 'one' );
33
- return <ToggleGroup value={ value } onChange={ newValue => setValue( newValue ) } groupLabel="group" options={ options } />;
33
+ return (
34
+ <ToggleGroup
35
+ value={ value }
36
+ onChange={ newValue => setValue( newValue ) }
37
+ groupLabel="group"
38
+ options={ options }
39
+ />
40
+ );
34
41
  };
@@ -36,7 +36,12 @@ const ToggleRow = ( { image, badge, title, subTitle, body, meta, sx, ...props }
36
36
  flex: '0 0 auto',
37
37
  } }
38
38
  >
39
- <img src={ image } width={ 32 } sx={ { display: 'block' } } alt="Icon representing a toggle" />
39
+ <img
40
+ src={ image }
41
+ width={ 32 }
42
+ sx={ { display: 'block' } }
43
+ alt="Icon representing a toggle"
44
+ />
40
45
  </Card>
41
46
  </Box>
42
47
  ) }
@@ -15,7 +15,12 @@ const Validation = ( { children, isValid, ...props } ) => {
15
15
  const Icon = isValid ? MdCheckCircle : MdErrorOutline;
16
16
 
17
17
  return (
18
- <Heading variant="h5" as="p" sx={ { color: isValid ? 'success' : 'error', display: 'flex', alignItems: 'center' } } { ...props }>
18
+ <Heading
19
+ variant="h5"
20
+ as="p"
21
+ sx={ { color: isValid ? 'success' : 'error', display: 'flex', alignItems: 'center' } }
22
+ { ...props }
23
+ >
19
24
  <Icon sx={ { mr: 1 } } />
20
25
  { children }
21
26
  </Heading>
@@ -13,4 +13,16 @@ import { RadioBoxGroup } from './RadioBoxGroup';
13
13
  import { Textarea } from './Textarea';
14
14
  import { Checkbox } from './Checkbox';
15
15
 
16
- export { Input, Label, Radio, RadioBoxGroup, ToggleGroup, Select, Textarea, Toggle, ToggleRow, Validation, Checkbox };
16
+ export {
17
+ Input,
18
+ Label,
19
+ Radio,
20
+ RadioBoxGroup,
21
+ ToggleGroup,
22
+ Select,
23
+ Textarea,
24
+ Toggle,
25
+ ToggleRow,
26
+ Validation,
27
+ Checkbox,
28
+ };
@@ -8,7 +8,7 @@ import { Grid as ThemeGrid } from 'theme-ui';
8
8
  import { forwardRef } from 'react';
9
9
 
10
10
  const Grid = forwardRef( ( props, ref ) => {
11
- return <ThemeGrid {...props} ref={ref} />;
11
+ return <ThemeGrid { ...props } ref={ ref } />;
12
12
  } );
13
13
 
14
14
  Grid.displayName = 'Grid';
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -9,15 +9,15 @@ import classNames from 'classnames';
9
9
 
10
10
  const Heading = ( { variant = 'h3', sx, className = null, ...props } ) => (
11
11
  <ThemeHeading
12
- as={variant}
13
- sx={{
12
+ as={ variant }
13
+ sx={ {
14
14
  color: 'heading',
15
15
  // pass variant prop to sx
16
16
  variant: `text.${ variant }`,
17
17
  ...sx,
18
- }}
18
+ } }
19
19
  className={ classNames( 'vip-heading-component', className ) }
20
- {...props}
20
+ { ...props }
21
21
  />
22
22
  );
23
23
 
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -8,8 +8,8 @@ import PropTypes from 'prop-types';
8
8
  import { MdError, MdWarning, MdCheckCircle, MdInfo } from 'react-icons/md';
9
9
 
10
10
  /**
11
- * Internal dependencies
12
- */
11
+ * Internal dependencies
12
+ */
13
13
  import { Box, Flex, Heading, Card } from '../';
14
14
 
15
15
  const NoticeIcon = ( { color, variant } ) => {
@@ -27,9 +27,7 @@ const NoticeIcon = ( { color, variant } ) => {
27
27
  break;
28
28
  }
29
29
 
30
- return (
31
- <Icon sx={ { marginRight: 2, color, flex: '0 0 auto' } }/>
32
- );
30
+ return <Icon sx={ { marginRight: 2, color, flex: '0 0 auto' } } />;
33
31
  };
34
32
 
35
33
  NoticeIcon.propTypes = {
@@ -37,7 +35,15 @@ NoticeIcon.propTypes = {
37
35
  variant: PropTypes.string,
38
36
  };
39
37
 
40
- const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}, className = null, ...props } ) => {
38
+ const Notice = ( {
39
+ variant = 'warning',
40
+ inline = false,
41
+ children,
42
+ title,
43
+ sx = {},
44
+ className = null,
45
+ ...props
46
+ } ) => {
41
47
  let color = 'yellow';
42
48
 
43
49
  switch ( variant ) {
@@ -70,17 +76,25 @@ const Notice = ( { variant = 'warning', inline = false, children, title, sx = {}
70
76
  className={ classNames( 'vip-notice-component', className ) }
71
77
  { ...props }
72
78
  >
73
- <Flex sx={ {
74
- alignItems: 'center',
75
- } }>
76
- <Flex sx={ {
79
+ <Flex
80
+ sx={ {
77
81
  alignItems: 'center',
78
- } }>
79
- <NoticeIcon color={`${ color }.100`} variant={ variant } />
82
+ } }
83
+ >
84
+ <Flex
85
+ sx={ {
86
+ alignItems: 'center',
87
+ } }
88
+ >
89
+ <NoticeIcon color={ `${ color }.100` } variant={ variant } />
80
90
  </Flex>
81
91
 
82
92
  <Box sx={ { ml: 23 } }>
83
- { title && <Heading variant="h4" as="p" sx={ { color: `${ color }.100`, mb: 0 } }>{ title }</Heading> }
93
+ { title && (
94
+ <Heading variant="h4" as="p" sx={ { color: `${ color }.100`, mb: 0 } }>
95
+ { title }
96
+ </Heading>
97
+ ) }
84
98
  { children }
85
99
  </Box>
86
100
  </Flex>
@@ -15,23 +15,21 @@ export default {
15
15
 
16
16
  export const Default = () => (
17
17
  <React.Fragment>
18
- <Notice variant="alert" sx={{ mb: 4 }}>
18
+ <Notice variant="alert" sx={ { mb: 4 } }>
19
19
  <Heading variant="h4">Your site is ready to launch!</Heading>
20
- <Text sx={{ mb: 0 }}>
20
+ <Text sx={ { mb: 0 } }>
21
21
  It looks like you&lsquo;re ready to share your application with the world.
22
22
  </Text>
23
23
  </Notice>
24
24
 
25
- <Notice variant="success" sx={{ mb: 4 }}>
25
+ <Notice variant="success" sx={ { mb: 4 } }>
26
26
  It looks like you&lsquo;re ready to share your <a href="#">application with the world.</a>
27
27
  </Notice>
28
28
 
29
- <Notice sx={{ mb: 4 }} title="This notice has only the title prop passed" />
29
+ <Notice sx={ { mb: 4 } } title="This notice has only the title prop passed" />
30
30
 
31
- <Notice variant="success" sx={{ mb: 4 }} title="You made it!">
32
- <Text sx={{ mb: 0 }}>
33
- This notice has a title and children
34
- </Text>
31
+ <Notice variant="success" sx={ { mb: 4 } } title="You made it!">
32
+ <Text sx={ { mb: 0 } }>This notice has a title and children</Text>
35
33
  </Notice>
36
34
  </React.Fragment>
37
35
  );
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -9,38 +9,43 @@ import PropTypes from 'prop-types';
9
9
  /**
10
10
  * Internal dependencies
11
11
  */
12
- import { Box, Button, Card, Flex, Heading, Text } from '../';
12
+ import { Box, Card, Flex, Text, Button } from '../';
13
+ import ScreenReaderText from '../ScreenReaderText/ScreenReaderText';
13
14
 
14
15
  const Notification = ( { title, body, status = 'success', onClose } ) => (
15
16
  <Card
17
+ role="alert"
16
18
  className="vip-notification-component"
17
- sx={{
19
+ sx={ {
18
20
  boxShadow: 'medium',
19
21
  width: 320,
20
22
  position: 'relative',
21
23
  variant: `notification.${ status }`,
22
- }}
24
+ } }
23
25
  >
24
- <Button
25
- onClick={onClose}
26
- variant="icon"
27
- sx={{ color: 'muted', position: 'absolute', top: 2, right: 2 }}
28
- >
29
- <MdClose />
30
- </Button>
31
- <Flex sx={{ alignItems: 'center' }}>
32
- {status === 'error' ? (
33
- <MdError sx={{ color: 'error', flex: '0 0 auto' }} />
26
+ <ScreenReaderText>Alert,</ScreenReaderText>
27
+ <Flex sx={ { alignItems: 'center' } }>
28
+ { status === 'error' ? (
29
+ <MdError sx={ { color: 'error', flex: '0 0 auto' } } aria-hidden="true" />
34
30
  ) : (
35
- <MdCheckCircle sx={{ color: 'success', flex: '0 0 auto' }} />
36
- )}
37
- <Box sx={{ flex: '1 1 auto', ml: 3 }}>
38
- <Heading variant="h4" sx={{ mb: 0 }}>
39
- {title}
40
- </Heading>
41
- {body && <Text sx={{ mb: 0, mt: 1 }}>{body}</Text>}
31
+ <MdCheckCircle sx={ { color: 'success', flex: '0 0 auto' } } aria-hidden="true" />
32
+ ) }
33
+ <Box sx={ { flex: '1 1 auto', ml: 3 } }>
34
+ <p sx={ { my: 0, color: 'heading', fontWeight: 'bold' } }>{ title }</p>
35
+ { body && <Text sx={ { mb: 0, mt: 1 } }>{ body }</Text> }
42
36
  </Box>
43
37
  </Flex>
38
+
39
+ { onClose && (
40
+ <Button
41
+ onClick={ onClose }
42
+ variant="icon"
43
+ sx={ { color: 'muted', position: 'absolute', top: 2, right: 2 } }
44
+ aria-hidden="true"
45
+ >
46
+ <MdClose />
47
+ </Button>
48
+ ) }
44
49
  </Card>
45
50
  );
46
51
 
@@ -9,8 +9,8 @@ export default {
9
9
  };
10
10
 
11
11
  export const Default = () => (
12
- <Notification
13
- title="My first notification"
14
- subTitle="Use when providing success or error feedback on global action"
15
- />
12
+ <Notification title="Awesome!" body="Your message has been sent successfully." />
13
+ );
14
+ export const Error = () => (
15
+ <Notification status="error" title="Snag!" body="Your message could not be sent." />
16
16
  );
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -13,6 +13,27 @@ import PropTypes from 'prop-types';
13
13
  import { Badge, Box, Grid, Heading, Text } from '..';
14
14
  import classNames from 'classnames';
15
15
 
16
+ const disabledStyles = {
17
+ border: '1px solid',
18
+ borderColor: 'border',
19
+ background: 'none',
20
+ boxShadow: 'none',
21
+ color: 'grey.70',
22
+ };
23
+
24
+ const gridInlineStyle = {
25
+ py: 2,
26
+ px: 2,
27
+ mx: -2,
28
+ };
29
+
30
+ const regularGridStyle = small => ( {
31
+ py: 3,
32
+ px: [ 3, 3, small ? 3 : 5 ],
33
+ borderBottom: '1px solid',
34
+ borderColor: 'border',
35
+ } );
36
+
16
37
  const OptionRow = ( {
17
38
  image,
18
39
  icon,
@@ -29,37 +50,18 @@ const OptionRow = ( {
29
50
  className = null,
30
51
  ...props
31
52
  } ) => {
32
- const mergedCard = disabled
33
- ? {
34
- border: '1px solid',
35
- borderColor: 'border',
36
- background: 'none',
37
- boxShadow: 'none',
38
- color: 'grey.70',
39
- }
40
- : {};
53
+ const mergedCard = disabled ? disabledStyles : {};
54
+ const inlineStyles = inline ? gridInlineStyle : regularGridStyle( small );
41
55
 
42
- const inlineStyles = inline
43
- ? {
44
- py: 2,
45
- px: 2,
46
- mx: -2,
47
- }
48
- : {
49
- py: 3,
50
- px: [ 3, 3, small ? 3 : 5 ],
51
- borderBottom: '1px solid',
52
- borderColor: 'border',
53
- };
54
56
  return (
55
57
  <Grid
56
- to={to}
57
- columns={[ 1, 1, 'auto 1fr auto' ]}
58
- gap={[ 3, 3, `${ small ? 3 : 4 }` ]}
58
+ to={ to }
59
+ columns={ [ 1, 1, 'auto 1fr auto' ] }
60
+ gap={ [ 3, 3, `${ small ? 3 : 4 }` ] }
59
61
  data-order={ order || undefined }
60
62
  className={ classNames( 'vip-option-row-component', className ) }
61
- {...props}
62
- sx={{
63
+ { ...props }
64
+ sx={ {
63
65
  alignItems: 'center',
64
66
  cursor: disabled ? 'auto' : 'pointer',
65
67
  textDecoration: 'none',
@@ -68,12 +70,12 @@ const OptionRow = ( {
68
70
  backgroundColor: 'hover',
69
71
  },
70
72
  ...inlineStyles,
71
- }}
73
+ } }
72
74
  >
73
75
  <Box>
74
- {image ? (
76
+ { image ? (
75
77
  <Box
76
- sx={{
78
+ sx={ {
77
79
  display: [ 'inline-block', 'inline-block', 'block' ],
78
80
  p: small ? 12 : 20,
79
81
  flex: '0 0 auto',
@@ -81,34 +83,34 @@ const OptionRow = ( {
81
83
  color: 'brand.10',
82
84
  borderRadius: 1,
83
85
  ...mergedCard,
84
- }}
86
+ } }
85
87
  >
86
- {React.isValidElement( image ) ? (
88
+ { React.isValidElement( image ) ? (
87
89
  image
88
90
  ) : (
89
91
  <img
90
- src={image}
91
- width={small ? 32 : 48}
92
- sx={{ display: 'block' }}
92
+ src={ image }
93
+ width={ small ? 32 : 48 }
94
+ sx={ { display: 'block' } }
93
95
  alt="Image representing the list item"
94
96
  />
95
- )}
97
+ ) }
96
98
  </Box>
97
99
  ) : (
98
100
  icon && icon
99
- )}
101
+ ) }
100
102
  </Box>
101
103
 
102
- <Box sx={{ flex: '1 1 auto' }}>
103
- <Heading variant="h4" sx={{ mb: subTitle || body ? 1 : 0 }}>
104
- {label}
105
- {badge && <Badge sx={{ marginLeft: 2 }}>{badge}</Badge>}
104
+ <Box sx={ { flex: '1 1 auto' } }>
105
+ <Heading variant="h4" sx={ { mb: subTitle || body ? 1 : 0 } }>
106
+ { label }
107
+ { badge && <Badge sx={ { marginLeft: 2 } }>{ badge }</Badge> }
106
108
  </Heading>
107
- {subTitle && <Text sx={{ mb: 1, color: 'muted' }}>{subTitle}</Text>}
108
- {body && <Text sx={{ mb: 0 }}>{body}</Text>}
109
+ { subTitle && <Text sx={ { mb: 1, color: 'muted' } }>{ subTitle }</Text> }
110
+ { body && <Text sx={ { mb: 0 } }>{ body }</Text> }
109
111
  </Box>
110
- { ( false !== meta && '' !== meta ) && (
111
- <Box data-testid="meta">{ meta ? meta : <MdArrowForward size={24} /> }</Box>
112
+ { false !== meta && '' !== meta && (
113
+ <Box data-testid="meta">{ meta ? meta : <MdArrowForward size={ 24 } /> }</Box>
112
114
  ) }
113
115
  </Grid>
114
116
  );
@@ -8,28 +8,30 @@ export default {
8
8
  component: OptionRow,
9
9
  };
10
10
 
11
- // eslint-disable-next-line max-len
12
- const image1 = "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='M71.4 15.3L54.2 4.2C54 4 53.7 4 53.4 4H26.4C26.1 4 25.8 4.1 25.6 4.2L8.29997 15.3C7.89997 15.6 7.59998 16 7.59998 16.5V32.1V63C7.59998 63.5 7.89997 64 8.29997 64.2L25.5 75.3C25.5 75.3 25.6 75.3 25.6 75.4C25.6 75.4 25.7 75.4 25.7 75.5C25.9 75.6 26 75.6 26.2 75.6H53.2C53.4 75.6 53.5 75.6 53.7 75.5C53.8 75.5 53.8 75.5 53.8 75.4C53.8 75.4 53.9 75.4 53.9 75.3L71.4 64.2C71.5 64.1 71.7 64 71.8 63.8C71.8 63.8 71.8 63.7 71.9 63.7C72 63.6 72.1 63.4 72.1 63.2V63.1C72.1 63 72.1 62.9 72.1 62.8V32.1V16.5C72.1 16 71.8 15.6 71.4 15.3ZM24.9 71.4L10.6 62.2V34.8L24.9 44V71.4ZM51.9 72.6H27.8V44.7H51.9V72.6ZM69.1 31.3L52.9 41.7H26.8L10.6 31.3V17.3L26.8 6.9H52.9L69.1 17.3V31.3Z' fill='%23BD9D70' /%3E%3C/svg%3E";
13
- // eslint-disable-next-line max-len
14
- const image2 = "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";
11
+ const image1 =
12
+ // eslint-disable-next-line max-len
13
+ "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='M71.4 15.3L54.2 4.2C54 4 53.7 4 53.4 4H26.4C26.1 4 25.8 4.1 25.6 4.2L8.29997 15.3C7.89997 15.6 7.59998 16 7.59998 16.5V32.1V63C7.59998 63.5 7.89997 64 8.29997 64.2L25.5 75.3C25.5 75.3 25.6 75.3 25.6 75.4C25.6 75.4 25.7 75.4 25.7 75.5C25.9 75.6 26 75.6 26.2 75.6H53.2C53.4 75.6 53.5 75.6 53.7 75.5C53.8 75.5 53.8 75.5 53.8 75.4C53.8 75.4 53.9 75.4 53.9 75.3L71.4 64.2C71.5 64.1 71.7 64 71.8 63.8C71.8 63.8 71.8 63.7 71.9 63.7C72 63.6 72.1 63.4 72.1 63.2V63.1C72.1 63 72.1 62.9 72.1 62.8V32.1V16.5C72.1 16 71.8 15.6 71.4 15.3ZM24.9 71.4L10.6 62.2V34.8L24.9 44V71.4ZM51.9 72.6H27.8V44.7H51.9V72.6ZM69.1 31.3L52.9 41.7H26.8L10.6 31.3V17.3L26.8 6.9H52.9L69.1 17.3V31.3Z' fill='%23BD9D70' /%3E%3C/svg%3E";
14
+ const image2 =
15
+ // eslint-disable-next-line max-len
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";
15
17
 
16
18
  export const Default = () => (
17
- <Box sx={{ mx: -5 }}>
19
+ <Box sx={ { mx: -5 } }>
18
20
  <OptionRow
19
- image={image1}
21
+ image={ image1 }
20
22
  label="Option Row"
21
23
  subTitle="Mostly used to link off to other pages."
22
24
  as="a"
23
25
  />
24
26
  <OptionRow
25
- image={image2}
27
+ image={ image2 }
26
28
  label="Option Row"
27
29
  subTitle="Mostly used to link off to other pages."
28
30
  as="a"
29
31
  order={ 2 }
30
32
  />
31
33
  <OptionRow
32
- image={image2}
34
+ image={ image2 }
33
35
  label="Option Row – Disabled"
34
36
  subTitle="Mostly used to link off to other pages."
35
37
  as={ Box }
@@ -5,18 +5,14 @@ import { render, screen } from '@testing-library/react';
5
5
  import { axe } from 'jest-axe';
6
6
 
7
7
  /**
8
- * Internal dependencies
9
- */
8
+ * Internal dependencies
9
+ */
10
10
  import { OptionRow } from './OptionRow';
11
11
 
12
12
  describe( '<OptionRow />', () => {
13
13
  it( 'renders the OptionRow', async () => {
14
14
  const { container } = render(
15
- <OptionRow
16
- label="Option Row"
17
- subTitle="Mostly used to link off to other pages."
18
- as="a"
19
- />
15
+ <OptionRow label="Option Row" subTitle="Mostly used to link off to other pages." as="a" />
20
16
  );
21
17
 
22
18
  expect( screen.getByText( 'Mostly used to link off to other pages.' ) ).toBeInTheDocument();
@@ -26,12 +22,13 @@ describe( '<OptionRow />', () => {
26
22
  } );
27
23
 
28
24
  it( 'renders a disabled OptionRow', async () => {
29
- // eslint-disable-next-line max-len
30
- const image1 = "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='M71.4 15.3L54.2 4.2C54 4 53.7 4 53.4 4H26.4C26.1 4 25.8 4.1 25.6 4.2L8.29997 15.3C7.89997 15.6 7.59998 16 7.59998 16.5V32.1V63C7.59998 63.5 7.89997 64 8.29997 64.2L25.5 75.3C25.5 75.3 25.6 75.3 25.6 75.4C25.6 75.4 25.7 75.4 25.7 75.5C25.9 75.6 26 75.6 26.2 75.6H53.2C53.4 75.6 53.5 75.6 53.7 75.5C53.8 75.5 53.8 75.5 53.8 75.4C53.8 75.4 53.9 75.4 53.9 75.3L71.4 64.2C71.5 64.1 71.7 64 71.8 63.8C71.8 63.8 71.8 63.7 71.9 63.7C72 63.6 72.1 63.4 72.1 63.2V63.1C72.1 63 72.1 62.9 72.1 62.8V32.1V16.5C72.1 16 71.8 15.6 71.4 15.3ZM24.9 71.4L10.6 62.2V34.8L24.9 44V71.4ZM51.9 72.6H27.8V44.7H51.9V72.6ZM69.1 31.3L52.9 41.7H26.8L10.6 31.3V17.3L26.8 6.9H52.9L69.1 17.3V31.3Z' fill='%23BD9D70' /%3E%3C/svg%3E";
25
+ const image1 =
26
+ // eslint-disable-next-line max-len
27
+ "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='M71.4 15.3L54.2 4.2C54 4 53.7 4 53.4 4H26.4C26.1 4 25.8 4.1 25.6 4.2L8.29997 15.3C7.89997 15.6 7.59998 16 7.59998 16.5V32.1V63C7.59998 63.5 7.89997 64 8.29997 64.2L25.5 75.3C25.5 75.3 25.6 75.3 25.6 75.4C25.6 75.4 25.7 75.4 25.7 75.5C25.9 75.6 26 75.6 26.2 75.6H53.2C53.4 75.6 53.5 75.6 53.7 75.5C53.8 75.5 53.8 75.5 53.8 75.4C53.8 75.4 53.9 75.4 53.9 75.3L71.4 64.2C71.5 64.1 71.7 64 71.8 63.8C71.8 63.8 71.8 63.7 71.9 63.7C72 63.6 72.1 63.4 72.1 63.2V63.1C72.1 63 72.1 62.9 72.1 62.8V32.1V16.5C72.1 16 71.8 15.6 71.4 15.3ZM24.9 71.4L10.6 62.2V34.8L24.9 44V71.4ZM51.9 72.6H27.8V44.7H51.9V72.6ZM69.1 31.3L52.9 41.7H26.8L10.6 31.3V17.3L26.8 6.9H52.9L69.1 17.3V31.3Z' fill='%23BD9D70' /%3E%3C/svg%3E";
31
28
 
32
29
  const { container } = render(
33
30
  <OptionRow
34
- image={image1}
31
+ image={ image1 }
35
32
  label="Option Row"
36
33
  subTitle="Mostly used to link off to other pages."
37
34
  as="a"
@@ -40,7 +37,11 @@ describe( '<OptionRow />', () => {
40
37
  />
41
38
  );
42
39
 
43
- expect( screen.getByAltText( 'Image representing the list item' ).closest( 'div' ) ).toHaveStyle( { background: 'none' } );
40
+ expect(
41
+ screen.getByAltText( 'Image representing the list item' ).closest( 'div' )
42
+ ).toHaveStyle( {
43
+ background: 'none',
44
+ } );
44
45
  expect( screen.queryByTestId( 'meta' ) ).not.toBeInTheDocument();
45
46
 
46
47
  // Check for accessibility issues
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -30,7 +30,9 @@ const Progress = ( { steps, activeStep, sx, className, ...props } ) => (
30
30
  <Spinner size={ 24 } />
31
31
  <Heading variant="h4" sx={ { ml: 2, mb: 0 } }>
32
32
  { `${ activeStep + 1 } of ${ steps.length }` }:{ ' ' }
33
- <Text as="span" sx={ { color: 'muted' } }>{ steps[ activeStep ] }</Text>
33
+ <Text as="span" sx={ { color: 'muted' } }>
34
+ { steps[ activeStep ] }
35
+ </Text>
34
36
  </Heading>
35
37
  </Flex>
36
38
  ) }
@@ -10,9 +10,9 @@ export default {
10
10
 
11
11
  export const Default = () => (
12
12
  <Progress
13
- max={1}
14
- value={1 / 2}
15
- steps={[ 'Downloading Data', 'Importing Data...', 'Finalizing' ]}
16
- activeStep={1}
13
+ max={ 1 }
14
+ value={ 1 / 2 }
15
+ steps={ [ 'Downloading Data', 'Importing Data...', 'Finalizing' ] }
16
+ activeStep={ 1 }
17
17
  />
18
18
  );
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */