@automattic/vip-design-system 0.20.1 → 0.22.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 (47) hide show
  1. package/build/system/Avatar/Avatar.js +7 -3
  2. package/build/system/Badge/Badge.js +7 -3
  3. package/build/system/Box/Box.js +4 -3
  4. package/build/system/Code/Code.js +10 -4
  5. package/build/system/Flex/Flex.js +10 -5
  6. package/build/system/Form/Label.js +12 -4
  7. package/build/system/Form/Radio.js +7 -3
  8. package/build/system/Form/RadioBoxGroup.js +7 -3
  9. package/build/system/Form/Toggle.js +7 -3
  10. package/build/system/Form/ToggleGroup.js +7 -3
  11. package/build/system/Link/Link.js +7 -3
  12. package/build/system/Notice/Notice.js +2 -1
  13. package/build/system/Notification/Notification.js +6 -2
  14. package/build/system/OptionRow/OptionRow.js +5 -3
  15. package/build/system/ScreenReaderText/ScreenReaderText.js +16 -13
  16. package/build/system/Spinner/Spinner.js +7 -3
  17. package/build/system/Table/Table.js +22 -4
  18. package/build/system/Table/Table.stories.js +5 -1
  19. package/build/system/Tabs/Tabs.js +7 -3
  20. package/build/system/Text/Text.js +7 -3
  21. package/build/system/Wizard/Wizard.js +4 -2
  22. package/build/system/Wizard/WizardStep.js +6 -2
  23. package/build/system/Wizard/WizardStepHorizontal.js +6 -2
  24. package/package.json +1 -1
  25. package/src/system/Avatar/Avatar.js +54 -53
  26. package/src/system/Badge/Badge.js +24 -19
  27. package/src/system/Box/Box.js +2 -2
  28. package/src/system/Code/Code.js +81 -76
  29. package/src/system/Flex/Flex.js +6 -1
  30. package/src/system/Form/Label.js +10 -2
  31. package/src/system/Form/Radio.js +11 -3
  32. package/src/system/Form/RadioBoxGroup.js +52 -46
  33. package/src/system/Form/Toggle.js +50 -50
  34. package/src/system/Form/ToggleGroup.js +49 -43
  35. package/src/system/Link/Link.js +6 -2
  36. package/src/system/Notice/Notice.js +1 -1
  37. package/src/system/Notification/Notification.js +41 -34
  38. package/src/system/OptionRow/OptionRow.js +86 -78
  39. package/src/system/ScreenReaderText/ScreenReaderText.js +14 -17
  40. package/src/system/Spinner/Spinner.js +6 -2
  41. package/src/system/Table/Table.js +25 -10
  42. package/src/system/Table/Table.stories.jsx +4 -1
  43. package/src/system/Tabs/Tabs.js +6 -2
  44. package/src/system/Text/Text.js +6 -2
  45. package/src/system/Wizard/Wizard.js +49 -45
  46. package/src/system/Wizard/WizardStep.js +63 -57
  47. package/src/system/Wizard/WizardStepHorizontal.js +6 -2
@@ -3,6 +3,7 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import React from 'react';
6
7
  import PropTypes from 'prop-types';
7
8
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
8
9
  import { MdCheckCircle } from 'react-icons/md';
@@ -12,54 +13,59 @@ import { MdCheckCircle } from 'react-icons/md';
12
13
  */
13
14
  import { Heading, Text } from '../';
14
15
 
