@automattic/vip-design-system 0.10.3 → 0.12.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 (141) 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 +2 -1
  7. package/.storybook/preview.js +5 -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/Form/Toggle.js +45 -72
  19. package/build/system/Form/Toggle.stories.js +63 -0
  20. package/build/system/Form/Toggle.test.js +55 -0
  21. package/build/system/Notification/Notification.js +24 -15
  22. package/build/system/Notification/Notification.stories.js +14 -4
  23. package/build/system/OptionRow/OptionRow.js +23 -17
  24. package/build/system/OptionRow/OptionRow.stories.js +5 -5
  25. package/build/system/OptionRow/OptionRow.test.js +4 -4
  26. package/build/system/ResourceList/ResourceList.js +34 -25
  27. package/build/system/ResourceList/ResourceList.stories.js +2 -0
  28. package/build/system/ScreenReaderText/ScreenReader.test.js +37 -0
  29. package/build/system/ScreenReaderText/ScreenReaderText.js +49 -0
  30. package/build/system/ScreenReaderText/index.js +7 -0
  31. package/build/system/Table/Table.stories.js +46 -3
  32. package/build/system/Table/TableCell.js +57 -0
  33. package/build/system/Table/TableRow.js +12 -57
  34. package/build/system/Table/index.js +5 -1
  35. package/build/system/Time/index.js +1 -1
  36. package/build/system/Wizard/Wizard.stories.js +1 -1
  37. package/build/system/index.js +1 -0
  38. package/package.json +10 -4
  39. package/src/system/Avatar/Avatar.js +1 -0
  40. package/src/system/Avatar/index.js +0 -1
  41. package/src/system/Badge/index.js +0 -1
  42. package/src/system/BlankState/BlankState.js +8 -5
  43. package/src/system/BlankState/BlankState.stories.jsx +5 -4
  44. package/src/system/BlankState/BlankState.test.js +21 -21
  45. package/src/system/BlankState/index.js +0 -1
  46. package/src/system/Box/Box.js +7 -1
  47. package/src/system/Box/index.js +0 -1
  48. package/src/system/Button/Button.js +3 -3
  49. package/src/system/Button/Button.stories.jsx +2 -2
  50. package/src/system/Button/index.js +0 -1
  51. package/src/system/Card/Card.js +4 -4
  52. package/src/system/Card/Card.test.js +1 -2
  53. package/src/system/Card/index.js +0 -1
  54. package/src/system/Code/Code.js +6 -2
  55. package/src/system/Code/Code.stories.jsx +10 -5
  56. package/src/system/Code/Code.test.js +3 -16
  57. package/src/system/ConfirmationDialog/ConfirmationDialog.js +8 -1
  58. package/src/system/Dialog/Dialog.js +17 -8
  59. package/src/system/Dialog/Dialog.stories.jsx +9 -13
  60. package/src/system/Dialog/DialogButton.js +18 -14
  61. package/src/system/Dialog/DialogDivider.js +1 -1
  62. package/src/system/Dialog/DialogMenu.js +1 -5
  63. package/src/system/Dialog/DialogMenuItem.js +4 -8
  64. package/src/system/Dialog/DialogTrigger.js +1 -1
  65. package/src/system/Dialog/index.js +0 -1
  66. package/src/system/Flex/Flex.js +1 -1
  67. package/src/system/Flex/index.js +0 -1
  68. package/src/system/Form/AsyncSearchSelect.js +3 -7
  69. package/src/system/Form/Checkbox.js +32 -28
  70. package/src/system/Form/InlineSelect.js +21 -17
  71. package/src/system/Form/Input.js +43 -45
  72. package/src/system/Form/Label.js +2 -2
  73. package/src/system/Form/RadioBoxGroup.js +34 -32
  74. package/src/system/Form/RadioBoxGroup.stories.jsx +8 -1
  75. package/src/system/Form/SearchSelect.js +7 -7
  76. package/src/system/Form/Select.js +21 -2
  77. package/src/system/Form/Select.stories.jsx +31 -34
  78. package/src/system/Form/Select.test.js +3 -8
  79. package/src/system/Form/Textarea.js +38 -40
  80. package/src/system/Form/Toggle.js +37 -65
  81. package/src/system/Form/Toggle.stories.jsx +42 -0
  82. package/src/system/Form/Toggle.test.js +23 -0
  83. package/src/system/Form/ToggleGroup.js +29 -31
  84. package/src/system/Form/ToggleGroup.stories.jsx +8 -1
  85. package/src/system/Form/ToggleRow.js +6 -1
  86. package/src/system/Form/Validation.js +6 -1
  87. package/src/system/Form/index.js +13 -1
  88. package/src/system/Grid/Grid.js +1 -1
  89. package/src/system/Grid/index.js +0 -1
  90. package/src/system/Heading/Heading.js +4 -4
  91. package/src/system/Heading/index.js +0 -1
  92. package/src/system/Link/index.js +0 -1
  93. package/src/system/Notice/Notice.js +27 -13
  94. package/src/system/Notice/Notice.stories.jsx +6 -8
  95. package/src/system/Notice/index.js +0 -1
  96. package/src/system/Notification/Notification.js +25 -20
  97. package/src/system/Notification/Notification.stories.jsx +4 -4
  98. package/src/system/Notification/index.js +0 -1
  99. package/src/system/OptionRow/OptionRow.js +46 -44
  100. package/src/system/OptionRow/OptionRow.stories.jsx +10 -8
  101. package/src/system/OptionRow/OptionRow.test.js +12 -11
  102. package/src/system/OptionRow/index.js +0 -1
  103. package/src/system/Progress/Progress.js +3 -1
  104. package/src/system/Progress/Progress.stories.jsx +4 -4
  105. package/src/system/Progress/index.js +0 -1
  106. package/src/system/ResourceList/ResourceItem.js +15 -15
  107. package/src/system/ResourceList/ResourceList.js +28 -16
  108. package/src/system/ResourceList/ResourceList.stories.jsx +77 -71
  109. package/src/system/ScreenReaderText/ScreenReader.test.js +22 -0
  110. package/src/system/ScreenReaderText/ScreenReaderText.js +40 -0
  111. package/src/system/ScreenReaderText/index.js +7 -0
  112. package/src/system/Spinner/Spinner.js +4 -4
  113. package/src/system/Spinner/index.js +0 -1
  114. package/src/system/Table/Table.js +5 -5
  115. package/src/system/Table/Table.stories.jsx +39 -9
  116. package/src/system/Table/TableCell.js +48 -0
  117. package/src/system/Table/TableRow.js +10 -47
  118. package/src/system/Table/index.js +2 -2
  119. package/src/system/Tabs/Tabs.js +3 -3
  120. package/src/system/Tabs/index.js +0 -1
  121. package/src/system/Text/Text.js +3 -3
  122. package/src/system/Text/Text.stories.jsx +4 -6
  123. package/src/system/Text/index.js +0 -1
  124. package/src/system/Time/Time.stories.jsx +2 -6
  125. package/src/system/Time/index.js +5 -5
  126. package/src/system/Timeline/Timeline.js +6 -12
  127. package/src/system/Timeline/Timeline.stories.jsx +3 -12
  128. package/src/system/Timeline/index.js +0 -1
  129. package/src/system/Tooltip/Tooltip.js +4 -8
  130. package/src/system/Wizard/Wizard.js +23 -21
  131. package/src/system/Wizard/Wizard.stories.jsx +7 -12
  132. package/src/system/Wizard/WizardStep.js +8 -8
  133. package/src/system/Wizard/WizardStepHorizontal.js +4 -4
  134. package/src/system/Wizard/index.js +0 -1
  135. package/src/system/index.js +2 -1
  136. package/src/system/theme/index.js +3 -4
  137. package/tokens/valet-color.json +1919 -0
  138. package/build/system/Form/MultiSelect.js +0 -38
  139. package/build/system/UsageChart/UsageChart.js +0 -60
  140. package/build/system/UsageChart/UsageChart.stories.js +0 -20
  141. package/build/system/UsageChart/index.js +0 -7
