@automattic/vip-design-system 0.10.3 → 0.11.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 (128) 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/MultiSelect.js +45 -25
  17. package/build/system/Form/Select.stories.js +3 -4
  18. package/build/system/Form/Select.test.js +2 -2
  19. package/build/system/Notification/Notification.js +24 -15
  20. package/build/system/Notification/Notification.stories.js +14 -4
  21. package/build/system/OptionRow/OptionRow.js +23 -17
  22. package/build/system/OptionRow/OptionRow.stories.js +5 -5
  23. package/build/system/OptionRow/OptionRow.test.js +4 -4
  24. package/build/system/ResourceList/ResourceList.js +34 -25
  25. package/build/system/ResourceList/ResourceList.stories.js +2 -0
  26. package/build/system/ScreenReaderText/ScreenReader.test.js +37 -0
  27. package/build/system/ScreenReaderText/ScreenReaderText.js +49 -0
  28. package/build/system/ScreenReaderText/index.js +7 -0
  29. package/build/system/Time/index.js +1 -1
  30. package/build/system/UsageChart/UsageChart.js +47 -45
  31. package/build/system/UsageChart/UsageChart.stories.js +8 -8
  32. package/build/system/UsageChart/index.js +3 -3
  33. package/build/system/Wizard/Wizard.stories.js +1 -1
  34. package/package.json +8 -4
  35. package/src/system/Avatar/Avatar.js +1 -0
  36. package/src/system/Avatar/index.js +0 -1
  37. package/src/system/Badge/index.js +0 -1
  38. package/src/system/BlankState/BlankState.js +8 -5
  39. package/src/system/BlankState/BlankState.stories.jsx +5 -4
  40. package/src/system/BlankState/BlankState.test.js +21 -21
  41. package/src/system/BlankState/index.js +0 -1
  42. package/src/system/Box/Box.js +7 -1
  43. package/src/system/Box/index.js +0 -1
  44. package/src/system/Button/Button.js +3 -3
  45. package/src/system/Button/Button.stories.jsx +2 -2
  46. package/src/system/Button/index.js +0 -1
  47. package/src/system/Card/Card.js +4 -4
  48. package/src/system/Card/Card.test.js +1 -2
  49. package/src/system/Card/index.js +0 -1
  50. package/src/system/Code/Code.js +6 -2
  51. package/src/system/Code/Code.stories.jsx +10 -5
  52. package/src/system/Code/Code.test.js +3 -16
  53. package/src/system/ConfirmationDialog/ConfirmationDialog.js +8 -1
  54. package/src/system/Dialog/Dialog.js +17 -8
  55. package/src/system/Dialog/Dialog.stories.jsx +9 -13
  56. package/src/system/Dialog/DialogButton.js +18 -14
  57. package/src/system/Dialog/DialogDivider.js +1 -1
  58. package/src/system/Dialog/DialogMenu.js +1 -5
  59. package/src/system/Dialog/DialogMenuItem.js +4 -8
  60. package/src/system/Dialog/DialogTrigger.js +1 -1
  61. package/src/system/Dialog/index.js +0 -1
  62. package/src/system/Flex/Flex.js +1 -1
  63. package/src/system/Flex/index.js +0 -1
  64. package/src/system/Form/AsyncSearchSelect.js +3 -7
  65. package/src/system/Form/Checkbox.js +32 -28
  66. package/src/system/Form/InlineSelect.js +21 -17
  67. package/src/system/Form/Input.js +43 -45
  68. package/src/system/Form/Label.js +2 -2
  69. package/src/system/Form/RadioBoxGroup.js +34 -32
  70. package/src/system/Form/RadioBoxGroup.stories.jsx +8 -1
  71. package/src/system/Form/SearchSelect.js +7 -7
  72. package/src/system/Form/Select.js +21 -2
  73. package/src/system/Form/Select.stories.jsx +31 -34
  74. package/src/system/Form/Select.test.js +3 -8
  75. package/src/system/Form/Textarea.js +38 -40
  76. package/src/system/Form/Toggle.js +9 -11
  77. package/src/system/Form/ToggleGroup.js +29 -31
  78. package/src/system/Form/ToggleGroup.stories.jsx +8 -1
  79. package/src/system/Form/ToggleRow.js +6 -1
  80. package/src/system/Form/Validation.js +6 -1
  81. package/src/system/Form/index.js +13 -1
  82. package/src/system/Grid/Grid.js +1 -1
  83. package/src/system/Grid/index.js +0 -1
  84. package/src/system/Heading/Heading.js +4 -4
  85. package/src/system/Heading/index.js +0 -1
  86. package/src/system/Link/index.js +0 -1
  87. package/src/system/Notice/Notice.js +27 -13
  88. package/src/system/Notice/Notice.stories.jsx +6 -8
  89. package/src/system/Notice/index.js +0 -1
  90. package/src/system/Notification/Notification.js +25 -20
  91. package/src/system/Notification/Notification.stories.jsx +4 -4
  92. package/src/system/Notification/index.js +0 -1
  93. package/src/system/OptionRow/OptionRow.js +46 -44
  94. package/src/system/OptionRow/OptionRow.stories.jsx +10 -8
  95. package/src/system/OptionRow/OptionRow.test.js +12 -11
  96. package/src/system/OptionRow/index.js +0 -1
  97. package/src/system/Progress/Progress.js +3 -1
  98. package/src/system/Progress/Progress.stories.jsx +4 -4
  99. package/src/system/Progress/index.js +0 -1
  100. package/src/system/ResourceList/ResourceItem.js +15 -15
  101. package/src/system/ResourceList/ResourceList.js +28 -16
  102. package/src/system/ResourceList/ResourceList.stories.jsx +77 -71
  103. package/src/system/ScreenReaderText/ScreenReader.test.js +22 -0
  104. package/src/system/ScreenReaderText/ScreenReaderText.js +40 -0
  105. package/src/system/ScreenReaderText/index.js +7 -0
  106. package/src/system/Spinner/Spinner.js +4 -4
  107. package/src/system/Spinner/index.js +0 -1
  108. package/src/system/Table/Table.js +5 -5
  109. package/src/system/Table/Table.stories.jsx +10 -8
  110. package/src/system/Table/index.js +0 -1
  111. package/src/system/Tabs/Tabs.js +3 -3
  112. package/src/system/Tabs/index.js +0 -1
  113. package/src/system/Text/Text.js +3 -3
  114. package/src/system/Text/Text.stories.jsx +4 -6
  115. package/src/system/Text/index.js +0 -1
  116. package/src/system/Time/Time.stories.jsx +2 -6
  117. package/src/system/Time/index.js +5 -5
  118. package/src/system/Timeline/Timeline.js +6 -12
  119. package/src/system/Timeline/Timeline.stories.jsx +3 -12
  120. package/src/system/Timeline/index.js +0 -1
  121. package/src/system/Tooltip/Tooltip.js +4 -8
  122. package/src/system/Wizard/Wizard.js +23 -21
  123. package/src/system/Wizard/Wizard.stories.jsx +7 -12
  124. package/src/system/Wizard/WizardStep.js +8 -8
  125. package/src/system/Wizard/WizardStepHorizontal.js +4 -4
  126. package/src/system/Wizard/index.js +0 -1
  127. package/src/system/theme/index.js +3 -4
  128. package/tokens/valet-color.json +1919 -0
