@zendeskgarden/react-forms 9.0.0-next.4 → 9.0.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.cjs.js +233 -229
- package/dist/index.esm.js +235 -231
- package/dist/typings/elements/common/Field.d.ts +9 -1
- package/dist/typings/elements/common/Hint.d.ts +2 -0
- package/dist/typings/elements/common/Label.d.ts +2 -0
- package/dist/typings/elements/common/Message.d.ts +2 -0
- package/dist/typings/styled/select/StyledSelect.d.ts +1 -1
- package/dist/typings/styled/text/StyledTextarea.d.ts +1 -1
- package/dist/typings/types/index.d.ts +3 -3
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import React__default, { createContext, useContext, Children, useState, useMemo, forwardRef,
|
|
9
|
+
import React__default, { createContext, useContext, Children, useEffect, useState, useMemo, forwardRef, useRef, useCallback, useLayoutEffect } from 'react';
|
|
10
10
|
import { useField } from '@zendeskgarden/container-field';
|
|
11
11
|
import styled, { css } from 'styled-components';
|
|
12
|
-
import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight,
|
|
12
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColorV8, focusStyles, SELECTOR_FOCUS_VISIBLE, getFocusBoxShadow, useText } from '@zendeskgarden/react-theming';
|
|
13
13
|
import { hideVisually, math, em, rgba } from 'polished';
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
15
|
import { composeEventHandlers, getControlledValue } from '@zendeskgarden/container-utilities';
|
|
@@ -39,7 +39,7 @@ const useFieldContext = () => {
|
|
|
39
39
|
const COMPONENT_ID$G = 'forms.field';
|
|
40
40
|
const StyledField = styled.div.attrs({
|
|
41
41
|
'data-garden-id': COMPONENT_ID$G,
|
|
42
|
-
'data-garden-version': '9.0.0-next.
|
|
42
|
+
'data-garden-version': '9.0.0-next.6'
|
|
43
43
|
}).withConfig({
|
|
44
44
|
displayName: "StyledField",
|
|
45
45
|
componentId: "sc-12gzfsu-0"
|
|
@@ -52,7 +52,7 @@ const COMPONENT_ID$F = 'forms.fieldset';
|
|
|
52
52
|
const StyledFieldset = styled(StyledField).attrs({
|
|
53
53
|
as: 'fieldset',
|
|
54
54
|
'data-garden-id': COMPONENT_ID$F,
|
|
55
|
-
'data-garden-version': '9.0.0-next.
|
|
55
|
+
'data-garden-version': '9.0.0-next.6'
|
|
56
56
|
}).withConfig({
|
|
57
57
|
displayName: "StyledFieldset",
|
|
58
58
|
componentId: "sc-1vr4mxv-0"
|
|
@@ -64,11 +64,11 @@ StyledFieldset.defaultProps = {
|
|
|
64
64
|
const COMPONENT_ID$E = 'forms.input_label';
|
|
65
65
|
const StyledLabel = styled.label.attrs(props => ({
|
|
66
66
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID$E,
|
|
67
|
-
'data-garden-version': props['data-garden-version'] || '9.0.0-next.
|
|
67
|
+
'data-garden-version': props['data-garden-version'] || '9.0.0-next.6'
|
|
68
68
|
})).withConfig({
|
|
69
69
|
displayName: "StyledLabel",
|
|
70
70
|
componentId: "sc-2utmsz-0"
|
|
71
|
-
})(["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 => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme
|
|
71
|
+
})(["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 => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => getColorV8('foreground', 600 , props.theme), 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 && hideVisually(), props => retrieveComponentStyles(COMPONENT_ID$E, props));
|
|
72
72
|
StyledLabel.defaultProps = {
|
|
73
73
|
theme: DEFAULT_THEME
|
|
74
74
|
};
|
|
@@ -77,7 +77,7 @@ const COMPONENT_ID$D = 'forms.fieldset_legend';
|
|
|
77
77
|
const StyledLegend = styled(StyledLabel).attrs({
|
|
78
78
|
as: 'legend',
|
|
79
79
|
'data-garden-id': COMPONENT_ID$D,
|
|
80
|
-
'data-garden-version': '9.0.0-next.
|
|
80
|
+
'data-garden-version': '9.0.0-next.6'
|
|
81
81
|
}).withConfig({
|
|
82
82
|
displayName: "StyledLegend",
|
|
83
83
|
componentId: "sc-6s0zwq-0"
|
|
@@ -89,11 +89,11 @@ StyledLegend.defaultProps = {
|
|
|
89
89
|
const COMPONENT_ID$C = 'forms.input_hint';
|
|
90
90
|
const StyledHint = styled.div.attrs(props => ({
|
|
91
91
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID$C,
|
|
92
|
-
'data-garden-version': props['data-garden-version'] || '9.0.0-next.
|
|
92
|
+
'data-garden-version': props['data-garden-version'] || '9.0.0-next.6'
|
|
93
93
|
})).withConfig({
|
|
94
94
|
displayName: "StyledHint",
|
|
95
95
|
componentId: "sc-17c2wu8-0"
|
|
96
|
-
})(["direction:", ";display:block;vertical-align:middle;line-height:", ";color:", ";font-size:", ";", ";"], props => props.theme.rtl && 'rtl', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props =>
|
|
96
|
+
})(["direction:", ";display:block;vertical-align:middle;line-height:", ";color:", ";font-size:", ";", ";"], props => props.theme.rtl && 'rtl', props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => getColorV8('neutralHue', 600, props.theme), props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID$C, props));
|
|
97
97
|
StyledHint.defaultProps = {
|
|
98
98
|
theme: DEFAULT_THEME
|
|
99
99
|
};
|
|
@@ -194,7 +194,7 @@ const MessageIcon = _ref => {
|
|
|
194
194
|
const COMPONENT_ID$B = 'forms.input_message_icon';
|
|
195
195
|
const StyledMessageIcon = styled(MessageIcon).attrs({
|
|
196
196
|
'data-garden-id': COMPONENT_ID$B,
|
|
197
|
-
'data-garden-version': '9.0.0-next.
|
|
197
|
+
'data-garden-version': '9.0.0-next.6',
|
|
198
198
|
'aria-hidden': null
|
|
199
199
|
}).withConfig({
|
|
200
200
|
displayName: "StyledMessageIcon",
|
|
@@ -209,20 +209,20 @@ const validationStyles = props => {
|
|
|
209
209
|
const padding = math(`${props.theme.space.base} * 2px + ${props.theme.iconSizes.md}`);
|
|
210
210
|
let color;
|
|
211
211
|
if (props.validation === 'error') {
|
|
212
|
-
color =
|
|
212
|
+
color = getColorV8('dangerHue', 600, props.theme);
|
|
213
213
|
} else if (props.validation === 'success') {
|
|
214
|
-
color =
|
|
214
|
+
color = getColorV8('successHue', 600, props.theme);
|
|
215
215
|
} else if (props.validation === 'warning') {
|
|
216
|
-
color =
|
|
216
|
+
color = getColorV8('warningHue', 700, props.theme);
|
|
217
217
|
} else {
|
|
218
|
-
color =
|
|
218
|
+
color = getColorV8('neutralHue', 700, props.theme);
|
|
219
219
|
}
|
|
220
220
|
return css(["padding-", ":", ";color:", ";"], rtl ? 'right' : 'left', props.validation && padding, color);
|
|
221
221
|
};
|
|
222
222
|
const COMPONENT_ID$A = 'forms.input_message';
|
|
223
223
|
const StyledMessage = styled.div.attrs(props => ({
|
|
224
224
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID$A,
|
|
225
|
-
'data-garden-version': props['data-garden-version'] || '9.0.0-next.
|
|
225
|
+
'data-garden-version': props['data-garden-version'] || '9.0.0-next.6'
|
|
226
226
|
})).withConfig({
|
|
227
227
|
displayName: "StyledMessage",
|
|
228
228
|
componentId: "sc-30hgg7-0"
|
|
@@ -238,7 +238,7 @@ const isInvalid = validation => {
|
|
|
238
238
|
const colorStyles$a = props => {
|
|
239
239
|
const HUE = 'primaryHue';
|
|
240
240
|
const SHADE = 600;
|
|
241
|
-
const placeholderColor =
|
|
241
|
+
const placeholderColor = getColorV8('neutralHue', SHADE - 200, props.theme);
|
|
242
242
|
let borderColor;
|
|
243
243
|
let hoverBorderColor;
|
|
244
244
|
let focusBorderColor;
|
|
@@ -254,20 +254,20 @@ const colorStyles$a = props => {
|
|
|
254
254
|
} else if (props.validation === 'error') {
|
|
255
255
|
hue = 'dangerHue';
|
|
256
256
|
}
|
|
257
|
-
borderColor =
|
|
257
|
+
borderColor = getColorV8(hue, SHADE, props.theme);
|
|
258
258
|
hoverBorderColor = borderColor;
|
|
259
259
|
focusBorderColor = borderColor;
|
|
260
260
|
focusRingHue = hue;
|
|
261
261
|
} else {
|
|
262
|
-
borderColor =
|
|
263
|
-
hoverBorderColor =
|
|
262
|
+
borderColor = getColorV8('neutralHue', SHADE - 300, props.theme);
|
|
263
|
+
hoverBorderColor = getColorV8('primaryHue', SHADE, props.theme);
|
|
264
264
|
focusBorderColor = hoverBorderColor;
|
|
265
265
|
}
|
|
266
|
-
const readOnlyBackgroundColor =
|
|
267
|
-
const readOnlyBorderColor =
|
|
266
|
+
const readOnlyBackgroundColor = getColorV8('neutralHue', SHADE - 500, props.theme);
|
|
267
|
+
const readOnlyBorderColor = getColorV8('neutralHue', SHADE - 300, props.theme);
|
|
268
268
|
const disabledBackgroundColor = readOnlyBackgroundColor;
|
|
269
|
-
const disabledBorderColor =
|
|
270
|
-
const disabledForegroundColor =
|
|
269
|
+
const disabledBorderColor = getColorV8('neutralHue', SHADE - 400, props.theme);
|
|
270
|
+
const disabledForegroundColor = getColorV8('neutralHue', SHADE - 200, props.theme);
|
|
271
271
|
let controlledBorderColor = borderColor;
|
|
272
272
|
if (props.isFocused) {
|
|
273
273
|
controlledBorderColor = focusBorderColor;
|
|
@@ -275,7 +275,7 @@ const colorStyles$a = props => {
|
|
|
275
275
|
if (props.isHovered) {
|
|
276
276
|
controlledBorderColor = hoverBorderColor;
|
|
277
277
|
}
|
|
278
|
-
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
|
|
278
|
+
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' : getColorV8('background', 600 , props.theme), getColorV8('foreground', 600 , props.theme), placeholderColor, readOnlyBorderColor, !props.isBare && readOnlyBackgroundColor, hoverBorderColor, focusStyles({
|
|
279
279
|
theme: props.theme,
|
|
280
280
|
inset: props.focusInset,
|
|
281
281
|
condition: !props.isBare,
|
|
@@ -312,7 +312,7 @@ const sizeStyles$c = props => {
|
|
|
312
312
|
};
|
|
313
313
|
const StyledTextInput = styled.input.attrs(props => ({
|
|
314
314
|
'data-garden-id': COMPONENT_ID$z,
|
|
315
|
-
'data-garden-version': '9.0.0-next.
|
|
315
|
+
'data-garden-version': '9.0.0-next.6',
|
|
316
316
|
'aria-invalid': isInvalid(props.validation)
|
|
317
317
|
})).withConfig({
|
|
318
318
|
displayName: "StyledTextInput",
|
|
@@ -335,7 +335,7 @@ const hiddenStyles = `
|
|
|
335
335
|
const StyledTextarea = styled(StyledTextInput).attrs({
|
|
336
336
|
as: 'textarea',
|
|
337
337
|
'data-garden-id': COMPONENT_ID$y,
|
|
338
|
-
'data-garden-version': '9.0.0-next.
|
|
338
|
+
'data-garden-version': '9.0.0-next.6'
|
|
339
339
|
}).withConfig({
|
|
340
340
|
displayName: "StyledTextarea",
|
|
341
341
|
componentId: "sc-wxschl-0"
|
|
@@ -352,7 +352,7 @@ const colorStyles$9 = props => {
|
|
|
352
352
|
} else if (props.isHovered || props.isFocused) {
|
|
353
353
|
shade = 700;
|
|
354
354
|
}
|
|
355
|
-
return css(["color:", ";"],
|
|
355
|
+
return css(["color:", ";"], getColorV8('neutralHue', shade, props.theme));
|
|
356
356
|
};
|
|
357
357
|
const sizeStyles$b = props => {
|
|
358
358
|
const size = props.theme.iconSizes.md;
|
|
@@ -381,7 +381,7 @@ _ref => {
|
|
|
381
381
|
return React__default.cloneElement(Children.only(children), props);
|
|
382
382
|
}).attrs({
|
|
383
383
|
'data-garden-id': COMPONENT_ID$x,
|
|
384
|
-
'data-garden-version': '9.0.0-next.
|
|
384
|
+
'data-garden-version': '9.0.0-next.6'
|
|
385
385
|
}).withConfig({
|
|
386
386
|
displayName: "StyledTextMediaFigure",
|
|
387
387
|
componentId: "sc-1qepknj-0"
|
|
@@ -419,7 +419,7 @@ const colorStyles$8 = props => {
|
|
|
419
419
|
shade: validation === 'warning' ? 700 : 600,
|
|
420
420
|
selector: isFocused ? '&' : '&:focus-within',
|
|
421
421
|
styles: {
|
|
422
|
-
borderColor:
|
|
422
|
+
borderColor: getColorV8(getValidationHue(validation), 600, theme)
|
|
423
423
|
}
|
|
424
424
|
}));
|
|
425
425
|
};
|
|
@@ -428,7 +428,7 @@ const StyledTextFauxInput = styled(StyledTextInput).attrs(props => ({
|
|
|
428
428
|
'aria-readonly': props.isReadOnly,
|
|
429
429
|
'aria-disabled': props.isDisabled,
|
|
430
430
|
'data-garden-id': COMPONENT_ID$w,
|
|
431
|
-
'data-garden-version': '9.0.0-next.
|
|
431
|
+
'data-garden-version': '9.0.0-next.6'
|
|
432
432
|
})).withConfig({
|
|
433
433
|
displayName: "StyledTextFauxInput",
|
|
434
434
|
componentId: "sc-yqw7j9-0"
|
|
@@ -440,7 +440,7 @@ StyledTextFauxInput.defaultProps = {
|
|
|
440
440
|
const COMPONENT_ID$v = 'forms.media_input';
|
|
441
441
|
const StyledTextMediaInput = styled(StyledTextInput).attrs({
|
|
442
442
|
'data-garden-id': COMPONENT_ID$v,
|
|
443
|
-
'data-garden-version': '9.0.0-next.
|
|
443
|
+
'data-garden-version': '9.0.0-next.6',
|
|
444
444
|
isBare: true
|
|
445
445
|
}).withConfig({
|
|
446
446
|
displayName: "StyledTextMediaInput",
|
|
@@ -462,7 +462,7 @@ const itemStyles = props => {
|
|
|
462
462
|
};
|
|
463
463
|
const StyledInputGroup = styled.div.attrs({
|
|
464
464
|
'data-garden-id': COMPONENT_ID$u,
|
|
465
|
-
'data-garden-version': '9.0.0-next.
|
|
465
|
+
'data-garden-version': '9.0.0-next.6'
|
|
466
466
|
}).withConfig({
|
|
467
467
|
displayName: "StyledInputGroup",
|
|
468
468
|
componentId: "sc-kjh1f0-0"
|
|
@@ -480,7 +480,7 @@ const sizeStyles$a = props => {
|
|
|
480
480
|
};
|
|
481
481
|
const StyledRadioLabel = styled(StyledLabel).attrs({
|
|
482
482
|
'data-garden-id': COMPONENT_ID$t,
|
|
483
|
-
'data-garden-version': '9.0.0-next.
|
|
483
|
+
'data-garden-version': '9.0.0-next.6',
|
|
484
484
|
isRadio: true
|
|
485
485
|
}).withConfig({
|
|
486
486
|
displayName: "StyledRadioLabel",
|
|
@@ -493,7 +493,7 @@ StyledRadioLabel.defaultProps = {
|
|
|
493
493
|
const COMPONENT_ID$s = 'forms.checkbox_label';
|
|
494
494
|
const StyledCheckLabel = styled(StyledRadioLabel).attrs({
|
|
495
495
|
'data-garden-id': COMPONENT_ID$s,
|
|
496
|
-
'data-garden-version': '9.0.0-next.
|
|
496
|
+
'data-garden-version': '9.0.0-next.6'
|
|
497
497
|
}).withConfig({
|
|
498
498
|
displayName: "StyledCheckLabel",
|
|
499
499
|
componentId: "sc-x7nr1-0"
|
|
@@ -505,7 +505,7 @@ StyledCheckLabel.defaultProps = {
|
|
|
505
505
|
const COMPONENT_ID$r = 'forms.radio_hint';
|
|
506
506
|
const StyledRadioHint = styled(StyledHint).attrs({
|
|
507
507
|
'data-garden-id': COMPONENT_ID$r,
|
|
508
|
-
'data-garden-version': '9.0.0-next.
|
|
508
|
+
'data-garden-version': '9.0.0-next.6'
|
|
509
509
|
}).withConfig({
|
|
510
510
|
displayName: "StyledRadioHint",
|
|
511
511
|
componentId: "sc-eo8twg-0"
|
|
@@ -517,7 +517,7 @@ StyledRadioHint.defaultProps = {
|
|
|
517
517
|
const COMPONENT_ID$q = 'forms.checkbox_hint';
|
|
518
518
|
const StyledCheckHint = styled(StyledRadioHint).attrs({
|
|
519
519
|
'data-garden-id': COMPONENT_ID$q,
|
|
520
|
-
'data-garden-version': '9.0.0-next.
|
|
520
|
+
'data-garden-version': '9.0.0-next.6'
|
|
521
521
|
}).withConfig({
|
|
522
522
|
displayName: "StyledCheckHint",
|
|
523
523
|
componentId: "sc-1kl8e8c-0"
|
|
@@ -529,21 +529,21 @@ StyledCheckHint.defaultProps = {
|
|
|
529
529
|
const COMPONENT_ID$p = 'forms.radio';
|
|
530
530
|
const colorStyles$7 = props => {
|
|
531
531
|
const SHADE = 600;
|
|
532
|
-
const borderColor =
|
|
533
|
-
const backgroundColor = props.theme
|
|
532
|
+
const borderColor = getColorV8('neutralHue', SHADE - 300, props.theme);
|
|
533
|
+
const backgroundColor = getColorV8('background', 600 , props.theme);
|
|
534
534
|
const iconColor = backgroundColor;
|
|
535
|
-
const hoverBackgroundColor =
|
|
536
|
-
const hoverBorderColor =
|
|
535
|
+
const hoverBackgroundColor = getColorV8('primaryHue', SHADE, props.theme, 0.08);
|
|
536
|
+
const hoverBorderColor = getColorV8('primaryHue', SHADE, props.theme);
|
|
537
537
|
const focusBorderColor = hoverBorderColor;
|
|
538
|
-
const activeBackgroundColor =
|
|
538
|
+
const activeBackgroundColor = getColorV8('primaryHue', SHADE, props.theme, 0.2);
|
|
539
539
|
const activeBorderColor = focusBorderColor;
|
|
540
540
|
const checkedBorderColor = focusBorderColor;
|
|
541
541
|
const checkedBackgroundColor = checkedBorderColor;
|
|
542
|
-
const checkedHoverBorderColor =
|
|
542
|
+
const checkedHoverBorderColor = getColorV8('primaryHue', SHADE + 100, props.theme);
|
|
543
543
|
const checkedHoverBackgroundColor = checkedHoverBorderColor;
|
|
544
|
-
const checkedActiveBorderColor =
|
|
544
|
+
const checkedActiveBorderColor = getColorV8('primaryHue', SHADE + 200, props.theme);
|
|
545
545
|
const checkedActiveBackgroundColor = checkedActiveBorderColor;
|
|
546
|
-
const disabledBackgroundColor =
|
|
546
|
+
const disabledBackgroundColor = getColorV8('neutralHue', SHADE - 400, props.theme);
|
|
547
547
|
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({
|
|
548
548
|
theme: props.theme,
|
|
549
549
|
styles: {
|
|
@@ -564,7 +564,7 @@ const sizeStyles$9 = props => {
|
|
|
564
564
|
};
|
|
565
565
|
const StyledRadioInput = styled.input.attrs({
|
|
566
566
|
'data-garden-id': COMPONENT_ID$p,
|
|
567
|
-
'data-garden-version': '9.0.0-next.
|
|
567
|
+
'data-garden-version': '9.0.0-next.6',
|
|
568
568
|
type: 'radio'
|
|
569
569
|
}).withConfig({
|
|
570
570
|
displayName: "StyledRadioInput",
|
|
@@ -577,16 +577,16 @@ StyledRadioInput.defaultProps = {
|
|
|
577
577
|
const COMPONENT_ID$o = 'forms.checkbox';
|
|
578
578
|
const colorStyles$6 = props => {
|
|
579
579
|
const SHADE = 600;
|
|
580
|
-
const indeterminateBorderColor =
|
|
580
|
+
const indeterminateBorderColor = getColorV8('primaryHue', SHADE, props.theme);
|
|
581
581
|
const indeterminateBackgroundColor = indeterminateBorderColor;
|
|
582
|
-
const indeterminateActiveBorderColor =
|
|
582
|
+
const indeterminateActiveBorderColor = getColorV8('primaryHue', SHADE + 100, props.theme);
|
|
583
583
|
const indeterminateActiveBackgroundColor = indeterminateActiveBorderColor;
|
|
584
|
-
const indeterminateDisabledBackgroundColor =
|
|
584
|
+
const indeterminateDisabledBackgroundColor = getColorV8('neutralHue', SHADE - 400, props.theme);
|
|
585
585
|
return 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);
|
|
586
586
|
};
|
|
587
587
|
const StyledCheckInput = styled(StyledRadioInput).attrs({
|
|
588
588
|
'data-garden-id': COMPONENT_ID$o,
|
|
589
|
-
'data-garden-version': '9.0.0-next.
|
|
589
|
+
'data-garden-version': '9.0.0-next.6',
|
|
590
590
|
type: 'checkbox'
|
|
591
591
|
}).withConfig({
|
|
592
592
|
displayName: "StyledCheckInput",
|
|
@@ -599,7 +599,7 @@ StyledCheckInput.defaultProps = {
|
|
|
599
599
|
const COMPONENT_ID$n = 'forms.radio_message';
|
|
600
600
|
const StyledRadioMessage = styled(StyledMessage).attrs({
|
|
601
601
|
'data-garden-id': COMPONENT_ID$n,
|
|
602
|
-
'data-garden-version': '9.0.0-next.
|
|
602
|
+
'data-garden-version': '9.0.0-next.6'
|
|
603
603
|
}).withConfig({
|
|
604
604
|
displayName: "StyledRadioMessage",
|
|
605
605
|
componentId: "sc-1pmi0q8-0"
|
|
@@ -611,7 +611,7 @@ StyledRadioMessage.defaultProps = {
|
|
|
611
611
|
const COMPONENT_ID$m = 'forms.checkbox_message';
|
|
612
612
|
const StyledCheckMessage = styled(StyledRadioMessage).attrs({
|
|
613
613
|
'data-garden-id': COMPONENT_ID$m,
|
|
614
|
-
'data-garden-version': '9.0.0-next.
|
|
614
|
+
'data-garden-version': '9.0.0-next.6'
|
|
615
615
|
}).withConfig({
|
|
616
616
|
displayName: "StyledCheckMessage",
|
|
617
617
|
componentId: "sc-s4p6kd-0"
|
|
@@ -643,7 +643,7 @@ var SvgCheckSmFill = function SvgCheckSmFill(props) {
|
|
|
643
643
|
const COMPONENT_ID$l = 'forms.check_svg';
|
|
644
644
|
const StyledCheckSvg = styled(SvgCheckSmFill).attrs({
|
|
645
645
|
'data-garden-id': COMPONENT_ID$l,
|
|
646
|
-
'data-garden-version': '9.0.0-next.
|
|
646
|
+
'data-garden-version': '9.0.0-next.6'
|
|
647
647
|
}).withConfig({
|
|
648
648
|
displayName: "StyledCheckSvg",
|
|
649
649
|
componentId: "sc-fvxetk-0"
|
|
@@ -673,7 +673,7 @@ var SvgDashFill = function SvgDashFill(props) {
|
|
|
673
673
|
const COMPONENT_ID$k = 'forms.dash_svg';
|
|
674
674
|
const StyledDashSvg = styled(SvgDashFill).attrs({
|
|
675
675
|
'data-garden-id': COMPONENT_ID$k,
|
|
676
|
-
'data-garden-version': '9.0.0-next.
|
|
676
|
+
'data-garden-version': '9.0.0-next.6'
|
|
677
677
|
}).withConfig({
|
|
678
678
|
displayName: "StyledDashSvg",
|
|
679
679
|
componentId: "sc-z3vq71-0"
|
|
@@ -684,12 +684,12 @@ StyledDashSvg.defaultProps = {
|
|
|
684
684
|
|
|
685
685
|
const COMPONENT_ID$j = 'forms.file_upload';
|
|
686
686
|
const colorStyles$5 = props => {
|
|
687
|
-
const baseColor =
|
|
688
|
-
const hoverColor =
|
|
689
|
-
const activeColor =
|
|
690
|
-
const disabledBackgroundColor =
|
|
691
|
-
const disabledForegroundColor =
|
|
692
|
-
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 :
|
|
687
|
+
const baseColor = getColorV8('primaryHue', 600, props.theme);
|
|
688
|
+
const hoverColor = getColorV8('primaryHue', 700, props.theme);
|
|
689
|
+
const activeColor = getColorV8('primaryHue', 800, props.theme);
|
|
690
|
+
const disabledBackgroundColor = getColorV8('neutralHue', 200, props.theme);
|
|
691
|
+
const disabledForegroundColor = getColorV8('neutralHue', 400, props.theme);
|
|
692
|
+
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 : getColorV8('neutralHue', 600, props.theme), props.isDragging && rgba(baseColor, 0.2), props.isDragging ? activeColor : baseColor, hoverColor, rgba(baseColor, 0.08), hoverColor, focusStyles({
|
|
693
693
|
theme: props.theme,
|
|
694
694
|
hue: baseColor
|
|
695
695
|
}), activeColor, rgba(baseColor, 0.2), activeColor, disabledForegroundColor, disabledBackgroundColor, disabledForegroundColor);
|
|
@@ -704,7 +704,7 @@ const sizeStyles$8 = props => {
|
|
|
704
704
|
};
|
|
705
705
|
const StyledFileUpload = styled.div.attrs({
|
|
706
706
|
'data-garden-id': COMPONENT_ID$j,
|
|
707
|
-
'data-garden-version': '9.0.0-next.
|
|
707
|
+
'data-garden-version': '9.0.0-next.6'
|
|
708
708
|
}).withConfig({
|
|
709
709
|
displayName: "StyledFileUpload",
|
|
710
710
|
componentId: "sc-1rodjgn-0"
|
|
@@ -716,11 +716,11 @@ StyledFileUpload.defaultProps = {
|
|
|
716
716
|
const COMPONENT_ID$i = 'forms.file.close';
|
|
717
717
|
const StyledFileClose = styled.button.attrs({
|
|
718
718
|
'data-garden-id': COMPONENT_ID$i,
|
|
719
|
-
'data-garden-version': '9.0.0-next.
|
|
719
|
+
'data-garden-version': '9.0.0-next.6'
|
|
720
720
|
}).withConfig({
|
|
721
721
|
displayName: "StyledFileClose",
|
|
722
722
|
componentId: "sc-1m31jbf-0"
|
|
723
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;border:none;background:transparent;cursor:pointer;color:", ";appearance:none;&:hover{opacity:0.9;}&:focus{outline:none;}", ";"], props => props.theme
|
|
723
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;border:none;background:transparent;cursor:pointer;color:", ";appearance:none;&:hover{opacity:0.9;}&:focus{outline:none;}", ";"], props => getColorV8('foreground', 600 , props.theme), props => retrieveComponentStyles(COMPONENT_ID$i, props));
|
|
724
724
|
StyledFileClose.defaultProps = {
|
|
725
725
|
theme: DEFAULT_THEME
|
|
726
726
|
};
|
|
@@ -731,17 +731,17 @@ const colorStyles$4 = props => {
|
|
|
731
731
|
let focusBorderColor;
|
|
732
732
|
let foregroundColor;
|
|
733
733
|
if (props.validation === 'success') {
|
|
734
|
-
borderColor =
|
|
734
|
+
borderColor = getColorV8('successHue', 600, props.theme);
|
|
735
735
|
focusBorderColor = borderColor;
|
|
736
736
|
foregroundColor = borderColor;
|
|
737
737
|
} else if (props.validation === 'error') {
|
|
738
|
-
borderColor =
|
|
738
|
+
borderColor = getColorV8('dangerHue', 600, props.theme);
|
|
739
739
|
focusBorderColor = borderColor;
|
|
740
740
|
foregroundColor = borderColor;
|
|
741
741
|
} else {
|
|
742
|
-
borderColor =
|
|
743
|
-
focusBorderColor =
|
|
744
|
-
foregroundColor = props.theme
|
|
742
|
+
borderColor = getColorV8('neutralHue', 300, props.theme);
|
|
743
|
+
focusBorderColor = getColorV8('primaryHue', 600, props.theme);
|
|
744
|
+
foregroundColor = getColorV8('foreground', 600 , props.theme);
|
|
745
745
|
}
|
|
746
746
|
return css(["border-color:", ";color:", ";", ""], borderColor, foregroundColor, focusStyles({
|
|
747
747
|
theme: props.theme,
|
|
@@ -779,7 +779,7 @@ const sizeStyles$7 = props => {
|
|
|
779
779
|
};
|
|
780
780
|
const StyledFile = styled.div.attrs({
|
|
781
781
|
'data-garden-id': COMPONENT_ID$h,
|
|
782
|
-
'data-garden-version': '9.0.0-next.
|
|
782
|
+
'data-garden-version': '9.0.0-next.6'
|
|
783
783
|
}).withConfig({
|
|
784
784
|
displayName: "StyledFile",
|
|
785
785
|
componentId: "sc-195lzp1-0"
|
|
@@ -791,11 +791,11 @@ StyledFile.defaultProps = {
|
|
|
791
791
|
const COMPONENT_ID$g = 'forms.file.delete';
|
|
792
792
|
const StyledFileDelete = styled(StyledFileClose).attrs({
|
|
793
793
|
'data-garden-id': COMPONENT_ID$g,
|
|
794
|
-
'data-garden-version': '9.0.0-next.
|
|
794
|
+
'data-garden-version': '9.0.0-next.6'
|
|
795
795
|
}).withConfig({
|
|
796
796
|
displayName: "StyledFileDelete",
|
|
797
797
|
componentId: "sc-a8nnhx-0"
|
|
798
|
-
})(["color:", ";", ";"], props =>
|
|
798
|
+
})(["color:", ";", ";"], props => getColorV8('dangerHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID$g, props));
|
|
799
799
|
StyledFileDelete.defaultProps = {
|
|
800
800
|
theme: DEFAULT_THEME
|
|
801
801
|
};
|
|
@@ -811,7 +811,7 @@ const StyledFileIcon = styled(_ref => {
|
|
|
811
811
|
return React__default.cloneElement(Children.only(children), props);
|
|
812
812
|
}).attrs({
|
|
813
813
|
'data-garden-id': COMPONENT_ID$f,
|
|
814
|
-
'data-garden-version': '9.0.0-next.
|
|
814
|
+
'data-garden-version': '9.0.0-next.6'
|
|
815
815
|
}).withConfig({
|
|
816
816
|
displayName: "StyledFileIcon",
|
|
817
817
|
componentId: "sc-7b3q0c-0"
|
|
@@ -823,7 +823,7 @@ StyledFileIcon.defaultProps = {
|
|
|
823
823
|
const COMPONENT_ID$e = 'forms.file_list';
|
|
824
824
|
const StyledFileList = styled.ul.attrs({
|
|
825
825
|
'data-garden-id': COMPONENT_ID$e,
|
|
826
|
-
'data-garden-version': '9.0.0-next.
|
|
826
|
+
'data-garden-version': '9.0.0-next.6'
|
|
827
827
|
}).withConfig({
|
|
828
828
|
displayName: "StyledFileList",
|
|
829
829
|
componentId: "sc-gbahjg-0"
|
|
@@ -835,7 +835,7 @@ StyledFileList.defaultProps = {
|
|
|
835
835
|
const COMPONENT_ID$d = 'forms.file_list.item';
|
|
836
836
|
const StyledFileListItem = styled.li.attrs({
|
|
837
837
|
'data-garden-id': COMPONENT_ID$d,
|
|
838
|
-
'data-garden-version': '9.0.0-next.
|
|
838
|
+
'data-garden-version': '9.0.0-next.6'
|
|
839
839
|
}).withConfig({
|
|
840
840
|
displayName: "StyledFileListItem",
|
|
841
841
|
componentId: "sc-1ova3lo-0"
|
|
@@ -865,7 +865,7 @@ var SvgCircleSmFill$1 = function SvgCircleSmFill(props) {
|
|
|
865
865
|
const COMPONENT_ID$c = 'forms.radio_svg';
|
|
866
866
|
const StyledRadioSvg = styled(SvgCircleSmFill$1).attrs({
|
|
867
867
|
'data-garden-id': COMPONENT_ID$c,
|
|
868
|
-
'data-garden-version': '9.0.0-next.
|
|
868
|
+
'data-garden-version': '9.0.0-next.6'
|
|
869
869
|
}).withConfig({
|
|
870
870
|
displayName: "StyledRadioSvg",
|
|
871
871
|
componentId: "sc-1r1qtr1-0"
|
|
@@ -882,7 +882,7 @@ const sizeStyles$6 = props => {
|
|
|
882
882
|
};
|
|
883
883
|
const StyledToggleLabel = styled(StyledCheckLabel).attrs({
|
|
884
884
|
'data-garden-id': COMPONENT_ID$b,
|
|
885
|
-
'data-garden-version': '9.0.0-next.
|
|
885
|
+
'data-garden-version': '9.0.0-next.6'
|
|
886
886
|
}).withConfig({
|
|
887
887
|
displayName: "StyledToggleLabel",
|
|
888
888
|
componentId: "sc-e0asdk-0"
|
|
@@ -894,7 +894,7 @@ StyledToggleLabel.defaultProps = {
|
|
|
894
894
|
const COMPONENT_ID$a = 'forms.toggle_hint';
|
|
895
895
|
const StyledToggleHint = styled(StyledHint).attrs({
|
|
896
896
|
'data-garden-id': COMPONENT_ID$a,
|
|
897
|
-
'data-garden-version': '9.0.0-next.
|
|
897
|
+
'data-garden-version': '9.0.0-next.6'
|
|
898
898
|
}).withConfig({
|
|
899
899
|
displayName: "StyledToggleHint",
|
|
900
900
|
componentId: "sc-nziggu-0"
|
|
@@ -906,9 +906,9 @@ StyledToggleHint.defaultProps = {
|
|
|
906
906
|
const COMPONENT_ID$9 = 'forms.toggle';
|
|
907
907
|
const colorStyles$3 = props => {
|
|
908
908
|
const SHADE = 600;
|
|
909
|
-
const backgroundColor =
|
|
910
|
-
const hoverBackgroundColor =
|
|
911
|
-
const activeBackgroundColor =
|
|
909
|
+
const backgroundColor = getColorV8('neutralHue', SHADE - 100, props.theme);
|
|
910
|
+
const hoverBackgroundColor = getColorV8('neutralHue', SHADE, props.theme);
|
|
911
|
+
const activeBackgroundColor = getColorV8('neutralHue', SHADE + 100, props.theme);
|
|
912
912
|
return css(["& ~ ", "::before{background-color:", ";}&:enabled ~ ", ":hover::before{background-color:", ";}&:enabled ~ ", ":active::before{background-color:", ";}"], StyledToggleLabel, backgroundColor, StyledToggleLabel, hoverBackgroundColor, StyledToggleLabel, activeBackgroundColor);
|
|
913
913
|
};
|
|
914
914
|
const sizeStyles$5 = props => {
|
|
@@ -921,7 +921,7 @@ const sizeStyles$5 = props => {
|
|
|
921
921
|
};
|
|
922
922
|
const StyledToggleInput = styled(StyledCheckInput).attrs({
|
|
923
923
|
'data-garden-id': COMPONENT_ID$9,
|
|
924
|
-
'data-garden-version': '9.0.0-next.
|
|
924
|
+
'data-garden-version': '9.0.0-next.6'
|
|
925
925
|
}).withConfig({
|
|
926
926
|
displayName: "StyledToggleInput",
|
|
927
927
|
componentId: "sc-sgp47s-0"
|
|
@@ -933,7 +933,7 @@ StyledToggleInput.defaultProps = {
|
|
|
933
933
|
const COMPONENT_ID$8 = 'forms.toggle_message';
|
|
934
934
|
const StyledToggleMessage = styled(StyledMessage).attrs({
|
|
935
935
|
'data-garden-id': COMPONENT_ID$8,
|
|
936
|
-
'data-garden-version': '9.0.0-next.
|
|
936
|
+
'data-garden-version': '9.0.0-next.6'
|
|
937
937
|
}).withConfig({
|
|
938
938
|
displayName: "StyledToggleMessage",
|
|
939
939
|
componentId: "sc-13vuvl1-0"
|
|
@@ -963,7 +963,7 @@ var SvgCircleSmFill = function SvgCircleSmFill(props) {
|
|
|
963
963
|
const COMPONENT_ID$7 = 'forms.toggle_svg';
|
|
964
964
|
const StyledToggleSvg = styled(SvgCircleSmFill).attrs({
|
|
965
965
|
'data-garden-id': COMPONENT_ID$7,
|
|
966
|
-
'data-garden-version': '9.0.0-next.
|
|
966
|
+
'data-garden-version': '9.0.0-next.6'
|
|
967
967
|
}).withConfig({
|
|
968
968
|
displayName: "StyledToggleSvg",
|
|
969
969
|
componentId: "sc-162xbyx-0"
|
|
@@ -974,7 +974,7 @@ StyledToggleSvg.defaultProps = {
|
|
|
974
974
|
|
|
975
975
|
const COMPONENT_ID$6 = 'forms.select';
|
|
976
976
|
const colorStyles$2 = props => {
|
|
977
|
-
const color =
|
|
977
|
+
const color = getColorV8('neutralHue', 700, props.theme);
|
|
978
978
|
return css(["&:hover + ", ",&:focus + ", ",&:focus-visible + ", ",&[data-garden-focus-visible='true'] + ", "{color:", ";}"], StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, color);
|
|
979
979
|
};
|
|
980
980
|
const sizeStyles$4 = props => {
|
|
@@ -985,12 +985,12 @@ const sizeStyles$4 = props => {
|
|
|
985
985
|
};
|
|
986
986
|
const StyledSelect = styled(StyledTextInput).attrs({
|
|
987
987
|
'data-garden-id': COMPONENT_ID$6,
|
|
988
|
-
'data-garden-version': '9.0.0-next.
|
|
988
|
+
'data-garden-version': '9.0.0-next.6',
|
|
989
989
|
as: 'select'
|
|
990
990
|
}).withConfig({
|
|
991
991
|
displayName: "StyledSelect",
|
|
992
992
|
componentId: "sc-8xdxpt-0"
|
|
993
|
-
})(["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$4(props), props => colorStyles$2(props), props => props.theme
|
|
993
|
+
})(["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$4(props), props => colorStyles$2(props), props => getColorV8('foreground', 600 , props.theme), StyledTextMediaFigure);
|
|
994
994
|
StyledSelect.defaultProps = {
|
|
995
995
|
theme: DEFAULT_THEME
|
|
996
996
|
};
|
|
@@ -998,7 +998,7 @@ StyledSelect.defaultProps = {
|
|
|
998
998
|
const COMPONENT_ID$5 = 'forms.select_wrapper';
|
|
999
999
|
const StyledSelectWrapper = styled(StyledTextFauxInput).attrs({
|
|
1000
1000
|
'data-garden-id': COMPONENT_ID$5,
|
|
1001
|
-
'data-garden-version': '9.0.0-next.
|
|
1001
|
+
'data-garden-version': '9.0.0-next.6'
|
|
1002
1002
|
}).withConfig({
|
|
1003
1003
|
displayName: "StyledSelectWrapper",
|
|
1004
1004
|
componentId: "sc-i7b6hw-0"
|
|
@@ -1054,19 +1054,19 @@ const trackLowerStyles = function (styles) {
|
|
|
1054
1054
|
};
|
|
1055
1055
|
const colorStyles$1 = props => {
|
|
1056
1056
|
const SHADE = 600;
|
|
1057
|
-
const thumbBackgroundColor =
|
|
1057
|
+
const thumbBackgroundColor = getColorV8('primaryHue', SHADE, props.theme);
|
|
1058
1058
|
const thumbBorderColor = thumbBackgroundColor;
|
|
1059
|
-
const thumbBoxShadow = props.theme.shadows.lg(math(`${props.theme.space.base} * 1px`), math(`${props.theme.space.base} * 2px`),
|
|
1059
|
+
const thumbBoxShadow = props.theme.shadows.lg(math(`${props.theme.space.base} * 1px`), math(`${props.theme.space.base} * 2px`), getColorV8('neutralHue', SHADE + 200, props.theme, 0.24));
|
|
1060
1060
|
const thumbFocusBoxShadow = getFocusBoxShadow({
|
|
1061
1061
|
theme: props.theme
|
|
1062
1062
|
});
|
|
1063
|
-
const thumbActiveBackgroundColor =
|
|
1063
|
+
const thumbActiveBackgroundColor = getColorV8('primaryHue', SHADE + 100, props.theme);
|
|
1064
1064
|
const thumbActiveBorderColor = thumbBorderColor;
|
|
1065
|
-
const thumbDisabledBackgroundColor =
|
|
1065
|
+
const thumbDisabledBackgroundColor = getColorV8('neutralHue', SHADE - 300, props.theme);
|
|
1066
1066
|
const thumbDisabledBorderColor = thumbDisabledBackgroundColor;
|
|
1067
1067
|
const thumbHoverBackgroundColor = thumbActiveBackgroundColor;
|
|
1068
1068
|
const thumbHoverBorderColor = thumbHoverBackgroundColor;
|
|
1069
|
-
const trackBackgroundColor =
|
|
1069
|
+
const trackBackgroundColor = getColorV8('neutralHue', SHADE - 400, props.theme);
|
|
1070
1070
|
const trackLowerBackgroundColor = props.hasLowerTrack ? thumbBackgroundColor : '';
|
|
1071
1071
|
const trackBackgroundImage = props.hasLowerTrack ? `linear-gradient(${trackLowerBackgroundColor}, ${trackLowerBackgroundColor})` : '';
|
|
1072
1072
|
const trackDisabledLowerBackgroundColor = props.hasLowerTrack ? thumbDisabledBackgroundColor : '';
|
|
@@ -1123,7 +1123,7 @@ const sizeStyles$3 = props => {
|
|
|
1123
1123
|
};
|
|
1124
1124
|
const StyledRangeInput = styled.input.attrs(props => ({
|
|
1125
1125
|
'data-garden-id': COMPONENT_ID$4,
|
|
1126
|
-
'data-garden-version': '9.0.0-next.
|
|
1126
|
+
'data-garden-version': '9.0.0-next.6',
|
|
1127
1127
|
type: 'range',
|
|
1128
1128
|
style: {
|
|
1129
1129
|
backgroundSize: props.hasLowerTrack && props.backgroundSize
|
|
@@ -1171,7 +1171,7 @@ const sizeStyles$2 = props => {
|
|
|
1171
1171
|
};
|
|
1172
1172
|
const StyledTileIcon = styled.span.attrs({
|
|
1173
1173
|
'data-garden-id': COMPONENT_ID$3,
|
|
1174
|
-
'data-garden-version': '9.0.0-next.
|
|
1174
|
+
'data-garden-version': '9.0.0-next.6'
|
|
1175
1175
|
}).withConfig({
|
|
1176
1176
|
displayName: "StyledTileIcon",
|
|
1177
1177
|
componentId: "sc-1wazhg4-0"
|
|
@@ -1183,36 +1183,36 @@ StyledTileIcon.defaultProps = {
|
|
|
1183
1183
|
const COMPONENT_ID$2 = 'forms.tile';
|
|
1184
1184
|
const colorStyles = props => {
|
|
1185
1185
|
const SHADE = 600;
|
|
1186
|
-
const iconColor =
|
|
1187
|
-
const color =
|
|
1188
|
-
const borderColor =
|
|
1189
|
-
const hoverBackgroundColor =
|
|
1190
|
-
const hoverBorderColor =
|
|
1186
|
+
const iconColor = getColorV8('neutralHue', SHADE, props.theme);
|
|
1187
|
+
const color = getColorV8('neutralHue', SHADE + 200, props.theme);
|
|
1188
|
+
const borderColor = getColorV8('neutralHue', SHADE - 300, props.theme);
|
|
1189
|
+
const hoverBackgroundColor = getColorV8('primaryHue', SHADE, props.theme, 0.08);
|
|
1190
|
+
const hoverBorderColor = getColorV8('primaryHue', SHADE, props.theme);
|
|
1191
1191
|
const focusBorderColor = hoverBorderColor;
|
|
1192
|
-
const activeBackgroundColor =
|
|
1192
|
+
const activeBackgroundColor = getColorV8('primaryHue', SHADE, props.theme, 0.2);
|
|
1193
1193
|
const activeBorderColor = focusBorderColor;
|
|
1194
|
-
const disabledBackgroundColor =
|
|
1195
|
-
const disabledBorderColor =
|
|
1196
|
-
const disabledColor =
|
|
1194
|
+
const disabledBackgroundColor = getColorV8('neutralHue', SHADE - 500, props.theme);
|
|
1195
|
+
const disabledBorderColor = getColorV8('neutralHue', SHADE - 400, props.theme);
|
|
1196
|
+
const disabledColor = getColorV8('neutralHue', SHADE - 200, props.theme);
|
|
1197
1197
|
const selectedBorderColor = focusBorderColor;
|
|
1198
1198
|
const selectedBackgroundColor = selectedBorderColor;
|
|
1199
|
-
const selectedHoverBorderColor =
|
|
1199
|
+
const selectedHoverBorderColor = getColorV8('primaryHue', SHADE + 100, props.theme);
|
|
1200
1200
|
const selectedHoverBackgroundColor = selectedHoverBorderColor;
|
|
1201
|
-
const selectedActiveBorderColor =
|
|
1201
|
+
const selectedActiveBorderColor = getColorV8('primaryHue', SHADE + 200, props.theme);
|
|
1202
1202
|
const selectedActiveBackgroundColor = selectedActiveBorderColor;
|
|
1203
1203
|
const selectedDisabledBackgroundColor = disabledBorderColor;
|
|
1204
|
-
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,
|
|
1204
|
+
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, getColorV8('neutralHue', SHADE - 300, props.theme), borderColor, getColorV8('background', 600 , props.theme), color, StyledTileIcon, iconColor, hoverBorderColor, hoverBackgroundColor, StyledTileIcon, color, focusStyles({
|
|
1205
1205
|
theme: props.theme,
|
|
1206
1206
|
hue: focusBorderColor,
|
|
1207
1207
|
styles: {
|
|
1208
1208
|
borderColor: focusBorderColor
|
|
1209
1209
|
},
|
|
1210
1210
|
selector: `&:focus-within`
|
|
1211
|
-
}), activeBorderColor, activeBackgroundColor, StyledTileIcon, color, selectedBorderColor, selectedBackgroundColor, props.theme
|
|
1211
|
+
}), activeBorderColor, activeBackgroundColor, StyledTileIcon, color, selectedBorderColor, selectedBackgroundColor, getColorV8('background', 600 , props.theme), StyledTileIcon, getColorV8('background', 600 , props.theme), selectedHoverBorderColor, selectedHoverBackgroundColor, getColorV8('background', 600 , props.theme), StyledTileIcon, getColorV8('background', 600 , props.theme), selectedActiveBorderColor, selectedActiveBackgroundColor, getColorV8('background', 600 , props.theme), StyledTileIcon, getColorV8('background', 600 , props.theme), disabledBorderColor, disabledBackgroundColor, disabledColor, StyledTileIcon, disabledColor, selectedDisabledBackgroundColor, disabledColor, StyledTileIcon, disabledColor);
|
|
1212
1212
|
};
|
|
1213
1213
|
const StyledTile = styled.label.attrs(props => ({
|
|
1214
1214
|
'data-garden-id': COMPONENT_ID$2,
|
|
1215
|
-
'data-garden-version': '9.0.0-next.
|
|
1215
|
+
'data-garden-version': '9.0.0-next.6',
|
|
1216
1216
|
'data-garden-selected': props.isSelected
|
|
1217
1217
|
})).withConfig({
|
|
1218
1218
|
displayName: "StyledTile",
|
|
@@ -1236,7 +1236,7 @@ const sizeStyles$1 = props => {
|
|
|
1236
1236
|
};
|
|
1237
1237
|
const StyledTileDescription = styled.span.attrs({
|
|
1238
1238
|
'data-garden-id': COMPONENT_ID$1,
|
|
1239
|
-
'data-garden-version': '9.0.0-next.
|
|
1239
|
+
'data-garden-version': '9.0.0-next.6'
|
|
1240
1240
|
}).withConfig({
|
|
1241
1241
|
displayName: "StyledTileDescription",
|
|
1242
1242
|
componentId: "sc-xfuu7u-0"
|
|
@@ -1269,7 +1269,7 @@ const sizeStyles = props => {
|
|
|
1269
1269
|
};
|
|
1270
1270
|
const StyledTileLabel = styled.span.attrs({
|
|
1271
1271
|
'data-garden-id': COMPONENT_ID,
|
|
1272
|
-
'data-garden-version': '9.0.0-next.
|
|
1272
|
+
'data-garden-version': '9.0.0-next.6'
|
|
1273
1273
|
}).withConfig({
|
|
1274
1274
|
displayName: "StyledTileLabel",
|
|
1275
1275
|
componentId: "sc-1mypv27-0"
|
|
@@ -1278,73 +1278,6 @@ StyledTileLabel.defaultProps = {
|
|
|
1278
1278
|
theme: DEFAULT_THEME
|
|
1279
1279
|
};
|
|
1280
1280
|
|
|
1281
|
-
const Field = React__default.forwardRef((props, ref) => {
|
|
1282
|
-
const [hasHint, setHasHint] = useState(false);
|
|
1283
|
-
const [hasMessage, setHasMessage] = useState(false);
|
|
1284
|
-
const [isLabelActive, setIsLabelActive] = useState(false);
|
|
1285
|
-
const [isLabelHovered, setIsLabelHovered] = useState(false);
|
|
1286
|
-
const {
|
|
1287
|
-
getInputProps,
|
|
1288
|
-
getMessageProps,
|
|
1289
|
-
...propGetters
|
|
1290
|
-
} = useField({
|
|
1291
|
-
idPrefix: props.id,
|
|
1292
|
-
hasHint,
|
|
1293
|
-
hasMessage
|
|
1294
|
-
});
|
|
1295
|
-
const fieldProps = useMemo(() => ({
|
|
1296
|
-
...propGetters,
|
|
1297
|
-
getInputProps,
|
|
1298
|
-
getMessageProps,
|
|
1299
|
-
isLabelActive,
|
|
1300
|
-
setIsLabelActive,
|
|
1301
|
-
isLabelHovered,
|
|
1302
|
-
setIsLabelHovered,
|
|
1303
|
-
hasHint,
|
|
1304
|
-
setHasHint,
|
|
1305
|
-
hasMessage,
|
|
1306
|
-
setHasMessage
|
|
1307
|
-
}), [propGetters, getInputProps, getMessageProps, isLabelActive, isLabelHovered, hasHint, hasMessage]);
|
|
1308
|
-
return React__default.createElement(FieldContext.Provider, {
|
|
1309
|
-
value: fieldProps
|
|
1310
|
-
}, React__default.createElement(StyledField, _extends$t({}, props, {
|
|
1311
|
-
ref: ref
|
|
1312
|
-
})));
|
|
1313
|
-
});
|
|
1314
|
-
Field.displayName = 'Field';
|
|
1315
|
-
|
|
1316
|
-
const FieldsetContext = createContext(undefined);
|
|
1317
|
-
const useFieldsetContext = () => {
|
|
1318
|
-
const fieldsetContext = useContext(FieldsetContext);
|
|
1319
|
-
return fieldsetContext;
|
|
1320
|
-
};
|
|
1321
|
-
|
|
1322
|
-
const LegendComponent = forwardRef((props, ref) => {
|
|
1323
|
-
const fieldsetContext = useFieldsetContext();
|
|
1324
|
-
return React__default.createElement(StyledLegend, _extends$t({}, props, fieldsetContext, {
|
|
1325
|
-
ref: ref
|
|
1326
|
-
}));
|
|
1327
|
-
});
|
|
1328
|
-
LegendComponent.displayName = 'Fieldset.Legend';
|
|
1329
|
-
const Legend = LegendComponent;
|
|
1330
|
-
|
|
1331
|
-
const FieldsetComponent = forwardRef((props, ref) => {
|
|
1332
|
-
const fieldsetContext = useMemo(() => ({
|
|
1333
|
-
isCompact: props.isCompact
|
|
1334
|
-
}), [props.isCompact]);
|
|
1335
|
-
return React__default.createElement(FieldsetContext.Provider, {
|
|
1336
|
-
value: fieldsetContext
|
|
1337
|
-
}, React__default.createElement(StyledFieldset, _extends$t({}, props, {
|
|
1338
|
-
ref: ref
|
|
1339
|
-
})));
|
|
1340
|
-
});
|
|
1341
|
-
FieldsetComponent.displayName = 'Fieldset';
|
|
1342
|
-
FieldsetComponent.propTypes = {
|
|
1343
|
-
isCompact: PropTypes.bool
|
|
1344
|
-
};
|
|
1345
|
-
const Fieldset = FieldsetComponent;
|
|
1346
|
-
Fieldset.Legend = Legend;
|
|
1347
|
-
|
|
1348
1281
|
const InputContext = createContext(undefined);
|
|
1349
1282
|
const useInputContext = () => {
|
|
1350
1283
|
return useContext(InputContext);
|
|
@@ -1387,6 +1320,71 @@ const Hint = React__default.forwardRef((props, ref) => {
|
|
|
1387
1320
|
});
|
|
1388
1321
|
Hint.displayName = 'Hint';
|
|
1389
1322
|
|
|
1323
|
+
const VALIDATION = ['success', 'warning', 'error'];
|
|
1324
|
+
const FILE_VALIDATION = ['success', 'error'];
|
|
1325
|
+
const FILE_TYPE = ['pdf', 'zip', 'image', 'document', 'spreadsheet', 'presentation', 'generic'];
|
|
1326
|
+
|
|
1327
|
+
const Message = React__default.forwardRef((_ref, ref) => {
|
|
1328
|
+
let {
|
|
1329
|
+
validation,
|
|
1330
|
+
validationLabel,
|
|
1331
|
+
children,
|
|
1332
|
+
...props
|
|
1333
|
+
} = _ref;
|
|
1334
|
+
const {
|
|
1335
|
+
hasMessage,
|
|
1336
|
+
setHasMessage,
|
|
1337
|
+
getMessageProps
|
|
1338
|
+
} = useFieldContext() || {};
|
|
1339
|
+
const type = useInputContext();
|
|
1340
|
+
useEffect(() => {
|
|
1341
|
+
if (!hasMessage && setHasMessage) {
|
|
1342
|
+
setHasMessage(true);
|
|
1343
|
+
}
|
|
1344
|
+
return () => {
|
|
1345
|
+
if (hasMessage && setHasMessage) {
|
|
1346
|
+
setHasMessage(false);
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
}, [hasMessage, setHasMessage]);
|
|
1350
|
+
let MessageComponent;
|
|
1351
|
+
if (type === 'checkbox') {
|
|
1352
|
+
MessageComponent = StyledCheckMessage;
|
|
1353
|
+
} else if (type === 'radio') {
|
|
1354
|
+
MessageComponent = StyledRadioMessage;
|
|
1355
|
+
} else if (type === 'toggle') {
|
|
1356
|
+
MessageComponent = StyledToggleMessage;
|
|
1357
|
+
} else {
|
|
1358
|
+
MessageComponent = StyledMessage;
|
|
1359
|
+
}
|
|
1360
|
+
let combinedProps = {
|
|
1361
|
+
validation,
|
|
1362
|
+
validationLabel,
|
|
1363
|
+
...props
|
|
1364
|
+
};
|
|
1365
|
+
if (getMessageProps) {
|
|
1366
|
+
combinedProps = getMessageProps(combinedProps);
|
|
1367
|
+
}
|
|
1368
|
+
const ariaLabel = useText(Message, combinedProps, 'validationLabel', validation, validation !== undefined);
|
|
1369
|
+
return React__default.createElement(MessageComponent, _extends$t({
|
|
1370
|
+
ref: ref
|
|
1371
|
+
}, combinedProps), validation && React__default.createElement(StyledMessageIcon, {
|
|
1372
|
+
validation: validation,
|
|
1373
|
+
"aria-label": ariaLabel
|
|
1374
|
+
}), children);
|
|
1375
|
+
});
|
|
1376
|
+
Message.displayName = 'Message';
|
|
1377
|
+
Message.propTypes = {
|
|
1378
|
+
validation: PropTypes.oneOf(VALIDATION),
|
|
1379
|
+
validationLabel: PropTypes.string
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
const FieldsetContext = createContext(undefined);
|
|
1383
|
+
const useFieldsetContext = () => {
|
|
1384
|
+
const fieldsetContext = useContext(FieldsetContext);
|
|
1385
|
+
return fieldsetContext;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1390
1388
|
const Label$1 = React__default.forwardRef((props, ref) => {
|
|
1391
1389
|
const fieldContext = useFieldContext();
|
|
1392
1390
|
const fieldsetContext = useFieldsetContext();
|
|
@@ -1463,64 +1461,70 @@ Label$1.propTypes = {
|
|
|
1463
1461
|
isRegular: PropTypes.bool
|
|
1464
1462
|
};
|
|
1465
1463
|
|
|
1466
|
-
const
|
|
1467
|
-
const
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
const
|
|
1471
|
-
let {
|
|
1472
|
-
validation,
|
|
1473
|
-
validationLabel,
|
|
1474
|
-
children,
|
|
1475
|
-
...props
|
|
1476
|
-
} = _ref;
|
|
1464
|
+
const FieldComponent = React__default.forwardRef((props, ref) => {
|
|
1465
|
+
const [hasHint, setHasHint] = useState(false);
|
|
1466
|
+
const [hasMessage, setHasMessage] = useState(false);
|
|
1467
|
+
const [isLabelActive, setIsLabelActive] = useState(false);
|
|
1468
|
+
const [isLabelHovered, setIsLabelHovered] = useState(false);
|
|
1477
1469
|
const {
|
|
1470
|
+
getInputProps,
|
|
1471
|
+
getMessageProps,
|
|
1472
|
+
...propGetters
|
|
1473
|
+
} = useField({
|
|
1474
|
+
idPrefix: props.id,
|
|
1475
|
+
hasHint,
|
|
1476
|
+
hasMessage
|
|
1477
|
+
});
|
|
1478
|
+
const fieldProps = useMemo(() => ({
|
|
1479
|
+
...propGetters,
|
|
1480
|
+
getInputProps,
|
|
1481
|
+
getMessageProps,
|
|
1482
|
+
isLabelActive,
|
|
1483
|
+
setIsLabelActive,
|
|
1484
|
+
isLabelHovered,
|
|
1485
|
+
setIsLabelHovered,
|
|
1486
|
+
hasHint,
|
|
1487
|
+
setHasHint,
|
|
1478
1488
|
hasMessage,
|
|
1479
|
-
setHasMessage
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
if (!hasMessage && setHasMessage) {
|
|
1485
|
-
setHasMessage(true);
|
|
1486
|
-
}
|
|
1487
|
-
return () => {
|
|
1488
|
-
if (hasMessage && setHasMessage) {
|
|
1489
|
-
setHasMessage(false);
|
|
1490
|
-
}
|
|
1491
|
-
};
|
|
1492
|
-
}, [hasMessage, setHasMessage]);
|
|
1493
|
-
let MessageComponent;
|
|
1494
|
-
if (type === 'checkbox') {
|
|
1495
|
-
MessageComponent = StyledCheckMessage;
|
|
1496
|
-
} else if (type === 'radio') {
|
|
1497
|
-
MessageComponent = StyledRadioMessage;
|
|
1498
|
-
} else if (type === 'toggle') {
|
|
1499
|
-
MessageComponent = StyledToggleMessage;
|
|
1500
|
-
} else {
|
|
1501
|
-
MessageComponent = StyledMessage;
|
|
1502
|
-
}
|
|
1503
|
-
let combinedProps = {
|
|
1504
|
-
validation,
|
|
1505
|
-
validationLabel,
|
|
1506
|
-
...props
|
|
1507
|
-
};
|
|
1508
|
-
if (getMessageProps) {
|
|
1509
|
-
combinedProps = getMessageProps(combinedProps);
|
|
1510
|
-
}
|
|
1511
|
-
const ariaLabel = useText(Message, combinedProps, 'validationLabel', validation, validation !== undefined);
|
|
1512
|
-
return React__default.createElement(MessageComponent, _extends$t({
|
|
1489
|
+
setHasMessage
|
|
1490
|
+
}), [propGetters, getInputProps, getMessageProps, isLabelActive, isLabelHovered, hasHint, hasMessage]);
|
|
1491
|
+
return React__default.createElement(FieldContext.Provider, {
|
|
1492
|
+
value: fieldProps
|
|
1493
|
+
}, React__default.createElement(StyledField, _extends$t({}, props, {
|
|
1513
1494
|
ref: ref
|
|
1514
|
-
}
|
|
1515
|
-
validation: validation,
|
|
1516
|
-
"aria-label": ariaLabel
|
|
1517
|
-
}), children);
|
|
1495
|
+
})));
|
|
1518
1496
|
});
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1497
|
+
FieldComponent.displayName = 'Field';
|
|
1498
|
+
const Field = FieldComponent;
|
|
1499
|
+
Field.Hint = Hint;
|
|
1500
|
+
Field.Label = Label$1;
|
|
1501
|
+
Field.Message = Message;
|
|
1502
|
+
|
|
1503
|
+
const LegendComponent = forwardRef((props, ref) => {
|
|
1504
|
+
const fieldsetContext = useFieldsetContext();
|
|
1505
|
+
return React__default.createElement(StyledLegend, _extends$t({}, props, fieldsetContext, {
|
|
1506
|
+
ref: ref
|
|
1507
|
+
}));
|
|
1508
|
+
});
|
|
1509
|
+
LegendComponent.displayName = 'Fieldset.Legend';
|
|
1510
|
+
const Legend = LegendComponent;
|
|
1511
|
+
|
|
1512
|
+
const FieldsetComponent = forwardRef((props, ref) => {
|
|
1513
|
+
const fieldsetContext = useMemo(() => ({
|
|
1514
|
+
isCompact: props.isCompact
|
|
1515
|
+
}), [props.isCompact]);
|
|
1516
|
+
return React__default.createElement(FieldsetContext.Provider, {
|
|
1517
|
+
value: fieldsetContext
|
|
1518
|
+
}, React__default.createElement(StyledFieldset, _extends$t({}, props, {
|
|
1519
|
+
ref: ref
|
|
1520
|
+
})));
|
|
1521
|
+
});
|
|
1522
|
+
FieldsetComponent.displayName = 'Fieldset';
|
|
1523
|
+
FieldsetComponent.propTypes = {
|
|
1524
|
+
isCompact: PropTypes.bool
|
|
1523
1525
|
};
|
|
1526
|
+
const Fieldset = FieldsetComponent;
|
|
1527
|
+
Fieldset.Legend = Legend;
|
|
1524
1528
|
|
|
1525
1529
|
const Checkbox = React__default.forwardRef((_ref, ref) => {
|
|
1526
1530
|
let {
|
|
@@ -2706,8 +2710,8 @@ MediaInput.propTypes = {
|
|
|
2706
2710
|
isBare: PropTypes.bool,
|
|
2707
2711
|
focusInset: PropTypes.bool,
|
|
2708
2712
|
validation: PropTypes.oneOf(VALIDATION),
|
|
2709
|
-
start: PropTypes.
|
|
2710
|
-
end: PropTypes.
|
|
2713
|
+
start: PropTypes.any,
|
|
2714
|
+
end: PropTypes.any,
|
|
2711
2715
|
wrapperProps: PropTypes.object,
|
|
2712
2716
|
wrapperRef: PropTypes.any
|
|
2713
2717
|
};
|