@automattic/vip-design-system 0.26.3 → 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/Form/Input.js +0 -1
- package/build/system/Form/Validation.js +1 -0
- package/build/system/ResourceList/ResourceList.js +1 -1
- package/package.json +1 -1
- package/src/system/Form/Input.js +0 -1
- package/src/system/Form/Validation.js +1 -1
- package/build/system/Form/MultiSelect.js +0 -38
- package/build/system/UsageChart/UsageChart.js +0 -60
- package/build/system/UsageChart/index.js +0 -7
|
@@ -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, {
|
package/package.json
CHANGED
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
|
);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.MultiSelect = void 0;
|
|
5
|
-
|
|
6
|
-
var _reactSelect = _interopRequireDefault(require("react-select"));
|
|
7
|
-
|
|
8
|
-
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
|
-
function _extends() { _extends = Object.assign || 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
|
-
|
|
14
|
-
var vipGold = '#c29c69'; // hardcoding for now
|
|
15
|
-
|
|
16
|
-
var vipGrey2 = '#d7dee2';
|
|
17
|
-
var customStyles = {
|
|
18
|
-
control: function control(styles) {
|
|
19
|
-
return _extends({}, styles, {
|
|
20
|
-
border: "1px solid " + vipGrey2,
|
|
21
|
-
boxShadow: 'none',
|
|
22
|
-
'&:hover': {
|
|
23
|
-
border: "1px solid " + vipGold
|
|
24
|
-
},
|
|
25
|
-
'&:focus': {
|
|
26
|
-
border: "1px solid " + vipGold
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var MultiSelect = function MultiSelect(props) {
|
|
33
|
-
return (0, _jsxRuntime.jsx)(_reactSelect["default"], _extends({}, props, {
|
|
34
|
-
styles: customStyles
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
exports.MultiSelect = MultiSelect;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.UsageChart = void 0;
|
|
5
|
-
|
|
6
|
-
var _framerMotion = require("framer-motion");
|
|
7
|
-
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
|
-
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* External dependencies
|
|
16
|
-
*/
|
|
17
|
-
var UsageChart = function UsageChart(_ref) {
|
|
18
|
-
var total = _ref.total,
|
|
19
|
-
max = _ref.max,
|
|
20
|
-
_ref$variant = _ref.variant,
|
|
21
|
-
variant = _ref$variant === void 0 ? 'primary' : _ref$variant;
|
|
22
|
-
var width = total / max * 100 + '%';
|
|
23
|
-
var formattedTotal = total;
|
|
24
|
-
|
|
25
|
-
if (total > 1000000) {
|
|
26
|
-
formattedTotal = (total / 1000000).toFixed(2) + "M";
|
|
27
|
-
} else if (total > 1000) {
|
|
28
|
-
formattedTotal = (total / 1000).toFixed(2) + "K";
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return (0, _jsxRuntime.jsx)("div", {
|
|
32
|
-
sx: {
|
|
33
|
-
height: variant === 'primary' ? 32 : 8,
|
|
34
|
-
overflow: 'hidden',
|
|
35
|
-
backgroundColor: variant === 'primary' ? 'border' : 'transparent'
|
|
36
|
-
},
|
|
37
|
-
children: (0, _jsxRuntime.jsx)(_framerMotion.motion.div, {
|
|
38
|
-
initial: {
|
|
39
|
-
width: 0
|
|
40
|
-
},
|
|
41
|
-
animate: {
|
|
42
|
-
width: width
|
|
43
|
-
},
|
|
44
|
-
transition: {
|
|
45
|
-
duration: 0.7
|
|
46
|
-
},
|
|
47
|
-
sx: {
|
|
48
|
-
height: '100%',
|
|
49
|
-
backgroundColor: variant === 'primary' ? 'primary' : 'grey.40'
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
exports.UsageChart = UsageChart;
|
|
56
|
-
UsageChart.propTypes = {
|
|
57
|
-
total: _propTypes["default"].number,
|
|
58
|
-
max: _propTypes["default"].number,
|
|
59
|
-
variant: _propTypes["default"].string
|
|
60
|
-
};
|