15
- const RadioBoxGroup = ( { onChange, groupLabel, value, options, ...props } ) => (
16
- <RadioGroupPrimitive.Root
17
- onValueChange={ onChange }
18
- value={ value }
19
- aria-label={ groupLabel }
20
- sx={ {
21
- display: 'flex',
22
- gap: 2,
23
- } }
24
- { ...props }
25
- >
26
- { options.map( ( option, index ) => (
27
- <RadioGroupPrimitive.Item
28
- key={ option.value }
29
- value={ option.value }
30
- id={ `o${ index }` }
31
- sx={ {
32
- p: 3,
33
- background: 'none',
34
- cursor: 'pointer',
35
- borderRadius: 2,
36
- textAlign: 'left',
37
- border: '1px solid',
38
- borderColor: 'border',
39
- position: 'relative',
40
- '&:hover': {
41
- borderColor: 'grey.10',
42
- },
43
- '&[data-state=checked]': {
44
- borderColor: 'primary',
45
- },
46
- } }
47
- >
48
- <RadioGroupPrimitive.Indicator>
49
- <MdCheckCircle
50
- size={ 16 }
51
- sx={ { position: 'absolute', top: 2, right: 2, color: 'primary' } }
52
- />
53
- </RadioGroupPrimitive.Indicator>
54
- <Heading variant="h4" as="label" htmlFor={ `o${ index }` } sx={ { mb: 0 } }>
55
- { option.label }
56
- </Heading>
57
- <Text sx={ { color: 'muted', mb: 0, fontSize: 1 } }>{ option.description }</Text>
58
- </RadioGroupPrimitive.Item>
59
- ) ) }
60
- </RadioGroupPrimitive.Root>
16
+ const RadioBoxGroup = React.forwardRef(
17
+ ( { onChange, groupLabel, value, options, ...props }, forwardRef ) => (
18
+ <RadioGroupPrimitive.Root
19
+ onValueChange={ onChange }
20
+ value={ value }
21
+ aria-label={ groupLabel }
22
+ sx={ {
23
+ display: 'flex',
24
+ gap: 2,
25
+ } }
26
+ ref={ forwardRef }
27
+ { ...props }
28
+ >
29
+ { options.map( ( option, index ) => (
30
+ <RadioGroupPrimitive.Item
31
+ key={ option.value }
32
+ value={ option.value }
33
+ id={ `o${ index }` }
34
+ sx={ {
35
+ p: 3,
36
+ background: 'none',
37
+ cursor: 'pointer',
38
+ borderRadius: 2,
39
+ textAlign: 'left',
40
+ border: '1px solid',
41
+ borderColor: 'border',
42
+ position: 'relative',
43
+ '&:hover': {
44
+ borderColor: 'grey.10',
45
+ },
46
+ '&[data-state=checked]': {
47
+ borderColor: 'primary',
48
+ },
49
+ } }
50
+ >
51
+ <RadioGroupPrimitive.Indicator>
52
+ <MdCheckCircle
53
+ size={ 16 }
54
+ sx={ { position: 'absolute', top: 2, right: 2, color: 'primary' } }
55
+ />
56
+ </RadioGroupPrimitive.Indicator>
57
+ <Heading variant="h4" as="label" htmlFor={ `o${ index }` } sx={ { mb: 0 } }>
58
+ { option.label }
59
+ </Heading>
60
+ <Text sx={ { color: 'muted', mb: 0, fontSize: 1 } }>{ option.description }</Text>
61
+ </RadioGroupPrimitive.Item>
62
+ ) ) }
63
+ </RadioGroupPrimitive.Root>
64
+ )
61
65
  );
62
66
 
67
+ RadioBoxGroup.displayName = 'RadioBoxGroup';
68
+
63
69
  RadioBoxGroup.propTypes = {
64
70
  onChange: PropTypes.func,
65
71
  options: PropTypes.array,
@@ -4,6 +4,7 @@
4
4
  /**
5
5
  * External dependencies
6
6
  */
7
+ import React from 'react';
7
8
  import classNames from 'classnames';
8
9
  import PropTypes from 'prop-types';
9
10
 
@@ -12,62 +13,61 @@ import * as Switch from '@radix-ui/react-switch';
12
13
  // Documentation for Radix Switch component
13
14
  // https://www.radix-ui.com/docs/primitives/components/switch
14
15
 
15
- export const Toggle = ( {
16
- name = 'toggle',
17
- onChange,
18
- className = null,
19
- variant = 'primary',
20
- ...rest
21
- } ) => (
22
- <Switch.Root
23
- className={ classNames( 'vip-toggle-component', className ) }
24
- sx={ {
25
- all: 'unset',
26
- cursor: 'pointer',
27
- position: 'relative',
28
- width: 40,
29
- height: 20,
30
- borderRadius: '32px',
31
- backgroundColor: 'muted',
32
- backgroundRepeat: 'no-repeat',
33
- backgroundPosition: 'right 2px top 2px',
34
- backgroundImage: `url(
16
+ export const Toggle = React.forwardRef(
17
+ ( { name = 'toggle', onChange, className = null, variant = 'primary', ...rest }, forwardRef ) => (
18
+ <Switch.Root
19
+ className={ classNames( 'vip-toggle-component', className ) }
20
+ sx={ {
21
+ all: 'unset',
22
+ cursor: 'pointer',
23
+ position: 'relative',
24
+ width: 40,
25
+ height: 20,
26
+ borderRadius: '32px',
27
+ backgroundColor: 'muted',
28
+ backgroundRepeat: 'no-repeat',
29
+ backgroundPosition: 'right 2px top 2px',
30
+ backgroundImage: `url(
35
31
  'data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.53846 3L3 4.53846L6.46156 8.00001L3.00003 11.4615L4.53848 13L8.00001 9.53847L11.4615 13L13 11.4615L9.53847 8.00001L13 4.53849L11.4615 3.00003L8.00001 6.46156L4.53846 3Z" fill="white"/></svg>')`,
36
- WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',
32
+ WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',
37
33
 
38
- '&:focus': theme => theme.outline,
39
- '&:focus-visible': theme => theme.outline,
40
- '&[disabled]': {
41
- opacity: 0.7,
42
- },
43
- '&[data-state="checked"]': {
44
- backgroundColor: variant,
45
- backgroundPosition: 'left 2px top 2px',
46
- backgroundImage: `url(
34
+ '&:focus': theme => theme.outline,
35
+ '&:focus-visible': theme => theme.outline,
36
+ '&[disabled]': {
37
+ opacity: 0.7,
38
+ },
39
+ '&[data-state="checked"]': {
40
+ backgroundColor: variant,
41
+ backgroundPosition: 'left 2px top 2px',
42
+ backgroundImage: `url(
47
43
  'data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.4999 4.9995L5.7254 12.4008L2.5 9.33023L3.83307 7.92994L5.7254 9.73144L12.1668 3.59921L13.4999 4.9995Z" fill="white"/></svg>')`,
48
- },
49
- } }
50
- name={ name }
51
- onCheckedChange={ onChange || undefined }
52
- { ...rest }
53
- >
54
- <Switch.Thumb
55
- sx={ {
56
- display: 'block',
57
- width: 16,
58
- height: 16,
59
- backgroundColor: 'white',
60
- borderRadius: '50%',
61
- boxShadow: 'rgb(0 0 0 / 5%) 0px 1px 5px, rgb(0 0 0 / 15%) 0px 1px 1px',
62
- transition: 'transform 100ms',
63
- transform: 'translateX(2px)',
64
- willChange: 'transform',
65
- '&[data-state="checked"]': { transform: 'translateX(22px)' },
44
+ },
66
45
  } }
67
- />
68
- </Switch.Root>
46
+ name={ name }
47
+ onCheckedChange={ onChange || undefined }
48
+ ref={ forwardRef }
49
+ { ...rest }
50
+ >
51
+ <Switch.Thumb
52
+ sx={ {
53
+ display: 'block',
54
+ width: 16,
55
+ height: 16,
56
+ backgroundColor: 'white',
57
+ borderRadius: '50%',
58
+ boxShadow: 'rgb(0 0 0 / 5%) 0px 1px 5px, rgb(0 0 0 / 15%) 0px 1px 1px',
59
+ transition: 'transform 100ms',
60
+ transform: 'translateX(2px)',
61
+ willChange: 'transform',
62
+ '&[data-state="checked"]': { transform: 'translateX(22px)' },
63
+ } }
64
+ />
65
+ </Switch.Root>
66
+ )
69
67
  );
70
68
 
69
+ Toggle.displayName = 'Toggle';
70
+
71
71
  Toggle.propTypes = {
72
72
  name: PropTypes.string,
73
73
  className: PropTypes.any,
@@ -3,54 +3,60 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import React from 'react';
6
7
  import PropTypes from 'prop-types';
7
8
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
8
9
 
9
- const ToggleGroup = ( { onChange, groupLabel, value, options, ...props } ) => (
10
- <RadioGroupPrimitive.Root
11
- onValueChange={ onChange }
12
- value={ value }
13
- aria-label={ groupLabel }
14
- sx={ {
15
- bg: 'backgroundSecondary',
16
- p: 1,
17
- display: 'flex',
18
- alignItems: 'center',
19
- } }
20
- { ...props }
21
- >
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
- ) ) }
51
- </RadioGroupPrimitive.Root>
10
+ const ToggleGroup = React.forwardRef(
11
+ ( { onChange, groupLabel, value, options, ...props }, forwardRef ) => (
12
+ <RadioGroupPrimitive.Root
13
+ onValueChange={ onChange }
14
+ value={ value }
15
+ aria-label={ groupLabel }
16
+ sx={ {
17
+ bg: 'backgroundSecondary',
18
+ p: 1,
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ } }
22
+ ref={ forwardRef }
23
+ { ...props }
24
+ >
25
+ { options.map( ( option, index ) => (
26
+ <RadioGroupPrimitive.Item
27
+ key={ option.value }
28
+ value={ option.value }
29
+ id={ `o${ index }` }
30
+ sx={ {
31
+ fontSize: 1,
32
+ color: 'muted',
33
+ background: 'none',
34
+ border: 'none',
35
+ cursor: 'pointer',
36
+ borderRadius: 1,
37
+ py: 1,
38
+ px: 2,
39
+ flex: '1 1 auto',
40
+ textAlign: 'center',
41
+ '&:hover': {
42
+ color: 'heading',
43
+ },
44
+ '&[data-state=checked]': {
45
+ backgroundColor: 'card',
46
+ boxShadow: 'low',
47
+ color: 'heading',
48
+ },
49
+ } }
50
+ >
51
+ { option.label }
52
+ </RadioGroupPrimitive.Item>
53
+ ) ) }
54
+ </RadioGroupPrimitive.Root>
55
+ )
52
56
  );
