@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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React__default from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import SvgAlertErrorStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js';
|
|
10
|
+
import SvgAlertWarningStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js';
|
|
11
|
+
import SvgCheckCircleStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js';
|
|
12
|
+
import '../../styled/common/StyledField.js';
|
|
13
|
+
import '../../styled/common/StyledFieldset.js';
|
|
14
|
+
import '../../styled/common/StyledLegend.js';
|
|
15
|
+
import '../../styled/common/StyledHint.js';
|
|
16
|
+
import '../../styled/common/StyledLabel.js';
|
|
17
|
+
import '../../styled/common/StyledMessage.js';
|
|
18
|
+
import { StyledMessageIcon } from '../../styled/common/StyledMessageIcon.js';
|
|
19
|
+
import '../../styled/text/StyledTextInput.js';
|
|
20
|
+
import '../../styled/text/StyledTextarea.js';
|
|
21
|
+
import '../../styled/text/StyledTextFauxInput.js';
|
|
22
|
+
import '../../styled/text/StyledTextMediaInput.js';
|
|
23
|
+
import '../../styled/text/StyledTextMediaFigure.js';
|
|
24
|
+
import '../../styled/input-group/StyledInputGroup.js';
|
|
25
|
+
import '../../styled/checkbox/StyledCheckLabel.js';
|
|
26
|
+
import '../../styled/checkbox/StyledCheckHint.js';
|
|
27
|
+
import '../../styled/checkbox/StyledCheckInput.js';
|
|
28
|
+
import '../../styled/checkbox/StyledCheckMessage.js';
|
|
29
|
+
import '../../styled/checkbox/StyledCheckSvg.js';
|
|
30
|
+
import '../../styled/checkbox/StyledDashSvg.js';
|
|
31
|
+
import '../../styled/file-upload/StyledFileUpload.js';
|
|
32
|
+
import '../../styled/file-list/StyledFile.js';
|
|
33
|
+
import '../../styled/file-list/StyledFileClose.js';
|
|
34
|
+
import '../../styled/file-list/StyledFileDelete.js';
|
|
35
|
+
import '../../styled/file-list/StyledFileIcon.js';
|
|
36
|
+
import '../../styled/file-list/StyledFileList.js';
|
|
37
|
+
import '../../styled/file-list/StyledFileListItem.js';
|
|
38
|
+
import '../../styled/radio/StyledRadioLabel.js';
|
|
39
|
+
import '../../styled/radio/StyledRadioHint.js';
|
|
40
|
+
import '../../styled/radio/StyledRadioInput.js';
|
|
41
|
+
import '../../styled/radio/StyledRadioMessage.js';
|
|
42
|
+
import '../../styled/radio/StyledRadioSvg.js';
|
|
43
|
+
import '../../styled/toggle/StyledToggleLabel.js';
|
|
44
|
+
import '../../styled/toggle/StyledToggleHint.js';
|
|
45
|
+
import '../../styled/toggle/StyledToggleInput.js';
|
|
46
|
+
import '../../styled/toggle/StyledToggleMessage.js';
|
|
47
|
+
import '../../styled/toggle/StyledToggleSvg.js';
|
|
48
|
+
import '../../styled/select/StyledSelect.js';
|
|
49
|
+
import '../../styled/select/StyledSelectWrapper.js';
|
|
50
|
+
import '../../styled/range/StyledRangeInput.js';
|
|
51
|
+
import '../../styled/tiles/StyledTile.js';
|
|
52
|
+
import '../../styled/tiles/StyledTileDescription.js';
|
|
53
|
+
import '../../styled/tiles/StyledTileIcon.js';
|
|
54
|
+
import '../../styled/tiles/StyledTileInput.js';
|
|
55
|
+
import '../../styled/tiles/StyledTileLabel.js';
|
|
56
|
+
import { VALIDATION } from '../../types/index.js';
|
|
57
|
+
|
|
58
|
+
const MessageIcon = _ref => {
|
|
59
|
+
let {
|
|
60
|
+
validation,
|
|
61
|
+
children,
|
|
62
|
+
...props
|
|
63
|
+
} = _ref;
|
|
64
|
+
return React__default.createElement(StyledMessageIcon, Object.assign({
|
|
65
|
+
"aria-hidden": null,
|
|
66
|
+
role: "img"
|
|
67
|
+
}, props), validation ? {
|
|
68
|
+
error: React__default.createElement(SvgAlertErrorStroke, null),
|
|
69
|
+
success: React__default.createElement(SvgCheckCircleStroke, null),
|
|
70
|
+
warning: React__default.createElement(SvgAlertWarningStroke, null)
|
|
71
|
+
}[validation] : children);
|
|
72
|
+
};
|
|
73
|
+
MessageIcon.displayName = 'Field.MessageIcon';
|
|
74
|
+
MessageIcon.propTypes = {
|
|
75
|
+
validation: PropTypes.oneOf(VALIDATION)
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { MessageIcon };
|
|
@@ -57,12 +57,18 @@ import { EndIcon } from './components/EndIcon.js';
|
|
|
57
57
|
|
|
58
58
|
const FauxInputComponent = forwardRef((_ref, ref) => {
|
|
59
59
|
let {
|
|
60
|
-
onFocus,
|
|
61
|
-
onBlur,
|
|
62
60
|
disabled,
|
|
63
|
-
|
|
61
|
+
focusInset,
|
|
62
|
+
isBare,
|
|
63
|
+
isCompact,
|
|
64
64
|
isFocused: controlledIsFocused,
|
|
65
|
-
|
|
65
|
+
isHovered,
|
|
66
|
+
onBlur,
|
|
67
|
+
onFocus,
|
|
68
|
+
readOnly,
|
|
69
|
+
validation,
|
|
70
|
+
mediaLayout,
|
|
71
|
+
...other
|
|
66
72
|
} = _ref;
|
|
67
73
|
const [isFocused, setIsFocused] = useState(false);
|
|
68
74
|
const onFocusHandler = composeEventHandlers(onFocus, () => {
|
|
@@ -74,11 +80,17 @@ const FauxInputComponent = forwardRef((_ref, ref) => {
|
|
|
74
80
|
return React__default.createElement(StyledTextFauxInput, Object.assign({
|
|
75
81
|
onFocus: onFocusHandler,
|
|
76
82
|
onBlur: onBlurHandler,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
$focusInset: focusInset,
|
|
84
|
+
$isBare: isBare,
|
|
85
|
+
$isCompact: isCompact,
|
|
86
|
+
$isDisabled: disabled,
|
|
87
|
+
$isFocused: controlledIsFocused === undefined ? isFocused : controlledIsFocused,
|
|
88
|
+
$isHovered: isHovered,
|
|
89
|
+
$isReadOnly: readOnly,
|
|
90
|
+
$mediaLayout: mediaLayout,
|
|
91
|
+
$validation: validation,
|
|
80
92
|
tabIndex: disabled ? undefined : 0
|
|
81
|
-
},
|
|
93
|
+
}, other, {
|
|
82
94
|
ref: ref
|
|
83
95
|
}));
|
|
84
96
|
});
|
|
@@ -72,9 +72,9 @@ const FileComponent = forwardRef((_ref, ref) => {
|
|
|
72
72
|
return React__default.createElement(FileContext.Provider, {
|
|
73
73
|
value: fileContextValue
|
|
74
74
|
}, React__default.createElement(StyledFile, Object.assign({}, props, {
|
|
75
|
-
isCompact: isCompact,
|
|
76
|
-
focusInset: focusInset,
|
|
77
|
-
validation: validation,
|
|
75
|
+
$isCompact: isCompact,
|
|
76
|
+
$focusInset: focusInset,
|
|
77
|
+
$validation: validation,
|
|
78
78
|
ref: ref
|
|
79
79
|
}), !!validationType && React__default.createElement(StyledFileIcon, {
|
|
80
80
|
$isCompact: isCompact,
|
|
@@ -55,7 +55,7 @@ import '../../styled/tiles/StyledTileLabel.js';
|
|
|
55
55
|
const InputGroup = React__default.forwardRef((_ref, ref) => {
|
|
56
56
|
let {
|
|
57
57
|
isCompact,
|
|
58
|
-
...
|
|
58
|
+
...other
|
|
59
59
|
} = _ref;
|
|
60
60
|
const contextValue = useMemo(() => ({
|
|
61
61
|
isCompact
|
|
@@ -64,8 +64,8 @@ const InputGroup = React__default.forwardRef((_ref, ref) => {
|
|
|
64
64
|
value: contextValue
|
|
65
65
|
}, React__default.createElement(StyledInputGroup, Object.assign({
|
|
66
66
|
ref: ref,
|
|
67
|
-
isCompact: isCompact
|
|
68
|
-
},
|
|
67
|
+
$isCompact: isCompact
|
|
68
|
+
}, other)));
|
|
69
69
|
});
|
|
70
70
|
InputGroup.displayName = 'InputGroup';
|
|
71
71
|
InputGroup.propTypes = {
|
|
@@ -55,7 +55,7 @@ const DescriptionComponent = forwardRef((props, ref) => {
|
|
|
55
55
|
const tilesContext = useTilesContext();
|
|
56
56
|
return React__default.createElement(StyledTileDescription, Object.assign({
|
|
57
57
|
ref: ref,
|
|
58
|
-
isCentered: tilesContext?.isCentered
|
|
58
|
+
$isCentered: tilesContext?.isCentered
|
|
59
59
|
}, props));
|
|
60
60
|
});
|
|
61
61
|
DescriptionComponent.displayName = 'Tiles.Description';
|
|
@@ -55,7 +55,7 @@ const IconComponent = forwardRef((props, ref) => {
|
|
|
55
55
|
const tileContext = useTilesContext();
|
|
56
56
|
return React__default.createElement(StyledTileIcon, Object.assign({
|
|
57
57
|
ref: ref,
|
|
58
|
-
isCentered: tileContext?.isCentered
|
|
58
|
+
$isCentered: tileContext?.isCentered
|
|
59
59
|
}, props));
|
|
60
60
|
});
|
|
61
61
|
IconComponent.displayName = 'Tiles.Icon';
|
|
@@ -64,7 +64,7 @@ const LabelComponent = forwardRef((props, forwardedRef) => {
|
|
|
64
64
|
return React__default.createElement(StyledTileLabel, Object.assign({
|
|
65
65
|
ref: mergeRefs([ref, forwardedRef]),
|
|
66
66
|
title: title,
|
|
67
|
-
isCentered: tilesContext?.isCentered
|
|
67
|
+
$isCentered: tilesContext?.isCentered
|
|
68
68
|
}, props));
|
|
69
69
|
});
|
|
70
70
|
LabelComponent.displayName = 'Tiles.Label';
|
|
@@ -11,7 +11,7 @@ import { StyledRadioHint } from '../radio/StyledRadioHint.js';
|
|
|
11
11
|
const COMPONENT_ID = 'forms.checkbox_hint';
|
|
12
12
|
const StyledCheckHint = styled(StyledRadioHint).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: "StyledCheckHint",
|
|
17
17
|
componentId: "sc-1kl8e8c-0"
|
|
@@ -65,7 +65,7 @@ const colorStyles = _ref => {
|
|
|
65
65
|
};
|
|
66
66
|
const StyledCheckInput = styled(StyledRadioInput).attrs({
|
|
67
67
|
'data-garden-id': COMPONENT_ID,
|
|
68
|
-
'data-garden-version': '9.
|
|
68
|
+
'data-garden-version': '9.1.1',
|
|
69
69
|
type: 'checkbox'
|
|
70
70
|
}).withConfig({
|
|
71
71
|
displayName: "StyledCheckInput",
|
|
@@ -11,7 +11,7 @@ import { StyledRadioLabel } from '../radio/StyledRadioLabel.js';
|
|
|
11
11
|
const COMPONENT_ID = 'forms.checkbox_label';
|
|
12
12
|
const StyledCheckLabel = styled(StyledRadioLabel).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: "StyledCheckLabel",
|
|
17
17
|
componentId: "sc-x7nr1-0"
|
|
@@ -11,7 +11,7 @@ import { StyledRadioMessage } from '../radio/StyledRadioMessage.js';
|
|
|
11
11
|
const COMPONENT_ID = 'forms.checkbox_message';
|
|
12
12
|
const StyledCheckMessage = styled(StyledRadioMessage).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: "StyledCheckMessage",
|
|
17
17
|
componentId: "sc-s4p6kd-0"
|
|
@@ -13,7 +13,7 @@ import { StyledCheckLabel } from './StyledCheckLabel.js';
|
|
|
13
13
|
const COMPONENT_ID = 'forms.check_svg';
|
|
14
14
|
const StyledCheckSvg = styled(SvgCheckSmFill).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: "StyledCheckSvg",
|
|
19
19
|
componentId: "sc-fvxetk-0"
|
|
@@ -13,7 +13,7 @@ import { StyledCheckLabel } from './StyledCheckLabel.js';
|
|
|
13
13
|
const COMPONENT_ID = 'forms.dash_svg';
|
|
14
14
|
const StyledDashSvg = styled(SvgDashFill).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: "StyledDashSvg",
|
|
19
19
|
componentId: "sc-z3vq71-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
10
10
|
const COMPONENT_ID = 'forms.field';
|
|
11
11
|
const StyledField = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.
|
|
13
|
+
'data-garden-version': '9.1.1'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledField",
|
|
16
16
|
componentId: "sc-12gzfsu-0"
|
|
@@ -12,10 +12,10 @@ const COMPONENT_ID = 'forms.fieldset';
|
|
|
12
12
|
const StyledFieldset = styled(StyledField).attrs({
|
|
13
13
|
as: 'fieldset',
|
|
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: "StyledFieldset",
|
|
18
18
|
componentId: "sc-1vr4mxv-0"
|
|
19
|
-
})(["", "{margin-top:", "px;}", ";"], StyledField, props => props.theme.space.base * (props
|
|
19
|
+
})(["", "{margin-top:", "px;}", ";"], StyledField, props => props.theme.space.base * (props.$isCompact ? 1 : 2), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
20
|
|
|
21
21
|
export { StyledFieldset };
|
|
@@ -10,7 +10,7 @@ import { getLineHeight, getColor, retrieveComponentStyles } from '@zendeskgarden
|
|
|
10
10
|
const COMPONENT_ID = 'forms.input_hint';
|
|
11
11
|
const StyledHint = styled.div.attrs(props => ({
|
|
12
12
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
|
|
13
|
-
'data-garden-version': props['data-garden-version'] || '9.
|
|
13
|
+
'data-garden-version': props['data-garden-version'] || '9.1.1'
|
|
14
14
|
})).withConfig({
|
|
15
15
|
displayName: "StyledHint",
|
|
16
16
|
componentId: "sc-17c2wu8-0"
|
|
@@ -11,13 +11,13 @@ import { getLineHeight, getColor, retrieveComponentStyles } from '@zendeskgarden
|
|
|
11
11
|
const COMPONENT_ID = 'forms.input_label';
|
|
12
12
|
const StyledLabel = styled.label.attrs(props => ({
|
|
13
13
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
|
|
14
|
-
'data-garden-version': props['data-garden-version'] || '9.
|
|
14
|
+
'data-garden-version': props['data-garden-version'] || '9.1.1'
|
|
15
15
|
})).withConfig({
|
|
16
16
|
displayName: "StyledLabel",
|
|
17
17
|
componentId: "sc-2utmsz-0"
|
|
18
18
|
})(["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 => getColor({
|
|
19
19
|
theme: props.theme,
|
|
20
20
|
variable: 'foreground.default'
|
|
21
|
-
}), props => props.theme.fontSizes.md, props => props
|
|
21
|
+
}), 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, props));
|
|
22
22
|
|
|
23
23
|
export { StyledLabel };
|
|
@@ -12,7 +12,7 @@ const COMPONENT_ID = 'forms.fieldset_legend';
|
|
|
12
12
|
const StyledLegend = styled(StyledLabel).attrs({
|
|
13
13
|
as: 'legend',
|
|
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: "StyledLegend",
|
|
18
18
|
componentId: "sc-6s0zwq-0"
|
|
@@ -14,14 +14,14 @@ const COMPONENT_ID = 'forms.input_message';
|
|
|
14
14
|
const colorStyles = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
theme,
|
|
17
|
-
validation
|
|
17
|
+
$validation
|
|
18
18
|
} = _ref;
|
|
19
19
|
let variable;
|
|
20
|
-
if (validation === 'error') {
|
|
20
|
+
if ($validation === 'error') {
|
|
21
21
|
variable = 'foreground.danger';
|
|
22
|
-
} else if (validation === 'success') {
|
|
22
|
+
} else if ($validation === 'success') {
|
|
23
23
|
variable = 'foreground.success';
|
|
24
|
-
} else if (validation === 'warning') {
|
|
24
|
+
} else if ($validation === 'warning') {
|
|
25
25
|
variable = 'foreground.warning';
|
|
26
26
|
} else {
|
|
27
27
|
variable = 'foreground.subtle';
|
|
@@ -35,17 +35,17 @@ const colorStyles = _ref => {
|
|
|
35
35
|
const sizeStyles = _ref2 => {
|
|
36
36
|
let {
|
|
37
37
|
theme,
|
|
38
|
-
validation
|
|
38
|
+
$validation
|
|
39
39
|
} = _ref2;
|
|
40
40
|
const fontSize = theme.fontSizes.sm;
|
|
41
41
|
const lineHeight = getLineHeight(theme.iconSizes.md, theme.fontSizes.sm);
|
|
42
42
|
const marginTop = `${theme.space.base}px`;
|
|
43
|
-
const paddingHorizontal = validation ? math(`${theme.space.base * 2} + ${theme.iconSizes.md}`) : undefined;
|
|
43
|
+
const paddingHorizontal = $validation ? math(`${theme.space.base * 2} + ${theme.iconSizes.md}`) : undefined;
|
|
44
44
|
return css(["padding-", ":", ";line-height:", ";font-size:", ";", ":not([hidden]) + &{margin-top:", ";}"], theme.rtl ? 'right' : 'left', paddingHorizontal, lineHeight, fontSize, StyledLabel, marginTop);
|
|
45
45
|
};
|
|
46
46
|
const StyledMessage = styled.div.attrs(props => ({
|
|
47
47
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
|
|
48
|
-
'data-garden-version': props['data-garden-version'] || '9.
|
|
48
|
+
'data-garden-version': props['data-garden-version'] || '9.1.1'
|
|
49
49
|
})).withConfig({
|
|
50
50
|
displayName: "StyledMessage",
|
|
51
51
|
componentId: "sc-30hgg7-0"
|
|
@@ -5,36 +5,12 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import
|
|
9
|
-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
10
|
-
import SvgAlertErrorStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js';
|
|
11
|
-
import SvgAlertWarningStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js';
|
|
12
|
-
import SvgCheckCircleStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js';
|
|
8
|
+
import { StyledBaseIcon, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
13
9
|
|
|
14
|
-
const MessageIcon = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
children,
|
|
17
|
-
validation,
|
|
18
|
-
...props
|
|
19
|
-
} = _ref;
|
|
20
|
-
let retVal;
|
|
21
|
-
if (validation === 'error') {
|
|
22
|
-
retVal = React__default.createElement(SvgAlertErrorStroke, props);
|
|
23
|
-
} else if (validation === 'success') {
|
|
24
|
-
retVal = React__default.createElement(SvgCheckCircleStroke, props);
|
|
25
|
-
} else if (validation === 'warning') {
|
|
26
|
-
retVal = React__default.createElement(SvgAlertWarningStroke, props);
|
|
27
|
-
} else {
|
|
28
|
-
retVal = React__default.cloneElement(Children.only(children));
|
|
29
|
-
}
|
|
30
|
-
return retVal;
|
|
31
|
-
};
|
|
32
10
|
const COMPONENT_ID = 'forms.input_message_icon';
|
|
33
|
-
const StyledMessageIcon = styled(
|
|
11
|
+
const StyledMessageIcon = styled(StyledBaseIcon).attrs({
|
|
34
12
|
'data-garden-id': COMPONENT_ID,
|
|
35
|
-
'data-garden-version': '9.
|
|
36
|
-
'aria-hidden': null,
|
|
37
|
-
role: 'img'
|
|
13
|
+
'data-garden-version': '9.1.1'
|
|
38
14
|
}).withConfig({
|
|
39
15
|
displayName: "StyledMessageIcon",
|
|
40
16
|
componentId: "sc-1ph2gba-0"
|
|
@@ -12,17 +12,17 @@ const COMPONENT_ID = 'forms.file';
|
|
|
12
12
|
const colorStyles = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
theme,
|
|
15
|
-
focusInset,
|
|
16
|
-
validation
|
|
15
|
+
$focusInset,
|
|
16
|
+
$validation
|
|
17
17
|
} = _ref;
|
|
18
18
|
let borderVariable;
|
|
19
19
|
let focusBorderVariable;
|
|
20
20
|
let foregroundVariable;
|
|
21
|
-
if (validation === 'success') {
|
|
21
|
+
if ($validation === 'success') {
|
|
22
22
|
borderVariable = 'border.successEmphasis';
|
|
23
23
|
focusBorderVariable = borderVariable;
|
|
24
24
|
foregroundVariable = 'foreground.success';
|
|
25
|
-
} else if (validation === 'error') {
|
|
25
|
+
} else if ($validation === 'error') {
|
|
26
26
|
borderVariable = 'border.dangerEmphasis';
|
|
27
27
|
focusBorderVariable = borderVariable;
|
|
28
28
|
foregroundVariable = 'foreground.danger';
|
|
@@ -45,7 +45,7 @@ const colorStyles = _ref => {
|
|
|
45
45
|
});
|
|
46
46
|
return css(["border-color:", ";color:", ";", ""], borderColor, foregroundColor, focusStyles({
|
|
47
47
|
theme,
|
|
48
|
-
inset: focusInset,
|
|
48
|
+
inset: $focusInset,
|
|
49
49
|
color: {
|
|
50
50
|
variable: focusBorderVariable
|
|
51
51
|
},
|
|
@@ -57,10 +57,10 @@ const colorStyles = _ref => {
|
|
|
57
57
|
const sizeStyles = _ref2 => {
|
|
58
58
|
let {
|
|
59
59
|
theme,
|
|
60
|
-
isCompact
|
|
60
|
+
$isCompact
|
|
61
61
|
} = _ref2;
|
|
62
|
-
const size = `${theme.space.base * (isCompact ? 7 : 10)}px`;
|
|
63
|
-
const spacing = `${theme.space.base * (isCompact ? 2 : 3)}px`;
|
|
62
|
+
const size = `${theme.space.base * ($isCompact ? 7 : 10)}px`;
|
|
63
|
+
const spacing = `${theme.space.base * ($isCompact ? 2 : 3)}px`;
|
|
64
64
|
const fontSize = theme.fontSizes.md;
|
|
65
65
|
const lineHeight = getLineHeight(theme.space.base * 5, fontSize);
|
|
66
66
|
return `
|
|
@@ -85,7 +85,7 @@ const sizeStyles = _ref2 => {
|
|
|
85
85
|
};
|
|
86
86
|
const StyledFile = styled.div.attrs({
|
|
87
87
|
'data-garden-id': COMPONENT_ID,
|
|
88
|
-
'data-garden-version': '9.
|
|
88
|
+
'data-garden-version': '9.1.1'
|
|
89
89
|
}).withConfig({
|
|
90
90
|
displayName: "StyledFile",
|
|
91
91
|
componentId: "sc-195lzp1-0"
|
|
@@ -10,7 +10,7 @@ import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming'
|
|
|
10
10
|
const COMPONENT_ID = 'forms.file.close';
|
|
11
11
|
const StyledFileClose = styled.button.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.
|
|
13
|
+
'data-garden-version': '9.1.1'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledFileClose",
|
|
16
16
|
componentId: "sc-1m31jbf-0"
|
|
@@ -11,7 +11,7 @@ import { StyledFileClose } from './StyledFileClose.js';
|
|
|
11
11
|
const COMPONENT_ID = 'forms.file.delete';
|
|
12
12
|
const StyledFileDelete = styled(StyledFileClose).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: "StyledFileDelete",
|
|
17
17
|
componentId: "sc-a8nnhx-0"
|
|
@@ -30,7 +30,7 @@ const sizeStyles = _ref2 => {
|
|
|
30
30
|
};
|
|
31
31
|
const StyledFileIcon = styled(StyledBaseIcon).attrs({
|
|
32
32
|
'data-garden-id': COMPONENT_ID,
|
|
33
|
-
'data-garden-version': '9.
|
|
33
|
+
'data-garden-version': '9.1.1'
|
|
34
34
|
}).withConfig({
|
|
35
35
|
displayName: "StyledFileIcon",
|
|
36
36
|
componentId: "sc-7b3q0c-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
10
10
|
const COMPONENT_ID = 'forms.file_list';
|
|
11
11
|
const StyledFileList = styled.ul.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.
|
|
13
|
+
'data-garden-version': '9.1.1'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledFileList",
|
|
16
16
|
componentId: "sc-gbahjg-0"
|
|
@@ -12,7 +12,7 @@ import { StyledFileUpload } from '../file-upload/StyledFileUpload.js';
|
|
|
12
12
|
const COMPONENT_ID = 'forms.file_list.item';
|
|
13
13
|
const StyledFileListItem = styled.li.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: "StyledFileListItem",
|
|
18
18
|
componentId: "sc-1ova3lo-0"
|
|
@@ -15,7 +15,7 @@ const COMPONENT_ID = 'forms.file_upload';
|
|
|
15
15
|
const colorStyles = _ref => {
|
|
16
16
|
let {
|
|
17
17
|
theme,
|
|
18
|
-
isDragging
|
|
18
|
+
$isDragging
|
|
19
19
|
} = _ref;
|
|
20
20
|
const borderOptions = {
|
|
21
21
|
theme,
|
|
@@ -86,25 +86,25 @@ const colorStyles = _ref => {
|
|
|
86
86
|
theme,
|
|
87
87
|
variable: 'foreground.disabled'
|
|
88
88
|
});
|
|
89
|
-
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:", ";}"], isDragging ? activeBorderColor : borderColor, isDragging ? activeBackgroundColor : undefined, isDragging ? activeForegroundColor : foregroundColor, hoverBorderColor, hoverBackgroundColor, hoverForegroundColor, focusStyles({
|
|
89
|
+
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:", ";}"], $isDragging ? activeBorderColor : borderColor, $isDragging ? activeBackgroundColor : undefined, $isDragging ? activeForegroundColor : foregroundColor, hoverBorderColor, hoverBackgroundColor, hoverForegroundColor, focusStyles({
|
|
90
90
|
theme
|
|
91
91
|
}), activeBorderColor, activeBackgroundColor, activeForegroundColor, disabledBorderColor, disabledBackgroundColor, disabledForegroundColor);
|
|
92
92
|
};
|
|
93
93
|
const sizeStyles = _ref2 => {
|
|
94
94
|
let {
|
|
95
95
|
theme,
|
|
96
|
-
isCompact
|
|
96
|
+
$isCompact
|
|
97
97
|
} = _ref2;
|
|
98
|
-
const marginTop = `${theme.space.base * (isCompact ? 1 : 2)}px`;
|
|
99
|
-
const paddingHorizontal = `${isCompact ? 2 : 4}em`;
|
|
100
|
-
const paddingVertical = math(`${theme.space.base * (isCompact ? 2.5 : 5)} - ${theme.borderWidths.sm}`);
|
|
98
|
+
const marginTop = `${theme.space.base * ($isCompact ? 1 : 2)}px`;
|
|
99
|
+
const paddingHorizontal = `${$isCompact ? 2 : 4}em`;
|
|
100
|
+
const paddingVertical = math(`${theme.space.base * ($isCompact ? 2.5 : 5)} - ${theme.borderWidths.sm}`);
|
|
101
101
|
const fontSize = theme.fontSizes.md;
|
|
102
102
|
const lineHeight = getLineHeight(theme.space.base * 5, fontSize);
|
|
103
103
|
return css(["padding:", " ", ";min-width:4em;line-height:", ";font-size:", ";", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}"], paddingVertical, paddingHorizontal, lineHeight, fontSize, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, marginTop);
|
|
104
104
|
};
|
|
105
105
|
const StyledFileUpload = styled.div.attrs({
|
|
106
106
|
'data-garden-id': COMPONENT_ID,
|
|
107
|
-
'data-garden-version': '9.
|
|
107
|
+
'data-garden-version': '9.1.1'
|
|
108
108
|
}).withConfig({
|
|
109
109
|
displayName: "StyledFileUpload",
|
|
110
110
|
componentId: "sc-1rodjgn-0"
|
|
@@ -13,7 +13,7 @@ import { StyledMessage } from '../common/StyledMessage.js';
|
|
|
13
13
|
|
|
14
14
|
const COMPONENT_ID = 'forms.input_group';
|
|
15
15
|
const positionStyles = props => {
|
|
16
|
-
const topMargin = `${props.theme.space.base * (props
|
|
16
|
+
const topMargin = `${props.theme.space.base * (props.$isCompact ? 1 : 2)}px`;
|
|
17
17
|
return css(["", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}& > ", "{position:relative;flex:1 1 auto;margin-top:0;margin-bottom:0;width:auto;min-width:0;}"], StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, topMargin, StyledTextInput);
|
|
18
18
|
};
|
|
19
19
|
const itemStyles = props => {
|
|
@@ -23,7 +23,7 @@ const itemStyles = props => {
|
|
|
23
23
|
};
|
|
24
24
|
const StyledInputGroup = styled.div.attrs({
|
|
25
25
|
'data-garden-id': COMPONENT_ID,
|
|
26
|
-
'data-garden-version': '9.
|
|
26
|
+
'data-garden-version': '9.1.1'
|
|
27
27
|
}).withConfig({
|
|
28
28
|
displayName: "StyledInputGroup",
|
|
29
29
|
componentId: "sc-kjh1f0-0"
|
|
@@ -12,7 +12,7 @@ import { StyledHint } from '../common/StyledHint.js';
|
|
|
12
12
|
const COMPONENT_ID = 'forms.radio_hint';
|
|
13
13
|
const StyledRadioHint = 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: "StyledRadioHint",
|
|
18
18
|
componentId: "sc-eo8twg-0"
|
|
@@ -96,7 +96,7 @@ const colorStyles = _ref => {
|
|
|
96
96
|
const sizeStyles = _ref2 => {
|
|
97
97
|
let {
|
|
98
98
|
theme,
|
|
99
|
-
isCompact
|
|
99
|
+
$isCompact
|
|
100
100
|
} = _ref2;
|
|
101
101
|
const lineHeight = `${theme.space.base * 5}px`;
|
|
102
102
|
const size = `${theme.space.base * 4}px`;
|
|
@@ -104,12 +104,12 @@ const sizeStyles = _ref2 => {
|
|
|
104
104
|
const iconSize = theme.iconSizes.sm;
|
|
105
105
|
const iconPosition = math(`(${size} - ${iconSize}) / 2`);
|
|
106
106
|
const iconTop = math(`${iconPosition} + ${top}`);
|
|
107
|
-
const marginTop = `${theme.space.base * (isCompact ? 1 : 2)}px`;
|
|
107
|
+
const marginTop = `${theme.space.base * ($isCompact ? 1 : 2)}px`;
|
|
108
108
|
return css(["top:", ";width:", ";height:", ";& ~ ", "::before{top:", ";border:", ";background-size:", ";width:", ";height:", ";box-sizing:border-box;}& ~ ", " > svg{top:", ";", ":", ";width:", ";height:", ";}&& ~ ", " ~ ", "{margin-top:", ";}"], top, size, size, StyledRadioLabel, top, theme.borders.sm, theme.iconSizes.sm, size, size, StyledRadioLabel, iconTop, theme.rtl ? 'right' : 'left', iconPosition, iconSize, iconSize, StyledRadioLabel, StyledMessage, marginTop);
|
|
109
109
|
};
|
|
110
110
|
const StyledRadioInput = styled.input.attrs({
|
|
111
111
|
'data-garden-id': COMPONENT_ID,
|
|
112
|
-
'data-garden-version': '9.
|
|
112
|
+
'data-garden-version': '9.1.1',
|
|
113
113
|
type: 'radio'
|
|
114
114
|
}).withConfig({
|
|
115
115
|
displayName: "StyledRadioInput",
|
|
@@ -17,8 +17,8 @@ const sizeStyles = props => {
|
|
|
17
17
|
};
|
|
18
18
|
const StyledRadioLabel = styled(StyledLabel).attrs({
|
|
19
19
|
'data-garden-id': COMPONENT_ID,
|
|
20
|
-
'data-garden-version': '9.
|
|
21
|
-
isRadio: true
|
|
20
|
+
'data-garden-version': '9.1.1',
|
|
21
|
+
$isRadio: true
|
|
22
22
|
}).withConfig({
|
|
23
23
|
displayName: "StyledRadioLabel",
|
|
24
24
|
componentId: "sc-1aq2e5t-0"
|
|
@@ -12,7 +12,7 @@ import { StyledMessage } from '../common/StyledMessage.js';
|
|
|
12
12
|
const COMPONENT_ID = 'forms.radio_message';
|
|
13
13
|
const StyledRadioMessage = styled(StyledMessage).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: "StyledRadioMessage",
|
|
18
18
|
componentId: "sc-1pmi0q8-0"
|
|
@@ -13,7 +13,7 @@ import { StyledRadioLabel } from './StyledRadioLabel.js';
|
|
|
13
13
|
const COMPONENT_ID = 'forms.radio_svg';
|
|
14
14
|
const StyledRadioSvg = styled(SvgCircleSmFill).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: "StyledRadioSvg",
|
|
19
19
|
componentId: "sc-1r1qtr1-0"
|