@zendeskgarden/react-forms 8.66.0 → 8.68.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 +152 -101
- package/dist/index.esm.js +154 -103
- package/dist/typings/elements/faux-input/components/EndIcon.d.ts +2 -1
- package/dist/typings/elements/faux-input/components/StartIcon.d.ts +2 -1
- package/dist/typings/styled/select/StyledSelectWrapper.d.ts +1 -2
- package/dist/typings/styled/text/StyledTextFauxInput.d.ts +6 -1
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -9,8 +9,8 @@ import * as React from 'react';
|
|
|
9
9
|
import React__default, { createContext, useContext, Children, useState, useRef, useMemo, forwardRef, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
10
10
|
import { useField } from '@zendeskgarden/container-field';
|
|
11
11
|
import styled, { css, ThemeContext } from 'styled-components';
|
|
12
|
-
import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColor, useText, useDocument } from '@zendeskgarden/react-theming';
|
|
13
|
-
import { hideVisually, math,
|
|
12
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColor, focusStyles, SELECTOR_FOCUS_VISIBLE, getFocusBoxShadow, useText, useDocument } from '@zendeskgarden/react-theming';
|
|
13
|
+
import { hideVisually, math, em, rgba } from 'polished';
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
15
|
import { composeEventHandlers, getControlledValue } from '@zendeskgarden/container-utilities';
|
|
16
16
|
import mergeRefs from 'react-merge-refs';
|
|
@@ -41,7 +41,7 @@ const useFieldContext = () => {
|
|
|
41
41
|
const COMPONENT_ID$K = 'forms.field';
|
|
42
42
|
const StyledField = styled.div.attrs({
|
|
43
43
|
'data-garden-id': COMPONENT_ID$K,
|
|
44
|
-
'data-garden-version': '8.
|
|
44
|
+
'data-garden-version': '8.68.0'
|
|
45
45
|
}).withConfig({
|
|
46
46
|
displayName: "StyledField",
|
|
47
47
|
componentId: "sc-12gzfsu-0"
|
|
@@ -54,7 +54,7 @@ const COMPONENT_ID$J = 'forms.fieldset';
|
|
|
54
54
|
const StyledFieldset = styled(StyledField).attrs({
|
|
55
55
|
as: 'fieldset',
|
|
56
56
|
'data-garden-id': COMPONENT_ID$J,
|
|
57
|
-
'data-garden-version': '8.
|
|
57
|
+
'data-garden-version': '8.68.0'
|
|
58
58
|
}).withConfig({
|
|
59
59
|
displayName: "StyledFieldset",
|
|
60
60
|
componentId: "sc-1vr4mxv-0"
|
|
@@ -66,7 +66,7 @@ StyledFieldset.defaultProps = {
|
|
|
66
66
|
const COMPONENT_ID$I = 'forms.input_label';
|
|
67
67
|
const StyledLabel = styled.label.attrs({
|
|
68
68
|
'data-garden-id': COMPONENT_ID$I,
|
|
69
|
-
'data-garden-version': '8.
|
|
69
|
+
'data-garden-version': '8.68.0'
|
|
70
70
|
}).withConfig({
|
|
71
71
|
displayName: "StyledLabel",
|
|
72
72
|
componentId: "sc-2utmsz-0"
|
|
@@ -79,7 +79,7 @@ const COMPONENT_ID$H = 'forms.fieldset_legend';
|
|
|
79
79
|
const StyledLegend = styled(StyledLabel).attrs({
|
|
80
80
|
as: 'legend',
|
|
81
81
|
'data-garden-id': COMPONENT_ID$H,
|
|
82
|
-
'data-garden-version': '8.
|
|
82
|
+
'data-garden-version': '8.68.0'
|
|
83
83
|
}).withConfig({
|
|
84
84
|
displayName: "StyledLegend",
|
|
85
85
|
componentId: "sc-6s0zwq-0"
|
|
@@ -91,7 +91,7 @@ StyledLegend.defaultProps = {
|
|
|
91
91
|
const COMPONENT_ID$G = 'forms.input_hint';
|
|
92
92
|
const StyledHint = styled.div.attrs({
|
|
93
93
|
'data-garden-id': COMPONENT_ID$G,
|
|
94
|
-
'data-garden-version': '8.
|
|
94
|
+
'data-garden-version': '8.68.0'
|
|
95
95
|
}).withConfig({
|
|
96
96
|
displayName: "StyledHint",
|
|
97
97
|
componentId: "sc-17c2wu8-0"
|
|
@@ -196,7 +196,7 @@ const MessageIcon = _ref => {
|
|
|
196
196
|
const COMPONENT_ID$F = 'forms.input_message_icon';
|
|
197
197
|
const StyledMessageIcon = styled(MessageIcon).attrs({
|
|
198
198
|
'data-garden-id': COMPONENT_ID$F,
|
|
199
|
-
'data-garden-version': '8.
|
|
199
|
+
'data-garden-version': '8.68.0',
|
|
200
200
|
'aria-hidden': null
|
|
201
201
|
}).withConfig({
|
|
202
202
|
displayName: "StyledMessageIcon",
|
|
@@ -224,7 +224,7 @@ const validationStyles = props => {
|
|
|
224
224
|
const COMPONENT_ID$E = 'forms.input_message';
|
|
225
225
|
const StyledMessage = styled.div.attrs({
|
|
226
226
|
'data-garden-id': COMPONENT_ID$E,
|
|
227
|
-
'data-garden-version': '8.
|
|
227
|
+
'data-garden-version': '8.68.0'
|
|
228
228
|
}).withConfig({
|
|
229
229
|
displayName: "StyledMessage",
|
|
230
230
|
componentId: "sc-30hgg7-0"
|
|
@@ -237,32 +237,34 @@ const COMPONENT_ID$D = 'forms.input';
|
|
|
237
237
|
const isInvalid = validation => {
|
|
238
238
|
return validation === 'warning' || validation === 'error';
|
|
239
239
|
};
|
|
240
|
-
const colorStyles$
|
|
240
|
+
const colorStyles$c = props => {
|
|
241
|
+
const HUE = 'primaryHue';
|
|
241
242
|
const SHADE = 600;
|
|
242
243
|
const placeholderColor = getColor('neutralHue', SHADE - 200, props.theme);
|
|
243
244
|
let borderColor;
|
|
244
245
|
let hoverBorderColor;
|
|
245
246
|
let focusBorderColor;
|
|
247
|
+
let focusRingHue = HUE;
|
|
248
|
+
let focusRingShade = SHADE;
|
|
246
249
|
if (props.validation) {
|
|
247
|
-
let hue;
|
|
250
|
+
let hue = HUE;
|
|
248
251
|
if (props.validation === 'success') {
|
|
249
252
|
hue = 'successHue';
|
|
250
253
|
} else if (props.validation === 'warning') {
|
|
251
254
|
hue = 'warningHue';
|
|
255
|
+
focusRingShade = 700;
|
|
252
256
|
} else if (props.validation === 'error') {
|
|
253
257
|
hue = 'dangerHue';
|
|
254
258
|
}
|
|
255
259
|
borderColor = getColor(hue, SHADE, props.theme);
|
|
256
260
|
hoverBorderColor = borderColor;
|
|
257
261
|
focusBorderColor = borderColor;
|
|
262
|
+
focusRingHue = hue;
|
|
258
263
|
} else {
|
|
259
264
|
borderColor = getColor('neutralHue', SHADE - 300, props.theme);
|
|
260
265
|
hoverBorderColor = getColor('primaryHue', SHADE, props.theme);
|
|
261
266
|
focusBorderColor = hoverBorderColor;
|
|
262
267
|
}
|
|
263
|
-
const boxShadow = `
|
|
264
|
-
${props.focusInset ? 'inset' : ''}
|
|
265
|
-
${props.theme.shadows.md(rgba(focusBorderColor, 0.35))}`;
|
|
266
268
|
const readOnlyBackgroundColor = getColor('neutralHue', SHADE - 500, props.theme);
|
|
267
269
|
const readOnlyBorderColor = getColor('neutralHue', SHADE - 300, props.theme);
|
|
268
270
|
const disabledBackgroundColor = readOnlyBackgroundColor;
|
|
@@ -275,7 +277,16 @@ const colorStyles$b = props => {
|
|
|
275
277
|
if (props.isHovered) {
|
|
276
278
|
controlledBorderColor = hoverBorderColor;
|
|
277
279
|
}
|
|
278
|
-
return css(["border-color:", ";
|
|
280
|
+
return css(["border-color:", ";background-color:", ";color:", ";&::placeholder{color:", ";}&[readonly],&[aria-readonly='true']{border-color:", ";background-color:", ";}&:hover{border-color:", ";}", " &:disabled,&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], controlledBorderColor, props.isBare ? 'transparent' : props.theme.colors.background, props.theme.colors.foreground, placeholderColor, readOnlyBorderColor, !props.isBare && readOnlyBackgroundColor, hoverBorderColor, focusStyles({
|
|
281
|
+
theme: props.theme,
|
|
282
|
+
inset: props.focusInset,
|
|
283
|
+
condition: !props.isBare,
|
|
284
|
+
hue: focusRingHue,
|
|
285
|
+
shade: focusRingShade,
|
|
286
|
+
styles: {
|
|
287
|
+
borderColor: focusBorderColor
|
|
288
|
+
}
|
|
289
|
+
}), disabledBorderColor, !props.isBare && disabledBackgroundColor, disabledForegroundColor);
|
|
279
290
|
};
|
|
280
291
|
const sizeStyles$f = props => {
|
|
281
292
|
const fontSize = props.theme.fontSizes.md;
|
|
@@ -303,12 +314,12 @@ const sizeStyles$f = props => {
|
|
|
303
314
|
};
|
|
304
315
|
const StyledTextInput = styled.input.attrs(props => ({
|
|
305
316
|
'data-garden-id': COMPONENT_ID$D,
|
|
306
|
-
'data-garden-version': '8.
|
|
317
|
+
'data-garden-version': '8.68.0',
|
|
307
318
|
'aria-invalid': isInvalid(props.validation)
|
|
308
319
|
})).withConfig({
|
|
309
320
|
displayName: "StyledTextInput",
|
|
310
321
|
componentId: "sc-k12n8x-0"
|
|
311
|
-
})(["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;}}", "
|
|
322
|
+
})(["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;}}", ";", ";&: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$c(props), props => retrieveComponentStyles(COMPONENT_ID$D, props));
|
|
312
323
|
StyledTextInput.defaultProps = {
|
|
313
324
|
theme: DEFAULT_THEME
|
|
314
325
|
};
|
|
@@ -326,7 +337,7 @@ const hiddenStyles = `
|
|
|
326
337
|
const StyledTextarea = styled(StyledTextInput).attrs({
|
|
327
338
|
as: 'textarea',
|
|
328
339
|
'data-garden-id': COMPONENT_ID$C,
|
|
329
|
-
'data-garden-version': '8.
|
|
340
|
+
'data-garden-version': '8.68.0'
|
|
330
341
|
}).withConfig({
|
|
331
342
|
displayName: "StyledTextarea",
|
|
332
343
|
componentId: "sc-wxschl-0"
|
|
@@ -336,7 +347,7 @@ StyledTextarea.defaultProps = {
|
|
|
336
347
|
};
|
|
337
348
|
|
|
338
349
|
const COMPONENT_ID$B = 'forms.media_figure';
|
|
339
|
-
const colorStyles$
|
|
350
|
+
const colorStyles$b = props => {
|
|
340
351
|
let shade = 600;
|
|
341
352
|
if (props.isDisabled) {
|
|
342
353
|
shade = 400;
|
|
@@ -372,26 +383,58 @@ _ref => {
|
|
|
372
383
|
return React__default.cloneElement(Children.only(children), props);
|
|
373
384
|
}).attrs({
|
|
374
385
|
'data-garden-id': COMPONENT_ID$B,
|
|
375
|
-
'data-garden-version': '8.
|
|
386
|
+
'data-garden-version': '8.68.0'
|
|
376
387
|
}).withConfig({
|
|
377
388
|
displayName: "StyledTextMediaFigure",
|
|
378
389
|
componentId: "sc-1qepknj-0"
|
|
379
|
-
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", " ", ";"], props => props.isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => colorStyles$
|
|
390
|
+
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", " ", ";"], props => props.isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => colorStyles$b(props), props => sizeStyles$e(props), props => retrieveComponentStyles(COMPONENT_ID$B, props));
|
|
380
391
|
StyledTextMediaFigure.defaultProps = {
|
|
381
392
|
theme: DEFAULT_THEME
|
|
382
393
|
};
|
|
383
394
|
|
|
384
395
|
const COMPONENT_ID$A = 'forms.faux_input';
|
|
396
|
+
const VALIDATION_HUES = {
|
|
397
|
+
success: 'successHue',
|
|
398
|
+
warning: 'warningHue',
|
|
399
|
+
error: 'dangerHue'
|
|
400
|
+
};
|
|
401
|
+
function getValidationHue(validation) {
|
|
402
|
+
let defaultHue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'primaryHue';
|
|
403
|
+
if (validation) {
|
|
404
|
+
return VALIDATION_HUES[validation];
|
|
405
|
+
}
|
|
406
|
+
return defaultHue;
|
|
407
|
+
}
|
|
408
|
+
const colorStyles$a = props => {
|
|
409
|
+
const {
|
|
410
|
+
theme,
|
|
411
|
+
validation,
|
|
412
|
+
focusInset,
|
|
413
|
+
isBare,
|
|
414
|
+
isFocused
|
|
415
|
+
} = props;
|
|
416
|
+
return css(["", ""], focusStyles({
|
|
417
|
+
theme,
|
|
418
|
+
inset: focusInset,
|
|
419
|
+
condition: !isBare,
|
|
420
|
+
hue: getValidationHue(validation),
|
|
421
|
+
shade: validation === 'warning' ? 700 : 600,
|
|
422
|
+
selector: isFocused ? '&' : '&:focus-within',
|
|
423
|
+
styles: {
|
|
424
|
+
borderColor: getColor(getValidationHue(validation), 600, theme)
|
|
425
|
+
}
|
|
426
|
+
}));
|
|
427
|
+
};
|
|
385
428
|
const StyledTextFauxInput = styled(StyledTextInput).attrs(props => ({
|
|
386
429
|
as: 'div',
|
|
387
430
|
'aria-readonly': props.isReadOnly,
|
|
388
431
|
'aria-disabled': props.isDisabled,
|
|
389
432
|
'data-garden-id': COMPONENT_ID$A,
|
|
390
|
-
'data-garden-version': '8.
|
|
433
|
+
'data-garden-version': '8.68.0'
|
|
391
434
|
})).withConfig({
|
|
392
435
|
displayName: "StyledTextFauxInput",
|
|
393
436
|
componentId: "sc-yqw7j9-0"
|
|
394
|
-
})(["display:", ";align-items:", ";cursor:", ";overflow:hidden
|
|
437
|
+
})(["display:", ";align-items:", ";cursor:", ";overflow:hidden;", " & > ", "{vertical-align:", ";", "{box-shadow:unset;}}& > ", "{flex-shrink:", ";}", ";"], props => props.mediaLayout ? 'inline-flex' : 'inline-block', props => props.mediaLayout && 'baseline', props => props.mediaLayout && !props.isDisabled ? 'text' : 'default', colorStyles$a, StyledTextInput, props => !props.mediaLayout && 'baseline', SELECTOR_FOCUS_VISIBLE, StyledTextMediaFigure, props => props.mediaLayout && '0', props => retrieveComponentStyles(COMPONENT_ID$A, props));
|
|
395
438
|
StyledTextFauxInput.defaultProps = {
|
|
396
439
|
theme: DEFAULT_THEME
|
|
397
440
|
};
|
|
@@ -399,7 +442,7 @@ StyledTextFauxInput.defaultProps = {
|
|
|
399
442
|
const COMPONENT_ID$z = 'forms.media_input';
|
|
400
443
|
const StyledTextMediaInput = styled(StyledTextInput).attrs({
|
|
401
444
|
'data-garden-id': COMPONENT_ID$z,
|
|
402
|
-
'data-garden-version': '8.
|
|
445
|
+
'data-garden-version': '8.68.0',
|
|
403
446
|
isBare: true
|
|
404
447
|
}).withConfig({
|
|
405
448
|
displayName: "StyledTextMediaInput",
|
|
@@ -417,11 +460,11 @@ const positionStyles = props => {
|
|
|
417
460
|
const itemStyles = props => {
|
|
418
461
|
const startDirection = props.theme.rtl ? 'right' : 'left';
|
|
419
462
|
const endDirection = props.theme.rtl ? 'left' : 'right';
|
|
420
|
-
return css(["& > *{z-index:-1;}& > ", ":disabled{z-index:-2;}& > ", ":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;}& > *:not(:first-child){margin-", ":-", ";}& > *:first-child:not(:last-child){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;}"], StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, startDirection, props.theme.borderWidths.sm, endDirection, endDirection, startDirection, startDirection);
|
|
463
|
+
return css(["& > *{z-index:-1;}& > ", "{z-index:0;}& > ", ":disabled{z-index:-2;}& > ", ":hover,& > button:hover,& > ", ":focus-visible,& > button:focus-visible,& > ", "[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;}& > *:not(:first-child){margin-", ":-", ";}& > *:first-child:not(:last-child){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;}"], StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, startDirection, props.theme.borderWidths.sm, endDirection, endDirection, startDirection, startDirection);
|
|
421
464
|
};
|
|
422
465
|
const StyledInputGroup = styled.div.attrs({
|
|
423
466
|
'data-garden-id': COMPONENT_ID$y,
|
|
424
|
-
'data-garden-version': '8.
|
|
467
|
+
'data-garden-version': '8.68.0'
|
|
425
468
|
}).withConfig({
|
|
426
469
|
displayName: "StyledInputGroup",
|
|
427
470
|
componentId: "sc-kjh1f0-0"
|
|
@@ -439,7 +482,7 @@ const sizeStyles$d = props => {
|
|
|
439
482
|
};
|
|
440
483
|
const StyledRadioLabel = styled(StyledLabel).attrs({
|
|
441
484
|
'data-garden-id': COMPONENT_ID$x,
|
|
442
|
-
'data-garden-version': '8.
|
|
485
|
+
'data-garden-version': '8.68.0',
|
|
443
486
|
isRadio: true
|
|
444
487
|
}).withConfig({
|
|
445
488
|
displayName: "StyledRadioLabel",
|
|
@@ -452,7 +495,7 @@ StyledRadioLabel.defaultProps = {
|
|
|
452
495
|
const COMPONENT_ID$w = 'forms.checkbox_label';
|
|
453
496
|
const StyledCheckLabel = styled(StyledRadioLabel).attrs({
|
|
454
497
|
'data-garden-id': COMPONENT_ID$w,
|
|
455
|
-
'data-garden-version': '8.
|
|
498
|
+
'data-garden-version': '8.68.0'
|
|
456
499
|
}).withConfig({
|
|
457
500
|
displayName: "StyledCheckLabel",
|
|
458
501
|
componentId: "sc-x7nr1-0"
|
|
@@ -464,7 +507,7 @@ StyledCheckLabel.defaultProps = {
|
|
|
464
507
|
const COMPONENT_ID$v = 'forms.radio_hint';
|
|
465
508
|
const StyledRadioHint = styled(StyledHint).attrs({
|
|
466
509
|
'data-garden-id': COMPONENT_ID$v,
|
|
467
|
-
'data-garden-version': '8.
|
|
510
|
+
'data-garden-version': '8.68.0'
|
|
468
511
|
}).withConfig({
|
|
469
512
|
displayName: "StyledRadioHint",
|
|
470
513
|
componentId: "sc-eo8twg-0"
|
|
@@ -476,7 +519,7 @@ StyledRadioHint.defaultProps = {
|
|
|
476
519
|
const COMPONENT_ID$u = 'forms.checkbox_hint';
|
|
477
520
|
const StyledCheckHint = styled(StyledRadioHint).attrs({
|
|
478
521
|
'data-garden-id': COMPONENT_ID$u,
|
|
479
|
-
'data-garden-version': '8.
|
|
522
|
+
'data-garden-version': '8.68.0'
|
|
480
523
|
}).withConfig({
|
|
481
524
|
displayName: "StyledCheckHint",
|
|
482
525
|
componentId: "sc-1kl8e8c-0"
|
|
@@ -496,7 +539,6 @@ const colorStyles$9 = props => {
|
|
|
496
539
|
const focusBorderColor = hoverBorderColor;
|
|
497
540
|
const activeBackgroundColor = getColor('primaryHue', SHADE, props.theme, 0.2);
|
|
498
541
|
const activeBorderColor = focusBorderColor;
|
|
499
|
-
const boxShadow = props.theme.shadows.md(rgba(focusBorderColor, 0.35));
|
|
500
542
|
const checkedBorderColor = focusBorderColor;
|
|
501
543
|
const checkedBackgroundColor = checkedBorderColor;
|
|
502
544
|
const checkedHoverBorderColor = getColor('primaryHue', SHADE + 100, props.theme);
|
|
@@ -504,7 +546,13 @@ const colorStyles$9 = props => {
|
|
|
504
546
|
const checkedActiveBorderColor = getColor('primaryHue', SHADE + 200, props.theme);
|
|
505
547
|
const checkedActiveBackgroundColor = checkedActiveBorderColor;
|
|
506
548
|
const disabledBackgroundColor = getColor('neutralHue', SHADE - 400, props.theme);
|
|
507
|
-
return css(["& ~ ", "::before{border-color:", ";background-color:", ";}& ~ ", " > svg{color:", ";}& ~ ", ":hover::before{border-color:", ";background-color:", ";}
|
|
549
|
+
return css(["& ~ ", "::before{border-color:", ";background-color:", ";}& ~ ", " > svg{color:", ";}& ~ ", ":hover::before{border-color:", ";background-color:", ";}", " & ~ ", ":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, focusStyles({
|
|
550
|
+
theme: props.theme,
|
|
551
|
+
styles: {
|
|
552
|
+
borderColor: focusBorderColor
|
|
553
|
+
},
|
|
554
|
+
selector: `&:focus-visible ~ ${StyledRadioLabel}::before, &[data-garden-focus-visible='true'] ~ ${StyledRadioLabel}::before`
|
|
555
|
+
}), StyledRadioLabel, activeBorderColor, activeBackgroundColor, StyledRadioLabel, checkedBorderColor, checkedBackgroundColor, StyledRadioLabel, checkedHoverBorderColor, checkedHoverBackgroundColor, StyledRadioLabel, checkedActiveBorderColor, checkedActiveBackgroundColor, StyledRadioLabel, disabledBackgroundColor);
|
|
508
556
|
};
|
|
509
557
|
const sizeStyles$c = props => {
|
|
510
558
|
const lineHeight = `${props.theme.space.base * 5}px`;
|
|
@@ -518,7 +566,7 @@ const sizeStyles$c = props => {
|
|
|
518
566
|
};
|
|
519
567
|
const StyledRadioInput = styled.input.attrs({
|
|
520
568
|
'data-garden-id': COMPONENT_ID$t,
|
|
521
|
-
'data-garden-version': '8.
|
|
569
|
+
'data-garden-version': '8.68.0',
|
|
522
570
|
type: 'radio'
|
|
523
571
|
}).withConfig({
|
|
524
572
|
displayName: "StyledRadioInput",
|
|
@@ -540,7 +588,7 @@ const colorStyles$8 = props => {
|
|
|
540
588
|
};
|
|
541
589
|
const StyledCheckInput = styled(StyledRadioInput).attrs({
|
|
542
590
|
'data-garden-id': COMPONENT_ID$s,
|
|
543
|
-
'data-garden-version': '8.
|
|
591
|
+
'data-garden-version': '8.68.0',
|
|
544
592
|
type: 'checkbox'
|
|
545
593
|
}).withConfig({
|
|
546
594
|
displayName: "StyledCheckInput",
|
|
@@ -553,7 +601,7 @@ StyledCheckInput.defaultProps = {
|
|
|
553
601
|
const COMPONENT_ID$r = 'forms.radio_message';
|
|
554
602
|
const StyledRadioMessage = styled(StyledMessage).attrs({
|
|
555
603
|
'data-garden-id': COMPONENT_ID$r,
|
|
556
|
-
'data-garden-version': '8.
|
|
604
|
+
'data-garden-version': '8.68.0'
|
|
557
605
|
}).withConfig({
|
|
558
606
|
displayName: "StyledRadioMessage",
|
|
559
607
|
componentId: "sc-1pmi0q8-0"
|
|
@@ -565,7 +613,7 @@ StyledRadioMessage.defaultProps = {
|
|
|
565
613
|
const COMPONENT_ID$q = 'forms.checkbox_message';
|
|
566
614
|
const StyledCheckMessage = styled(StyledRadioMessage).attrs({
|
|
567
615
|
'data-garden-id': COMPONENT_ID$q,
|
|
568
|
-
'data-garden-version': '8.
|
|
616
|
+
'data-garden-version': '8.68.0'
|
|
569
617
|
}).withConfig({
|
|
570
618
|
displayName: "StyledCheckMessage",
|
|
571
619
|
componentId: "sc-s4p6kd-0"
|
|
@@ -597,7 +645,7 @@ var SvgCheckSmFill = function SvgCheckSmFill(props) {
|
|
|
597
645
|
const COMPONENT_ID$p = 'forms.check_svg';
|
|
598
646
|
const StyledCheckSvg = styled(SvgCheckSmFill).attrs({
|
|
599
647
|
'data-garden-id': COMPONENT_ID$p,
|
|
600
|
-
'data-garden-version': '8.
|
|
648
|
+
'data-garden-version': '8.68.0'
|
|
601
649
|
}).withConfig({
|
|
602
650
|
displayName: "StyledCheckSvg",
|
|
603
651
|
componentId: "sc-fvxetk-0"
|
|
@@ -627,7 +675,7 @@ var SvgDashFill = function SvgDashFill(props) {
|
|
|
627
675
|
const COMPONENT_ID$o = 'forms.dash_svg';
|
|
628
676
|
const StyledDashSvg = styled(SvgDashFill).attrs({
|
|
629
677
|
'data-garden-id': COMPONENT_ID$o,
|
|
630
|
-
'data-garden-version': '8.
|
|
678
|
+
'data-garden-version': '8.68.0'
|
|
631
679
|
}).withConfig({
|
|
632
680
|
displayName: "StyledDashSvg",
|
|
633
681
|
componentId: "sc-z3vq71-0"
|
|
@@ -643,8 +691,10 @@ const colorStyles$7 = props => {
|
|
|
643
691
|
const activeColor = getColor('primaryHue', 800, props.theme);
|
|
644
692
|
const disabledBackgroundColor = getColor('neutralHue', 200, props.theme);
|
|
645
693
|
const disabledForegroundColor = getColor('neutralHue', 400, props.theme);
|
|
646
|
-
|
|
647
|
-
|
|
694
|
+
return css(["border-color:", ";background-color:", ";color:", ";&:hover{border-color:", ";background-color:", ";color:", ";}", " &:active{border-color:", ";background-color:", ";color:", ";}&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], props.isDragging ? activeColor : getColor('neutralHue', 600, props.theme), props.isDragging && rgba(baseColor, 0.2), props.isDragging ? activeColor : baseColor, hoverColor, rgba(baseColor, 0.08), hoverColor, focusStyles({
|
|
695
|
+
theme: props.theme,
|
|
696
|
+
hue: baseColor
|
|
697
|
+
}), activeColor, rgba(baseColor, 0.2), activeColor, disabledForegroundColor, disabledBackgroundColor, disabledForegroundColor);
|
|
648
698
|
};
|
|
649
699
|
const sizeStyles$b = props => {
|
|
650
700
|
const marginTop = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
|
|
@@ -656,11 +706,11 @@ const sizeStyles$b = props => {
|
|
|
656
706
|
};
|
|
657
707
|
const StyledFileUpload = styled.div.attrs({
|
|
658
708
|
'data-garden-id': COMPONENT_ID$n,
|
|
659
|
-
'data-garden-version': '8.
|
|
709
|
+
'data-garden-version': '8.68.0'
|
|
660
710
|
}).withConfig({
|
|
661
711
|
displayName: "StyledFileUpload",
|
|
662
712
|
componentId: "sc-1rodjgn-0"
|
|
663
|
-
})(["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;", "
|
|
713
|
+
})(["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;", ";&[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 => retrieveComponentStyles(COMPONENT_ID$n, props));
|
|
664
714
|
StyledFileUpload.defaultProps = {
|
|
665
715
|
theme: DEFAULT_THEME
|
|
666
716
|
};
|
|
@@ -668,7 +718,7 @@ StyledFileUpload.defaultProps = {
|
|
|
668
718
|
const COMPONENT_ID$m = 'forms.file.close';
|
|
669
719
|
const StyledFileClose = styled.button.attrs({
|
|
670
720
|
'data-garden-id': COMPONENT_ID$m,
|
|
671
|
-
'data-garden-version': '8.
|
|
721
|
+
'data-garden-version': '8.68.0'
|
|
672
722
|
}).withConfig({
|
|
673
723
|
displayName: "StyledFileClose",
|
|
674
724
|
componentId: "sc-1m31jbf-0"
|
|
@@ -695,18 +745,14 @@ const colorStyles$6 = props => {
|
|
|
695
745
|
focusBorderColor = getColor('primaryHue', 600, props.theme);
|
|
696
746
|
foregroundColor = props.theme.colors.foreground;
|
|
697
747
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
&:focus {
|
|
706
|
-
box-shadow: ${boxShadow};
|
|
707
|
-
border-color: ${focusBorderColor};
|
|
748
|
+
return css(["border-color:", ";color:", ";", ""], borderColor, foregroundColor, focusStyles({
|
|
749
|
+
theme: props.theme,
|
|
750
|
+
inset: props.focusInset,
|
|
751
|
+
hue: focusBorderColor,
|
|
752
|
+
styles: {
|
|
753
|
+
borderColor: focusBorderColor
|
|
708
754
|
}
|
|
709
|
-
|
|
755
|
+
}));
|
|
710
756
|
};
|
|
711
757
|
const sizeStyles$a = props => {
|
|
712
758
|
const size = `${props.theme.space.base * (props.isCompact ? 7 : 10)}px`;
|
|
@@ -735,11 +781,11 @@ const sizeStyles$a = props => {
|
|
|
735
781
|
};
|
|
736
782
|
const StyledFile = styled.div.attrs({
|
|
737
783
|
'data-garden-id': COMPONENT_ID$l,
|
|
738
|
-
'data-garden-version': '8.
|
|
784
|
+
'data-garden-version': '8.68.0'
|
|
739
785
|
}).withConfig({
|
|
740
786
|
displayName: "StyledFile",
|
|
741
787
|
componentId: "sc-195lzp1-0"
|
|
742
|
-
})(["display:flex;position:relative;flex-wrap:nowrap;align-items:center;", "
|
|
788
|
+
})(["display:flex;position:relative;flex-wrap:nowrap;align-items:center;transition:box-shadow 0.1s ease-in-out;", ";", ";& > 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 => retrieveComponentStyles(COMPONENT_ID$l, props));
|
|
743
789
|
StyledFile.defaultProps = {
|
|
744
790
|
theme: DEFAULT_THEME
|
|
745
791
|
};
|
|
@@ -747,7 +793,7 @@ StyledFile.defaultProps = {
|
|
|
747
793
|
const COMPONENT_ID$k = 'forms.file.delete';
|
|
748
794
|
const StyledFileDelete = styled(StyledFileClose).attrs({
|
|
749
795
|
'data-garden-id': COMPONENT_ID$k,
|
|
750
|
-
'data-garden-version': '8.
|
|
796
|
+
'data-garden-version': '8.68.0'
|
|
751
797
|
}).withConfig({
|
|
752
798
|
displayName: "StyledFileDelete",
|
|
753
799
|
componentId: "sc-a8nnhx-0"
|
|
@@ -767,7 +813,7 @@ const StyledFileIcon = styled(_ref => {
|
|
|
767
813
|
return React__default.cloneElement(Children.only(children), props);
|
|
768
814
|
}).attrs({
|
|
769
815
|
'data-garden-id': COMPONENT_ID$j,
|
|
770
|
-
'data-garden-version': '8.
|
|
816
|
+
'data-garden-version': '8.68.0'
|
|
771
817
|
}).withConfig({
|
|
772
818
|
displayName: "StyledFileIcon",
|
|
773
819
|
componentId: "sc-7b3q0c-0"
|
|
@@ -779,7 +825,7 @@ StyledFileIcon.defaultProps = {
|
|
|
779
825
|
const COMPONENT_ID$i = 'forms.file_list';
|
|
780
826
|
const StyledFileList = styled.ul.attrs({
|
|
781
827
|
'data-garden-id': COMPONENT_ID$i,
|
|
782
|
-
'data-garden-version': '8.
|
|
828
|
+
'data-garden-version': '8.68.0'
|
|
783
829
|
}).withConfig({
|
|
784
830
|
displayName: "StyledFileList",
|
|
785
831
|
componentId: "sc-gbahjg-0"
|
|
@@ -791,7 +837,7 @@ StyledFileList.defaultProps = {
|
|
|
791
837
|
const COMPONENT_ID$h = 'forms.file_list.item';
|
|
792
838
|
const StyledFileListItem = styled.li.attrs({
|
|
793
839
|
'data-garden-id': COMPONENT_ID$h,
|
|
794
|
-
'data-garden-version': '8.
|
|
840
|
+
'data-garden-version': '8.68.0'
|
|
795
841
|
}).withConfig({
|
|
796
842
|
displayName: "StyledFileListItem",
|
|
797
843
|
componentId: "sc-1ova3lo-0"
|
|
@@ -821,7 +867,7 @@ var SvgCircleSmFill$1 = function SvgCircleSmFill(props) {
|
|
|
821
867
|
const COMPONENT_ID$g = 'forms.radio_svg';
|
|
822
868
|
const StyledRadioSvg = styled(SvgCircleSmFill$1).attrs({
|
|
823
869
|
'data-garden-id': COMPONENT_ID$g,
|
|
824
|
-
'data-garden-version': '8.
|
|
870
|
+
'data-garden-version': '8.68.0'
|
|
825
871
|
}).withConfig({
|
|
826
872
|
displayName: "StyledRadioSvg",
|
|
827
873
|
componentId: "sc-1r1qtr1-0"
|
|
@@ -838,7 +884,7 @@ const sizeStyles$9 = props => {
|
|
|
838
884
|
};
|
|
839
885
|
const StyledToggleLabel = styled(StyledCheckLabel).attrs({
|
|
840
886
|
'data-garden-id': COMPONENT_ID$f,
|
|
841
|
-
'data-garden-version': '8.
|
|
887
|
+
'data-garden-version': '8.68.0'
|
|
842
888
|
}).withConfig({
|
|
843
889
|
displayName: "StyledToggleLabel",
|
|
844
890
|
componentId: "sc-e0asdk-0"
|
|
@@ -850,7 +896,7 @@ StyledToggleLabel.defaultProps = {
|
|
|
850
896
|
const COMPONENT_ID$e = 'forms.toggle_hint';
|
|
851
897
|
const StyledToggleHint = styled(StyledHint).attrs({
|
|
852
898
|
'data-garden-id': COMPONENT_ID$e,
|
|
853
|
-
'data-garden-version': '8.
|
|
899
|
+
'data-garden-version': '8.68.0'
|
|
854
900
|
}).withConfig({
|
|
855
901
|
displayName: "StyledToggleHint",
|
|
856
902
|
componentId: "sc-nziggu-0"
|
|
@@ -877,7 +923,7 @@ const sizeStyles$8 = props => {
|
|
|
877
923
|
};
|
|
878
924
|
const StyledToggleInput = styled(StyledCheckInput).attrs({
|
|
879
925
|
'data-garden-id': COMPONENT_ID$d,
|
|
880
|
-
'data-garden-version': '8.
|
|
926
|
+
'data-garden-version': '8.68.0'
|
|
881
927
|
}).withConfig({
|
|
882
928
|
displayName: "StyledToggleInput",
|
|
883
929
|
componentId: "sc-sgp47s-0"
|
|
@@ -889,7 +935,7 @@ StyledToggleInput.defaultProps = {
|
|
|
889
935
|
const COMPONENT_ID$c = 'forms.toggle_message';
|
|
890
936
|
const StyledToggleMessage = styled(StyledMessage).attrs({
|
|
891
937
|
'data-garden-id': COMPONENT_ID$c,
|
|
892
|
-
'data-garden-version': '8.
|
|
938
|
+
'data-garden-version': '8.68.0'
|
|
893
939
|
}).withConfig({
|
|
894
940
|
displayName: "StyledToggleMessage",
|
|
895
941
|
componentId: "sc-13vuvl1-0"
|
|
@@ -919,7 +965,7 @@ var SvgCircleSmFill = function SvgCircleSmFill(props) {
|
|
|
919
965
|
const COMPONENT_ID$b = 'forms.toggle_svg';
|
|
920
966
|
const StyledToggleSvg = styled(SvgCircleSmFill).attrs({
|
|
921
967
|
'data-garden-id': COMPONENT_ID$b,
|
|
922
|
-
'data-garden-version': '8.
|
|
968
|
+
'data-garden-version': '8.68.0'
|
|
923
969
|
}).withConfig({
|
|
924
970
|
displayName: "StyledToggleSvg",
|
|
925
971
|
componentId: "sc-162xbyx-0"
|
|
@@ -931,7 +977,7 @@ StyledToggleSvg.defaultProps = {
|
|
|
931
977
|
const COMPONENT_ID$a = 'forms.select';
|
|
932
978
|
const colorStyles$4 = props => {
|
|
933
979
|
const color = getColor('neutralHue', 700, props.theme);
|
|
934
|
-
return css(["&:hover + ", ",&:focus + ", ",&[data-garden-focus-visible='true'] + ", "{color:", ";}"], StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, color);
|
|
980
|
+
return css(["&:hover + ", ",&:focus + ", ",&:focus-visible + ", ",&[data-garden-focus-visible='true'] + ", "{color:", ";}"], StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, color);
|
|
935
981
|
};
|
|
936
982
|
const sizeStyles$7 = props => {
|
|
937
983
|
const padding = math(`${props.theme.iconSizes.md} + ${props.theme.space.base * 5}`);
|
|
@@ -941,7 +987,7 @@ const sizeStyles$7 = props => {
|
|
|
941
987
|
};
|
|
942
988
|
const StyledSelect = styled(StyledTextInput).attrs({
|
|
943
989
|
'data-garden-id': COMPONENT_ID$a,
|
|
944
|
-
'data-garden-version': '8.
|
|
990
|
+
'data-garden-version': '8.68.0',
|
|
945
991
|
as: 'select'
|
|
946
992
|
}).withConfig({
|
|
947
993
|
displayName: "StyledSelect",
|
|
@@ -954,12 +1000,11 @@ StyledSelect.defaultProps = {
|
|
|
954
1000
|
const COMPONENT_ID$9 = 'forms.select_wrapper';
|
|
955
1001
|
const StyledSelectWrapper = styled(StyledTextFauxInput).attrs({
|
|
956
1002
|
'data-garden-id': COMPONENT_ID$9,
|
|
957
|
-
'data-garden-version': '8.
|
|
958
|
-
isBare: true
|
|
1003
|
+
'data-garden-version': '8.68.0'
|
|
959
1004
|
}).withConfig({
|
|
960
1005
|
displayName: "StyledSelectWrapper",
|
|
961
1006
|
componentId: "sc-i7b6hw-0"
|
|
962
|
-
})(["position:relative;overflow:visible;"]);
|
|
1007
|
+
})(["position:relative;padding:0;overflow:visible;& > ", "{border-color:transparent;background-color:transparent;", "{box-shadow:unset;}}"], StyledSelect, SELECTOR_FOCUS_VISIBLE);
|
|
963
1008
|
StyledSelectWrapper.defaultProps = {
|
|
964
1009
|
theme: DEFAULT_THEME
|
|
965
1010
|
};
|
|
@@ -1014,11 +1059,13 @@ const colorStyles$3 = props => {
|
|
|
1014
1059
|
const thumbBackgroundColor = getColor('primaryHue', SHADE, props.theme);
|
|
1015
1060
|
const thumbBorderColor = thumbBackgroundColor;
|
|
1016
1061
|
const thumbBoxShadow = props.theme.shadows.lg(math(`${props.theme.space.base} * 1px`), math(`${props.theme.space.base} * 2px`), getColor('neutralHue', SHADE + 200, props.theme, 0.24));
|
|
1062
|
+
const thumbFocusBoxShadow = getFocusBoxShadow({
|
|
1063
|
+
theme: props.theme
|
|
1064
|
+
});
|
|
1017
1065
|
const thumbActiveBackgroundColor = getColor('primaryHue', SHADE + 100, props.theme);
|
|
1018
1066
|
const thumbActiveBorderColor = thumbBorderColor;
|
|
1019
1067
|
const thumbDisabledBackgroundColor = getColor('neutralHue', SHADE - 300, props.theme);
|
|
1020
1068
|
const thumbDisabledBorderColor = thumbDisabledBackgroundColor;
|
|
1021
|
-
const thumbFocusBoxShadow = props.theme.shadows.md(getColor('primaryHue', SHADE, props.theme, 0.35));
|
|
1022
1069
|
const thumbHoverBackgroundColor = thumbActiveBackgroundColor;
|
|
1023
1070
|
const thumbHoverBorderColor = thumbHoverBackgroundColor;
|
|
1024
1071
|
const trackBackgroundColor = getColor('neutralHue', SHADE - 400, props.theme);
|
|
@@ -1045,7 +1092,7 @@ const colorStyles$3 = props => {
|
|
|
1045
1092
|
box-shadow: ${thumbFocusBoxShadow};
|
|
1046
1093
|
`, '[data-garden-focus-visible="true"]'), thumbStyles(`
|
|
1047
1094
|
border-color: ${thumbActiveBorderColor};
|
|
1048
|
-
background-color: ${thumbActiveBackgroundColor}
|
|
1095
|
+
background-color: ${thumbActiveBackgroundColor};
|
|
1049
1096
|
`, ':active'), trackStyles(`
|
|
1050
1097
|
background-image: ${trackDisabledBackgroundImage};
|
|
1051
1098
|
`, ':disabled'), thumbStyles(`
|
|
@@ -1053,7 +1100,7 @@ const colorStyles$3 = props => {
|
|
|
1053
1100
|
box-shadow: none;
|
|
1054
1101
|
background-color: ${thumbDisabledBackgroundColor};
|
|
1055
1102
|
`, ':disabled'), trackLowerStyles(`
|
|
1056
|
-
background-color: ${trackDisabledLowerBackgroundColor}
|
|
1103
|
+
background-color: ${trackDisabledLowerBackgroundColor};
|
|
1057
1104
|
`, ':disabled'));
|
|
1058
1105
|
};
|
|
1059
1106
|
const sizeStyles$6 = props => {
|
|
@@ -1078,7 +1125,7 @@ const sizeStyles$6 = props => {
|
|
|
1078
1125
|
};
|
|
1079
1126
|
const StyledRangeInput = styled.input.attrs(props => ({
|
|
1080
1127
|
'data-garden-id': COMPONENT_ID$8,
|
|
1081
|
-
'data-garden-version': '8.
|
|
1128
|
+
'data-garden-version': '8.68.0',
|
|
1082
1129
|
type: 'range',
|
|
1083
1130
|
style: {
|
|
1084
1131
|
backgroundSize: props.hasLowerTrack && props.backgroundSize
|
|
@@ -1111,7 +1158,7 @@ StyledRangeInput.defaultProps = {
|
|
|
1111
1158
|
const COMPONENT_ID$7 = 'forms.slider';
|
|
1112
1159
|
const StyledSlider = styled.div.attrs({
|
|
1113
1160
|
'data-garden-id': COMPONENT_ID$7,
|
|
1114
|
-
'data-garden-version': '8.
|
|
1161
|
+
'data-garden-version': '8.68.0'
|
|
1115
1162
|
}).withConfig({
|
|
1116
1163
|
displayName: "StyledSlider",
|
|
1117
1164
|
componentId: "sc-1di437a-0"
|
|
@@ -1130,10 +1177,11 @@ const colorStyles$2 = props => {
|
|
|
1130
1177
|
const activeBorderColor = borderColor;
|
|
1131
1178
|
const hoverBackgroundColor = activeBackgroundColor;
|
|
1132
1179
|
const hoverBorderColor = hoverBackgroundColor;
|
|
1133
|
-
const focusBoxShadow = props.theme.shadows.md(getColor('primaryHue', SHADE, props.theme, 0.35));
|
|
1134
1180
|
const disabledBackgroundColor = getColor('neutralHue', SHADE - 300, props.theme);
|
|
1135
1181
|
const disabledBorderColor = disabledBackgroundColor;
|
|
1136
|
-
return css(["border-color:", ";box-shadow:", ";background-color:", "
|
|
1182
|
+
return css(["border-color:", ";box-shadow:", ";background-color:", ";&: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, hoverBorderColor, hoverBackgroundColor, focusStyles({
|
|
1183
|
+
theme: props.theme
|
|
1184
|
+
}), activeBorderColor, activeBackgroundColor, disabledBorderColor, disabledBackgroundColor);
|
|
1137
1185
|
};
|
|
1138
1186
|
const sizeStyles$5 = props => {
|
|
1139
1187
|
const size = math(`${props.theme.space.base} * 5px`);
|
|
@@ -1142,12 +1190,12 @@ const sizeStyles$5 = props => {
|
|
|
1142
1190
|
};
|
|
1143
1191
|
const StyledSliderThumb = styled.div.attrs(props => ({
|
|
1144
1192
|
'data-garden-id': COMPONENT_ID$6,
|
|
1145
|
-
'data-garden-version': '8.
|
|
1193
|
+
'data-garden-version': '8.68.0',
|
|
1146
1194
|
'aria-disabled': props.isDisabled
|
|
1147
1195
|
})).withConfig({
|
|
1148
1196
|
displayName: "StyledSliderThumb",
|
|
1149
1197
|
componentId: "sc-yspbwa-0"
|
|
1150
|
-
})(["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;", "
|
|
1198
|
+
})(["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;", ";", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.position} * 1px`), props => props.theme.borders.md, props => sizeStyles$5(props), props => colorStyles$2(props), props => retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
1151
1199
|
StyledSliderThumb.defaultProps = {
|
|
1152
1200
|
position: 0,
|
|
1153
1201
|
theme: DEFAULT_THEME
|
|
@@ -1172,7 +1220,7 @@ const sizeStyles$4 = props => {
|
|
|
1172
1220
|
};
|
|
1173
1221
|
const StyledSliderTrack = styled.div.attrs(props => ({
|
|
1174
1222
|
'data-garden-id': COMPONENT_ID$5,
|
|
1175
|
-
'data-garden-version': '8.
|
|
1223
|
+
'data-garden-version': '8.68.0',
|
|
1176
1224
|
'aria-disabled': props.isDisabled
|
|
1177
1225
|
})).withConfig({
|
|
1178
1226
|
displayName: "StyledSliderTrack",
|
|
@@ -1192,7 +1240,7 @@ const sizeStyles$3 = props => {
|
|
|
1192
1240
|
};
|
|
1193
1241
|
const StyledSliderTrackRail = styled.div.attrs({
|
|
1194
1242
|
'data-garden-id': COMPONENT_ID$4,
|
|
1195
|
-
'data-garden-version': '8.
|
|
1243
|
+
'data-garden-version': '8.68.0'
|
|
1196
1244
|
}).withConfig({
|
|
1197
1245
|
displayName: "StyledSliderTrackRail",
|
|
1198
1246
|
componentId: "sc-1o5owbd-0"
|
|
@@ -1219,7 +1267,7 @@ const sizeStyles$2 = props => {
|
|
|
1219
1267
|
};
|
|
1220
1268
|
const StyledTileIcon = styled.span.attrs({
|
|
1221
1269
|
'data-garden-id': COMPONENT_ID$3,
|
|
1222
|
-
'data-garden-version': '8.
|
|
1270
|
+
'data-garden-version': '8.68.0'
|
|
1223
1271
|
}).withConfig({
|
|
1224
1272
|
displayName: "StyledTileIcon",
|
|
1225
1273
|
componentId: "sc-1wazhg4-0"
|
|
@@ -1237,7 +1285,6 @@ const colorStyles = props => {
|
|
|
1237
1285
|
const hoverBackgroundColor = getColor('primaryHue', SHADE, props.theme, 0.08);
|
|
1238
1286
|
const hoverBorderColor = getColor('primaryHue', SHADE, props.theme);
|
|
1239
1287
|
const focusBorderColor = hoverBorderColor;
|
|
1240
|
-
const focusBoxShadow = props.theme.shadows.md(rgba(focusBorderColor, 0.35));
|
|
1241
1288
|
const activeBackgroundColor = getColor('primaryHue', SHADE, props.theme, 0.2);
|
|
1242
1289
|
const activeBorderColor = focusBorderColor;
|
|
1243
1290
|
const disabledBackgroundColor = getColor('neutralHue', SHADE - 500, props.theme);
|
|
@@ -1250,12 +1297,18 @@ const colorStyles = props => {
|
|
|
1250
1297
|
const selectedActiveBorderColor = getColor('primaryHue', SHADE + 200, props.theme);
|
|
1251
1298
|
const selectedActiveBackgroundColor = selectedActiveBorderColor;
|
|
1252
1299
|
const selectedDisabledBackgroundColor = disabledBorderColor;
|
|
1253
|
-
return css(["border:", " ", ";border-color:", ";background-color:", ";color:", ";", "{color:", ";}&:
|
|
1300
|
+
return css(["border:", " ", ";border-color:", ";background-color:", ";color:", ";", "{color:", ";}&:hover:not([aria-disabled='true']){border-color:", ";background-color:", ";", "{color:", ";}}", " &: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, getColor('neutralHue', SHADE - 300, props.theme), borderColor, props.theme.colors.background, color, StyledTileIcon, iconColor, hoverBorderColor, hoverBackgroundColor, StyledTileIcon, color, focusStyles({
|
|
1301
|
+
theme: props.theme,
|
|
1302
|
+
hue: focusBorderColor,
|
|
1303
|
+
styles: {
|
|
1304
|
+
borderColor: focusBorderColor
|
|
1305
|
+
},
|
|
1306
|
+
selector: `&:focus-within`
|
|
1307
|
+
}), 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);
|
|
1254
1308
|
};
|
|
1255
1309
|
const StyledTile = styled.label.attrs(props => ({
|
|
1256
1310
|
'data-garden-id': COMPONENT_ID$2,
|
|
1257
|
-
'data-garden-version': '8.
|
|
1258
|
-
'data-garden-focus-visible': props.isFocused,
|
|
1311
|
+
'data-garden-version': '8.68.0',
|
|
1259
1312
|
'data-garden-selected': props.isSelected
|
|
1260
1313
|
})).withConfig({
|
|
1261
1314
|
displayName: "StyledTile",
|
|
@@ -1279,7 +1332,7 @@ const sizeStyles$1 = props => {
|
|
|
1279
1332
|
};
|
|
1280
1333
|
const StyledTileDescription = styled.span.attrs({
|
|
1281
1334
|
'data-garden-id': COMPONENT_ID$1,
|
|
1282
|
-
'data-garden-version': '8.
|
|
1335
|
+
'data-garden-version': '8.68.0'
|
|
1283
1336
|
}).withConfig({
|
|
1284
1337
|
displayName: "StyledTileDescription",
|
|
1285
1338
|
componentId: "sc-xfuu7u-0"
|
|
@@ -1312,7 +1365,7 @@ const sizeStyles = props => {
|
|
|
1312
1365
|
};
|
|
1313
1366
|
const StyledTileLabel = styled.span.attrs({
|
|
1314
1367
|
'data-garden-id': COMPONENT_ID,
|
|
1315
|
-
'data-garden-version': '8.
|
|
1368
|
+
'data-garden-version': '8.68.0'
|
|
1316
1369
|
}).withConfig({
|
|
1317
1370
|
displayName: "StyledTileLabel",
|
|
1318
1371
|
componentId: "sc-1mypv27-0"
|
|
@@ -1563,7 +1616,7 @@ const Message = React__default.forwardRef((_ref, ref) => {
|
|
|
1563
1616
|
if (getMessageProps) {
|
|
1564
1617
|
combinedProps = getMessageProps(combinedProps);
|
|
1565
1618
|
}
|
|
1566
|
-
const ariaLabel = useText(Message, combinedProps, 'validationLabel', validation);
|
|
1619
|
+
const ariaLabel = useText(Message, combinedProps, 'validationLabel', validation, validation !== undefined);
|
|
1567
1620
|
return React__default.createElement(MessageComponent, _extends$t({
|
|
1568
1621
|
ref: ref
|
|
1569
1622
|
}, combinedProps), validation && React__default.createElement(StyledMessageIcon, {
|
|
@@ -1964,12 +2017,18 @@ const Select = React__default.forwardRef((_ref, ref) => {
|
|
|
1964
2017
|
let {
|
|
1965
2018
|
disabled,
|
|
1966
2019
|
isCompact,
|
|
2020
|
+
validation,
|
|
2021
|
+
focusInset,
|
|
2022
|
+
isBare,
|
|
1967
2023
|
...props
|
|
1968
2024
|
} = _ref;
|
|
1969
2025
|
const fieldContext = useFieldContext();
|
|
1970
2026
|
let combinedProps = {
|
|
1971
2027
|
disabled,
|
|
2028
|
+
isBare,
|
|
1972
2029
|
isCompact,
|
|
2030
|
+
validation,
|
|
2031
|
+
focusInset,
|
|
1973
2032
|
ref,
|
|
1974
2033
|
...props
|
|
1975
2034
|
};
|
|
@@ -1979,8 +2038,11 @@ const Select = React__default.forwardRef((_ref, ref) => {
|
|
|
1979
2038
|
});
|
|
1980
2039
|
}
|
|
1981
2040
|
return React__default.createElement(StyledSelectWrapper, {
|
|
1982
|
-
isCompact: isCompact
|
|
1983
|
-
|
|
2041
|
+
isCompact: isCompact,
|
|
2042
|
+
isBare: isBare,
|
|
2043
|
+
validation: validation,
|
|
2044
|
+
focusInset: focusInset
|
|
2045
|
+
}, React__default.createElement(StyledSelect, combinedProps), !isBare && React__default.createElement(FauxInput.EndIcon, {
|
|
1984
2046
|
isDisabled: disabled
|
|
1985
2047
|
}, React__default.createElement(SvgChevronDownStroke, null)));
|
|
1986
2048
|
});
|
|
@@ -2108,7 +2170,6 @@ const TileComponent = React__default.forwardRef((_ref, ref) => {
|
|
|
2108
2170
|
disabled,
|
|
2109
2171
|
...props
|
|
2110
2172
|
} = _ref;
|
|
2111
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
2112
2173
|
const tilesContext = useTilesContext();
|
|
2113
2174
|
const inputRef = useRef(null);
|
|
2114
2175
|
let inputProps;
|
|
@@ -2123,20 +2184,10 @@ const TileComponent = React__default.forwardRef((_ref, ref) => {
|
|
|
2123
2184
|
ref: ref,
|
|
2124
2185
|
"aria-disabled": disabled,
|
|
2125
2186
|
isDisabled: disabled,
|
|
2126
|
-
isFocused: isFocused,
|
|
2127
2187
|
isSelected: tilesContext && tilesContext.value === value
|
|
2128
2188
|
}, props), children, React__default.createElement(StyledTileInput, _extends$t({}, inputProps, {
|
|
2129
2189
|
disabled: disabled,
|
|
2130
2190
|
value: value,
|
|
2131
|
-
onBlur: () => setIsFocused(false),
|
|
2132
|
-
onFocus: e => {
|
|
2133
|
-
e.persist();
|
|
2134
|
-
setTimeout(() => {
|
|
2135
|
-
if (e.target.getAttribute('data-garden-focus-visible')) {
|
|
2136
|
-
setIsFocused(true);
|
|
2137
|
-
}
|
|
2138
|
-
}, 1);
|
|
2139
|
-
},
|
|
2140
2191
|
type: "radio",
|
|
2141
2192
|
ref: inputRef
|
|
2142
2193
|
})));
|