53
57
 
58
+ ToggleGroup.displayName = 'ToggleGroup';
59
+
54
60
  ToggleGroup.propTypes = {
55
61
  onChange: PropTypes.func,
56
62
  options: PropTypes.array,
@@ -3,10 +3,11 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import React from 'react';
6
7
  import { Link as ThemeLink } from 'theme-ui';
7
8
  import PropTypes from 'prop-types';
8
9
 
9
- const Link = ( { active = false, sx, ...props } ) => (
10
+ const Link = React.forwardRef( ( { active = false, sx, ...props }, forwardRef ) => (
10
11
  <ThemeLink
11
12
  { ...props }
12
13
  sx={ {
@@ -27,8 +28,11 @@ const Link = ( { active = false, sx, ...props } ) => (
27
28
  '&:focus-visible': theme => theme.outline,
28
29
  ...sx,
29
30
  } }
31
+ ref={ forwardRef }
30
32
  />
31
- );
33
+ ) );
34
+
35
+ Link.displayName = 'Link';
32
36
 
33
37
  Link.propTypes = {
34
38
  active: PropTypes.bool,
@@ -28,7 +28,7 @@ const NoticeIcon = ( { color, variant } ) => {
28
28
  break;
29
29
  }
30
30
 
31
- return <Icon sx={ { color, flex: '0 0 auto' } } size={ 21 } />;
31
+ return <Icon sx={ { color, flex: '0 0 auto' } } size={ 21 } aria-hidden="true" />;
32
32
  };
33
33
 
34
34
  NoticeIcon.propTypes = {
@@ -3,6 +3,7 @@
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
+ import React from 'react';
6
7
  import { MdCheckCircle, MdClose, MdError } from 'react-icons/md';
7
8
  import PropTypes from 'prop-types';
8
9
 
@@ -12,43 +13,49 @@ import PropTypes from 'prop-types';
12
13
  import { Box, Card, Flex, Text, Button } from '../';
13
14
  import ScreenReaderText from '../ScreenReaderText';
14
15
 
15
- const Notification = ( { title, body, status = 'success', onClose } ) => (
16
- <Card
17
- role="alert"
18
- className="vip-notification-component"
19
- sx={ {
20
- boxShadow: 'medium',
21
- width: 320,
22
- position: 'relative',
23
- variant: `notification.${ status }`,
24
- } }
25
- >
26
- <ScreenReaderText>Alert,</ScreenReaderText>
27
- <Flex sx={ { alignItems: 'center' } }>
28
- { status === 'error' ? (
29
- <MdError sx={ { color: 'error', flex: '0 0 auto' } } aria-hidden="true" />
30
- ) : (
31
- <MdCheckCircle sx={ { color: 'success', flex: '0 0 auto' } } aria-hidden="true" />
16
+ const Notification = React.forwardRef(
17
+ ( { title, body, status = 'success', onClose }, forwardRef ) => (
18
+ <Card
19
+ role="alert"
20
+ className="vip-notification-component"
21
+ sx={ {
22
+ boxShadow: 'medium',
23
+ width: 320,
24
+ position: 'relative',
25
+ variant: `notification.${ status }`,
26
+ } }
27
+ ref={ forwardRef }
28
+ >
29
+ <ScreenReaderText>Alert,</ScreenReaderText>
30
+
31
+ <Flex sx={ { alignItems: 'center' } }>
32
+ { status === 'error' ? (
33
+ <MdError sx={ { color: 'error', flex: '0 0 auto' } } aria-hidden="true" />
34
+ ) : (
35
+ <MdCheckCircle sx={ { color: 'success', flex: '0 0 auto' } } aria-hidden="true" />
36
+ ) }
37
+ <Box sx={ { flex: '1 1 auto', ml: 3 } }>
38
+ <p sx={ { my: 0, color: 'heading', fontWeight: 'bold' } }>{ title }</p>
39
+ { body && <Text sx={ { mb: 0, mt: 1 } }>{ body }</Text> }
40
+ </Box>
41
+ </Flex>
42
+
43
+ { onClose && (
44
+ <Button
45
+ onClick={ onClose }
46
+ variant="icon"
47
+ sx={ { color: 'muted', position: 'absolute', top: 2, right: 2 } }
48
+ aria-hidden="true"
49
+ >
50
+ <MdClose />
51
+ </Button>
32
52
  ) }
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> }
36
- </Box>
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
- ) }
49
- </Card>
53
+ </Card>
54
+ )
50
55
  );
51
56
 
57
+ Notification.displayName = 'Notification';
58
+
52
59
  Notification.propTypes = {
53
60
  title: PropTypes.node,
54
61
  body: PropTypes.node,
@@ -34,87 +34,95 @@ const regularGridStyle = small => ( {
34
34
  borderColor: 'borders.2',
35
35
  } );
36
36
 
37
- const OptionRow = ( {
38
- image,
39
- icon,
40
- badge,
41
- label,
42
- inline = false,
43
- subTitle,
44
- body,
45
- meta,
46
- to,
47
- small = false,
48
- disabled = false,
49
- order = null,
50
- className = null,
51
- ...props
52
- } ) => {
53
- const mergedCard = disabled ? disabledStyles : {};
54
- const inlineStyles = inline ? gridInlineStyle : regularGridStyle( small );
37
+ const OptionRow = React.forwardRef(
38
+ (
39
+ {
40
+ image,
41
+ icon,
42
+ badge,
43
+ label,
44
+ inline = false,
45
+ subTitle,
46
+ body,
47
+ meta,
48
+ to,
49
+ small = false,
50
+ disabled = false,
51
+ order = null,
52
+ className = null,
53
+ ...props
54
+ },
55
+ forwardRef
56
+ ) => {
57
+ const mergedCard = disabled ? disabledStyles : {};
58
+ const inlineStyles = inline ? gridInlineStyle : regularGridStyle( small );
55
59
 
56
- return (
57
- <Grid
58
- to={ to }
59
- columns={ [ 1, 1, 'auto 1fr auto' ] }
60
- gap={ [ 3, 3, `${ small ? 3 : 4 }` ] }
61
- data-order={ order || undefined }
62
- className={ classNames( 'vip-option-row-component', className ) }
63
- { ...props }
64
- sx={ {
65
- alignItems: 'center',
66
- cursor: disabled ? 'auto' : 'pointer',
67
- textDecoration: 'none',
68
- color: 'inherit',
69
- '&:hover': ! disabled && {
70
- backgroundColor: 'hover',
71
- },
72
- ...inlineStyles,
73
- } }
74
- >
75
- <Box>
76
- { image ? (
77
- <Box
78
- sx={ {
79
- display: [ 'inline-block', 'inline-block', 'block' ],
80
- p: small ? 12 : 20,
81
- flex: '0 0 auto',
82
- bg: 'brand.70',
83
- color: 'brand.10',
84
- borderRadius: 1,
85
- ...mergedCard,
86
- } }
87
- >
88
- { React.isValidElement( image ) ? (
89
- image
90
- ) : (
91
- <img
92
- src={ image }
93
- width={ small ? 32 : 48 }
94
- sx={ { display: 'block' } }
95
- alt="Image representing the list item"
96
- />
97
- ) }
98
- </Box>
99
- ) : (
100
- icon && icon
60
+ return (
61
+ <Grid
62
+ to={ to }
63
+ columns={ [ 1, 1, 'auto 1fr auto' ] }
64
+ gap={ [ 3, 3, `${ small ? 3 : 4 }` ] }
65
+ data-order={ order || undefined }
66
+ className={ classNames( 'vip-option-row-component', className ) }
67
+ ref={ forwardRef }
68
+ { ...props }
69
+ sx={ {
70
+ alignItems: 'center',
71
+ cursor: disabled ? 'auto' : 'pointer',
72
+ textDecoration: 'none',
73
+ color: 'inherit',
74
+ '&:hover': ! disabled && {
75
+ backgroundColor: 'hover',
76
+ },
77
+ ...inlineStyles,
78
+ } }
79
+ >
80
+ <Box>
81
+ { image ? (
82
+ <Box
83
+ sx={ {
84
+ display: [ 'inline-block', 'inline-block', 'block' ],
85
+ p: small ? 12 : 20,
86
+ flex: '0 0 auto',
87
+ bg: 'brand.70',
88
+ color: 'brand.10',
89
+ borderRadius: 1,
90
+ ...mergedCard,
91
+ } }
92
+ >
93
+ { React.isValidElement( image ) ? (
94
+ image
95
+ ) : (
96
+ <img
97
+ src={ image }
98
+ width={ small ? 32 : 48 }
99
+ sx={ { display: 'block' } }
100
+ alt="Image representing the list item"
101
+ />
102
+ ) }
103
+ </Box>
104
+ ) : (
105
+ icon && icon
106
+ ) }
107
+ </Box>
108
+
109
+ <Box sx={ { flex: '1 1 auto' } }>
110
+ <Heading variant="h4" sx={ { mb: subTitle || body ? 1 : 0 } }>
111
+ { label }
112
+ { badge && <Badge sx={ { marginLeft: 2 } }>{ badge }</Badge> }
113
+ </Heading>
114
+ { subTitle && <Text sx={ { mb: 1, color: 'muted' } }>{ subTitle }</Text> }
115
+ { body && <Text sx={ { mb: 0 } }>{ body }</Text> }
116
+ </Box>
117
+ { false !== meta && '' !== meta && (
118
+ <Box data-testid="meta">{ meta ? meta : <MdArrowForward size={ 24 } /> }</Box>
101
119
  ) }
102
- </Box>
120
+ </Grid>
121
+ );
122
+ }
123
+ );
103
124
 
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> }
108
- </Heading>
109
- { subTitle && <Text sx={ { mb: 1, color: 'muted' } }>{ subTitle }</Text> }
110
- { body && <Text sx={ { mb: 0 } }>{ body }</Text> }
111
- </Box>
112
- { false !== meta && '' !== meta && (
113
- <Box data-testid="meta">{ meta ? meta : <MdArrowForward size={ 24 } /> }</Box>
114
- ) }
115
- </Grid>
116
- );
117
- };
125
+ OptionRow.displayName = 'OptionRow';
118
126
 
119
127
  OptionRow.propTypes = {
120
128
  image: PropTypes.oneOfType( [ PropTypes.object, PropTypes.string ] ),