@zendeskgarden/react-forms 8.57.0 → 8.58.0
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/dist/index.cjs.js +1158 -1686
- package/dist/index.esm.js +1159 -1687
- package/dist/typings/styled/range/StyledSlider.d.ts +4 -5
- package/dist/typings/types/index.d.ts +4 -2
- package/package.json +5 -4
package/dist/index.cjs.js
CHANGED
|
@@ -18,6 +18,7 @@ var PropTypes = require('prop-types');
|
|
|
18
18
|
var containerUtilities = require('@zendeskgarden/container-utilities');
|
|
19
19
|
var mergeRefs = require('react-merge-refs');
|
|
20
20
|
var debounce = require('lodash.debounce');
|
|
21
|
+
var containerSlider = require('@zendeskgarden/container-slider');
|
|
21
22
|
|
|
22
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
24
|
|
|
@@ -46,265 +47,85 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
46
47
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
|
|
47
48
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
48
49
|
|
|
49
|
-
function ownKeys(object, enumerableOnly) {
|
|
50
|
-
var keys = Object.keys(object);
|
|
51
|
-
|
|
52
|
-
if (Object.getOwnPropertySymbols) {
|
|
53
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
54
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
55
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
56
|
-
})), keys.push.apply(keys, symbols);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return keys;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _objectSpread2(target) {
|
|
63
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
64
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
65
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
66
|
-
_defineProperty(target, key, source[key]);
|
|
67
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
68
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return target;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function _defineProperty(obj, key, value) {
|
|
76
|
-
if (key in obj) {
|
|
77
|
-
Object.defineProperty(obj, key, {
|
|
78
|
-
value: value,
|
|
79
|
-
enumerable: true,
|
|
80
|
-
configurable: true,
|
|
81
|
-
writable: true
|
|
82
|
-
});
|
|
83
|
-
} else {
|
|
84
|
-
obj[key] = value;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return obj;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
50
|
function _extends$t() {
|
|
91
51
|
_extends$t = Object.assign ? Object.assign.bind() : function (target) {
|
|
92
52
|
for (var i = 1; i < arguments.length; i++) {
|
|
93
53
|
var source = arguments[i];
|
|
94
|
-
|
|
95
54
|
for (var key in source) {
|
|
96
55
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
97
56
|
target[key] = source[key];
|
|
98
57
|
}
|
|
99
58
|
}
|
|
100
59
|
}
|
|
101
|
-
|
|
102
60
|
return target;
|
|
103
61
|
};
|
|
104
62
|
return _extends$t.apply(this, arguments);
|
|
105
63
|
}
|
|
106
64
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var sourceKeys = Object.keys(source);
|
|
111
|
-
var key, i;
|
|
112
|
-
|
|
113
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
114
|
-
key = sourceKeys[i];
|
|
115
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
116
|
-
target[key] = source[key];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return target;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _objectWithoutProperties(source, excluded) {
|
|
123
|
-
if (source == null) return {};
|
|
124
|
-
|
|
125
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
126
|
-
|
|
127
|
-
var key, i;
|
|
128
|
-
|
|
129
|
-
if (Object.getOwnPropertySymbols) {
|
|
130
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
131
|
-
|
|
132
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
133
|
-
key = sourceSymbolKeys[i];
|
|
134
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
135
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
136
|
-
target[key] = source[key];
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return target;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function _slicedToArray(arr, i) {
|
|
144
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function _arrayWithHoles(arr) {
|
|
148
|
-
if (Array.isArray(arr)) return arr;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function _iterableToArrayLimit(arr, i) {
|
|
152
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
153
|
-
|
|
154
|
-
if (_i == null) return;
|
|
155
|
-
var _arr = [];
|
|
156
|
-
var _n = true;
|
|
157
|
-
var _d = false;
|
|
158
|
-
|
|
159
|
-
var _s, _e;
|
|
160
|
-
|
|
161
|
-
try {
|
|
162
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
163
|
-
_arr.push(_s.value);
|
|
164
|
-
|
|
165
|
-
if (i && _arr.length === i) break;
|
|
166
|
-
}
|
|
167
|
-
} catch (err) {
|
|
168
|
-
_d = true;
|
|
169
|
-
_e = err;
|
|
170
|
-
} finally {
|
|
171
|
-
try {
|
|
172
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
173
|
-
} finally {
|
|
174
|
-
if (_d) throw _e;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return _arr;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
182
|
-
if (!o) return;
|
|
183
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
184
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
185
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
186
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
187
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function _arrayLikeToArray(arr, len) {
|
|
191
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
192
|
-
|
|
193
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
194
|
-
|
|
195
|
-
return arr2;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function _nonIterableRest() {
|
|
199
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
var FieldContext = React.createContext(undefined);
|
|
203
|
-
var useFieldContext = function useFieldContext() {
|
|
204
|
-
var fieldContext = React.useContext(FieldContext);
|
|
65
|
+
const FieldContext = React.createContext(undefined);
|
|
66
|
+
const useFieldContext = () => {
|
|
67
|
+
const fieldContext = React.useContext(FieldContext);
|
|
205
68
|
return fieldContext;
|
|
206
69
|
};
|
|
207
70
|
|
|
208
|
-
|
|
209
|
-
|
|
71
|
+
const COMPONENT_ID$K = 'forms.field';
|
|
72
|
+
const StyledField = styled__default["default"].div.attrs({
|
|
210
73
|
'data-garden-id': COMPONENT_ID$K,
|
|
211
|
-
'data-garden-version': '8.
|
|
74
|
+
'data-garden-version': '8.58.0'
|
|
212
75
|
}).withConfig({
|
|
213
76
|
displayName: "StyledField",
|
|
214
77
|
componentId: "sc-12gzfsu-0"
|
|
215
|
-
})(["position:relative;direction:", ";margin:0;border:0;padding:0;font-size:0;", ";"],
|
|
216
|
-
return props.theme.rtl && 'rtl';
|
|
217
|
-
}, function (props) {
|
|
218
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$K, props);
|
|
219
|
-
});
|
|
78
|
+
})(["position:relative;direction:", ";margin:0;border:0;padding:0;font-size:0;", ";"], props => props.theme.rtl && 'rtl', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$K, props));
|
|
220
79
|
StyledField.defaultProps = {
|
|
221
80
|
theme: reactTheming.DEFAULT_THEME
|
|
222
81
|
};
|
|
223
82
|
|
|
224
|
-
|
|
225
|
-
|
|
83
|
+
const COMPONENT_ID$J = 'forms.fieldset';
|
|
84
|
+
const StyledFieldset = styled__default["default"](StyledField).attrs({
|
|
226
85
|
as: 'fieldset',
|
|
227
86
|
'data-garden-id': COMPONENT_ID$J,
|
|
228
|
-
'data-garden-version': '8.
|
|
87
|
+
'data-garden-version': '8.58.0'
|
|
229
88
|
}).withConfig({
|
|
230
89
|
displayName: "StyledFieldset",
|
|
231
90
|
componentId: "sc-1vr4mxv-0"
|
|
232
|
-
})(["", "{margin-top:", "px;}", ";"], StyledField,
|
|
233
|
-
return props.theme.space.base * (props.isCompact ? 1 : 2);
|
|
234
|
-
}, function (props) {
|
|
235
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$J, props);
|
|
236
|
-
});
|
|
91
|
+
})(["", "{margin-top:", "px;}", ";"], StyledField, props => props.theme.space.base * (props.isCompact ? 1 : 2), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$J, props));
|
|
237
92
|
StyledFieldset.defaultProps = {
|
|
238
93
|
theme: reactTheming.DEFAULT_THEME
|
|
239
94
|
};
|
|
240
95
|
|
|
241
|
-
|
|
242
|
-
|
|
96
|
+
const COMPONENT_ID$I = 'forms.input_label';
|
|
97
|
+
const StyledLabel = styled__default["default"].label.attrs({
|
|
243
98
|
'data-garden-id': COMPONENT_ID$I,
|
|
244
|
-
'data-garden-version': '8.
|
|
99
|
+
'data-garden-version': '8.58.0'
|
|
245
100
|
}).withConfig({
|
|
246
101
|
displayName: "StyledLabel",
|
|
247
102
|
componentId: "sc-2utmsz-0"
|
|
248
|
-
})(["direction:", ";vertical-align:middle;line-height:", ";color:", ";font-size:", ";font-weight:", ";&[hidden]{display:", ";vertical-align:", ";text-indent:", ";font-size:", ";", ";}", ";"],
|
|
249
|
-
return props.theme.rtl && 'rtl';
|
|
250
|
-
}, function (props) {
|
|
251
|
-
return reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
252
|
-
}, function (props) {
|
|
253
|
-
return props.theme.colors.foreground;
|
|
254
|
-
}, function (props) {
|
|
255
|
-
return props.theme.fontSizes.md;
|
|
256
|
-
}, function (props) {
|
|
257
|
-
return props.isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold;
|
|
258
|
-
}, function (props) {
|
|
259
|
-
return props.isRadio ? 'inline-block' : 'inline';
|
|
260
|
-
}, function (props) {
|
|
261
|
-
return props.isRadio && 'top';
|
|
262
|
-
}, function (props) {
|
|
263
|
-
return props.isRadio && '-100%';
|
|
264
|
-
}, function (props) {
|
|
265
|
-
return props.isRadio && '0';
|
|
266
|
-
}, function (props) {
|
|
267
|
-
return !props.isRadio && polished.hideVisually();
|
|
268
|
-
}, function (props) {
|
|
269
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$I, props);
|
|
270
|
-
});
|
|
103
|
+
})(["direction:", ";vertical-align:middle;line-height:", ";color:", ";font-size:", ";font-weight:", ";&[hidden]{display:", ";vertical-align:", ";text-indent:", ";font-size:", ";", ";}", ";"], props => props.theme.rtl && 'rtl', props => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => props.isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, props => props.isRadio ? 'inline-block' : 'inline', props => props.isRadio && 'top', props => props.isRadio && '-100%', props => props.isRadio && '0', props => !props.isRadio && polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$I, props));
|
|
271
104
|
StyledLabel.defaultProps = {
|
|
272
105
|
theme: reactTheming.DEFAULT_THEME
|
|
273
106
|
};
|
|
274
107
|
|
|
275
|
-
|
|
276
|
-
|
|
108
|
+
const COMPONENT_ID$H = 'forms.fieldset_legend';
|
|
109
|
+
const StyledLegend = styled__default["default"](StyledLabel).attrs({
|
|
277
110
|
as: 'legend',
|
|
278
111
|
'data-garden-id': COMPONENT_ID$H,
|
|
279
|
-
'data-garden-version': '8.
|
|
112
|
+
'data-garden-version': '8.58.0'
|
|
280
113
|
}).withConfig({
|
|
281
114
|
displayName: "StyledLegend",
|
|
282
115
|
componentId: "sc-6s0zwq-0"
|
|
283
|
-
})(["padding:0;", ";"],
|
|
284
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$H, props);
|
|
285
|
-
});
|
|
116
|
+
})(["padding:0;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$H, props));
|
|
286
117
|
StyledLegend.defaultProps = {
|
|
287
118
|
theme: reactTheming.DEFAULT_THEME
|
|
288
119
|
};
|
|
289
120
|
|
|
290
|
-
|
|
291
|
-
|
|
121
|
+
const COMPONENT_ID$G = 'forms.input_hint';
|
|
122
|
+
const StyledHint = styled__default["default"].div.attrs({
|
|
292
123
|
'data-garden-id': COMPONENT_ID$G,
|
|
293
|
-
'data-garden-version': '8.
|
|
124
|
+
'data-garden-version': '8.58.0'
|
|
294
125
|
}).withConfig({
|
|
295
126
|
displayName: "StyledHint",
|
|
296
127
|
componentId: "sc-17c2wu8-0"
|
|
297
|
-
})(["direction:", ";display:block;vertical-align:middle;line-height:", ";color:", ";font-size:", ";", ";"],
|
|
298
|
-
return props.theme.rtl && 'rtl';
|
|
299
|
-
}, function (props) {
|
|
300
|
-
return reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
301
|
-
}, function (props) {
|
|
302
|
-
return reactTheming.getColor('neutralHue', 600, props.theme);
|
|
303
|
-
}, function (props) {
|
|
304
|
-
return props.theme.fontSizes.md;
|
|
305
|
-
}, function (props) {
|
|
306
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$G, props);
|
|
307
|
-
});
|
|
128
|
+
})(["direction:", ";display:block;vertical-align:middle;line-height:", ";color:", ";font-size:", ";", ";"], props => props.theme.rtl && 'rtl', props => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => reactTheming.getColor('neutralHue', 600, props.theme), props => props.theme.fontSizes.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$G, props));
|
|
308
129
|
StyledHint.defaultProps = {
|
|
309
130
|
theme: reactTheming.DEFAULT_THEME
|
|
310
131
|
};
|
|
@@ -320,7 +141,8 @@ var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
|
|
|
320
141
|
height: 16,
|
|
321
142
|
focusable: "false",
|
|
322
143
|
viewBox: "0 0 16 16",
|
|
323
|
-
"aria-hidden": "true"
|
|
144
|
+
"aria-hidden": "true",
|
|
145
|
+
role: "img"
|
|
324
146
|
}, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
325
147
|
fill: "none",
|
|
326
148
|
stroke: "currentColor"
|
|
@@ -350,7 +172,8 @@ var SvgAlertWarningStroke = function SvgAlertWarningStroke(props) {
|
|
|
350
172
|
height: 16,
|
|
351
173
|
focusable: "false",
|
|
352
174
|
viewBox: "0 0 16 16",
|
|
353
|
-
"aria-hidden": "true"
|
|
175
|
+
"aria-hidden": "true",
|
|
176
|
+
role: "img"
|
|
354
177
|
}, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
|
|
355
178
|
fill: "none",
|
|
356
179
|
stroke: "currentColor",
|
|
@@ -375,7 +198,8 @@ var SvgCheckCircleStroke$1 = function SvgCheckCircleStroke(props) {
|
|
|
375
198
|
height: 16,
|
|
376
199
|
focusable: "false",
|
|
377
200
|
viewBox: "0 0 16 16",
|
|
378
|
-
"aria-hidden": "true"
|
|
201
|
+
"aria-hidden": "true",
|
|
202
|
+
role: "img"
|
|
379
203
|
}, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
380
204
|
fill: "none",
|
|
381
205
|
stroke: "currentColor"
|
|
@@ -390,12 +214,13 @@ var SvgCheckCircleStroke$1 = function SvgCheckCircleStroke(props) {
|
|
|
390
214
|
}))));
|
|
391
215
|
};
|
|
392
216
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
217
|
+
const MessageIcon = _ref => {
|
|
218
|
+
let {
|
|
219
|
+
children,
|
|
220
|
+
validation,
|
|
221
|
+
...props
|
|
222
|
+
} = _ref;
|
|
223
|
+
let retVal;
|
|
399
224
|
if (validation === 'error') {
|
|
400
225
|
retVal = React__default["default"].createElement(SvgAlertErrorStroke, props);
|
|
401
226
|
} else if (validation === 'success') {
|
|
@@ -407,29 +232,23 @@ var MessageIcon = function MessageIcon(_ref) {
|
|
|
407
232
|
}
|
|
408
233
|
return retVal;
|
|
409
234
|
};
|
|
410
|
-
|
|
411
|
-
|
|
235
|
+
const COMPONENT_ID$F = 'forms.input_message_icon';
|
|
236
|
+
const StyledMessageIcon = styled__default["default"](MessageIcon).attrs({
|
|
412
237
|
'data-garden-id': COMPONENT_ID$F,
|
|
413
|
-
'data-garden-version': '8.
|
|
238
|
+
'data-garden-version': '8.58.0',
|
|
414
239
|
'aria-hidden': null
|
|
415
240
|
}).withConfig({
|
|
416
241
|
displayName: "StyledMessageIcon",
|
|
417
242
|
componentId: "sc-1ph2gba-0"
|
|
418
|
-
})(["width:", ";height:", ";", ";"],
|
|
419
|
-
return props.theme.iconSizes.md;
|
|
420
|
-
}, function (props) {
|
|
421
|
-
return props.theme.iconSizes.md;
|
|
422
|
-
}, function (props) {
|
|
423
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$F, props);
|
|
424
|
-
});
|
|
243
|
+
})(["width:", ";height:", ";", ";"], props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$F, props));
|
|
425
244
|
StyledMessageIcon.defaultProps = {
|
|
426
245
|
theme: reactTheming.DEFAULT_THEME
|
|
427
246
|
};
|
|
428
247
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
248
|
+
const validationStyles = props => {
|
|
249
|
+
const rtl = props.theme.rtl;
|
|
250
|
+
const padding = polished.math(`${props.theme.space.base} * 2px + ${props.theme.iconSizes.md}`);
|
|
251
|
+
let color;
|
|
433
252
|
if (props.validation === 'error') {
|
|
434
253
|
color = reactTheming.getColor('dangerHue', 600, props.theme);
|
|
435
254
|
} else if (props.validation === 'success') {
|
|
@@ -441,44 +260,30 @@ var validationStyles = function validationStyles(props) {
|
|
|
441
260
|
}
|
|
442
261
|
return styled.css(["padding-", ":", ";color:", ";"], rtl ? 'right' : 'left', props.validation && padding, color);
|
|
443
262
|
};
|
|
444
|
-
|
|
445
|
-
|
|
263
|
+
const COMPONENT_ID$E = 'forms.input_message';
|
|
264
|
+
const StyledMessage = styled__default["default"].div.attrs({
|
|
446
265
|
'data-garden-id': COMPONENT_ID$E,
|
|
447
|
-
'data-garden-version': '8.
|
|
266
|
+
'data-garden-version': '8.58.0'
|
|
448
267
|
}).withConfig({
|
|
449
268
|
displayName: "StyledMessage",
|
|
450
269
|
componentId: "sc-30hgg7-0"
|
|
451
|
-
})(["direction:", ";display:inline-block;position:relative;vertical-align:middle;line-height:", ";font-size:", ";", ";& ", "{position:absolute;top:-1px;", ":0;}", ":not([hidden]) + &{display:block;margin-top:", ";}", ";"],
|
|
452
|
-
return props.theme.rtl && 'rtl';
|
|
453
|
-
}, function (props) {
|
|
454
|
-
return reactTheming.getLineHeight(props.theme.iconSizes.md, props.theme.fontSizes.sm);
|
|
455
|
-
}, function (props) {
|
|
456
|
-
return props.theme.fontSizes.sm;
|
|
457
|
-
}, function (props) {
|
|
458
|
-
return validationStyles(props);
|
|
459
|
-
}, StyledMessageIcon, function (props) {
|
|
460
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
461
|
-
}, StyledLabel, function (props) {
|
|
462
|
-
return polished.math("".concat(props.theme.space.base, " * 1px"));
|
|
463
|
-
}, function (props) {
|
|
464
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$E, props);
|
|
465
|
-
});
|
|
270
|
+
})(["direction:", ";display:inline-block;position:relative;vertical-align:middle;line-height:", ";font-size:", ";", ";& ", "{position:absolute;top:-1px;", ":0;}", ":not([hidden]) + &{display:block;margin-top:", ";}", ";"], props => props.theme.rtl && 'rtl', props => reactTheming.getLineHeight(props.theme.iconSizes.md, props.theme.fontSizes.sm), props => props.theme.fontSizes.sm, props => validationStyles(props), StyledMessageIcon, props => props.theme.rtl ? 'right' : 'left', StyledLabel, props => polished.math(`${props.theme.space.base} * 1px`), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$E, props));
|
|
466
271
|
StyledMessage.defaultProps = {
|
|
467
272
|
theme: reactTheming.DEFAULT_THEME
|
|
468
273
|
};
|
|
469
274
|
|
|
470
|
-
|
|
471
|
-
|
|
275
|
+
const COMPONENT_ID$D = 'forms.input';
|
|
276
|
+
const isInvalid = validation => {
|
|
472
277
|
return validation === 'warning' || validation === 'error';
|
|
473
278
|
};
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
279
|
+
const colorStyles$b = props => {
|
|
280
|
+
const SHADE = 600;
|
|
281
|
+
const placeholderColor = reactTheming.getColor('neutralHue', SHADE - 200, props.theme);
|
|
282
|
+
let borderColor;
|
|
283
|
+
let hoverBorderColor;
|
|
284
|
+
let focusBorderColor;
|
|
480
285
|
if (props.validation) {
|
|
481
|
-
|
|
286
|
+
let hue;
|
|
482
287
|
if (props.validation === 'success') {
|
|
483
288
|
hue = 'successHue';
|
|
484
289
|
} else if (props.validation === 'warning') {
|
|
@@ -494,13 +299,15 @@ var colorStyles$b = function colorStyles(props) {
|
|
|
494
299
|
hoverBorderColor = reactTheming.getColor('primaryHue', SHADE, props.theme);
|
|
495
300
|
focusBorderColor = hoverBorderColor;
|
|
496
301
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
302
|
+
const boxShadow = `
|
|
303
|
+
${props.focusInset ? 'inset' : ''}
|
|
304
|
+
${props.theme.shadows.md(polished.rgba(focusBorderColor, 0.35))}`;
|
|
305
|
+
const readOnlyBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 500, props.theme);
|
|
306
|
+
const readOnlyBorderColor = reactTheming.getColor('neutralHue', SHADE - 300, props.theme);
|
|
307
|
+
const disabledBackgroundColor = readOnlyBackgroundColor;
|
|
308
|
+
const disabledBorderColor = reactTheming.getColor('neutralHue', SHADE - 400, props.theme);
|
|
309
|
+
const disabledForegroundColor = reactTheming.getColor('neutralHue', SHADE - 200, props.theme);
|
|
310
|
+
let controlledBorderColor = borderColor;
|
|
504
311
|
if (props.isFocused) {
|
|
505
312
|
controlledBorderColor = focusBorderColor;
|
|
506
313
|
}
|
|
@@ -509,88 +316,67 @@ var colorStyles$b = function colorStyles(props) {
|
|
|
509
316
|
}
|
|
510
317
|
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&::placeholder{color:", ";}&[readonly],&[aria-readonly='true']{border-color:", ";background-color:", ";}&:hover{border-color:", ";}&:focus,&[data-garden-focus-visible='true']{border-color:", ";box-shadow:", ";}&:disabled,&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], controlledBorderColor, !props.isBare && props.isFocused && boxShadow, props.isBare ? 'transparent' : props.theme.colors.background, props.theme.colors.foreground, placeholderColor, readOnlyBorderColor, !props.isBare && readOnlyBackgroundColor, hoverBorderColor, focusBorderColor, !props.isBare && boxShadow, disabledBorderColor, !props.isBare && disabledBackgroundColor, disabledForegroundColor);
|
|
511
318
|
};
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
319
|
+
const sizeStyles$f = props => {
|
|
320
|
+
const fontSize = props.theme.fontSizes.md;
|
|
321
|
+
const paddingHorizontal = `${props.theme.space.base * 3}px`;
|
|
322
|
+
let height;
|
|
323
|
+
let paddingVertical;
|
|
324
|
+
let browseFontSize;
|
|
325
|
+
let swatchHeight;
|
|
519
326
|
if (props.isCompact) {
|
|
520
|
-
height =
|
|
521
|
-
paddingVertical =
|
|
522
|
-
browseFontSize = polished.math(
|
|
523
|
-
swatchHeight =
|
|
327
|
+
height = `${props.theme.space.base * 8}px`;
|
|
328
|
+
paddingVertical = `${props.theme.space.base * 1.5}px`;
|
|
329
|
+
browseFontSize = polished.math(`${props.theme.fontSizes.sm} - 1`);
|
|
330
|
+
swatchHeight = `${props.theme.space.base * 6}px`;
|
|
524
331
|
} else {
|
|
525
|
-
height =
|
|
526
|
-
paddingVertical =
|
|
332
|
+
height = `${props.theme.space.base * 10}px`;
|
|
333
|
+
paddingVertical = `${props.theme.space.base * 2.5}px`;
|
|
527
334
|
browseFontSize = props.theme.fontSizes.sm;
|
|
528
|
-
swatchHeight =
|
|
335
|
+
swatchHeight = `${props.theme.space.base * 7}px`;
|
|
529
336
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
return styled.css(["padding:", ";min-height:", ";line-height:", ";font-size:", ";&::-ms-browse{font-size:", ";}&[type='date'],&[type='datetime-local'],&[type='file'],&[type='month'],&[type='time'],&[type='week']{max-height:", ";}&[type='file']{line-height:1;}@supports (-ms-ime-align:auto){&[type='color']{padding:", ";}}&::-moz-color-swatch{margin-top:", ";margin-left:", ";width:calc(100% + ", ");height:", ";}&::-webkit-color-swatch{margin:", " ", ";}", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", "px;}"], padding, props.isBare ? '1em' : height, reactTheming.getLineHeight(lineHeight, fontSize), fontSize, browseFontSize, height, props.isCompact ? '0 2px' : '1px 3px', swatchMarginVertical, swatchMarginHorizontal, polished.math(
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
};
|
|
542
|
-
}).withConfig({
|
|
337
|
+
const lineHeight = polished.math(`${height} - (${paddingVertical} * 2) - (${props.theme.borderWidths.sm} * 2)`);
|
|
338
|
+
const padding = props.isBare ? '0' : `${polished.em(paddingVertical, fontSize)} ${polished.em(paddingHorizontal, fontSize)}`;
|
|
339
|
+
const swatchMarginVertical = polished.math(`(${lineHeight} - ${swatchHeight}) / 2`);
|
|
340
|
+
const swatchMarginHorizontal = polished.math(`${paddingVertical} + ${swatchMarginVertical} - ${paddingHorizontal}`);
|
|
341
|
+
return styled.css(["padding:", ";min-height:", ";line-height:", ";font-size:", ";&::-ms-browse{font-size:", ";}&[type='date'],&[type='datetime-local'],&[type='file'],&[type='month'],&[type='time'],&[type='week']{max-height:", ";}&[type='file']{line-height:1;}@supports (-ms-ime-align:auto){&[type='color']{padding:", ";}}&::-moz-color-swatch{margin-top:", ";margin-left:", ";width:calc(100% + ", ");height:", ";}&::-webkit-color-swatch{margin:", " ", ";}", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", "px;}"], padding, props.isBare ? '1em' : height, reactTheming.getLineHeight(lineHeight, fontSize), fontSize, browseFontSize, height, props.isCompact ? '0 2px' : '1px 3px', swatchMarginVertical, swatchMarginHorizontal, polished.math(`${swatchMarginHorizontal} * -2`), swatchHeight, swatchMarginVertical, swatchMarginHorizontal, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, props.theme.space.base * (props.isCompact ? 1 : 2));
|
|
342
|
+
};
|
|
343
|
+
const StyledTextInput = styled__default["default"].input.attrs(props => ({
|
|
344
|
+
'data-garden-id': COMPONENT_ID$D,
|
|
345
|
+
'data-garden-version': '8.58.0',
|
|
346
|
+
'aria-invalid': isInvalid(props.validation)
|
|
347
|
+
})).withConfig({
|
|
543
348
|
displayName: "StyledTextInput",
|
|
544
349
|
componentId: "sc-k12n8x-0"
|
|
545
|
-
})(["appearance:none;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;direction:", ";border:", ";border-radius:", ";width:100%;box-sizing:border-box;vertical-align:middle;font-family:inherit;&::-ms-browse{border-radius:", ";}&::-ms-clear,&::-ms-reveal{display:none;}&::-moz-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch-wrapper{padding:0;}&::-webkit-clear-button,&::-webkit-inner-spin-button,&::-webkit-search-cancel-button,&::-webkit-search-results-button{display:none;}&::-webkit-datetime-edit{direction:", ";line-height:1;}&::placeholder{opacity:1;}&:invalid{box-shadow:none;}&[type='file']::-ms-value{display:none;}@media screen and (min--moz-device-pixel-ratio:0){&[type='number']{appearance:textfield;}}", ";&:focus{outline:none;}", ";&:disabled{cursor:default;}", ";"],
|
|
546
|
-
return props.theme.rtl && 'rtl';
|
|
547
|
-
}, function (props) {
|
|
548
|
-
return props.isBare ? 'none' : props.theme.borders.sm;
|
|
549
|
-
}, function (props) {
|
|
550
|
-
return props.isBare ? '0' : props.theme.borderRadii.md;
|
|
551
|
-
}, function (props) {
|
|
552
|
-
return props.theme.borderRadii.sm;
|
|
553
|
-
}, function (props) {
|
|
554
|
-
return props.theme.borderRadii.sm;
|
|
555
|
-
}, function (props) {
|
|
556
|
-
return props.theme.borderRadii.sm;
|
|
557
|
-
}, function (props) {
|
|
558
|
-
return props.theme.rtl && 'rtl';
|
|
559
|
-
}, function (props) {
|
|
560
|
-
return sizeStyles$f(props);
|
|
561
|
-
}, function (props) {
|
|
562
|
-
return colorStyles$b(props);
|
|
563
|
-
}, function (props) {
|
|
564
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$D, props);
|
|
565
|
-
});
|
|
350
|
+
})(["appearance:none;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;direction:", ";border:", ";border-radius:", ";width:100%;box-sizing:border-box;vertical-align:middle;font-family:inherit;&::-ms-browse{border-radius:", ";}&::-ms-clear,&::-ms-reveal{display:none;}&::-moz-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch-wrapper{padding:0;}&::-webkit-clear-button,&::-webkit-inner-spin-button,&::-webkit-search-cancel-button,&::-webkit-search-results-button{display:none;}&::-webkit-datetime-edit{direction:", ";line-height:1;}&::placeholder{opacity:1;}&:invalid{box-shadow:none;}&[type='file']::-ms-value{display:none;}@media screen and (min--moz-device-pixel-ratio:0){&[type='number']{appearance:textfield;}}", ";&:focus{outline:none;}", ";&:disabled{cursor:default;}", ";"], props => props.theme.rtl && 'rtl', props => props.isBare ? 'none' : props.theme.borders.sm, props => props.isBare ? '0' : props.theme.borderRadii.md, props => props.theme.borderRadii.sm, props => props.theme.borderRadii.sm, props => props.theme.borderRadii.sm, props => props.theme.rtl && 'rtl', props => sizeStyles$f(props), props => colorStyles$b(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$D, props));
|
|
566
351
|
StyledTextInput.defaultProps = {
|
|
567
352
|
theme: reactTheming.DEFAULT_THEME
|
|
568
353
|
};
|
|
569
354
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
355
|
+
const COMPONENT_ID$C = 'forms.textarea';
|
|
356
|
+
const hiddenStyles = `
|
|
357
|
+
visibility: hidden;
|
|
358
|
+
position: absolute;
|
|
359
|
+
overflow: hidden;
|
|
360
|
+
height: 0;
|
|
361
|
+
top: 0;
|
|
362
|
+
left: 0;
|
|
363
|
+
transform: translateZ(0);
|
|
364
|
+
`;
|
|
365
|
+
const StyledTextarea = styled__default["default"](StyledTextInput).attrs({
|
|
573
366
|
as: 'textarea',
|
|
574
367
|
'data-garden-id': COMPONENT_ID$C,
|
|
575
|
-
'data-garden-version': '8.
|
|
368
|
+
'data-garden-version': '8.58.0'
|
|
576
369
|
}).withConfig({
|
|
577
370
|
displayName: "StyledTextarea",
|
|
578
371
|
componentId: "sc-wxschl-0"
|
|
579
|
-
})(["resize:", ";overflow:auto;", ";", ";"],
|
|
580
|
-
return props.isResizable ? 'vertical' : 'none';
|
|
581
|
-
}, function (props) {
|
|
582
|
-
return props.isHidden && hiddenStyles;
|
|
583
|
-
}, function (props) {
|
|
584
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$C, props);
|
|
585
|
-
});
|
|
372
|
+
})(["resize:", ";overflow:auto;", ";", ";"], props => props.isResizable ? 'vertical' : 'none', props => props.isHidden && hiddenStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$C, props));
|
|
586
373
|
StyledTextarea.defaultProps = {
|
|
587
374
|
theme: reactTheming.DEFAULT_THEME
|
|
588
375
|
};
|
|
589
376
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
var shade = 600;
|
|
377
|
+
const COMPONENT_ID$B = 'forms.media_figure';
|
|
378
|
+
const colorStyles$a = props => {
|
|
379
|
+
let shade = 600;
|
|
594
380
|
if (props.isDisabled) {
|
|
595
381
|
shade = 400;
|
|
596
382
|
} else if (props.isHovered || props.isFocused) {
|
|
@@ -598,11 +384,11 @@ var colorStyles$a = function colorStyles(props) {
|
|
|
598
384
|
}
|
|
599
385
|
return styled.css(["color:", ";"], reactTheming.getColor('neutralHue', shade, props.theme));
|
|
600
386
|
};
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
387
|
+
const sizeStyles$e = props => {
|
|
388
|
+
const size = props.theme.iconSizes.md;
|
|
389
|
+
const marginFirst = `1px ${props.theme.space.base * 2}px auto 0`;
|
|
390
|
+
const marginLast = `1px 0 auto ${props.theme.space.base * 2}px`;
|
|
391
|
+
let margin;
|
|
606
392
|
if (props.position === 'start') {
|
|
607
393
|
margin = props.theme.rtl ? marginLast : marginFirst;
|
|
608
394
|
} else {
|
|
@@ -610,286 +396,220 @@ var sizeStyles$e = function sizeStyles(props) {
|
|
|
610
396
|
}
|
|
611
397
|
return styled.css(["margin:", ";width:", ";height:", ";"], margin, size, size);
|
|
612
398
|
};
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
399
|
+
const StyledTextMediaFigure = styled__default["default"](
|
|
400
|
+
_ref => {
|
|
401
|
+
let {
|
|
402
|
+
children,
|
|
403
|
+
position,
|
|
404
|
+
isHovered,
|
|
405
|
+
isFocused,
|
|
406
|
+
isDisabled,
|
|
407
|
+
isRotated,
|
|
408
|
+
theme,
|
|
409
|
+
...props
|
|
410
|
+
} = _ref;
|
|
623
411
|
return React__default["default"].cloneElement(React.Children.only(children), props);
|
|
624
412
|
}).attrs({
|
|
625
413
|
'data-garden-id': COMPONENT_ID$B,
|
|
626
|
-
'data-garden-version': '8.
|
|
414
|
+
'data-garden-version': '8.58.0'
|
|
627
415
|
}).withConfig({
|
|
628
416
|
displayName: "StyledTextMediaFigure",
|
|
629
417
|
componentId: "sc-1qepknj-0"
|
|
630
|
-
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", " ", ";"],
|
|
631
|
-
return props.isRotated && "rotate(".concat(props.theme.rtl ? '-' : '+', "180deg)");
|
|
632
|
-
}, function (props) {
|
|
633
|
-
return colorStyles$a(props);
|
|
634
|
-
}, function (props) {
|
|
635
|
-
return sizeStyles$e(props);
|
|
636
|
-
}, function (props) {
|
|
637
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$B, props);
|
|
638
|
-
});
|
|
418
|
+
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", " ", ";"], props => props.isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => colorStyles$a(props), props => sizeStyles$e(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$B, props));
|
|
639
419
|
StyledTextMediaFigure.defaultProps = {
|
|
640
420
|
theme: reactTheming.DEFAULT_THEME
|
|
641
421
|
};
|
|
642
422
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
};
|
|
652
|
-
}).withConfig({
|
|
423
|
+
const COMPONENT_ID$A = 'forms.faux_input';
|
|
424
|
+
const StyledTextFauxInput = styled__default["default"](StyledTextInput).attrs(props => ({
|
|
425
|
+
as: 'div',
|
|
426
|
+
'aria-readonly': props.isReadOnly,
|
|
427
|
+
'aria-disabled': props.isDisabled,
|
|
428
|
+
'data-garden-id': COMPONENT_ID$A,
|
|
429
|
+
'data-garden-version': '8.58.0'
|
|
430
|
+
})).withConfig({
|
|
653
431
|
displayName: "StyledTextFauxInput",
|
|
654
432
|
componentId: "sc-yqw7j9-0"
|
|
655
|
-
})(["display:", ";align-items:", ";cursor:", ";overflow:hidden;& > ", "{vertical-align:", ";}& > ", "{flex-shrink:", ";}", ";"],
|
|
656
|
-
return props.mediaLayout ? 'inline-flex' : 'inline-block';
|
|
657
|
-
}, function (props) {
|
|
658
|
-
return props.mediaLayout && 'baseline';
|
|
659
|
-
}, function (props) {
|
|
660
|
-
return props.mediaLayout && !props.isDisabled ? 'text' : 'default';
|
|
661
|
-
}, StyledTextInput, function (props) {
|
|
662
|
-
return !props.mediaLayout && 'baseline';
|
|
663
|
-
}, StyledTextMediaFigure, function (props) {
|
|
664
|
-
return props.mediaLayout && '0';
|
|
665
|
-
}, function (props) {
|
|
666
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$A, props);
|
|
667
|
-
});
|
|
433
|
+
})(["display:", ";align-items:", ";cursor:", ";overflow:hidden;& > ", "{vertical-align:", ";}& > ", "{flex-shrink:", ";}", ";"], props => props.mediaLayout ? 'inline-flex' : 'inline-block', props => props.mediaLayout && 'baseline', props => props.mediaLayout && !props.isDisabled ? 'text' : 'default', StyledTextInput, props => !props.mediaLayout && 'baseline', StyledTextMediaFigure, props => props.mediaLayout && '0', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$A, props));
|
|
668
434
|
StyledTextFauxInput.defaultProps = {
|
|
669
435
|
theme: reactTheming.DEFAULT_THEME
|
|
670
436
|
};
|
|
671
437
|
|
|
672
|
-
|
|
673
|
-
|
|
438
|
+
const COMPONENT_ID$z = 'forms.media_input';
|
|
439
|
+
const StyledTextMediaInput = styled__default["default"](StyledTextInput).attrs({
|
|
674
440
|
'data-garden-id': COMPONENT_ID$z,
|
|
675
|
-
'data-garden-version': '8.
|
|
441
|
+
'data-garden-version': '8.58.0',
|
|
676
442
|
isBare: true
|
|
677
443
|
}).withConfig({
|
|
678
444
|
displayName: "StyledTextMediaInput",
|
|
679
445
|
componentId: "sc-12i9xfi-0"
|
|
680
|
-
})(["flex-grow:1;", ";"],
|
|
681
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$z, props);
|
|
682
|
-
});
|
|
446
|
+
})(["flex-grow:1;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$z, props));
|
|
683
447
|
StyledTextMediaInput.defaultProps = {
|
|
684
448
|
theme: reactTheming.DEFAULT_THEME
|
|
685
449
|
};
|
|
686
450
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
451
|
+
const COMPONENT_ID$y = 'forms.input_group';
|
|
452
|
+
const positionStyles = props => {
|
|
453
|
+
const topMargin = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
|
|
454
|
+
const startDirection = props.theme.rtl ? 'right' : 'left';
|
|
455
|
+
const endDirection = props.theme.rtl ? 'left' : 'right';
|
|
692
456
|
return styled.css(["", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}& > ", "{position:relative;flex:1 1 auto;margin-top:0;margin-bottom:0;width:auto;min-width:0;}& > ", ":not(:first-child){border-top-", "-radius:0;border-bottom-", "-radius:0;}& > ", ":not(:last-child){border-top-", "-radius:0;border-bottom-", "-radius:0;}"], StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, topMargin, StyledTextInput, StyledTextInput, startDirection, startDirection, StyledTextInput, endDirection, endDirection);
|
|
693
457
|
};
|
|
694
|
-
|
|
695
|
-
|
|
458
|
+
const itemStyles = props => {
|
|
459
|
+
const horizontal = props.theme.rtl ? 'right' : 'left';
|
|
696
460
|
return styled.css(["& > *{margin-", ":-", " !important;z-index:-1;}& > ", ":hover,& > button:hover,& > ", "[data-garden-focus-visible],& > button[data-garden-focus-visible],& > ", ":active,& > button:active{z-index:1;}& > button:disabled{border-top-width:0;border-bottom-width:0;}& > ", ":disabled{z-index:-2;}& > *:first-child:not(:last-child){margin-", ":0;border-top-", "-radius:0;border-bottom-", "-radius:0;}& > *:last-child:not(:first-child){border-top-", "-radius:0;border-bottom-", "-radius:0;}& > *:not(:first-child):not(:last-child){border-radius:0;}"], horizontal, props.theme.borderWidths.sm, StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, props.theme.rtl ? 'right' : 'left', props.theme.rtl ? 'left' : 'right', props.theme.rtl ? 'left' : 'right', props.theme.rtl ? 'right' : 'left', props.theme.rtl ? 'right' : 'left');
|
|
697
461
|
};
|
|
698
|
-
|
|
462
|
+
const StyledInputGroup = styled__default["default"].div.attrs({
|
|
699
463
|
'data-garden-id': COMPONENT_ID$y,
|
|
700
|
-
'data-garden-version': '8.
|
|
464
|
+
'data-garden-version': '8.58.0'
|
|
701
465
|
}).withConfig({
|
|
702
466
|
displayName: "StyledInputGroup",
|
|
703
467
|
componentId: "sc-kjh1f0-0"
|
|
704
|
-
})(["display:inline-flex;position:relative;flex-wrap:nowrap;align-items:stretch;z-index:0;width:100%;", ";", ";", ";"],
|
|
705
|
-
return positionStyles(props);
|
|
706
|
-
}, function (props) {
|
|
707
|
-
return itemStyles(props);
|
|
708
|
-
}, function (props) {
|
|
709
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$y, props);
|
|
710
|
-
});
|
|
468
|
+
})(["display:inline-flex;position:relative;flex-wrap:nowrap;align-items:stretch;z-index:0;width:100%;", ";", ";", ";"], props => positionStyles(props), props => itemStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$y, props));
|
|
711
469
|
StyledInputGroup.defaultProps = {
|
|
712
470
|
theme: reactTheming.DEFAULT_THEME
|
|
713
471
|
};
|
|
714
472
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
473
|
+
const COMPONENT_ID$x = 'forms.radio_label';
|
|
474
|
+
const sizeStyles$d = props => {
|
|
475
|
+
const size = props.theme.space.base * 4;
|
|
476
|
+
const padding = size + props.theme.space.base * 2;
|
|
477
|
+
const lineHeight = props.theme.space.base * 5;
|
|
720
478
|
return styled.css(["padding-", ":", "px;&[hidden]{padding-", ":", "px;line-height:", "px;}"], props.theme.rtl ? 'right' : 'left', padding, props.theme.rtl ? 'right' : 'left', size, lineHeight);
|
|
721
479
|
};
|
|
722
|
-
|
|
480
|
+
const StyledRadioLabel = styled__default["default"](StyledLabel).attrs({
|
|
723
481
|
'data-garden-id': COMPONENT_ID$x,
|
|
724
|
-
'data-garden-version': '8.
|
|
482
|
+
'data-garden-version': '8.58.0',
|
|
725
483
|
isRadio: true
|
|
726
484
|
}).withConfig({
|
|
727
485
|
displayName: "StyledRadioLabel",
|
|
728
486
|
componentId: "sc-1aq2e5t-0"
|
|
729
|
-
})(["display:inline-block;position:relative;cursor:pointer;
|
|
730
|
-
return sizeStyles$d(props);
|
|
731
|
-
}, function (props) {
|
|
732
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$x, props);
|
|
733
|
-
});
|
|
487
|
+
})(["display:inline-block;position:relative;cursor:pointer;", ";", ";"], props => sizeStyles$d(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$x, props));
|
|
734
488
|
StyledRadioLabel.defaultProps = {
|
|
735
489
|
theme: reactTheming.DEFAULT_THEME
|
|
736
490
|
};
|
|
737
491
|
|
|
738
|
-
|
|
739
|
-
|
|
492
|
+
const COMPONENT_ID$w = 'forms.checkbox_label';
|
|
493
|
+
const StyledCheckLabel = styled__default["default"](StyledRadioLabel).attrs({
|
|
740
494
|
'data-garden-id': COMPONENT_ID$w,
|
|
741
|
-
'data-garden-version': '8.
|
|
495
|
+
'data-garden-version': '8.58.0'
|
|
742
496
|
}).withConfig({
|
|
743
497
|
displayName: "StyledCheckLabel",
|
|
744
498
|
componentId: "sc-x7nr1-0"
|
|
745
|
-
})(["", ";"],
|
|
746
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$w, props);
|
|
747
|
-
});
|
|
499
|
+
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$w, props));
|
|
748
500
|
StyledCheckLabel.defaultProps = {
|
|
749
501
|
theme: reactTheming.DEFAULT_THEME
|
|
750
502
|
};
|
|
751
503
|
|
|
752
|
-
|
|
753
|
-
|
|
504
|
+
const COMPONENT_ID$v = 'forms.radio_hint';
|
|
505
|
+
const StyledRadioHint = styled__default["default"](StyledHint).attrs({
|
|
754
506
|
'data-garden-id': COMPONENT_ID$v,
|
|
755
|
-
'data-garden-version': '8.
|
|
507
|
+
'data-garden-version': '8.58.0'
|
|
756
508
|
}).withConfig({
|
|
757
509
|
displayName: "StyledRadioHint",
|
|
758
510
|
componentId: "sc-eo8twg-0"
|
|
759
|
-
})(["padding-", ":", ";", ";"],
|
|
760
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
761
|
-
}, function (props) {
|
|
762
|
-
return polished.math("".concat(props.theme.space.base, " * 6px"));
|
|
763
|
-
}, function (props) {
|
|
764
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$v, props);
|
|
765
|
-
});
|
|
511
|
+
})(["padding-", ":", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => polished.math(`${props.theme.space.base} * 6px`), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$v, props));
|
|
766
512
|
StyledRadioHint.defaultProps = {
|
|
767
513
|
theme: reactTheming.DEFAULT_THEME
|
|
768
514
|
};
|
|
769
515
|
|
|
770
|
-
|
|
771
|
-
|
|
516
|
+
const COMPONENT_ID$u = 'forms.checkbox_hint';
|
|
517
|
+
const StyledCheckHint = styled__default["default"](StyledRadioHint).attrs({
|
|
772
518
|
'data-garden-id': COMPONENT_ID$u,
|
|
773
|
-
'data-garden-version': '8.
|
|
519
|
+
'data-garden-version': '8.58.0'
|
|
774
520
|
}).withConfig({
|
|
775
521
|
displayName: "StyledCheckHint",
|
|
776
522
|
componentId: "sc-1kl8e8c-0"
|
|
777
|
-
})(["", ";"],
|
|
778
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$u, props);
|
|
779
|
-
});
|
|
523
|
+
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$u, props));
|
|
780
524
|
StyledCheckHint.defaultProps = {
|
|
781
525
|
theme: reactTheming.DEFAULT_THEME
|
|
782
526
|
};
|
|
783
527
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
528
|
+
const COMPONENT_ID$t = 'forms.radio';
|
|
529
|
+
const colorStyles$9 = props => {
|
|
530
|
+
const SHADE = 600;
|
|
531
|
+
const borderColor = reactTheming.getColor('neutralHue', SHADE - 300, props.theme);
|
|
532
|
+
const backgroundColor = props.theme.colors.background;
|
|
533
|
+
const iconColor = backgroundColor;
|
|
534
|
+
const hoverBackgroundColor = reactTheming.getColor('primaryHue', SHADE, props.theme, 0.08);
|
|
535
|
+
const hoverBorderColor = reactTheming.getColor('primaryHue', SHADE, props.theme);
|
|
536
|
+
const focusBorderColor = hoverBorderColor;
|
|
537
|
+
const activeBackgroundColor = reactTheming.getColor('primaryHue', SHADE, props.theme, 0.2);
|
|
538
|
+
const activeBorderColor = focusBorderColor;
|
|
539
|
+
const boxShadow = props.theme.shadows.md(polished.rgba(focusBorderColor, 0.35));
|
|
540
|
+
const checkedBorderColor = focusBorderColor;
|
|
541
|
+
const checkedBackgroundColor = checkedBorderColor;
|
|
542
|
+
const checkedHoverBorderColor = reactTheming.getColor('primaryHue', SHADE + 100, props.theme);
|
|
543
|
+
const checkedHoverBackgroundColor = checkedHoverBorderColor;
|
|
544
|
+
const checkedActiveBorderColor = reactTheming.getColor('primaryHue', SHADE + 200, props.theme);
|
|
545
|
+
const checkedActiveBackgroundColor = checkedActiveBorderColor;
|
|
546
|
+
const disabledBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 400, props.theme);
|
|
803
547
|
return styled.css(["& ~ ", "::before{border-color:", ";background-color:", ";}& ~ ", " > svg{color:", ";}& ~ ", ":hover::before{border-color:", ";background-color:", ";}&[data-garden-focus-visible='true'] ~ ", "::before{border-color:", ";box-shadow:", ";}& ~ ", ":active::before{border-color:", ";background-color:", ";}&:checked ~ ", "::before{border-color:", ";background-color:", ";}&:enabled:checked ~ ", ":hover::before{border-color:", ";background-color:", ";}&:enabled:checked ~ ", ":active::before{border-color:", ";background-color:", ";}&:disabled ~ ", "::before{border-color:transparent;background-color:", ";}"], StyledRadioLabel, borderColor, backgroundColor, StyledRadioLabel, iconColor, StyledRadioLabel, hoverBorderColor, hoverBackgroundColor, StyledRadioLabel, focusBorderColor, boxShadow, StyledRadioLabel, activeBorderColor, activeBackgroundColor, StyledRadioLabel, checkedBorderColor, checkedBackgroundColor, StyledRadioLabel, checkedHoverBorderColor, checkedHoverBackgroundColor, StyledRadioLabel, checkedActiveBorderColor, checkedActiveBackgroundColor, StyledRadioLabel, disabledBackgroundColor);
|
|
804
548
|
};
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
549
|
+
const sizeStyles$c = props => {
|
|
550
|
+
const lineHeight = `${props.theme.space.base * 5}px`;
|
|
551
|
+
const size = `${props.theme.space.base * 4}px`;
|
|
552
|
+
const top = polished.math(`(${lineHeight} - ${size}) / 2`);
|
|
553
|
+
const iconSize = props.theme.iconSizes.sm;
|
|
554
|
+
const iconPosition = polished.math(`(${size} - ${iconSize}) / 2`);
|
|
555
|
+
const iconTop = polished.math(`${iconPosition} + ${top}`);
|
|
556
|
+
const marginTop = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
|
|
813
557
|
return styled.css(["top:", ";width:", ";height:", ";& ~ ", "::before{top:", ";background-size:", ";width:", ";height:", ";box-sizing:border-box;}& ~ ", " > svg{top:", ";", ":", ";width:", ";height:", ";}&& ~ ", " ~ ", "{margin-top:", ";}"], top, size, size, StyledRadioLabel, top, props.theme.iconSizes.sm, size, size, StyledRadioLabel, iconTop, props.theme.rtl ? 'right' : 'left', iconPosition, iconSize, iconSize, StyledRadioLabel, StyledMessage, marginTop);
|
|
814
558
|
};
|
|
815
|
-
|
|
559
|
+
const StyledRadioInput = styled__default["default"].input.attrs({
|
|
816
560
|
'data-garden-id': COMPONENT_ID$t,
|
|
817
|
-
'data-garden-version': '8.
|
|
561
|
+
'data-garden-version': '8.58.0',
|
|
818
562
|
type: 'radio'
|
|
819
563
|
}).withConfig({
|
|
820
564
|
displayName: "StyledRadioInput",
|
|
821
565
|
componentId: "sc-qsavpv-0"
|
|
822
|
-
})(["position:absolute;opacity:0;margin:0;& ~ ", "::before{position:absolute;", ":0;transition:border-color .25s ease-in-out,box-shadow .1s ease-in-out,background-color .25s ease-in-out,color .25s ease-in-out;border:", ";border-radius:50%;background-repeat:no-repeat;background-position:center;content:'';}& ~ ", " > svg{position:absolute;}", ";&:focus ~ ", "::before{outline:none;}& ~ ", ":active::before{transition:border-color 0.1s ease-in-out,background-color 0.1s ease-in-out,color 0.1s ease-in-out;}", ";&:disabled ~ ", "{cursor:default;}", ";"], StyledRadioLabel,
|
|
823
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
824
|
-
}, function (props) {
|
|
825
|
-
return props.theme.borders.sm;
|
|
826
|
-
}, StyledRadioLabel, function (props) {
|
|
827
|
-
return sizeStyles$c(props);
|
|
828
|
-
}, StyledRadioLabel, StyledRadioLabel, function (props) {
|
|
829
|
-
return colorStyles$9(props);
|
|
830
|
-
}, StyledRadioLabel, function (props) {
|
|
831
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$t, props);
|
|
832
|
-
});
|
|
566
|
+
})(["position:absolute;opacity:0;margin:0;& ~ ", "::before{position:absolute;", ":0;transition:border-color .25s ease-in-out,box-shadow .1s ease-in-out,background-color .25s ease-in-out,color .25s ease-in-out;border:", ";border-radius:50%;background-repeat:no-repeat;background-position:center;content:'';}& ~ ", " > svg{position:absolute;}", ";&:focus ~ ", "::before{outline:none;}& ~ ", ":active::before{transition:border-color 0.1s ease-in-out,background-color 0.1s ease-in-out,color 0.1s ease-in-out;}", ";&:disabled ~ ", "{cursor:default;}", ";"], StyledRadioLabel, props => props.theme.rtl ? 'right' : 'left', props => props.theme.borders.sm, StyledRadioLabel, props => sizeStyles$c(props), StyledRadioLabel, StyledRadioLabel, props => colorStyles$9(props), StyledRadioLabel, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$t, props));
|
|
833
567
|
StyledRadioInput.defaultProps = {
|
|
834
568
|
theme: reactTheming.DEFAULT_THEME
|
|
835
569
|
};
|
|
836
570
|
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
571
|
+
const COMPONENT_ID$s = 'forms.checkbox';
|
|
572
|
+
const colorStyles$8 = props => {
|
|
573
|
+
const SHADE = 600;
|
|
574
|
+
const indeterminateBorderColor = reactTheming.getColor('primaryHue', SHADE, props.theme);
|
|
575
|
+
const indeterminateBackgroundColor = indeterminateBorderColor;
|
|
576
|
+
const indeterminateActiveBorderColor = reactTheming.getColor('primaryHue', SHADE + 100, props.theme);
|
|
577
|
+
const indeterminateActiveBackgroundColor = indeterminateActiveBorderColor;
|
|
578
|
+
const indeterminateDisabledBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 400, props.theme);
|
|
845
579
|
return styled.css(["&:indeterminate ~ ", "::before{border-color:", ";background-color:", ";}&:enabled:indeterminate ~ ", ":active::before{border-color:", ";background-color:", ";}&:disabled:indeterminate ~ ", "::before{border-color:transparent;background-color:", ";}"], StyledCheckLabel, indeterminateBorderColor, indeterminateBackgroundColor, StyledCheckLabel, indeterminateActiveBorderColor, indeterminateActiveBackgroundColor, StyledCheckLabel, indeterminateDisabledBackgroundColor);
|
|
846
580
|
};
|
|
847
|
-
|
|
581
|
+
const StyledCheckInput = styled__default["default"](StyledRadioInput).attrs({
|
|
848
582
|
'data-garden-id': COMPONENT_ID$s,
|
|
849
|
-
'data-garden-version': '8.
|
|
583
|
+
'data-garden-version': '8.58.0',
|
|
850
584
|
type: 'checkbox'
|
|
851
585
|
}).withConfig({
|
|
852
586
|
displayName: "StyledCheckInput",
|
|
853
587
|
componentId: "sc-176jxxe-0"
|
|
854
|
-
})(["& ~ ", "::before{border-radius:", ";}", ";", ";"], StyledCheckLabel,
|
|
855
|
-
return props.theme.borderRadii.md;
|
|
856
|
-
}, function (props) {
|
|
857
|
-
return colorStyles$8(props);
|
|
858
|
-
}, function (props) {
|
|
859
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$s, props);
|
|
860
|
-
});
|
|
588
|
+
})(["& ~ ", "::before{border-radius:", ";}", ";", ";"], StyledCheckLabel, props => props.theme.borderRadii.md, props => colorStyles$8(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$s, props));
|
|
861
589
|
StyledCheckInput.defaultProps = {
|
|
862
590
|
theme: reactTheming.DEFAULT_THEME
|
|
863
591
|
};
|
|
864
592
|
|
|
865
|
-
|
|
866
|
-
|
|
593
|
+
const COMPONENT_ID$r = 'forms.radio_message';
|
|
594
|
+
const StyledRadioMessage = styled__default["default"](StyledMessage).attrs({
|
|
867
595
|
'data-garden-id': COMPONENT_ID$r,
|
|
868
|
-
'data-garden-version': '8.
|
|
596
|
+
'data-garden-version': '8.58.0'
|
|
869
597
|
}).withConfig({
|
|
870
598
|
displayName: "StyledRadioMessage",
|
|
871
599
|
componentId: "sc-1pmi0q8-0"
|
|
872
|
-
})(["padding-", ":", ";", ";"],
|
|
873
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
874
|
-
}, function (props) {
|
|
875
|
-
return polished.math("".concat(props.theme.space.base, " * 6px"));
|
|
876
|
-
}, function (props) {
|
|
877
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$r, props);
|
|
878
|
-
});
|
|
600
|
+
})(["padding-", ":", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => polished.math(`${props.theme.space.base} * 6px`), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$r, props));
|
|
879
601
|
StyledRadioMessage.defaultProps = {
|
|
880
602
|
theme: reactTheming.DEFAULT_THEME
|
|
881
603
|
};
|
|
882
604
|
|
|
883
|
-
|
|
884
|
-
|
|
605
|
+
const COMPONENT_ID$q = 'forms.checkbox_message';
|
|
606
|
+
const StyledCheckMessage = styled__default["default"](StyledRadioMessage).attrs({
|
|
885
607
|
'data-garden-id': COMPONENT_ID$q,
|
|
886
|
-
'data-garden-version': '8.
|
|
608
|
+
'data-garden-version': '8.58.0'
|
|
887
609
|
}).withConfig({
|
|
888
610
|
displayName: "StyledCheckMessage",
|
|
889
611
|
componentId: "sc-s4p6kd-0"
|
|
890
|
-
})(["", ";"],
|
|
891
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$q, props);
|
|
892
|
-
});
|
|
612
|
+
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$q, props));
|
|
893
613
|
StyledCheckMessage.defaultProps = {
|
|
894
614
|
theme: reactTheming.DEFAULT_THEME
|
|
895
615
|
};
|
|
@@ -905,7 +625,8 @@ var SvgCheckSmFill = function SvgCheckSmFill(props) {
|
|
|
905
625
|
height: 12,
|
|
906
626
|
focusable: "false",
|
|
907
627
|
viewBox: "0 0 12 12",
|
|
908
|
-
"aria-hidden": "true"
|
|
628
|
+
"aria-hidden": "true",
|
|
629
|
+
role: "img"
|
|
909
630
|
}, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
|
|
910
631
|
fill: "none",
|
|
911
632
|
stroke: "currentColor",
|
|
@@ -916,16 +637,14 @@ var SvgCheckSmFill = function SvgCheckSmFill(props) {
|
|
|
916
637
|
})));
|
|
917
638
|
};
|
|
918
639
|
|
|
919
|
-
|
|
920
|
-
|
|
640
|
+
const COMPONENT_ID$p = 'forms.check_svg';
|
|
641
|
+
const StyledCheckSvg = styled__default["default"](SvgCheckSmFill).attrs({
|
|
921
642
|
'data-garden-id': COMPONENT_ID$p,
|
|
922
|
-
'data-garden-version': '8.
|
|
643
|
+
'data-garden-version': '8.58.0'
|
|
923
644
|
}).withConfig({
|
|
924
645
|
displayName: "StyledCheckSvg",
|
|
925
646
|
componentId: "sc-fvxetk-0"
|
|
926
|
-
})(["transition:opacity 0.25 ease-in-out;opacity:0;pointer-events:none;", ":checked ~ ", " > &{opacity:1;}", ":indeterminate ~ ", " > &{opacity:0;}", ";"], StyledCheckInput, StyledCheckLabel, StyledCheckInput, StyledCheckLabel,
|
|
927
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$p, props);
|
|
928
|
-
});
|
|
647
|
+
})(["transition:opacity 0.25 ease-in-out;opacity:0;pointer-events:none;", ":checked ~ ", " > &{opacity:1;}", ":indeterminate ~ ", " > &{opacity:0;}", ";"], StyledCheckInput, StyledCheckLabel, StyledCheckInput, StyledCheckLabel, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$p, props));
|
|
929
648
|
StyledCheckSvg.defaultProps = {
|
|
930
649
|
theme: reactTheming.DEFAULT_THEME
|
|
931
650
|
};
|
|
@@ -941,7 +660,8 @@ var SvgDashFill = function SvgDashFill(props) {
|
|
|
941
660
|
height: 12,
|
|
942
661
|
focusable: "false",
|
|
943
662
|
viewBox: "0 0 12 12",
|
|
944
|
-
"aria-hidden": "true"
|
|
663
|
+
"aria-hidden": "true",
|
|
664
|
+
role: "img"
|
|
945
665
|
}, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
|
|
946
666
|
stroke: "currentColor",
|
|
947
667
|
strokeLinecap: "round",
|
|
@@ -950,78 +670,64 @@ var SvgDashFill = function SvgDashFill(props) {
|
|
|
950
670
|
})));
|
|
951
671
|
};
|
|
952
672
|
|
|
953
|
-
|
|
954
|
-
|
|
673
|
+
const COMPONENT_ID$o = 'forms.dash_svg';
|
|
674
|
+
const StyledDashSvg = styled__default["default"](SvgDashFill).attrs({
|
|
955
675
|
'data-garden-id': COMPONENT_ID$o,
|
|
956
|
-
'data-garden-version': '8.
|
|
676
|
+
'data-garden-version': '8.58.0'
|
|
957
677
|
}).withConfig({
|
|
958
678
|
displayName: "StyledDashSvg",
|
|
959
679
|
componentId: "sc-z3vq71-0"
|
|
960
|
-
})(["transition:opacity 0.25 ease-in-out;opacity:0;pointer-events:none;", ":indeterminate ~ ", " > &{opacity:1;}", ";"], StyledCheckInput, StyledCheckLabel,
|
|
961
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$o, props);
|
|
962
|
-
});
|
|
680
|
+
})(["transition:opacity 0.25 ease-in-out;opacity:0;pointer-events:none;", ":indeterminate ~ ", " > &{opacity:1;}", ";"], StyledCheckInput, StyledCheckLabel, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$o, props));
|
|
963
681
|
StyledDashSvg.defaultProps = {
|
|
964
682
|
theme: reactTheming.DEFAULT_THEME
|
|
965
683
|
};
|
|
966
684
|
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
685
|
+
const COMPONENT_ID$n = 'forms.file_upload';
|
|
686
|
+
const colorStyles$7 = props => {
|
|
687
|
+
const baseColor = reactTheming.getColor('primaryHue', 600, props.theme);
|
|
688
|
+
const hoverColor = reactTheming.getColor('primaryHue', 700, props.theme);
|
|
689
|
+
const activeColor = reactTheming.getColor('primaryHue', 800, props.theme);
|
|
690
|
+
const disabledBackgroundColor = reactTheming.getColor('neutralHue', 200, props.theme);
|
|
691
|
+
const disabledForegroundColor = reactTheming.getColor('neutralHue', 400, props.theme);
|
|
692
|
+
const boxShadow = `inset ${props.theme.shadows.md(polished.rgba(baseColor, 0.35))}`;
|
|
975
693
|
return styled.css(["border-color:", ";background-color:", ";color:", ";&:hover{border-color:", ";background-color:", ";color:", ";}&[data-garden-focus-visible]{box-shadow:", ";}&:active{border-color:", ";background-color:", ";color:", ";}&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], props.isDragging ? activeColor : reactTheming.getColor('neutralHue', 600, props.theme), props.isDragging && polished.rgba(baseColor, 0.2), props.isDragging ? activeColor : baseColor, hoverColor, polished.rgba(baseColor, 0.08), hoverColor, boxShadow, activeColor, polished.rgba(baseColor, 0.2), activeColor, disabledForegroundColor, disabledBackgroundColor, disabledForegroundColor);
|
|
976
694
|
};
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
695
|
+
const sizeStyles$b = props => {
|
|
696
|
+
const marginTop = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
|
|
697
|
+
const paddingHorizontal = `${props.isCompact ? 2 : 4}em`;
|
|
698
|
+
const paddingVertical = polished.math(`${props.theme.space.base * (props.isCompact ? 2.5 : 5)} - ${props.theme.borderWidths.sm}`);
|
|
699
|
+
const fontSize = props.theme.fontSizes.md;
|
|
700
|
+
const lineHeight = reactTheming.getLineHeight(props.theme.space.base * 5, fontSize);
|
|
983
701
|
return styled.css(["padding:", " ", ";min-width:4em;line-height:", ";font-size:", ";", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}"], paddingVertical, paddingHorizontal, lineHeight, fontSize, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, marginTop);
|
|
984
702
|
};
|
|
985
|
-
|
|
703
|
+
const StyledFileUpload = styled__default["default"].div.attrs({
|
|
986
704
|
'data-garden-id': COMPONENT_ID$n,
|
|
987
|
-
'data-garden-version': '8.
|
|
705
|
+
'data-garden-version': '8.58.0'
|
|
988
706
|
}).withConfig({
|
|
989
707
|
displayName: "StyledFileUpload",
|
|
990
708
|
componentId: "sc-1rodjgn-0"
|
|
991
|
-
})(["display:flex;align-items:center;justify-content:center;box-sizing:border-box;direction:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:dashed ", ";border-radius:", ";cursor:pointer;text-align:center;user-select:none;", ";&:focus{outline:none;}&[aria-disabled='true']{cursor:default;}", ";", ";"],
|
|
992
|
-
return props.theme.rtl ? 'rtl' : 'ltr';
|
|
993
|
-
}, function (props) {
|
|
994
|
-
return props.theme.borderWidths.sm;
|
|
995
|
-
}, function (props) {
|
|
996
|
-
return props.theme.borderRadii.md;
|
|
997
|
-
}, sizeStyles$b, colorStyles$7, function (props) {
|
|
998
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$n, props);
|
|
999
|
-
});
|
|
709
|
+
})(["display:flex;align-items:center;justify-content:center;box-sizing:border-box;direction:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:dashed ", ";border-radius:", ";cursor:pointer;text-align:center;user-select:none;", ";&:focus{outline:none;}&[aria-disabled='true']{cursor:default;}", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.borderWidths.sm, props => props.theme.borderRadii.md, sizeStyles$b, colorStyles$7, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$n, props));
|
|
1000
710
|
StyledFileUpload.defaultProps = {
|
|
1001
711
|
theme: reactTheming.DEFAULT_THEME
|
|
1002
712
|
};
|
|
1003
713
|
|
|
1004
|
-
|
|
1005
|
-
|
|
714
|
+
const COMPONENT_ID$m = 'forms.file.close';
|
|
715
|
+
const StyledFileClose = styled__default["default"].div.attrs({
|
|
1006
716
|
'data-garden-id': COMPONENT_ID$m,
|
|
1007
|
-
'data-garden-version': '8.
|
|
717
|
+
'data-garden-version': '8.58.0'
|
|
1008
718
|
}).withConfig({
|
|
1009
719
|
displayName: "StyledFileClose",
|
|
1010
720
|
componentId: "sc-1m31jbf-0"
|
|
1011
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;cursor:pointer;color:", ";&:hover{opacity:0.9;}&:focus{outline:none;}", ";"],
|
|
1012
|
-
return props.theme.colors.foreground;
|
|
1013
|
-
}, function (props) {
|
|
1014
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$m, props);
|
|
1015
|
-
});
|
|
721
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;cursor:pointer;color:", ";&:hover{opacity:0.9;}&:focus{outline:none;}", ";"], props => props.theme.colors.foreground, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$m, props));
|
|
1016
722
|
StyledFileClose.defaultProps = {
|
|
1017
723
|
theme: reactTheming.DEFAULT_THEME
|
|
1018
724
|
};
|
|
1019
725
|
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
726
|
+
const COMPONENT_ID$l = 'forms.file';
|
|
727
|
+
const colorStyles$6 = props => {
|
|
728
|
+
let borderColor;
|
|
729
|
+
let focusBorderColor;
|
|
730
|
+
let foregroundColor;
|
|
1025
731
|
if (props.validation === 'success') {
|
|
1026
732
|
borderColor = reactTheming.getColor('successHue', 600, props.theme);
|
|
1027
733
|
focusBorderColor = borderColor;
|
|
@@ -1035,100 +741,107 @@ var colorStyles$6 = function colorStyles(props) {
|
|
|
1035
741
|
focusBorderColor = reactTheming.getColor('primaryHue', 600, props.theme);
|
|
1036
742
|
foregroundColor = props.theme.colors.foreground;
|
|
1037
743
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
744
|
+
const boxShadow = `
|
|
745
|
+
${props.focusInset ? 'inset' : ''}
|
|
746
|
+
${props.theme.shadows.md(polished.rgba(focusBorderColor, 0.35))}`;
|
|
747
|
+
return `
|
|
748
|
+
border-color: ${borderColor};
|
|
749
|
+
color: ${foregroundColor};
|
|
750
|
+
|
|
751
|
+
&:focus {
|
|
752
|
+
box-shadow: ${boxShadow};
|
|
753
|
+
border-color: ${focusBorderColor};
|
|
754
|
+
}
|
|
755
|
+
`;
|
|
756
|
+
};
|
|
757
|
+
const sizeStyles$a = props => {
|
|
758
|
+
const size = `${props.theme.space.base * (props.isCompact ? 7 : 10)}px`;
|
|
759
|
+
const spacing = `${props.theme.space.base * (props.isCompact ? 2 : 3)}px`;
|
|
760
|
+
const fontSize = props.theme.fontSizes.md;
|
|
761
|
+
const lineHeight = reactTheming.getLineHeight(props.theme.space.base * 5, fontSize);
|
|
762
|
+
return `
|
|
763
|
+
box-sizing: border-box;
|
|
764
|
+
border: ${props.theme.borders.sm};
|
|
765
|
+
border-radius: ${props.theme.borderRadii.md};
|
|
766
|
+
padding: 0 ${spacing};
|
|
767
|
+
height: ${size};
|
|
768
|
+
line-height: ${lineHeight};
|
|
769
|
+
font-size: ${fontSize};
|
|
770
|
+
|
|
771
|
+
& > span {
|
|
772
|
+
width: 100%;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
& > ${StyledFileClose} {
|
|
776
|
+
width: ${size};
|
|
777
|
+
height: ${size};
|
|
778
|
+
margin-${props.theme.rtl ? 'left' : 'right'}: -${spacing};
|
|
779
|
+
}
|
|
780
|
+
`;
|
|
1047
781
|
};
|
|
1048
|
-
|
|
782
|
+
const StyledFile = styled__default["default"].div.attrs({
|
|
1049
783
|
'data-garden-id': COMPONENT_ID$l,
|
|
1050
|
-
'data-garden-version': '8.
|
|
784
|
+
'data-garden-version': '8.58.0'
|
|
1051
785
|
}).withConfig({
|
|
1052
786
|
displayName: "StyledFile",
|
|
1053
787
|
componentId: "sc-195lzp1-0"
|
|
1054
|
-
})(["display:flex;position:relative;flex-wrap:nowrap;align-items:center;", ";&:focus{outline:none;}", ";& > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}& > [role='progressbar']{position:absolute;bottom:0;left:0;transition:opacity 0.2s ease-in-out;margin:0;border-top-left-radius:0;border-top-right-radius:0;width:100%;& > div{border-top-", "-radius:0;}}& > [role='progressbar'][aria-valuenow='0'],& > [role='progressbar'][aria-valuenow='100']{opacity:0;}", ";"], sizeStyles$a, colorStyles$6,
|
|
1055
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
1056
|
-
}, function (props) {
|
|
1057
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$l, props);
|
|
1058
|
-
});
|
|
788
|
+
})(["display:flex;position:relative;flex-wrap:nowrap;align-items:center;", ";&:focus{outline:none;}", ";& > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}& > [role='progressbar']{position:absolute;bottom:0;left:0;transition:opacity 0.2s ease-in-out;margin:0;border-top-left-radius:0;border-top-right-radius:0;width:100%;& > div{border-top-", "-radius:0;}}& > [role='progressbar'][aria-valuenow='0'],& > [role='progressbar'][aria-valuenow='100']{opacity:0;}", ";"], sizeStyles$a, colorStyles$6, props => props.theme.rtl ? 'right' : 'left', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$l, props));
|
|
1059
789
|
StyledFile.defaultProps = {
|
|
1060
790
|
theme: reactTheming.DEFAULT_THEME
|
|
1061
791
|
};
|
|
1062
792
|
|
|
1063
|
-
|
|
1064
|
-
|
|
793
|
+
const COMPONENT_ID$k = 'forms.file.delete';
|
|
794
|
+
const StyledFileDelete = styled__default["default"](StyledFileClose).attrs({
|
|
1065
795
|
'data-garden-id': COMPONENT_ID$k,
|
|
1066
|
-
'data-garden-version': '8.
|
|
796
|
+
'data-garden-version': '8.58.0'
|
|
1067
797
|
}).withConfig({
|
|
1068
798
|
displayName: "StyledFileDelete",
|
|
1069
799
|
componentId: "sc-a8nnhx-0"
|
|
1070
|
-
})(["color:", ";", ";"],
|
|
1071
|
-
return reactTheming.getColor('dangerHue', 600, props.theme);
|
|
1072
|
-
}, function (props) {
|
|
1073
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$k, props);
|
|
1074
|
-
});
|
|
800
|
+
})(["color:", ";", ";"], props => reactTheming.getColor('dangerHue', 600, props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$k, props));
|
|
1075
801
|
StyledFileDelete.defaultProps = {
|
|
1076
802
|
theme: reactTheming.DEFAULT_THEME
|
|
1077
803
|
};
|
|
1078
804
|
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
805
|
+
const COMPONENT_ID$j = 'forms.file.icon';
|
|
806
|
+
const StyledFileIcon = styled__default["default"](_ref => {
|
|
807
|
+
let {
|
|
808
|
+
children,
|
|
809
|
+
isCompact,
|
|
810
|
+
theme,
|
|
811
|
+
...props
|
|
812
|
+
} = _ref;
|
|
1086
813
|
return React__default["default"].cloneElement(React.Children.only(children), props);
|
|
1087
814
|
}).attrs({
|
|
1088
815
|
'data-garden-id': COMPONENT_ID$j,
|
|
1089
|
-
'data-garden-version': '8.
|
|
816
|
+
'data-garden-version': '8.58.0'
|
|
1090
817
|
}).withConfig({
|
|
1091
818
|
displayName: "StyledFileIcon",
|
|
1092
819
|
componentId: "sc-7b3q0c-0"
|
|
1093
|
-
})(["flex-shrink:0;width:", ";margin-", ":", "px;", ";"],
|
|
1094
|
-
return props.isCompact ? props.theme.iconSizes.sm : props.theme.iconSizes.md;
|
|
1095
|
-
}, function (props) {
|
|
1096
|
-
return props.theme.rtl ? 'left' : 'right';
|
|
1097
|
-
}, function (props) {
|
|
1098
|
-
return props.theme.space.base * 2;
|
|
1099
|
-
}, function (props) {
|
|
1100
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$j, props);
|
|
1101
|
-
});
|
|
820
|
+
})(["flex-shrink:0;width:", ";margin-", ":", "px;", ";"], props => props.isCompact ? props.theme.iconSizes.sm : props.theme.iconSizes.md, props => props.theme.rtl ? 'left' : 'right', props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$j, props));
|
|
1102
821
|
StyledFileIcon.defaultProps = {
|
|
1103
822
|
theme: reactTheming.DEFAULT_THEME
|
|
1104
823
|
};
|
|
1105
824
|
|
|
1106
|
-
|
|
1107
|
-
|
|
825
|
+
const COMPONENT_ID$i = 'forms.file_list';
|
|
826
|
+
const StyledFileList = styled__default["default"].ul.attrs({
|
|
1108
827
|
'data-garden-id': COMPONENT_ID$i,
|
|
1109
|
-
'data-garden-version': '8.
|
|
828
|
+
'data-garden-version': '8.58.0'
|
|
1110
829
|
}).withConfig({
|
|
1111
830
|
displayName: "StyledFileList",
|
|
1112
831
|
componentId: "sc-gbahjg-0"
|
|
1113
|
-
})(["margin:0;padding:0;list-style:none;", ";"],
|
|
1114
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$i, props);
|
|
1115
|
-
});
|
|
832
|
+
})(["margin:0;padding:0;list-style:none;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$i, props));
|
|
1116
833
|
StyledFileList.defaultProps = {
|
|
1117
834
|
theme: reactTheming.DEFAULT_THEME
|
|
1118
835
|
};
|
|
1119
836
|
|
|
1120
|
-
|
|
1121
|
-
|
|
837
|
+
const COMPONENT_ID$h = 'forms.file_list.item';
|
|
838
|
+
const StyledFileListItem = styled__default["default"].li.attrs({
|
|
1122
839
|
'data-garden-id': COMPONENT_ID$h,
|
|
1123
|
-
'data-garden-version': '8.
|
|
840
|
+
'data-garden-version': '8.58.0'
|
|
1124
841
|
}).withConfig({
|
|
1125
842
|
displayName: "StyledFileListItem",
|
|
1126
843
|
componentId: "sc-1ova3lo-0"
|
|
1127
|
-
})(["&:not(:first-child),", " ~ ", " > &:first-child{margin-top:", "px;}", ";"], StyledFileUpload, StyledFileList,
|
|
1128
|
-
return props.theme.space.base * 2;
|
|
1129
|
-
}, function (props) {
|
|
1130
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$h, props);
|
|
1131
|
-
});
|
|
844
|
+
})(["&:not(:first-child),", " ~ ", " > &:first-child{margin-top:", "px;}", ";"], StyledFileUpload, StyledFileList, props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$h, props));
|
|
1132
845
|
StyledFileListItem.defaultProps = {
|
|
1133
846
|
theme: reactTheming.DEFAULT_THEME
|
|
1134
847
|
};
|
|
@@ -1144,7 +857,8 @@ var SvgCircleSmFill$1 = function SvgCircleSmFill(props) {
|
|
|
1144
857
|
height: 12,
|
|
1145
858
|
focusable: "false",
|
|
1146
859
|
viewBox: "0 0 12 12",
|
|
1147
|
-
"aria-hidden": "true"
|
|
860
|
+
"aria-hidden": "true",
|
|
861
|
+
role: "img"
|
|
1148
862
|
}, props), _circle$3 || (_circle$3 = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
1149
863
|
cx: 6,
|
|
1150
864
|
cy: 6,
|
|
@@ -1153,110 +867,82 @@ var SvgCircleSmFill$1 = function SvgCircleSmFill(props) {
|
|
|
1153
867
|
})));
|
|
1154
868
|
};
|
|
1155
869
|
|
|
1156
|
-
|
|
1157
|
-
|
|
870
|
+
const COMPONENT_ID$g = 'forms.radio_svg';
|
|
871
|
+
const StyledRadioSvg = styled__default["default"](SvgCircleSmFill$1).attrs({
|
|
1158
872
|
'data-garden-id': COMPONENT_ID$g,
|
|
1159
|
-
'data-garden-version': '8.
|
|
873
|
+
'data-garden-version': '8.58.0'
|
|
1160
874
|
}).withConfig({
|
|
1161
875
|
displayName: "StyledRadioSvg",
|
|
1162
876
|
componentId: "sc-1r1qtr1-0"
|
|
1163
|
-
})(["transition:opacity 0.25 ease-in-out;opacity:0;", ":checked ~ ", " > &{opacity:1;}", ";"], StyledRadioInput, StyledRadioLabel,
|
|
1164
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$g, props);
|
|
1165
|
-
});
|
|
877
|
+
})(["transition:opacity 0.25 ease-in-out;opacity:0;", ":checked ~ ", " > &{opacity:1;}", ";"], StyledRadioInput, StyledRadioLabel, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$g, props));
|
|
1166
878
|
StyledRadioSvg.defaultProps = {
|
|
1167
879
|
theme: reactTheming.DEFAULT_THEME
|
|
1168
880
|
};
|
|
1169
881
|
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
882
|
+
const COMPONENT_ID$f = 'forms.toggle_label';
|
|
883
|
+
const sizeStyles$9 = props => {
|
|
884
|
+
const size = props.theme.space.base * 10;
|
|
885
|
+
const padding = size + props.theme.space.base * 2;
|
|
1174
886
|
return styled.css(["padding-", ":", "px;&[hidden]{padding-", ":", "px;}"], props.theme.rtl ? 'right' : 'left', padding, props.theme.rtl ? 'right' : 'left', size);
|
|
1175
887
|
};
|
|
1176
|
-
|
|
888
|
+
const StyledToggleLabel = styled__default["default"](StyledCheckLabel).attrs({
|
|
1177
889
|
'data-garden-id': COMPONENT_ID$f,
|
|
1178
|
-
'data-garden-version': '8.
|
|
890
|
+
'data-garden-version': '8.58.0'
|
|
1179
891
|
}).withConfig({
|
|
1180
892
|
displayName: "StyledToggleLabel",
|
|
1181
893
|
componentId: "sc-e0asdk-0"
|
|
1182
|
-
})(["", ";", ";"],
|
|
1183
|
-
return sizeStyles$9(props);
|
|
1184
|
-
}, function (props) {
|
|
1185
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$f, props);
|
|
1186
|
-
});
|
|
894
|
+
})(["", ";", ";"], props => sizeStyles$9(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$f, props));
|
|
1187
895
|
StyledToggleLabel.defaultProps = {
|
|
1188
896
|
theme: reactTheming.DEFAULT_THEME
|
|
1189
897
|
};
|
|
1190
898
|
|
|
1191
|
-
|
|
1192
|
-
|
|
899
|
+
const COMPONENT_ID$e = 'forms.toggle_hint';
|
|
900
|
+
const StyledToggleHint = styled__default["default"](StyledHint).attrs({
|
|
1193
901
|
'data-garden-id': COMPONENT_ID$e,
|
|
1194
|
-
'data-garden-version': '8.
|
|
902
|
+
'data-garden-version': '8.58.0'
|
|
1195
903
|
}).withConfig({
|
|
1196
904
|
displayName: "StyledToggleHint",
|
|
1197
905
|
componentId: "sc-nziggu-0"
|
|
1198
|
-
})(["padding-", ":", ";", ";"],
|
|
1199
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
1200
|
-
}, function (props) {
|
|
1201
|
-
return polished.math("".concat(props.theme.space.base, " * 12px"));
|
|
1202
|
-
}, function (props) {
|
|
1203
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props);
|
|
1204
|
-
});
|
|
906
|
+
})(["padding-", ":", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => polished.math(`${props.theme.space.base} * 12px`), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props));
|
|
1205
907
|
StyledToggleHint.defaultProps = {
|
|
1206
908
|
theme: reactTheming.DEFAULT_THEME
|
|
1207
909
|
};
|
|
1208
910
|
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
911
|
+
const COMPONENT_ID$d = 'forms.toggle';
|
|
912
|
+
const colorStyles$5 = props => {
|
|
913
|
+
const SHADE = 600;
|
|
914
|
+
const backgroundColor = reactTheming.getColor('neutralHue', SHADE - 100, props.theme);
|
|
915
|
+
const hoverBackgroundColor = reactTheming.getColor('neutralHue', SHADE, props.theme);
|
|
916
|
+
const activeBackgroundColor = reactTheming.getColor('neutralHue', SHADE + 100, props.theme);
|
|
1215
917
|
return styled.css(["& ~ ", "::before{background-color:", ";}&:enabled ~ ", ":hover::before{background-color:", ";}&:enabled ~ ", ":active::before{background-color:", ";}"], StyledToggleLabel, backgroundColor, StyledToggleLabel, hoverBackgroundColor, StyledToggleLabel, activeBackgroundColor);
|
|
1216
918
|
};
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
919
|
+
const sizeStyles$8 = props => {
|
|
920
|
+
const height = `${props.theme.space.base * 5}px`;
|
|
921
|
+
const width = `${props.theme.space.base * 10}px`;
|
|
922
|
+
const iconSize = props.theme.iconSizes.md;
|
|
923
|
+
const iconPosition = polished.math(`(${height} - ${iconSize}) / 2`);
|
|
924
|
+
const checkedIconPosition = polished.math(`${width} - ${iconSize} - ${iconPosition}`);
|
|
1223
925
|
return styled.css(["top:0;width:", ";height:", ";& ~ ", "::before{width:", ";height:", ";}& ~ ", " > svg{top:", ";", ":", ";width:", ";height:", ";}&:checked ~ ", " > svg{", ":", ";}"], width, height, StyledToggleLabel, width, height, StyledToggleLabel, iconPosition, props.theme.rtl ? 'right' : 'left', iconPosition, iconSize, iconSize, StyledToggleLabel, props.theme.rtl ? 'right' : 'left', checkedIconPosition);
|
|
1224
926
|
};
|
|
1225
|
-
|
|
927
|
+
const StyledToggleInput = styled__default["default"](StyledCheckInput).attrs({
|
|
1226
928
|
'data-garden-id': COMPONENT_ID$d,
|
|
1227
|
-
'data-garden-version': '8.
|
|
929
|
+
'data-garden-version': '8.58.0'
|
|
1228
930
|
}).withConfig({
|
|
1229
931
|
displayName: "StyledToggleInput",
|
|
1230
932
|
componentId: "sc-sgp47s-0"
|
|
1231
|
-
})(["& ~ ", "::before{top:0;transition:box-shadow .1s ease-in-out,background-color .15s ease-in-out,color .25s ease-in-out;border:none;border-radius:100px;}", ";", ";", ";"], StyledToggleLabel,
|
|
1232
|
-
return sizeStyles$8(props);
|
|
1233
|
-
}, function (props) {
|
|
1234
|
-
return colorStyles$5(props);
|
|
1235
|
-
}, function (props) {
|
|
1236
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$d, props);
|
|
1237
|
-
});
|
|
933
|
+
})(["& ~ ", "::before{top:0;transition:box-shadow .1s ease-in-out,background-color .15s ease-in-out,color .25s ease-in-out;border:none;border-radius:100px;}", ";", ";", ";"], StyledToggleLabel, props => sizeStyles$8(props), props => colorStyles$5(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$d, props));
|
|
1238
934
|
StyledToggleInput.defaultProps = {
|
|
1239
935
|
theme: reactTheming.DEFAULT_THEME
|
|
1240
936
|
};
|
|
1241
937
|
|
|
1242
|
-
|
|
1243
|
-
|
|
938
|
+
const COMPONENT_ID$c = 'forms.toggle_message';
|
|
939
|
+
const StyledToggleMessage = styled__default["default"](StyledMessage).attrs({
|
|
1244
940
|
'data-garden-id': COMPONENT_ID$c,
|
|
1245
|
-
'data-garden-version': '8.
|
|
941
|
+
'data-garden-version': '8.58.0'
|
|
1246
942
|
}).withConfig({
|
|
1247
943
|
displayName: "StyledToggleMessage",
|
|
1248
944
|
componentId: "sc-13vuvl1-0"
|
|
1249
|
-
})(["padding-", ":", ";& ", "{", ":", ";}", ";"],
|
|
1250
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
1251
|
-
}, function (props) {
|
|
1252
|
-
return polished.math("".concat(props.theme.space.base, " * 12px"));
|
|
1253
|
-
}, StyledMessageIcon, function (props) {
|
|
1254
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
1255
|
-
}, function (props) {
|
|
1256
|
-
return polished.math("".concat(props.theme.space.base, " * 10px - ").concat(props.theme.iconSizes.md));
|
|
1257
|
-
}, function (props) {
|
|
1258
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$c, props);
|
|
1259
|
-
});
|
|
945
|
+
})(["padding-", ":", ";& ", "{", ":", ";}", ";"], props => props.theme.rtl ? 'right' : 'left', props => polished.math(`${props.theme.space.base} * 12px`), StyledMessageIcon, props => props.theme.rtl ? 'right' : 'left', props => polished.math(`${props.theme.space.base} * 10px - ${props.theme.iconSizes.md}`), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$c, props));
|
|
1260
946
|
StyledToggleMessage.defaultProps = {
|
|
1261
947
|
theme: reactTheming.DEFAULT_THEME
|
|
1262
948
|
};
|
|
@@ -1272,7 +958,8 @@ var SvgCircleSmFill = function SvgCircleSmFill(props) {
|
|
|
1272
958
|
height: 16,
|
|
1273
959
|
focusable: "false",
|
|
1274
960
|
viewBox: "0 0 16 16",
|
|
1275
|
-
"aria-hidden": "true"
|
|
961
|
+
"aria-hidden": "true",
|
|
962
|
+
role: "img"
|
|
1276
963
|
}, props), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
1277
964
|
cx: 8,
|
|
1278
965
|
cy: 8,
|
|
@@ -1281,53 +968,45 @@ var SvgCircleSmFill = function SvgCircleSmFill(props) {
|
|
|
1281
968
|
})));
|
|
1282
969
|
};
|
|
1283
970
|
|
|
1284
|
-
|
|
1285
|
-
|
|
971
|
+
const COMPONENT_ID$b = 'forms.toggle_svg';
|
|
972
|
+
const StyledToggleSvg = styled__default["default"](SvgCircleSmFill).attrs({
|
|
1286
973
|
'data-garden-id': COMPONENT_ID$b,
|
|
1287
|
-
'data-garden-version': '8.
|
|
974
|
+
'data-garden-version': '8.58.0'
|
|
1288
975
|
}).withConfig({
|
|
1289
976
|
displayName: "StyledToggleSvg",
|
|
1290
977
|
componentId: "sc-162xbyx-0"
|
|
1291
|
-
})(["transition:all 0.15s ease-in-out;", ";"],
|
|
1292
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props);
|
|
1293
|
-
});
|
|
978
|
+
})(["transition:all 0.15s ease-in-out;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
1294
979
|
StyledToggleSvg.defaultProps = {
|
|
1295
980
|
theme: reactTheming.DEFAULT_THEME
|
|
1296
981
|
};
|
|
1297
982
|
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
983
|
+
const COMPONENT_ID$a = 'forms.select';
|
|
984
|
+
const colorStyles$4 = props => {
|
|
985
|
+
const color = reactTheming.getColor('neutralHue', 700, props.theme);
|
|
1301
986
|
return styled.css(["&:hover + ", ",&:focus + ", ",&[data-garden-focus-visible='true'] + ", "{color:", ";}"], StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, color);
|
|
1302
987
|
};
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
988
|
+
const sizeStyles$7 = props => {
|
|
989
|
+
const padding = polished.math(`${props.theme.iconSizes.md} + ${props.theme.space.base * 5}`);
|
|
990
|
+
const iconVerticalPosition = `${props.theme.space.base * (props.isCompact ? 1.5 : 2.5) + 1}px`;
|
|
991
|
+
const iconHorizontalPosition = `${props.theme.space.base * 3}px`;
|
|
1307
992
|
return styled.css(["padding-", ":", ";& + ", "{top:", ";", ":", ";}"], props.theme.rtl ? 'left' : 'right', !props.isBare && padding, StyledTextMediaFigure, iconVerticalPosition, props.theme.rtl ? 'left' : 'right', iconHorizontalPosition);
|
|
1308
993
|
};
|
|
1309
|
-
|
|
994
|
+
const StyledSelect = styled__default["default"](StyledTextInput).attrs({
|
|
1310
995
|
'data-garden-id': COMPONENT_ID$a,
|
|
1311
|
-
'data-garden-version': '8.
|
|
996
|
+
'data-garden-version': '8.58.0',
|
|
1312
997
|
as: 'select'
|
|
1313
998
|
}).withConfig({
|
|
1314
999
|
displayName: "StyledSelect",
|
|
1315
1000
|
componentId: "sc-8xdxpt-0"
|
|
1316
|
-
})(["cursor:pointer;text-overflow:ellipsis;", ";", ";&::-ms-expand{display:none;}&::-ms-value{background-color:transparent;color:inherit;}&:-moz-focusring{transition:none;text-shadow:0 0 0 ", ";color:transparent;}& + ", "{position:absolute;pointer-events:none;}"],
|
|
1317
|
-
return sizeStyles$7(props);
|
|
1318
|
-
}, function (props) {
|
|
1319
|
-
return colorStyles$4(props);
|
|
1320
|
-
}, function (props) {
|
|
1321
|
-
return props.theme.colors.foreground;
|
|
1322
|
-
}, StyledTextMediaFigure);
|
|
1001
|
+
})(["cursor:pointer;text-overflow:ellipsis;", ";", ";&::-ms-expand{display:none;}&::-ms-value{background-color:transparent;color:inherit;}&:-moz-focusring{transition:none;text-shadow:0 0 0 ", ";color:transparent;}& + ", "{position:absolute;pointer-events:none;}"], props => sizeStyles$7(props), props => colorStyles$4(props), props => props.theme.colors.foreground, StyledTextMediaFigure);
|
|
1323
1002
|
StyledSelect.defaultProps = {
|
|
1324
1003
|
theme: reactTheming.DEFAULT_THEME
|
|
1325
1004
|
};
|
|
1326
1005
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1006
|
+
const COMPONENT_ID$9 = 'forms.select_wrapper';
|
|
1007
|
+
const StyledSelectWrapper = styled__default["default"](StyledTextFauxInput).attrs({
|
|
1329
1008
|
'data-garden-id': COMPONENT_ID$9,
|
|
1330
|
-
'data-garden-version': '8.
|
|
1009
|
+
'data-garden-version': '8.58.0',
|
|
1331
1010
|
isBare: true
|
|
1332
1011
|
}).withConfig({
|
|
1333
1012
|
displayName: "StyledSelectWrapper",
|
|
@@ -1337,321 +1016,331 @@ StyledSelectWrapper.defaultProps = {
|
|
|
1337
1016
|
theme: reactTheming.DEFAULT_THEME
|
|
1338
1017
|
};
|
|
1339
1018
|
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
return
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
var modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1347
|
-
return "\n &".concat(modifier, "::-moz-range-track {\n ").concat(styles, "\n }\n\n &").concat(modifier, "::-ms-track {\n ").concat(styles, "\n }\n\n &").concat(modifier, "::-webkit-slider-runnable-track {\n ").concat(styles, "\n }\n ");
|
|
1348
|
-
};
|
|
1349
|
-
var trackLowerStyles = function trackLowerStyles(styles) {
|
|
1350
|
-
var modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1351
|
-
return "\n &".concat(modifier, "::-moz-range-progress {\n ").concat(styles, "\n }\n\n &").concat(modifier, "::-ms-fill-lower {\n ").concat(styles, "\n }\n ");
|
|
1352
|
-
};
|
|
1353
|
-
var colorStyles$3 = function colorStyles(props) {
|
|
1354
|
-
var SHADE = 600;
|
|
1355
|
-
var thumbBackgroundColor = reactTheming.getColor('primaryHue', SHADE, props.theme);
|
|
1356
|
-
var thumbBorderColor = thumbBackgroundColor;
|
|
1357
|
-
var thumbBoxShadow = props.theme.shadows.lg(polished.math("".concat(props.theme.space.base, " * 1px")), polished.math("".concat(props.theme.space.base, " * 2px")), reactTheming.getColor('neutralHue', SHADE + 200, props.theme, 0.24));
|
|
1358
|
-
var thumbActiveBackgroundColor = reactTheming.getColor('primaryHue', SHADE + 100, props.theme);
|
|
1359
|
-
var thumbActiveBorderColor = thumbBorderColor;
|
|
1360
|
-
var thumbDisabledBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 300, props.theme);
|
|
1361
|
-
var thumbDisabledBorderColor = thumbDisabledBackgroundColor;
|
|
1362
|
-
var thumbFocusBoxShadow = props.theme.shadows.md(reactTheming.getColor('primaryHue', SHADE, props.theme, 0.35));
|
|
1363
|
-
var thumbHoverBackgroundColor = thumbActiveBackgroundColor;
|
|
1364
|
-
var thumbHoverBorderColor = thumbHoverBackgroundColor;
|
|
1365
|
-
var trackBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 400, props.theme);
|
|
1366
|
-
var trackLowerBackgroundColor = props.hasLowerTrack ? thumbBackgroundColor : '';
|
|
1367
|
-
var trackBackgroundImage = props.hasLowerTrack ? "linear-gradient(".concat(trackLowerBackgroundColor, ", ").concat(trackLowerBackgroundColor, ")") : '';
|
|
1368
|
-
var trackDisabledLowerBackgroundColor = props.hasLowerTrack ? thumbDisabledBackgroundColor : '';
|
|
1369
|
-
var trackDisabledBackgroundImage = props.hasLowerTrack ? "linear-gradient(".concat(trackDisabledLowerBackgroundColor, ", ").concat(trackDisabledLowerBackgroundColor, ")") : '';
|
|
1370
|
-
return styled.css(["", " ", " ", " ", " ", " ", " ", " ", " ", ""], trackStyles("\n background-color: ".concat(trackBackgroundColor, ";\n background-image: ").concat(trackBackgroundImage, "; /* provide means for styling lower range on WebKit */\n ")), thumbStyles("\n border-color: ".concat(thumbBorderColor, ";\n box-shadow: ").concat(thumbBoxShadow, ";\n background-color: ").concat(thumbBackgroundColor, ";\n ")), trackLowerStyles("\n background-color: ".concat(trackLowerBackgroundColor, ";\n ")), thumbStyles("\n transition:\n border-color .25s ease-in-out,\n background-color .25s ease-in-out;\n border-color: ".concat(thumbHoverBorderColor, ";\n background-color: ").concat(thumbHoverBackgroundColor, ";\n "), ':hover'), thumbStyles("\n box-shadow: ".concat(thumbFocusBoxShadow, ";\n "), '[data-garden-focus-visible="true"]'), thumbStyles("\n border-color: ".concat(thumbActiveBorderColor, ";\n background-color: ").concat(thumbActiveBackgroundColor, "\n "), ':active'), trackStyles("\n background-image: ".concat(trackDisabledBackgroundImage, ";\n "), ':disabled'), thumbStyles("\n border-color: ".concat(thumbDisabledBorderColor, ";\n box-shadow: none;\n background-color: ").concat(thumbDisabledBackgroundColor, ";\n "), ':disabled'), trackLowerStyles("\n background-color: ".concat(trackDisabledLowerBackgroundColor, "\n "), ':disabled'));
|
|
1371
|
-
};
|
|
1372
|
-
var sizeStyles$6 = function sizeStyles(props) {
|
|
1373
|
-
var thumbSize = polished.math("".concat(props.theme.space.base, " * 5px"));
|
|
1374
|
-
var trackHeight = polished.math("".concat(props.theme.space.base, " * 1.5px"));
|
|
1375
|
-
var trackBorderRadius = trackHeight;
|
|
1376
|
-
var trackMargin = polished.math("(".concat(thumbSize, " - ").concat(trackHeight, ") / 2 + ").concat(props.theme.shadowWidths.md));
|
|
1377
|
-
var thumbMargin = polished.math("(".concat(trackHeight, " - ").concat(thumbSize, ") / 2"));
|
|
1378
|
-
return styled.css(["", ":not([hidden]) + &,", " + &,", " + &,& + ", ",& + ", "{margin-top:", ";}", ";", " ", ""], StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, polished.math("".concat(props.theme.space.base, " * 2px")), trackStyles("\n margin: ".concat(trackMargin, " 0;\n border-radius: ").concat(trackBorderRadius, ";\n height: ").concat(trackHeight, ";\n ")), thumbStyles("\n margin: ".concat(thumbMargin, " 0; /* reset for IE */\n width: ").concat(thumbSize, ";\n height: ").concat(thumbSize, ";\n ")), trackLowerStyles("\n border-top-".concat(props.theme.rtl ? 'right' : 'left', "-radius: ").concat(trackBorderRadius, ";\n border-bottom-").concat(props.theme.rtl ? 'right' : 'left', "-radius: ").concat(trackBorderRadius, ";\n height: ").concat(trackHeight, ";\n ")));
|
|
1379
|
-
};
|
|
1380
|
-
var StyledRangeInput = styled__default["default"].input.attrs(function (props) {
|
|
1381
|
-
return {
|
|
1382
|
-
'data-garden-id': COMPONENT_ID$8,
|
|
1383
|
-
'data-garden-version': '8.57.0',
|
|
1384
|
-
type: 'range',
|
|
1385
|
-
style: {
|
|
1386
|
-
backgroundSize: props.hasLowerTrack && props.backgroundSize
|
|
1019
|
+
const COMPONENT_ID$8 = 'forms.range';
|
|
1020
|
+
const thumbStyles = function (styles) {
|
|
1021
|
+
let modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1022
|
+
return `
|
|
1023
|
+
&${modifier}::-moz-range-thumb {
|
|
1024
|
+
${styles}
|
|
1387
1025
|
}
|
|
1388
|
-
|
|
1389
|
-
}
|
|
1026
|
+
|
|
1027
|
+
&${modifier}::-ms-thumb {
|
|
1028
|
+
${styles}
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
&${modifier}::-webkit-slider-thumb {
|
|
1032
|
+
${styles}
|
|
1033
|
+
}
|
|
1034
|
+
`;
|
|
1035
|
+
};
|
|
1036
|
+
const trackStyles = function (styles) {
|
|
1037
|
+
let modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1038
|
+
return `
|
|
1039
|
+
&${modifier}::-moz-range-track {
|
|
1040
|
+
${styles}
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
&${modifier}::-ms-track {
|
|
1044
|
+
${styles}
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
&${modifier}::-webkit-slider-runnable-track {
|
|
1048
|
+
${styles}
|
|
1049
|
+
}
|
|
1050
|
+
`;
|
|
1051
|
+
};
|
|
1052
|
+
const trackLowerStyles = function (styles) {
|
|
1053
|
+
let modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1054
|
+
return `
|
|
1055
|
+
&${modifier}::-moz-range-progress {
|
|
1056
|
+
${styles}
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
&${modifier}::-ms-fill-lower {
|
|
1060
|
+
${styles}
|
|
1061
|
+
}
|
|
1062
|
+
`;
|
|
1063
|
+
};
|
|
1064
|
+
const colorStyles$3 = props => {
|
|
1065
|
+
const SHADE = 600;
|
|
1066
|
+
const thumbBackgroundColor = reactTheming.getColor('primaryHue', SHADE, props.theme);
|
|
1067
|
+
const thumbBorderColor = thumbBackgroundColor;
|
|
1068
|
+
const thumbBoxShadow = props.theme.shadows.lg(polished.math(`${props.theme.space.base} * 1px`), polished.math(`${props.theme.space.base} * 2px`), reactTheming.getColor('neutralHue', SHADE + 200, props.theme, 0.24));
|
|
1069
|
+
const thumbActiveBackgroundColor = reactTheming.getColor('primaryHue', SHADE + 100, props.theme);
|
|
1070
|
+
const thumbActiveBorderColor = thumbBorderColor;
|
|
1071
|
+
const thumbDisabledBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 300, props.theme);
|
|
1072
|
+
const thumbDisabledBorderColor = thumbDisabledBackgroundColor;
|
|
1073
|
+
const thumbFocusBoxShadow = props.theme.shadows.md(reactTheming.getColor('primaryHue', SHADE, props.theme, 0.35));
|
|
1074
|
+
const thumbHoverBackgroundColor = thumbActiveBackgroundColor;
|
|
1075
|
+
const thumbHoverBorderColor = thumbHoverBackgroundColor;
|
|
1076
|
+
const trackBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 400, props.theme);
|
|
1077
|
+
const trackLowerBackgroundColor = props.hasLowerTrack ? thumbBackgroundColor : '';
|
|
1078
|
+
const trackBackgroundImage = props.hasLowerTrack ? `linear-gradient(${trackLowerBackgroundColor}, ${trackLowerBackgroundColor})` : '';
|
|
1079
|
+
const trackDisabledLowerBackgroundColor = props.hasLowerTrack ? thumbDisabledBackgroundColor : '';
|
|
1080
|
+
const trackDisabledBackgroundImage = props.hasLowerTrack ? `linear-gradient(${trackDisabledLowerBackgroundColor}, ${trackDisabledLowerBackgroundColor})` : '';
|
|
1081
|
+
return styled.css(["", " ", " ", " ", " ", " ", " ", " ", " ", ""], trackStyles(`
|
|
1082
|
+
background-color: ${trackBackgroundColor};
|
|
1083
|
+
background-image: ${trackBackgroundImage}; /* provide means for styling lower range on WebKit */
|
|
1084
|
+
`), thumbStyles(`
|
|
1085
|
+
border-color: ${thumbBorderColor};
|
|
1086
|
+
box-shadow: ${thumbBoxShadow};
|
|
1087
|
+
background-color: ${thumbBackgroundColor};
|
|
1088
|
+
`), trackLowerStyles(`
|
|
1089
|
+
background-color: ${trackLowerBackgroundColor};
|
|
1090
|
+
`), thumbStyles(`
|
|
1091
|
+
transition:
|
|
1092
|
+
border-color .25s ease-in-out,
|
|
1093
|
+
background-color .25s ease-in-out;
|
|
1094
|
+
border-color: ${thumbHoverBorderColor};
|
|
1095
|
+
background-color: ${thumbHoverBackgroundColor};
|
|
1096
|
+
`, ':hover'), thumbStyles(`
|
|
1097
|
+
box-shadow: ${thumbFocusBoxShadow};
|
|
1098
|
+
`, '[data-garden-focus-visible="true"]'), thumbStyles(`
|
|
1099
|
+
border-color: ${thumbActiveBorderColor};
|
|
1100
|
+
background-color: ${thumbActiveBackgroundColor}
|
|
1101
|
+
`, ':active'), trackStyles(`
|
|
1102
|
+
background-image: ${trackDisabledBackgroundImage};
|
|
1103
|
+
`, ':disabled'), thumbStyles(`
|
|
1104
|
+
border-color: ${thumbDisabledBorderColor};
|
|
1105
|
+
box-shadow: none;
|
|
1106
|
+
background-color: ${thumbDisabledBackgroundColor};
|
|
1107
|
+
`, ':disabled'), trackLowerStyles(`
|
|
1108
|
+
background-color: ${trackDisabledLowerBackgroundColor}
|
|
1109
|
+
`, ':disabled'));
|
|
1110
|
+
};
|
|
1111
|
+
const sizeStyles$6 = props => {
|
|
1112
|
+
const thumbSize = polished.math(`${props.theme.space.base} * 5px`);
|
|
1113
|
+
const trackHeight = polished.math(`${props.theme.space.base} * 1.5px`);
|
|
1114
|
+
const trackBorderRadius = trackHeight;
|
|
1115
|
+
const trackMargin = polished.math(`(${thumbSize} - ${trackHeight}) / 2 + ${props.theme.shadowWidths.md}`);
|
|
1116
|
+
const thumbMargin = polished.math(`(${trackHeight} - ${thumbSize}) / 2`);
|
|
1117
|
+
return styled.css(["", ":not([hidden]) + &,", " + &,", " + &,& + ", ",& + ", "{margin-top:", ";}", ";", " ", ""], StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, polished.math(`${props.theme.space.base} * 2px`), trackStyles(`
|
|
1118
|
+
margin: ${trackMargin} 0;
|
|
1119
|
+
border-radius: ${trackBorderRadius};
|
|
1120
|
+
height: ${trackHeight};
|
|
1121
|
+
`), thumbStyles(`
|
|
1122
|
+
margin: ${thumbMargin} 0; /* reset for IE */
|
|
1123
|
+
width: ${thumbSize};
|
|
1124
|
+
height: ${thumbSize};
|
|
1125
|
+
`), trackLowerStyles(`
|
|
1126
|
+
border-top-${props.theme.rtl ? 'right' : 'left'}-radius: ${trackBorderRadius};
|
|
1127
|
+
border-bottom-${props.theme.rtl ? 'right' : 'left'}-radius: ${trackBorderRadius};
|
|
1128
|
+
height: ${trackHeight};
|
|
1129
|
+
`));
|
|
1130
|
+
};
|
|
1131
|
+
const StyledRangeInput = styled__default["default"].input.attrs(props => ({
|
|
1132
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
1133
|
+
'data-garden-version': '8.58.0',
|
|
1134
|
+
type: 'range',
|
|
1135
|
+
style: {
|
|
1136
|
+
backgroundSize: props.hasLowerTrack && props.backgroundSize
|
|
1137
|
+
}
|
|
1138
|
+
})).withConfig({
|
|
1390
1139
|
displayName: "StyledRangeInput",
|
|
1391
1140
|
componentId: "sc-1iv2yqp-0"
|
|
1392
|
-
})(["appearance:none;direction:", ";margin:0;background-color:inherit;cursor:pointer;padding:0;width:100%;vertical-align:middle;", " &::-webkit-slider-container,&::-webkit-slider-runnable-track{background-size:inherit;}", ";", " ", ";&::-moz-focus-outer{border:0;}&::-ms-tooltip{display:none;}&:focus{outline:none;}&:disabled{cursor:default;}", ";"],
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
}
|
|
1141
|
+
})(["appearance:none;direction:", ";margin:0;background-color:inherit;cursor:pointer;padding:0;width:100%;vertical-align:middle;", " &::-webkit-slider-container,&::-webkit-slider-runnable-track{background-size:inherit;}", ";", " ", ";&::-moz-focus-outer{border:0;}&::-ms-tooltip{display:none;}&:focus{outline:none;}&:disabled{cursor:default;}", ";"], props => props.theme.rtl && 'rtl', props => trackStyles(`
|
|
1142
|
+
appearance: none;
|
|
1143
|
+
border-color: transparent; /* reset for IE */
|
|
1144
|
+
background-repeat: repeat-y;
|
|
1145
|
+
background-size: 0;
|
|
1146
|
+
background-position: ${props.theme.rtl ? '100% 100%' : '0% 0%'};
|
|
1147
|
+
width: 99.8%; /* fix for IE which cuts off the upper track's border radius */
|
|
1148
|
+
color: transparent; /* reset for IE */
|
|
1149
|
+
box-sizing: border-box; /* reset for IE */
|
|
1150
|
+
`), props => sizeStyles$6(props), props => thumbStyles(`
|
|
1151
|
+
appearance: none;
|
|
1152
|
+
transition: box-shadow .1s ease-in-out;
|
|
1153
|
+
border: ${props.theme.borders.md};
|
|
1154
|
+
border-radius: 100%;
|
|
1155
|
+
box-sizing: border-box;
|
|
1156
|
+
`), props => colorStyles$3(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
1405
1157
|
StyledRangeInput.defaultProps = {
|
|
1406
1158
|
backgroundSize: '0%',
|
|
1407
1159
|
hasLowerTrack: true,
|
|
1408
1160
|
theme: reactTheming.DEFAULT_THEME
|
|
1409
1161
|
};
|
|
1410
1162
|
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
'data-garden-version': '8.57.0',
|
|
1416
|
-
'aria-disabled': props.isDisabled
|
|
1417
|
-
};
|
|
1163
|
+
const COMPONENT_ID$7 = 'forms.slider';
|
|
1164
|
+
const StyledSlider = styled__default["default"].div.attrs({
|
|
1165
|
+
'data-garden-id': COMPONENT_ID$7,
|
|
1166
|
+
'data-garden-version': '8.58.0'
|
|
1418
1167
|
}).withConfig({
|
|
1419
1168
|
displayName: "StyledSlider",
|
|
1420
1169
|
componentId: "sc-1di437a-0"
|
|
1421
|
-
})(["display:block;position:relative;z-index:0;cursor:pointer;height:", ";&[aria-disabled='true']{cursor:default;}", ":not([hidden]) + &,", " + &,", " + &,& + ", ",& + ", "{margin-top:", ";}", ";"],
|
|
1422
|
-
return polished.math("(".concat(props.theme.space.base, " * 5px) + (").concat(props.theme.shadowWidths.md, " * 2)"));
|
|
1423
|
-
}, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, function (props) {
|
|
1424
|
-
return polished.math("".concat(props.theme.space.base, " * 2px"));
|
|
1425
|
-
}, function (props) {
|
|
1426
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props);
|
|
1427
|
-
});
|
|
1170
|
+
})(["display:block;position:relative;z-index:0;cursor:pointer;height:", ";&[aria-disabled='true']{cursor:default;}", ":not([hidden]) + &,", " + &,", " + &,& + ", ",& + ", "{margin-top:", ";}", ";"], props => polished.math(`(${props.theme.space.base} * 5px) + (${props.theme.shadowWidths.md} * 2)`), StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, props => polished.math(`${props.theme.space.base} * 2px`), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
1428
1171
|
StyledSlider.defaultProps = {
|
|
1429
1172
|
theme: reactTheming.DEFAULT_THEME
|
|
1430
1173
|
};
|
|
1431
1174
|
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1175
|
+
const COMPONENT_ID$6 = 'forms.slider_thumb';
|
|
1176
|
+
const colorStyles$2 = props => {
|
|
1177
|
+
const SHADE = 600;
|
|
1178
|
+
const backgroundColor = reactTheming.getColor('primaryHue', SHADE, props.theme);
|
|
1179
|
+
const borderColor = backgroundColor;
|
|
1180
|
+
const boxShadow = props.theme.shadows.lg(polished.math(`${props.theme.space.base} * 1px`), polished.math(`${props.theme.space.base} * 2px`), reactTheming.getColor('neutralHue', SHADE + 200, props.theme, 0.24));
|
|
1181
|
+
const activeBackgroundColor = reactTheming.getColor('primaryHue', SHADE + 100, props.theme);
|
|
1182
|
+
const activeBorderColor = borderColor;
|
|
1183
|
+
const hoverBackgroundColor = activeBackgroundColor;
|
|
1184
|
+
const hoverBorderColor = hoverBackgroundColor;
|
|
1185
|
+
const focusBoxShadow = props.theme.shadows.md(reactTheming.getColor('primaryHue', SHADE, props.theme, 0.35));
|
|
1186
|
+
const disabledBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 300, props.theme);
|
|
1187
|
+
const disabledBorderColor = disabledBackgroundColor;
|
|
1445
1188
|
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";&[data-garden-focus-visible='true']{box-shadow:", ";}&:hover,&[data-garden-hover='true']{border-color:", ";background-color:", ";}&:active,&[data-garden-active='true']{border-color:", ";background-color:", ";}&[aria-disabled='true']{border-color:", ";box-shadow:none;background-color:", ";}"], borderColor, boxShadow, backgroundColor, focusBoxShadow, hoverBorderColor, hoverBackgroundColor, activeBorderColor, activeBackgroundColor, disabledBorderColor, disabledBackgroundColor);
|
|
1446
1189
|
};
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1190
|
+
const sizeStyles$5 = props => {
|
|
1191
|
+
const size = polished.math(`${props.theme.space.base} * 5px`);
|
|
1192
|
+
const marginTop = polished.math(`${size} / -2`);
|
|
1450
1193
|
return styled.css(["margin-top:", ";width:", ";height:", ";"], marginTop, size, size);
|
|
1451
1194
|
};
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
};
|
|
1458
|
-
}).withConfig({
|
|
1195
|
+
const StyledSliderThumb = styled__default["default"].div.attrs(props => ({
|
|
1196
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
1197
|
+
'data-garden-version': '8.58.0',
|
|
1198
|
+
'aria-disabled': props.isDisabled
|
|
1199
|
+
})).withConfig({
|
|
1459
1200
|
displayName: "StyledSliderThumb",
|
|
1460
1201
|
componentId: "sc-yspbwa-0"
|
|
1461
|
-
})(["appearance:none;position:absolute;top:50%;", ":", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out;z-index:1;border:", ";border-radius:100%;cursor:inherit;box-sizing:border-box;font-size:0;", ";&:focus{outline:none;}", ";", ";"],
|
|
1462
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
1463
|
-
}, function (props) {
|
|
1464
|
-
return polished.math("".concat(props.position, " * 1px"));
|
|
1465
|
-
}, function (props) {
|
|
1466
|
-
return props.theme.borders.md;
|
|
1467
|
-
}, function (props) {
|
|
1468
|
-
return sizeStyles$5(props);
|
|
1469
|
-
}, function (props) {
|
|
1470
|
-
return colorStyles$2(props);
|
|
1471
|
-
}, function (props) {
|
|
1472
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props);
|
|
1473
|
-
});
|
|
1202
|
+
})(["appearance:none;position:absolute;top:50%;", ":", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out;z-index:1;border:", ";border-radius:100%;cursor:inherit;box-sizing:border-box;font-size:0;", ";&:focus{outline:none;}", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => polished.math(`${props.position} * 1px`), props => props.theme.borders.md, props => sizeStyles$5(props), props => colorStyles$2(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
1474
1203
|
StyledSliderThumb.defaultProps = {
|
|
1475
1204
|
position: 0,
|
|
1476
1205
|
theme: reactTheming.DEFAULT_THEME
|
|
1477
1206
|
};
|
|
1478
1207
|
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1208
|
+
const COMPONENT_ID$5 = 'forms.slider_track';
|
|
1209
|
+
const colorStyles$1 = props => {
|
|
1210
|
+
const SHADE = 600;
|
|
1211
|
+
const backgroundColor = reactTheming.getColor('neutralHue', SHADE - 400, props.theme);
|
|
1212
|
+
const backgroundImageColor = reactTheming.getColor('primaryHue', SHADE, props.theme);
|
|
1213
|
+
const disabledBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 300, props.theme);
|
|
1485
1214
|
return styled.css(["background-color:", ";background-image:linear-gradient(", ",", ");&[aria-disabled='true']{background-image:linear-gradient(", ",", ");}"], backgroundColor, backgroundImageColor, backgroundImageColor, disabledBackgroundColor, disabledBackgroundColor);
|
|
1486
1215
|
};
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1216
|
+
const sizeStyles$4 = props => {
|
|
1217
|
+
const height = polished.math(`${props.theme.space.base} * 1.5px`);
|
|
1218
|
+
const backgroundPosition = polished.math(`${props.backgroundPosition} * 1px`);
|
|
1219
|
+
const backgroundSize = polished.math(`${props.backgroundSize} * 1px`);
|
|
1220
|
+
const borderRadius = height;
|
|
1221
|
+
const marginTop = polished.math(`${height} / -2`);
|
|
1222
|
+
const padding = polished.math(`${props.theme.space.base} * 2.5px`);
|
|
1494
1223
|
return styled.css(["margin-top:", ";border-radius:", ";background-position:", ";background-size:", ";padding:0 ", ";"], marginTop, borderRadius, backgroundPosition, backgroundSize, padding);
|
|
1495
1224
|
};
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
};
|
|
1502
|
-
}).withConfig({
|
|
1225
|
+
const StyledSliderTrack = styled__default["default"].div.attrs(props => ({
|
|
1226
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
1227
|
+
'data-garden-version': '8.58.0',
|
|
1228
|
+
'aria-disabled': props.isDisabled
|
|
1229
|
+
})).withConfig({
|
|
1503
1230
|
displayName: "StyledSliderTrack",
|
|
1504
1231
|
componentId: "sc-aw5m6g-0"
|
|
1505
|
-
})(["position:absolute;top:50%;box-sizing:border-box;background-origin:content-box;background-repeat:repeat-y;width:100%;", ";", ";", ";"],
|
|
1506
|
-
return sizeStyles$4(props);
|
|
1507
|
-
}, function (props) {
|
|
1508
|
-
return colorStyles$1(props);
|
|
1509
|
-
}, function (props) {
|
|
1510
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props);
|
|
1511
|
-
});
|
|
1232
|
+
})(["position:absolute;top:50%;box-sizing:border-box;background-origin:content-box;background-repeat:repeat-y;width:100%;", ";", ";", ";"], props => sizeStyles$4(props), props => colorStyles$1(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
1512
1233
|
StyledSliderTrack.defaultProps = {
|
|
1513
1234
|
backgroundSize: 0,
|
|
1514
1235
|
backgroundPosition: 0,
|
|
1515
1236
|
theme: reactTheming.DEFAULT_THEME
|
|
1516
1237
|
};
|
|
1517
1238
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
return styled.css(["margin:0 ", " 0 ", ";height:", ";"], props.theme.rtl ?
|
|
1239
|
+
const COMPONENT_ID$4 = 'forms.slider_track_rail';
|
|
1240
|
+
const sizeStyles$3 = props => {
|
|
1241
|
+
const height = polished.math(`${props.theme.space.base} * 1.5px`);
|
|
1242
|
+
const margin = polished.math(`${props.theme.space.base} * 2.5px`);
|
|
1243
|
+
return styled.css(["margin:0 ", " 0 ", ";height:", ";"], props.theme.rtl ? `-${margin}` : margin, props.theme.rtl ? margin : `-${margin}`, height);
|
|
1523
1244
|
};
|
|
1524
|
-
|
|
1245
|
+
const StyledSliderTrackRail = styled__default["default"].div.attrs({
|
|
1525
1246
|
'data-garden-id': COMPONENT_ID$4,
|
|
1526
|
-
'data-garden-version': '8.
|
|
1247
|
+
'data-garden-version': '8.58.0'
|
|
1527
1248
|
}).withConfig({
|
|
1528
1249
|
displayName: "StyledSliderTrackRail",
|
|
1529
1250
|
componentId: "sc-1o5owbd-0"
|
|
1530
|
-
})(["position:relative;", ";", ";"],
|
|
1531
|
-
return sizeStyles$3(props);
|
|
1532
|
-
}, function (props) {
|
|
1533
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props);
|
|
1534
|
-
});
|
|
1251
|
+
})(["position:relative;", ";", ";"], props => sizeStyles$3(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
1535
1252
|
StyledSliderTrackRail.defaultProps = {
|
|
1536
1253
|
theme: reactTheming.DEFAULT_THEME
|
|
1537
1254
|
};
|
|
1538
1255
|
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1256
|
+
const COMPONENT_ID$3 = 'forms.tile_icon';
|
|
1257
|
+
const sizeStyles$2 = props => {
|
|
1258
|
+
const iconSize = polished.math(`${props.theme.iconSizes.md} * 2`);
|
|
1259
|
+
let position;
|
|
1260
|
+
let top;
|
|
1261
|
+
let horizontalValue;
|
|
1545
1262
|
if (!props.isCentered) {
|
|
1546
1263
|
position = 'absolute';
|
|
1547
|
-
top =
|
|
1548
|
-
horizontalValue =
|
|
1264
|
+
top = `${props.theme.space.base * 6}px`;
|
|
1265
|
+
horizontalValue = `left: ${props.theme.space.base * 5}px`;
|
|
1549
1266
|
if (props.theme.rtl) {
|
|
1550
|
-
horizontalValue =
|
|
1267
|
+
horizontalValue = `right: ${props.theme.space.base * 5}px`;
|
|
1551
1268
|
}
|
|
1552
1269
|
}
|
|
1553
1270
|
return styled.css(["position:", ";top:", ";", ";& > *{width:", ";height:", ";}"], position, top, horizontalValue, iconSize, iconSize);
|
|
1554
1271
|
};
|
|
1555
|
-
|
|
1272
|
+
const StyledTileIcon = styled__default["default"].span.attrs({
|
|
1556
1273
|
'data-garden-id': COMPONENT_ID$3,
|
|
1557
|
-
'data-garden-version': '8.
|
|
1274
|
+
'data-garden-version': '8.58.0'
|
|
1558
1275
|
}).withConfig({
|
|
1559
1276
|
displayName: "StyledTileIcon",
|
|
1560
1277
|
componentId: "sc-1wazhg4-0"
|
|
1561
|
-
})(["display:block;transition:color 0.25s ease-in-out;text-align:center;line-height:0;", ";", ";"],
|
|
1562
|
-
return sizeStyles$2(props);
|
|
1563
|
-
}, function (props) {
|
|
1564
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props);
|
|
1565
|
-
});
|
|
1278
|
+
})(["display:block;transition:color 0.25s ease-in-out;text-align:center;line-height:0;", ";", ";"], props => sizeStyles$2(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
1566
1279
|
StyledTileIcon.defaultProps = {
|
|
1567
1280
|
theme: reactTheming.DEFAULT_THEME
|
|
1568
1281
|
};
|
|
1569
1282
|
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1283
|
+
const COMPONENT_ID$2 = 'forms.tile';
|
|
1284
|
+
const colorStyles = props => {
|
|
1285
|
+
const SHADE = 600;
|
|
1286
|
+
const iconColor = reactTheming.getColor('neutralHue', SHADE, props.theme);
|
|
1287
|
+
const color = reactTheming.getColor('neutralHue', SHADE + 200, props.theme);
|
|
1288
|
+
const borderColor = reactTheming.getColor('neutralHue', SHADE - 300, props.theme);
|
|
1289
|
+
const hoverBackgroundColor = reactTheming.getColor('primaryHue', SHADE, props.theme, 0.08);
|
|
1290
|
+
const hoverBorderColor = reactTheming.getColor('primaryHue', SHADE, props.theme);
|
|
1291
|
+
const focusBorderColor = hoverBorderColor;
|
|
1292
|
+
const focusBoxShadow = props.theme.shadows.md(polished.rgba(focusBorderColor, 0.35));
|
|
1293
|
+
const activeBackgroundColor = reactTheming.getColor('primaryHue', SHADE, props.theme, 0.2);
|
|
1294
|
+
const activeBorderColor = focusBorderColor;
|
|
1295
|
+
const disabledBackgroundColor = reactTheming.getColor('neutralHue', SHADE - 500, props.theme);
|
|
1296
|
+
const disabledBorderColor = reactTheming.getColor('neutralHue', SHADE - 400, props.theme);
|
|
1297
|
+
const disabledColor = reactTheming.getColor('neutralHue', SHADE - 200, props.theme);
|
|
1298
|
+
const selectedBorderColor = focusBorderColor;
|
|
1299
|
+
const selectedBackgroundColor = selectedBorderColor;
|
|
1300
|
+
const selectedHoverBorderColor = reactTheming.getColor('primaryHue', SHADE + 100, props.theme);
|
|
1301
|
+
const selectedHoverBackgroundColor = selectedHoverBorderColor;
|
|
1302
|
+
const selectedActiveBorderColor = reactTheming.getColor('primaryHue', SHADE + 200, props.theme);
|
|
1303
|
+
const selectedActiveBackgroundColor = selectedActiveBorderColor;
|
|
1304
|
+
const selectedDisabledBackgroundColor = disabledBorderColor;
|
|
1592
1305
|
return styled.css(["border:", " ", ";border-color:", ";background-color:", ";color:", ";", "{color:", ";}&:focus{outline:none;}&:hover:not([aria-disabled='true']){border-color:", ";background-color:", ";", "{color:", ";}}&[data-garden-focus-visible='true']{border-color:", ";box-shadow:", ";}&:active:not([aria-disabled='true']){border-color:", ";background-color:", ";", "{color:", ";}}&[data-garden-selected='true']{border-color:", ";background-color:", ";color:", ";", "{color:", ";}}&[data-garden-selected='true']:not([aria-disabled='true']):hover{border-color:", ";background-color:", ";color:", ";", "{color:", ";}}&[data-garden-selected='true']:not([aria-disabled='true']):active{border-color:", ";background-color:", ";color:", ";", "{color:", ";}}&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";", "{color:", ";}}&[data-garden-selected='true'][aria-disabled='true']{background-color:", ";color:", ";", "{color:", ";}}"], props.theme.borders.sm, reactTheming.getColor('neutralHue', SHADE - 300, props.theme), borderColor, props.theme.colors.background, color, StyledTileIcon, iconColor, hoverBorderColor, hoverBackgroundColor, StyledTileIcon, color, focusBorderColor, focusBoxShadow, activeBorderColor, activeBackgroundColor, StyledTileIcon, color, selectedBorderColor, selectedBackgroundColor, props.theme.colors.background, StyledTileIcon, props.theme.colors.background, selectedHoverBorderColor, selectedHoverBackgroundColor, props.theme.colors.background, StyledTileIcon, props.theme.colors.background, selectedActiveBorderColor, selectedActiveBackgroundColor, props.theme.colors.background, StyledTileIcon, props.theme.colors.background, disabledBorderColor, disabledBackgroundColor, disabledColor, StyledTileIcon, disabledColor, selectedDisabledBackgroundColor, disabledColor, StyledTileIcon, disabledColor);
|
|
1593
1306
|
};
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
};
|
|
1601
|
-
}).withConfig({
|
|
1307
|
+
const StyledTile = styled__default["default"].label.attrs(props => ({
|
|
1308
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
1309
|
+
'data-garden-version': '8.58.0',
|
|
1310
|
+
'data-garden-focus-visible': props.isFocused,
|
|
1311
|
+
'data-garden-selected': props.isSelected
|
|
1312
|
+
})).withConfig({
|
|
1602
1313
|
displayName: "StyledTile",
|
|
1603
1314
|
componentId: "sc-1jjvmxs-0"
|
|
1604
|
-
})(["display:block;position:relative;transition:border-color .25s ease-in-out,box-shadow .1s ease-in-out,background-color .25s ease-in-out,color .25s ease-in-out;border-radius:", ";cursor:", ";padding:", "px;direction:", ";", ";", ";"],
|
|
1605
|
-
return props.theme.borderRadii.md;
|
|
1606
|
-
}, function (props) {
|
|
1607
|
-
return !props.isDisabled && 'pointer';
|
|
1608
|
-
}, function (props) {
|
|
1609
|
-
return props.theme.space.base * 5;
|
|
1610
|
-
}, function (props) {
|
|
1611
|
-
return props.theme.rtl && 'rtl';
|
|
1612
|
-
}, function (props) {
|
|
1613
|
-
return colorStyles(props);
|
|
1614
|
-
}, function (props) {
|
|
1615
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props);
|
|
1616
|
-
});
|
|
1315
|
+
})(["display:block;position:relative;transition:border-color .25s ease-in-out,box-shadow .1s ease-in-out,background-color .25s ease-in-out,color .25s ease-in-out;border-radius:", ";cursor:", ";padding:", "px;direction:", ";min-width:132px;word-break:break-word;", ";", ";"], props => props.theme.borderRadii.md, props => !props.isDisabled && 'pointer', props => props.theme.space.base * 5, props => props.theme.rtl && 'rtl', props => colorStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
1617
1316
|
StyledTile.defaultProps = {
|
|
1618
1317
|
theme: reactTheming.DEFAULT_THEME
|
|
1619
1318
|
};
|
|
1620
1319
|
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1320
|
+
const COMPONENT_ID$1 = 'forms.tile_description';
|
|
1321
|
+
const sizeStyles$1 = props => {
|
|
1322
|
+
let marginDirection = 'left';
|
|
1323
|
+
let marginValue;
|
|
1625
1324
|
if (props.theme.rtl) {
|
|
1626
1325
|
marginDirection = 'right';
|
|
1627
1326
|
}
|
|
1628
1327
|
if (!props.isCentered) {
|
|
1629
|
-
marginValue = polished.math(
|
|
1328
|
+
marginValue = polished.math(`(${props.theme.iconSizes.md} * 2) + ${props.theme.space.base * 5}px`);
|
|
1630
1329
|
}
|
|
1631
1330
|
return styled.css(["margin-top:", "px;margin-", ":", ";"], props.theme.space.base, marginDirection, marginValue);
|
|
1632
1331
|
};
|
|
1633
|
-
|
|
1332
|
+
const StyledTileDescription = styled__default["default"].span.attrs({
|
|
1634
1333
|
'data-garden-id': COMPONENT_ID$1,
|
|
1635
|
-
'data-garden-version': '8.
|
|
1334
|
+
'data-garden-version': '8.58.0'
|
|
1636
1335
|
}).withConfig({
|
|
1637
1336
|
displayName: "StyledTileDescription",
|
|
1638
1337
|
componentId: "sc-xfuu7u-0"
|
|
1639
|
-
})(["display:block;text-align:", ";line-height:", ";font-size:", ";", ";", ";"],
|
|
1640
|
-
return props.isCentered && 'center';
|
|
1641
|
-
}, function (props) {
|
|
1642
|
-
return reactTheming.getLineHeight(props.theme.space.base * 4, props.theme.fontSizes.sm);
|
|
1643
|
-
}, function (props) {
|
|
1644
|
-
return props.theme.fontSizes.sm;
|
|
1645
|
-
}, function (props) {
|
|
1646
|
-
return sizeStyles$1(props);
|
|
1647
|
-
}, function (props) {
|
|
1648
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props);
|
|
1649
|
-
});
|
|
1338
|
+
})(["display:block;text-align:", ";line-height:", ";font-size:", ";", ";", ";"], props => props.isCentered && 'center', props => reactTheming.getLineHeight(props.theme.space.base * 4, props.theme.fontSizes.sm), props => props.theme.fontSizes.sm, props => sizeStyles$1(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
1650
1339
|
StyledTileDescription.defaultProps = {
|
|
1651
1340
|
theme: reactTheming.DEFAULT_THEME
|
|
1652
1341
|
};
|
|
1653
1342
|
|
|
1654
|
-
|
|
1343
|
+
const StyledTileInput = styled__default["default"].input.withConfig({
|
|
1655
1344
|
displayName: "StyledTileInput",
|
|
1656
1345
|
componentId: "sc-1nq2m6q-0"
|
|
1657
1346
|
})(["position:absolute;border:0;clip:rect(1px,1px,1px,1px);padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
|
|
@@ -1659,91 +1348,66 @@ StyledTileInput.defaultProps = {
|
|
|
1659
1348
|
theme: reactTheming.DEFAULT_THEME
|
|
1660
1349
|
};
|
|
1661
1350
|
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1351
|
+
const COMPONENT_ID = 'forms.tile_label';
|
|
1352
|
+
const sizeStyles = props => {
|
|
1353
|
+
let marginDirection = 'left';
|
|
1354
|
+
let marginTop = `${props.theme.space.base * 2}px`;
|
|
1355
|
+
let marginValue;
|
|
1667
1356
|
if (props.theme.rtl) {
|
|
1668
1357
|
marginDirection = 'right';
|
|
1669
1358
|
}
|
|
1670
1359
|
if (!props.isCentered) {
|
|
1671
|
-
marginValue = polished.math(
|
|
1360
|
+
marginValue = polished.math(`(${props.theme.iconSizes.md} * 2) + ${props.theme.space.base * 5}px`);
|
|
1672
1361
|
marginTop = '0';
|
|
1673
1362
|
}
|
|
1674
1363
|
return styled.css(["margin-top:", ";margin-", ":", ";"], marginTop, marginDirection, marginValue);
|
|
1675
1364
|
};
|
|
1676
|
-
|
|
1365
|
+
const StyledTileLabel = styled__default["default"].span.attrs({
|
|
1677
1366
|
'data-garden-id': COMPONENT_ID,
|
|
1678
|
-
'data-garden-version': '8.
|
|
1367
|
+
'data-garden-version': '8.58.0'
|
|
1679
1368
|
}).withConfig({
|
|
1680
1369
|
displayName: "StyledTileLabel",
|
|
1681
1370
|
componentId: "sc-1mypv27-0"
|
|
1682
|
-
})(["display:block;text-align:", ";line-height:", ";font-size:", ";font-weight:", ";", ";", ";"],
|
|
1683
|
-
return props.isCentered && 'center';
|
|
1684
|
-
}, function (props) {
|
|
1685
|
-
return reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
1686
|
-
}, function (props) {
|
|
1687
|
-
return props.theme.fontSizes.md;
|
|
1688
|
-
}, function (props) {
|
|
1689
|
-
return props.theme.fontWeights.semibold;
|
|
1690
|
-
}, function (props) {
|
|
1691
|
-
return sizeStyles(props);
|
|
1692
|
-
}, function (props) {
|
|
1693
|
-
return reactTheming.retrieveComponentStyles(COMPONENT_ID, props);
|
|
1694
|
-
});
|
|
1371
|
+
})(["display:block;text-align:", ";line-height:", ";font-size:", ";font-weight:", ";", ";", ";"], props => props.isCentered && 'center', props => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
1695
1372
|
StyledTileLabel.defaultProps = {
|
|
1696
1373
|
theme: reactTheming.DEFAULT_THEME
|
|
1697
1374
|
};
|
|
1698
1375
|
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
}, options));
|
|
1735
|
-
},
|
|
1736
|
-
isLabelActive: isLabelActive,
|
|
1737
|
-
setIsLabelActive: setIsLabelActive,
|
|
1738
|
-
isLabelHovered: isLabelHovered,
|
|
1739
|
-
setIsLabelHovered: setIsLabelHovered,
|
|
1740
|
-
hasHint: hasHint,
|
|
1741
|
-
setHasHint: setHasHint,
|
|
1742
|
-
hasMessage: hasMessage,
|
|
1743
|
-
setHasMessage: setHasMessage,
|
|
1744
|
-
multiThumbRangeRef: multiThumbRangeRef
|
|
1745
|
-
});
|
|
1746
|
-
}, [propGetters, _getInputProps, _getMessageProps, isLabelActive, isLabelHovered, hasHint, hasMessage]);
|
|
1376
|
+
const Field = React__default["default"].forwardRef((props, ref) => {
|
|
1377
|
+
const [hasHint, setHasHint] = React.useState(false);
|
|
1378
|
+
const [hasMessage, setHasMessage] = React.useState(false);
|
|
1379
|
+
const [isLabelActive, setIsLabelActive] = React.useState(false);
|
|
1380
|
+
const [isLabelHovered, setIsLabelHovered] = React.useState(false);
|
|
1381
|
+
const multiThumbRangeRef = React.useRef(null);
|
|
1382
|
+
const {
|
|
1383
|
+
getInputProps,
|
|
1384
|
+
getMessageProps,
|
|
1385
|
+
...propGetters
|
|
1386
|
+
} = containerField.useField(props.id);
|
|
1387
|
+
const fieldProps = React.useMemo(() => ({
|
|
1388
|
+
...propGetters,
|
|
1389
|
+
getInputProps: function (options) {
|
|
1390
|
+
let describeOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1391
|
+
return getInputProps(options, {
|
|
1392
|
+
...describeOptions,
|
|
1393
|
+
isDescribed: hasHint,
|
|
1394
|
+
hasMessage
|
|
1395
|
+
});
|
|
1396
|
+
},
|
|
1397
|
+
getMessageProps: options => getMessageProps({
|
|
1398
|
+
role: 'alert',
|
|
1399
|
+
...options
|
|
1400
|
+
}),
|
|
1401
|
+
isLabelActive,
|
|
1402
|
+
setIsLabelActive,
|
|
1403
|
+
isLabelHovered,
|
|
1404
|
+
setIsLabelHovered,
|
|
1405
|
+
hasHint,
|
|
1406
|
+
setHasHint,
|
|
1407
|
+
hasMessage,
|
|
1408
|
+
setHasMessage,
|
|
1409
|
+
multiThumbRangeRef
|
|
1410
|
+
}), [propGetters, getInputProps, getMessageProps, isLabelActive, isLabelHovered, hasHint, hasMessage]);
|
|
1747
1411
|
return React__default["default"].createElement(FieldContext.Provider, {
|
|
1748
1412
|
value: fieldProps
|
|
1749
1413
|
}, React__default["default"].createElement(StyledField, _extends$t({}, props, {
|
|
@@ -1752,27 +1416,25 @@ var Field = React__default["default"].forwardRef(function (props, ref) {
|
|
|
1752
1416
|
});
|
|
1753
1417
|
Field.displayName = 'Field';
|
|
1754
1418
|
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1419
|
+
const FieldsetContext = React.createContext(undefined);
|
|
1420
|
+
const useFieldsetContext = () => {
|
|
1421
|
+
const fieldsetContext = React.useContext(FieldsetContext);
|
|
1758
1422
|
return fieldsetContext;
|
|
1759
1423
|
};
|
|
1760
1424
|
|
|
1761
|
-
|
|
1762
|
-
|
|
1425
|
+
const LegendComponent = React.forwardRef((props, ref) => {
|
|
1426
|
+
const fieldsetContext = useFieldsetContext();
|
|
1763
1427
|
return React__default["default"].createElement(StyledLegend, _extends$t({}, props, fieldsetContext, {
|
|
1764
1428
|
ref: ref
|
|
1765
1429
|
}));
|
|
1766
1430
|
});
|
|
1767
1431
|
LegendComponent.displayName = 'Fieldset.Legend';
|
|
1768
|
-
|
|
1432
|
+
const Legend = LegendComponent;
|
|
1769
1433
|
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
};
|
|
1775
|
-
}, [props.isCompact]);
|
|
1434
|
+
const FieldsetComponent = React.forwardRef((props, ref) => {
|
|
1435
|
+
const fieldsetContext = React.useMemo(() => ({
|
|
1436
|
+
isCompact: props.isCompact
|
|
1437
|
+
}), [props.isCompact]);
|
|
1776
1438
|
return React__default["default"].createElement(FieldsetContext.Provider, {
|
|
1777
1439
|
value: fieldsetContext
|
|
1778
1440
|
}, React__default["default"].createElement(StyledFieldset, _extends$t({}, props, {
|
|
@@ -1783,31 +1445,32 @@ FieldsetComponent.displayName = 'Fieldset';
|
|
|
1783
1445
|
FieldsetComponent.propTypes = {
|
|
1784
1446
|
isCompact: PropTypes__default["default"].bool
|
|
1785
1447
|
};
|
|
1786
|
-
|
|
1448
|
+
const Fieldset = FieldsetComponent;
|
|
1787
1449
|
Fieldset.Legend = Legend;
|
|
1788
1450
|
|
|
1789
|
-
|
|
1790
|
-
|
|
1451
|
+
const InputContext = React.createContext(undefined);
|
|
1452
|
+
const useInputContext = () => {
|
|
1791
1453
|
return React.useContext(InputContext);
|
|
1792
1454
|
};
|
|
1793
1455
|
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1456
|
+
const Hint = React__default["default"].forwardRef((props, ref) => {
|
|
1457
|
+
const {
|
|
1458
|
+
hasHint,
|
|
1459
|
+
setHasHint,
|
|
1460
|
+
getHintProps
|
|
1461
|
+
} = useFieldContext() || {};
|
|
1462
|
+
const type = useInputContext();
|
|
1463
|
+
React.useEffect(() => {
|
|
1801
1464
|
if (!hasHint && setHasHint) {
|
|
1802
1465
|
setHasHint(true);
|
|
1803
1466
|
}
|
|
1804
|
-
return
|
|
1467
|
+
return () => {
|
|
1805
1468
|
if (hasHint && setHasHint) {
|
|
1806
1469
|
setHasHint(false);
|
|
1807
1470
|
}
|
|
1808
1471
|
};
|
|
1809
1472
|
}, [hasHint, setHasHint]);
|
|
1810
|
-
|
|
1473
|
+
let HintComponent;
|
|
1811
1474
|
if (type === 'checkbox') {
|
|
1812
1475
|
HintComponent = StyledCheckHint;
|
|
1813
1476
|
} else if (type === 'radio') {
|
|
@@ -1817,7 +1480,7 @@ var Hint = React__default["default"].forwardRef(function (props, ref) {
|
|
|
1817
1480
|
} else {
|
|
1818
1481
|
HintComponent = StyledHint;
|
|
1819
1482
|
}
|
|
1820
|
-
|
|
1483
|
+
let combinedProps = props;
|
|
1821
1484
|
if (getHintProps) {
|
|
1822
1485
|
combinedProps = getHintProps(combinedProps);
|
|
1823
1486
|
}
|
|
@@ -1827,52 +1490,56 @@ var Hint = React__default["default"].forwardRef(function (props, ref) {
|
|
|
1827
1490
|
});
|
|
1828
1491
|
Hint.displayName = 'Hint';
|
|
1829
1492
|
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1493
|
+
const Label$1 = React__default["default"].forwardRef((props, ref) => {
|
|
1494
|
+
const fieldContext = useFieldContext();
|
|
1495
|
+
const fieldsetContext = useFieldsetContext();
|
|
1496
|
+
const type = useInputContext();
|
|
1497
|
+
let combinedProps = props;
|
|
1835
1498
|
if (fieldContext) {
|
|
1836
1499
|
combinedProps = fieldContext.getLabelProps(combinedProps);
|
|
1837
1500
|
if (type === undefined) {
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1501
|
+
const {
|
|
1502
|
+
setIsLabelActive,
|
|
1503
|
+
setIsLabelHovered,
|
|
1504
|
+
multiThumbRangeRef
|
|
1505
|
+
} = fieldContext;
|
|
1506
|
+
combinedProps = {
|
|
1507
|
+
...combinedProps,
|
|
1508
|
+
onMouseUp: containerUtilities.composeEventHandlers(props.onMouseUp, () => {
|
|
1843
1509
|
setIsLabelActive(false);
|
|
1844
1510
|
}),
|
|
1845
|
-
onMouseDown: containerUtilities.composeEventHandlers(props.onMouseDown,
|
|
1511
|
+
onMouseDown: containerUtilities.composeEventHandlers(props.onMouseDown, () => {
|
|
1846
1512
|
setIsLabelActive(true);
|
|
1847
1513
|
}),
|
|
1848
|
-
onMouseEnter: containerUtilities.composeEventHandlers(props.onMouseEnter,
|
|
1514
|
+
onMouseEnter: containerUtilities.composeEventHandlers(props.onMouseEnter, () => {
|
|
1849
1515
|
setIsLabelHovered(true);
|
|
1850
1516
|
}),
|
|
1851
|
-
onMouseLeave: containerUtilities.composeEventHandlers(props.onMouseLeave,
|
|
1517
|
+
onMouseLeave: containerUtilities.composeEventHandlers(props.onMouseLeave, () => {
|
|
1852
1518
|
setIsLabelHovered(false);
|
|
1853
1519
|
}),
|
|
1854
|
-
onClick: containerUtilities.composeEventHandlers(props.onClick,
|
|
1520
|
+
onClick: containerUtilities.composeEventHandlers(props.onClick, () => {
|
|
1855
1521
|
multiThumbRangeRef.current && multiThumbRangeRef.current.focus();
|
|
1856
1522
|
})
|
|
1857
|
-
}
|
|
1523
|
+
};
|
|
1858
1524
|
}
|
|
1859
1525
|
}
|
|
1860
1526
|
if (fieldsetContext) {
|
|
1861
|
-
combinedProps =
|
|
1527
|
+
combinedProps = {
|
|
1528
|
+
...combinedProps,
|
|
1862
1529
|
isRegular: combinedProps.isRegular === undefined ? true : combinedProps.isRegular
|
|
1863
|
-
}
|
|
1530
|
+
};
|
|
1864
1531
|
}
|
|
1865
1532
|
if (type === 'radio') {
|
|
1866
1533
|
return React__default["default"].createElement(StyledRadioLabel, _extends$t({
|
|
1867
1534
|
ref: ref
|
|
1868
1535
|
}, combinedProps), React__default["default"].createElement(StyledRadioSvg, null), props.children);
|
|
1869
1536
|
} else if (type === 'checkbox') {
|
|
1870
|
-
|
|
1871
|
-
|
|
1537
|
+
const onLabelSelect = e => {
|
|
1538
|
+
const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
1872
1539
|
if (fieldContext && isFirefox && e.target instanceof Element) {
|
|
1873
|
-
|
|
1540
|
+
const inputId = e.target.getAttribute('for');
|
|
1874
1541
|
if (!inputId) return;
|
|
1875
|
-
|
|
1542
|
+
const input = document.getElementById(inputId);
|
|
1876
1543
|
if (input && input.type === 'checkbox') {
|
|
1877
1544
|
if (e.shiftKey) {
|
|
1878
1545
|
input.click();
|
|
@@ -1882,9 +1549,10 @@ var Label$1 = React__default["default"].forwardRef(function (props, ref) {
|
|
|
1882
1549
|
}
|
|
1883
1550
|
}
|
|
1884
1551
|
};
|
|
1885
|
-
combinedProps =
|
|
1552
|
+
combinedProps = {
|
|
1553
|
+
...combinedProps,
|
|
1886
1554
|
onClick: containerUtilities.composeEventHandlers(combinedProps.onClick, onLabelSelect)
|
|
1887
|
-
}
|
|
1555
|
+
};
|
|
1888
1556
|
return React__default["default"].createElement(StyledCheckLabel, _extends$t({
|
|
1889
1557
|
ref: ref
|
|
1890
1558
|
}, combinedProps), React__default["default"].createElement(StyledCheckSvg, null), React__default["default"].createElement(StyledDashSvg, null), props.children);
|
|
@@ -1902,32 +1570,34 @@ Label$1.propTypes = {
|
|
|
1902
1570
|
isRegular: PropTypes__default["default"].bool
|
|
1903
1571
|
};
|
|
1904
1572
|
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1573
|
+
const VALIDATION = ['success', 'warning', 'error'];
|
|
1574
|
+
const FILE_VALIDATION = ['success', 'error'];
|
|
1575
|
+
const FILE_TYPE = ['pdf', 'zip', 'image', 'document', 'spreadsheet', 'presentation', 'generic'];
|
|
1576
|
+
|
|
1577
|
+
const Message = React__default["default"].forwardRef((_ref, ref) => {
|
|
1578
|
+
let {
|
|
1579
|
+
validation,
|
|
1580
|
+
validationLabel,
|
|
1581
|
+
children,
|
|
1582
|
+
...props
|
|
1583
|
+
} = _ref;
|
|
1584
|
+
const {
|
|
1585
|
+
hasMessage,
|
|
1586
|
+
setHasMessage,
|
|
1587
|
+
getMessageProps
|
|
1588
|
+
} = useFieldContext() || {};
|
|
1589
|
+
const type = useInputContext();
|
|
1590
|
+
React.useEffect(() => {
|
|
1921
1591
|
if (!hasMessage && setHasMessage) {
|
|
1922
1592
|
setHasMessage(true);
|
|
1923
1593
|
}
|
|
1924
|
-
return
|
|
1594
|
+
return () => {
|
|
1925
1595
|
if (hasMessage && setHasMessage) {
|
|
1926
1596
|
setHasMessage(false);
|
|
1927
1597
|
}
|
|
1928
1598
|
};
|
|
1929
1599
|
}, [hasMessage, setHasMessage]);
|
|
1930
|
-
|
|
1600
|
+
let MessageComponent;
|
|
1931
1601
|
if (type === 'checkbox') {
|
|
1932
1602
|
MessageComponent = StyledCheckMessage;
|
|
1933
1603
|
} else if (type === 'radio') {
|
|
@@ -1937,14 +1607,15 @@ var Message = React__default["default"].forwardRef(function (_ref, ref) {
|
|
|
1937
1607
|
} else {
|
|
1938
1608
|
MessageComponent = StyledMessage;
|
|
1939
1609
|
}
|
|
1940
|
-
|
|
1941
|
-
validation
|
|
1942
|
-
validationLabel
|
|
1943
|
-
|
|
1610
|
+
let combinedProps = {
|
|
1611
|
+
validation,
|
|
1612
|
+
validationLabel,
|
|
1613
|
+
...props
|
|
1614
|
+
};
|
|
1944
1615
|
if (getMessageProps) {
|
|
1945
1616
|
combinedProps = getMessageProps(combinedProps);
|
|
1946
1617
|
}
|
|
1947
|
-
|
|
1618
|
+
const ariaLabel = reactTheming.useText(Message, combinedProps, 'validationLabel', validation);
|
|
1948
1619
|
return React__default["default"].createElement(MessageComponent, _extends$t({
|
|
1949
1620
|
ref: ref
|
|
1950
1621
|
}, combinedProps), validation && React__default["default"].createElement(StyledMessageIcon, {
|
|
@@ -1958,18 +1629,19 @@ Message.propTypes = {
|
|
|
1958
1629
|
validationLabel: PropTypes__default["default"].string
|
|
1959
1630
|
};
|
|
1960
1631
|
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1632
|
+
const Checkbox = React__default["default"].forwardRef((_ref, ref) => {
|
|
1633
|
+
let {
|
|
1634
|
+
indeterminate,
|
|
1635
|
+
children,
|
|
1636
|
+
...props
|
|
1637
|
+
} = _ref;
|
|
1638
|
+
const fieldsetContext = useFieldsetContext();
|
|
1639
|
+
const fieldContext = useFieldContext();
|
|
1640
|
+
const inputRef = inputElement => {
|
|
1969
1641
|
inputElement && (inputElement.indeterminate = indeterminate);
|
|
1970
1642
|
};
|
|
1971
|
-
|
|
1972
|
-
[inputRef, ref].forEach(
|
|
1643
|
+
const combinedRef = inputElement => {
|
|
1644
|
+
[inputRef, ref].forEach(targetRef => {
|
|
1973
1645
|
if (targetRef) {
|
|
1974
1646
|
if (typeof targetRef === 'function') {
|
|
1975
1647
|
targetRef(inputElement);
|
|
@@ -1979,9 +1651,11 @@ var Checkbox = React__default["default"].forwardRef(function (_ref, ref) {
|
|
|
1979
1651
|
}
|
|
1980
1652
|
});
|
|
1981
1653
|
};
|
|
1982
|
-
|
|
1983
|
-
ref: combinedRef
|
|
1984
|
-
|
|
1654
|
+
let combinedProps = {
|
|
1655
|
+
ref: combinedRef,
|
|
1656
|
+
...props,
|
|
1657
|
+
...fieldsetContext
|
|
1658
|
+
};
|
|
1985
1659
|
if (fieldContext) {
|
|
1986
1660
|
combinedProps = fieldContext.getInputProps(combinedProps);
|
|
1987
1661
|
}
|
|
@@ -1995,29 +1669,32 @@ Checkbox.propTypes = {
|
|
|
1995
1669
|
indeterminate: PropTypes__default["default"].bool
|
|
1996
1670
|
};
|
|
1997
1671
|
|
|
1998
|
-
|
|
1999
|
-
|
|
1672
|
+
const InputGroupContext = React.createContext(undefined);
|
|
1673
|
+
const useInputGroupContext = () => {
|
|
2000
1674
|
return React.useContext(InputGroupContext);
|
|
2001
1675
|
};
|
|
2002
1676
|
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1677
|
+
const Input = React__default["default"].forwardRef((_ref, ref) => {
|
|
1678
|
+
let {
|
|
1679
|
+
onSelect,
|
|
1680
|
+
...props
|
|
1681
|
+
} = _ref;
|
|
1682
|
+
const fieldContext = useFieldContext();
|
|
1683
|
+
const inputGroupContext = useInputGroupContext();
|
|
1684
|
+
const onSelectHandler = props.readOnly ? containerUtilities.composeEventHandlers(onSelect, event => {
|
|
2010
1685
|
event.currentTarget.select();
|
|
2011
1686
|
}) : onSelect;
|
|
2012
|
-
|
|
2013
|
-
ref
|
|
2014
|
-
onSelect: onSelectHandler
|
|
2015
|
-
|
|
1687
|
+
let combinedProps = {
|
|
1688
|
+
ref,
|
|
1689
|
+
onSelect: onSelectHandler,
|
|
1690
|
+
...props
|
|
1691
|
+
};
|
|
2016
1692
|
if (inputGroupContext) {
|
|
2017
|
-
combinedProps =
|
|
1693
|
+
combinedProps = {
|
|
1694
|
+
...combinedProps,
|
|
2018
1695
|
isCompact: inputGroupContext.isCompact || combinedProps.isCompact,
|
|
2019
1696
|
focusInset: props.focusInset === undefined ? true : props.focusInset
|
|
2020
|
-
}
|
|
1697
|
+
};
|
|
2021
1698
|
}
|
|
2022
1699
|
if (fieldContext) {
|
|
2023
1700
|
combinedProps = fieldContext.getInputProps(combinedProps);
|
|
@@ -2032,15 +1709,18 @@ Input.propTypes = {
|
|
|
2032
1709
|
};
|
|
2033
1710
|
Input.displayName = 'Input';
|
|
2034
1711
|
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
1712
|
+
const Radio = React__default["default"].forwardRef((_ref, ref) => {
|
|
1713
|
+
let {
|
|
1714
|
+
children,
|
|
1715
|
+
...props
|
|
1716
|
+
} = _ref;
|
|
1717
|
+
const fieldsetContext = useFieldsetContext();
|
|
1718
|
+
const fieldContext = useFieldContext();
|
|
1719
|
+
let combinedProps = {
|
|
1720
|
+
ref,
|
|
1721
|
+
...props,
|
|
1722
|
+
...fieldsetContext
|
|
1723
|
+
};
|
|
2044
1724
|
if (fieldContext) {
|
|
2045
1725
|
combinedProps = fieldContext.getInputProps(combinedProps);
|
|
2046
1726
|
}
|
|
@@ -2053,45 +1733,45 @@ Radio.propTypes = {
|
|
|
2053
1733
|
isCompact: PropTypes__default["default"].bool
|
|
2054
1734
|
};
|
|
2055
1735
|
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
1736
|
+
const Range = React__default["default"].forwardRef((_ref, ref) => {
|
|
1737
|
+
let {
|
|
1738
|
+
hasLowerTrack,
|
|
1739
|
+
min,
|
|
1740
|
+
max,
|
|
1741
|
+
step,
|
|
1742
|
+
...props
|
|
1743
|
+
} = _ref;
|
|
1744
|
+
const [backgroundSize, setBackgroundSize] = React.useState('0');
|
|
1745
|
+
const rangeRef = React.useRef();
|
|
1746
|
+
const fieldContext = useFieldContext();
|
|
1747
|
+
const updateBackgroundWidthFromInput = React.useCallback(rangeTarget => {
|
|
1748
|
+
let relativeMax = max;
|
|
1749
|
+
const {
|
|
1750
|
+
value
|
|
1751
|
+
} = rangeTarget;
|
|
2072
1752
|
if (parseFloat(relativeMax) < parseFloat(min)) {
|
|
2073
1753
|
relativeMax = 100;
|
|
2074
1754
|
}
|
|
2075
|
-
|
|
2076
|
-
setBackgroundSize(
|
|
1755
|
+
const percentage = 100 * (value - min) / (relativeMax - min);
|
|
1756
|
+
setBackgroundSize(`${percentage}%`);
|
|
2077
1757
|
},
|
|
2078
1758
|
[max, min, step]);
|
|
2079
|
-
React.useEffect(
|
|
1759
|
+
React.useEffect(() => {
|
|
2080
1760
|
updateBackgroundWidthFromInput(rangeRef.current);
|
|
2081
1761
|
}, [rangeRef, updateBackgroundWidthFromInput, props.value]);
|
|
2082
|
-
|
|
1762
|
+
const onChange = hasLowerTrack ? containerUtilities.composeEventHandlers(props.onChange, event => {
|
|
2083
1763
|
updateBackgroundWidthFromInput(event.target);
|
|
2084
1764
|
}) : props.onChange;
|
|
2085
|
-
|
|
1765
|
+
let combinedProps = {
|
|
2086
1766
|
ref: mergeRefs__default["default"]([rangeRef, ref]),
|
|
2087
|
-
hasLowerTrack
|
|
2088
|
-
min
|
|
2089
|
-
max
|
|
2090
|
-
step
|
|
2091
|
-
backgroundSize
|
|
2092
|
-
|
|
2093
|
-
onChange
|
|
2094
|
-
}
|
|
1767
|
+
hasLowerTrack,
|
|
1768
|
+
min,
|
|
1769
|
+
max,
|
|
1770
|
+
step,
|
|
1771
|
+
backgroundSize,
|
|
1772
|
+
...props,
|
|
1773
|
+
onChange
|
|
1774
|
+
};
|
|
2095
1775
|
if (fieldContext) {
|
|
2096
1776
|
combinedProps = fieldContext.getInputProps(combinedProps, {
|
|
2097
1777
|
isDescribed: true
|
|
@@ -2107,45 +1787,43 @@ Range.defaultProps = {
|
|
|
2107
1787
|
};
|
|
2108
1788
|
Range.displayName = 'Range';
|
|
2109
1789
|
|
|
2110
|
-
|
|
2111
|
-
var parseStyleValue = function parseStyleValue(value) {
|
|
1790
|
+
const parseStyleValue = value => {
|
|
2112
1791
|
return parseInt(value, 10) || 0;
|
|
2113
1792
|
};
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
1793
|
+
const Textarea = React__default["default"].forwardRef((_ref, ref) => {
|
|
1794
|
+
let {
|
|
1795
|
+
minRows,
|
|
1796
|
+
maxRows,
|
|
1797
|
+
style,
|
|
1798
|
+
onChange,
|
|
1799
|
+
onSelect,
|
|
1800
|
+
...props
|
|
1801
|
+
} = _ref;
|
|
1802
|
+
const fieldContext = useFieldContext();
|
|
1803
|
+
const textAreaRef = React.useRef();
|
|
1804
|
+
const shadowTextAreaRef = React.useRef(null);
|
|
1805
|
+
const [state, setState] = React.useState({
|
|
2125
1806
|
overflow: false,
|
|
2126
1807
|
height: 0
|
|
2127
|
-
})
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
var isControlled = props.value !== null && props.value !== undefined;
|
|
2132
|
-
var isAutoResizable = (minRows !== undefined || maxRows !== undefined) && !props.isResizable;
|
|
2133
|
-
var calculateHeight = React.useCallback(function () {
|
|
1808
|
+
});
|
|
1809
|
+
const isControlled = props.value !== null && props.value !== undefined;
|
|
1810
|
+
const isAutoResizable = (minRows !== undefined || maxRows !== undefined) && !props.isResizable;
|
|
1811
|
+
const calculateHeight = React.useCallback(() => {
|
|
2134
1812
|
if (!isAutoResizable) {
|
|
2135
1813
|
return;
|
|
2136
1814
|
}
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
1815
|
+
const textarea = textAreaRef.current;
|
|
1816
|
+
const computedStyle = window.getComputedStyle(textarea);
|
|
1817
|
+
const shadowTextArea = shadowTextAreaRef.current;
|
|
2140
1818
|
shadowTextArea.style.width = computedStyle.width;
|
|
2141
1819
|
shadowTextArea.value = textarea.value || textarea.placeholder || ' ';
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
1820
|
+
const boxSizing = computedStyle.boxSizing;
|
|
1821
|
+
const padding = parseStyleValue(computedStyle.paddingBottom) + parseStyleValue(computedStyle.paddingTop);
|
|
1822
|
+
const border = parseStyleValue(computedStyle.borderTopWidth) + parseStyleValue(computedStyle.borderBottomWidth);
|
|
1823
|
+
const innerHeight = shadowTextArea.scrollHeight - padding;
|
|
2146
1824
|
shadowTextArea.value = 'x';
|
|
2147
|
-
|
|
2148
|
-
|
|
1825
|
+
const singleRowHeight = shadowTextArea.scrollHeight - padding;
|
|
1826
|
+
let outerHeight = innerHeight;
|
|
2149
1827
|
if (minRows) {
|
|
2150
1828
|
outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight);
|
|
2151
1829
|
}
|
|
@@ -2153,19 +1831,19 @@ var Textarea = React__default["default"].forwardRef(function (_ref, ref) {
|
|
|
2153
1831
|
outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight);
|
|
2154
1832
|
}
|
|
2155
1833
|
outerHeight = Math.max(outerHeight, singleRowHeight);
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
setState(
|
|
1834
|
+
const updatedHeight = outerHeight + (boxSizing === 'border-box' ? padding + border : 0);
|
|
1835
|
+
const overflow = Math.abs(outerHeight - innerHeight) <= 1;
|
|
1836
|
+
setState(prevState => {
|
|
2159
1837
|
if (updatedHeight > 0 && Math.abs((prevState.height || 0) - updatedHeight) > 1 || prevState.overflow !== overflow) {
|
|
2160
1838
|
return {
|
|
2161
|
-
overflow
|
|
1839
|
+
overflow,
|
|
2162
1840
|
height: updatedHeight
|
|
2163
1841
|
};
|
|
2164
1842
|
}
|
|
2165
1843
|
return prevState;
|
|
2166
1844
|
});
|
|
2167
1845
|
}, [maxRows, minRows, textAreaRef, isAutoResizable]);
|
|
2168
|
-
|
|
1846
|
+
const onChangeHandler = React.useCallback(e => {
|
|
2169
1847
|
if (!isControlled) {
|
|
2170
1848
|
calculateHeight();
|
|
2171
1849
|
}
|
|
@@ -2173,37 +1851,41 @@ var Textarea = React__default["default"].forwardRef(function (_ref, ref) {
|
|
|
2173
1851
|
onChange(e);
|
|
2174
1852
|
}
|
|
2175
1853
|
}, [calculateHeight, isControlled, onChange]);
|
|
2176
|
-
React.useEffect(
|
|
1854
|
+
React.useEffect(() => {
|
|
2177
1855
|
if (!isAutoResizable) {
|
|
2178
1856
|
return undefined;
|
|
2179
1857
|
}
|
|
2180
|
-
|
|
1858
|
+
const resizeHandler = debounce__default["default"](() => {
|
|
2181
1859
|
calculateHeight();
|
|
2182
1860
|
});
|
|
2183
1861
|
window.addEventListener('resize', resizeHandler);
|
|
2184
|
-
return
|
|
1862
|
+
return () => {
|
|
2185
1863
|
resizeHandler.cancel();
|
|
2186
1864
|
window.removeEventListener('resize', resizeHandler);
|
|
2187
1865
|
};
|
|
2188
1866
|
}, [calculateHeight, isAutoResizable]);
|
|
2189
|
-
React.useLayoutEffect(
|
|
1867
|
+
React.useLayoutEffect(() => {
|
|
2190
1868
|
calculateHeight();
|
|
2191
1869
|
});
|
|
2192
|
-
|
|
1870
|
+
const computedStyle = {};
|
|
2193
1871
|
if (isAutoResizable) {
|
|
2194
1872
|
computedStyle.height = state.height;
|
|
2195
1873
|
computedStyle.overflow = state.overflow ? 'hidden' : undefined;
|
|
2196
1874
|
}
|
|
2197
|
-
|
|
1875
|
+
const onSelectHandler = props.readOnly ? containerUtilities.composeEventHandlers(onSelect, event => {
|
|
2198
1876
|
event.currentTarget.select();
|
|
2199
1877
|
}) : onSelect;
|
|
2200
|
-
|
|
1878
|
+
let combinedProps = {
|
|
2201
1879
|
ref: mergeRefs__default["default"]([textAreaRef, ref]),
|
|
2202
1880
|
rows: minRows,
|
|
2203
1881
|
onChange: onChangeHandler,
|
|
2204
1882
|
onSelect: onSelectHandler,
|
|
2205
|
-
style:
|
|
2206
|
-
|
|
1883
|
+
style: {
|
|
1884
|
+
...computedStyle,
|
|
1885
|
+
...style
|
|
1886
|
+
},
|
|
1887
|
+
...props
|
|
1888
|
+
};
|
|
2207
1889
|
if (fieldContext) {
|
|
2208
1890
|
combinedProps = fieldContext.getInputProps(combinedProps, {
|
|
2209
1891
|
isDescribed: true
|
|
@@ -2232,15 +1914,18 @@ Textarea.propTypes = {
|
|
|
2232
1914
|
};
|
|
2233
1915
|
Textarea.displayName = 'Textarea';
|
|
2234
1916
|
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
1917
|
+
const Toggle = React__default["default"].forwardRef((_ref, ref) => {
|
|
1918
|
+
let {
|
|
1919
|
+
children,
|
|
1920
|
+
...props
|
|
1921
|
+
} = _ref;
|
|
1922
|
+
const fieldsetContext = useFieldsetContext();
|
|
1923
|
+
const fieldContext = useFieldContext();
|
|
1924
|
+
let combinedProps = {
|
|
1925
|
+
ref,
|
|
1926
|
+
...props,
|
|
1927
|
+
...fieldsetContext
|
|
1928
|
+
};
|
|
2244
1929
|
if (fieldContext) {
|
|
2245
1930
|
combinedProps = fieldContext.getInputProps(combinedProps);
|
|
2246
1931
|
}
|
|
@@ -2264,45 +1949,40 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
|
2264
1949
|
height: 16,
|
|
2265
1950
|
focusable: "false",
|
|
2266
1951
|
viewBox: "0 0 16 16",
|
|
2267
|
-
"aria-hidden": "true"
|
|
1952
|
+
"aria-hidden": "true",
|
|
1953
|
+
role: "img"
|
|
2268
1954
|
}, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
|
|
2269
1955
|
fill: "currentColor",
|
|
2270
1956
|
d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
|
|
2271
1957
|
})));
|
|
2272
1958
|
};
|
|
2273
1959
|
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
}, props));
|
|
2278
|
-
};
|
|
1960
|
+
const StartIconComponent = props => React__default["default"].createElement(StyledTextMediaFigure, _extends$t({
|
|
1961
|
+
position: "start"
|
|
1962
|
+
}, props));
|
|
2279
1963
|
StartIconComponent.displayName = 'FauxInput.StartIcon';
|
|
2280
|
-
|
|
1964
|
+
const StartIcon = StartIconComponent;
|
|
2281
1965
|
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
}, props));
|
|
2286
|
-
};
|
|
1966
|
+
const EndIconComponent = props => React__default["default"].createElement(StyledTextMediaFigure, _extends$t({
|
|
1967
|
+
position: "end"
|
|
1968
|
+
}, props));
|
|
2287
1969
|
EndIconComponent.displayName = 'FauxInput.EndIcon';
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
setIsFocused = _useState2[1];
|
|
2302
|
-
var onFocusHandler = containerUtilities.composeEventHandlers(onFocus, function () {
|
|
1970
|
+
const EndIcon = EndIconComponent;
|
|
1971
|
+
|
|
1972
|
+
const FauxInputComponent = React.forwardRef((_ref, ref) => {
|
|
1973
|
+
let {
|
|
1974
|
+
onFocus,
|
|
1975
|
+
onBlur,
|
|
1976
|
+
disabled,
|
|
1977
|
+
readOnly,
|
|
1978
|
+
isFocused: controlledIsFocused,
|
|
1979
|
+
...props
|
|
1980
|
+
} = _ref;
|
|
1981
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
1982
|
+
const onFocusHandler = containerUtilities.composeEventHandlers(onFocus, () => {
|
|
2303
1983
|
setIsFocused(true);
|
|
2304
1984
|
});
|
|
2305
|
-
|
|
1985
|
+
const onBlurHandler = containerUtilities.composeEventHandlers(onBlur, () => {
|
|
2306
1986
|
setIsFocused(false);
|
|
2307
1987
|
});
|
|
2308
1988
|
return React__default["default"].createElement(StyledTextFauxInput, _extends$t({
|
|
@@ -2327,21 +2007,23 @@ FauxInputComponent.propTypes = {
|
|
|
2327
2007
|
isFocused: PropTypes__default["default"].bool,
|
|
2328
2008
|
isHovered: PropTypes__default["default"].bool
|
|
2329
2009
|
};
|
|
2330
|
-
|
|
2010
|
+
const FauxInput = FauxInputComponent;
|
|
2331
2011
|
FauxInput.EndIcon = EndIcon;
|
|
2332
2012
|
FauxInput.StartIcon = StartIcon;
|
|
2333
2013
|
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2014
|
+
const Select = React__default["default"].forwardRef((_ref, ref) => {
|
|
2015
|
+
let {
|
|
2016
|
+
disabled,
|
|
2017
|
+
isCompact,
|
|
2018
|
+
...props
|
|
2019
|
+
} = _ref;
|
|
2020
|
+
const fieldContext = useFieldContext();
|
|
2021
|
+
let combinedProps = {
|
|
2022
|
+
disabled,
|
|
2023
|
+
isCompact,
|
|
2024
|
+
ref,
|
|
2025
|
+
...props
|
|
2026
|
+
};
|
|
2345
2027
|
if (fieldContext) {
|
|
2346
2028
|
combinedProps = fieldContext.getInputProps(combinedProps, {
|
|
2347
2029
|
isDescribed: true
|
|
@@ -2361,304 +2043,92 @@ Select.propTypes = {
|
|
|
2361
2043
|
};
|
|
2362
2044
|
Select.displayName = 'Select';
|
|
2363
2045
|
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2046
|
+
const MIN = 0;
|
|
2047
|
+
const MAX = 100;
|
|
2048
|
+
const MultiThumbRange = React.forwardRef((_ref, ref) => {
|
|
2049
|
+
let {
|
|
2050
|
+
min = MIN,
|
|
2051
|
+
max = MAX,
|
|
2052
|
+
minValue,
|
|
2053
|
+
maxValue,
|
|
2054
|
+
disabled,
|
|
2055
|
+
step,
|
|
2056
|
+
jump,
|
|
2057
|
+
onChange,
|
|
2058
|
+
onMouseDown,
|
|
2059
|
+
...props
|
|
2060
|
+
} = _ref;
|
|
2061
|
+
const theme = React.useContext(styled.ThemeContext);
|
|
2062
|
+
const environment = reactTheming.useDocument(theme);
|
|
2063
|
+
const trackRailRef = React.useRef(null);
|
|
2064
|
+
const minThumbRef = React.useRef(null);
|
|
2065
|
+
const maxThumbRef = React.useRef(null);
|
|
2066
|
+
const {
|
|
2067
|
+
getTrackProps,
|
|
2068
|
+
getMinThumbProps,
|
|
2069
|
+
getMaxThumbProps,
|
|
2070
|
+
trackRect,
|
|
2071
|
+
minValue: updatedMinValue,
|
|
2072
|
+
maxValue: updatedMaxValue
|
|
2073
|
+
} = containerSlider.useSlider({
|
|
2074
|
+
trackRef: trackRailRef,
|
|
2075
|
+
minThumbRef,
|
|
2076
|
+
maxThumbRef,
|
|
2077
|
+
min,
|
|
2078
|
+
max,
|
|
2079
|
+
minValue,
|
|
2080
|
+
maxValue,
|
|
2081
|
+
onChange,
|
|
2082
|
+
step,
|
|
2083
|
+
jump,
|
|
2084
|
+
disabled,
|
|
2085
|
+
rtl: theme.rtl,
|
|
2086
|
+
environment
|
|
2087
|
+
});
|
|
2088
|
+
const {
|
|
2089
|
+
onMouseDown: onSliderMouseDown,
|
|
2090
|
+
...trackProps
|
|
2091
|
+
} = getTrackProps({
|
|
2092
|
+
onMouseDown
|
|
2093
|
+
});
|
|
2094
|
+
const fieldContext = useFieldContext();
|
|
2095
|
+
const {
|
|
2096
|
+
isLabelHovered,
|
|
2097
|
+
isLabelActive,
|
|
2098
|
+
multiThumbRangeRef
|
|
2099
|
+
} = fieldContext || {};
|
|
2100
|
+
React.useEffect(() => {
|
|
2403
2101
|
if (multiThumbRangeRef) {
|
|
2404
2102
|
multiThumbRangeRef.current = minThumbRef.current;
|
|
2405
2103
|
}
|
|
2406
2104
|
}, [multiThumbRangeRef]);
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
return function () {
|
|
2411
|
-
window.removeEventListener('resize', onWindowResize);
|
|
2412
|
-
};
|
|
2413
|
-
}, [onWindowResize]);
|
|
2414
|
-
var calculateMinPosition = React.useCallback(function (minDistance) {
|
|
2415
|
-
var boundedMinValue = minValue;
|
|
2416
|
-
if (boundedMinValue < min) {
|
|
2417
|
-
boundedMinValue = min;
|
|
2418
|
-
} else if (boundedMinValue > maxValue) {
|
|
2419
|
-
boundedMinValue = maxValue;
|
|
2420
|
-
} else if (boundedMinValue > max) {
|
|
2421
|
-
boundedMinValue = max;
|
|
2422
|
-
}
|
|
2423
|
-
return (boundedMinValue - min) / (max - min) * (railWidth - minDistance);
|
|
2424
|
-
}, [max, maxValue, min, minValue, railWidth]);
|
|
2425
|
-
var calculateMaxPosition = React.useCallback(function (minDistance) {
|
|
2426
|
-
var boundedMaxValue = maxValue;
|
|
2427
|
-
if (boundedMaxValue > max) {
|
|
2428
|
-
boundedMaxValue = max;
|
|
2429
|
-
} else if (boundedMaxValue < minValue) {
|
|
2430
|
-
boundedMaxValue = minValue;
|
|
2431
|
-
} else if (boundedMaxValue < min) {
|
|
2432
|
-
boundedMaxValue = min;
|
|
2433
|
-
}
|
|
2434
|
-
return (boundedMaxValue - min) / (max - min) * (railWidth - minDistance) + minDistance;
|
|
2435
|
-
}, [max, maxValue, min, minValue, railWidth]);
|
|
2436
|
-
var onRangeValuesChange = React.useCallback(function () {
|
|
2437
|
-
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
2438
|
-
newMinValue = _ref3.minValue,
|
|
2439
|
-
newMaxValue = _ref3.maxValue;
|
|
2440
|
-
if (disabled) {
|
|
2441
|
-
return;
|
|
2442
|
-
}
|
|
2443
|
-
if (onChange && (newMinValue !== minValue || newMaxValue !== maxValue)) {
|
|
2444
|
-
onChange({
|
|
2445
|
-
minValue: newMinValue,
|
|
2446
|
-
maxValue: newMaxValue
|
|
2447
|
-
});
|
|
2448
|
-
}
|
|
2449
|
-
}, [disabled, maxValue, minValue, onChange]);
|
|
2450
|
-
var updateMinThumbSlider = React.useCallback(function (value) {
|
|
2451
|
-
var managedValue = value;
|
|
2452
|
-
if (value < min) {
|
|
2453
|
-
managedValue = min;
|
|
2454
|
-
} else if (value > maxValue) {
|
|
2455
|
-
managedValue = maxValue;
|
|
2456
|
-
}
|
|
2457
|
-
onRangeValuesChange({
|
|
2458
|
-
maxValue: maxValue,
|
|
2459
|
-
minValue: managedValue
|
|
2460
|
-
});
|
|
2461
|
-
}, [maxValue, min, onRangeValuesChange]);
|
|
2462
|
-
var updateMaxThumbSlider = React.useCallback(function (value) {
|
|
2463
|
-
var managedValue = value;
|
|
2464
|
-
if (value < minValue) {
|
|
2465
|
-
managedValue = minValue;
|
|
2466
|
-
} else if (value > max) {
|
|
2467
|
-
managedValue = max;
|
|
2468
|
-
}
|
|
2469
|
-
onRangeValuesChange({
|
|
2470
|
-
maxValue: managedValue,
|
|
2471
|
-
minValue: minValue
|
|
2472
|
-
});
|
|
2473
|
-
}, [max, minValue, onRangeValuesChange]);
|
|
2474
|
-
var calculateUpdatedValue = React.useCallback(function (e) {
|
|
2475
|
-
if (!trackRailRef.current) {
|
|
2476
|
-
return undefined;
|
|
2477
|
-
}
|
|
2478
|
-
var trackOffsetLeft = trackRailRef.current.getBoundingClientRect().left;
|
|
2479
|
-
var trackOffsetRight = trackOffsetLeft + trackRailRef.current.getBoundingClientRect().width;
|
|
2480
|
-
var trackWidth = trackRailRef.current.getBoundingClientRect().width;
|
|
2481
|
-
var diffX = e.pageX - (theme.rtl ? trackOffsetRight : trackOffsetLeft);
|
|
2482
|
-
if (theme.rtl) {
|
|
2483
|
-
diffX *= -1;
|
|
2484
|
-
}
|
|
2485
|
-
var newValue = min + parseInt((max - min) * diffX / trackWidth, 10);
|
|
2486
|
-
return Math.floor(newValue / step) * step;
|
|
2487
|
-
}, [max, min, step, theme.rtl]);
|
|
2488
|
-
var onDocumentMouseMove = React.useCallback(function (e) {
|
|
2489
|
-
var newValue = calculateUpdatedValue(e);
|
|
2490
|
-
if (isMinThumbFocused) {
|
|
2491
|
-
updateMinThumbSlider(newValue);
|
|
2492
|
-
} else {
|
|
2493
|
-
updateMaxThumbSlider(newValue);
|
|
2494
|
-
}
|
|
2495
|
-
}, [calculateUpdatedValue, isMinThumbFocused, updateMinThumbSlider, updateMaxThumbSlider]);
|
|
2496
|
-
var removeDragEvents = React.useCallback(function () {
|
|
2497
|
-
if (themedDocument) {
|
|
2498
|
-
themedDocument.removeEventListener('mousemove', onDocumentMouseMove);
|
|
2499
|
-
themedDocument.removeEventListener('mouseup', removeDragEvents);
|
|
2500
|
-
}
|
|
2501
|
-
setIsMousedDown(false);
|
|
2502
|
-
}, [onDocumentMouseMove, themedDocument]);
|
|
2503
|
-
var onTrackMouseDown = React.useCallback(function (e) {
|
|
2504
|
-
if (e.button !== 0 || disabled) {
|
|
2505
|
-
return;
|
|
2506
|
-
}
|
|
2507
|
-
e.preventDefault();
|
|
2508
|
-
var valueAtMouseDown = calculateUpdatedValue(e);
|
|
2509
|
-
if (valueAtMouseDown === undefined || minValue === undefined || maxValue === undefined) {
|
|
2510
|
-
return;
|
|
2511
|
-
}
|
|
2512
|
-
var distanceFromMinThumb = Math.abs(minValue - valueAtMouseDown);
|
|
2513
|
-
var distanceFromMaxThumb = Math.abs(maxValue - valueAtMouseDown);
|
|
2514
|
-
if (distanceFromMinThumb <= distanceFromMaxThumb) {
|
|
2515
|
-
minThumbRef.current && minThumbRef.current.focus();
|
|
2516
|
-
updateMinThumbSlider(valueAtMouseDown);
|
|
2517
|
-
} else {
|
|
2518
|
-
maxThumbRef.current && maxThumbRef.current.focus();
|
|
2519
|
-
updateMaxThumbSlider(valueAtMouseDown);
|
|
2520
|
-
}
|
|
2521
|
-
}, [calculateUpdatedValue, disabled, maxValue, minValue, updateMaxThumbSlider, updateMinThumbSlider]);
|
|
2522
|
-
React.useEffect(function () {
|
|
2523
|
-
if (isMousedDown && themedDocument) {
|
|
2524
|
-
themedDocument.addEventListener('mousemove', onDocumentMouseMove);
|
|
2525
|
-
themedDocument.addEventListener('mouseup', removeDragEvents);
|
|
2526
|
-
}
|
|
2527
|
-
return function () {
|
|
2528
|
-
if (isMousedDown && themedDocument) {
|
|
2529
|
-
themedDocument.removeEventListener('mousemove', onDocumentMouseMove);
|
|
2530
|
-
themedDocument.removeEventListener('mouseup', removeDragEvents);
|
|
2531
|
-
}
|
|
2532
|
-
};
|
|
2533
|
-
}, [isMousedDown, onDocumentMouseMove, removeDragEvents, themedDocument]);
|
|
2534
|
-
var _onKeyDown = function onKeyDown(type) {
|
|
2535
|
-
return function (e) {
|
|
2536
|
-
var isMinThumb = type === 'min';
|
|
2537
|
-
var keyIntercepted = false;
|
|
2538
|
-
var decrementThumb = function decrementThumb() {
|
|
2539
|
-
if (isMinThumb) {
|
|
2540
|
-
updateMinThumbSlider(minValue - step);
|
|
2541
|
-
} else {
|
|
2542
|
-
updateMaxThumbSlider(maxValue - step);
|
|
2543
|
-
}
|
|
2544
|
-
};
|
|
2545
|
-
var incrementThumb = function incrementThumb() {
|
|
2546
|
-
if (isMinThumb) {
|
|
2547
|
-
updateMinThumbSlider(minValue + step);
|
|
2548
|
-
} else {
|
|
2549
|
-
updateMaxThumbSlider(maxValue + step);
|
|
2550
|
-
}
|
|
2551
|
-
};
|
|
2552
|
-
switch (e.keyCode) {
|
|
2553
|
-
case containerUtilities.KEY_CODES.LEFT:
|
|
2554
|
-
if (theme.rtl) {
|
|
2555
|
-
incrementThumb();
|
|
2556
|
-
} else {
|
|
2557
|
-
decrementThumb();
|
|
2558
|
-
}
|
|
2559
|
-
keyIntercepted = true;
|
|
2560
|
-
break;
|
|
2561
|
-
case containerUtilities.KEY_CODES.DOWN:
|
|
2562
|
-
decrementThumb();
|
|
2563
|
-
keyIntercepted = true;
|
|
2564
|
-
break;
|
|
2565
|
-
case containerUtilities.KEY_CODES.RIGHT:
|
|
2566
|
-
if (theme.rtl) {
|
|
2567
|
-
decrementThumb();
|
|
2568
|
-
} else {
|
|
2569
|
-
incrementThumb();
|
|
2570
|
-
}
|
|
2571
|
-
keyIntercepted = true;
|
|
2572
|
-
break;
|
|
2573
|
-
case containerUtilities.KEY_CODES.UP:
|
|
2574
|
-
incrementThumb();
|
|
2575
|
-
keyIntercepted = true;
|
|
2576
|
-
break;
|
|
2577
|
-
case containerUtilities.KEY_CODES.HOME:
|
|
2578
|
-
if (isMinThumb) {
|
|
2579
|
-
updateMinThumbSlider(min);
|
|
2580
|
-
} else {
|
|
2581
|
-
updateMaxThumbSlider(min);
|
|
2582
|
-
}
|
|
2583
|
-
keyIntercepted = true;
|
|
2584
|
-
break;
|
|
2585
|
-
case containerUtilities.KEY_CODES.END:
|
|
2586
|
-
if (isMinThumb) {
|
|
2587
|
-
updateMinThumbSlider(max);
|
|
2588
|
-
} else {
|
|
2589
|
-
updateMaxThumbSlider(max);
|
|
2590
|
-
}
|
|
2591
|
-
keyIntercepted = true;
|
|
2592
|
-
break;
|
|
2593
|
-
}
|
|
2594
|
-
if (keyIntercepted) {
|
|
2595
|
-
e.preventDefault();
|
|
2596
|
-
e.stopPropagation();
|
|
2597
|
-
}
|
|
2598
|
-
};
|
|
2599
|
-
};
|
|
2600
|
-
var MIN_DISTANCE = 0;
|
|
2601
|
-
var minPosition = calculateMinPosition(MIN_DISTANCE);
|
|
2602
|
-
var maxPosition = calculateMaxPosition(MIN_DISTANCE);
|
|
2603
|
-
var sliderBackgroundSize = Math.abs(maxPosition) - Math.abs(minPosition);
|
|
2604
|
-
var onSliderMouseDown = containerUtilities.composeEventHandlers(onMouseDown, onTrackMouseDown);
|
|
2105
|
+
const minPosition = (updatedMinValue - min) / (max - min) * trackRect.width;
|
|
2106
|
+
const maxPosition = (updatedMaxValue - min) / (max - min) * trackRect.width;
|
|
2107
|
+
const sliderBackgroundSize = Math.abs(maxPosition) - Math.abs(minPosition);
|
|
2605
2108
|
return React__default["default"].createElement(StyledSlider, _extends$t({
|
|
2606
2109
|
ref: ref,
|
|
2607
|
-
isDisabled: disabled,
|
|
2608
2110
|
onMouseDown: onSliderMouseDown
|
|
2609
2111
|
}, props), React__default["default"].createElement(StyledSliderTrack, {
|
|
2610
2112
|
backgroundSize: sliderBackgroundSize,
|
|
2611
|
-
backgroundPosition: theme.rtl ?
|
|
2113
|
+
backgroundPosition: theme.rtl ? trackRect.width - maxPosition : minPosition,
|
|
2612
2114
|
isDisabled: disabled
|
|
2613
|
-
}, React__default["default"].createElement(StyledSliderTrackRail, {
|
|
2115
|
+
}, React__default["default"].createElement(StyledSliderTrackRail, _extends$t({}, trackProps, {
|
|
2614
2116
|
ref: trackRailRef
|
|
2615
|
-
}, React__default["default"].createElement(StyledSliderThumb, {
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
"aria-valuemin": min,
|
|
2619
|
-
"aria-valuemax": maxValue,
|
|
2620
|
-
"aria-valuenow": minValue,
|
|
2621
|
-
"aria-valuetext": minValue,
|
|
2117
|
+
}), React__default["default"].createElement(StyledSliderThumb, _extends$t({}, getMinThumbProps({
|
|
2118
|
+
'aria-label': updatedMinValue
|
|
2119
|
+
}), {
|
|
2622
2120
|
isDisabled: disabled,
|
|
2623
2121
|
position: minPosition,
|
|
2624
2122
|
ref: minThumbRef,
|
|
2625
|
-
onKeyDown: function onKeyDown(e) {
|
|
2626
|
-
return _onKeyDown('min')(e);
|
|
2627
|
-
},
|
|
2628
|
-
onFocus: function onFocus() {
|
|
2629
|
-
setIsMinThumbFocused(true);
|
|
2630
|
-
},
|
|
2631
|
-
onBlur: function onBlur() {
|
|
2632
|
-
setIsMinThumbFocused(false);
|
|
2633
|
-
},
|
|
2634
|
-
onMouseDown: function onMouseDown(e) {
|
|
2635
|
-
setIsMousedDown(true);
|
|
2636
|
-
e.preventDefault();
|
|
2637
|
-
e.stopPropagation();
|
|
2638
|
-
minThumbRef.current && minThumbRef.current.focus();
|
|
2639
|
-
},
|
|
2640
2123
|
"data-garden-active": isLabelActive,
|
|
2641
2124
|
"data-garden-hover": isLabelHovered
|
|
2642
|
-
}), React__default["default"].createElement(StyledSliderThumb, {
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
"aria-valuemin": minValue,
|
|
2646
|
-
"aria-valuemax": max,
|
|
2647
|
-
"aria-valuenow": maxValue,
|
|
2648
|
-
"aria-valuetext": maxValue,
|
|
2125
|
+
})), React__default["default"].createElement(StyledSliderThumb, _extends$t({}, getMaxThumbProps({
|
|
2126
|
+
'aria-label': updatedMaxValue
|
|
2127
|
+
}), {
|
|
2649
2128
|
isDisabled: disabled,
|
|
2650
2129
|
position: maxPosition,
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
},
|
|
2654
|
-
ref: maxThumbRef,
|
|
2655
|
-
onMouseDown: function onMouseDown(e) {
|
|
2656
|
-
setIsMousedDown(true);
|
|
2657
|
-
e.preventDefault();
|
|
2658
|
-
e.stopPropagation();
|
|
2659
|
-
maxThumbRef.current && maxThumbRef.current.focus();
|
|
2660
|
-
}
|
|
2661
|
-
}))));
|
|
2130
|
+
ref: maxThumbRef
|
|
2131
|
+
})))));
|
|
2662
2132
|
});
|
|
2663
2133
|
MultiThumbRange.displayName = 'MultiThumbRange';
|
|
2664
2134
|
MultiThumbRange.propTypes = {
|
|
@@ -2667,35 +2137,32 @@ MultiThumbRange.propTypes = {
|
|
|
2667
2137
|
minValue: PropTypes__default["default"].number,
|
|
2668
2138
|
maxValue: PropTypes__default["default"].number,
|
|
2669
2139
|
step: PropTypes__default["default"].number,
|
|
2140
|
+
jump: PropTypes__default["default"].number,
|
|
2670
2141
|
disabled: PropTypes__default["default"].bool,
|
|
2671
2142
|
onChange: PropTypes__default["default"].func
|
|
2672
2143
|
};
|
|
2673
2144
|
MultiThumbRange.defaultProps = {
|
|
2674
|
-
min:
|
|
2675
|
-
max:
|
|
2676
|
-
minValue: 0,
|
|
2677
|
-
maxValue: 100,
|
|
2145
|
+
min: MIN,
|
|
2146
|
+
max: MAX,
|
|
2678
2147
|
step: 1
|
|
2679
2148
|
};
|
|
2680
2149
|
|
|
2681
|
-
|
|
2682
|
-
|
|
2150
|
+
const TilesContext = React.createContext(undefined);
|
|
2151
|
+
const useTilesContext = () => {
|
|
2683
2152
|
return React.useContext(TilesContext);
|
|
2684
2153
|
};
|
|
2685
2154
|
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
var inputRef = React.useRef(null);
|
|
2698
|
-
var inputProps;
|
|
2155
|
+
const TileComponent = React__default["default"].forwardRef((_ref, ref) => {
|
|
2156
|
+
let {
|
|
2157
|
+
children,
|
|
2158
|
+
value,
|
|
2159
|
+
disabled,
|
|
2160
|
+
...props
|
|
2161
|
+
} = _ref;
|
|
2162
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
2163
|
+
const tilesContext = useTilesContext();
|
|
2164
|
+
const inputRef = React.useRef(null);
|
|
2165
|
+
let inputProps;
|
|
2699
2166
|
if (tilesContext) {
|
|
2700
2167
|
inputProps = {
|
|
2701
2168
|
name: tilesContext.name,
|
|
@@ -2712,12 +2179,10 @@ var TileComponent = React__default["default"].forwardRef(function (_ref, ref) {
|
|
|
2712
2179
|
}, props), children, React__default["default"].createElement(StyledTileInput, _extends$t({}, inputProps, {
|
|
2713
2180
|
disabled: disabled,
|
|
2714
2181
|
value: value,
|
|
2715
|
-
onBlur:
|
|
2716
|
-
|
|
2717
|
-
},
|
|
2718
|
-
onFocus: function onFocus(e) {
|
|
2182
|
+
onBlur: () => setIsFocused(false),
|
|
2183
|
+
onFocus: e => {
|
|
2719
2184
|
e.persist();
|
|
2720
|
-
setTimeout(
|
|
2185
|
+
setTimeout(() => {
|
|
2721
2186
|
if (e.target.getAttribute('data-garden-focus-visible')) {
|
|
2722
2187
|
setIsFocused(true);
|
|
2723
2188
|
}
|
|
@@ -2732,36 +2197,33 @@ TileComponent.propTypes = {
|
|
|
2732
2197
|
value: PropTypes__default["default"].string,
|
|
2733
2198
|
disabled: PropTypes__default["default"].bool
|
|
2734
2199
|
};
|
|
2735
|
-
|
|
2200
|
+
const Tile = TileComponent;
|
|
2736
2201
|
|
|
2737
|
-
|
|
2738
|
-
|
|
2202
|
+
const DescriptionComponent = React.forwardRef((props, ref) => {
|
|
2203
|
+
const tilesContext = useTilesContext();
|
|
2739
2204
|
return React__default["default"].createElement(StyledTileDescription, _extends$t({
|
|
2740
2205
|
ref: ref,
|
|
2741
2206
|
isCentered: tilesContext && tilesContext.isCentered
|
|
2742
2207
|
}, props));
|
|
2743
2208
|
});
|
|
2744
2209
|
DescriptionComponent.displayName = 'Tiles.Description';
|
|
2745
|
-
|
|
2210
|
+
const Description = DescriptionComponent;
|
|
2746
2211
|
|
|
2747
|
-
|
|
2748
|
-
|
|
2212
|
+
const IconComponent = React.forwardRef((props, ref) => {
|
|
2213
|
+
const tileContext = useTilesContext();
|
|
2749
2214
|
return React__default["default"].createElement(StyledTileIcon, _extends$t({
|
|
2750
2215
|
ref: ref,
|
|
2751
2216
|
isCentered: tileContext && tileContext.isCentered
|
|
2752
2217
|
}, props));
|
|
2753
2218
|
});
|
|
2754
2219
|
IconComponent.displayName = 'Tiles.Icon';
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
var ref = React.useRef();
|
|
2763
|
-
var tilesContext = useTilesContext();
|
|
2764
|
-
React.useEffect(function () {
|
|
2220
|
+
const Icon = IconComponent;
|
|
2221
|
+
|
|
2222
|
+
const LabelComponent = React.forwardRef((props, forwardedRef) => {
|
|
2223
|
+
const [title, setTitle] = React.useState('');
|
|
2224
|
+
const ref = React.useRef();
|
|
2225
|
+
const tilesContext = useTilesContext();
|
|
2226
|
+
React.useEffect(() => {
|
|
2765
2227
|
if (ref.current) {
|
|
2766
2228
|
setTitle(ref.current.textContent || undefined);
|
|
2767
2229
|
}
|
|
@@ -2773,37 +2235,33 @@ var LabelComponent = React.forwardRef(function (props, forwardedRef) {
|
|
|
2773
2235
|
}, props));
|
|
2774
2236
|
});
|
|
2775
2237
|
LabelComponent.displayName = 'Tiles.Label';
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
setValue = _useState2[1];
|
|
2789
|
-
var handleOnChange = React.useCallback(function () {
|
|
2238
|
+
const Label = LabelComponent;
|
|
2239
|
+
|
|
2240
|
+
const TilesComponent = React.forwardRef((_ref, ref) => {
|
|
2241
|
+
let {
|
|
2242
|
+
onChange,
|
|
2243
|
+
value: controlledValue,
|
|
2244
|
+
name,
|
|
2245
|
+
isCentered,
|
|
2246
|
+
...props
|
|
2247
|
+
} = _ref;
|
|
2248
|
+
const [value, setValue] = React.useState(controlledValue);
|
|
2249
|
+
const handleOnChange = React.useCallback(function () {
|
|
2790
2250
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2791
2251
|
args[_key] = arguments[_key];
|
|
2792
2252
|
}
|
|
2793
2253
|
setValue(args[0].target.value);
|
|
2794
2254
|
if (onChange) {
|
|
2795
|
-
onChange
|
|
2255
|
+
onChange(...args);
|
|
2796
2256
|
}
|
|
2797
2257
|
}, [onChange]);
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
};
|
|
2806
|
-
}, [handleOnChange, selectedValue, name, isCentered]);
|
|
2258
|
+
const selectedValue = containerUtilities.getControlledValue(controlledValue, value);
|
|
2259
|
+
const tileContext = React.useMemo(() => ({
|
|
2260
|
+
onChange: handleOnChange,
|
|
2261
|
+
value: selectedValue,
|
|
2262
|
+
name,
|
|
2263
|
+
isCentered
|
|
2264
|
+
}), [handleOnChange, selectedValue, name, isCentered]);
|
|
2807
2265
|
return React__default["default"].createElement(TilesContext.Provider, {
|
|
2808
2266
|
value: tileContext
|
|
2809
2267
|
}, React__default["default"].createElement("div", _extends$t({
|
|
@@ -2821,21 +2279,20 @@ TilesComponent.propTypes = {
|
|
|
2821
2279
|
TilesComponent.defaultProps = {
|
|
2822
2280
|
isCentered: true
|
|
2823
2281
|
};
|
|
2824
|
-
|
|
2282
|
+
const Tiles = TilesComponent;
|
|
2825
2283
|
Tiles.Description = Description;
|
|
2826
2284
|
Tiles.Icon = Icon;
|
|
2827
2285
|
Tiles.Label = Label;
|
|
2828
2286
|
Tiles.Tile = Tile;
|
|
2829
2287
|
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
}, [isCompact]);
|
|
2288
|
+
const InputGroup = React__default["default"].forwardRef((_ref, ref) => {
|
|
2289
|
+
let {
|
|
2290
|
+
isCompact,
|
|
2291
|
+
...props
|
|
2292
|
+
} = _ref;
|
|
2293
|
+
const contextValue = React.useMemo(() => ({
|
|
2294
|
+
isCompact
|
|
2295
|
+
}), [isCompact]);
|
|
2839
2296
|
return React__default["default"].createElement(InputGroupContext.Provider, {
|
|
2840
2297
|
value: contextValue
|
|
2841
2298
|
}, React__default["default"].createElement(StyledInputGroup, _extends$t({
|
|
@@ -2848,10 +2305,11 @@ InputGroup.propTypes = {
|
|
|
2848
2305
|
isCompact: PropTypes__default["default"].bool
|
|
2849
2306
|
};
|
|
2850
2307
|
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2308
|
+
const FileUpload = React__default["default"].forwardRef((_ref, ref) => {
|
|
2309
|
+
let {
|
|
2310
|
+
disabled,
|
|
2311
|
+
...props
|
|
2312
|
+
} = _ref;
|
|
2855
2313
|
return React__default["default"].createElement(StyledFileUpload, _extends$t({
|
|
2856
2314
|
ref: ref,
|
|
2857
2315
|
"aria-disabled": disabled
|
|
@@ -2864,23 +2322,27 @@ FileUpload.propTypes = {
|
|
|
2864
2322
|
};
|
|
2865
2323
|
FileUpload.displayName = 'FileUpload';
|
|
2866
2324
|
|
|
2867
|
-
|
|
2868
|
-
|
|
2325
|
+
const ItemComponent = React.forwardRef((_ref, ref) => {
|
|
2326
|
+
let {
|
|
2327
|
+
...props
|
|
2328
|
+
} = _ref;
|
|
2869
2329
|
return React__default["default"].createElement(StyledFileListItem, _extends$t({}, props, {
|
|
2870
2330
|
ref: ref
|
|
2871
2331
|
}));
|
|
2872
2332
|
});
|
|
2873
2333
|
ItemComponent.displayName = 'FileList.Item';
|
|
2874
|
-
|
|
2334
|
+
const Item = ItemComponent;
|
|
2875
2335
|
|
|
2876
|
-
|
|
2877
|
-
|
|
2336
|
+
const FileListComponent = React.forwardRef((_ref, ref) => {
|
|
2337
|
+
let {
|
|
2338
|
+
...props
|
|
2339
|
+
} = _ref;
|
|
2878
2340
|
return React__default["default"].createElement(StyledFileList, _extends$t({}, props, {
|
|
2879
2341
|
ref: ref
|
|
2880
2342
|
}));
|
|
2881
2343
|
});
|
|
2882
2344
|
FileListComponent.displayName = 'FileList';
|
|
2883
|
-
|
|
2345
|
+
const FileList = FileListComponent;
|
|
2884
2346
|
FileList.Item = Item;
|
|
2885
2347
|
|
|
2886
2348
|
var _path$j;
|
|
@@ -2894,7 +2356,8 @@ var SvgXStroke$1 = function SvgXStroke(props) {
|
|
|
2894
2356
|
height: 12,
|
|
2895
2357
|
focusable: "false",
|
|
2896
2358
|
viewBox: "0 0 12 12",
|
|
2897
|
-
"aria-hidden": "true"
|
|
2359
|
+
"aria-hidden": "true",
|
|
2360
|
+
role: "img"
|
|
2898
2361
|
}, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
|
|
2899
2362
|
stroke: "currentColor",
|
|
2900
2363
|
strokeLinecap: "round",
|
|
@@ -2913,7 +2376,8 @@ var SvgXStroke = function SvgXStroke(props) {
|
|
|
2913
2376
|
height: 16,
|
|
2914
2377
|
focusable: "false",
|
|
2915
2378
|
viewBox: "0 0 16 16",
|
|
2916
|
-
"aria-hidden": "true"
|
|
2379
|
+
"aria-hidden": "true",
|
|
2380
|
+
role: "img"
|
|
2917
2381
|
}, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
|
|
2918
2382
|
stroke: "currentColor",
|
|
2919
2383
|
strokeLinecap: "round",
|
|
@@ -2921,16 +2385,14 @@ var SvgXStroke = function SvgXStroke(props) {
|
|
|
2921
2385
|
})));
|
|
2922
2386
|
};
|
|
2923
2387
|
|
|
2924
|
-
|
|
2925
|
-
|
|
2388
|
+
const FileContext = React.createContext(undefined);
|
|
2389
|
+
const useFileContext = () => {
|
|
2926
2390
|
return React.useContext(FileContext);
|
|
2927
2391
|
};
|
|
2928
2392
|
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
return event.preventDefault();
|
|
2933
|
-
}
|
|
2393
|
+
const CloseComponent = React__default["default"].forwardRef((props, ref) => {
|
|
2394
|
+
const fileContext = useFileContext();
|
|
2395
|
+
const onMouseDown = containerUtilities.composeEventHandlers(props.onMouseDown, event => event.preventDefault()
|
|
2934
2396
|
);
|
|
2935
2397
|
return React__default["default"].createElement(StyledFileClose, _extends$t({
|
|
2936
2398
|
ref: ref
|
|
@@ -2939,7 +2401,7 @@ var CloseComponent = React__default["default"].forwardRef(function (props, ref)
|
|
|
2939
2401
|
}), fileContext && fileContext.isCompact ? React__default["default"].createElement(SvgXStroke$1, null) : React__default["default"].createElement(SvgXStroke, null));
|
|
2940
2402
|
});
|
|
2941
2403
|
CloseComponent.displayName = 'File.Close';
|
|
2942
|
-
|
|
2404
|
+
const Close = CloseComponent;
|
|
2943
2405
|
|
|
2944
2406
|
var _path$h;
|
|
2945
2407
|
|
|
@@ -2952,7 +2414,8 @@ var SvgTrashStroke$1 = function SvgTrashStroke(props) {
|
|
|
2952
2414
|
height: 12,
|
|
2953
2415
|
focusable: "false",
|
|
2954
2416
|
viewBox: "0 0 12 12",
|
|
2955
|
-
"aria-hidden": "true"
|
|
2417
|
+
"aria-hidden": "true",
|
|
2418
|
+
role: "img"
|
|
2956
2419
|
}, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
|
|
2957
2420
|
fill: "none",
|
|
2958
2421
|
stroke: "currentColor",
|
|
@@ -2972,7 +2435,8 @@ var SvgTrashStroke = function SvgTrashStroke(props) {
|
|
|
2972
2435
|
height: 16,
|
|
2973
2436
|
focusable: "false",
|
|
2974
2437
|
viewBox: "0 0 16 16",
|
|
2975
|
-
"aria-hidden": "true"
|
|
2438
|
+
"aria-hidden": "true",
|
|
2439
|
+
role: "img"
|
|
2976
2440
|
}, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
|
|
2977
2441
|
fill: "none",
|
|
2978
2442
|
stroke: "currentColor",
|
|
@@ -2981,11 +2445,9 @@ var SvgTrashStroke = function SvgTrashStroke(props) {
|
|
|
2981
2445
|
})));
|
|
2982
2446
|
};
|
|
2983
2447
|
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
return event.preventDefault();
|
|
2988
|
-
}
|
|
2448
|
+
const DeleteComponent = React__default["default"].forwardRef((props, ref) => {
|
|
2449
|
+
const fileContext = useFileContext();
|
|
2450
|
+
const onMouseDown = containerUtilities.composeEventHandlers(props.onMouseDown, event => event.preventDefault()
|
|
2989
2451
|
);
|
|
2990
2452
|
return React__default["default"].createElement(StyledFileDelete, _extends$t({
|
|
2991
2453
|
ref: ref
|
|
@@ -2994,7 +2456,7 @@ var DeleteComponent = React__default["default"].forwardRef(function (props, ref)
|
|
|
2994
2456
|
}), fileContext && fileContext.isCompact ? React__default["default"].createElement(SvgTrashStroke$1, null) : React__default["default"].createElement(SvgTrashStroke, null));
|
|
2995
2457
|
});
|
|
2996
2458
|
DeleteComponent.displayName = 'File.Delete';
|
|
2997
|
-
|
|
2459
|
+
const Delete = DeleteComponent;
|
|
2998
2460
|
|
|
2999
2461
|
var _path$f, _rect$1;
|
|
3000
2462
|
|
|
@@ -3007,7 +2469,8 @@ var SvgFilePdfStroke$1 = function SvgFilePdfStroke(props) {
|
|
|
3007
2469
|
height: 12,
|
|
3008
2470
|
focusable: "false",
|
|
3009
2471
|
viewBox: "0 0 12 12",
|
|
3010
|
-
"aria-hidden": "true"
|
|
2472
|
+
"aria-hidden": "true",
|
|
2473
|
+
role: "img"
|
|
3011
2474
|
}, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3012
2475
|
fill: "none",
|
|
3013
2476
|
stroke: "currentColor",
|
|
@@ -3035,7 +2498,8 @@ var SvgFileZipStroke$1 = function SvgFileZipStroke(props) {
|
|
|
3035
2498
|
height: 12,
|
|
3036
2499
|
focusable: "false",
|
|
3037
2500
|
viewBox: "0 0 12 12",
|
|
3038
|
-
"aria-hidden": "true"
|
|
2501
|
+
"aria-hidden": "true",
|
|
2502
|
+
role: "img"
|
|
3039
2503
|
}, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3040
2504
|
fill: "none",
|
|
3041
2505
|
stroke: "currentColor",
|
|
@@ -3055,7 +2519,8 @@ var SvgFileImageStroke$1 = function SvgFileImageStroke(props) {
|
|
|
3055
2519
|
height: 12,
|
|
3056
2520
|
focusable: "false",
|
|
3057
2521
|
viewBox: "0 0 12 12",
|
|
3058
|
-
"aria-hidden": "true"
|
|
2522
|
+
"aria-hidden": "true",
|
|
2523
|
+
role: "img"
|
|
3059
2524
|
}, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3060
2525
|
fill: "none",
|
|
3061
2526
|
stroke: "currentColor",
|
|
@@ -3081,7 +2546,8 @@ var SvgFileDocumentStroke$1 = function SvgFileDocumentStroke(props) {
|
|
|
3081
2546
|
height: 12,
|
|
3082
2547
|
focusable: "false",
|
|
3083
2548
|
viewBox: "0 0 12 12",
|
|
3084
|
-
"aria-hidden": "true"
|
|
2549
|
+
"aria-hidden": "true",
|
|
2550
|
+
role: "img"
|
|
3085
2551
|
}, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3086
2552
|
fill: "none",
|
|
3087
2553
|
stroke: "currentColor",
|
|
@@ -3101,7 +2567,8 @@ var SvgFileSpreadsheetStroke$1 = function SvgFileSpreadsheetStroke(props) {
|
|
|
3101
2567
|
height: 12,
|
|
3102
2568
|
focusable: "false",
|
|
3103
2569
|
viewBox: "0 0 12 12",
|
|
3104
|
-
"aria-hidden": "true"
|
|
2570
|
+
"aria-hidden": "true",
|
|
2571
|
+
role: "img"
|
|
3105
2572
|
}, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3106
2573
|
fill: "none",
|
|
3107
2574
|
stroke: "currentColor",
|
|
@@ -3121,7 +2588,8 @@ var SvgFilePresentationStroke$1 = function SvgFilePresentationStroke(props) {
|
|
|
3121
2588
|
height: 12,
|
|
3122
2589
|
focusable: "false",
|
|
3123
2590
|
viewBox: "0 0 12 12",
|
|
3124
|
-
"aria-hidden": "true"
|
|
2591
|
+
"aria-hidden": "true",
|
|
2592
|
+
role: "img"
|
|
3125
2593
|
}, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3126
2594
|
fill: "none",
|
|
3127
2595
|
stroke: "currentColor",
|
|
@@ -3140,7 +2608,8 @@ var SvgFileGenericStroke$1 = function SvgFileGenericStroke(props) {
|
|
|
3140
2608
|
height: 12,
|
|
3141
2609
|
focusable: "false",
|
|
3142
2610
|
viewBox: "0 0 12 12",
|
|
3143
|
-
"aria-hidden": "true"
|
|
2611
|
+
"aria-hidden": "true",
|
|
2612
|
+
role: "img"
|
|
3144
2613
|
}, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3145
2614
|
fill: "none",
|
|
3146
2615
|
stroke: "currentColor",
|
|
@@ -3159,7 +2628,8 @@ var SvgCheckCircleStroke = function SvgCheckCircleStroke(props) {
|
|
|
3159
2628
|
height: 12,
|
|
3160
2629
|
focusable: "false",
|
|
3161
2630
|
viewBox: "0 0 12 12",
|
|
3162
|
-
"aria-hidden": "true"
|
|
2631
|
+
"aria-hidden": "true",
|
|
2632
|
+
role: "img"
|
|
3163
2633
|
}, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
|
|
3164
2634
|
fill: "none",
|
|
3165
2635
|
stroke: "currentColor"
|
|
@@ -3185,7 +2655,8 @@ var SvgFileErrorStroke$1 = function SvgFileErrorStroke(props) {
|
|
|
3185
2655
|
height: 12,
|
|
3186
2656
|
focusable: "false",
|
|
3187
2657
|
viewBox: "0 0 12 12",
|
|
3188
|
-
"aria-hidden": "true"
|
|
2658
|
+
"aria-hidden": "true",
|
|
2659
|
+
role: "img"
|
|
3189
2660
|
}, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3190
2661
|
fill: "none",
|
|
3191
2662
|
stroke: "currentColor",
|
|
@@ -3205,7 +2676,8 @@ var SvgFilePdfStroke = function SvgFilePdfStroke(props) {
|
|
|
3205
2676
|
height: 16,
|
|
3206
2677
|
focusable: "false",
|
|
3207
2678
|
viewBox: "0 0 16 16",
|
|
3208
|
-
"aria-hidden": "true"
|
|
2679
|
+
"aria-hidden": "true",
|
|
2680
|
+
role: "img"
|
|
3209
2681
|
}, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3210
2682
|
fill: "none",
|
|
3211
2683
|
stroke: "currentColor",
|
|
@@ -3233,7 +2705,8 @@ var SvgFileZipStroke = function SvgFileZipStroke(props) {
|
|
|
3233
2705
|
height: 16,
|
|
3234
2706
|
focusable: "false",
|
|
3235
2707
|
viewBox: "0 0 16 16",
|
|
3236
|
-
"aria-hidden": "true"
|
|
2708
|
+
"aria-hidden": "true",
|
|
2709
|
+
role: "img"
|
|
3237
2710
|
}, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3238
2711
|
fill: "none",
|
|
3239
2712
|
stroke: "currentColor",
|
|
@@ -3253,7 +2726,8 @@ var SvgFileImageStroke = function SvgFileImageStroke(props) {
|
|
|
3253
2726
|
height: 16,
|
|
3254
2727
|
focusable: "false",
|
|
3255
2728
|
viewBox: "0 0 16 16",
|
|
3256
|
-
"aria-hidden": "true"
|
|
2729
|
+
"aria-hidden": "true",
|
|
2730
|
+
role: "img"
|
|
3257
2731
|
}, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3258
2732
|
fill: "none",
|
|
3259
2733
|
stroke: "currentColor",
|
|
@@ -3278,7 +2752,8 @@ var SvgFileDocumentStroke = function SvgFileDocumentStroke(props) {
|
|
|
3278
2752
|
height: 16,
|
|
3279
2753
|
focusable: "false",
|
|
3280
2754
|
viewBox: "0 0 16 16",
|
|
3281
|
-
"aria-hidden": "true"
|
|
2755
|
+
"aria-hidden": "true",
|
|
2756
|
+
role: "img"
|
|
3282
2757
|
}, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3283
2758
|
fill: "none",
|
|
3284
2759
|
stroke: "currentColor",
|
|
@@ -3298,7 +2773,8 @@ var SvgFileSpreadsheetStroke = function SvgFileSpreadsheetStroke(props) {
|
|
|
3298
2773
|
height: 16,
|
|
3299
2774
|
focusable: "false",
|
|
3300
2775
|
viewBox: "0 0 16 16",
|
|
3301
|
-
"aria-hidden": "true"
|
|
2776
|
+
"aria-hidden": "true",
|
|
2777
|
+
role: "img"
|
|
3302
2778
|
}, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3303
2779
|
fill: "none",
|
|
3304
2780
|
stroke: "currentColor",
|
|
@@ -3318,7 +2794,8 @@ var SvgFilePresentationStroke = function SvgFilePresentationStroke(props) {
|
|
|
3318
2794
|
height: 16,
|
|
3319
2795
|
focusable: "false",
|
|
3320
2796
|
viewBox: "0 0 16 16",
|
|
3321
|
-
"aria-hidden": "true"
|
|
2797
|
+
"aria-hidden": "true",
|
|
2798
|
+
role: "img"
|
|
3322
2799
|
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3323
2800
|
fill: "none",
|
|
3324
2801
|
stroke: "currentColor",
|
|
@@ -3337,7 +2814,8 @@ var SvgFileGenericStroke = function SvgFileGenericStroke(props) {
|
|
|
3337
2814
|
height: 16,
|
|
3338
2815
|
focusable: "false",
|
|
3339
2816
|
viewBox: "0 0 16 16",
|
|
3340
|
-
"aria-hidden": "true"
|
|
2817
|
+
"aria-hidden": "true",
|
|
2818
|
+
role: "img"
|
|
3341
2819
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3342
2820
|
fill: "none",
|
|
3343
2821
|
stroke: "currentColor",
|
|
@@ -3356,7 +2834,8 @@ var SvgFileErrorStroke = function SvgFileErrorStroke(props) {
|
|
|
3356
2834
|
height: 16,
|
|
3357
2835
|
focusable: "false",
|
|
3358
2836
|
viewBox: "0 0 16 16",
|
|
3359
|
-
"aria-hidden": "true"
|
|
2837
|
+
"aria-hidden": "true",
|
|
2838
|
+
role: "img"
|
|
3360
2839
|
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
3361
2840
|
fill: "none",
|
|
3362
2841
|
stroke: "currentColor",
|
|
@@ -3365,7 +2844,7 @@ var SvgFileErrorStroke = function SvgFileErrorStroke(props) {
|
|
|
3365
2844
|
})));
|
|
3366
2845
|
};
|
|
3367
2846
|
|
|
3368
|
-
|
|
2847
|
+
const fileIconsDefault = {
|
|
3369
2848
|
pdf: React__default["default"].createElement(SvgFilePdfStroke, null),
|
|
3370
2849
|
zip: React__default["default"].createElement(SvgFileZipStroke, null),
|
|
3371
2850
|
image: React__default["default"].createElement(SvgFileImageStroke, null),
|
|
@@ -3376,7 +2855,7 @@ var fileIconsDefault = {
|
|
|
3376
2855
|
success: React__default["default"].createElement(SvgCheckCircleStroke$1, null),
|
|
3377
2856
|
error: React__default["default"].createElement(SvgFileErrorStroke, null)
|
|
3378
2857
|
};
|
|
3379
|
-
|
|
2858
|
+
const fileIconsCompact = {
|
|
3380
2859
|
pdf: React__default["default"].createElement(SvgFilePdfStroke$1, null),
|
|
3381
2860
|
zip: React__default["default"].createElement(SvgFileZipStroke$1, null),
|
|
3382
2861
|
image: React__default["default"].createElement(SvgFileImageStroke$1, null),
|
|
@@ -3388,20 +2867,19 @@ var fileIconsCompact = {
|
|
|
3388
2867
|
error: React__default["default"].createElement(SvgFileErrorStroke$1, null)
|
|
3389
2868
|
};
|
|
3390
2869
|
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
var validationType = validation || type;
|
|
2870
|
+
const FileComponent = React.forwardRef((_ref, ref) => {
|
|
2871
|
+
let {
|
|
2872
|
+
children,
|
|
2873
|
+
type,
|
|
2874
|
+
isCompact,
|
|
2875
|
+
focusInset,
|
|
2876
|
+
validation,
|
|
2877
|
+
...props
|
|
2878
|
+
} = _ref;
|
|
2879
|
+
const fileContextValue = React.useMemo(() => ({
|
|
2880
|
+
isCompact
|
|
2881
|
+
}), [isCompact]);
|
|
2882
|
+
const validationType = validation || type;
|
|
3405
2883
|
return React__default["default"].createElement(FileContext.Provider, {
|
|
3406
2884
|
value: fileContextValue
|
|
3407
2885
|
}, React__default["default"].createElement(StyledFile, _extends$t({}, props, {
|
|
@@ -3411,9 +2889,7 @@ var FileComponent = React.forwardRef(function (_ref, ref) {
|
|
|
3411
2889
|
ref: ref
|
|
3412
2890
|
}), validationType && React__default["default"].createElement(StyledFileIcon, {
|
|
3413
2891
|
isCompact: isCompact
|
|
3414
|
-
}, isCompact ? fileIconsCompact[validationType] : fileIconsDefault[validationType]), React.Children.map(children,
|
|
3415
|
-
return typeof child === 'string' ? React__default["default"].createElement("span", null, child) : child;
|
|
3416
|
-
})));
|
|
2892
|
+
}, isCompact ? fileIconsCompact[validationType] : fileIconsDefault[validationType]), React.Children.map(children, child => typeof child === 'string' ? React__default["default"].createElement("span", null, child) : child)));
|
|
3417
2893
|
});
|
|
3418
2894
|
FileComponent.displayName = 'File';
|
|
3419
2895
|
FileComponent.propTypes = {
|
|
@@ -3422,67 +2898,63 @@ FileComponent.propTypes = {
|
|
|
3422
2898
|
type: PropTypes__default["default"].oneOf(FILE_TYPE),
|
|
3423
2899
|
validation: PropTypes__default["default"].oneOf(FILE_VALIDATION)
|
|
3424
2900
|
};
|
|
3425
|
-
|
|
2901
|
+
const File = FileComponent;
|
|
3426
2902
|
File.Close = Close;
|
|
3427
2903
|
File.Delete = Delete;
|
|
3428
2904
|
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
onBlur = wrapperProps.onBlur,
|
|
3458
|
-
onMouseOver = wrapperProps.onMouseOver,
|
|
3459
|
-
onMouseOut = wrapperProps.onMouseOut,
|
|
3460
|
-
otherWrapperProps = _objectWithoutProperties(wrapperProps, _excluded2);
|
|
3461
|
-
var onFauxInputClickHandler = containerUtilities.composeEventHandlers(onClick, function () {
|
|
2905
|
+
const MediaInput = React__default["default"].forwardRef((_ref, ref) => {
|
|
2906
|
+
let {
|
|
2907
|
+
start,
|
|
2908
|
+
end,
|
|
2909
|
+
disabled,
|
|
2910
|
+
isCompact,
|
|
2911
|
+
isBare,
|
|
2912
|
+
focusInset,
|
|
2913
|
+
readOnly,
|
|
2914
|
+
validation,
|
|
2915
|
+
wrapperProps = {},
|
|
2916
|
+
wrapperRef,
|
|
2917
|
+
onSelect,
|
|
2918
|
+
...props
|
|
2919
|
+
} = _ref;
|
|
2920
|
+
const fieldContext = useFieldContext();
|
|
2921
|
+
const inputRef = React.useRef();
|
|
2922
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
2923
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
2924
|
+
const {
|
|
2925
|
+
onClick,
|
|
2926
|
+
onFocus,
|
|
2927
|
+
onBlur,
|
|
2928
|
+
onMouseOver,
|
|
2929
|
+
onMouseOut,
|
|
2930
|
+
...otherWrapperProps
|
|
2931
|
+
} = wrapperProps;
|
|
2932
|
+
const onFauxInputClickHandler = containerUtilities.composeEventHandlers(onClick, () => {
|
|
3462
2933
|
inputRef.current && inputRef.current.focus();
|
|
3463
2934
|
});
|
|
3464
|
-
|
|
2935
|
+
const onFauxInputFocusHandler = containerUtilities.composeEventHandlers(onFocus, () => {
|
|
3465
2936
|
setIsFocused(true);
|
|
3466
2937
|
});
|
|
3467
|
-
|
|
2938
|
+
const onFauxInputBlurHandler = containerUtilities.composeEventHandlers(onBlur, () => {
|
|
3468
2939
|
setIsFocused(false);
|
|
3469
2940
|
});
|
|
3470
|
-
|
|
2941
|
+
const onFauxInputMouseOverHandler = containerUtilities.composeEventHandlers(onMouseOver, () => {
|
|
3471
2942
|
setIsHovered(true);
|
|
3472
2943
|
});
|
|
3473
|
-
|
|
2944
|
+
const onFauxInputMouseOutHandler = containerUtilities.composeEventHandlers(onMouseOut, () => {
|
|
3474
2945
|
setIsHovered(false);
|
|
3475
2946
|
});
|
|
3476
|
-
|
|
2947
|
+
const onSelectHandler = readOnly ? containerUtilities.composeEventHandlers(onSelect, event => {
|
|
3477
2948
|
event.currentTarget.select();
|
|
3478
2949
|
}) : onSelect;
|
|
3479
|
-
|
|
3480
|
-
disabled
|
|
3481
|
-
readOnly
|
|
2950
|
+
let combinedProps = {
|
|
2951
|
+
disabled,
|
|
2952
|
+
readOnly,
|
|
3482
2953
|
ref: mergeRefs__default["default"]([inputRef, ref]),
|
|
3483
|
-
onSelect: onSelectHandler
|
|
3484
|
-
|
|
3485
|
-
|
|
2954
|
+
onSelect: onSelectHandler,
|
|
2955
|
+
...props
|
|
2956
|
+
};
|
|
2957
|
+
let isLabelHovered;
|
|
3486
2958
|
if (fieldContext) {
|
|
3487
2959
|
combinedProps = fieldContext.getInputProps(combinedProps, {
|
|
3488
2960
|
isDescribed: true
|