@automattic/vip-design-system 0.26.2 → 0.26.4
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/build/system/Accordion/Accordion.js +31 -21
- package/build/system/Form/Input.js +0 -1
- package/build/system/Form/Validation.js +1 -0
- package/build/system/theme/index.js +7 -0
- package/package.json +1 -1
- package/src/system/Accordion/Accordion.js +6 -4
- package/src/system/Form/Input.js +0 -1
- package/src/system/Form/Validation.js +1 -1
- package/src/system/theme/index.js +8 -0
|
@@ -110,19 +110,29 @@ var Trigger = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, forward
|
|
|
110
110
|
fontWeight: 600,
|
|
111
111
|
textTransform: 'uppercase',
|
|
112
112
|
'&[data-state="closed"]': {
|
|
113
|
-
backgroundColor:
|
|
113
|
+
backgroundColor: function backgroundColor(_ref3) {
|
|
114
|
+
var accordion = _ref3.accordion;
|
|
115
|
+
return accordion.background.closed;
|
|
116
|
+
}
|
|
114
117
|
},
|
|
115
118
|
'&[data-state="open"]': {
|
|
116
|
-
backgroundColor:
|
|
117
|
-
|
|
118
|
-
return
|
|
119
|
+
backgroundColor: function backgroundColor(_ref4) {
|
|
120
|
+
var accordion = _ref4.accordion;
|
|
121
|
+
return accordion.background.open;
|
|
122
|
+
},
|
|
123
|
+
borderBottom: function borderBottom(_ref5) {
|
|
124
|
+
var colors = _ref5.colors;
|
|
125
|
+
return "1px solid " + colors.border;
|
|
119
126
|
},
|
|
120
127
|
'.vip-accordion-trigger-indicator': {
|
|
121
128
|
transform: 'rotate(270deg)'
|
|
122
129
|
}
|
|
123
130
|
},
|
|
124
131
|
'&:hover': {
|
|
125
|
-
backgroundColor:
|
|
132
|
+
backgroundColor: function backgroundColor(_ref6) {
|
|
133
|
+
var accordion = _ref6.accordion;
|
|
134
|
+
return accordion.background.hover;
|
|
135
|
+
}
|
|
126
136
|
}
|
|
127
137
|
}
|
|
128
138
|
}, props, {
|
|
@@ -148,10 +158,10 @@ Trigger.propTypes = {
|
|
|
148
158
|
headingVariant: _propTypes["default"].string
|
|
149
159
|
};
|
|
150
160
|
|
|
151
|
-
var TriggerWithIcon = /*#__PURE__*/_react["default"].forwardRef(function (
|
|
152
|
-
var children =
|
|
153
|
-
icon =
|
|
154
|
-
props = (0, _objectWithoutPropertiesLoose2["default"])(
|
|
161
|
+
var TriggerWithIcon = /*#__PURE__*/_react["default"].forwardRef(function (_ref7, forwardedRef) {
|
|
162
|
+
var children = _ref7.children,
|
|
163
|
+
icon = _ref7.icon,
|
|
164
|
+
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref7, _excluded3);
|
|
155
165
|
return (0, _jsxRuntime.jsxs)(Trigger, (0, _extends2["default"])({}, props, {
|
|
156
166
|
ref: forwardedRef,
|
|
157
167
|
children: [(0, _jsxRuntime.jsx)("span", {
|
|
@@ -179,11 +189,11 @@ TriggerWithIcon.propTypes = {
|
|
|
179
189
|
icon: _propTypes["default"].node.isRequired
|
|
180
190
|
};
|
|
181
191
|
|
|
182
|
-
var Content = /*#__PURE__*/_react["default"].forwardRef(function (
|
|
183
|
-
var children =
|
|
184
|
-
|
|
185
|
-
sx =
|
|
186
|
-
props = (0, _objectWithoutPropertiesLoose2["default"])(
|
|
192
|
+
var Content = /*#__PURE__*/_react["default"].forwardRef(function (_ref8, forwardedRef) {
|
|
193
|
+
var children = _ref8.children,
|
|
194
|
+
_ref8$sx = _ref8.sx,
|
|
195
|
+
sx = _ref8$sx === void 0 ? {} : _ref8$sx,
|
|
196
|
+
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref8, _excluded4);
|
|
187
197
|
return (0, _jsxRuntime.jsx)(AccordionPrimitive.Content, (0, _extends2["default"])({
|
|
188
198
|
sx: (0, _extends2["default"])({
|
|
189
199
|
backgroundColor: 'transparent',
|
|
@@ -216,13 +226,13 @@ Content.propTypes = {
|
|
|
216
226
|
sx: _propTypes["default"].object
|
|
217
227
|
};
|
|
218
228
|
|
|
219
|
-
var Root = /*#__PURE__*/_react["default"].forwardRef(function (
|
|
220
|
-
var
|
|
221
|
-
sx =
|
|
222
|
-
defaultValue =
|
|
223
|
-
type =
|
|
224
|
-
children =
|
|
225
|
-
className =
|
|
229
|
+
var Root = /*#__PURE__*/_react["default"].forwardRef(function (_ref9, forwardRef) {
|
|
230
|
+
var _ref9$sx = _ref9.sx,
|
|
231
|
+
sx = _ref9$sx === void 0 ? {} : _ref9$sx,
|
|
232
|
+
defaultValue = _ref9.defaultValue,
|
|
233
|
+
type = _ref9.type,
|
|
234
|
+
children = _ref9.children,
|
|
235
|
+
className = _ref9.className;
|
|
226
236
|
return (0, _jsxRuntime.jsx)(AccordionPrimitive.Root, {
|
|
227
237
|
className: (0, _classnames["default"])('vip-accordion-component', className),
|
|
228
238
|
collapsible: true,
|
|
@@ -79,7 +79,6 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
79
79
|
ref: ref,
|
|
80
80
|
id: forLabel,
|
|
81
81
|
required: required,
|
|
82
|
-
noValidate: true,
|
|
83
82
|
"aria-describedby": hasError ? "describe-" + forLabel + "-validation" : undefined,
|
|
84
83
|
sx: (0, _extends2["default"])({}, inputStyles, sx)
|
|
85
84
|
}, props)), hasError && errorMessage && (0, _jsxRuntime.jsx)(_.Validation, {
|
|
@@ -165,6 +165,13 @@ var _default = {
|
|
|
165
165
|
high: // eslint-disable-next-line max-len
|
|
166
166
|
'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)'
|
|
167
167
|
},
|
|
168
|
+
accordion: {
|
|
169
|
+
background: {
|
|
170
|
+
open: (0, _getColor.getVariants)('color.gold')['7'],
|
|
171
|
+
closed: 'transparent',
|
|
172
|
+
hover: (0, _getColor.getVariants)('color.gold')['7']
|
|
173
|
+
}
|
|
174
|
+
},
|
|
168
175
|
tag: {
|
|
169
176
|
gold: (0, _getColor.getVariants)('tag.gold')
|
|
170
177
|
},
|
package/package.json
CHANGED
|
@@ -81,13 +81,15 @@ export const Trigger = React.forwardRef(
|
|
|
81
81
|
fontWeight: 600,
|
|
82
82
|
textTransform: 'uppercase',
|
|
83
83
|
|
|
84
|
-
'&[data-state="closed"]': {
|
|
84
|
+
'&[data-state="closed"]': {
|
|
85
|
+
backgroundColor: ( { accordion } ) => accordion.background.closed,
|
|
86
|
+
},
|
|
85
87
|
'&[data-state="open"]': {
|
|
86
|
-
backgroundColor:
|
|
87
|
-
borderBottom:
|
|
88
|
+
backgroundColor: ( { accordion } ) => accordion.background.open,
|
|
89
|
+
borderBottom: ( { colors } ) => `1px solid ${ colors.border }`,
|
|
88
90
|
'.vip-accordion-trigger-indicator': { transform: 'rotate(270deg)' },
|
|
89
91
|
},
|
|
90
|
-
'&:hover': { backgroundColor:
|
|
92
|
+
'&:hover': { backgroundColor: ( { accordion } ) => accordion.background.hover },
|
|
91
93
|
} }
|
|
92
94
|
{ ...props }
|
|
93
95
|
ref={ forwardedRef }
|
package/src/system/Form/Input.js
CHANGED
|
@@ -26,7 +26,7 @@ const Validation = ( { children, isValid, describedId = null, ...props } ) => {
|
|
|
26
26
|
id={ describedId ? `describe-${ describedId }-validation` : undefined }
|
|
27
27
|
{ ...props }
|
|
28
28
|
>
|
|
29
|
-
<Icon sx={ { mr: 1 } } aria-label={ IconLabel } />
|
|
29
|
+
<Icon sx={ { mr: 1 } } role="img" aria-label={ IconLabel } />
|
|
30
30
|
{ children }
|
|
31
31
|
</p>
|
|
32
32
|
);
|
|
@@ -162,6 +162,14 @@ export default {
|
|
|
162
162
|
'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)',
|
|
163
163
|
},
|
|
164
164
|
|
|
165
|
+
accordion: {
|
|
166
|
+
background: {
|
|
167
|
+
open: getVariants( 'color.gold' )[ '7' ],
|
|
168
|
+
closed: 'transparent',
|
|
169
|
+
hover: getVariants( 'color.gold' )[ '7' ],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
|
|
165
173
|
tag: {
|
|
166
174
|
gold: getVariants( 'tag.gold' ),
|
|
167
175
|
},
|