@automattic/vip-design-system 0.30.0 → 0.30.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/Form/Input.js +5 -2
- package/build/system/Form/Validation.js +1 -1
- package/build/system/NewDialog/DialogOverlay.js +1 -2
- package/build/system/NewForm/FormAutocomplete.css +93 -92
- package/build/system/NewForm/FormAutocomplete.js +24 -8
- package/build/system/NewForm/FormAutocomplete.stories.js +60 -10
- package/build/system/NewForm/FormSelectArrow.js +1 -0
- package/build/system/NewForm/FormSelectLoading.js +16 -14
- package/build/system/Notice/Notice.js +1 -1
- package/build/system/Notice/Notice.stories.js +10 -0
- package/build/system/OptionRow/OptionRow.js +9 -6
- package/build/system/OptionRow/OptionRow.stories.js +25 -8
- package/build/system/theme/generated/valet-theme-dark.json +27 -1
- package/build/system/theme/generated/valet-theme-light.json +27 -0
- package/build/system/theme/index.js +3 -3
- package/package.json +1 -1
- package/src/system/Form/Input.js +9 -2
- package/src/system/Form/Validation.js +1 -1
- package/src/system/NewDialog/DialogOverlay.js +1 -3
- package/src/system/NewForm/FormAutocomplete.css +93 -92
- package/src/system/NewForm/FormAutocomplete.js +11 -6
- package/src/system/NewForm/FormAutocomplete.stories.jsx +55 -10
- package/src/system/NewForm/FormSelectArrow.js +1 -0
- package/src/system/NewForm/FormSelectLoading.js +9 -3
- package/src/system/Notice/Notice.js +1 -1
- package/src/system/Notice/Notice.stories.jsx +5 -0
- package/src/system/OptionRow/OptionRow.js +7 -5
- package/src/system/OptionRow/OptionRow.stories.jsx +10 -2
- package/src/system/theme/generated/valet-theme-dark.json +27 -1
- package/src/system/theme/generated/valet-theme-light.json +27 -0
- package/src/system/theme/index.js +2 -1
- package/tokens/valet-core/wpvip-expressive-type.json +2 -2
- package/tokens/valet-core/wpvip-productive-color-dark.json +981 -955
- package/tokens/valet-core/wpvip-productive-color.json +27 -0
|
@@ -38,7 +38,8 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
38
38
|
var variant = _ref.variant,
|
|
39
39
|
label = _ref.label,
|
|
40
40
|
forLabel = _ref.forLabel,
|
|
41
|
-
hasError = _ref.hasError,
|
|
41
|
+
_ref$hasError = _ref.hasError,
|
|
42
|
+
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
42
43
|
required = _ref.required,
|
|
43
44
|
_ref$sx = _ref.sx,
|
|
44
45
|
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
@@ -55,7 +56,9 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
55
56
|
required: required,
|
|
56
57
|
"aria-required": required,
|
|
57
58
|
"aria-describedby": hasError ? "describe-" + forLabel + "-validation" : undefined,
|
|
58
|
-
sx: (0, _extends2["default"])({}, inputStyles, sx
|
|
59
|
+
sx: (0, _extends2["default"])({}, inputStyles, sx, hasError ? {
|
|
60
|
+
borderColor: 'input.border.error'
|
|
61
|
+
} : {})
|
|
59
62
|
}, props)), hasError && errorMessage && (0, _jsxRuntime.jsx)(_.Validation, {
|
|
60
63
|
isValid: false,
|
|
61
64
|
describedId: forLabel,
|
|
@@ -16,7 +16,7 @@ var _md = require("react-icons/md");
|
|
|
16
16
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
17
17
|
|
|
18
18
|
var _excluded = ["children", "isValid", "describedId"];
|
|
19
|
-
var errorColor = '
|
|
19
|
+
var errorColor = 'texts.error';
|
|
20
20
|
var helperColor = 'texts.helper';
|
|
21
21
|
|
|
22
22
|
var Validation = function Validation(_ref) {
|
|
@@ -36,8 +36,7 @@ var DialogOverlay = /*#__PURE__*/_react["default"].forwardRef(function (props, f
|
|
|
36
36
|
bottom: 0,
|
|
37
37
|
inset: 0,
|
|
38
38
|
opacity: 0.7,
|
|
39
|
-
|
|
40
|
-
'linear-gradient(198.09deg,#E5F0F6 2.01%, rgba(235, 238, 242, 0) 43.18%,rgba(249, 234, 232, 0) 47.86%, #FFE9D1 94.31%), linear-gradient(98.65deg, #FFE8E6 0.58%, rgba(255, 233, 214, 0) 52.45%, rgba(255, 233, 219, 0) 53.76%,#FFE9D1 105.86%), #F5F2F1'
|
|
39
|
+
backgroundColor: 'backgrounds.overlay'
|
|
41
40
|
}
|
|
42
41
|
}, props, {
|
|
43
42
|
ref: forwardedRef
|
|
@@ -1,166 +1,167 @@
|
|
|
1
1
|
.autocomplete__wrapper {
|
|
2
|
-
|
|
2
|
+
position: relative;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.autocomplete__hint,
|
|
6
6
|
.autocomplete__input {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
-webkit-appearance: none;
|
|
8
|
+
border: 2px solid #0b0c0c;
|
|
9
|
+
border-radius: 0; /* Safari 10 on iOS adds implicit border rounding. */
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
-moz-box-sizing: border-box;
|
|
12
|
+
-webkit-box-sizing: border-box;
|
|
13
|
+
margin-bottom: 0; /* BUG: Safari 10 on macOS seems to add an implicit margin. */
|
|
14
|
+
width: 100%;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.autocomplete__input {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
position: relative;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.autocomplete__hint {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
color: #b1b4b6;
|
|
24
|
+
position: absolute;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.autocomplete__input--default {
|
|
28
|
-
|
|
28
|
+
padding: 5px;
|
|
29
29
|
}
|
|
30
30
|
.autocomplete__input--focused {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
outline: 3px solid #fd0;
|
|
32
|
+
outline-offset: 0;
|
|
33
|
+
box-shadow: inset 0 0 0 2px;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.autocomplete__input--show-all-values {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
padding: 5px 34px 5px 5px; /* Space for arrow. Other padding should match .autocomplete__input--default. */
|
|
38
|
+
cursor: pointer;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.autocomplete__dropdown-arrow-down {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
/* .autocomplete__dropdown-arrow-down {
|
|
42
|
+
z-index: -1;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
position: absolute;
|
|
45
|
+
right: 8px;
|
|
46
|
+
width: 24px;
|
|
47
|
+
height: 24px;
|
|
48
|
+
top: 10px;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
} */
|
|
50
51
|
|
|
51
52
|
.autocomplete__menu {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
background-color: #fff;
|
|
54
|
+
border: 2px solid #0b0c0c;
|
|
55
|
+
border-top: 0;
|
|
56
|
+
color: #0b0c0c;
|
|
57
|
+
margin: 0;
|
|
58
|
+
max-height: 342px;
|
|
59
|
+
overflow-x: hidden;
|
|
60
|
+
padding: 0;
|
|
61
|
+
width: 100%;
|
|
62
|
+
width: calc( 100% - 4px );
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
.autocomplete__menu--visible {
|
|
65
|
-
|
|
66
|
+
display: block;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
.autocomplete__menu--hidden {
|
|
69
|
-
|
|
70
|
+
display: none;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
.autocomplete__menu--overlay {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
box-shadow: rgba( 0, 0, 0, 0.256863 ) 0px 2px 6px;
|
|
75
|
+
left: 0;
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: 100%;
|
|
78
|
+
z-index: 100;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
.autocomplete__menu--inline {
|
|
81
|
-
|
|
82
|
+
position: relative;
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
.autocomplete__option {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
border-bottom: solid #b1b4b6;
|
|
87
|
+
border-width: 1px 0;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
display: block;
|
|
90
|
+
position: relative;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
.autocomplete__option > * {
|
|
93
|
-
|
|
94
|
+
pointer-events: none;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
.autocomplete__option:first-of-type {
|
|
97
|
-
|
|
98
|
+
border-top-width: 0;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
.autocomplete__option:last-of-type {
|
|
101
|
-
|
|
102
|
+
border-bottom-width: 0;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
.autocomplete__option--odd {
|
|
105
|
-
|
|
106
|
+
background-color: #fafafa;
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
.autocomplete__option--focused,
|
|
109
110
|
.autocomplete__option:hover {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
background-color: #1d70b8;
|
|
112
|
+
border-color: #1d70b8;
|
|
113
|
+
color: white;
|
|
114
|
+
outline: none;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
@media (-ms-high-contrast: active), (forced-colors: active) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
@media ( -ms-high-contrast: active ), ( forced-colors: active ) {
|
|
118
|
+
.autocomplete__menu {
|
|
119
|
+
border-color: FieldText;
|
|
120
|
+
}
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
.autocomplete__option {
|
|
123
|
+
background-color: Field;
|
|
124
|
+
color: FieldText;
|
|
125
|
+
}
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
.autocomplete__option--focused,
|
|
128
|
+
.autocomplete__option:hover {
|
|
129
|
+
forced-color-adjust: none; /* prevent backplate from obscuring text */
|
|
130
|
+
background-color: Highlight;
|
|
131
|
+
border-color: Highlight;
|
|
132
|
+
color: HighlightText;
|
|
132
133
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
/* Prefer SelectedItem / SelectedItemText in browsers that support it */
|
|
135
|
+
background-color: SelectedItem;
|
|
136
|
+
border-color: SelectedItem;
|
|
137
|
+
color: SelectedItemText;
|
|
138
|
+
outline-color: SelectedItemText;
|
|
139
|
+
}
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
.autocomplete__option--no-results {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
background-color: #fafafa;
|
|
144
|
+
color: #646b6f;
|
|
145
|
+
cursor: not-allowed;
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
.autocomplete__hint,
|
|
148
149
|
.autocomplete__input,
|
|
149
150
|
.autocomplete__option {
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
font-size: 16px;
|
|
152
|
+
line-height: 1.25;
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
.autocomplete__hint,
|
|
155
156
|
.autocomplete__option {
|
|
156
|
-
|
|
157
|
+
padding: 5px;
|
|
157
158
|
}
|
|
158
159
|
|
|
159
|
-
@media (min-width: 641px) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
@media ( min-width: 641px ) {
|
|
161
|
+
.autocomplete__hint,
|
|
162
|
+
.autocomplete__input,
|
|
163
|
+
.autocomplete__option {
|
|
164
|
+
font-size: 19px;
|
|
165
|
+
line-height: 1.31579;
|
|
166
|
+
}
|
|
166
167
|
}
|
|
@@ -37,7 +37,7 @@ var _Form = require("../Form");
|
|
|
37
37
|
|
|
38
38
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
39
39
|
|
|
40
|
-
var _excluded = ["autoFilter", "className", "debounce", "displayMenu", "forLabel", "getOptionLabel", "getOptionValue", "isInline", "label", "loading", "minLength", "noOptionsMessage", "onChange", "onInputChange", "options", "required", "searchIcon", "showAllValues", "source", "value"
|
|
40
|
+
var _excluded = ["autoFilter", "className", "debounce", "displayMenu", "dropdownArrow", "errorMessage", "forLabel", "getOptionLabel", "getOptionValue", "hasError", "isInline", "label", "loading", "minLength", "noOptionsMessage", "onChange", "onInputChange", "options", "required", "searchIcon", "showAllValues", "source", "value"];
|
|
41
41
|
|
|
42
42
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
43
43
|
|
|
@@ -130,6 +130,12 @@ var searchIconStyles = {
|
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
+
var DefaultArrow = function DefaultArrow(config) {
|
|
134
|
+
return (0, _jsxRuntime.jsx)(_FormSelectArrow.FormSelectArrow, {
|
|
135
|
+
classNames: config.className
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
|
|
133
139
|
var FormAutocomplete = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef) {
|
|
134
140
|
var _ref$autoFilter = _ref.autoFilter,
|
|
135
141
|
autoFilter = _ref$autoFilter === void 0 ? true : _ref$autoFilter,
|
|
@@ -138,10 +144,14 @@ var FormAutocomplete = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
138
144
|
debounce = _ref$debounce === void 0 ? 0 : _ref$debounce,
|
|
139
145
|
_ref$displayMenu = _ref.displayMenu,
|
|
140
146
|
displayMenu = _ref$displayMenu === void 0 ? 'overlay' : _ref$displayMenu,
|
|
147
|
+
_ref$dropdownArrow = _ref.dropdownArrow,
|
|
148
|
+
dropdownArrow = _ref$dropdownArrow === void 0 ? DefaultArrow : _ref$dropdownArrow,
|
|
149
|
+
errorMessage = _ref.errorMessage,
|
|
141
150
|
_ref$forLabel = _ref.forLabel,
|
|
142
151
|
forLabel = _ref$forLabel === void 0 ? 'vip-autocomplete' : _ref$forLabel,
|
|
143
152
|
getOptionLabel = _ref.getOptionLabel,
|
|
144
153
|
getOptionValue = _ref.getOptionValue,
|
|
154
|
+
hasError = _ref.hasError,
|
|
145
155
|
isInline = _ref.isInline,
|
|
146
156
|
label = _ref.label,
|
|
147
157
|
loading = _ref.loading,
|
|
@@ -149,7 +159,7 @@ var FormAutocomplete = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
149
159
|
minLength = _ref$minLength === void 0 ? 0 : _ref$minLength,
|
|
150
160
|
_ref$noOptionsMessage = _ref.noOptionsMessage,
|
|
151
161
|
noOptionsMessage = _ref$noOptionsMessage === void 0 ? function () {
|
|
152
|
-
return 'No results found.';
|
|
162
|
+
return 'No results found. Type to search.';
|
|
153
163
|
} : _ref$noOptionsMessage,
|
|
154
164
|
_ref$onChange = _ref.onChange,
|
|
155
165
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
@@ -159,11 +169,9 @@ var FormAutocomplete = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
159
169
|
required = _ref.required,
|
|
160
170
|
searchIcon = _ref.searchIcon,
|
|
161
171
|
_ref$showAllValues = _ref.showAllValues,
|
|
162
|
-
showAllValues = _ref$showAllValues === void 0 ?
|
|
172
|
+
showAllValues = _ref$showAllValues === void 0 ? false : _ref$showAllValues,
|
|
163
173
|
source = _ref.source,
|
|
164
174
|
value = _ref.value,
|
|
165
|
-
hasError = _ref.hasError,
|
|
166
|
-
errorMessage = _ref.errorMessage,
|
|
167
175
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
168
176
|
|
|
169
177
|
var _useState = (0, _react.useState)(false),
|
|
@@ -282,8 +290,15 @@ var FormAutocomplete = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
282
290
|
displayMenu: displayMenu,
|
|
283
291
|
onConfirm: onValueChange,
|
|
284
292
|
tNoResults: noOptionsMessage,
|
|
285
|
-
required: required
|
|
286
|
-
|
|
293
|
+
required: required,
|
|
294
|
+
dropdownArrow: showAllValues ? dropdownArrow : function () {
|
|
295
|
+
return '';
|
|
296
|
+
}
|
|
297
|
+
}, props)), loading && (0, _jsxRuntime.jsx)(_FormSelectLoading.FormSelectLoading, {
|
|
298
|
+
sx: {
|
|
299
|
+
right: showAllValues ? 40 : 10
|
|
300
|
+
}
|
|
301
|
+
})]
|
|
287
302
|
})
|
|
288
303
|
}), hasError && errorMessage && (0, _jsxRuntime.jsx)(_Form.Validation, {
|
|
289
304
|
isValid: false,
|
|
@@ -316,6 +331,7 @@ FormAutocomplete.propTypes = {
|
|
|
316
331
|
searchIcon: _propTypes["default"].bool,
|
|
317
332
|
showAllValues: _propTypes["default"].bool,
|
|
318
333
|
source: _propTypes["default"].func,
|
|
319
|
-
value: _propTypes["default"].string
|
|
334
|
+
value: _propTypes["default"].string,
|
|
335
|
+
dropdownArrow: _propTypes["default"].node
|
|
320
336
|
};
|
|
321
337
|
FormAutocomplete.displayName = 'FormAutocomplete';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports["default"] = exports.WithSearchIcon = exports.WithLoading = exports.WithErrors = exports.WithDefaultValue = exports.WithDebounce = exports.WithCustomMessages = exports.Inline = exports.Default = void 0;
|
|
6
|
+
exports["default"] = exports.WithSearchIcon = exports.WithLoading = exports.WithErrors = exports.WithDefaultValue = exports.WithDebounce = exports.WithCustomMessages = exports.WithCustomArrow = exports.WithArrow = exports.Inline = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
@@ -66,17 +66,30 @@ var DefaultComponent = function DefaultComponent(_ref) {
|
|
|
66
66
|
_ref$width = _ref.width,
|
|
67
67
|
width = _ref$width === void 0 ? 250 : _ref$width,
|
|
68
68
|
rest = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
69
|
+
|
|
70
|
+
var _useState = (0, _react.useState)(null),
|
|
71
|
+
selectedValue = _useState[0],
|
|
72
|
+
setSelectedValue = _useState[1];
|
|
73
|
+
|
|
69
74
|
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
70
|
-
children: (0, _jsxRuntime.
|
|
71
|
-
children: (0, _jsxRuntime.jsx)("div", {
|
|
75
|
+
children: (0, _jsxRuntime.jsxs)(Form.Root, {
|
|
76
|
+
children: [(0, _jsxRuntime.jsx)("div", {
|
|
72
77
|
sx: {
|
|
73
78
|
width: width
|
|
74
79
|
},
|
|
75
80
|
children: (0, _jsxRuntime.jsx)(Form.Autocomplete, (0, _extends2["default"])({
|
|
76
81
|
forLabel: "form-autocomplete",
|
|
77
|
-
label: label
|
|
82
|
+
label: label,
|
|
83
|
+
onChange: function onChange(obj, val) {
|
|
84
|
+
setSelectedValue(val);
|
|
85
|
+
}
|
|
78
86
|
}, rest))
|
|
79
|
-
})
|
|
87
|
+
}), (0, _jsxRuntime.jsxs)("div", {
|
|
88
|
+
sx: {
|
|
89
|
+
mt: 3
|
|
90
|
+
},
|
|
91
|
+
children: ["Selected value: ", selectedValue]
|
|
92
|
+
})]
|
|
80
93
|
})
|
|
81
94
|
});
|
|
82
95
|
};
|
|
@@ -85,7 +98,9 @@ var Default = function Default() {
|
|
|
85
98
|
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
86
99
|
children: (0, _jsxRuntime.jsx)(DefaultComponent, (0, _extends2["default"])({
|
|
87
100
|
required: true
|
|
88
|
-
}, args
|
|
101
|
+
}, args, {
|
|
102
|
+
placeholder: "Start typing..."
|
|
103
|
+
}))
|
|
89
104
|
});
|
|
90
105
|
};
|
|
91
106
|
|
|
@@ -136,9 +151,9 @@ var WithLoading = function WithLoading() {
|
|
|
136
151
|
exports.WithLoading = WithLoading;
|
|
137
152
|
|
|
138
153
|
var WithDebounce = function WithDebounce() {
|
|
139
|
-
var
|
|
140
|
-
value =
|
|
141
|
-
setValue =
|
|
154
|
+
var _useState2 = (0, _react.useState)(null),
|
|
155
|
+
value = _useState2[0],
|
|
156
|
+
setValue = _useState2[1];
|
|
142
157
|
|
|
143
158
|
var customArgs = (0, _extends2["default"])({}, args, {
|
|
144
159
|
minLength: 3,
|
|
@@ -179,4 +194,39 @@ var WithErrors = function WithErrors() {
|
|
|
179
194
|
});
|
|
180
195
|
};
|
|
181
196
|
|
|
182
|
-
exports.WithErrors = WithErrors;
|
|
197
|
+
exports.WithErrors = WithErrors;
|
|
198
|
+
|
|
199
|
+
var WithArrow = function WithArrow() {
|
|
200
|
+
var customArgs = (0, _extends2["default"])({}, args, {
|
|
201
|
+
showAllValues: true
|
|
202
|
+
});
|
|
203
|
+
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
204
|
+
children: (0, _jsxRuntime.jsx)(DefaultComponent, (0, _extends2["default"])({}, customArgs))
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
exports.WithArrow = WithArrow;
|
|
209
|
+
|
|
210
|
+
var WithCustomArrow = function WithCustomArrow() {
|
|
211
|
+
var customArgs = (0, _extends2["default"])({}, args, {
|
|
212
|
+
showAllValues: true,
|
|
213
|
+
// eslint-disable-next-line react/display-name
|
|
214
|
+
dropdownArrow: function dropdownArrow() {
|
|
215
|
+
return (0, _jsxRuntime.jsx)("span", {
|
|
216
|
+
sx: {
|
|
217
|
+
position: 'absolute',
|
|
218
|
+
top: '2px',
|
|
219
|
+
right: '10px',
|
|
220
|
+
pointerEvents: 'none'
|
|
221
|
+
},
|
|
222
|
+
children: "\uD83D\uDC47"
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
227
|
+
children: (0, _jsxRuntime.jsx)(DefaultComponent, (0, _extends2["default"])({}, customArgs))
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
exports.WithCustomArrow = WithCustomArrow;
|
|
232
|
+
WithCustomArrow.displayName = 'WithCustomArrow';
|
|
@@ -36,6 +36,7 @@ var FormSelectArrow = /*#__PURE__*/_react["default"].forwardRef(function (props,
|
|
|
36
36
|
borderLeftStyle: _Input.baseControlBorderStyle.borderStyle,
|
|
37
37
|
borderLeftColor: _Input.baseControlBorderStyle.borderColor,
|
|
38
38
|
right: '10px',
|
|
39
|
+
top: '7px',
|
|
39
40
|
pointerEvents: 'none',
|
|
40
41
|
svg: {
|
|
41
42
|
fill: _Input.baseControlBorderStyle.borderColor
|
|
@@ -7,8 +7,12 @@ exports.FormSelectLoading = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
|
11
13
|
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
12
16
|
var _ai = require("react-icons/ai");
|
|
13
17
|
|
|
14
18
|
var _react2 = require("@emotion/react");
|
|
@@ -17,15 +21,7 @@ var _Input = require("../Form/Input.styles");
|
|
|
17
21
|
|
|
18
22
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* External dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Internal dependencies
|
|
28
|
-
*/
|
|
24
|
+
var _excluded = ["sx"];
|
|
29
25
|
var kf = (0, _react2.keyframes)({
|
|
30
26
|
from: {
|
|
31
27
|
transform: 'rotate(0deg)'
|
|
@@ -35,23 +31,29 @@ var kf = (0, _react2.keyframes)({
|
|
|
35
31
|
}
|
|
36
32
|
});
|
|
37
33
|
|
|
38
|
-
var FormSelectLoading = /*#__PURE__*/_react["default"].forwardRef(function (
|
|
34
|
+
var FormSelectLoading = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef) {
|
|
35
|
+
var _ref$sx = _ref.sx,
|
|
36
|
+
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
37
|
+
rest = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
39
38
|
return (0, _jsxRuntime.jsx)(_ai.AiOutlineLoading3Quarters, (0, _extends2["default"])({
|
|
40
39
|
ref: forwardRef,
|
|
41
40
|
"aria-hidden": "true",
|
|
42
41
|
size: 18,
|
|
43
|
-
sx: {
|
|
42
|
+
sx: (0, _extends2["default"])({
|
|
44
43
|
position: 'absolute',
|
|
45
|
-
right:
|
|
44
|
+
right: 10,
|
|
46
45
|
pointerEvents: 'none',
|
|
47
46
|
animation: kf + " 1s infinite linear",
|
|
48
47
|
opacity: 0.5,
|
|
49
48
|
svg: {
|
|
50
49
|
fill: _Input.inputBaseText
|
|
51
50
|
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
51
|
+
}, sx)
|
|
52
|
+
}, rest));
|
|
54
53
|
});
|
|
55
54
|
|
|
56
55
|
exports.FormSelectLoading = FormSelectLoading;
|
|
56
|
+
FormSelectLoading.propTypes = {
|
|
57
|
+
sx: _propTypes["default"].object
|
|
58
|
+
};
|
|
57
59
|
FormSelectLoading.displayName = 'FormSelectLoading';
|
|
@@ -75,6 +75,16 @@ var Default = function Default() {
|
|
|
75
75
|
href: "/?path=/story/avatar--default",
|
|
76
76
|
children: "A link to Avatar"
|
|
77
77
|
})]
|
|
78
|
+
}), (0, _jsxRuntime.jsxs)(_.Notice, {
|
|
79
|
+
variant: "alert",
|
|
80
|
+
sx: {
|
|
81
|
+
mb: 4
|
|
82
|
+
},
|
|
83
|
+
title: "Please read this first",
|
|
84
|
+
children: ["This notice has a title and children and", ' ', (0, _jsxRuntime.jsx)(_.Link, {
|
|
85
|
+
href: "/?path=/story/avatar--default",
|
|
86
|
+
children: "A link to Avatar"
|
|
87
|
+
})]
|
|
78
88
|
}), (0, _jsxRuntime.jsx)(_.Notice, {
|
|
79
89
|
variant: "alert",
|
|
80
90
|
sx: {
|
|
@@ -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", "badge", "label", "inline", "subTitle", "body", "meta", "small", "disabled", "order", "className", "variant"];
|
|
24
|
+
var _excluded = ["image", "badge", "label", "inline", "subTitle", "body", "meta", "small", "disabled", "order", "className", "titleVariant", "variant"];
|
|
25
25
|
var disabledStyles = {
|
|
26
26
|
border: '1px solid',
|
|
27
27
|
borderColor: 'optionRow.border',
|
|
@@ -60,8 +60,10 @@ var OptionRow = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwar
|
|
|
60
60
|
order = _ref$order === void 0 ? null : _ref$order,
|
|
61
61
|
_ref$className = _ref.className,
|
|
62
62
|
className = _ref$className === void 0 ? null : _ref$className,
|
|
63
|
+
_ref$titleVariant = _ref.titleVariant,
|
|
64
|
+
titleVariant = _ref$titleVariant === void 0 ? 'h3' : _ref$titleVariant,
|
|
63
65
|
_ref$variant = _ref.variant,
|
|
64
|
-
variant = _ref$variant === void 0 ? '
|
|
66
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
65
67
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
66
68
|
var mergedCard = disabled ? disabledStyles : {};
|
|
67
69
|
var inlineStyles = inline ? gridInlineStyle : regularGridStyle(small);
|
|
@@ -84,8 +86,8 @@ var OptionRow = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwar
|
|
|
84
86
|
display: ['inline-block', 'inline-block', 'block'],
|
|
85
87
|
p: small ? 12 : 20,
|
|
86
88
|
flex: '0 0 auto',
|
|
87
|
-
bg:
|
|
88
|
-
color:
|
|
89
|
+
bg: "optionRow." + variant + ".background",
|
|
90
|
+
color: "optionRow." + variant + ".icon",
|
|
89
91
|
borderRadius: 1
|
|
90
92
|
}, mergedCard),
|
|
91
93
|
children: /*#__PURE__*/_react["default"].isValidElement(image) ? image : (0, _jsxRuntime.jsx)("img", {
|
|
@@ -102,7 +104,7 @@ var OptionRow = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwar
|
|
|
102
104
|
flex: '1 1 auto'
|
|
103
105
|
},
|
|
104
106
|
children: [(0, _jsxRuntime.jsx)(_.Heading, {
|
|
105
|
-
|
|
107
|
+
titleVariant: titleVariant,
|
|
106
108
|
sx: {
|
|
107
109
|
mb: subTitle || body ? 1 : 0,
|
|
108
110
|
fontSize: 2,
|
|
@@ -169,5 +171,6 @@ OptionRow.propTypes = {
|
|
|
169
171
|
disabled: _propTypes["default"].bool,
|
|
170
172
|
order: _propTypes["default"].number,
|
|
171
173
|
className: _propTypes["default"].any,
|
|
172
|
-
|
|
174
|
+
titleVariant: _propTypes["default"].string,
|
|
175
|
+
variant: _propTypes["default"].oneOf(['default', 'alt'])
|
|
173
176
|
};
|