@automattic/vip-design-system 2.8.0 → 2.8.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/build/system/Box/Box.js +2 -2
- package/build/system/Card/Card.d.ts +0 -6
- package/build/system/Card/Card.js +8 -13
- package/build/system/Wizard/WizardStep.js +1 -0
- package/package.json +1 -1
- package/src/system/Box/Box.tsx +1 -1
- package/src/system/Card/Card.tsx +5 -9
- package/src/system/Wizard/WizardStep.tsx +1 -0
package/build/system/Box/Box.js
CHANGED
|
@@ -11,9 +11,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
11
11
|
* External dependencies
|
|
12
12
|
*/
|
|
13
13
|
var Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
14
|
-
return (0, _jsxRuntime.jsx)(_themeUi.Box, _extends({
|
|
14
|
+
return (0, _jsxRuntime.jsx)(_themeUi.Box, _extends({
|
|
15
15
|
className: (0, _classnames["default"])('vip-box-component', props.className),
|
|
16
16
|
ref: ref
|
|
17
|
-
}));
|
|
17
|
+
}, props));
|
|
18
18
|
});
|
|
19
19
|
Box.displayName = 'Box';
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/** @jsxImportSource theme-ui */
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
/**
|
|
4
|
-
* External dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { Argument } from 'classnames';
|
|
7
3
|
import { BoxProps } from 'theme-ui';
|
|
8
4
|
export declare enum CardVariant {
|
|
9
5
|
'primary' = 0,
|
|
@@ -13,8 +9,6 @@ export declare enum CardVariant {
|
|
|
13
9
|
}
|
|
14
10
|
export interface CardProps {
|
|
15
11
|
variant?: keyof typeof CardVariant;
|
|
16
|
-
sx?: BoxProps['sx'];
|
|
17
|
-
className?: Argument;
|
|
18
12
|
title?: string;
|
|
19
13
|
children?: React.ReactNode;
|
|
20
14
|
renderHeader?: (title?: string) => React.ReactNode;
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.CardVariant = exports.Card = void 0;
|
|
5
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
6
5
|
var _react = require("react");
|
|
7
6
|
var _ = require("..");
|
|
8
7
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
9
|
-
var _excluded = ["variant", "title", "renderHeader", "
|
|
8
|
+
var _excluded = ["variant", "title", "renderHeader", "children"];
|
|
10
9
|
/** @jsxImportSource theme-ui */
|
|
11
10
|
/**
|
|
12
11
|
* External dependencies
|
|
@@ -14,7 +13,6 @@ var _excluded = ["variant", "title", "renderHeader", "sx", "className", "childre
|
|
|
14
13
|
/**
|
|
15
14
|
* Internal dependencies
|
|
16
15
|
*/
|
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
16
|
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
17
|
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
18
|
var CardVariant = exports.CardVariant = /*#__PURE__*/function (CardVariant) {
|
|
@@ -29,29 +27,26 @@ var Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
29
27
|
variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
|
|
30
28
|
title = _ref.title,
|
|
31
29
|
renderHeader = _ref.renderHeader,
|
|
32
|
-
_ref$sx = _ref.sx,
|
|
33
|
-
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
34
|
-
className = _ref.className,
|
|
35
30
|
children = _ref.children,
|
|
36
|
-
|
|
31
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
37
32
|
return (0, _jsxRuntime.jsxs)(_.Box, _extends({
|
|
38
33
|
ref: ref,
|
|
39
34
|
sx: {
|
|
40
35
|
variant: "cards." + variant
|
|
41
36
|
},
|
|
42
|
-
className:
|
|
43
|
-
},
|
|
37
|
+
className: "vip-card-component"
|
|
38
|
+
}, rest, {
|
|
44
39
|
children: [renderHeader ? renderHeader(title) : '', title && !renderHeader && (0, _jsxRuntime.jsx)(_.Box, {
|
|
45
|
-
className:
|
|
40
|
+
className: "vip-card-header-component",
|
|
46
41
|
sx: {
|
|
47
42
|
variant: "cards." + variant + ".header"
|
|
48
43
|
},
|
|
49
44
|
children: title
|
|
50
45
|
}), (0, _jsxRuntime.jsx)(_.Box, {
|
|
51
|
-
className:
|
|
52
|
-
sx:
|
|
46
|
+
className: "vip-card-body-component",
|
|
47
|
+
sx: {
|
|
53
48
|
variant: "cards." + variant + ".children"
|
|
54
|
-
},
|
|
49
|
+
},
|
|
55
50
|
children: children
|
|
56
51
|
})]
|
|
57
52
|
}));
|
|
@@ -83,6 +83,7 @@ var WizardStep = exports.WizardStep = /*#__PURE__*/_react["default"].forwardRef(
|
|
|
83
83
|
},
|
|
84
84
|
"data-step": order,
|
|
85
85
|
"data-active": active || undefined,
|
|
86
|
+
className: "wizard-step-" + status,
|
|
86
87
|
ref: forwardRef,
|
|
87
88
|
children: [(0, _jsxRuntime.jsxs)(_.Flex, {
|
|
88
89
|
sx: {
|
package/package.json
CHANGED
package/src/system/Box/Box.tsx
CHANGED
|
@@ -8,9 +8,9 @@ import { Box as ThemeBox, BoxProps as ThemeBoxProps } from 'theme-ui';
|
|
|
8
8
|
export const Box = forwardRef< HTMLElement, ThemeBoxProps >(
|
|
9
9
|
( props: ThemeBoxProps, ref: Ref< HTMLElement > ) => (
|
|
10
10
|
<ThemeBox
|
|
11
|
-
{ ...props }
|
|
12
11
|
className={ classNames( 'vip-box-component', props.className ) }
|
|
13
12
|
ref={ ref }
|
|
13
|
+
{ ...props }
|
|
14
14
|
/>
|
|
15
15
|
)
|
|
16
16
|
);
|
package/src/system/Card/Card.tsx
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* External dependencies
|
|
5
5
|
*/
|
|
6
|
-
import classNames, { Argument } from 'classnames';
|
|
7
6
|
import { forwardRef, Ref } from 'react';
|
|
8
7
|
import { BoxProps } from 'theme-ui';
|
|
9
8
|
|
|
@@ -21,8 +20,6 @@ export enum CardVariant {
|
|
|
21
20
|
|
|
22
21
|
export interface CardProps {
|
|
23
22
|
variant?: keyof typeof CardVariant;
|
|
24
|
-
sx?: BoxProps[ 'sx' ];
|
|
25
|
-
className?: Argument;
|
|
26
23
|
title?: string;
|
|
27
24
|
children?: React.ReactNode;
|
|
28
25
|
renderHeader?: ( title?: string ) => React.ReactNode;
|
|
@@ -32,7 +29,7 @@ type CardBoxProps = CardProps & BoxProps;
|
|
|
32
29
|
|
|
33
30
|
export const Card = forwardRef< HTMLElement, CardBoxProps >(
|
|
34
31
|
(
|
|
35
|
-
{ variant = 'primary', title, renderHeader,
|
|
32
|
+
{ variant = 'primary', title, renderHeader, children, ...rest }: CardProps,
|
|
36
33
|
ref: Ref< HTMLElement >
|
|
37
34
|
) => {
|
|
38
35
|
return (
|
|
@@ -41,13 +38,13 @@ export const Card = forwardRef< HTMLElement, CardBoxProps >(
|
|
|
41
38
|
sx={ {
|
|
42
39
|
variant: `cards.${ variant }`,
|
|
43
40
|
} }
|
|
44
|
-
className=
|
|
45
|
-
{ ...
|
|
41
|
+
className="vip-card-component"
|
|
42
|
+
{ ...rest }
|
|
46
43
|
>
|
|
47
44
|
{ renderHeader ? renderHeader( title ) : '' }
|
|
48
45
|
{ title && ! renderHeader && (
|
|
49
46
|
<Box
|
|
50
|
-
className=
|
|
47
|
+
className="vip-card-header-component"
|
|
51
48
|
sx={ {
|
|
52
49
|
variant: `cards.${ variant }.header`,
|
|
53
50
|
} }
|
|
@@ -57,10 +54,9 @@ export const Card = forwardRef< HTMLElement, CardBoxProps >(
|
|
|
57
54
|
) }
|
|
58
55
|
|
|
59
56
|
<Box
|
|
60
|
-
className=
|
|
57
|
+
className="vip-card-body-component"
|
|
61
58
|
sx={ {
|
|
62
59
|
variant: `cards.${ variant }.children`,
|
|
63
|
-
...sx,
|
|
64
60
|
} }
|
|
65
61
|
>
|
|
66
62
|
{ children }
|
|
@@ -101,6 +101,7 @@ export const WizardStep = React.forwardRef< HTMLDivElement, WizardStepProps >(
|
|
|
101
101
|
} }
|
|
102
102
|
data-step={ order }
|
|
103
103
|
data-active={ active || undefined }
|
|
104
|
+
className={ `wizard-step-${ status }` }
|
|
104
105
|
ref={ forwardRef }
|
|
105
106
|
>
|
|
106
107
|
<Flex sx={ { alignItems: 'flex-end', mb: 2 } }>
|