@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.
- package/.eslintignore +2 -1
- package/.prettierignore +1 -0
- package/.storybook/decorators/withBoundingBox.tsx +30 -4
- package/.storybook/decorators/withColorMode.tsx +5 -5
- package/CONTRIBUTING.md +1 -1
- package/build/system/Accordion/Accordion.js +6 -6
- package/build/system/Accordion/Accordion.stories.js +1 -1
- package/build/system/Accordion/Accordion.test.js +7 -5
- package/build/system/Avatar/Avatar.js +3 -2
- package/build/system/Badge/Badge.js +1 -0
- package/build/system/Button/Button.d.ts +11 -0
- package/build/system/Button/Button.js +12 -1
- package/build/system/Button/Button.stories.d.ts +2 -1
- package/build/system/Button/Button.stories.js +1 -2
- package/build/system/Button/Button.test.js +72 -45
- package/build/system/Button/ButtonSubmit.d.ts +17 -1
- package/build/system/Button/ButtonSubmit.js +58 -65
- package/build/system/Button/ButtonSubmit.stories.d.ts +17 -37
- package/build/system/Button/ButtonSubmit.stories.js +52 -0
- package/build/system/Button/ButtonSubmit.test.js +55 -35
- package/build/system/Button/index.d.ts +7 -3
- package/build/system/Button/index.js +8 -7
- package/build/system/Dropdown/DropdownContent.js +1 -1
- package/build/system/Dropdown/DropdownItem.js +1 -1
- package/build/system/Dropdown/DropdownLabel.js +1 -1
- package/build/system/Form/Checkbox.d.ts +9 -9
- package/build/system/Form/Checkbox.js +56 -61
- package/build/system/Form/Checkbox.stories.d.ts +6 -6
- package/build/system/Form/Checkbox.stories.js +71 -0
- package/build/system/Form/Input.d.ts +14 -1
- package/build/system/Form/Input.js +59 -72
- package/build/system/Form/Input.stories.d.ts +6 -4
- package/build/system/Form/Input.stories.js +53 -0
- package/build/system/Form/Input.styles.d.ts +23 -14
- package/build/system/Form/Input.styles.js +40 -28
- package/build/system/Form/InputWithCopyButton.stories.jsx +7 -0
- package/build/system/Form/Label.d.ts +19 -8
- package/build/system/Form/Label.js +39 -43
- package/build/system/Form/Label.stories.d.ts +7 -5
- package/build/system/Form/Label.stories.js +32 -0
- package/build/system/Form/Radio.js +4 -4
- package/build/system/Form/Radio.stories.jsx +1 -1
- package/build/system/Form/RadioBoxGroup.js +1 -1
- package/build/system/Form/RequiredLabel.d.ts +2 -1
- package/build/system/Form/RequiredLabel.js +16 -7
- package/build/system/Form/Toggle.js +2 -2
- package/build/system/Form/Validation.d.ts +8 -13
- package/build/system/Form/Validation.js +39 -35
- package/build/system/Heading/Heading.stories.js +3 -0
- package/build/system/Link/Link.js +1 -1
- package/build/system/NewDialog/DialogClose.js +2 -2
- package/build/system/NewDialog/DialogContent.js +3 -3
- package/build/system/NewDialog/DialogTitle.js +3 -1
- package/build/system/NewDialog/NewDialog.stories.d.ts +0 -1
- package/build/system/NewDialog/NewDialog.stories.jsx +0 -27
- package/build/system/NewForm/Fieldset.d.ts +12 -1
- package/build/system/NewForm/Fieldset.js +38 -40
- package/build/system/NewForm/Form.d.ts +8 -1
- package/build/system/NewForm/Form.js +24 -23
- package/build/system/NewForm/FormAutocomplete.css +0 -11
- package/build/system/NewForm/FormAutocomplete.js +8 -8
- package/build/system/NewForm/FormAutocomplete.stories.jsx +1 -3
- package/build/system/NewForm/FormAutocompleteMultiselect.js +10 -10
- package/build/system/NewForm/FormSelect.js +1 -1
- package/build/system/NewForm/FormSelectArrow.js +1 -1
- package/build/system/NewForm/FormSelectInline.js +1 -1
- package/build/system/NewForm/FormSelectLoading.js +1 -1
- package/build/system/NewForm/FormSelectSearch.js +2 -2
- package/build/system/NewForm/Legend.d.ts +12 -1
- package/build/system/NewForm/Legend.js +32 -34
- package/build/system/NewForm/index.d.ts +1 -1
- package/build/system/OptionRow/OptionRow.js +1 -1
- package/build/system/Progress/Progress.d.ts +9 -2
- package/build/system/Progress/Progress.js +75 -70
- package/build/system/Progress/Progress.stories.d.ts +9 -7
- package/build/system/Progress/Progress.stories.js +34 -0
- package/build/system/Progress/Progress.test.d.ts +1 -0
- package/build/system/Progress/Progress.test.js +65 -0
- package/build/system/Progress/index.d.ts +4 -2
- package/build/system/Progress/index.js +5 -5
- package/build/system/ScreenReaderText/ScreenReaderText.js +1 -2
- package/build/system/Tabs/TabsTrigger.js +0 -1
- package/build/system/Text/Text.js +1 -1
- package/build/system/Text/Text.stories.js +36 -0
- package/build/system/Tooltip/Tooltip.css +6 -2
- package/build/system/Tooltip/Tooltip.stories.js +2 -2
- package/build/system/Wizard/Wizard.d.ts +14 -1
- package/build/system/Wizard/Wizard.js +62 -93
- package/build/system/Wizard/Wizard.stories.d.ts +11 -8
- package/build/system/Wizard/Wizard.stories.js +167 -0
- package/build/system/Wizard/WizardStep.d.ts +24 -1
- package/build/system/Wizard/WizardStep.js +180 -190
- package/build/system/Wizard/index.d.ts +4 -2
- package/build/system/Wizard/index.js +6 -7
- package/build/system/index.d.ts +2 -2
- package/build/system/index.js +2 -1
- package/build/system/theme/generated/valet-theme-dark.json +1219 -476
- package/build/system/theme/generated/valet-theme-light.json +1217 -474
- package/build/system/theme/{getColor.d.ts → getPropValue.d.ts} +2 -1
- package/{src/system/theme/getColor.js → build/system/theme/getPropValue.js} +36 -4
- package/build/system/theme/index.d.ts +20 -65
- package/build/system/theme/index.js +27 -57
- package/package.json +4 -4
- package/src/system/Accordion/Accordion.stories.tsx +1 -1
- package/src/system/Accordion/Accordion.test.tsx +3 -0
- package/src/system/Accordion/Accordion.tsx +6 -6
- package/src/system/Avatar/Avatar.tsx +3 -3
- package/src/system/Badge/Badge.tsx +1 -1
- package/src/system/Button/Button.stories.tsx +2 -3
- package/src/system/Button/{Button.test.js → Button.test.tsx} +2 -2
- package/src/system/Button/Button.tsx +12 -0
- package/src/system/Button/ButtonSubmit.stories.tsx +31 -0
- package/src/system/Button/{ButtonSubmit.test.js → ButtonSubmit.test.tsx} +4 -4
- package/src/system/Button/{ButtonSubmit.js → ButtonSubmit.tsx} +21 -27
- package/src/system/Button/index.ts +8 -0
- package/src/system/Dropdown/DropdownContent.js +1 -1
- package/src/system/Dropdown/DropdownItem.js +1 -1
- package/src/system/Dropdown/DropdownLabel.js +1 -1
- package/src/system/Form/{Checkbox.stories.jsx → Checkbox.stories.tsx} +3 -2
- package/src/system/Form/{Checkbox.js → Checkbox.tsx} +6 -10
- package/src/system/Form/{Input.stories.jsx → Input.stories.tsx} +1 -0
- package/src/system/Form/{Input.styles.js → Input.styles.ts} +14 -5
- package/src/system/Form/{Input.js → Input.tsx} +10 -19
- package/src/system/Form/InputWithCopyButton.stories.jsx +7 -0
- package/src/system/Form/{Label.js → Label.tsx} +8 -13
- package/src/system/Form/Radio.js +4 -4
- package/src/system/Form/Radio.stories.jsx +1 -1
- package/src/system/Form/RadioBoxGroup.js +1 -1
- package/src/system/Form/{RequiredLabel.js → RequiredLabel.tsx} +1 -3
- package/src/system/Form/Toggle.js +2 -2
- package/src/system/Form/{Validation.js → Validation.tsx} +11 -12
- package/src/system/Heading/Heading.stories.tsx +1 -0
- package/src/system/Link/Link.tsx +1 -1
- package/src/system/NewDialog/DialogClose.js +2 -2
- package/src/system/NewDialog/DialogContent.js +3 -3
- package/src/system/NewDialog/DialogTitle.js +3 -1
- package/src/system/NewDialog/NewDialog.stories.jsx +0 -27
- package/src/system/NewForm/Fieldset.tsx +46 -0
- package/src/system/NewForm/Form.tsx +23 -0
- package/src/system/NewForm/FormAutocomplete.css +0 -11
- package/src/system/NewForm/FormAutocomplete.js +8 -8
- package/src/system/NewForm/FormAutocomplete.stories.jsx +1 -3
- package/src/system/NewForm/FormAutocompleteMultiselect.js +10 -10
- package/src/system/NewForm/FormSelect.js +1 -1
- package/src/system/NewForm/FormSelectArrow.js +1 -1
- package/src/system/NewForm/FormSelectInline.js +1 -1
- package/src/system/NewForm/FormSelectLoading.js +1 -1
- package/src/system/NewForm/FormSelectSearch.js +2 -2
- package/src/system/NewForm/Legend.tsx +40 -0
- package/src/system/OptionRow/OptionRow.js +1 -1
- package/src/system/Progress/Progress.test.tsx +33 -0
- package/src/system/Progress/{Progress.js → Progress.tsx} +16 -19
- package/src/system/Progress/index.ts +4 -0
- package/src/system/ScreenReaderText/ScreenReaderText.tsx +0 -2
- package/src/system/Tabs/TabsTrigger.js +0 -1
- package/src/system/Text/Text.stories.tsx +7 -0
- package/src/system/Text/Text.tsx +1 -1
- package/src/system/Tooltip/Tooltip.css +6 -2
- package/src/system/Tooltip/Tooltip.stories.tsx +4 -4
- package/{build/system/Wizard/Wizard.stories.jsx → src/system/Wizard/Wizard.stories.tsx} +18 -23
- package/src/system/Wizard/Wizard.tsx +62 -0
- package/src/system/Wizard/{WizardStep.js → WizardStep.tsx} +38 -41
- package/src/system/Wizard/index.ts +7 -0
- package/src/system/index.js +2 -1
- package/src/system/theme/generated/valet-theme-dark.json +1219 -476
- package/src/system/theme/generated/valet-theme-light.json +1217 -474
- package/{build/system/theme/getColor.js → src/system/theme/getPropValue.js} +36 -4
- package/src/system/theme/index.js +27 -57
- package/tokens/utilities/colors/color output/blue.json +305 -0
- package/tokens/utilities/colors/color output/gold.json +305 -0
- package/tokens/utilities/colors/color output/gray.json +305 -0
- package/tokens/utilities/colors/color output/green.json +305 -0
- package/tokens/utilities/colors/color output/orange.json +305 -0
- package/tokens/utilities/colors/color output/pink.json +305 -0
- package/tokens/utilities/colors/color output/red.json +305 -0
- package/tokens/utilities/colors/color output/salmon.json +305 -0
- package/tokens/utilities/colors/color output/yellow.json +305 -0
- package/tokens/utilities/colors/colorOutput.json +4062 -0
- package/tokens/utilities/colors/color_3d_plot.js +43 -0
- package/tokens/utilities/colors/color_graph.js +31 -0
- package/tokens/utilities/colors/colors.json +1981 -0
- package/tokens/utilities/colors/index.js +118 -0
- package/tokens/utilities/colors/package-lock.json +6749 -0
- package/tokens/utilities/colors/package.json +21 -0
- package/tokens/utilities/figma-type-calculator/responsive-type.js +98 -0
- package/tokens/valet-core/$metadata.json +19 -15
- package/tokens/valet-core/$themes.json +3323 -419
- package/tokens/valet-core/{figma-parsely-expressive-type.json → figma-parsely-web-type.json} +128 -128
- package/tokens/valet-core/{figma-valet-expressive-type.json → figma-valet-web-type.json} +126 -126
- package/tokens/valet-core/figma-wpvip-services-web-type.json +1267 -0
- package/tokens/valet-core/{figma-wpvip-expressive-type.json → figma-wpvip-web-type.json} +162 -162
- package/tokens/valet-core/{parsely-expressive-color.json → parsely-web-color.json} +1 -1
- package/tokens/valet-core/{wpvip-expressive-core.json → parsely-web-core.json} +73 -23
- package/tokens/valet-core/{parsely-expressive-type.json → parsely-web-type.json} +21 -9
- package/tokens/valet-core/valet-core.json +331 -232
- package/tokens/valet-core/{valet-expressive-color.json → valet-web-color.json} +1 -1
- package/tokens/valet-core/{parsely-expressive-core.json → valet-web-core.json} +72 -22
- package/tokens/valet-core/{wpvip-productive-color.json → wpvip-product-core.json} +663 -7
- package/tokens/valet-core/{wpvip-productive-color-dark.json → wpvip-product-dark.json} +332 -10
- package/tokens/valet-core/{wpvip-expressive-color.json → wpvip-services-web-color.json} +1 -1
- package/tokens/valet-core/{valet-expressive-core.json → wpvip-services-web-core.json} +72 -22
- package/tokens/valet-core/wpvip-services-web-type.json +412 -0
- package/tokens/valet-core/{wpvip-expressive-color-dark.json → wpvip-web-color-dark.json} +1 -1
- package/tokens/valet-core/wpvip-web-color.json +730 -0
- package/tokens/valet-core/{wpvip-expressive-type.json → wpvip-web-type.json} +24 -12
- package/tokens/valet-core/wpvip-web.json +1310 -0
- package/tsconfig.json +2 -1
- package/build/system/Button/ButtonSubmit.stories.jsx +0 -40
- package/build/system/Button/variants.d.ts +0 -2
- package/build/system/Button/variants.js +0 -1
- package/build/system/Form/Checkbox.stories.jsx +0 -54
- package/build/system/Form/Input.stories.jsx +0 -38
- package/build/system/Wizard/WizardStepHorizontal.d.ts +0 -2
- package/build/system/Wizard/WizardStepHorizontal.js +0 -55
- package/build/system/theme/textStyles.d.ts +0 -71
- package/build/system/theme/textStyles.js +0 -46
- package/src/system/Button/ButtonSubmit.stories.jsx +0 -40
- package/src/system/Button/index.js +0 -8
- package/src/system/Button/variants.js +0 -1
- package/src/system/Form/Label.stories.jsx +0 -36
- package/src/system/NewForm/Fieldset.js +0 -47
- package/src/system/NewForm/Form.js +0 -26
- package/src/system/NewForm/Legend.js +0 -41
- package/src/system/Progress/Progress.stories.jsx +0 -25
- package/src/system/Progress/index.js +0 -6
- package/src/system/Wizard/Wizard.js +0 -103
- package/src/system/Wizard/Wizard.stories.jsx +0 -145
- package/src/system/Wizard/WizardStepHorizontal.js +0 -55
- package/src/system/Wizard/index.js +0 -8
- package/src/system/theme/textStyles.js +0 -46
- /package/{build/system/Form/Label.stories.jsx → src/system/Form/Label.stories.tsx} +0 -0
- /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 +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,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 +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,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 };
|