@@ -4,6 +4,7 @@
4
4
  * External dependencies
5
5
  */
6
6
  import PropTypes from 'prop-types';
7
+ import { useMemo } from 'react';
7
8
 
8
9
  /**
9
10
  * Internal dependencies
@@ -29,15 +30,15 @@ const formatDate = date => {
29
30
  const StyledListItem = props => (
30
31
  <Box
31
32
  as="li"
32
- sx={{
33
+ sx={ {
33
34
  py: 2,
34
35
  borderBottom: '1px solid',
35
36
  borderColor: 'border',
36
37
  listStyleType: 'none',
37
38
  margin: 0,
38
39
  px: 0,
39
- }}
40
- {...props}
40
+ } }
41
+ { ...props }
41
42
  />
42
43
  );
43
44
 
@@ -56,31 +57,42 @@ const ResourceList = ( { groupedByDay = false, items, renderItem, dateKey } ) =>
56
57
  }
57
58
 
58
59
  const renderItemList = itemsList =>
59
- itemsList.map( ( item, index ) => <StyledListItem key={index}>{renderItem( item )}</StyledListItem> );
60
+ itemsList.map( ( item, index ) => (
61
+ <StyledListItem key={ index }>{ renderItem( item ) }</StyledListItem>
62
+ ) );
60
63
 
61
- return (
62
- <Box as="ul" sx={{ listStyleType: 'none', m: 0, p: 0 }} className="vip-resource-list-component">
63
- {groupedByDay
64
- ? Object.keys( groupedItems ).map( ( groupName, index ) => (
65
- <Box sx={{ mb: 4 }} key={index}>
66
- <Heading variant="h4" as="h4" sx={{ mb: 3 }}>
67
- {groupName}
64
+ const renderGoupedItems = () =>
65
+ useMemo(
66
+ () =>
67
+ Object.keys( groupedItems ).map( ( groupName, index ) => (
68
+ <Box sx={ { mb: 4 } } key={ index } as="li">
69
+ <Heading variant="h4" as="h4" sx={ { mb: 3 } }>
70
+ { groupName }
68
71
  </Heading>
69
72
  <Box
70
73
  as="ul"
71
- sx={{
74
+ sx={ {
72
75
  listStyleType: 'none',
73
76
  m: 0,
74
77
  p: 0,
75
78
  borderTop: '1px solid',
76
79
  borderColor: 'border',
77
- }}
80
+ } }
78
81
  >
79
- {renderItemList( groupedItems[ groupName ] )}
82
+ { renderItemList( groupedItems[ groupName ] ) }
80
83
  </Box>
81
84
  </Box>
82
- ) )
83
- : renderItemList( items )}
85
+ ) ),
86
+ [ groupedItems ]
87
+ );
88
+
89
+ return (
90
+ <Box
91
+ as="ul"
92
+ sx={ { listStyleType: 'none', m: 0, p: 0 } }
93
+ className="vip-resource-list-component"
94
+ >
95
+ { groupedByDay ? renderGoupedItems( groupedItems ) : renderItemList( items ) }
84
96
  </Box>
85
97
  );
86
98
  };
@@ -56,62 +56,65 @@ const logs = [
56
56
  ];
57
57
 
58
58
  export const Grouped = () => (
59
- <Box sx={{ p: 5, pt: 2 }}>
60
- <Heading sx={{ mb: 2 }}>Audit Log</Heading>
61
- <Text sx={{ mb: 4 }}>A live trail of system and human events.</Text>
59
+ <Box sx={ { p: 5, pt: 2 } }>
60
+ <Heading sx={ { mb: 2 } }>Audit Log</Heading>
61
+ <Text sx={ { mb: 4 } }>A live trail of system and human events.</Text>
62
62
  <ResourceList
63
- items={logs}
63
+ items={ logs }
64
64
  dateKey="date"
65
- groupedByDay={true}
66
- renderItem={item => (
65
+ groupedByDay={ true }
66
+ renderItem={ item => (
67
67
  <ResourceItem
68
- item={item}
69
- icon={<BiGlobe sx={{ color: 'red' }} />}
70
- dateKey={'date'}
71
- relativeTime={true}
72
- timeOnly={true}
68
+ item={ item }
69
+ icon={ <BiGlobe sx={ { color: 'red' } } /> }
70
+ dateKey={ 'date' }
71
+ relativeTime={ true }
72
+ timeOnly={ true }
73
73
  >
74
- <Flex sx={{ alignItems: 'center', gap: 3 }}>
74
+ <Flex sx={ { alignItems: 'center', gap: 3 } }>
75
75
  <Avatar
76
- name={item.actor}
76
+ name={ item.actor }
77
77
  src="https://uifaces.co/our-content/donated/1H_7AxP0.jpg"
78
- size={16}
78
+ size={ 16 }
79
79
  />
80
- <Heading variant="h4" as="p" sx={{ mb: 0, fontWeight: 'normal' }}>
81
- {item.actor}{' '}
82
- <Text as="span" sx={{ color: 'muted', mb: 0 }}>
83
- {item.action}
84
- </Text>{' '}
85
- {item.object}
80
+ <Heading variant="h4" as="p" sx={ { mb: 0, fontWeight: 'normal' } }>
81
+ { item.actor }{ ' ' }
82
+ <Text as="span" sx={ { color: 'muted', mb: 0 } }>
83
+ { item.action }
84
+ </Text>{ ' ' }
85
+ { item.object }
86
86
  </Heading>
87
87
  </Flex>
88
- {item.showObject && (
88
+ { item.showObject && (
89
89
  <Box
90
90
  variant="indent"
91
- sx={{ mt: 2, display: 'flex', flexWrap: 'wrap', gap: 3, alignItems: 'center' }}
91
+ sx={ { mt: 2, display: 'flex', flexWrap: 'wrap', gap: 3, alignItems: 'center' } }
92
92
  >
93
- <Heading variant="h5" as="div" sx={{ mb: 0 }}>
94
- Merge pull request{' '}
95
- <Text as="span" sx={{ color: 'muted' }}>
93
+ <Heading variant="h5" as="div" sx={ { mb: 0 } }>
94
+ Merge pull request{ ' ' }
95
+ <Text as="span" sx={ { color: 'muted' } }>
96
96
  #443
97
97
  </Text>
98
98
  </Heading>
99
- <Text sx={{ mb: 0, fontSize: 1, display: 'flex', alignItems: 'center', gap: 1 }}>
99
+ <Text
100
+ as="div"
101
+ sx={ { mb: 0, fontSize: 1, display: 'flex', alignItems: 'center', gap: 1 } }
102
+ >
100
103
  <Avatar
101
- name={item.actor}
104
+ name={ item.actor }
102
105
  src="https://uifaces.co/our-content/donated/n4Ngwvi7.jpg"
103
- size={16}
106
+ size={ 16 }
104
107
  />
105
- {item.actor}
108
+ { item.actor }
106
109
  </Text>
107
- <Text sx={{ mb: 0, fontSize: 1, display: 'flex', alignItems: 'center', gap: 1 }}>
108
- <BiCheckCircle size={16} />
110
+ <Text sx={ { mb: 0, fontSize: 1, display: 'flex', alignItems: 'center', gap: 1 } }>
111
+ <BiCheckCircle size={ 16 } />
109
112
  Deployed in 31s
110
113
  </Text>
111
114
  </Box>
112
- )}
115
+ ) }
113
116
  </ResourceItem>
114
- )}
117
+ ) }
115
118
  />
116
119
  </Box>
117
120
  );
@@ -218,83 +221,86 @@ const deploys = [
218
221
  ];
219
222
 
220
223
  export const Relative = () => (
221
- <Box sx={{ p: 5, pt: 2 }}>
222
- <Heading sx={{ mb: 2 }}>Deploys</Heading>
223
- <Text sx={{ mb: 4 }}>View and manage application deployments.</Text>
224
- <Card variant="indent" sx={{ mb: 4, display: 'flex', flexDirection: 'row-reverse', gap: 1 }}>
225
- {deploys.map( ( deploy, index ) => (
224
+ <Box sx={ { p: 5, pt: 2 } }>
225
+ <Heading sx={ { mb: 2 } }>Deploys</Heading>
226
+ <Text sx={ { mb: 4 } }>View and manage application deployments.</Text>
227
+ <Card variant="indent" sx={ { mb: 4, display: 'flex', flexDirection: 'row-reverse', gap: 1 } }>
228
+ { deploys.map( ( deploy, index ) => (
226
229
  <Box
227
- key={index}
228
- sx={{
230
+ key={ index }
231
+ sx={ {
229
232
  flex: '1 1 auto',
230
233
  width: 10,
231
234
  height: 4,
232
235
  backgroundColor: deploy.status === 'running' ? 'blue.50' : 'green.50',
233
236
  borderRadius: 1,
234
- }}
237
+ } }
235
238
  ></Box>
236
- ) )}
239
+ ) ) }
237
240
  </Card>
238
241
  <ResourceList
239
- items={deploys}
242
+ items={ deploys }
240
243
  dateKey="date"
241
- groupedByDay={false}
242
- renderItem={item => (
244
+ groupedByDay={ false }
245
+ renderItem={ item => (
243
246
  <ResourceItem
244
- item={item}
245
- dateKey={'date'}
246
- relativeTime={true}
247
- timeOnly={true}
248
- renderActions={() => (
249
- <Flex sx={{ alignItems: 'center' }}>
250
- <Button variant="secondary" sx={{ fontSize: 1 }}>
247
+ item={ item }
248
+ dateKey={ 'date' }
249
+ relativeTime={ true }
250
+ timeOnly={ true }
251
+ renderActions={ () => (
252
+ <Flex sx={ { alignItems: 'center' } }>
253
+ <Button variant="secondary" sx={ { fontSize: 1 } }>
251
254
  Rollback
252
255
  </Button>
253
256
  </Flex>
254
- )}
257
+ ) }
255
258
  >
256
- <Flex sx={{ alignItems: 'center', gap: 4 }}>
257
- <Flex sx={{ alignItems: 'center', gap: 3, minWidth: 300 }}>
258
- <Heading variant="h4" as="p" sx={{ mb: 0, fontWeight: 'normal' }}>
259
- {item.title}{' '}
260
- <Text as="span" sx={{ color: 'muted', mb: 0 }}>
261
- {item.id}
259
+ <Flex sx={ { alignItems: 'center', gap: 4 } }>
260
+ <Flex sx={ { alignItems: 'center', gap: 3, minWidth: 300 } }>
261
+ <Heading variant="h4" as="p" sx={ { mb: 0, fontWeight: 'normal' } }>
262
+ { item.title }{ ' ' }
263
+ <Text as="span" sx={ { color: 'muted', mb: 0 } }>
264
+ { item.id }
262
265
  </Text>
263
266
  </Heading>
264
- {item.status === 'running' && <Badge sx={{ mb: 0 }}>Running</Badge>}
267
+ { item.status === 'running' && <Badge sx={ { mb: 0 } }>Running</Badge> }
265
268
  </Flex>
266
- <Text sx={{ mb: 0, color: 'muted', display: 'flex', alignItems: 'center', gap: 2 }}>
269
+ <Text
270
+ as="div"
271
+ sx={ { mb: 0, color: 'muted', display: 'flex', alignItems: 'center', gap: 2 } }
272
+ >
267
273
  <Avatar
268
- name={item.author}
269
- size={16}
274
+ name={ item.author }
275
+ size={ 16 }
270
276
  src="https://randomuser.me/api/portraits/men/46.jpg"
271
277
  />
272
- {item.author}
278
+ { item.author }
273
279
  </Text>
274
280
  <Text
275
- sx={{
281
+ sx={ {
276
282
  mb: 0,
277
283
  color: item.status === 'running' ? 'blue.60' : 'muted',
278
284
  display: 'flex',
279
285
  alignItems: 'center',
280
286
  gap: 1,
281
- }}
287
+ } }
282
288
  >
283
- {item.status === 'running' ? (
289
+ { item.status === 'running' ? (
284
290
  <React.Fragment>
285
- <BiRevision size={16} />
291
+ <BiRevision size={ 16 } />
286
292
  Running for 31s
287
293
  </React.Fragment>
288
294
  ) : (
289
295
  <React.Fragment>
290
- <BiCheckCircle size={16} />
296
+ <BiCheckCircle size={ 16 } />
291
297
  Deployed in 31s
292
298
  </React.Fragment>
293
- )}
299
+ ) }
294
300
  </Text>
295
301
  </Flex>
296
302
  </ResourceItem>
297
- )}
303
+ ) }
298
304
  />
299
305
  </Box>
300
306
  );
@@ -0,0 +1,22 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render, screen } from '@testing-library/react';
5
+ import '@testing-library/jest-dom';
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import ScreenReaderText from './ScreenReaderText';
10
+
11
+ describe( '<ScreenReaderText />', () => {
12
+ it( 'should render correctly', () => {
13
+ const props = {};
14
+ const text = 'Hello there';
15
+ const { container } = render( <ScreenReaderText { ...props }>{ text }</ScreenReaderText> );
16
+ // we're using the querySelector to ensure the class is rendered since it affects the A11Y
17
+ // in case it's removed it could compromise the A11Y of the components using it.
18
+ expect( container.querySelector( '.screen-reader-text' ) ).toBeInTheDocument();
19
+
20
+ expect( screen.queryByText( text ) ).toBeInTheDocument();
21
+ } );
22
+ } );
@@ -0,0 +1,40 @@
1
+ /** @jsxImportSource theme-ui */
2
+ /**
3
+ * External dependencies
4
+ */
5
+
6
+ import PropTypes from 'prop-types';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+
12
+ export default function ScreenReaderText( props ) {
13
+ return (
14
+ <span
15
+ className="screen-reader-text"
16
+ sx={ {
17
+ border: 'none',
18
+ clip: 'rect(1px, 1px, 1px, 1px)',
19
+ clipPath: 'inset(50%)',
20
+ height: '1px',
21
+ margin: '-1px',
22
+ overflow: 'hidden',
23
+ padding: '0',
24
+ position: 'absolute',
25
+ width: '1px',
26
+ wordWrap: 'normal !important',
27
+ } }
28
+ { ...props }
29
+ >
30
+ { props.children }
31
+ </span>
32
+ );
33
+ }
34
+
35
+ /**
36
+ * propTypes
37
+ */
38
+ ScreenReaderText.propTypes = {
39
+ children: PropTypes.node.isRequired,
40
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+
5
+ import { ScreenReaderText } from './ScreenReaderText';
6
+
7
+ export { ScreenReaderText };
@@ -9,13 +9,13 @@ import classNames from 'classnames';
9
9
 
10
10
  const Spinner = ( { sx, className = null, ...props } ) => (
11
11
  <ThemeSpinner
12
- strokeWidth={2}
13
- sx={{
12
+ strokeWidth={ 2 }
13
+ sx={ {
14
14
  fill: 'none',
15
15
  color: 'primary',
16
- }}
16
+ } }
17
17
  className={ classNames( 'vip-spinner-component', className ) }
18
- {...props}
18
+ { ...props }
19
19
  />
20
20
  );
21
21
 
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -8,11 +8,11 @@ import classNames from 'classnames';
8
8
 
9
9
  const Table = ( { sx, className, ...props } ) => (
10
10
  <table
11
- sx={{ width: '100%', minWidth: 1024, ...sx }}
12
- cellPadding={0}
13
- cellSpacing={0}
14
- className={classNames( 'vip-table-component', className )}
15
- {...props}
11
+ sx={ { width: '100%', minWidth: 1024, ...sx } }
12
+ cellPadding={ 0 }
13
+ cellSpacing={ 0 }
14
+ className={ classNames( 'vip-table-component', className ) }
15
+ { ...props }
16
16
  />
17
17
  );
18
18
 
@@ -11,28 +11,30 @@ export default {
11
11
  export const Default = () => (
12
12
  <Table>
13
13
  <thead>
14
- <TableRow head cells={[ 'User', 'Command', 'Duration', 'Time' ]} />
14
+ <TableRow head cells={ [ 'User', 'Command', 'Duration', 'Time' ] } />
15
15
  </thead>
16
16
  <tbody>
17
17
  <TableRow
18
- cells={[
19
- <Flex sx={{ alignItems: 'center' }} key="user">
20
- <Heading variant="h4" sx={{ mb: 0 }}>
18
+ cells={ [
19
+ <Flex sx={ { alignItems: 'center' } } key="user">
20
+ <Heading variant="h4" sx={ { mb: 0 } }>
21
21
  kwaves
22
22
  </Heading>
23
23
  </Flex>,
24
24
  <Heading
25
25
  variant="h4"
26
26
  key="command"
27
- sx={{ mb: 0, display: 'flex', alignItems: 'center' }}
27
+ sx={ { mb: 0, display: 'flex', alignItems: 'center' } }
28
28
  >
29
29
  wp rewrite flush
30
30
  </Heading>,
31
- <Text sx={{ mb: 0 }} key="duration">2s</Text>,
32
- <Text sx={{ mb: 0, color: 'muted' }} key="time">
31
+ <Text sx={ { mb: 0 } } key="duration">
32
+ 2s
33
+ </Text>,
34
+ <Text sx={ { mb: 0, color: 'muted' } } key="time">
33
35
  11th Mar 2020, 16:49:22
34
36
  </Text>,
35
- ]}
37
+ ] }
36
38
  />
37
39
  </tbody>
38
40
  </Table>
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -14,15 +14,15 @@ import { Flex } from '..';
14
14
  const Tabs = ( { className = null, sx, ...props } ) => (
15
15
  <Flex
16
16
  className={ classNames( 'vip-tabs-component', className ) }
17
- sx={{
17
+ sx={ {
18
18
  borderBottom: '1px solid',
19
19
  borderColor: 'border',
20
20
  listStyleType: 'none',
21
21
  margin: 0,
22
22
  padding: 0,
23
23
  ...sx,
24
- }}
25
- {...props}
24
+ } }
25
+ { ...props }
26
26
  />
27
27
  );
28
28
 
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -10,13 +10,13 @@ import classNames from 'classnames';
10
10
  const Text = ( { sx, className = null, ...props } ) => (
11
11
  <ThemeText
12
12
  as="p"
13
- sx={{
13
+ sx={ {
14
14
  lineHeight: 1.5,
15
15
  marginBottom: 2,
16
16
  ...sx,
17
- }}
17
+ } }
18
18
  className={ classNames( 'vip-text-component', className ) }
19
- {...props}
19
+ { ...props }
20
20
  />
21
21
  );
22
22
 
@@ -10,11 +10,9 @@ export default {
10
10
 
11
11
  export const Default = () => (
12
12
  <Text>
13
- Apparently we had reached a great height in the atmosphere, for the sky
14
- was a dead black, and the stars had ceased to twinkle. By the same
15
- illusion which lifts the horizon of the sea to the level of the
16
- spectator on a hillside, the sable cloud beneath was dished out, and the
17
- car seemed to float in the middle of an immense dark sphere, whose upper
18
- half was strewn with silver.{' '}
13
+ Apparently we had reached a great height in the atmosphere, for the sky was a dead black, and
14
+ the stars had ceased to twinkle. By the same illusion which lifts the horizon of the sea to the
15
+ level of the spectator on a hillside, the sable cloud beneath was dished out, and the car seemed
16
+ to float in the middle of an immense dark sphere, whose upper half was strewn with silver.{ ' ' }
19
17
  </Text>
20
18
  );
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */
@@ -17,16 +17,12 @@ export const Default = () => (
17
17
  <React.Fragment>
18
18
  <Grid gap={ 2 } columns={ [ 2, '100px 300px' ] } sx={ { mb: '20px' } }>
19
19
  <Time time="7pm" />
20
- <Box>
21
- It looks like everything is recovered now. You can forget about the last event.
22
- </Box>
20
+ <Box>It looks like everything is recovered now. You can forget about the last event.</Box>
23
21
  </Grid>
24
22
 
25
23
  <Grid gap={ 2 } columns={ [ 2, '100px 200px' ] }>
26
24
  <Time time="6pm" />
27
- <Box>
28
- At this particular moment in the day, something happened with your environment.
29
- </Box>
25
+ <Box>At this particular moment in the day, something happened with your environment.</Box>
30
26
  </Grid>
31
27
  </React.Fragment>
32
28
  );
@@ -44,19 +44,19 @@ const Time = ( { time, relativeTime = false, timeOnly = false, className = null,
44
44
 
45
45
  return (
46
46
  <Text
47
- title={time.toLocaleString( 'sv', { timeZoneName: 'short' } )}
48
- datetime={time}
47
+ title={ time.toLocaleString( 'sv', { timeZoneName: 'short' } ) }
48
+ datetime={ time }
49
49
  as="time"
50
50
  className={ classNames( 'vip-time-component', className ) }
51
- {...props}
51
+ { ...props }
52
52
  >
53
- {formattedTime}
53
+ { formattedTime }
54
54
  </Text>
55
55
  );
56
56
  };
57
57
 
58
58
  Time.propTypes = {
59
- time: PropTypes.string,
59
+ time: PropTypes.oneOfType( [ PropTypes.string, PropTypes.date ] ),
60
60
  timeOnly: PropTypes.bool,
61
61
  relativeTime: PropTypes.bool,
62
62
  className: PropTypes.any,
@@ -16,25 +16,19 @@ const VerticalLine = () => {
16
16
  borderColor: 'border',
17
17
  height: 'calc( 50% - 16px )',
18
18
  borderRadius: '2px',
19
- } }>
20
- </div>
19
+ } }
20
+ ></div>
21
21
  );
22
22
  };
23
23
 
24
24
  const Timeline = ( { time, first = false, last = false, className = null, ...props } ) => (
25
25
  <Flex className={ classNames( 'vip-timeline-component', className ) } { ...props }>
26
26
  <Flex sx={ { flexDirection: 'column', justifyContent: 'space-evenly', alignItems: 'center' } }>
27
- { ! first && (
28
- <VerticalLine />
29
- ) }
30
- <MdWatchLater aria-hidden sx={ { color: 'border' } } size={ 18 }/>
31
- { ! last && (
32
- <VerticalLine />
33
- ) }
34
- </Flex>
35
- <Flex sx={ { alignItems: 'center', ml: 2 } }>
36
- { time }
27
+ { ! first && <VerticalLine /> }
28
+ <MdWatchLater aria-hidden sx={ { color: 'border' } } size={ 18 } />
29
+ { ! last && <VerticalLine /> }
37
30
  </Flex>
31
+ <Flex sx={ { alignItems: 'center', ml: 2 } }>{ time }</Flex>
38
32
  </Flex>
39
33
  );
40
34
 
@@ -17,18 +17,9 @@ export default {
17
17
  export const Default = () => {
18
18
  return (
19
19
  <React.Fragment>
20
- <Timeline
21
- time="13:00"
22
- title="21:00 UTC"
23
- />
24
- <Timeline
25
- time={ <Link>14:00</Link> }
26
- title="22:00 UTC"
27
- />
28
- <Timeline
29
- time="15:00"
30
- title="23:00 UTC"
31
- />
20
+ <Timeline time="13:00" title="21:00 UTC" />
21
+ <Timeline time={ <Link>14:00</Link> } title="22:00 UTC" />
22
+ <Timeline time="15:00" title="23:00 UTC" />
32
23
  </React.Fragment>
33
24
  );
34
25
  };
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Internal dependencies
4
3
  */