@automattic/vip-design-system 1.2.3 → 1.3.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 (232) hide show
  1. package/.eslintignore +2 -1
  2. package/.prettierignore +1 -0
  3. package/.storybook/decorators/withBoundingBox.tsx +30 -4
  4. package/.storybook/decorators/withColorMode.tsx +5 -5
  5. package/CONTRIBUTING.md +1 -1
  6. package/build/system/Accordion/Accordion.js +6 -6
  7. package/build/system/Accordion/Accordion.stories.js +1 -1
  8. package/build/system/Accordion/Accordion.test.js +7 -5
  9. package/build/system/Avatar/Avatar.js +3 -2
  10. package/build/system/Badge/Badge.js +1 -0
  11. package/build/system/Button/Button.d.ts +11 -0
  12. package/build/system/Button/Button.js +12 -1
  13. package/build/system/Button/Button.stories.d.ts +2 -1
  14. package/build/system/Button/Button.stories.js +1 -2
  15. package/build/system/Button/Button.test.js +72 -45
  16. package/build/system/Button/ButtonSubmit.d.ts +17 -1
  17. package/build/system/Button/ButtonSubmit.js +58 -65
  18. package/build/system/Button/ButtonSubmit.stories.d.ts +17 -37
  19. package/build/system/Button/ButtonSubmit.stories.js +52 -0
  20. package/build/system/Button/ButtonSubmit.test.js +55 -35
  21. package/build/system/Button/index.d.ts +7 -3
  22. package/build/system/Button/index.js +8 -7
  23. package/build/system/Dropdown/DropdownContent.js +1 -1
  24. package/build/system/Dropdown/DropdownItem.js +1 -1
  25. package/build/system/Dropdown/DropdownLabel.js +1 -1
  26. package/build/system/Form/Checkbox.d.ts +9 -9
  27. package/build/system/Form/Checkbox.js +56 -61
  28. package/build/system/Form/Checkbox.stories.d.ts +6 -6
  29. package/build/system/Form/Checkbox.stories.js +71 -0
  30. package/build/system/Form/Input.d.ts +14 -1
  31. package/build/system/Form/Input.js +59 -72
  32. package/build/system/Form/Input.stories.d.ts +6 -4
  33. package/build/system/Form/Input.stories.js +53 -0
  34. package/build/system/Form/Input.styles.d.ts +23 -14
  35. package/build/system/Form/Input.styles.js +40 -28
  36. package/build/system/Form/InputWithCopyButton.stories.jsx +7 -0
  37. package/build/system/Form/Label.d.ts +19 -8
  38. package/build/system/Form/Label.js +39 -43
  39. package/build/system/Form/Label.stories.d.ts +7 -5
  40. package/build/system/Form/Label.stories.js +32 -0
  41. package/build/system/Form/Radio.js +4 -4
  42. package/build/system/Form/Radio.stories.jsx +1 -1
  43. package/build/system/Form/RadioBoxGroup.js +1 -1
  44. package/build/system/Form/RequiredLabel.d.ts +2 -1
  45. package/build/system/Form/RequiredLabel.js +16 -7
  46. package/build/system/Form/Toggle.js +2 -2
  47. package/build/system/Form/Validation.d.ts +8 -13
  48. package/build/system/Form/Validation.js +39 -35
  49. package/build/system/Heading/Heading.stories.js +3 -0
  50. package/build/system/Link/Link.js +1 -1
  51. package/build/system/NewDialog/DialogClose.js +2 -2
  52. package/build/system/NewDialog/DialogContent.js +3 -3
  53. package/build/system/NewDialog/DialogTitle.js +3 -1
  54. package/build/system/NewDialog/NewDialog.stories.d.ts +0 -1
  55. package/build/system/NewDialog/NewDialog.stories.jsx +0 -27
  56. package/build/system/NewForm/Fieldset.d.ts +12 -1
  57. package/build/system/NewForm/Fieldset.js +38 -40
  58. package/build/system/NewForm/Form.d.ts +8 -1
  59. package/build/system/NewForm/Form.js +24 -23
  60. package/build/system/NewForm/FormAutocomplete.css +0 -11
  61. package/build/system/NewForm/FormAutocomplete.js +8 -8
  62. package/build/system/NewForm/FormAutocomplete.stories.jsx +1 -3
  63. package/build/system/NewForm/FormAutocompleteMultiselect.js +10 -10
  64. package/build/system/NewForm/FormSelect.js +1 -1
  65. package/build/system/NewForm/FormSelectArrow.js +1 -1
  66. package/build/system/NewForm/FormSelectInline.js +1 -1
  67. package/build/system/NewForm/FormSelectLoading.js +1 -1
  68. package/build/system/NewForm/FormSelectSearch.js +2 -2
  69. package/build/system/NewForm/Legend.d.ts +12 -1
  70. package/build/system/NewForm/Legend.js +32 -34
  71. package/build/system/NewForm/index.d.ts +1 -1
  72. package/build/system/OptionRow/OptionRow.js +1 -1
  73. package/build/system/Progress/Progress.d.ts +9 -2
  74. package/build/system/Progress/Progress.js +75 -70
  75. package/build/system/Progress/Progress.stories.d.ts +9 -7
  76. package/build/system/Progress/Progress.stories.js +34 -0
  77. package/build/system/Progress/Progress.test.d.ts +1 -0
  78. package/build/system/Progress/Progress.test.js +65 -0
  79. package/build/system/Progress/index.d.ts +4 -2
  80. package/build/system/Progress/index.js +5 -5
  81. package/build/system/ScreenReaderText/ScreenReaderText.js +1 -2
  82. package/build/system/Tabs/TabsTrigger.js +0 -1
  83. package/build/system/Text/Text.js +1 -1
  84. package/build/system/Text/Text.stories.js +36 -0
  85. package/build/system/Tooltip/Tooltip.css +6 -2
  86. package/build/system/Tooltip/Tooltip.stories.js +2 -2
  87. package/build/system/Wizard/Wizard.d.ts +14 -1
  88. package/build/system/Wizard/Wizard.js +62 -93
  89. package/build/system/Wizard/Wizard.stories.d.ts +11 -8
  90. package/build/system/Wizard/Wizard.stories.js +167 -0
  91. package/build/system/Wizard/WizardStep.d.ts +24 -1
  92. package/build/system/Wizard/WizardStep.js +180 -190
  93. package/build/system/Wizard/index.d.ts +4 -2
  94. package/build/system/Wizard/index.js +6 -7
  95. package/build/system/index.d.ts +2 -2
  96. package/build/system/index.js +2 -1
  97. package/build/system/theme/generated/valet-theme-dark.json +1219 -476
  98. package/build/system/theme/generated/valet-theme-light.json +1217 -474
  99. package/build/system/theme/{getColor.d.ts → getPropValue.d.ts} +2 -1
  100. package/{src/system/theme/getColor.js → build/system/theme/getPropValue.js} +36 -4
  101. package/build/system/theme/index.d.ts +20 -65
  102. package/build/system/theme/index.js +27 -57
  103. package/package.json +4 -4
  104. package/src/system/Accordion/Accordion.stories.tsx +1 -1
  105. package/src/system/Accordion/Accordion.test.tsx +3 -0
  106. package/src/system/Accordion/Accordion.tsx +6 -6
  107. package/src/system/Avatar/Avatar.tsx +3 -3
  108. package/src/system/Badge/Badge.tsx +1 -1
  109. package/src/system/Button/Button.stories.tsx +2 -3
  110. package/src/system/Button/{Button.test.js → Button.test.tsx} +2 -2
  111. package/src/system/Button/Button.tsx +12 -0
  112. package/src/system/Button/ButtonSubmit.stories.tsx +31 -0
  113. package/src/system/Button/{ButtonSubmit.test.js → ButtonSubmit.test.tsx} +4 -4
  114. package/src/system/Button/{ButtonSubmit.js → ButtonSubmit.tsx} +21 -27
  115. package/src/system/Button/index.ts +8 -0
  116. package/src/system/Dropdown/DropdownContent.js +1 -1
  117. package/src/system/Dropdown/DropdownItem.js +1 -1
  118. package/src/system/Dropdown/DropdownLabel.js +1 -1
  119. package/src/system/Form/{Checkbox.stories.jsx → Checkbox.stories.tsx} +3 -2
  120. package/src/system/Form/{Checkbox.js → Checkbox.tsx} +6 -10
  121. package/src/system/Form/{Input.stories.jsx → Input.stories.tsx} +1 -0
  122. package/src/system/Form/{Input.styles.js → Input.styles.ts} +14 -5
  123. package/src/system/Form/{Input.js → Input.tsx} +10 -19
  124. package/src/system/Form/InputWithCopyButton.stories.jsx +7 -0
  125. package/src/system/Form/{Label.js → Label.tsx} +8 -13
  126. package/src/system/Form/Radio.js +4 -4
  127. package/src/system/Form/Radio.stories.jsx +1 -1
  128. package/src/system/Form/RadioBoxGroup.js +1 -1
  129. package/src/system/Form/{RequiredLabel.js → RequiredLabel.tsx} +1 -3
  130. package/src/system/Form/Toggle.js +2 -2
  131. package/src/system/Form/{Validation.js → Validation.tsx} +11 -12
  132. package/src/system/Heading/Heading.stories.tsx +1 -0
  133. package/src/system/Link/Link.tsx +1 -1
  134. package/src/system/NewDialog/DialogClose.js +2 -2
  135. package/src/system/NewDialog/DialogContent.js +3 -3
  136. package/src/system/NewDialog/DialogTitle.js +3 -1
  137. package/src/system/NewDialog/NewDialog.stories.jsx +0 -27
  138. package/src/system/NewForm/Fieldset.tsx +46 -0
  139. package/src/system/NewForm/Form.tsx +23 -0
  140. package/src/system/NewForm/FormAutocomplete.css +0 -11
  141. package/src/system/NewForm/FormAutocomplete.js +8 -8
  142. package/src/system/NewForm/FormAutocomplete.stories.jsx +1 -3
  143. package/src/system/NewForm/FormAutocompleteMultiselect.js +10 -10
  144. package/src/system/NewForm/FormSelect.js +1 -1
  145. package/src/system/NewForm/FormSelectArrow.js +1 -1
  146. package/src/system/NewForm/FormSelectInline.js +1 -1
  147. package/src/system/NewForm/FormSelectLoading.js +1 -1
  148. package/src/system/NewForm/FormSelectSearch.js +2 -2
  149. package/src/system/NewForm/Legend.tsx +40 -0
  150. package/src/system/OptionRow/OptionRow.js +1 -1
  151. package/src/system/Progress/Progress.test.tsx +33 -0
  152. package/src/system/Progress/{Progress.js → Progress.tsx} +16 -19
  153. package/src/system/Progress/index.ts +4 -0
  154. package/src/system/ScreenReaderText/ScreenReaderText.tsx +0 -2
  155. package/src/system/Tabs/TabsTrigger.js +0 -1
  156. package/src/system/Text/Text.stories.tsx +7 -0
  157. package/src/system/Text/Text.tsx +1 -1
  158. package/src/system/Tooltip/Tooltip.css +6 -2
  159. package/src/system/Tooltip/Tooltip.stories.tsx +4 -4
  160. package/{build/system/Wizard/Wizard.stories.jsx → src/system/Wizard/Wizard.stories.tsx} +18 -23
  161. package/src/system/Wizard/Wizard.tsx +62 -0
  162. package/src/system/Wizard/{WizardStep.js → WizardStep.tsx} +38 -41
  163. package/src/system/Wizard/index.ts +7 -0
  164. package/src/system/index.js +2 -1
  165. package/src/system/theme/generated/valet-theme-dark.json +1219 -476
  166. package/src/system/theme/generated/valet-theme-light.json +1217 -474
  167. package/{build/system/theme/getColor.js → src/system/theme/getPropValue.js} +36 -4
  168. package/src/system/theme/index.js +27 -57
  169. package/tokens/utilities/colors/color output/blue.json +305 -0
  170. package/tokens/utilities/colors/color output/gold.json +305 -0
  171. package/tokens/utilities/colors/color output/gray.json +305 -0
  172. package/tokens/utilities/colors/color output/green.json +305 -0
  173. package/tokens/utilities/colors/color output/orange.json +305 -0
  174. package/tokens/utilities/colors/color output/pink.json +305 -0
  175. package/tokens/utilities/colors/color output/red.json +305 -0
  176. package/tokens/utilities/colors/color output/salmon.json +305 -0
  177. package/tokens/utilities/colors/color output/yellow.json +305 -0
  178. package/tokens/utilities/colors/colorOutput.json +4062 -0
  179. package/tokens/utilities/colors/color_3d_plot.js +43 -0
  180. package/tokens/utilities/colors/color_graph.js +31 -0
  181. package/tokens/utilities/colors/colors.json +1981 -0
  182. package/tokens/utilities/colors/index.js +118 -0
  183. package/tokens/utilities/colors/package-lock.json +6749 -0
  184. package/tokens/utilities/colors/package.json +21 -0
  185. package/tokens/utilities/figma-type-calculator/responsive-type.js +98 -0
  186. package/tokens/valet-core/$metadata.json +19 -15
  187. package/tokens/valet-core/$themes.json +3323 -419
  188. package/tokens/valet-core/{figma-parsely-expressive-type.json → figma-parsely-web-type.json} +128 -128
  189. package/tokens/valet-core/{figma-valet-expressive-type.json → figma-valet-web-type.json} +126 -126
  190. package/tokens/valet-core/figma-wpvip-services-web-type.json +1267 -0
  191. package/tokens/valet-core/{figma-wpvip-expressive-type.json → figma-wpvip-web-type.json} +162 -162
  192. package/tokens/valet-core/{parsely-expressive-color.json → parsely-web-color.json} +1 -1
  193. package/tokens/valet-core/{wpvip-expressive-core.json → parsely-web-core.json} +73 -23
  194. package/tokens/valet-core/{parsely-expressive-type.json → parsely-web-type.json} +21 -9
  195. package/tokens/valet-core/valet-core.json +331 -232
  196. package/tokens/valet-core/{valet-expressive-color.json → valet-web-color.json} +1 -1
  197. package/tokens/valet-core/{parsely-expressive-core.json → valet-web-core.json} +72 -22
  198. package/tokens/valet-core/{wpvip-productive-color.json → wpvip-product-core.json} +663 -7
  199. package/tokens/valet-core/{wpvip-productive-color-dark.json → wpvip-product-dark.json} +332 -10
  200. package/tokens/valet-core/{wpvip-expressive-color.json → wpvip-services-web-color.json} +1 -1
  201. package/tokens/valet-core/{valet-expressive-core.json → wpvip-services-web-core.json} +72 -22
  202. package/tokens/valet-core/wpvip-services-web-type.json +412 -0
  203. package/tokens/valet-core/{wpvip-expressive-color-dark.json → wpvip-web-color-dark.json} +1 -1
  204. package/tokens/valet-core/wpvip-web-color.json +730 -0
  205. package/tokens/valet-core/{wpvip-expressive-type.json → wpvip-web-type.json} +24 -12
  206. package/tokens/valet-core/wpvip-web.json +1310 -0
  207. package/tsconfig.json +2 -1
  208. package/build/system/Button/ButtonSubmit.stories.jsx +0 -40
  209. package/build/system/Button/variants.d.ts +0 -2
  210. package/build/system/Button/variants.js +0 -1
  211. package/build/system/Form/Checkbox.stories.jsx +0 -54
  212. package/build/system/Form/Input.stories.jsx +0 -38
  213. package/build/system/Wizard/WizardStepHorizontal.d.ts +0 -2
  214. package/build/system/Wizard/WizardStepHorizontal.js +0 -55
  215. package/build/system/theme/textStyles.d.ts +0 -71
  216. package/build/system/theme/textStyles.js +0 -46
  217. package/src/system/Button/ButtonSubmit.stories.jsx +0 -40
  218. package/src/system/Button/index.js +0 -8
  219. package/src/system/Button/variants.js +0 -1
  220. package/src/system/Form/Label.stories.jsx +0 -36
  221. package/src/system/NewForm/Fieldset.js +0 -47
  222. package/src/system/NewForm/Form.js +0 -26
  223. package/src/system/NewForm/Legend.js +0 -41
  224. package/src/system/Progress/Progress.stories.jsx +0 -25
  225. package/src/system/Progress/index.js +0 -6
  226. package/src/system/Wizard/Wizard.js +0 -103
  227. package/src/system/Wizard/Wizard.stories.jsx +0 -145
  228. package/src/system/Wizard/WizardStepHorizontal.js +0 -55
  229. package/src/system/Wizard/index.js +0 -8
  230. package/src/system/theme/textStyles.js +0 -46
  231. /package/{build/system/Form/Label.stories.jsx → src/system/Form/Label.stories.tsx} +0 -0
  232. /package/{build/system/Progress/Progress.stories.jsx → src/system/Progress/Progress.stories.tsx} +0 -0
