@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
|
@@ -1,39 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.Validation = void 0;
|
|
5
|
+
var _md = require("react-icons/md");
|
|
6
|
+
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
7
|
+
var _excluded = ["children", "isValid", "describedId"];
|
|
8
|
+
/** @jsxImportSource theme-ui */
|
|
3
9
|
/**
|
|
4
10
|
* External dependencies
|
|
5
11
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export { Validation };
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
|
+
var errorColor = 'texts.error';
|
|
15
|
+
var helperColor = 'texts.helper';
|
|
16
|
+
var Validation = exports.Validation = function Validation(_ref) {
|
|
17
|
+
var children = _ref.children,
|
|
18
|
+
isValid = _ref.isValid,
|
|
19
|
+
describedId = _ref.describedId,
|
|
20
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
|
+
return (0, _jsxRuntime.jsxs)("p", _extends({
|
|
22
|
+
sx: {
|
|
23
|
+
color: isValid ? helperColor : errorColor,
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
m: 0,
|
|
27
|
+
fontSize: 1
|
|
28
|
+
},
|
|
29
|
+
id: describedId ? "describe-" + describedId + "-validation" : undefined
|
|
30
|
+
}, props, {
|
|
31
|
+
children: [isValid ? (0, _jsxRuntime.jsx)(_md.MdCheckCircle, {
|
|
32
|
+
sx: {
|
|
33
|
+
mr: 1
|
|
34
|
+
},
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
}) : (0, _jsxRuntime.jsx)(_md.MdErrorOutline, {
|
|
37
|
+
sx: {
|
|
38
|
+
mr: 1
|
|
39
|
+
},
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
}), children]
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
@@ -19,7 +19,7 @@ var Link = exports.Link = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
19
19
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
20
|
return (0, _jsxRuntime.jsx)(_themeUi.Link, _extends({
|
|
21
21
|
sx: _extends({
|
|
22
|
-
|
|
22
|
+
textDecorationThickness: '0.1em',
|
|
23
23
|
textUnderlineOffset: '0.1em',
|
|
24
24
|
color: active ? 'links.active' : 'link',
|
|
25
25
|
'&:visited': {
|
|
@@ -39,8 +39,8 @@ export const DialogCloseDefault = React.forwardRef( ( props, forwardedRef ) => (
|
|
|
39
39
|
justifyContent: 'center',
|
|
40
40
|
color: 'icon.primary',
|
|
41
41
|
position: 'absolute',
|
|
42
|
-
top:
|
|
43
|
-
right:
|
|
42
|
+
top: 3,
|
|
43
|
+
right: 3,
|
|
44
44
|
|
|
45
45
|
'&:hover': {
|
|
46
46
|
backgroundColor: 'borders.2',
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
export const contentStyles = {
|
|
4
4
|
background: 'dialog',
|
|
5
5
|
variant: 'dialog.modal',
|
|
6
|
-
borderRadius:
|
|
7
|
-
boxShadow: '
|
|
6
|
+
borderRadius: 2,
|
|
7
|
+
boxShadow: 'medium',
|
|
8
8
|
position: 'fixed',
|
|
9
9
|
top: '50%',
|
|
10
10
|
left: '50%',
|
|
@@ -12,6 +12,6 @@ export const contentStyles = {
|
|
|
12
12
|
width: '90vw',
|
|
13
13
|
maxWidth: '640px',
|
|
14
14
|
maxHeight: '85vh',
|
|
15
|
-
padding:
|
|
15
|
+
padding: 6,
|
|
16
16
|
'> h1, > h2': { marginTop: '0 !important' },
|
|
17
17
|
};
|
|
@@ -19,7 +19,9 @@ export const DialogTitle = ( { title, hidden = false } ) => {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<DialogPrimitive.Title
|
|
22
|
+
<DialogPrimitive.Title
|
|
23
|
+
sx={ { margin: 0, fontSize: 3, fontWeight: 'medium', color: 'heading' } }
|
|
24
|
+
>
|
|
23
25
|
{ titleNode }
|
|
24
26
|
</DialogPrimitive.Title>
|
|
25
27
|
);
|
|
@@ -30,7 +30,6 @@ declare namespace _default {
|
|
|
30
30
|
}
|
|
31
31
|
export default _default;
|
|
32
32
|
export function Default(): import("react").JSX.Element;
|
|
33
|
-
export function AutoOpen(): import("react").JSX.Element;
|
|
34
33
|
export function HiddenHeadings(): import("react").JSX.Element;
|
|
35
34
|
export function CustomStyling(): import("react").JSX.Element;
|
|
36
35
|
export function CustomClose(): import("react").JSX.Element;
|
|
@@ -10,7 +10,6 @@ import { useState } from 'react';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { Button, Text, Input, Label } from '../../system';
|
|
13
|
-
import ScreenReaderText from '../ScreenReaderText';
|
|
14
13
|
import * as NewDialog from '.';
|
|
15
14
|
|
|
16
15
|
export default {
|
|
@@ -33,31 +32,6 @@ export const Default = () => (
|
|
|
33
32
|
</>
|
|
34
33
|
);
|
|
35
34
|
|
|
36
|
-
export const AutoOpen = () => (
|
|
37
|
-
<>
|
|
38
|
-
<Text sx={ { fontSize: 3, mb: 3 } }>Auto Opens when rendered. Press escape to close it.</Text>
|
|
39
|
-
<NewDialog.Root
|
|
40
|
-
{ ...defaultProps }
|
|
41
|
-
defaultOpen={ true }
|
|
42
|
-
content={
|
|
43
|
-
<div>
|
|
44
|
-
<h3>Test</h3>
|
|
45
|
-
<p>
|
|
46
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
|
|
47
|
-
has been the industry standard dummy text ever since the 1500s, when an unknown printer
|
|
48
|
-
took a galley of type and scrambled it to make a type specimen book. It has survived not
|
|
49
|
-
only five centuries, but also the leap into electronic typesetting, remaining
|
|
50
|
-
essentially unchanged. It was popularised in the 1960s with the release of Letraset
|
|
51
|
-
sheets containing Lorem Ipsum passages, and more recently with desktop publishing
|
|
52
|
-
software like Aldus PageMaker including versions of Lorem Ipsum.
|
|
53
|
-
</p>
|
|
54
|
-
</div>
|
|
55
|
-
}
|
|
56
|
-
trigger={ <ScreenReaderText>hey</ScreenReaderText> }
|
|
57
|
-
/>
|
|
58
|
-
</>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
35
|
export const HiddenHeadings = () => (
|
|
62
36
|
<>
|
|
63
37
|
<Text sx={ { fontSize: 3, mb: 3 } }>
|
|
@@ -96,7 +70,6 @@ export const CustomStyling = () => (
|
|
|
96
70
|
|
|
97
71
|
<NewDialog.Root
|
|
98
72
|
{ ...defaultProps }
|
|
99
|
-
defaultOpen
|
|
100
73
|
trigger={ <Button>Trigger Dialog</Button> }
|
|
101
74
|
title="Custom dialog title"
|
|
102
75
|
style={ {
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
/**
|
|
3
|
+
* External dependencies
|
|
4
|
+
*/
|
|
2
5
|
import React from 'react';
|
|
6
|
+
import { ThemeUIStyleObject } from 'theme-ui';
|
|
7
|
+
interface FieldsetProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
sx?: ThemeUIStyleObject;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Fieldset: React.ForwardRefExoticComponent<FieldsetProps & React.RefAttributes<HTMLFieldSetElement>>;
|
|
13
|
+
export {};
|
|
@@ -1,47 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.Fieldset = void 0;
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
7
|
+
var _Input = require("../Form/Input.styles");
|
|
8
|
+
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
9
|
+
var _excluded = ["children", "className", "sx"];
|
|
10
|
+
/** @jsxImportSource theme-ui */
|
|
3
11
|
/**
|
|
4
12
|
* External dependencies
|
|
5
13
|
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import classNames from 'classnames';
|
|
9
|
-
|
|
10
14
|
/**
|
|
11
15
|
* Internal dependencies
|
|
12
16
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
className: PropTypes.any,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
Fieldset.displayName = 'Fieldset';
|
|
46
|
-
|
|
47
|
-
export { Fieldset };
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
+
var Fieldset = exports.Fieldset = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef) {
|
|
21
|
+
var children = _ref.children,
|
|
22
|
+
className = _ref.className,
|
|
23
|
+
_ref$sx = _ref.sx,
|
|
24
|
+
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
25
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
26
|
+
return (0, _jsxRuntime.jsx)("fieldset", _extends({
|
|
27
|
+
ref: forwardRef,
|
|
28
|
+
className: (0, _classnames["default"])('vip-form-fieldset-component', className),
|
|
29
|
+
sx: _extends({
|
|
30
|
+
all: 'unset'
|
|
31
|
+
}, _Input.baseControlBorderStyle, {
|
|
32
|
+
backgroundColor: _Input.inputBaseBackground,
|
|
33
|
+
color: _Input.inputBaseText,
|
|
34
|
+
borderRadius: 1,
|
|
35
|
+
display: 'block',
|
|
36
|
+
pt: 1,
|
|
37
|
+
pb: 2,
|
|
38
|
+
px: 3,
|
|
39
|
+
mb: 3
|
|
40
|
+
}, sx)
|
|
41
|
+
}, props, {
|
|
42
|
+
children: children
|
|
43
|
+
}));
|
|
44
|
+
});
|
|
45
|
+
Fieldset.displayName = 'Fieldset';
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
2
4
|
import React from 'react';
|
|
5
|
+
export interface FormProps {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<HTMLFormElement>>;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.Form = void 0;
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
7
|
+
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
8
|
+
var _excluded = ["children", "className"];
|
|
1
9
|
/**
|
|
2
10
|
* External dependencies
|
|
3
11
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
Form.
|
|
20
|
-
children: PropTypes.any,
|
|
21
|
-
className: PropTypes.any,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
Form.displayName = 'Form';
|
|
25
|
-
|
|
26
|
-
export { Form };
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
var Form = exports.Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef) {
|
|
16
|
+
var children = _ref.children,
|
|
17
|
+
className = _ref.className,
|
|
18
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
|
+
return (0, _jsxRuntime.jsx)("form", _extends({
|
|
20
|
+
ref: forwardRef,
|
|
21
|
+
className: (0, _classnames["default"])('vip-form-component', className),
|
|
22
|
+
noValidate: true
|
|
23
|
+
}, props, {
|
|
24
|
+
children: children
|
|
25
|
+
}));
|
|
26
|
+
});
|
|
27
|
+
Form.displayName = 'Form';
|
|
@@ -38,17 +38,6 @@
|
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
/* .autocomplete__dropdown-arrow-down {
|
|
42
|
-
z-index: -1;
|
|
43
|
-
display: inline-block;
|
|
44
|
-
position: absolute;
|
|
45
|
-
right: 8px;
|
|
46
|
-
width: 24px;
|
|
47
|
-
height: 24px;
|
|
48
|
-
top: 10px;
|
|
49
|
-
pointer-events: none;
|
|
50
|
-
} */
|
|
51
|
-
|
|
52
41
|
.autocomplete__menu {
|
|
53
42
|
background-color: #fff;
|
|
54
43
|
border: 2px solid #0b0c0c;
|
|
@@ -17,12 +17,12 @@ import { FormSelectArrow } from './FormSelectArrow';
|
|
|
17
17
|
import { Label } from '../Form/Label';
|
|
18
18
|
import { FormSelectSearch } from './FormSelectSearch';
|
|
19
19
|
import { FormSelectLoading } from './FormSelectLoading';
|
|
20
|
-
import { baseControlBorderStyle,
|
|
20
|
+
import { baseControlBorderStyle, inputBaseText } from '../Form/Input.styles';
|
|
21
21
|
import { Validation } from '../Form';
|
|
22
22
|
|
|
23
23
|
const baseBorderTextColors = {
|
|
24
24
|
...baseControlBorderStyle,
|
|
25
|
-
backgroundColor:
|
|
25
|
+
backgroundColor: 'layer.2',
|
|
26
26
|
color: inputBaseText,
|
|
27
27
|
borderRadius: 1,
|
|
28
28
|
};
|
|
@@ -51,7 +51,7 @@ const defaultStyles = {
|
|
|
51
51
|
'&:focus-visible': { outlineWidth: 0, boxShadow: 'none' },
|
|
52
52
|
'&:focus-within': { outlineWidth: 0, boxShadow: 'none' },
|
|
53
53
|
'&.autocomplete__input--focused': { outlineWidth: 0, boxShadow: 'none' },
|
|
54
|
-
'&.autocomplete__input--show-all-values': { paddingRight:
|
|
54
|
+
'&.autocomplete__input--show-all-values': { paddingRight: 7 },
|
|
55
55
|
},
|
|
56
56
|
'& .autocomplete__menu': {
|
|
57
57
|
...baseBorderTextColors,
|
|
@@ -66,11 +66,11 @@ const defaultStyles = {
|
|
|
66
66
|
borderColor: baseControlBorderStyle.borderColor,
|
|
67
67
|
},
|
|
68
68
|
'& .autocomplete__option--odd': {
|
|
69
|
-
bg: '
|
|
69
|
+
bg: 'layer.1',
|
|
70
70
|
},
|
|
71
71
|
'& .autocomplete__option:hover, & .autocomplete__option--focused': {
|
|
72
|
-
bg: '
|
|
73
|
-
borderColor: '
|
|
72
|
+
bg: 'input.background.primary',
|
|
73
|
+
borderColor: 'input.background.primary',
|
|
74
74
|
},
|
|
75
75
|
'& .autocomplete__input--show-all-values': {
|
|
76
76
|
paddingRight: 0,
|
|
@@ -89,7 +89,7 @@ const inlineStyles = {
|
|
|
89
89
|
|
|
90
90
|
const searchIconStyles = {
|
|
91
91
|
'& .autocomplete__input.autocomplete__input': {
|
|
92
|
-
paddingLeft:
|
|
92
|
+
paddingLeft: 6,
|
|
93
93
|
},
|
|
94
94
|
};
|
|
95
95
|
|
|
@@ -345,7 +345,7 @@ const FormAutocomplete = React.forwardRef(
|
|
|
345
345
|
{ ...props }
|
|
346
346
|
/>
|
|
347
347
|
|
|
348
|
-
{ loading && <FormSelectLoading sx={ { right: showAllValues ?
|
|
348
|
+
{ loading && <FormSelectLoading sx={ { right: showAllValues ? 7 : 3 } } /> }
|
|
349
349
|
</FormSelectContent>
|
|
350
350
|
</div>
|
|
351
351
|
|
|
@@ -151,9 +151,7 @@ WithCustomArrow.args = {
|
|
|
151
151
|
showAllValues: true,
|
|
152
152
|
// eslint-disable-next-line react/display-name
|
|
153
153
|
dropdownArrow: () => (
|
|
154
|
-
<span sx={ { position: 'absolute', top:
|
|
155
|
-
👇
|
|
156
|
-
</span>
|
|
154
|
+
<span sx={ { position: 'absolute', top: 1, right: 3, pointerEvents: 'none' } }>👇</span>
|
|
157
155
|
),
|
|
158
156
|
};
|
|
159
157
|
WithCustomArrow.displayName = 'WithCustomArrow';
|
|
@@ -16,14 +16,14 @@ import { FormSelectArrow } from './FormSelectArrow';
|
|
|
16
16
|
import { Label } from '../Form/Label';
|
|
17
17
|
import { FormSelectSearch } from './FormSelectSearch';
|
|
18
18
|
import { FormSelectLoading } from './FormSelectLoading';
|
|
19
|
-
import { baseControlBorderStyle,
|
|
19
|
+
import { baseControlBorderStyle, inputBaseText } from '../Form/Input.styles';
|
|
20
20
|
import { Validation } from '../Form';
|
|
21
21
|
import { Button, Flex } from '../';
|
|
22
22
|
import { MdClose } from 'react-icons/md';
|
|
23
23
|
|
|
24
24
|
const baseBorderTextColors = {
|
|
25
25
|
...baseControlBorderStyle,
|
|
26
|
-
backgroundColor:
|
|
26
|
+
backgroundColor: 'layer.2',
|
|
27
27
|
color: inputBaseText,
|
|
28
28
|
borderRadius: 1,
|
|
29
29
|
};
|
|
@@ -41,7 +41,7 @@ const defaultStyles = {
|
|
|
41
41
|
'&.autocomplete__input--focused': theme => theme.outline,
|
|
42
42
|
'& .autocomplete__input': {
|
|
43
43
|
width: '100%',
|
|
44
|
-
paddingLeft:
|
|
44
|
+
paddingLeft: 4,
|
|
45
45
|
py: 0,
|
|
46
46
|
borderWidth: 0,
|
|
47
47
|
color: 'text',
|
|
@@ -51,7 +51,7 @@ const defaultStyles = {
|
|
|
51
51
|
'&:focus-visible': { outlineWidth: 0, boxShadow: 'none' },
|
|
52
52
|
'&:focus-within': { outlineWidth: 0, boxShadow: 'none' },
|
|
53
53
|
'&.autocomplete__input--focused': { outlineWidth: 0, boxShadow: 'none' },
|
|
54
|
-
'&.autocomplete__input--show-all-values': { paddingRight:
|
|
54
|
+
'&.autocomplete__input--show-all-values': { paddingRight: 7 },
|
|
55
55
|
'&::placeholder': {
|
|
56
56
|
color: 'input.text.placeholder',
|
|
57
57
|
opacity: 1,
|
|
@@ -70,18 +70,18 @@ const defaultStyles = {
|
|
|
70
70
|
borderColor: baseControlBorderStyle.borderColor,
|
|
71
71
|
},
|
|
72
72
|
'& .autocomplete__option--odd': {
|
|
73
|
-
bg: '
|
|
73
|
+
bg: 'layer.1',
|
|
74
74
|
},
|
|
75
75
|
'& .autocomplete__option:hover, & .autocomplete__option--focused': {
|
|
76
|
-
bg: '
|
|
77
|
-
borderColor: '
|
|
76
|
+
bg: 'input.background.primary',
|
|
77
|
+
borderColor: 'input.background.primary',
|
|
78
78
|
},
|
|
79
79
|
'& .autocomplete__input--show-all-values': {
|
|
80
80
|
paddingRight: 0,
|
|
81
81
|
},
|
|
82
82
|
'& .autocomplete__hint': {
|
|
83
83
|
border: 'none',
|
|
84
|
-
paddingLeft:
|
|
84
|
+
paddingLeft: 4,
|
|
85
85
|
minHeight: '27px',
|
|
86
86
|
lineHeight: '27px',
|
|
87
87
|
},
|
|
@@ -93,7 +93,7 @@ const inlineStyles = {
|
|
|
93
93
|
|
|
94
94
|
const searchIconStyles = {
|
|
95
95
|
'& .autocomplete__input.autocomplete__input': {
|
|
96
|
-
paddingLeft:
|
|
96
|
+
paddingLeft: 6,
|
|
97
97
|
},
|
|
98
98
|
};
|
|
99
99
|
|
|
@@ -407,7 +407,7 @@ const FormAutocompleteMultiselect = React.forwardRef(
|
|
|
407
407
|
{ ...props }
|
|
408
408
|
/>
|
|
409
409
|
{ addStatus && <AddSelectionStatus status={ addStatus } /> }
|
|
410
|
-
{ loading && <FormSelectLoading sx={ { right: showAllValues ?
|
|
410
|
+
{ loading && <FormSelectLoading sx={ { right: showAllValues ? 7 : 3 } } /> }
|
|
411
411
|
</FormSelectContent>
|
|
412
412
|
</div>
|
|
413
413
|
<Flex sx={ { mt: 2, justifyContent: 'space-between' } }>
|
|
@@ -22,7 +22,7 @@ export const FormSelectArrow = React.forwardRef( ( props, forwardRef ) => (
|
|
|
22
22
|
borderLeftWidth: borderStyle.borderWidth,
|
|
23
23
|
borderLeftStyle: borderStyle.borderStyle,
|
|
24
24
|
borderLeftColor: borderStyle.borderColor,
|
|
25
|
-
right:
|
|
25
|
+
right: 3,
|
|
26
26
|
top: '7px',
|
|
27
27
|
pointerEvents: 'none',
|
|
28
28
|
svg: {
|
|
@@ -14,7 +14,7 @@ export const inlineStyles = {
|
|
|
14
14
|
gridTemplateColumns: 'auto 1fr',
|
|
15
15
|
position: 'relative',
|
|
16
16
|
alignItems: 'center',
|
|
17
|
-
backgroundColor: 'input.background',
|
|
17
|
+
backgroundColor: 'input.background.default',
|
|
18
18
|
borderRadius: 1,
|
|
19
19
|
...baseControlBorderStyle,
|
|
20
20
|
paddingRight: 0,
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
/**
|
|
3
|
+
* External dependencies
|
|
4
|
+
*/
|
|
2
5
|
import React from 'react';
|
|
6
|
+
import { ThemeUIStyleObject } from 'theme-ui';
|
|
7
|
+
interface LegendProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
sx?: ThemeUIStyleObject;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Legend: React.ForwardRefExoticComponent<LegendProps & React.RefAttributes<HTMLLegendElement>>;
|
|
13
|
+
export {};
|