@zendeskgarden/react-forms 9.0.0 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +176 -0
- package/dist/esm/elements/Checkbox.js +4 -3
- package/dist/esm/elements/FileUpload.js +7 -3
- package/dist/esm/elements/Input.js +18 -17
- package/dist/esm/elements/Radio.js +4 -3
- package/dist/esm/elements/Range.js +9 -9
- package/dist/esm/elements/Select.js +9 -9
- package/dist/esm/elements/Textarea.js +23 -13
- package/dist/esm/elements/Toggle.js +4 -3
- package/dist/esm/elements/common/Fieldset.js +10 -5
- package/dist/esm/elements/common/Label.js +33 -31
- package/dist/esm/elements/common/Legend.js +1 -3
- package/dist/esm/elements/common/Message.js +6 -5
- package/dist/esm/elements/common/MessageIcon.js +78 -0
- package/dist/esm/elements/faux-input/FauxInput.js +20 -8
- package/dist/esm/elements/file-list/components/File.js +3 -3
- package/dist/esm/elements/input-group/InputGroup.js +3 -3
- package/dist/esm/elements/tiles/components/Description.js +1 -1
- package/dist/esm/elements/tiles/components/Icon.js +1 -1
- package/dist/esm/elements/tiles/components/Label.js +1 -1
- package/dist/esm/styled/checkbox/StyledCheckHint.js +1 -1
- package/dist/esm/styled/checkbox/StyledCheckInput.js +1 -1
- package/dist/esm/styled/checkbox/StyledCheckLabel.js +1 -1
- package/dist/esm/styled/checkbox/StyledCheckMessage.js +1 -1
- package/dist/esm/styled/checkbox/StyledCheckSvg.js +1 -1
- package/dist/esm/styled/checkbox/StyledDashSvg.js +1 -1
- package/dist/esm/styled/common/StyledField.js +1 -1
- package/dist/esm/styled/common/StyledFieldset.js +2 -2
- package/dist/esm/styled/common/StyledHint.js +1 -1
- package/dist/esm/styled/common/StyledLabel.js +2 -2
- package/dist/esm/styled/common/StyledLegend.js +1 -1
- package/dist/esm/styled/common/StyledMessage.js +7 -7
- package/dist/esm/styled/common/StyledMessageIcon.js +3 -27
- package/dist/esm/styled/file-list/StyledFile.js +9 -9
- package/dist/esm/styled/file-list/StyledFileClose.js +1 -1
- package/dist/esm/styled/file-list/StyledFileDelete.js +1 -1
- package/dist/esm/styled/file-list/StyledFileIcon.js +1 -1
- package/dist/esm/styled/file-list/StyledFileList.js +1 -1
- package/dist/esm/styled/file-list/StyledFileListItem.js +1 -1
- package/dist/esm/styled/file-upload/StyledFileUpload.js +7 -7
- package/dist/esm/styled/input-group/StyledInputGroup.js +2 -2
- package/dist/esm/styled/radio/StyledRadioHint.js +1 -1
- package/dist/esm/styled/radio/StyledRadioInput.js +3 -3
- package/dist/esm/styled/radio/StyledRadioLabel.js +2 -2
- package/dist/esm/styled/radio/StyledRadioMessage.js +1 -1
- package/dist/esm/styled/radio/StyledRadioSvg.js +1 -1
- package/dist/esm/styled/range/StyledRangeInput.js +9 -9
- package/dist/esm/styled/select/StyledSelect.js +6 -6
- package/dist/esm/styled/select/StyledSelectWrapper.js +3 -3
- package/dist/esm/styled/text/StyledTextFauxInput.js +15 -15
- package/dist/esm/styled/text/StyledTextInput.js +22 -22
- package/dist/esm/styled/text/StyledTextMediaFigure.js +1 -1
- package/dist/esm/styled/text/StyledTextMediaInput.js +2 -2
- package/dist/esm/styled/text/StyledTextarea.js +2 -2
- package/dist/esm/styled/tiles/StyledTile.js +1 -1
- package/dist/esm/styled/tiles/StyledTileDescription.js +4 -4
- package/dist/esm/styled/tiles/StyledTileIcon.js +3 -3
- package/dist/esm/styled/tiles/StyledTileLabel.js +5 -5
- package/dist/esm/styled/toggle/StyledToggleHint.js +1 -1
- package/dist/esm/styled/toggle/StyledToggleInput.js +1 -1
- package/dist/esm/styled/toggle/StyledToggleLabel.js +1 -1
- package/dist/esm/styled/toggle/StyledToggleMessage.js +1 -1
- package/dist/esm/styled/toggle/StyledToggleSvg.js +1 -1
- package/dist/index.cjs.js +401 -365
- package/dist/typings/elements/common/MessageIcon.d.ts +9 -0
- package/dist/typings/styled/checkbox/StyledCheckLabel.d.ts +2 -2
- package/dist/typings/styled/common/StyledFieldset.d.ts +1 -1
- package/dist/typings/styled/common/StyledLabel.d.ts +2 -2
- package/dist/typings/styled/common/StyledLegend.d.ts +1 -5
- package/dist/typings/styled/common/StyledMessage.d.ts +1 -1
- package/dist/typings/styled/common/StyledMessageIcon.d.ts +2 -10
- package/dist/typings/styled/file-list/StyledFile.d.ts +3 -3
- package/dist/typings/styled/file-list/StyledFileIcon.d.ts +1 -1
- package/dist/typings/styled/file-upload/StyledFileUpload.d.ts +2 -2
- package/dist/typings/styled/input-group/StyledInputGroup.d.ts +1 -1
- package/dist/typings/styled/radio/StyledRadioInput.d.ts +1 -1
- package/dist/typings/styled/radio/StyledRadioLabel.d.ts +2 -2
- package/dist/typings/styled/range/StyledRangeInput.d.ts +2 -2
- package/dist/typings/styled/text/StyledTextFauxInput.d.ts +3 -3
- package/dist/typings/styled/text/StyledTextInput.d.ts +6 -6
- package/dist/typings/styled/text/StyledTextMediaFigure.d.ts +1 -1
- package/dist/typings/styled/text/StyledTextMediaInput.d.ts +2 -2
- package/dist/typings/styled/text/StyledTextarea.d.ts +2 -2
- package/dist/typings/styled/tiles/StyledTileDescription.d.ts +1 -1
- package/dist/typings/styled/tiles/StyledTileIcon.d.ts +1 -1
- package/dist/typings/styled/tiles/StyledTileLabel.d.ts +1 -1
- package/dist/typings/styled/toggle/StyledToggleLabel.d.ts +2 -2
- package/dist/typings/types/index.d.ts +6 -0
- package/package.json +7 -6
|
@@ -59,7 +59,7 @@ const trackLowerStyles = function (styles) {
|
|
|
59
59
|
const colorStyles = _ref => {
|
|
60
60
|
let {
|
|
61
61
|
theme,
|
|
62
|
-
hasLowerTrack
|
|
62
|
+
$hasLowerTrack
|
|
63
63
|
} = _ref;
|
|
64
64
|
const options = {
|
|
65
65
|
theme,
|
|
@@ -109,18 +109,18 @@ const colorStyles = _ref => {
|
|
|
109
109
|
offset: -200
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
|
-
const trackLowerBackgroundColor = hasLowerTrack ? thumbBackgroundColor : '';
|
|
113
|
-
const trackBackgroundImage = hasLowerTrack ? `linear-gradient(${trackLowerBackgroundColor}, ${trackLowerBackgroundColor})` : '';
|
|
112
|
+
const trackLowerBackgroundColor = $hasLowerTrack ? thumbBackgroundColor : '';
|
|
113
|
+
const trackBackgroundImage = $hasLowerTrack ? `linear-gradient(${trackLowerBackgroundColor}, ${trackLowerBackgroundColor})` : '';
|
|
114
114
|
const trackDisabledBackgroundColor = getColor({
|
|
115
115
|
theme,
|
|
116
116
|
variable: 'background.disabled',
|
|
117
117
|
transparency: theme.opacity[200]
|
|
118
118
|
});
|
|
119
|
-
const trackDisabledLowerBackgroundColor = hasLowerTrack ? getColor({
|
|
119
|
+
const trackDisabledLowerBackgroundColor = $hasLowerTrack ? getColor({
|
|
120
120
|
theme,
|
|
121
121
|
variable: 'border.emphasis'
|
|
122
122
|
}) : '';
|
|
123
|
-
const trackDisabledBackgroundImage = hasLowerTrack ? `linear-gradient(${trackDisabledLowerBackgroundColor}, ${trackDisabledLowerBackgroundColor})` : '';
|
|
123
|
+
const trackDisabledBackgroundImage = $hasLowerTrack ? `linear-gradient(${trackDisabledLowerBackgroundColor}, ${trackDisabledLowerBackgroundColor})` : '';
|
|
124
124
|
return css(["", " ", " ", " ", " ", " ", " ", " ", " ", ""], trackStyles(`
|
|
125
125
|
background-color: ${trackBackgroundColor};
|
|
126
126
|
background-image: ${trackBackgroundImage}; /* [1] */
|
|
@@ -177,10 +177,10 @@ const sizeStyles = _ref2 => {
|
|
|
177
177
|
};
|
|
178
178
|
const StyledRangeInput = styled.input.attrs(props => ({
|
|
179
179
|
'data-garden-id': COMPONENT_ID,
|
|
180
|
-
'data-garden-version': '9.
|
|
180
|
+
'data-garden-version': '9.1.1',
|
|
181
181
|
type: 'range',
|
|
182
182
|
style: {
|
|
183
|
-
backgroundSize: props
|
|
183
|
+
backgroundSize: props.$hasLowerTrack && props.$backgroundSize
|
|
184
184
|
}
|
|
185
185
|
})).withConfig({
|
|
186
186
|
displayName: "StyledRangeInput",
|
|
@@ -202,8 +202,8 @@ const StyledRangeInput = styled.input.attrs(props => ({
|
|
|
202
202
|
box-sizing: border-box;
|
|
203
203
|
`), colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
204
204
|
StyledRangeInput.defaultProps = {
|
|
205
|
-
backgroundSize: '0%',
|
|
206
|
-
hasLowerTrack: true,
|
|
205
|
+
$backgroundSize: '0%',
|
|
206
|
+
$hasLowerTrack: true,
|
|
207
207
|
theme: DEFAULT_THEME
|
|
208
208
|
};
|
|
209
209
|
|
|
@@ -34,22 +34,22 @@ const colorStyles = _ref => {
|
|
|
34
34
|
const sizeStyles = _ref2 => {
|
|
35
35
|
let {
|
|
36
36
|
theme,
|
|
37
|
-
isBare,
|
|
38
|
-
isCompact
|
|
37
|
+
$isBare,
|
|
38
|
+
$isCompact
|
|
39
39
|
} = _ref2;
|
|
40
|
-
const padding = isBare ? undefined : math(`${theme.iconSizes.md} + ${theme.space.base * 5}`);
|
|
41
|
-
const iconVerticalPosition = `${theme.space.base * (isCompact ? 1.5 : 2.5) + 1}px`;
|
|
40
|
+
const padding = $isBare ? undefined : math(`${theme.iconSizes.md} + ${theme.space.base * 5}`);
|
|
41
|
+
const iconVerticalPosition = `${theme.space.base * ($isCompact ? 1.5 : 2.5) + 1}px`;
|
|
42
42
|
const iconHorizontalPosition = `${theme.space.base * 3}px`;
|
|
43
43
|
return css(["padding-", ":", ";& + ", "{top:", ";", ":", ";}"], theme.rtl ? 'left' : 'right', padding, StyledTextMediaFigure, iconVerticalPosition, theme.rtl ? 'left' : 'right', iconHorizontalPosition);
|
|
44
44
|
};
|
|
45
45
|
const StyledSelect = styled(StyledTextInput).attrs({
|
|
46
46
|
'data-garden-id': COMPONENT_ID,
|
|
47
|
-
'data-garden-version': '9.
|
|
47
|
+
'data-garden-version': '9.1.1',
|
|
48
48
|
as: 'select'
|
|
49
49
|
}).withConfig({
|
|
50
50
|
displayName: "StyledSelect",
|
|
51
51
|
componentId: "sc-8xdxpt-0"
|
|
52
|
-
})(["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;}"], sizeStyles, colorStyles, props => getColor({
|
|
52
|
+
})(["opacity:1;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;}"], sizeStyles, colorStyles, props => getColor({
|
|
53
53
|
theme: props.theme,
|
|
54
54
|
variable: 'foreground.default'
|
|
55
55
|
}), StyledTextMediaFigure);
|
|
@@ -13,14 +13,14 @@ const COMPONENT_ID = 'forms.select_wrapper';
|
|
|
13
13
|
const sizeStyles = _ref => {
|
|
14
14
|
let {
|
|
15
15
|
theme,
|
|
16
|
-
isCompact
|
|
16
|
+
$isCompact
|
|
17
17
|
} = _ref;
|
|
18
|
-
const height = `${theme.space.base * (isCompact ? 8 : 10)}px`;
|
|
18
|
+
const height = `${theme.space.base * ($isCompact ? 8 : 10)}px`;
|
|
19
19
|
return css(["max-height:", ";"], height);
|
|
20
20
|
};
|
|
21
21
|
const StyledSelectWrapper = styled(StyledTextFauxInput).attrs({
|
|
22
22
|
'data-garden-id': COMPONENT_ID,
|
|
23
|
-
'data-garden-version': '9.
|
|
23
|
+
'data-garden-version': '9.1.1'
|
|
24
24
|
}).withConfig({
|
|
25
25
|
displayName: "StyledSelectWrapper",
|
|
26
26
|
componentId: "sc-i7b6hw-0"
|
|
@@ -13,19 +13,19 @@ const COMPONENT_ID = 'forms.faux_input';
|
|
|
13
13
|
const colorStyles = _ref => {
|
|
14
14
|
let {
|
|
15
15
|
theme,
|
|
16
|
-
validation,
|
|
17
|
-
focusInset,
|
|
18
|
-
isBare,
|
|
19
|
-
isFocused
|
|
16
|
+
$validation,
|
|
17
|
+
$focusInset,
|
|
18
|
+
$isBare,
|
|
19
|
+
$isFocused
|
|
20
20
|
} = _ref;
|
|
21
21
|
let borderVariable;
|
|
22
22
|
let focusBorderColor;
|
|
23
|
-
if (validation) {
|
|
24
|
-
if (validation === 'success') {
|
|
23
|
+
if ($validation) {
|
|
24
|
+
if ($validation === 'success') {
|
|
25
25
|
borderVariable = 'border.successEmphasis';
|
|
26
|
-
} else if (validation === 'warning') {
|
|
26
|
+
} else if ($validation === 'warning') {
|
|
27
27
|
borderVariable = 'border.warningEmphasis';
|
|
28
|
-
} else if (validation === 'error') {
|
|
28
|
+
} else if ($validation === 'error') {
|
|
29
29
|
borderVariable = 'border.dangerEmphasis';
|
|
30
30
|
}
|
|
31
31
|
focusBorderColor = getColor({
|
|
@@ -41,26 +41,26 @@ const colorStyles = _ref => {
|
|
|
41
41
|
}
|
|
42
42
|
return css(["", ""], focusStyles({
|
|
43
43
|
theme,
|
|
44
|
-
inset: focusInset,
|
|
44
|
+
inset: $focusInset,
|
|
45
45
|
color: {
|
|
46
46
|
variable: borderVariable
|
|
47
47
|
},
|
|
48
|
-
selector: isFocused ? '&' : '&:focus-within',
|
|
48
|
+
selector: $isFocused ? '&' : '&:focus-within',
|
|
49
49
|
styles: {
|
|
50
50
|
borderColor: focusBorderColor
|
|
51
51
|
},
|
|
52
|
-
condition:
|
|
52
|
+
condition: !$isBare
|
|
53
53
|
}));
|
|
54
54
|
};
|
|
55
55
|
const StyledTextFauxInput = styled(StyledTextInput).attrs(props => ({
|
|
56
56
|
as: 'div',
|
|
57
|
-
'aria-readonly': props
|
|
58
|
-
'aria-disabled': props
|
|
57
|
+
'aria-readonly': props.$isReadOnly,
|
|
58
|
+
'aria-disabled': props.$isDisabled,
|
|
59
59
|
'data-garden-id': COMPONENT_ID,
|
|
60
|
-
'data-garden-version': '9.
|
|
60
|
+
'data-garden-version': '9.1.1'
|
|
61
61
|
})).withConfig({
|
|
62
62
|
displayName: "StyledTextFauxInput",
|
|
63
63
|
componentId: "sc-yqw7j9-0"
|
|
64
|
-
})(["display:", ";align-items:", ";cursor:", ";overflow:hidden;", " & > ", "{vertical-align:", ";", "{box-shadow:unset;}}& > ", "{flex-shrink:", ";}", ";"], props => props
|
|
64
|
+
})(["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, StyledTextInput, props => !props.$mediaLayout && 'baseline', SELECTOR_FOCUS_VISIBLE, StyledTextMediaFigure, props => props.$mediaLayout && '0', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
65
65
|
|
|
66
66
|
export { StyledTextFauxInput };
|
|
@@ -21,16 +21,16 @@ const isInvalid = validation => {
|
|
|
21
21
|
const colorStyles = _ref => {
|
|
22
22
|
let {
|
|
23
23
|
theme,
|
|
24
|
-
isBare,
|
|
25
|
-
isHovered,
|
|
26
|
-
focusInset,
|
|
27
|
-
validation
|
|
24
|
+
$isBare,
|
|
25
|
+
$isHovered,
|
|
26
|
+
$focusInset,
|
|
27
|
+
$validation
|
|
28
28
|
} = _ref;
|
|
29
29
|
const foregroundColor = getColor({
|
|
30
30
|
theme,
|
|
31
31
|
variable: 'foreground.default'
|
|
32
32
|
});
|
|
33
|
-
const backgroundColor = isBare ? 'transparent' : getColor({
|
|
33
|
+
const backgroundColor = $isBare ? 'transparent' : getColor({
|
|
34
34
|
theme,
|
|
35
35
|
variable: 'background.default'
|
|
36
36
|
});
|
|
@@ -38,12 +38,12 @@ const colorStyles = _ref => {
|
|
|
38
38
|
let hoverBorderColor;
|
|
39
39
|
let borderVariable;
|
|
40
40
|
let focusBorderColor;
|
|
41
|
-
if (validation) {
|
|
42
|
-
if (validation === 'success') {
|
|
41
|
+
if ($validation) {
|
|
42
|
+
if ($validation === 'success') {
|
|
43
43
|
borderVariable = 'border.successEmphasis';
|
|
44
|
-
} else if (validation === 'warning') {
|
|
44
|
+
} else if ($validation === 'warning') {
|
|
45
45
|
borderVariable = 'border.warningEmphasis';
|
|
46
|
-
} else if (validation === 'error') {
|
|
46
|
+
} else if ($validation === 'error') {
|
|
47
47
|
borderVariable = 'border.dangerEmphasis';
|
|
48
48
|
}
|
|
49
49
|
borderColor = getColor({
|
|
@@ -70,7 +70,7 @@ const colorStyles = _ref => {
|
|
|
70
70
|
});
|
|
71
71
|
focusBorderColor = hoverBorderColor;
|
|
72
72
|
}
|
|
73
|
-
const disabledBackgroundColor = isBare ? undefined : getColor({
|
|
73
|
+
const disabledBackgroundColor = $isBare ? undefined : getColor({
|
|
74
74
|
theme,
|
|
75
75
|
variable: 'background.disabled'
|
|
76
76
|
});
|
|
@@ -88,20 +88,20 @@ const colorStyles = _ref => {
|
|
|
88
88
|
theme,
|
|
89
89
|
variable: 'foreground.subtle'
|
|
90
90
|
});
|
|
91
|
-
const calendarPickerIcon = renderToString(
|
|
91
|
+
const calendarPickerIcon = renderToString(React__default.createElement(SvgChevronDownStroke, {
|
|
92
92
|
color: calendarPickerColor
|
|
93
93
|
}));
|
|
94
94
|
const calendarPickerBackgroundImage = `url("data:image/svg+xml,${encodeURIComponent(calendarPickerIcon)}")`;
|
|
95
|
-
return css(["border-color:", ";background-color:", ";color:", ";&::placeholder{opacity:1;color:", ";}&::-webkit-datetime-edit{color:", ";}&::-webkit-calendar-picker-indicator{background-image:", ";}&[readonly],&[aria-readonly='true']{background-color:", ";}&:hover{border-color:", ";}", " &::-webkit-calendar-picker-indicator:focus-visible{", "}&:disabled,&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], isHovered ? hoverBorderColor : borderColor, backgroundColor, foregroundColor, placeholderColor, placeholderColor, calendarPickerBackgroundImage, readOnlyBackgroundColor, hoverBorderColor, focusStyles({
|
|
95
|
+
return css(["border-color:", ";background-color:", ";color:", ";&::placeholder{opacity:1;color:", ";}&::-webkit-datetime-edit{color:", ";}&::-webkit-calendar-picker-indicator{background-image:", ";}&[readonly],&[aria-readonly='true']{background-color:", ";}&:hover{border-color:", ";}", " &::-webkit-calendar-picker-indicator:focus-visible{", "}&:disabled,&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], $isHovered ? hoverBorderColor : borderColor, backgroundColor, foregroundColor, placeholderColor, placeholderColor, calendarPickerBackgroundImage, readOnlyBackgroundColor, hoverBorderColor, focusStyles({
|
|
96
96
|
theme,
|
|
97
|
-
inset: focusInset,
|
|
97
|
+
inset: $focusInset,
|
|
98
98
|
color: {
|
|
99
99
|
variable: borderVariable
|
|
100
100
|
},
|
|
101
101
|
styles: {
|
|
102
102
|
borderColor: focusBorderColor
|
|
103
103
|
},
|
|
104
|
-
condition:
|
|
104
|
+
condition: !$isBare
|
|
105
105
|
}), focusStyles({
|
|
106
106
|
theme
|
|
107
107
|
}), disabledBorderColor, disabledBackgroundColor, disabledForegroundColor);
|
|
@@ -109,8 +109,8 @@ const colorStyles = _ref => {
|
|
|
109
109
|
const sizeStyles = _ref2 => {
|
|
110
110
|
let {
|
|
111
111
|
theme,
|
|
112
|
-
isBare,
|
|
113
|
-
isCompact
|
|
112
|
+
$isBare,
|
|
113
|
+
$isCompact
|
|
114
114
|
} = _ref2;
|
|
115
115
|
const fontSize = theme.fontSizes.md;
|
|
116
116
|
const paddingHorizontal = `${theme.space.base * 3}px`;
|
|
@@ -118,7 +118,7 @@ const sizeStyles = _ref2 => {
|
|
|
118
118
|
let paddingVertical;
|
|
119
119
|
let browseFontSize;
|
|
120
120
|
let swatchHeight;
|
|
121
|
-
if (isCompact) {
|
|
121
|
+
if ($isCompact) {
|
|
122
122
|
height = `${theme.space.base * 8}px`;
|
|
123
123
|
paddingVertical = `${theme.space.base * 1.5}px`;
|
|
124
124
|
browseFontSize = math(`${theme.fontSizes.sm} - 1`);
|
|
@@ -130,20 +130,20 @@ const sizeStyles = _ref2 => {
|
|
|
130
130
|
swatchHeight = `${theme.space.base * 7}px`;
|
|
131
131
|
}
|
|
132
132
|
const lineHeight = math(`${height} - (${paddingVertical} * 2) - (${theme.borderWidths.sm} * 2)`);
|
|
133
|
-
const padding = isBare ? '0' : `${em(paddingVertical, fontSize)} ${em(paddingHorizontal, fontSize)}`;
|
|
133
|
+
const padding = $isBare ? '0' : `${em(paddingVertical, fontSize)} ${em(paddingHorizontal, fontSize)}`;
|
|
134
134
|
const swatchMarginVertical = math(`(${lineHeight} - ${swatchHeight}) / 2`);
|
|
135
135
|
const swatchMarginHorizontal = math(`${paddingVertical} + ${swatchMarginVertical} - ${paddingHorizontal}`);
|
|
136
136
|
const calendarPickerSize = `${theme.space.base * 5}px`;
|
|
137
137
|
const calendarPickerBackgroundSize = theme.iconSizes.md;
|
|
138
|
-
return css(["padding:", ";min-height:", ";line-height:", ";font-size:", ";&::-ms-browse{font-size:", ";}&[type='date'],&[type='datetime-local'],&[type='file'],&[type='month'],&[type='time'],&[type='week']{max-height:", ";}&[type='file']{line-height:1;}@supports (-ms-ime-align:auto){&[type='color']{padding:", ";}}&::-moz-color-swatch{margin-top:", ";margin-left:", ";width:calc(100% + ", ");height:", ";}&::-webkit-calendar-picker-indicator{background-position:center;background-size:", ";padding:0;width:", ";height:", ";}&::-webkit-color-swatch{margin:", " ", ";}", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& ~ ", "{margin-top:", "px;}"], padding, isBare ? '1em' : height, getLineHeight(lineHeight, fontSize), fontSize, browseFontSize, height, isCompact ? '0 2px' : '1px 3px', swatchMarginVertical, swatchMarginHorizontal, math(`${swatchMarginHorizontal} * -2`), swatchHeight, calendarPickerBackgroundSize, calendarPickerSize, calendarPickerSize, swatchMarginVertical, swatchMarginHorizontal, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, theme.space.base * (isCompact ? 1 : 2));
|
|
138
|
+
return css(["padding:", ";min-height:", ";line-height:", ";font-size:", ";&::-ms-browse{font-size:", ";}&[type='date'],&[type='datetime-local'],&[type='file'],&[type='month'],&[type='time'],&[type='week']{max-height:", ";}&[type='file']{line-height:1;}@supports (-ms-ime-align:auto){&[type='color']{padding:", ";}}&::-moz-color-swatch{margin-top:", ";margin-left:", ";width:calc(100% + ", ");height:", ";}&::-webkit-calendar-picker-indicator{background-position:center;background-size:", ";padding:0;width:", ";height:", ";}&::-webkit-color-swatch{margin:", " ", ";}", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& ~ ", "{margin-top:", "px;}"], padding, $isBare ? '1em' : height, getLineHeight(lineHeight, fontSize), fontSize, browseFontSize, height, $isCompact ? '0 2px' : '1px 3px', swatchMarginVertical, swatchMarginHorizontal, math(`${swatchMarginHorizontal} * -2`), swatchHeight, calendarPickerBackgroundSize, calendarPickerSize, calendarPickerSize, swatchMarginVertical, swatchMarginHorizontal, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, theme.space.base * ($isCompact ? 1 : 2));
|
|
139
139
|
};
|
|
140
140
|
const StyledTextInput = styled.input.attrs(props => ({
|
|
141
141
|
'data-garden-id': COMPONENT_ID,
|
|
142
|
-
'data-garden-version': '9.
|
|
143
|
-
'aria-invalid': isInvalid(props
|
|
142
|
+
'data-garden-version': '9.1.1',
|
|
143
|
+
'aria-invalid': isInvalid(props.$validation)
|
|
144
144
|
})).withConfig({
|
|
145
145
|
displayName: "StyledTextInput",
|
|
146
146
|
componentId: "sc-1r6733h-0"
|
|
147
|
-
})(["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;}&::-webkit-calendar-picker-indicator{border-radius:100%;}&: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
|
|
147
|
+
})(["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;}&::-webkit-calendar-picker-indicator{border-radius:100%;}&: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', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
148
148
|
|
|
149
149
|
export { StyledTextInput };
|
|
@@ -56,7 +56,7 @@ const sizeStyles = props => {
|
|
|
56
56
|
};
|
|
57
57
|
const StyledTextMediaFigure = styled(StyledBaseIcon).attrs({
|
|
58
58
|
'data-garden-id': COMPONENT_ID,
|
|
59
|
-
'data-garden-version': '9.
|
|
59
|
+
'data-garden-version': '9.1.1'
|
|
60
60
|
}).withConfig({
|
|
61
61
|
displayName: "StyledTextMediaFigure",
|
|
62
62
|
componentId: "sc-1qepknj-0"
|
|
@@ -11,8 +11,8 @@ import { StyledTextInput } from './StyledTextInput.js';
|
|
|
11
11
|
const COMPONENT_ID = 'forms.media_input';
|
|
12
12
|
const StyledTextMediaInput = styled(StyledTextInput).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.
|
|
15
|
-
isBare: true
|
|
14
|
+
'data-garden-version': '9.1.1',
|
|
15
|
+
$isBare: true
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledTextMediaInput",
|
|
18
18
|
componentId: "sc-12i9xfi-0"
|
|
@@ -21,10 +21,10 @@ const hiddenStyles = `
|
|
|
21
21
|
const StyledTextarea = styled(StyledTextInput).attrs({
|
|
22
22
|
as: 'textarea',
|
|
23
23
|
'data-garden-id': COMPONENT_ID,
|
|
24
|
-
'data-garden-version': '9.
|
|
24
|
+
'data-garden-version': '9.1.1'
|
|
25
25
|
}).withConfig({
|
|
26
26
|
displayName: "StyledTextarea",
|
|
27
27
|
componentId: "sc-wxschl-0"
|
|
28
|
-
})(["resize:", ";overflow:auto;", ";", ";"], props => props
|
|
28
|
+
})(["resize:", ";overflow:auto;", ";", ";"], props => props.$isResizable ? 'vertical' : 'none', props => props.$isHidden && hiddenStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
29
29
|
|
|
30
30
|
export { StyledTextarea };
|
|
@@ -102,7 +102,7 @@ const sizeStyles = _ref2 => {
|
|
|
102
102
|
};
|
|
103
103
|
const StyledTile = styled.label.attrs({
|
|
104
104
|
'data-garden-id': COMPONENT_ID,
|
|
105
|
-
'data-garden-version': '9.
|
|
105
|
+
'data-garden-version': '9.1.1'
|
|
106
106
|
}).withConfig({
|
|
107
107
|
displayName: "StyledTile",
|
|
108
108
|
componentId: "sc-1jjvmxs-0"
|
|
@@ -12,20 +12,20 @@ const COMPONENT_ID = 'forms.tile_description';
|
|
|
12
12
|
const sizeStyles = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
theme,
|
|
15
|
-
isCentered
|
|
15
|
+
$isCentered
|
|
16
16
|
} = _ref;
|
|
17
17
|
const marginTop = `${theme.space.base}px`;
|
|
18
|
-
const marginHorizontal = isCentered ? undefined : math(`(${theme.iconSizes.md} * 2) + ${theme.space.base * 5}px`);
|
|
18
|
+
const marginHorizontal = $isCentered ? undefined : math(`(${theme.iconSizes.md} * 2) + ${theme.space.base * 5}px`);
|
|
19
19
|
const fontSize = theme.fontSizes.sm;
|
|
20
20
|
const lineHeight = getLineHeight(theme.space.base * 4, fontSize);
|
|
21
21
|
return css(["margin-top:", ";margin-", ":", ";line-height:", ";font-size:", ";"], marginTop, theme.rtl ? 'right' : 'left', marginHorizontal, lineHeight, fontSize);
|
|
22
22
|
};
|
|
23
23
|
const StyledTileDescription = styled.span.attrs({
|
|
24
24
|
'data-garden-id': COMPONENT_ID,
|
|
25
|
-
'data-garden-version': '9.
|
|
25
|
+
'data-garden-version': '9.1.1'
|
|
26
26
|
}).withConfig({
|
|
27
27
|
displayName: "StyledTileDescription",
|
|
28
28
|
componentId: "sc-xfuu7u-0"
|
|
29
|
-
})(["display:block;text-align:", ";", ";", ";"], props => props
|
|
29
|
+
})(["display:block;text-align:", ";", ";", ";"], props => props.$isCentered && 'center', sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
30
30
|
|
|
31
31
|
export { StyledTileDescription };
|
|
@@ -50,13 +50,13 @@ const colorStyles = _ref => {
|
|
|
50
50
|
const sizeStyles = _ref2 => {
|
|
51
51
|
let {
|
|
52
52
|
theme,
|
|
53
|
-
isCentered
|
|
53
|
+
$isCentered
|
|
54
54
|
} = _ref2;
|
|
55
55
|
const iconSize = math(`${theme.iconSizes.md} * 2`);
|
|
56
56
|
let position;
|
|
57
57
|
let top;
|
|
58
58
|
let horizontal;
|
|
59
|
-
if (
|
|
59
|
+
if (!$isCentered) {
|
|
60
60
|
position = 'absolute';
|
|
61
61
|
top = `${theme.space.base * 6}px`;
|
|
62
62
|
horizontal = `${theme.space.base * 5}px`;
|
|
@@ -65,7 +65,7 @@ const sizeStyles = _ref2 => {
|
|
|
65
65
|
};
|
|
66
66
|
const StyledTileIcon = styled.span.attrs({
|
|
67
67
|
'data-garden-id': COMPONENT_ID,
|
|
68
|
-
'data-garden-version': '9.
|
|
68
|
+
'data-garden-version': '9.1.1'
|
|
69
69
|
}).withConfig({
|
|
70
70
|
displayName: "StyledTileIcon",
|
|
71
71
|
componentId: "sc-1wazhg4-0"
|
|
@@ -12,20 +12,20 @@ const COMPONENT_ID = 'forms.tile_label';
|
|
|
12
12
|
const sizeStyles = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
theme,
|
|
15
|
-
isCentered
|
|
15
|
+
$isCentered
|
|
16
16
|
} = _ref;
|
|
17
|
-
const marginTop = isCentered ? `${theme.space.base * 2}px` : 0;
|
|
18
|
-
const marginHorizontal = isCentered ? undefined : math(`(${theme.iconSizes.md} * 2) + ${theme.space.base * 5}px`);
|
|
17
|
+
const marginTop = $isCentered ? `${theme.space.base * 2}px` : 0;
|
|
18
|
+
const marginHorizontal = $isCentered ? undefined : math(`(${theme.iconSizes.md} * 2) + ${theme.space.base * 5}px`);
|
|
19
19
|
const fontSize = theme.fontSizes.md;
|
|
20
20
|
const lineHeight = getLineHeight(theme.space.base * 5, fontSize);
|
|
21
21
|
return css(["margin-top:", ";margin-", ":", ";line-height:", ";font-size:", ";"], marginTop, theme.rtl ? 'right' : 'left', marginHorizontal, lineHeight, fontSize);
|
|
22
22
|
};
|
|
23
23
|
const StyledTileLabel = styled.span.attrs({
|
|
24
24
|
'data-garden-id': COMPONENT_ID,
|
|
25
|
-
'data-garden-version': '9.
|
|
25
|
+
'data-garden-version': '9.1.1'
|
|
26
26
|
}).withConfig({
|
|
27
27
|
displayName: "StyledTileLabel",
|
|
28
28
|
componentId: "sc-1mypv27-0"
|
|
29
|
-
})(["display:block;text-align:", ";font-weight:", ";", ";", ";"], props => props
|
|
29
|
+
})(["display:block;text-align:", ";font-weight:", ";", ";", ";"], props => props.$isCentered && 'center', props => props.theme.fontWeights.semibold, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
30
30
|
|
|
31
31
|
export { StyledTileLabel };
|
|
@@ -12,7 +12,7 @@ import { StyledHint } from '../common/StyledHint.js';
|
|
|
12
12
|
const COMPONENT_ID = 'forms.toggle_hint';
|
|
13
13
|
const StyledToggleHint = styled(StyledHint).attrs({
|
|
14
14
|
'data-garden-id': COMPONENT_ID,
|
|
15
|
-
'data-garden-version': '9.
|
|
15
|
+
'data-garden-version': '9.1.1'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledToggleHint",
|
|
18
18
|
componentId: "sc-nziggu-0"
|
|
@@ -53,7 +53,7 @@ const sizeStyles = _ref2 => {
|
|
|
53
53
|
};
|
|
54
54
|
const StyledToggleInput = styled(StyledCheckInput).attrs({
|
|
55
55
|
'data-garden-id': COMPONENT_ID,
|
|
56
|
-
'data-garden-version': '9.
|
|
56
|
+
'data-garden-version': '9.1.1'
|
|
57
57
|
}).withConfig({
|
|
58
58
|
displayName: "StyledToggleInput",
|
|
59
59
|
componentId: "sc-sgp47s-0"
|
|
@@ -16,7 +16,7 @@ const sizeStyles = props => {
|
|
|
16
16
|
};
|
|
17
17
|
const StyledToggleLabel = styled(StyledCheckLabel).attrs({
|
|
18
18
|
'data-garden-id': COMPONENT_ID,
|
|
19
|
-
'data-garden-version': '9.
|
|
19
|
+
'data-garden-version': '9.1.1'
|
|
20
20
|
}).withConfig({
|
|
21
21
|
displayName: "StyledToggleLabel",
|
|
22
22
|
componentId: "sc-e0asdk-0"
|
|
@@ -13,7 +13,7 @@ import { StyledMessageIcon } from '../common/StyledMessageIcon.js';
|
|
|
13
13
|
const COMPONENT_ID = 'forms.toggle_message';
|
|
14
14
|
const StyledToggleMessage = styled(StyledMessage).attrs({
|
|
15
15
|
'data-garden-id': COMPONENT_ID,
|
|
16
|
-
'data-garden-version': '9.
|
|
16
|
+
'data-garden-version': '9.1.1'
|
|
17
17
|
}).withConfig({
|
|
18
18
|
displayName: "StyledToggleMessage",
|
|
19
19
|
componentId: "sc-13vuvl1-0"
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
11
11
|
const COMPONENT_ID = 'forms.toggle_svg';
|
|
12
12
|
const StyledToggleSvg = styled(SvgCircleSmFill).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.
|
|
14
|
+
'data-garden-version': '9.1.1'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledToggleSvg",
|
|
17
17
|
componentId: "sc-162xbyx-0"
|