@automattic/vip-design-system 0.28.1 → 0.28.2
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/.storybook/decorators/withColorMode.jsx +15 -2
- package/README.md +3 -3
- package/build/system/Accordion/Accordion.js +21 -30
- package/build/system/Badge/Badge.stories.js +1 -1
- package/build/system/Dropdown/Dropdown.stories.js +9 -5
- package/build/system/Form/Radio.stories.js +1 -1
- package/build/system/NewForm/FormAutocomplete.js +12 -2
- package/build/system/NewForm/FormAutocomplete.stories.js +14 -2
- package/build/system/NewForm/FormSelect.stories.js +3 -1
- package/build/system/Notice/Notice.stories.js +13 -23
- package/build/system/Table/Table.stories.js +0 -3
- package/build/system/Tabs/Tabs.stories.js +3 -3
- package/build/system/Wizard/WizardStep.js +5 -3
- package/build/system/theme/colors.js +7 -170
- package/build/system/theme/generated/valet-theme-dark.json +2924 -0
- package/{src/system/theme/generated/valet-theme.json → build/system/theme/generated/valet-theme-light.json} +47 -8
- package/build/system/theme/getColor.js +53 -50
- package/build/system/theme/index.js +114 -147
- package/build/system/theme/textStyles.js +51 -0
- package/package.json +7 -3
- package/src/system/Accordion/Accordion.js +8 -6
- package/src/system/Badge/Badge.stories.jsx +2 -2
- package/src/system/Dropdown/Dropdown.stories.jsx +12 -10
- package/src/system/Form/Radio.stories.jsx +3 -3
- package/src/system/NewForm/FormAutocomplete.js +11 -0
- package/src/system/NewForm/FormAutocomplete.stories.jsx +13 -0
- package/src/system/NewForm/FormSelect.stories.jsx +3 -2
- package/src/system/Notice/Notice.stories.jsx +8 -12
- package/src/system/Table/Table.stories.jsx +1 -1
- package/src/system/Tabs/Tabs.stories.jsx +3 -3
- package/src/system/Wizard/WizardStep.js +9 -3
- package/src/system/theme/colors.js +5 -171
- package/src/system/theme/generated/valet-theme-dark.json +2924 -0
- package/src/system/theme/generated/valet-theme-light.json +2918 -0
- package/src/system/theme/getColor.js +46 -40
- package/src/system/theme/index.js +150 -170
- package/src/system/theme/textStyles.js +46 -0
- package/tokens/valet-core/$metadata.json +1 -0
- package/tokens/valet-core/$themes.json +0 -2
- package/tokens/valet-core/wpvip-productive-color-dark.json +946 -0
- package/tokens/valet-core/wpvip-productive-color.json +47 -8
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
"type": "color",
|
|
5
5
|
"description": "Use as main application background",
|
|
6
6
|
"value": "#fbfbfb"
|
|
7
|
+
},
|
|
8
|
+
"overlay": {
|
|
9
|
+
"value": "#000000b3",
|
|
10
|
+
"type": "color",
|
|
11
|
+
"description": "Use for modal UI overlay"
|
|
7
12
|
}
|
|
8
13
|
},
|
|
9
14
|
"layer": {
|
|
@@ -690,14 +695,6 @@
|
|
|
690
695
|
"type": "color"
|
|
691
696
|
}
|
|
692
697
|
},
|
|
693
|
-
"overlay": {
|
|
694
|
-
"type": "color",
|
|
695
|
-
"value": "#767372"
|
|
696
|
-
},
|
|
697
|
-
"interactive": {
|
|
698
|
-
"type": "color",
|
|
699
|
-
"value": "#a66915"
|
|
700
|
-
},
|
|
701
698
|
"tag": {
|
|
702
699
|
"gray": {
|
|
703
700
|
"background": {
|
|
@@ -898,6 +895,48 @@
|
|
|
898
895
|
}
|
|
899
896
|
}
|
|
900
897
|
},
|
|
898
|
+
"toolbar": {
|
|
899
|
+
"background": {
|
|
900
|
+
"value": "#13191e",
|
|
901
|
+
"type": "color",
|
|
902
|
+
"description": "The background color for the top toolbar"
|
|
903
|
+
},
|
|
904
|
+
"text": {
|
|
905
|
+
"default": {
|
|
906
|
+
"value": "#ebe9e8",
|
|
907
|
+
"type": "color",
|
|
908
|
+
"description": "Default text color for the top toolbar's contents"
|
|
909
|
+
},
|
|
910
|
+
"hover": {
|
|
911
|
+
"value": "#ebe9e8",
|
|
912
|
+
"type": "color"
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
"brand": {
|
|
916
|
+
"value": "#ffffff",
|
|
917
|
+
"type": "color",
|
|
918
|
+
"description": "Use for the logo"
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
"logs": {
|
|
922
|
+
"text": {
|
|
923
|
+
"primary": {
|
|
924
|
+
"value": "#ebe9e8",
|
|
925
|
+
"type": "color",
|
|
926
|
+
"description": "Use for monotype output in an invere layer."
|
|
927
|
+
},
|
|
928
|
+
"secondary": {
|
|
929
|
+
"value": "#b3afae",
|
|
930
|
+
"type": "color",
|
|
931
|
+
"description": "Use for timestamp or secondary monotype output in an inverse layer."
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
"background": {
|
|
935
|
+
"value": "#13191e",
|
|
936
|
+
"type": "color",
|
|
937
|
+
"description": "Use for the pseudo terminal window background color."
|
|
938
|
+
}
|
|
939
|
+
},
|
|
901
940
|
"rem": {
|
|
902
941
|
"value": 16,
|
|
903
942
|
"type": "other",
|
|
@@ -3,61 +3,64 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
|
|
8
8
|
var _extends4 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
10
|
-
var _valetTheme = _interopRequireDefault(require("./generated/valet-theme.json"));
|
|
11
|
-
|
|
12
10
|
/**
|
|
13
11
|
* Internal dependencies
|
|
14
12
|
*/
|
|
15
|
-
|
|
16
|
-
if (variant === void 0) {
|
|
17
|
-
variant = 'default';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (!_valetTheme["default"][color]) {
|
|
21
|
-
return '#000000';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return _valetTheme["default"][color][variant].value;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.getColor = getColor;
|
|
28
|
-
|
|
29
|
-
var resolvePath = function resolvePath(object, path, defaultValue) {
|
|
30
|
-
return path.split('.').reduce(function (acc, property) {
|
|
31
|
-
return acc ? acc[property] : defaultValue;
|
|
32
|
-
}, object);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
var getVariants = function getVariants(color) {
|
|
36
|
-
var property = resolvePath(_valetTheme["default"], color, {});
|
|
37
|
-
return Object.keys(property).reduce(function (variants, variant) {
|
|
38
|
-
var _extends2;
|
|
39
|
-
|
|
40
|
-
return (0, _extends4["default"])({}, variants, (_extends2 = {}, _extends2[variant] = property[variant].value, _extends2));
|
|
41
|
-
}, {});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
exports.getVariants = getVariants;
|
|
45
|
-
|
|
46
|
-
var traverse = function traverse(root) {
|
|
47
|
-
if (root.hasOwnProperty('value') && root.hasOwnProperty('type')) {
|
|
48
|
-
return root.value;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return Object.entries(root).reduce(function (acc, _ref) {
|
|
52
|
-
var _extends3;
|
|
53
|
-
|
|
54
|
-
var key = _ref[0],
|
|
55
|
-
value = _ref[1];
|
|
56
|
-
return (0, _extends4["default"])({}, acc, (_extends3 = {}, _extends3[key] = traverse(value), _extends3));
|
|
57
|
-
}, {});
|
|
58
|
-
}; // Valet Theme Productive Theme
|
|
13
|
+
// Valet Theme Productive Theme
|
|
59
14
|
// https://www.figma.com/file/sILtW5Cs2tAnPWrSOEVyER/Productive-Color?node-id=1%3A17&t=4kHdpoprxntk5Ilw-0
|
|
15
|
+
var _default = function _default(theme) {
|
|
16
|
+
var getColor = function getColor(color, variant) {
|
|
17
|
+
if (variant === void 0) {
|
|
18
|
+
variant = 'default';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!theme[color]) {
|
|
22
|
+
return '#000000';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return theme[color][variant].value;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var resolvePath = function resolvePath(object, path, defaultValue) {
|
|
29
|
+
return path.split('.').reduce(function (acc, property) {
|
|
30
|
+
return acc ? acc[property] : defaultValue;
|
|
31
|
+
}, object);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var getVariants = function getVariants(color) {
|
|
35
|
+
var property = resolvePath(theme, color, {});
|
|
36
|
+
return Object.keys(property).reduce(function (variants, variant) {
|
|
37
|
+
var _extends2;
|
|
38
|
+
|
|
39
|
+
return (0, _extends4["default"])({}, variants, (_extends2 = {}, _extends2[variant] = property[variant].value, _extends2));
|
|
40
|
+
}, {});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var traverse = function traverse(root) {
|
|
44
|
+
if (root.hasOwnProperty('value') && root.hasOwnProperty('type')) {
|
|
45
|
+
return root.value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return Object.entries(root).reduce(function (acc, _ref) {
|
|
49
|
+
var _extends3;
|
|
50
|
+
|
|
51
|
+
var key = _ref[0],
|
|
52
|
+
value = _ref[1];
|
|
53
|
+
return (0, _extends4["default"])({}, acc, (_extends3 = {}, _extends3[key] = traverse(value), _extends3));
|
|
54
|
+
}, {});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
ValetTheme: traverse(theme),
|
|
59
|
+
getColor: getColor,
|
|
60
|
+
getVariants: getVariants,
|
|
61
|
+
traverse: traverse,
|
|
62
|
+
resolvePath: resolvePath
|
|
63
|
+
};
|
|
64
|
+
};
|
|
60
65
|
|
|
61
|
-
|
|
62
|
-
var ValetTheme = traverse(_valetTheme["default"]);
|
|
63
|
-
exports.ValetTheme = ValetTheme;
|
|
66
|
+
exports["default"] = _default;
|
|
@@ -7,64 +7,38 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
10
|
-
var _getColor = require("./getColor");
|
|
10
|
+
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _valetThemeLight = _interopRequireDefault(require("./generated/valet-theme-light.json"));
|
|
13
|
+
|
|
14
|
+
var _valetThemeDark = _interopRequireDefault(require("./generated/valet-theme-dark.json"));
|
|
15
|
+
|
|
16
|
+
var _colors = _interopRequireDefault(require("./colors"));
|
|
17
|
+
|
|
18
|
+
var _textStyles = require("./textStyles");
|
|
13
19
|
|
|
14
20
|
/**
|
|
15
21
|
* Internal dependencies
|
|
16
22
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
color: 'heading'
|
|
32
|
-
},
|
|
33
|
-
h3: {
|
|
34
|
-
fontSize: 3,
|
|
35
|
-
marginBottom: 3,
|
|
36
|
-
letterSpacing: '-.005em',
|
|
37
|
-
lineHeight: 1.4,
|
|
38
|
-
fontWeight: 'heading',
|
|
39
|
-
color: 'heading'
|
|
40
|
-
},
|
|
41
|
-
h4: {
|
|
42
|
-
fontSize: 2,
|
|
43
|
-
marginBottom: 1,
|
|
44
|
-
lineHeight: 1.5,
|
|
45
|
-
fontWeight: 'heading',
|
|
46
|
-
color: 'heading'
|
|
47
|
-
},
|
|
48
|
-
h5: {
|
|
49
|
-
fontSize: 1,
|
|
50
|
-
marginBottom: 1,
|
|
51
|
-
lineHeight: 1.5,
|
|
52
|
-
fontWeight: 'heading',
|
|
53
|
-
color: 'heading'
|
|
54
|
-
},
|
|
55
|
-
caps: {
|
|
56
|
-
fontSize: 1,
|
|
57
|
-
marginBottom: 2,
|
|
58
|
-
color: 'muted',
|
|
59
|
-
fontWeight: 'bold',
|
|
60
|
-
letterSpacing: '.05em'
|
|
61
|
-
}
|
|
62
|
-
};
|
|
23
|
+
// Light
|
|
24
|
+
var _ThemeBuilder = (0, _getColor["default"])(_valetThemeLight["default"]),
|
|
25
|
+
getColor = _ThemeBuilder.getColor,
|
|
26
|
+
getVariants = _ThemeBuilder.getVariants,
|
|
27
|
+
ValetTheme = _ThemeBuilder.ValetTheme;
|
|
28
|
+
|
|
29
|
+
var light = (0, _colors["default"])(ValetTheme); // Dark
|
|
30
|
+
|
|
31
|
+
var _ThemeBuilder2 = (0, _getColor["default"])(_valetThemeDark["default"]),
|
|
32
|
+
getColorDark = _ThemeBuilder2.getColor,
|
|
33
|
+
getVariantsDark = _ThemeBuilder2.getVariants,
|
|
34
|
+
ValetThemeDark = _ThemeBuilder2.ValetTheme;
|
|
35
|
+
|
|
36
|
+
var dark = (0, _colors["default"])(ValetThemeDark);
|
|
63
37
|
var outline = {
|
|
64
38
|
outlineStyle: 'solid',
|
|
65
|
-
outlineColor:
|
|
39
|
+
outlineColor: getColor('focus', 'inset'),
|
|
66
40
|
outlineWidth: '1px',
|
|
67
|
-
boxShadow: "0 0 0 1px " +
|
|
41
|
+
boxShadow: "0 0 0 1px " + getColor('focus', 'inset') + ", 0 0 0 3px " + getColor('focus')
|
|
68
42
|
};
|
|
69
43
|
var fonts = {
|
|
70
44
|
body: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',
|
|
@@ -72,118 +46,118 @@ var fonts = {
|
|
|
72
46
|
monospace: '"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',
|
|
73
47
|
serif: 'recoletaregular, Georgia, serif'
|
|
74
48
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
fonts: fonts,
|
|
79
|
-
fontSizes: [10, 12, 14, 19, 32, 40, 56, 64, 96],
|
|
80
|
-
fontWeights: {
|
|
81
|
-
body: 400,
|
|
82
|
-
heading: 500,
|
|
83
|
-
bold: 600
|
|
84
|
-
},
|
|
85
|
-
lineHeights: {
|
|
86
|
-
body: 1.6,
|
|
87
|
-
heading: 1.125
|
|
88
|
-
},
|
|
89
|
-
sizes: {
|
|
90
|
-
sidebar: 260
|
|
91
|
-
},
|
|
92
|
-
radii: [0, 4, 8],
|
|
93
|
-
config: {
|
|
94
|
-
useColorSchemeMediaQuery: false
|
|
95
|
-
},
|
|
96
|
-
initialColorModeName: 'light',
|
|
97
|
-
colors: (0, _extends2["default"])({
|
|
49
|
+
|
|
50
|
+
var getComponentColors = function getComponentColors(theme, gColor, gVariants) {
|
|
51
|
+
return {
|
|
98
52
|
// Valet Theme Colors
|
|
99
53
|
// This has to be in the plural because we already have a flag: text
|
|
100
|
-
texts: (0, _extends2["default"])({},
|
|
54
|
+
texts: (0, _extends2["default"])({}, theme.text, {
|
|
101
55
|
disabled: '#716e6e'
|
|
102
56
|
}),
|
|
103
|
-
button: (0, _extends2["default"])({},
|
|
104
|
-
tag: (0, _extends2["default"])({},
|
|
57
|
+
button: (0, _extends2["default"])({}, theme.button),
|
|
58
|
+
tag: (0, _extends2["default"])({}, theme.tag),
|
|
105
59
|
// Notice
|
|
106
|
-
notice: (0, _extends2["default"])({},
|
|
60
|
+
notice: (0, _extends2["default"])({}, theme.support),
|
|
107
61
|
// layer
|
|
108
|
-
layer: (0, _extends2["default"])({},
|
|
62
|
+
layer: (0, _extends2["default"])({}, theme.layer),
|
|
109
63
|
// icon
|
|
110
|
-
icon: (0, _extends2["default"])({},
|
|
64
|
+
icon: (0, _extends2["default"])({}, theme.icon),
|
|
111
65
|
// Form Controls
|
|
112
|
-
input: (0, _extends2["default"])({},
|
|
66
|
+
input: (0, _extends2["default"])({}, theme.input),
|
|
67
|
+
// Accordion
|
|
68
|
+
accordion: {
|
|
69
|
+
content: {
|
|
70
|
+
background: gColor('layer', '2'),
|
|
71
|
+
text: gColor('text', 'secondary')
|
|
72
|
+
},
|
|
73
|
+
trigger: {
|
|
74
|
+
text: gColor('text', 'primary')
|
|
75
|
+
},
|
|
76
|
+
background: {
|
|
77
|
+
open: gColor('layer', '3'),
|
|
78
|
+
closed: 'transparent',
|
|
79
|
+
hover: gColor('layer', '3')
|
|
80
|
+
}
|
|
81
|
+
},
|
|
113
82
|
optionRow: {
|
|
114
83
|
hover: 'rgba(0,0,0,.02)',
|
|
115
|
-
border: (
|
|
116
|
-
text: (
|
|
117
|
-
textAccent: (
|
|
118
|
-
icon: (
|
|
119
|
-
iconBackground: (
|
|
84
|
+
border: gColor('border', '1'),
|
|
85
|
+
text: gColor('text', 'secondary'),
|
|
86
|
+
textAccent: gColor('link', 'default'),
|
|
87
|
+
icon: gColor('icon', 'primary'),
|
|
88
|
+
iconBackground: gColor('layer', 'accent')
|
|
120
89
|
},
|
|
121
90
|
table: {
|
|
122
|
-
border: (
|
|
123
|
-
heading: (
|
|
124
|
-
text: (
|
|
91
|
+
border: gColor('border', '2'),
|
|
92
|
+
heading: gColor('text', 'primary'),
|
|
93
|
+
text: gColor('text', 'secondary')
|
|
125
94
|
},
|
|
126
95
|
// Common Tokens
|
|
127
|
-
text: (
|
|
128
|
-
heading: (
|
|
129
|
-
background: (
|
|
130
|
-
backgroundSecondary: (
|
|
131
|
-
primary: (
|
|
132
|
-
secondary:
|
|
133
|
-
muted: (
|
|
134
|
-
border: (
|
|
96
|
+
text: gColor('text', 'secondary'),
|
|
97
|
+
heading: gColor('text', 'primary'),
|
|
98
|
+
background: gColor('layer', '2'),
|
|
99
|
+
backgroundSecondary: gColor('layer', '1'),
|
|
100
|
+
primary: gColor('link', 'default'),
|
|
101
|
+
secondary: light.gray['70'],
|
|
102
|
+
muted: gColor('text', 'helper'),
|
|
103
|
+
border: gColor('border', '1'),
|
|
135
104
|
borders: {
|
|
136
|
-
1: (
|
|
137
|
-
2: (
|
|
138
|
-
3: (
|
|
139
|
-
4: (
|
|
140
|
-
inverse: (
|
|
141
|
-
accent: (
|
|
105
|
+
1: gColor('border', '1'),
|
|
106
|
+
2: gColor('border', '2'),
|
|
107
|
+
3: gColor('border', '3'),
|
|
108
|
+
4: gColor('border', '4'),
|
|
109
|
+
inverse: gColor('border', 'inverse'),
|
|
110
|
+
accent: gColor('border', 'accent')
|
|
142
111
|
},
|
|
143
112
|
hover: 'rgba(0,0,0,.02)',
|
|
144
113
|
darken: 'rgba(0,0,0,.05)',
|
|
145
|
-
placeholder: (
|
|
114
|
+
placeholder: gVariants('input.text').placeholder,
|
|
146
115
|
midnight: '#13191E',
|
|
147
|
-
dialog:
|
|
148
|
-
backgroundMuted: (
|
|
116
|
+
dialog: light.gray['0'],
|
|
117
|
+
backgroundMuted: gColor('layer', '1'),
|
|
149
118
|
// Variant colors
|
|
150
|
-
success:
|
|
151
|
-
error:
|
|
152
|
-
warning:
|
|
153
|
-
info:
|
|
119
|
+
success: theme.support.link.success["default"],
|
|
120
|
+
error: theme.support.link.error["default"],
|
|
121
|
+
warning: theme.support.link.warning["default"],
|
|
122
|
+
info: theme.support.link.info["default"],
|
|
154
123
|
// Card
|
|
155
124
|
card: '#fff',
|
|
156
125
|
// Link
|
|
157
|
-
link: (
|
|
126
|
+
link: gColor('link', 'default'),
|
|
158
127
|
links: {
|
|
159
|
-
"default": (
|
|
160
|
-
hover: (
|
|
161
|
-
active: (
|
|
162
|
-
visited: (
|
|
128
|
+
"default": gColor('link', 'default'),
|
|
129
|
+
hover: gColor('link', 'hover'),
|
|
130
|
+
active: gColor('link', 'active'),
|
|
131
|
+
visited: gColor('link', 'visited')
|
|
163
132
|
}
|
|
164
|
-
}
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var _default = {
|
|
137
|
+
outline: outline,
|
|
138
|
+
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
|
|
139
|
+
fonts: fonts,
|
|
140
|
+
fontSizes: [10, 12, 14, 19, 32, 40, 56, 64, 96],
|
|
141
|
+
fontWeights: {
|
|
142
|
+
body: 400,
|
|
143
|
+
heading: 500,
|
|
144
|
+
bold: 600
|
|
145
|
+
},
|
|
146
|
+
lineHeights: {
|
|
147
|
+
body: 1.6,
|
|
148
|
+
heading: 1.125
|
|
149
|
+
},
|
|
150
|
+
sizes: {
|
|
151
|
+
sidebar: 260
|
|
152
|
+
},
|
|
153
|
+
radii: [0, 4, 8],
|
|
154
|
+
config: {
|
|
155
|
+
useColorSchemeMediaQuery: false
|
|
156
|
+
},
|
|
157
|
+
initialColorModeName: 'light',
|
|
158
|
+
colors: (0, _extends2["default"])({}, getComponentColors(ValetTheme, getColor, getVariants), light, {
|
|
165
159
|
modes: {
|
|
166
|
-
|
|
167
|
-
dark: (0, _extends2["default"])({
|
|
168
|
-
text: _colors.dark.grey['90'],
|
|
169
|
-
heading: _colors.dark.grey['100'],
|
|
170
|
-
background: _colors.dark.grey['5'],
|
|
171
|
-
backgroundSecondary: _colors.dark.grey['10'],
|
|
172
|
-
primary: _colors.light.brand['70'],
|
|
173
|
-
secondary: '#30c',
|
|
174
|
-
muted: _colors.dark.grey['90'],
|
|
175
|
-
link: _colors.dark.brand['90'],
|
|
176
|
-
card: _colors.dark.grey['20'],
|
|
177
|
-
placeholder: _colors.dark.grey['70'],
|
|
178
|
-
border: _colors.dark.grey['30'],
|
|
179
|
-
hover: 'rgba(255,255,255,.02)',
|
|
180
|
-
midnight: _colors.dark.grey['90'],
|
|
181
|
-
success: _colors.dark.green['90'],
|
|
182
|
-
error: _colors.dark.red['90'],
|
|
183
|
-
warning: _colors.dark.yellow['90'],
|
|
184
|
-
dialog: _colors.dark.grey['40'],
|
|
185
|
-
backgroundMuted: _colors.dark.grey['10']
|
|
186
|
-
}, _colors.dark)
|
|
160
|
+
dark: (0, _extends2["default"])({}, getComponentColors(ValetThemeDark, getColorDark, getVariantsDark), dark)
|
|
187
161
|
}
|
|
188
162
|
}),
|
|
189
163
|
shadows: {
|
|
@@ -193,15 +167,8 @@ var _default = {
|
|
|
193
167
|
high: // eslint-disable-next-line max-len
|
|
194
168
|
'0px 2.76726px 2.21381px rgba(0, 0, 0, 0.0196802), 0px 6.6501px 5.32008px rgba(0, 0, 0, 0.0282725), 0px 12.5216px 10.0172px rgba(0, 0, 0, 0.035), 0px 22.3363px 17.869px rgba(0, 0, 0, 0.0417275), 0px 41.7776px 33.4221px rgba(0, 0, 0, 0.0503198), 0px 100px 80px rgba(0, 0, 0, 0.07)'
|
|
195
169
|
},
|
|
196
|
-
accordion: {
|
|
197
|
-
background: {
|
|
198
|
-
open: (0, _getColor.getVariants)('color.gold')['7'],
|
|
199
|
-
closed: 'transparent',
|
|
200
|
-
hover: (0, _getColor.getVariants)('color.gold')['7']
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
170
|
tag: {
|
|
204
|
-
gold:
|
|
171
|
+
gold: getVariants('tag.gold')
|
|
205
172
|
},
|
|
206
173
|
cards: {
|
|
207
174
|
primary: {
|
|
@@ -333,7 +300,7 @@ var _default = {
|
|
|
333
300
|
}
|
|
334
301
|
}
|
|
335
302
|
},
|
|
336
|
-
text: textStyles,
|
|
303
|
+
text: _textStyles.textStyles,
|
|
337
304
|
dialog: {
|
|
338
305
|
modal: {
|
|
339
306
|
position: 'fixed',
|
|
@@ -373,7 +340,7 @@ var _default = {
|
|
|
373
340
|
fontWeight: 'body',
|
|
374
341
|
fontSize: 2,
|
|
375
342
|
color: 'text',
|
|
376
|
-
backgroundColor:
|
|
343
|
+
backgroundColor: getColor('background', 'primary'),
|
|
377
344
|
'-webkit-font-smoothing': 'antialiased',
|
|
378
345
|
'-moz-osx-font-smoothing': 'grayscale',
|
|
379
346
|
a: {
|
|
@@ -392,7 +359,7 @@ var _default = {
|
|
|
392
359
|
p: {
|
|
393
360
|
color: 'text'
|
|
394
361
|
}
|
|
395
|
-
}, textStyles)
|
|
362
|
+
}, _textStyles.textStyles)
|
|
396
363
|
}
|
|
397
364
|
};
|
|
398
365
|
exports["default"] = _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.textStyles = void 0;
|
|
5
|
+
var textStyles = {
|
|
6
|
+
h1: {
|
|
7
|
+
fontSize: 5,
|
|
8
|
+
marginBottom: 3,
|
|
9
|
+
letterSpacing: '-.02em',
|
|
10
|
+
fontWeight: 'body',
|
|
11
|
+
fontFamily: 'serif',
|
|
12
|
+
color: 'heading'
|
|
13
|
+
},
|
|
14
|
+
h2: {
|
|
15
|
+
fontSize: 4,
|
|
16
|
+
marginBottom: 2,
|
|
17
|
+
letterSpacing: '-.005em',
|
|
18
|
+
fontWeight: 400,
|
|
19
|
+
color: 'heading'
|
|
20
|
+
},
|
|
21
|
+
h3: {
|
|
22
|
+
fontSize: 3,
|
|
23
|
+
marginBottom: 3,
|
|
24
|
+
letterSpacing: '-.005em',
|
|
25
|
+
lineHeight: 1.4,
|
|
26
|
+
fontWeight: 'heading',
|
|
27
|
+
color: 'heading'
|
|
28
|
+
},
|
|
29
|
+
h4: {
|
|
30
|
+
fontSize: 2,
|
|
31
|
+
marginBottom: 1,
|
|
32
|
+
lineHeight: 1.5,
|
|
33
|
+
fontWeight: 'heading',
|
|
34
|
+
color: 'heading'
|
|
35
|
+
},
|
|
36
|
+
h5: {
|
|
37
|
+
fontSize: 1,
|
|
38
|
+
marginBottom: 1,
|
|
39
|
+
lineHeight: 1.5,
|
|
40
|
+
fontWeight: 'heading',
|
|
41
|
+
color: 'heading'
|
|
42
|
+
},
|
|
43
|
+
caps: {
|
|
44
|
+
fontSize: 1,
|
|
45
|
+
marginBottom: 2,
|
|
46
|
+
color: 'muted',
|
|
47
|
+
fontWeight: 'bold',
|
|
48
|
+
letterSpacing: '.05em'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.textStyles = textStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/vip-design-system",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.2",
|
|
4
4
|
"main": "build/system/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build-storybook": "build-storybook",
|
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
"jest": "NODE_ENV=test jest --detectOpenHandles --env=jsdom",
|
|
12
12
|
"jest:coverage": "npm run jest && open-cli ./coverage/index.html",
|
|
13
13
|
"jest:watch": "npm run jest --watch",
|
|
14
|
-
"theme-builder-copy": "
|
|
15
|
-
"theme-
|
|
14
|
+
"theme-builder-copy": "npm run theme-builder-copy-light && npm run theme-builder-copy-dark",
|
|
15
|
+
"theme-builder-copy-light": "mkdir -p build/system/theme/generated/ && cp src/system/theme/generated/valet-theme-light.json build/system/theme/generated/valet-theme-light.json",
|
|
16
|
+
"theme-builder-copy-dark": "mkdir -p build/system/theme/generated/ && cp src/system/theme/generated/valet-theme-dark.json build/system/theme/generated/valet-theme-dark.json",
|
|
17
|
+
"theme-update": "npm run theme-update-light && npm run theme-update-dark",
|
|
18
|
+
"theme-update-light": "token-transformer tokens/valet-core src/system/theme/generated/valet-theme-light.json valet-core,wpvip-productive-color",
|
|
19
|
+
"theme-update-dark": "token-transformer tokens/valet-core src/system/theme/generated/valet-theme-dark.json valet-core,wpvip-productive-color-dark",
|
|
16
20
|
"lint": "eslint . --fix --max-warnings 0",
|
|
17
21
|
"storybook": "start-storybook -p 6006",
|
|
18
22
|
"dev": "npm run storybook",
|
|
@@ -81,15 +81,15 @@ export const Trigger = React.forwardRef(
|
|
|
81
81
|
fontWeight: 600,
|
|
82
82
|
|
|
83
83
|
'&[data-state="closed"]': {
|
|
84
|
-
backgroundColor:
|
|
84
|
+
backgroundColor: 'accordion.background.closed',
|
|
85
85
|
},
|
|
86
86
|
'&[data-state="open"]': {
|
|
87
|
-
backgroundColor:
|
|
87
|
+
backgroundColor: 'accordion.background.open',
|
|
88
88
|
borderBottom: '1px solid',
|
|
89
89
|
borderBottomColor: 'borders.2',
|
|
90
90
|
'.vip-accordion-trigger-indicator': { transform: 'rotate(270deg)' },
|
|
91
91
|
},
|
|
92
|
-
'&:hover': { backgroundColor:
|
|
92
|
+
'&:hover': { backgroundColor: 'accordion.background.hover' },
|
|
93
93
|
...sx,
|
|
94
94
|
} }
|
|
95
95
|
{ ...props }
|
|
@@ -122,7 +122,9 @@ Trigger.propTypes = {
|
|
|
122
122
|
export const TriggerWithIcon = React.forwardRef( ( { children, icon, ...props }, forwardedRef ) => (
|
|
123
123
|
<Trigger { ...props } ref={ forwardedRef }>
|
|
124
124
|
<span sx={ { color: 'icon.primary', fontSize: 3 } }>{ icon }</span>
|
|
125
|
-
<div sx={ { color: '
|
|
125
|
+
<div sx={ { color: 'accordion.trigger.text', flexGrow: 1, textAlign: 'left', ml: 3 } }>
|
|
126
|
+
{ children }
|
|
127
|
+
</div>
|
|
126
128
|
</Trigger>
|
|
127
129
|
) );
|
|
128
130
|
|
|
@@ -137,8 +139,8 @@ export const Content = React.forwardRef( ( { children, sx = {}, ...props }, forw
|
|
|
137
139
|
return (
|
|
138
140
|
<AccordionPrimitive.Content
|
|
139
141
|
sx={ {
|
|
140
|
-
backgroundColor: '
|
|
141
|
-
color: 'text',
|
|
142
|
+
backgroundColor: 'accordion.content.background',
|
|
143
|
+
color: 'accordion.content.text',
|
|
142
144
|
fontSize: 2,
|
|
143
145
|
overflow: 'hidden',
|
|
144
146
|
px: 3,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { Badge } from '..';
|
|
4
|
+
import { Badge, Link } from '..';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Badge',
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
const Template = props => <Badge { ...props } sx={ { m: 2 } } />;
|
|
12
12
|
const TemplateLink = props => (
|
|
13
13
|
<Template { ...props } sx={ { m: 2 } }>
|
|
14
|
-
<
|
|
14
|
+
<Link href="http://google.com">Google.com</Link>
|
|
15
15
|
</Template>
|
|
16
16
|
);
|
|
17
17
|
|