@@ -7,26 +7,30 @@ import PropTypes from 'prop-types';
7
7
  import { MdExpandMore } from 'react-icons/md';
8
8
 
9
9
  /**
10
- * Internal dependencies
11
- */
10
+ * Internal dependencies
11
+ */
12
12
  import { Button, Text } from '../';
13
13
 
14
14
  const DialogButton = ( { label, variant = 'secondary', value, children, ...props } ) => (
15
- <Button variant={ variant } sx={ {
16
- textAlign: 'left',
17
- display: 'inline-flex',
18
- py: 2,
19
- pl: 3,
20
- pr: 2,
21
- alignItems: 'center' } } { ...props }
15
+ <Button
16
+ variant={ variant }
17
+ sx={ {
18
+ textAlign: 'left',
19
+ display: 'inline-flex',
20
+ py: 2,
21
+ pl: 3,
22
+ pr: 2,
23
+ alignItems: 'center',
24
+ } }
25
+ { ...props }
22
26
  >
23
27
  { children }
24
- { label &&
25
- <Text as="span" sx={{ mb: 0, color: 'muted', mr: 2, flex: '0 0 auto' }}>
28
+ { label && (
29
+ <Text as="span" sx={ { mb: 0, color: 'muted', mr: 2, flex: '0 0 auto' } }>
26
30
  { label }:
27
31
  </Text>
28
- }
29
- { value &&
32
+ ) }
33
+ { value && (
30
34
  <Text
31
35
  as="span"
32
36
  sx={ {
@@ -40,7 +44,7 @@ const DialogButton = ( { label, variant = 'secondary', value, children, ...props
40
44
  >
41
45
  { value }
42
46
  </Text>
43
- }
47
+ ) }
44
48
  <MdExpandMore sx={ { ml: 2, top: 0, display: 'block', flex: '0 0 auto' } } />
45
49
  </Button>
46
50
  );
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  const DialogDivider = props => (
8
- <div sx={{ height: 1, backgroundColor: 'border', my: 1 }} { ...props } />
8
+ <div sx={ { height: 1, backgroundColor: 'border', my: 1 } } { ...props } />
9
9
  );
10
10
 
11
11
  export { DialogDivider };
@@ -5,11 +5,7 @@
5
5
  */
6
6
 
7
7
  const DialogMenu = props => (
8
- <ul
9
- role="menu"
10
- sx={{ listStyleType: 'none', m: 0, px: 0, py: 1 }}
11
- {...props}
12
- />
8
+ <ul role="menu" sx={ { listStyleType: 'none', m: 0, px: 0, py: 1 } } { ...props } />
13
9
  );
14
10
 
15
11
  export { DialogMenu };
@@ -7,8 +7,8 @@ import PropTypes from 'prop-types';
7
7
  import { useEffect, useRef } from 'react';
8
8
 
9
9
  /**
10
- * Internal dependencies
11
- */
10
+ * Internal dependencies
11
+ */
12
12
  import { Box, Spinner } from '../';
13
13
 
14
14
  const DialogMenuItem = ( { loading = false, children, ...props } ) => {
@@ -57,12 +57,8 @@ const DialogMenuItem = ( { loading = false, children, ...props } ) => {
57
57
  } }
58
58
  { ...props }
59
59
  >
60
- <Box sx={ { flex: '1 1 auto' } }>
61
- { children }
62
- </Box>
63
- { loading &&
64
- <Spinner sx={ { width: 12 } } />
65
- }
60
+ <Box sx={ { flex: '1 1 auto' } }>{ children }</Box>
61
+ { loading && <Spinner sx={ { width: 12 } } /> }
66
62
  </Box>
67
63
  </li>
68
64
  );
@@ -6,6 +6,6 @@
6
6
 
7
7
  import { Box } from '../';
8
8
 
9
- const DialogTrigger = props => <Box sx={{ display: 'inline' }} {...props} />;
9
+ const DialogTrigger = props => <Box sx={ { display: 'inline' } } { ...props } />;
10
10
 
11
11
  export { DialogTrigger };
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -5,6 +5,6 @@
5
5
  */
6
6
  import { Flex as ThemeFlex } from 'theme-ui';
7
7
 
8
- const Flex = props => <ThemeFlex {...props} />;
8
+ const Flex = props => <ThemeFlex { ...props } />;
9
9
 
10
10
  export { Flex };
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -7,19 +7,15 @@ import PropTypes from 'prop-types';
7
7
  import { withAsyncPaginate } from 'react-select-async-paginate';
8
8
 
9
9
  /**
10
- * Internal dependencies
11
- */
10
+ * Internal dependencies
11
+ */
12
12
  import { SearchSelect } from './SearchSelect';
13
13
 
14
14
  // Asynchronous search select to load paginated results asynchronously
15
15
  const CustomAsyncPaginate = withAsyncPaginate( SearchSelect );
16
16
 
17
17
  const AsyncSearchSelect = ( { options, ...props } ) => (
18
- <CustomAsyncPaginate
19
- SelectComponent={ SearchSelect }
20
- loadOptions={ options }
21
- { ...props }
22
- />
18
+ <CustomAsyncPaginate SelectComponent={ SearchSelect } loadOptions={ options } { ...props } />
23
19
  );
24
20
 
25
21
  AsyncSearchSelect.propTypes = {
@@ -7,35 +7,39 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
7
7
  import PropTypes from 'prop-types';
8
8
  import { MdDone } from 'react-icons/md';
9
9
 
10
- const StyledCheckbox = props => <CheckboxPrimitive.Root
11
- sx={ {
12
- all: 'unset',
13
- backgroundColor: 'grey.10',
14
- width: 16,
15
- height: 16,
16
- borderRadius: 1,
17
- display: 'flex',
18
- alignItems: 'center',
19
- justifyContent: 'center',
20
- '&:hover': { backgroundColor: 'grey.20' },
21
- '&:focus': { boxShadow: '0 0 0 2px black' },
22
- '&[data-state=checked]': {
23
- backgroundColor: 'primary',
24
- color: 'brand.0',
25
- },
26
- svg: {
27
- display: 'block',
28
- },
29
- } }
30
- { ...props }
31
- />;
10
+ const StyledCheckbox = props => (
11
+ <CheckboxPrimitive.Root
12
+ sx={ {
13
+ all: 'unset',
14
+ backgroundColor: 'grey.10',
15
+ width: 16,
16
+ height: 16,
17
+ borderRadius: 1,
18
+ display: 'flex',
19
+ alignItems: 'center',
20
+ justifyContent: 'center',
21
+ '&:hover': { backgroundColor: 'grey.20' },
22
+ '&:focus': { boxShadow: '0 0 0 2px black' },
23
+ '&[data-state=checked]': {
24
+ backgroundColor: 'primary',
25
+ color: 'brand.0',
26
+ },
27
+ svg: {
28
+ display: 'block',
29
+ },
30
+ } }
31
+ { ...props }
32
+ />
33
+ );
32
34
 
33
- const StyledIndicator = props => <CheckboxPrimitive.Indicator
34
- sx={ {
35
- color: 'brand.0',
36
- } }
37
- { ...props }
38
- />;
35
+ const StyledIndicator = props => (
36
+ <CheckboxPrimitive.Indicator
37
+ sx={ {
38
+ color: 'brand.0',
39
+ } }
40
+ { ...props }
41
+ />
42
+ );
39
43
 
40
44
  const Checkbox = ( { disabled, ...props } ) => (
41
45
  <StyledCheckbox
@@ -32,7 +32,14 @@ const selectStyles = {
32
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 = ( {
36
+ label,
37
+ value,
38
+ options,
39
+ noneLabel = 'All',
40
+ position = 'left',
41
+ ...props
42
+ } ) => {
36
43
  let valueLabel = noneLabel;
37
44
 
38
45
  if ( Array.isArray( value ) && value.length ) {
@@ -49,18 +56,18 @@ const InlineSelect = ( { label, value, options, noneLabel = 'All', position = 'l
49
56
  <Box>
50
57
  <Select
51
58
  autoFocus
52
- backspaceRemovesValue={false}
53
- components={{ Option, DropdownIndicator: null, IndicatorSeparator: null }}
54
- controlShouldRenderValue={false}
55
- hideSelectedOptions={false}
56
- isClearable={false}
59
+ backspaceRemovesValue={ false }
60
+ components={ { Option, DropdownIndicator: null, IndicatorSeparator: null } }
61
+ controlShouldRenderValue={ false }
62
+ hideSelectedOptions={ false }
63
+ isClearable={ false }
57
64
  menuIsOpen
58
- styles={selectStyles}
65
+ styles={ selectStyles }
59
66
  classNamePrefix={ 'select' }
60
- options={options}
67
+ options={ options }
61
68
  placeholder="Search..."
62
- tabSelectsValue={false}
63
- value={value}
69
+ tabSelectsValue={ false }
70
+ value={ value }
64
71
  sx={ {
65
72
  '.select__control': {
66
73
  background: 'none',
@@ -83,16 +90,16 @@ const InlineSelect = ( { label, value, options, noneLabel = 'All', position = 'l
83
90
  borderColor: 'border',
84
91
  },
85
92
  } }
86
- {...props}
93
+ { ...props }
87
94
  />
88
95
  </Box>
89
96
  );
90
97
 
91
98
  return (
92
99
  <Dialog
93
- content={Content}
100
+ content={ Content }
94
101
  position={ position }
95
- trigger={<DialogButton sx={{ width: '100%' }} label={label} value={valueLabel} />}
102
+ trigger={ <DialogButton sx={ { width: '100%' } } label={ label } value={ valueLabel } /> }
96
103
  />
97
104
  );
98
105
  };
@@ -100,10 +107,7 @@ const InlineSelect = ( { label, value, options, noneLabel = 'All', position = 'l
100
107
  InlineSelect.propTypes = {
101
108
  label: PropTypes.string,
102
109
  // https://react-select.com/props
103
- value: PropTypes.oneOfType( [
104
- PropTypes.array,
105
- PropTypes.object,
106
- ] ),
110
+ value: PropTypes.oneOfType( [ PropTypes.array, PropTypes.object ] ),
107
111
  options: PropTypes.array,
108
112
  position: PropTypes.string,
109
113
  noneLabel: PropTypes.string,
@@ -11,51 +11,49 @@ 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 ) => (
15
- <React.Fragment>
16
- { label &&
17
- <Label htmlFor={ forLabel }>
18
- { label }
19
- { required &&
20
- '*'
21
- }
22
- </Label>
23
- }
24
- <input
25
- { ...props }
26
- ref={ ref }
27
- id={ forLabel }
28
- required={ required }
29
- sx={ {
30
- border: '1px solid',
31
- borderColor: 'border',
32
- backgroundColor: 'card',
33
- borderRadius: 1,
34
- lineHeight: 'inherit',
35
- px: 3,
36
- py: 2,
37
- fontSize: 2,
38
- mb: 2,
39
- color: 'text',
40
- display: 'block',
41
- width: '100%',
42
- '&:focus': {
43
- borderColor: 'brand.60',
44
- outline: 'none',
45
- },
46
- '&:disabled': {
47
- bg: 'backgroundSecondary',
48
- },
49
- '&::placeholder': {
50
- color: 'placeholder',
51
- },
52
- } }
53
- />
54
- { hasError && errorMessage &&
55
- <Validation>{ errorMessage }</Validation>
56
- }
57
- </React.Fragment>
58
- ) );
14
+ const Input = React.forwardRef(
15
+ ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
16
+ <React.Fragment>
17
+ { label && (
18
+ <Label htmlFor={ forLabel }>
19
+ { label }
20
+ { required && '*' }
21
+ </Label>
22
+ ) }
23
+ <input
24
+ { ...props }
25
+ ref={ ref }
26
+ id={ forLabel }
27
+ required={ required }
28
+ sx={ {
29
+ border: '1px solid',
30
+ borderColor: 'border',
31
+ backgroundColor: 'card',
32
+ borderRadius: 1,
33
+ lineHeight: 'inherit',
34
+ px: 3,
35
+ py: 2,
36
+ fontSize: 2,
37
+ mb: 2,
38
+ color: 'text',
39
+ display: 'block',
40
+ width: '100%',
41
+ '&:focus': {
42
+ borderColor: 'brand.60',
43
+ outline: 'none',
44
+ },
45
+ '&:disabled': {
46
+ bg: 'backgroundSecondary',
47
+ },
48
+ '&::placeholder': {
49
+ color: 'placeholder',
50
+ },
51
+ } }
52
+ />
53
+ { hasError && errorMessage && <Validation>{ errorMessage }</Validation> }
54
+ </React.Fragment>
55
+ )
56
+ );
59
57
 
60
58
  Input.propTypes = {
61
59
  variant: PropTypes.string,
@@ -9,8 +9,8 @@ const Label = props => (
9
9
  <Heading
10
10
  variant="h4"
11
11
  as="label"
12
- sx={{ display: 'block', mb: 2, color: 'muted' }}
13
- {...props}
12
+ sx={ { display: 'block', mb: 2, color: 'muted' } }
13
+ { ...props }
14
14
  />
15
15
  );
16
16
 
@@ -20,41 +20,43 @@ const RadioBoxGroup = ( { onChange, groupLabel, value, options, ...props } ) =>
20
20
  sx={ {
21
21
  display: 'flex',
22
22
  gap: 2,
23
-
24
23
  } }
25
24
  { ...props }
26
25
  >
27
- {
28
- options.map( ( option, index ) => (
29
- <RadioGroupPrimitive.Item
30
- key={ option.value }
31
- value={ option.value }
32
- id={ `o${ index }` }
33
- sx={ {
34
- p: 3,
35
- background: 'none',
36
- cursor: 'pointer',
37
- borderRadius: 2,
38
- textAlign: 'left',
39
- border: '1px solid',
40
- borderColor: 'border',
41
- position: 'relative',
42
- '&:hover': {
43
- borderColor: 'grey.10',
44
- },
45
- '&[data-state=checked]': {
46
- borderColor: 'primary',
47
- },
48
- } }
49
- >
50
- <RadioGroupPrimitive.Indicator>
51
- <MdCheckCircle size={ 16 } sx={ { position: 'absolute', top: 2, right: 2, color: 'primary' } } />
52
- </RadioGroupPrimitive.Indicator>
53
- <Heading variant="h4" as="label" htmlFor={ `o${ index }` } sx={ { mb: 0 } }>{ option.label }</Heading>
54
- <Text sx={ { color: 'muted', mb: 0, fontSize: 1 } }>{ option.description }</Text>
55
- </RadioGroupPrimitive.Item>
56
- ) )
57
- }
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
+ ) ) }
58
60
  </RadioGroupPrimitive.Root>
59
61
  );
60
62
 
@@ -33,5 +33,12 @@ const options = [
33
33
 
34
34
  export const Default = () => {
35
35
  const [ value, setValue ] = useState( 'one' );
36
- return <RadioBoxGroup value={ value } onChange={ newValue => setValue( newValue ) } groupLabel="group" options={ options } />;
36
+ return (
37
+ <RadioBoxGroup
38
+ value={ value }
39
+ onChange={ newValue => setValue( newValue ) }
40
+ groupLabel="group"
41
+ options={ options }
42
+ />
43
+ );
37
44
  };
@@ -14,14 +14,14 @@ import { Flex, Text } from '..';
14
14
 
15
15
  // Option component
16
16
  export const Option = ( { label, isSelected, ...props } ) => (
17
- <components.Option {...props}>
18
- <Flex sx={{ alignItems: 'center' }}>
19
- {isSelected && (
20
- <Text as="span" sx={{ mb: 0, mr: 2, color: 'green.80', svg: { display: 'block' } }}>
17
+ <components.Option { ...props }>
18
+ <Flex sx={ { alignItems: 'center' } }>
19
+ { isSelected && (
20
+ <Text as="span" sx={ { mb: 0, mr: 2, color: 'green.80', svg: { display: 'block' } } }>
21
21
  <MdDone />
22
22
  </Text>
23
- )}
24
- <Text as="span" sx={{ mb: 0, flex: '1 1 auto', color: 'heading' }}>
23
+ ) }
24
+ <Text as="span" sx={ { mb: 0, flex: '1 1 auto', color: 'heading' } }>
25
25
  { label }
26
26
  </Text>
27
27
  </Flex>
@@ -73,7 +73,7 @@ DropdownIndicator.propTypes = {
73
73
 
74
74
  // ClearIndicator component
75
75
  const ClearIndicator = ( { innerProps: { ref, ...restInnerProps }, ...props } ) => (
76
- <MdClose ref={ref} {...restInnerProps} {...props} sx={{ color: 'text', mr: 2 }} />
76
+ <MdClose ref={ ref } { ...restInnerProps } { ...props } sx={ { color: 'text', mr: 2 } } />
77
77
  );
78
78
 
79
79
  ClearIndicator.propTypes = {
@@ -13,7 +13,16 @@ import { SearchSelect } from './SearchSelect';
13
13
  import { InlineSelect } from './InlineSelect';
14
14
  import { AsyncSearchSelect } from './AsyncSearchSelect';
15
15
 
16
- const Select = ( { isMulti = false, isInline, isAsync, options, label, isSearch, usePortal, ...props } ) => {
16
+ const Select = ( {
17
+ isMulti = false,
18
+ isInline,
19
+ isAsync,
20
+ options,
21
+ label,
22
+ isSearch,
23
+ usePortal,
24
+ ...props
25
+ } ) => {
17
26
  let Component;
18
27
  const selectRef = React.useRef();
19
28
  const portalProps = {};
@@ -36,7 +45,17 @@ const Select = ( { isMulti = false, isInline, isAsync, options, label, isSearch,
36
45
  break;
37
46
  }
38
47
 
39
- return <div ref={selectRef} className="vip-select-component"><Component isMulti={isMulti} label={label} options={options} {...portalProps} {...props} /></div>;
48
+ return (
49
+ <div ref={ selectRef } className="vip-select-component">
50
+ <Component
51
+ isMulti={ isMulti }
52
+ label={ label }
53
+ options={ options }
54
+ { ...portalProps }
55
+ { ...props }
56
+ />
57
+ </div>
58
+ );
40
59
  };
41
60
 
42
61
  Select.propTypes = {