package/tsconfig.json CHANGED
@@ -9,7 +9,8 @@
9
9
  "noEmit": true,
10
10
  // Disallow features that require cross-file information for emit.
11
11
  "isolatedModules": true,
12
-
12
+ // Allow to import *.json files
13
+ "resolveJsonModule": true,
13
14
  "allowSyntheticDefaultImports": true,
14
15
  "baseUrl": ".",
15
16
  "jsx": "react-jsx",
@@ -1,40 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import { ButtonSubmit } from '..';
10
- import variants from './variants';
11
-
12
- export default {
13
- title: 'ButtonSubmit',
14
- component: ButtonSubmit,
15
- argTypes: {
16
- loading: {
17
- control: { type: 'boolean', defaultValue: true },
18
- },
19
- disabled: {
20
- control: { type: 'boolean' },
21
- },
22
- show: {
23
- control: { type: 'boolean', default: true },
24
- },
25
- variant: {
26
- type: 'select',
27
- options: variants,
28
- },
29
- },
30
- };
31
-
32
- const Template = args => (
33
- <React.Fragment>
34
- { variants.map( v => (
35
- <ButtonSubmit sx={ { m: 3 } } key={ v } variant={ v } { ...args } label="Loading…" />
36
- ) ) }
37
- </React.Fragment>
38
- );
39
-
40
- export const Default = Template.bind( {} );
@@ -1,2 +0,0 @@
1
- declare const _default: string[];
2
- export default _default;
@@ -1 +0,0 @@
1
- export default [ 'primary', 'secondary', 'text', 'icon', 'tertiary', 'ghost', 'danger', 'display' ];
@@ -1,54 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { useState } from 'react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import { Form } from '..';
10
- import { Checkbox } from './Checkbox';
11
- import { Label } from './Label';
12
- import { Flex } from '../Flex';
13
-
14
- export default {
15
- title: 'Form/Checkbox',
16
- component: Checkbox,
17
- };
18
-
19
- export const Default = () => {
20
- const [ checked, setChecked ] = useState( true );
21
- const [ checked2, setChecked2 ] = useState( false );
22
-
23
- return (
24
- <Form.Root>
25
- <Form.Fieldset>
26
- <Form.Legend>Tell me your prefereces</Form.Legend>
27
-
28
- <Flex sx={ { alignItems: 'center' } }>
29
- <Checkbox
30
- id="check1"
31
- checked={ checked }
32
- aria-labelledby="label-check1"
33
- onCheckedChange={ setChecked }
34
- />
35
- <Label sx={ { m: 0, ml: 2 } } htmlFor="check1" id="label-check1">
36
- This option
37
- </Label>
38
- </Flex>
39
-
40
- <Flex sx={ { alignItems: 'center' } }>
41
- <Checkbox
42
- id="check2"
43
- checked={ checked2 }
44
- aria-labelledby="label-check2"
45
- onCheckedChange={ setChecked2 }
46
- />
47
- <Label sx={ { m: 0, ml: 2 } } htmlFor="check2" id="label-check2">
48
- This option too
49
- </Label>
50
- </Flex>
51
- </Form.Fieldset>
52
- </Form.Root>
53
- );
54
- };
@@ -1,38 +0,0 @@
1
- /** @jsxImportSource theme-ui */
2
-
3
- /**
4
- * Internal dependencies
5
- */
6
- import { Form } from '..';
7
-
8
- export default {
9
- title: 'Form/Input',
10
- };
11
-
12
- export const Default = () => (
13
- <Form.Root>
14
- <Form.Input
15
- placeholder="Your input here..."
16
- label="Always add a label to inputs"
17
- forLabel="input-simple"
18
- />
19
-
20
- <hr sx={ { my: 4 } } />
21
-
22
- <Form.Input
23
- forLabel="input-with-error"
24
- label="Error Input"
25
- errorMessage="Please type numeric characters only"
26
- hasError
27
- />
28
-
29
- <hr sx={ { my: 4 } } />
30
-
31
- <Form.Input forLabel="input-with-required" label="Required" required />
32
-
33
- <hr sx={ { my: 4 } } />
34
-
35
- <Form.Label htmlFor="input-with-custom-label">Custom Label outside the Input</Form.Label>
36
- <Form.Input forLabel="input-with-custom-label" required />
37
- </Form.Root>
38
- );
@@ -1,2 +0,0 @@
1
- export const WizardStepHorizontal: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
- import React from 'react';
@@ -1,55 +0,0 @@
1
- /** @jsxImportSource theme-ui */
2
-
3
- /**
4
- * External dependencies
5
- */
6
- import React from 'react';
7
- import { MdCheckCircle } from 'react-icons/md';
8
- import PropTypes from 'prop-types';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { Heading, Flex } from '..';
14
-
15
- const WizardStepHorizontal = React.forwardRef(
16
- ( { title, active, order, titleVariant = 'h3' }, forwardRef ) => {
17
- const color = active ? 'heading' : 'muted';
18
-
19
- return typeof title === 'string' ? (
20
- <Heading
21
- variant={ titleVariant }
22
- sx={ {
23
- mb: 0,
24
- display: 'flex',
25
- alignItems: 'center',
26
- fontSize: 2,
27
- color,
28
- } }
29
- data-step={ order }
30
- data-active={ active || undefined }
31
- ref={ forwardRef }
32
- >
33
- <MdCheckCircle aria-hidden="true" sx={ { mr: 2 } } />
34
- { title }
35
- </Heading>
36
- ) : (
37
- <Flex sx={ { alignItems: 'center', color } }>
38
- <MdCheckCircle aria-hidden="true" sx={ { mr: 2 } } />
39
- { title }
40
- </Flex>
41
- );
42
- }
43
- );
44
-
45
- WizardStepHorizontal.displayName = 'WizardStepHorizontal';
46
-
47
- WizardStepHorizontal.propTypes = {
48
- active: PropTypes.bool,
49
- order: PropTypes.number.isRequired,
50
- subTitle: PropTypes.node,
51
- title: PropTypes.node,
52
- titleVariant: PropTypes.string,
53
- };
54
-
55
- export { WizardStepHorizontal };
@@ -1,71 +0,0 @@
1
- export namespace textStyles {
2
- namespace h1 {
3
- let fontSize: number;
4
- let marginBottom: number;
5
- let letterSpacing: string;
6
- let fontWeight: string;
7
- let fontFamily: string;
8
- let color: string;
9
- }
10
- namespace h2 {
11
- let fontSize_1: number;
12
- export { fontSize_1 as fontSize };
13
- let marginBottom_1: number;
14
- export { marginBottom_1 as marginBottom };
15
- let letterSpacing_1: string;
16
- export { letterSpacing_1 as letterSpacing };
17
- let fontWeight_1: number;
18
- export { fontWeight_1 as fontWeight };
19
- let color_1: string;
20
- export { color_1 as color };
21
- }
22
- namespace h3 {
23
- let fontSize_2: number;
24
- export { fontSize_2 as fontSize };
25
- let marginBottom_2: number;
26
- export { marginBottom_2 as marginBottom };
27
- let letterSpacing_2: string;
28
- export { letterSpacing_2 as letterSpacing };
29
- export let lineHeight: number;
30
- let fontWeight_2: string;
31
- export { fontWeight_2 as fontWeight };
32
- let color_2: string;
33
- export { color_2 as color };
34
- }
35
- namespace h4 {
36
- let fontSize_3: number;
37
- export { fontSize_3 as fontSize };
38
- let marginBottom_3: number;
39
- export { marginBottom_3 as marginBottom };
40
- let lineHeight_1: number;
41
- export { lineHeight_1 as lineHeight };
42
- let fontWeight_3: string;
43
- export { fontWeight_3 as fontWeight };
44
- let color_3: string;
45
- export { color_3 as color };
46
- }
47
- namespace h5 {
48
- let fontSize_4: number;
49
- export { fontSize_4 as fontSize };
50
- let marginBottom_4: number;
51
- export { marginBottom_4 as marginBottom };
52
- let lineHeight_2: number;
53
- export { lineHeight_2 as lineHeight };
54
- let fontWeight_4: string;
55
- export { fontWeight_4 as fontWeight };
56
- let color_4: string;
57
- export { color_4 as color };
58
- }
59
- namespace caps {
60
- let fontSize_5: number;
61
- export { fontSize_5 as fontSize };
62
- let marginBottom_5: number;
63
- export { marginBottom_5 as marginBottom };
64
- let color_5: string;
65
- export { color_5 as color };
66
- let fontWeight_5: string;
67
- export { fontWeight_5 as fontWeight };
68
- let letterSpacing_3: string;
69
- export { letterSpacing_3 as letterSpacing };
70
- }
71
- }
@@ -1,46 +0,0 @@
1
- export const textStyles = {
2
- h1: {
3
- fontSize: 5,
4
- marginBottom: 3,
5
- letterSpacing: '-.02em',
6
- fontWeight: 'body',
7
- fontFamily: 'serif',
8
- color: 'heading',
9
- },
10
- h2: {
11
- fontSize: 4,
12
- marginBottom: 2,
13
- letterSpacing: '-.005em',
14
- fontWeight: 400,
15
- color: 'heading',
16
- },
17
- h3: {
18
- fontSize: 3,
19
- marginBottom: 3,
20
- letterSpacing: '-.005em',
21
- lineHeight: 1.4,
22
- fontWeight: 'heading',
23
- color: 'heading',
24
- },
25
- h4: {
26
- fontSize: 2,
27
- marginBottom: 1,
28
- lineHeight: 1.5,
29
- fontWeight: 'heading',
30
- color: 'heading',
31
- },
32
- h5: {
33
- fontSize: 1,
34
- marginBottom: 1,
35
- lineHeight: 1.5,
36
- fontWeight: 'heading',
37
- color: 'heading',
38
- },
39
- caps: {
40
- fontSize: 1,
41
- marginBottom: 2,
42
- color: 'muted',
43
- fontWeight: 'bold',
44
- letterSpacing: '.05em',
45
- },
46
- };
@@ -1,40 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import { ButtonSubmit } from '..';
10
- import variants from './variants';
11
-
12
- export default {
13
- title: 'ButtonSubmit',
14
- component: ButtonSubmit,
15
- argTypes: {
16
- loading: {
17
- control: { type: 'boolean', defaultValue: true },
18
- },
19
- disabled: {
20
- control: { type: 'boolean' },
21
- },
22
- show: {
23
- control: { type: 'boolean', default: true },
24
- },
25
- variant: {
26
- type: 'select',
27
- options: variants,
28
- },
29
- },
30
- };
31
-
32
- const Template = args => (
33
- <React.Fragment>
34
- { variants.map( v => (
35
- <ButtonSubmit sx={ { m: 3 } } key={ v } variant={ v } { ...args } label="Loading…" />
36
- ) ) }
37
- </React.Fragment>
38
- );
39
-
40
- export const Default = Template.bind( {} );
@@ -1,8 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
-
5
- import { Button } from './Button';
6
- import { ButtonSubmit } from './ButtonSubmit';
7
-
8
- export { Button, ButtonSubmit };
@@ -1 +0,0 @@
1
- export default [ 'primary', 'secondary', 'text', 'icon', 'tertiary', 'ghost', 'danger', 'display' ];
@@ -1,36 +0,0 @@
1
- /** @jsxImportSource theme-ui */
2
-
3
- /**
4
- * Internal dependencies
5
- */
6
- import { Form, Label } from '..';
7
-
8
- export default {
9
- title: 'Form/Label',
10
- };
11
-
12
- const DefaultComponent = props => (
13
- <Form.Root>
14
- <Label { ...props }>Label</Label>
15
- </Form.Root>
16
- );
17
-
18
- export const Default = () => {
19
- return (
20
- <>
21
- <DefaultComponent />
22
- </>
23
- );
24
- };
25
-
26
- export const Required = () => {
27
- const args = {
28
- required: true,
29
- };
30
-
31
- return (
32
- <>
33
- <DefaultComponent { ...args } />
34
- </>
35
- );
36
- };
@@ -1,47 +0,0 @@
1
- /** @jsxImportSource theme-ui */
2
-
3
- /**
4
- * External dependencies
5
- */
6
- import React from 'react';
7
- import PropTypes from 'prop-types';
8
- import classNames from 'classnames';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
-
14
- import { baseControlBorderStyle, inputBaseBackground, inputBaseText } from '../Form/Input.styles';
15
-
16
- const Fieldset = React.forwardRef( ( { children, className, sx = {}, ...props }, forwardRef ) => (
17
- <fieldset
18
- ref={ forwardRef }
19
- className={ classNames( 'vip-form-fieldset-component', className ) }
20
- sx={ {
21
- all: 'unset',
22
- ...baseControlBorderStyle,
23
- backgroundColor: inputBaseBackground,
24
- color: inputBaseText,
25
- borderRadius: 1,
26
- display: 'block',
27
- pt: 1,
28
- pb: 2,
29
- px: 3,
30
- mb: 3,
31
- ...sx,
32
- } }
33
- { ...props }
34
- >
35
- { children }
36
- </fieldset>
37
- ) );
38
-
39
- Fieldset.propTypes = {
40
- children: PropTypes.any,
41
- sx: PropTypes.any,
42
- className: PropTypes.any,
43
- };
44
-
45
- Fieldset.displayName = 'Fieldset';
46
-
47
- export { Fieldset };
@@ -1,26 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import React from 'react';
5
- import PropTypes from 'prop-types';
6
- import classNames from 'classnames';
7
-
8
- const Form = React.forwardRef( ( { children, className, ...props }, forwardRef ) => (
9
- <form
10
- ref={ forwardRef }
11
- className={ classNames( 'vip-form-component', className ) }
12
- noValidate
13
- { ...props }
14
- >
15
- { children }
16
- </form>
17
- ) );
18
-
19
- Form.propTypes = {
20
- children: PropTypes.any,
21
- className: PropTypes.any,
22
- };
23
-
24
- Form.displayName = 'Form';
25
-
26
- export { Form };
@@ -1,41 +0,0 @@
1
- /** @jsxImportSource theme-ui */
2
-
3
- /**
4
- * External dependencies
5
- */
6
- import React from 'react';
7
- import PropTypes from 'prop-types';
8
- import classNames from 'classnames';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
-
14
- import { baseLabelStyle } from '../Form/Label';
15
-
16
- const Legend = React.forwardRef( ( { children, className, sx = {}, ...props }, forwardRef ) => (
17
- <legend
18
- ref={ forwardRef }
19
- className={ classNames( 'vip-form-legend-component', className ) }
20
- sx={ {
21
- all: 'unset',
22
- ...baseLabelStyle,
23
- px: 1,
24
- mb: 0,
25
- ...sx,
26
- } }
27
- { ...props }
28
- >
29
- { children }
30
- </legend>
31
- ) );
32
-
33
- Legend.propTypes = {
34
- children: PropTypes.any,
35
- sx: PropTypes.any,
36
- className: PropTypes.any,
37
- };
38
-
39
- Legend.displayName = 'Legend';
40
-
41
- export { Legend };
@@ -1,25 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import React, { useEffect } from 'react';
5
- import { Progress } from '..';
6
-
7
- export default {
8
- title: 'Progress',
9
- component: Progress,
10
- };
11
-
12
- export const Default = () => {
13
- const [ counter, setCounter ] = React.useState( 0 );
14
- const steps = [ 'Downloading Data', 'Importing Data...', 'Finalizing', 'Done' ];
15
-
16
- useEffect( () => {
17
- setTimeout( () => {
18
- if ( counter < steps.length - 1 ) {
19
- setCounter( counter + 1 );
20
- }
21
- }, 2000 );
22
- }, [ counter, setCounter ] );
23
-
24
- return <Progress forLabel="Update site progress" steps={ steps } activeStep={ counter } />;
25
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { Progress } from './Progress';
5
-
6
- export { Progress };
@@ -1,103 +0,0 @@
1
- /** @jsxImportSource theme-ui */
2
-
3
- /**
4
- * External dependencies
5
- */
6
- import React, { useLayoutEffect, useState } from 'react';
7
- import PropTypes from 'prop-types';
8
- import classNames from 'classnames';
9
- import { MdArrowForward } from 'react-icons/md';
10
-
11
- /**
12
- * Internal dependencies
13
- */
14
- import { Box, WizardStep, Flex, WizardStepHorizontal } from '..';
15
-
16
- const Wizard = React.forwardRef(
17
- (
18
- {
19
- steps,
20
- activeStep,
21
- variant,
22
- completed = [],
23
- skipped = [],
24
- className = null,
25
- titleAutofocus = false,
26
- ...props
27
- },
28
- forwardRef
29
- ) => {
30
- const [ didMount, setDidMount ] = useState( false );
31
- const [ initialStep ] = useState( activeStep );
32
- // didMount helps us to track the initial render, so we can focus the title only subsequent renders
33
- // to avoid stealing the focus from the page we're in.
34
- useLayoutEffect( () => {
35
- if ( ! didMount && activeStep !== initialStep ) {
36
- setDidMount( true );
37
- }
38
- }, [ initialStep, activeStep, didMount, setDidMount ] );
39
- return (
40
- <Box className={ classNames( 'vip-wizard-component', className ) } ref={ forwardRef }>
41
- { variant === 'horizontal' ? (
42
- <Box>
43
- <Flex
44
- sx={ {
45
- flex: '0 0 auto',
46
- } }
47
- { ...props }
48
- >
49
- { steps.map( ( { title, subTitle, titleVariant }, index ) => (
50
- <React.Fragment key={ index }>
51
- <WizardStepHorizontal
52
- active={ index === activeStep }
53
- order={ index + 1 }
54
- subTitle={ subTitle }
55
- title={ title }
56
- titleVariant={ titleVariant }
57
- />
58
- { index < steps.length - 1 && (
59
- <MdArrowForward sx={ { mx: 2, color: 'gray.80' } } />
60
- ) }
61
- </React.Fragment>
62
- ) ) }
63
- </Flex>
64
- { steps[ activeStep ].children }
65
- </Box>
66
- ) : (
67
- steps.map( ( { title, subTitle, children, titleVariant, summary, onChange }, index ) => (
68
- <WizardStep
69
- active={ index === activeStep }
70
- complete={ completed.includes( index ) }
71
- skipped={ skipped.includes( index ) }
72
- key={ index }
73
- order={ index + 1 }
74
- totalSteps={ steps.length }
75
- subTitle={ subTitle }
76
- title={ title }
77
- titleVariant={ titleVariant }
78
- summary={ summary }
79
- onChange={ onChange }
80
- shouldFocusTitle={ titleAutofocus && didMount }
81
- >
82
- { children }
83
- </WizardStep>
84
- ) )
85
- ) }
86
- </Box>
87
- );
88
- }
89
- );
90
-
91
- Wizard.displayName = 'Wizard';
92
-
93
- Wizard.propTypes = {
94
- steps: PropTypes.array,
95
- activeStep: PropTypes.number,
96
- variant: PropTypes.string,
97
- completed: PropTypes.array,
98
- skipped: PropTypes.array,
99
- className: PropTypes.any,
100
- titleAutofocus: PropTypes.bool,
101
- };
102
-
103
- export { Wizard };