@automattic/vip-design-system 0.23.5 → 0.23.6
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/.github/workflows/codeql-analysis.yml +29 -29
- package/.github/workflows/nodejs.yaml +3 -3
- package/build/system/Link/Link.js +2 -2
- package/build/system/Notice/Notice.js +8 -4
- package/build/system/Notice/Notice.stories.js +10 -12
- package/build/system/OptionRow/OptionRow.js +27 -17
- package/build/system/OptionRow/OptionRow.stories.js +6 -5
- package/package.json +1 -1
- package/src/system/Link/Link.js +1 -1
- package/src/system/Notice/Notice.js +15 -2
- package/src/system/Notice/Notice.stories.jsx +13 -5
- package/src/system/OptionRow/OptionRow.js +21 -10
- package/src/system/OptionRow/OptionRow.stories.jsx +8 -5
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
10
|
# supported CodeQL languages.
|
|
11
11
|
#
|
|
12
|
-
name:
|
|
12
|
+
name: 'CodeQL'
|
|
13
13
|
|
|
14
14
|
on:
|
|
15
15
|
push:
|
|
16
|
-
branches: [
|
|
16
|
+
branches: [master]
|
|
17
17
|
pull_request:
|
|
18
18
|
# The branches below must be a subset of the branches above
|
|
19
|
-
branches: [
|
|
19
|
+
branches: [master]
|
|
20
20
|
schedule:
|
|
21
21
|
- cron: '32 21 * * 6'
|
|
22
22
|
|
|
@@ -32,40 +32,40 @@ jobs:
|
|
|
32
32
|
strategy:
|
|
33
33
|
fail-fast: false
|
|
34
34
|
matrix:
|
|
35
|
-
language: [
|
|
35
|
+
language: ['javascript']
|
|
36
36
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
|
37
37
|
# Learn more:
|
|
38
38
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
|
39
39
|
|
|
40
40
|
steps:
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
- name: Checkout repository
|
|
42
|
+
uses: actions/checkout@v3
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
# Initializes the CodeQL tools for scanning.
|
|
45
|
+
- name: Initialize CodeQL
|
|
46
|
+
uses: github/codeql-action/init@v1
|
|
47
|
+
with:
|
|
48
|
+
languages: ${{ matrix.language }}
|
|
49
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
50
|
+
# By default, queries listed here will override any specified in a config file.
|
|
51
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
52
|
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
55
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
|
56
|
+
- name: Autobuild
|
|
57
|
+
uses: github/codeql-action/autobuild@v1
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
60
|
+
# 📚 https://git.io/JvXDl
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
63
|
+
# and modify them (or add more) to build your code if your project
|
|
64
|
+
# uses a compiled language
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
#- run: |
|
|
67
|
+
# make bootstrap
|
|
68
|
+
# make release
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
- name: Perform CodeQL Analysis
|
|
71
|
+
uses: github/codeql-action/analyze@v1
|
|
@@ -10,14 +10,14 @@ jobs:
|
|
|
10
10
|
|
|
11
11
|
strategy:
|
|
12
12
|
matrix:
|
|
13
|
-
node-version: [
|
|
13
|
+
node-version: [16]
|
|
14
14
|
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v3
|
|
17
17
|
with:
|
|
18
18
|
persist-credentials: false
|
|
19
19
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
20
|
-
uses: actions/setup-node@
|
|
20
|
+
uses: actions/setup-node@v3
|
|
21
21
|
with:
|
|
22
22
|
node-version: ${{ matrix.node-version }}
|
|
23
23
|
- run: npm install -g npm@7.24.2
|
|
@@ -24,7 +24,7 @@ var Link = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef)
|
|
|
24
24
|
active = _ref$active === void 0 ? false : _ref$active,
|
|
25
25
|
sx = _ref.sx,
|
|
26
26
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
27
|
-
return (0, _jsxRuntime.jsx)(_themeUi.Link, (0, _extends2["default"])({
|
|
27
|
+
return (0, _jsxRuntime.jsx)(_themeUi.Link, (0, _extends2["default"])({
|
|
28
28
|
sx: (0, _extends2["default"])({
|
|
29
29
|
color: active ? 'links.active' : 'link',
|
|
30
30
|
textDdecorationThickness: '0.1em',
|
|
@@ -47,7 +47,7 @@ var Link = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef)
|
|
|
47
47
|
}
|
|
48
48
|
}, sx),
|
|
49
49
|
ref: forwardRef
|
|
50
|
-
}));
|
|
50
|
+
}, props));
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
exports.Link = Link;
|
|
@@ -21,7 +21,7 @@ var _ = require("../");
|
|
|
21
21
|
|
|
22
22
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
23
23
|
|
|
24
|
-
var _excluded = ["variant", "inline", "children", "title", "sx", "className"];
|
|
24
|
+
var _excluded = ["variant", "inline", "children", "title", "sx", "className", "headingVariant"];
|
|
25
25
|
|
|
26
26
|
var NoticeIcon = function NoticeIcon(_ref) {
|
|
27
27
|
var color = _ref.color,
|
|
@@ -68,6 +68,8 @@ var Notice = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, forwardR
|
|
|
68
68
|
sx = _ref2$sx === void 0 ? {} : _ref2$sx,
|
|
69
69
|
_ref2$className = _ref2.className,
|
|
70
70
|
className = _ref2$className === void 0 ? null : _ref2$className,
|
|
71
|
+
_ref2$headingVariant = _ref2.headingVariant,
|
|
72
|
+
headingVariant = _ref2$headingVariant === void 0 ? 'p' : _ref2$headingVariant,
|
|
71
73
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref2, _excluded);
|
|
72
74
|
var color = 'yellow';
|
|
73
75
|
|
|
@@ -117,11 +119,12 @@ var Notice = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, forwardR
|
|
|
117
119
|
ml: 3
|
|
118
120
|
},
|
|
119
121
|
children: [title && (0, _jsxRuntime.jsx)(_.Heading, {
|
|
120
|
-
|
|
121
|
-
as: "p",
|
|
122
|
+
as: headingVariant,
|
|
122
123
|
sx: {
|
|
123
124
|
color: color + ".100",
|
|
124
|
-
mb: 0
|
|
125
|
+
mb: 0,
|
|
126
|
+
fontSize: 2,
|
|
127
|
+
fontWeight: 'bold'
|
|
125
128
|
},
|
|
126
129
|
children: title
|
|
127
130
|
}), children]
|
|
@@ -139,5 +142,6 @@ Notice.propTypes = {
|
|
|
139
142
|
sx: _propTypes["default"].object,
|
|
140
143
|
title: _propTypes["default"].node,
|
|
141
144
|
variant: _propTypes["default"].string,
|
|
145
|
+
headingVariant: _propTypes["default"].string,
|
|
142
146
|
className: _propTypes["default"].any
|
|
143
147
|
};
|
|
@@ -26,20 +26,19 @@ exports["default"] = _default;
|
|
|
26
26
|
|
|
27
27
|
var Default = function Default() {
|
|
28
28
|
return (0, _jsxRuntime.jsxs)(_react["default"].Fragment, {
|
|
29
|
-
children: [(0, _jsxRuntime.
|
|
29
|
+
children: [(0, _jsxRuntime.jsx)(_.Notice, {
|
|
30
30
|
variant: "alert",
|
|
31
|
+
headingVariant: "h2",
|
|
31
32
|
sx: {
|
|
32
33
|
mb: 4
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children: "Your site is ready to launch!"
|
|
37
|
-
}), (0, _jsxRuntime.jsx)(_.Text, {
|
|
35
|
+
title: "Your site is ready to launch!",
|
|
36
|
+
children: (0, _jsxRuntime.jsx)(_.Text, {
|
|
38
37
|
sx: {
|
|
39
38
|
mb: 0
|
|
40
39
|
},
|
|
41
40
|
children: "It looks like you\u2018re ready to share your application with the world."
|
|
42
|
-
})
|
|
41
|
+
})
|
|
43
42
|
}), (0, _jsxRuntime.jsxs)(_.Notice, {
|
|
44
43
|
variant: "success",
|
|
45
44
|
sx: {
|
|
@@ -66,15 +65,14 @@ var Default = function Default() {
|
|
|
66
65
|
},
|
|
67
66
|
children: "This notice has a title and children"
|
|
68
67
|
})
|
|
69
|
-
}), (0, _jsxRuntime.
|
|
68
|
+
}), (0, _jsxRuntime.jsx)(_.Notice, {
|
|
70
69
|
variant: "alert",
|
|
71
70
|
sx: {
|
|
72
71
|
mb: 4
|
|
73
72
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}), (0, _jsxRuntime.jsxs)("ul", {
|
|
73
|
+
title: "There are errors in your form",
|
|
74
|
+
headingVariant: "h2",
|
|
75
|
+
children: (0, _jsxRuntime.jsxs)("ul", {
|
|
78
76
|
sx: {
|
|
79
77
|
mb: 0
|
|
80
78
|
},
|
|
@@ -94,7 +92,7 @@ var Default = function Default() {
|
|
|
94
92
|
children: "Please agree to the terms."
|
|
95
93
|
})
|
|
96
94
|
})]
|
|
97
|
-
})
|
|
95
|
+
})
|
|
98
96
|
})]
|
|
99
97
|
});
|
|
100
98
|
};
|
|
@@ -21,7 +21,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
21
21
|
|
|
22
22
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
23
23
|
|
|
24
|
-
var _excluded = ["image", "icon", "badge", "label", "inline", "subTitle", "body", "meta", "
|
|
24
|
+
var _excluded = ["image", "icon", "badge", "label", "inline", "subTitle", "body", "meta", "small", "disabled", "order", "className", "variant"];
|
|
25
25
|
var disabledStyles = {
|
|
26
26
|
border: '1px solid',
|
|
27
27
|
borderColor: 'borders.2',
|
|
@@ -53,7 +53,6 @@ var OptionRow = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwar
|
|
|
53
53
|
subTitle = _ref.subTitle,
|
|
54
54
|
body = _ref.body,
|
|
55
55
|
meta = _ref.meta,
|
|
56
|
-
to = _ref.to,
|
|
57
56
|
_ref$small = _ref.small,
|
|
58
57
|
small = _ref$small === void 0 ? false : _ref$small,
|
|
59
58
|
_ref$disabled = _ref.disabled,
|
|
@@ -67,19 +66,15 @@ var OptionRow = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwar
|
|
|
67
66
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
68
67
|
var mergedCard = disabled ? disabledStyles : {};
|
|
69
68
|
var inlineStyles = inline ? gridInlineStyle : regularGridStyle(small);
|
|
70
|
-
return (0, _jsxRuntime.jsxs)(_.Grid,
|
|
71
|
-
to: to,
|
|
69
|
+
return (0, _jsxRuntime.jsxs)(_.Grid, {
|
|
72
70
|
columns: [1, 1, 'auto 1fr auto'],
|
|
73
71
|
gap: [3, 3, "" + (small ? 3 : 4)],
|
|
74
72
|
"data-order": order || undefined,
|
|
75
73
|
className: (0, _classnames["default"])('vip-option-row-component', className),
|
|
76
|
-
ref: forwardRef
|
|
77
|
-
}, props, {
|
|
74
|
+
ref: forwardRef,
|
|
78
75
|
sx: (0, _extends2["default"])({
|
|
76
|
+
position: 'relative',
|
|
79
77
|
alignItems: 'center',
|
|
80
|
-
cursor: disabled ? 'auto' : 'pointer',
|
|
81
|
-
textDecoration: 'none',
|
|
82
|
-
color: 'text',
|
|
83
78
|
'&:hover': !disabled && {
|
|
84
79
|
backgroundColor: 'hover'
|
|
85
80
|
}
|
|
@@ -107,19 +102,35 @@ var OptionRow = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwar
|
|
|
107
102
|
sx: {
|
|
108
103
|
flex: '1 1 auto'
|
|
109
104
|
},
|
|
110
|
-
children: [(0, _jsxRuntime.
|
|
105
|
+
children: [(0, _jsxRuntime.jsx)(_.Heading, {
|
|
111
106
|
variant: variant,
|
|
112
107
|
sx: {
|
|
113
108
|
mb: subTitle || body ? 1 : 0,
|
|
114
109
|
fontSize: 2,
|
|
115
110
|
fontWeight: 'bold'
|
|
116
111
|
},
|
|
117
|
-
children:
|
|
112
|
+
children: (0, _jsxRuntime.jsxs)(_.Link, (0, _extends2["default"])({
|
|
113
|
+
as: 'a',
|
|
118
114
|
sx: {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
cursor: disabled ? 'auto' : 'pointer',
|
|
116
|
+
color: disabled ? 'text' : 'link',
|
|
117
|
+
'&:after': {
|
|
118
|
+
content: '""',
|
|
119
|
+
position: 'absolute',
|
|
120
|
+
top: 0,
|
|
121
|
+
right: 0,
|
|
122
|
+
bottom: 0,
|
|
123
|
+
left: 0
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, props, {
|
|
127
|
+
children: [label, badge && (0, _jsxRuntime.jsx)(_.Badge, {
|
|
128
|
+
sx: {
|
|
129
|
+
marginLeft: 2
|
|
130
|
+
},
|
|
131
|
+
children: badge
|
|
132
|
+
})]
|
|
133
|
+
}))
|
|
123
134
|
}), subTitle && (0, _jsxRuntime.jsx)(_.Text, {
|
|
124
135
|
sx: {
|
|
125
136
|
mb: 1,
|
|
@@ -142,7 +153,7 @@ var OptionRow = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwar
|
|
|
142
153
|
"aria-hidden": "true"
|
|
143
154
|
})
|
|
144
155
|
})]
|
|
145
|
-
})
|
|
156
|
+
});
|
|
146
157
|
});
|
|
147
158
|
|
|
148
159
|
exports.OptionRow = OptionRow;
|
|
@@ -156,7 +167,6 @@ OptionRow.propTypes = {
|
|
|
156
167
|
subTitle: _propTypes["default"].node,
|
|
157
168
|
body: _propTypes["default"].node,
|
|
158
169
|
meta: _propTypes["default"].node,
|
|
159
|
-
to: _propTypes["default"].string,
|
|
160
170
|
small: _propTypes["default"].bool,
|
|
161
171
|
disabled: _propTypes["default"].bool,
|
|
162
172
|
order: _propTypes["default"].number,
|
|
@@ -24,13 +24,13 @@ var Default = function Default() {
|
|
|
24
24
|
return (0, _jsxRuntime.jsxs)(_.Box, {
|
|
25
25
|
children: [(0, _jsxRuntime.jsx)(_.OptionRow, {
|
|
26
26
|
image: image1,
|
|
27
|
-
label: "Option Row",
|
|
27
|
+
label: "Option Row 1",
|
|
28
28
|
subTitle: "Mostly used to link off to other pages.",
|
|
29
29
|
as: "a",
|
|
30
30
|
href: "http://google.com/"
|
|
31
31
|
}), (0, _jsxRuntime.jsx)(_.OptionRow, {
|
|
32
32
|
image: image2,
|
|
33
|
-
label: "Option Row",
|
|
33
|
+
label: "Option Row 2",
|
|
34
34
|
subTitle: "Mostly used to link off to other pages.",
|
|
35
35
|
as: "a",
|
|
36
36
|
href: "http://google.com/",
|
|
@@ -44,10 +44,11 @@ var Default = function Default() {
|
|
|
44
44
|
meta: ""
|
|
45
45
|
}), (0, _jsxRuntime.jsx)(_.OptionRow, {
|
|
46
46
|
image: image2,
|
|
47
|
-
label: "Custom heading HTML
|
|
47
|
+
label: "Custom heading HTML h2",
|
|
48
48
|
subTitle: "Use the variant prop to adjust the heading structure",
|
|
49
|
-
as:
|
|
50
|
-
|
|
49
|
+
as: "a",
|
|
50
|
+
href: "http://google.com/",
|
|
51
|
+
variant: "h2",
|
|
51
52
|
meta: ""
|
|
52
53
|
})]
|
|
53
54
|
});
|
package/package.json
CHANGED
package/src/system/Link/Link.js
CHANGED
|
@@ -9,7 +9,6 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
|
|
10
10
|
const Link = React.forwardRef( ( { active = false, sx, ...props }, forwardRef ) => (
|
|
11
11
|
<ThemeLink
|
|
12
|
-
{ ...props }
|
|
13
12
|
sx={ {
|
|
14
13
|
color: active ? 'links.active' : 'link',
|
|
15
14
|
textDdecorationThickness: '0.1em',
|
|
@@ -29,6 +28,7 @@ const Link = React.forwardRef( ( { active = false, sx, ...props }, forwardRef )
|
|
|
29
28
|
...sx,
|
|
30
29
|
} }
|
|
31
30
|
ref={ forwardRef }
|
|
31
|
+
{ ...props }
|
|
32
32
|
/>
|
|
33
33
|
) );
|
|
34
34
|
|
|
@@ -38,7 +38,16 @@ NoticeIcon.propTypes = {
|
|
|
38
38
|
|
|
39
39
|
const Notice = React.forwardRef(
|
|
40
40
|
(
|
|
41
|
-
{
|
|
41
|
+
{
|
|
42
|
+
variant = 'warning',
|
|
43
|
+
inline = false,
|
|
44
|
+
children,
|
|
45
|
+
title,
|
|
46
|
+
sx = {},
|
|
47
|
+
className = null,
|
|
48
|
+
headingVariant = 'p',
|
|
49
|
+
...props
|
|
50
|
+
},
|
|
42
51
|
forwardRef
|
|
43
52
|
) => {
|
|
44
53
|
let color = 'yellow';
|
|
@@ -88,7 +97,10 @@ const Notice = React.forwardRef(
|
|
|
88
97
|
|
|
89
98
|
<Box sx={ { ml: 3 } }>
|
|
90
99
|
{ title && (
|
|
91
|
-
<Heading
|
|
100
|
+
<Heading
|
|
101
|
+
as={ headingVariant }
|
|
102
|
+
sx={ { color: `${ color }.100`, mb: 0, fontSize: 2, fontWeight: 'bold' } }
|
|
103
|
+
>
|
|
92
104
|
{ title }
|
|
93
105
|
</Heading>
|
|
94
106
|
) }
|
|
@@ -109,6 +121,7 @@ Notice.propTypes = {
|
|
|
109
121
|
sx: PropTypes.object,
|
|
110
122
|
title: PropTypes.node,
|
|
111
123
|
variant: PropTypes.string,
|
|
124
|
+
headingVariant: PropTypes.string,
|
|
112
125
|
className: PropTypes.any,
|
|
113
126
|
};
|
|
114
127
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { Notice, Text } from '..';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
title: 'Notice',
|
|
@@ -15,8 +15,12 @@ export default {
|
|
|
15
15
|
|
|
16
16
|
export const Default = () => (
|
|
17
17
|
<React.Fragment>
|
|
18
|
-
<Notice
|
|
19
|
-
|
|
18
|
+
<Notice
|
|
19
|
+
variant="alert"
|
|
20
|
+
headingVariant="h2"
|
|
21
|
+
sx={ { mb: 4 } }
|
|
22
|
+
title="Your site is ready to launch!"
|
|
23
|
+
>
|
|
20
24
|
<Text sx={ { mb: 0 } }>
|
|
21
25
|
It looks like you‘re ready to share your application with the world.
|
|
22
26
|
</Text>
|
|
@@ -32,8 +36,12 @@ export const Default = () => (
|
|
|
32
36
|
<Text sx={ { mb: 0 } }>This notice has a title and children</Text>
|
|
33
37
|
</Notice>
|
|
34
38
|
|
|
35
|
-
<Notice
|
|
36
|
-
|
|
39
|
+
<Notice
|
|
40
|
+
variant="alert"
|
|
41
|
+
sx={ { mb: 4 } }
|
|
42
|
+
title="There are errors in your form"
|
|
43
|
+
headingVariant="h2"
|
|
44
|
+
>
|
|
37
45
|
<ul sx={ { mb: 0 } }>
|
|
38
46
|
<li>
|
|
39
47
|
<a href="#name">Please enter your name.</a>
|
|
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import { Badge, Box, Grid, Heading, Text } from '..';
|
|
13
|
+
import { Badge, Box, Grid, Heading, Text, Link } from '..';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
|
|
16
16
|
const disabledStyles = {
|
|
@@ -44,7 +44,6 @@ const OptionRow = React.forwardRef(
|
|
|
44
44
|
subTitle,
|
|
45
45
|
body,
|
|
46
46
|
meta,
|
|
47
|
-
to,
|
|
48
47
|
small = false,
|
|
49
48
|
disabled = false,
|
|
50
49
|
order = null,
|
|
@@ -59,18 +58,14 @@ const OptionRow = React.forwardRef(
|
|
|
59
58
|
|
|
60
59
|
return (
|
|
61
60
|
<Grid
|
|
62
|
-
to={ to }
|
|
63
61
|
columns={ [ 1, 1, 'auto 1fr auto' ] }
|
|
64
62
|
gap={ [ 3, 3, `${ small ? 3 : 4 }` ] }
|
|
65
63
|
data-order={ order || undefined }
|
|
66
64
|
className={ classNames( 'vip-option-row-component', className ) }
|
|
67
65
|
ref={ forwardRef }
|
|
68
|
-
{ ...props }
|
|
69
66
|
sx={ {
|
|
67
|
+
position: 'relative',
|
|
70
68
|
alignItems: 'center',
|
|
71
|
-
cursor: disabled ? 'auto' : 'pointer',
|
|
72
|
-
textDecoration: 'none',
|
|
73
|
-
color: 'text',
|
|
74
69
|
'&:hover': ! disabled && {
|
|
75
70
|
backgroundColor: 'hover',
|
|
76
71
|
},
|
|
@@ -106,8 +101,25 @@ const OptionRow = React.forwardRef(
|
|
|
106
101
|
variant={ variant }
|
|
107
102
|
sx={ { mb: subTitle || body ? 1 : 0, fontSize: 2, fontWeight: 'bold' } }
|
|
108
103
|
>
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
<Link
|
|
105
|
+
as={ 'a' }
|
|
106
|
+
sx={ {
|
|
107
|
+
cursor: disabled ? 'auto' : 'pointer',
|
|
108
|
+
color: disabled ? 'text' : 'link',
|
|
109
|
+
'&:after': {
|
|
110
|
+
content: '""',
|
|
111
|
+
position: 'absolute',
|
|
112
|
+
top: 0,
|
|
113
|
+
right: 0,
|
|
114
|
+
bottom: 0,
|
|
115
|
+
left: 0,
|
|
116
|
+
},
|
|
117
|
+
} }
|
|
118
|
+
{ ...props }
|
|
119
|
+
>
|
|
120
|
+
{ label }
|
|
121
|
+
{ badge && <Badge sx={ { marginLeft: 2 } }>{ badge }</Badge> }
|
|
122
|
+
</Link>
|
|
111
123
|
</Heading>
|
|
112
124
|
{ subTitle && <Text sx={ { mb: 1, color: 'text' } }>{ subTitle }</Text> }
|
|
113
125
|
{ body && <Text sx={ { mb: 0 } }>{ body }</Text> }
|
|
@@ -137,7 +149,6 @@ OptionRow.propTypes = {
|
|
|
137
149
|
subTitle: PropTypes.node,
|
|
138
150
|
body: PropTypes.node,
|
|
139
151
|
meta: PropTypes.node,
|
|
140
|
-
to: PropTypes.string,
|
|
141
152
|
small: PropTypes.bool,
|
|
142
153
|
disabled: PropTypes.bool,
|
|
143
154
|
order: PropTypes.number,
|
|
@@ -19,19 +19,20 @@ export const Default = () => (
|
|
|
19
19
|
<Box>
|
|
20
20
|
<OptionRow
|
|
21
21
|
image={ image1 }
|
|
22
|
-
label="Option Row"
|
|
22
|
+
label="Option Row 1"
|
|
23
23
|
subTitle="Mostly used to link off to other pages."
|
|
24
24
|
as="a"
|
|
25
25
|
href="http://google.com/"
|
|
26
26
|
/>
|
|
27
27
|
<OptionRow
|
|
28
28
|
image={ image2 }
|
|
29
|
-
label="Option Row"
|
|
29
|
+
label="Option Row 2"
|
|
30
30
|
subTitle="Mostly used to link off to other pages."
|
|
31
31
|
as="a"
|
|
32
32
|
href="http://google.com/"
|
|
33
33
|
order={ 2 }
|
|
34
34
|
/>
|
|
35
|
+
|
|
35
36
|
<OptionRow
|
|
36
37
|
image={ image2 }
|
|
37
38
|
label="Option Row – Disabled"
|
|
@@ -40,12 +41,14 @@ export const Default = () => (
|
|
|
40
41
|
disabled
|
|
41
42
|
meta=""
|
|
42
43
|
/>
|
|
44
|
+
|
|
43
45
|
<OptionRow
|
|
44
46
|
image={ image2 }
|
|
45
|
-
label="Custom heading HTML
|
|
47
|
+
label="Custom heading HTML h2"
|
|
46
48
|
subTitle="Use the variant prop to adjust the heading structure"
|
|
47
|
-
as=
|
|
48
|
-
|
|
49
|
+
as="a"
|
|
50
|
+
href="http://google.com/"
|
|
51
|
+
variant="h2"
|
|
49
52
|
meta=""
|
|
50
53
|
/>
|
|
51
54
|
</Box>
|