@zendeskgarden/react-forms 9.0.0-next.9 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/MediaInput.js +2 -2
- package/dist/esm/elements/Radio.js +4 -3
- package/dist/esm/elements/Range.js +9 -9
- package/dist/esm/elements/Select.js +9 -8
- package/dist/esm/elements/Textarea.js +24 -14
- package/dist/esm/elements/Toggle.js +4 -3
- package/dist/esm/elements/common/Fieldset.js +10 -5
- package/dist/esm/elements/common/Hint.js +1 -1
- package/dist/esm/elements/common/Label.js +35 -33
- package/dist/esm/elements/common/Legend.js +1 -3
- package/dist/esm/elements/common/Message.js +7 -6
- package/dist/esm/elements/common/MessageIcon.js +78 -0
- package/dist/esm/elements/faux-input/FauxInput.js +20 -8
- package/dist/esm/elements/faux-input/components/EndIcon.js +4 -0
- package/dist/esm/elements/faux-input/components/StartIcon.js +4 -0
- package/dist/esm/elements/file-list/components/File.js +6 -5
- 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/elements/tiles/components/Tile.js +1 -3
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-circle-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-sm-fill.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/circle-sm-fill.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/dash-fill.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-document-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-error-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-generic-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-image-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-pdf-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-presentation-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-spreadsheet-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-zip-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/trash-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/x-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/circle-sm-fill.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-document-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-error-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-generic-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-image-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-pdf-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-presentation-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-spreadsheet-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-zip-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/trash-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +1 -1
- package/dist/esm/styled/checkbox/StyledCheckHint.js +2 -5
- package/dist/esm/styled/checkbox/StyledCheckInput.js +55 -14
- package/dist/esm/styled/checkbox/StyledCheckLabel.js +2 -5
- package/dist/esm/styled/checkbox/StyledCheckMessage.js +2 -5
- package/dist/esm/styled/checkbox/StyledCheckSvg.js +2 -5
- package/dist/esm/styled/checkbox/StyledDashSvg.js +2 -5
- package/dist/esm/styled/common/StyledField.js +2 -5
- package/dist/esm/styled/common/StyledFieldset.js +3 -6
- package/dist/esm/styled/common/StyledHint.js +6 -6
- package/dist/esm/styled/common/StyledLabel.js +6 -6
- package/dist/esm/styled/common/StyledLegend.js +2 -5
- package/dist/esm/styled/common/StyledMessage.js +33 -19
- package/dist/esm/styled/common/StyledMessageIcon.js +3 -29
- package/dist/esm/styled/file-list/StyledFile.js +49 -31
- package/dist/esm/styled/file-list/StyledFileClose.js +6 -6
- package/dist/esm/styled/file-list/StyledFileDelete.js +6 -6
- package/dist/esm/styled/file-list/StyledFileIcon.js +24 -7
- package/dist/esm/styled/file-list/StyledFileList.js +2 -5
- package/dist/esm/styled/file-list/StyledFileListItem.js +2 -5
- package/dist/esm/styled/file-upload/StyledFileUpload.js +89 -23
- package/dist/esm/styled/input-group/StyledInputGroup.js +3 -6
- package/dist/esm/styled/radio/StyledRadioHint.js +2 -5
- package/dist/esm/styled/radio/StyledRadioInput.js +85 -27
- package/dist/esm/styled/radio/StyledRadioLabel.js +3 -6
- package/dist/esm/styled/radio/StyledRadioMessage.js +2 -5
- package/dist/esm/styled/radio/StyledRadioSvg.js +2 -5
- package/dist/esm/styled/range/StyledRangeInput.js +79 -29
- package/dist/esm/styled/select/StyledSelect.js +35 -14
- package/dist/esm/styled/select/StyledSelectWrapper.js +12 -7
- package/dist/esm/styled/text/StyledTextFauxInput.js +40 -35
- package/dist/esm/styled/text/StyledTextInput.js +104 -62
- package/dist/esm/styled/text/StyledTextMediaFigure.js +35 -13
- package/dist/esm/styled/text/StyledTextMediaInput.js +3 -6
- package/dist/esm/styled/text/StyledTextarea.js +3 -6
- package/dist/esm/styled/tiles/StyledTile.js +93 -37
- package/dist/esm/styled/tiles/StyledTileDescription.js +13 -16
- package/dist/esm/styled/tiles/StyledTileIcon.js +52 -16
- package/dist/esm/styled/tiles/StyledTileInput.js +1 -5
- package/dist/esm/styled/tiles/StyledTileLabel.js +13 -18
- package/dist/esm/styled/toggle/StyledToggleHint.js +2 -5
- package/dist/esm/styled/toggle/StyledToggleInput.js +38 -16
- package/dist/esm/styled/toggle/StyledToggleLabel.js +2 -5
- package/dist/esm/styled/toggle/StyledToggleMessage.js +2 -5
- package/dist/esm/styled/toggle/StyledToggleSvg.js +2 -5
- package/dist/index.cjs.js +1212 -773
- package/dist/typings/elements/common/Field.d.ts +1 -1
- package/dist/typings/elements/common/Fieldset.d.ts +3 -1
- package/dist/typings/elements/common/MessageIcon.d.ts +9 -0
- package/dist/typings/elements/faux-input/FauxInput.d.ts +3 -1
- package/dist/typings/elements/faux-input/components/EndIcon.d.ts +1 -1
- package/dist/typings/elements/faux-input/components/StartIcon.d.ts +1 -1
- package/dist/typings/elements/file-list/FileList.d.ts +3 -1
- package/dist/typings/elements/file-list/components/File.d.ts +3 -1
- package/dist/typings/elements/tiles/Tiles.d.ts +3 -1
- 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 -9
- package/dist/typings/styled/file-list/StyledFile.d.ts +3 -3
- package/dist/typings/styled/file-list/StyledFileIcon.d.ts +7 -2
- 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/select/StyledSelect.d.ts +0 -3
- package/dist/typings/styled/select/StyledSelectWrapper.d.ts +3 -1
- package/dist/typings/styled/text/StyledTextFauxInput.d.ts +3 -7
- package/dist/typings/styled/text/StyledTextInput.d.ts +6 -6
- package/dist/typings/styled/text/StyledTextMediaFigure.d.ts +1 -2
- 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/StyledTile.d.ts +4 -7
- 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 +9 -3
- package/dist/typings/utils/useFieldContext.d.ts +0 -1
- package/dist/typings/utils/useFieldsetContext.d.ts +0 -1
- package/dist/typings/utils/useFileContext.d.ts +0 -1
- package/dist/typings/utils/useInputContext.d.ts +0 -1
- package/dist/typings/utils/useInputGroupContext.d.ts +0 -1
- package/dist/typings/utils/useTilesContext.d.ts +0 -1
- package/package.json +8 -8
|
@@ -6,20 +6,17 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import SvgDashFill from '../../node_modules/@zendeskgarden/svg-icons/src/12/dash-fill.svg.js';
|
|
9
|
-
import { retrieveComponentStyles
|
|
9
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { StyledCheckInput } from './StyledCheckInput.js';
|
|
11
11
|
import { StyledCheckLabel } from './StyledCheckLabel.js';
|
|
12
12
|
|
|
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.0'
|
|
17
17
|
}).withConfig({
|
|
18
18
|
displayName: "StyledDashSvg",
|
|
19
19
|
componentId: "sc-z3vq71-0"
|
|
20
20
|
})(["transition:opacity 0.25s ease-in-out;opacity:0;pointer-events:none;", ":indeterminate ~ ", " > &{opacity:1;}", ";"], StyledCheckInput, StyledCheckLabel, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
|
-
StyledDashSvg.defaultProps = {
|
|
22
|
-
theme: DEFAULT_THEME
|
|
23
|
-
};
|
|
24
21
|
|
|
25
22
|
export { StyledDashSvg };
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
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.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledField",
|
|
16
16
|
componentId: "sc-12gzfsu-0"
|
|
17
17
|
})(["position:relative;direction:", ";margin:0;border:0;padding:0;font-size:0;", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledField.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledField };
|
|
@@ -5,20 +5,17 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledField } from './StyledField.js';
|
|
10
10
|
|
|
11
11
|
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.0'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledFieldset",
|
|
18
18
|
componentId: "sc-1vr4mxv-0"
|
|
19
|
-
})(["", "{margin-top:", "px;}", ";"], StyledField, props => props.theme.space.base * (props
|
|
20
|
-
StyledFieldset.defaultProps = {
|
|
21
|
-
theme: DEFAULT_THEME
|
|
22
|
-
};
|
|
19
|
+
})(["", "{margin-top:", "px;}", ";"], StyledField, props => props.theme.space.base * (props.$isCompact ? 1 : 2), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
23
20
|
|
|
24
21
|
export { StyledFieldset };
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { getLineHeight,
|
|
8
|
+
import { getLineHeight, getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
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.0'
|
|
14
14
|
})).withConfig({
|
|
15
15
|
displayName: "StyledHint",
|
|
16
16
|
componentId: "sc-17c2wu8-0"
|
|
17
|
-
})(["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 =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
})(["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 => getColor({
|
|
18
|
+
theme: props.theme,
|
|
19
|
+
variable: 'foreground.subtle'
|
|
20
|
+
}), props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
21
|
|
|
22
22
|
export { StyledHint };
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { hideVisually } from 'polished';
|
|
9
|
-
import { getLineHeight,
|
|
9
|
+
import { getLineHeight, getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
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.0'
|
|
15
15
|
})).withConfig({
|
|
16
16
|
displayName: "StyledLabel",
|
|
17
17
|
componentId: "sc-2utmsz-0"
|
|
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 =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
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
|
+
theme: props.theme,
|
|
20
|
+
variable: 'foreground.default'
|
|
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 };
|
|
@@ -5,20 +5,17 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledLabel } from './StyledLabel.js';
|
|
10
10
|
|
|
11
11
|
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.0'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledLegend",
|
|
18
18
|
componentId: "sc-6s0zwq-0"
|
|
19
19
|
})(["padding:0;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
|
-
StyledLegend.defaultProps = {
|
|
21
|
-
theme: DEFAULT_THEME
|
|
22
|
-
};
|
|
23
20
|
|
|
24
21
|
export { StyledLegend };
|
|
@@ -6,35 +6,49 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import {
|
|
9
|
+
import { retrieveComponentStyles, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { StyledMessageIcon } from './StyledMessageIcon.js';
|
|
11
11
|
import { StyledLabel } from './StyledLabel.js';
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
const COMPONENT_ID = 'forms.input_message';
|
|
14
|
+
const colorStyles = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
theme,
|
|
17
|
+
$validation
|
|
18
|
+
} = _ref;
|
|
19
|
+
let variable;
|
|
20
|
+
if ($validation === 'error') {
|
|
21
|
+
variable = 'foreground.danger';
|
|
22
|
+
} else if ($validation === 'success') {
|
|
23
|
+
variable = 'foreground.success';
|
|
24
|
+
} else if ($validation === 'warning') {
|
|
25
|
+
variable = 'foreground.warning';
|
|
23
26
|
} else {
|
|
24
|
-
|
|
27
|
+
variable = 'foreground.subtle';
|
|
25
28
|
}
|
|
26
|
-
|
|
29
|
+
const foregroundColor = getColor({
|
|
30
|
+
theme,
|
|
31
|
+
variable
|
|
32
|
+
});
|
|
33
|
+
return css(["color:", ";"], foregroundColor);
|
|
34
|
+
};
|
|
35
|
+
const sizeStyles = _ref2 => {
|
|
36
|
+
let {
|
|
37
|
+
theme,
|
|
38
|
+
$validation
|
|
39
|
+
} = _ref2;
|
|
40
|
+
const fontSize = theme.fontSizes.sm;
|
|
41
|
+
const lineHeight = getLineHeight(theme.iconSizes.md, theme.fontSizes.sm);
|
|
42
|
+
const marginTop = `${theme.space.base}px`;
|
|
43
|
+
const paddingHorizontal = $validation ? math(`${theme.space.base * 2} + ${theme.iconSizes.md}`) : undefined;
|
|
44
|
+
return css(["padding-", ":", ";line-height:", ";font-size:", ";", ":not([hidden]) + &{margin-top:", ";}"], theme.rtl ? 'right' : 'left', paddingHorizontal, lineHeight, fontSize, StyledLabel, marginTop);
|
|
27
45
|
};
|
|
28
|
-
const COMPONENT_ID = 'forms.input_message';
|
|
29
46
|
const StyledMessage = styled.div.attrs(props => ({
|
|
30
47
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
|
|
31
|
-
'data-garden-version': props['data-garden-version'] || '9.
|
|
48
|
+
'data-garden-version': props['data-garden-version'] || '9.1.0'
|
|
32
49
|
})).withConfig({
|
|
33
50
|
displayName: "StyledMessage",
|
|
34
51
|
componentId: "sc-30hgg7-0"
|
|
35
|
-
})(["direction:", ";display:inline-block;position:relative;vertical-align:middle;
|
|
36
|
-
StyledMessage.defaultProps = {
|
|
37
|
-
theme: DEFAULT_THEME
|
|
38
|
-
};
|
|
52
|
+
})(["direction:", ";display:inline-block;position:relative;vertical-align:middle;", ";", ";& ", "{position:absolute;top:-1px;", ":0;}", ":not([hidden]) + &{display:block;}", ";"], props => props.theme.rtl && 'rtl', sizeStyles, colorStyles, StyledMessageIcon, props => props.theme.rtl ? 'right' : 'left', StyledLabel, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
39
53
|
|
|
40
54
|
export { StyledMessage };
|
|
@@ -5,41 +5,15 @@
|
|
|
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, DEFAULT_THEME } 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
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
37
14
|
}).withConfig({
|
|
38
15
|
displayName: "StyledMessageIcon",
|
|
39
16
|
componentId: "sc-1ph2gba-0"
|
|
40
17
|
})(["width:", ";height:", ";", ";"], props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
41
|
-
StyledMessageIcon.defaultProps = {
|
|
42
|
-
theme: DEFAULT_THEME
|
|
43
|
-
};
|
|
44
18
|
|
|
45
19
|
export { StyledMessageIcon };
|
|
@@ -5,47 +5,68 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getColor, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledFileClose } from './StyledFileClose.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'forms.file';
|
|
12
|
-
const colorStyles =
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
$focusInset,
|
|
16
|
+
$validation
|
|
17
|
+
} = _ref;
|
|
18
|
+
let borderVariable;
|
|
19
|
+
let focusBorderVariable;
|
|
20
|
+
let foregroundVariable;
|
|
21
|
+
if ($validation === 'success') {
|
|
22
|
+
borderVariable = 'border.successEmphasis';
|
|
23
|
+
focusBorderVariable = borderVariable;
|
|
24
|
+
foregroundVariable = 'foreground.success';
|
|
25
|
+
} else if ($validation === 'error') {
|
|
26
|
+
borderVariable = 'border.dangerEmphasis';
|
|
27
|
+
focusBorderVariable = borderVariable;
|
|
28
|
+
foregroundVariable = 'foreground.danger';
|
|
24
29
|
} else {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
borderVariable = 'border.default';
|
|
31
|
+
focusBorderVariable = 'border.primaryEmphasis';
|
|
32
|
+
foregroundVariable = 'foreground.default';
|
|
28
33
|
}
|
|
34
|
+
const borderColor = getColor({
|
|
35
|
+
theme,
|
|
36
|
+
variable: borderVariable
|
|
37
|
+
});
|
|
38
|
+
const focusBorderColor = getColor({
|
|
39
|
+
theme,
|
|
40
|
+
variable: focusBorderVariable
|
|
41
|
+
});
|
|
42
|
+
const foregroundColor = getColor({
|
|
43
|
+
theme,
|
|
44
|
+
variable: foregroundVariable
|
|
45
|
+
});
|
|
29
46
|
return css(["border-color:", ";color:", ";", ""], borderColor, foregroundColor, focusStyles({
|
|
30
|
-
theme
|
|
31
|
-
inset:
|
|
47
|
+
theme,
|
|
48
|
+
inset: $focusInset,
|
|
32
49
|
color: {
|
|
33
|
-
|
|
50
|
+
variable: focusBorderVariable
|
|
34
51
|
},
|
|
35
52
|
styles: {
|
|
36
53
|
borderColor: focusBorderColor
|
|
37
54
|
}
|
|
38
55
|
}));
|
|
39
56
|
};
|
|
40
|
-
const sizeStyles =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
const sizeStyles = _ref2 => {
|
|
58
|
+
let {
|
|
59
|
+
theme,
|
|
60
|
+
$isCompact
|
|
61
|
+
} = _ref2;
|
|
62
|
+
const size = `${theme.space.base * ($isCompact ? 7 : 10)}px`;
|
|
63
|
+
const spacing = `${theme.space.base * ($isCompact ? 2 : 3)}px`;
|
|
64
|
+
const fontSize = theme.fontSizes.md;
|
|
65
|
+
const lineHeight = getLineHeight(theme.space.base * 5, fontSize);
|
|
45
66
|
return `
|
|
46
67
|
box-sizing: border-box;
|
|
47
|
-
border: ${
|
|
48
|
-
border-radius: ${
|
|
68
|
+
border: ${theme.borders.sm};
|
|
69
|
+
border-radius: ${theme.borderRadii.md};
|
|
49
70
|
padding: 0 ${spacing};
|
|
50
71
|
height: ${size};
|
|
51
72
|
line-height: ${lineHeight};
|
|
@@ -58,19 +79,16 @@ const sizeStyles = props => {
|
|
|
58
79
|
& > ${StyledFileClose} {
|
|
59
80
|
width: ${size};
|
|
60
81
|
height: ${size};
|
|
61
|
-
margin-${
|
|
82
|
+
margin-${theme.rtl ? 'left' : 'right'}: -${spacing};
|
|
62
83
|
}
|
|
63
84
|
`;
|
|
64
85
|
};
|
|
65
86
|
const StyledFile = styled.div.attrs({
|
|
66
87
|
'data-garden-id': COMPONENT_ID,
|
|
67
|
-
'data-garden-version': '9.
|
|
88
|
+
'data-garden-version': '9.1.0'
|
|
68
89
|
}).withConfig({
|
|
69
90
|
displayName: "StyledFile",
|
|
70
91
|
componentId: "sc-195lzp1-0"
|
|
71
92
|
})(["display:flex;position:relative;flex-wrap:nowrap;align-items:center;transition:box-shadow 0.1s ease-in-out;", ";", ";& > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}& > [role='progressbar']{position:absolute;bottom:0;left:0;transition:opacity 0.2s ease-in-out;margin:0;border-top-left-radius:0;border-top-right-radius:0;width:100%;& > div{border-top-", "-radius:0;}}& > [role='progressbar'][aria-valuenow='0'],& > [role='progressbar'][aria-valuenow='100']{opacity:0;}", ";"], sizeStyles, colorStyles, props => props.theme.rtl ? 'right' : 'left', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
72
|
-
StyledFile.defaultProps = {
|
|
73
|
-
theme: DEFAULT_THEME
|
|
74
|
-
};
|
|
75
93
|
|
|
76
94
|
export { StyledFile };
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
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.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledFileClose",
|
|
16
16
|
componentId: "sc-1m31jbf-0"
|
|
17
|
-
})(["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 =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
})(["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 => getColor({
|
|
18
|
+
theme: props.theme,
|
|
19
|
+
variable: 'foreground.subtle'
|
|
20
|
+
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
21
|
|
|
22
22
|
export { StyledFileClose };
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledFileClose } from './StyledFileClose.js';
|
|
10
10
|
|
|
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.0'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledFileDelete",
|
|
17
17
|
componentId: "sc-a8nnhx-0"
|
|
18
|
-
})(["color:", ";", ";"], props =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
18
|
+
})(["color:", ";", ";"], props => getColor({
|
|
19
|
+
theme: props.theme,
|
|
20
|
+
variable: 'foreground.danger'
|
|
21
|
+
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
22
22
|
|
|
23
23
|
export { StyledFileDelete };
|
|
@@ -4,19 +4,36 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
import { StyledBaseIcon, retrieveComponentStyles,
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { StyledBaseIcon, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'forms.file.icon';
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
theme,
|
|
14
|
+
$validation
|
|
15
|
+
} = _ref;
|
|
16
|
+
const color = $validation ? undefined : getColor({
|
|
17
|
+
theme,
|
|
18
|
+
variable: 'foreground.subtle'
|
|
19
|
+
});
|
|
20
|
+
return css(["color:", ";"], color);
|
|
21
|
+
};
|
|
22
|
+
const sizeStyles = _ref2 => {
|
|
23
|
+
let {
|
|
24
|
+
$isCompact,
|
|
25
|
+
theme
|
|
26
|
+
} = _ref2;
|
|
27
|
+
const width = $isCompact ? theme.iconSizes.sm : theme.iconSizes.md;
|
|
28
|
+
const margin = `${theme.space.base * 2}px`;
|
|
29
|
+
return css(["width:", ";margin-", ":", ";"], width, theme.rtl ? 'left' : 'right', margin);
|
|
30
|
+
};
|
|
11
31
|
const StyledFileIcon = styled(StyledBaseIcon).attrs({
|
|
12
32
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.
|
|
33
|
+
'data-garden-version': '9.1.0'
|
|
14
34
|
}).withConfig({
|
|
15
35
|
displayName: "StyledFileIcon",
|
|
16
36
|
componentId: "sc-7b3q0c-0"
|
|
17
|
-
})(["flex-shrink:0;
|
|
18
|
-
StyledFileIcon.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
37
|
+
})(["flex-shrink:0;", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
38
|
|
|
22
39
|
export { StyledFileIcon };
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
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.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledFileList",
|
|
16
16
|
componentId: "sc-gbahjg-0"
|
|
17
17
|
})(["margin:0;padding:0;list-style:none;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledFileList.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledFileList };
|
|
@@ -5,20 +5,17 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledFileList } from './StyledFileList.js';
|
|
10
10
|
import { StyledFileUpload } from '../file-upload/StyledFileUpload.js';
|
|
11
11
|
|
|
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.0'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledFileListItem",
|
|
18
18
|
componentId: "sc-1ova3lo-0"
|
|
19
19
|
})(["&:not(:first-child),", " ~ ", " > &:first-child{margin-top:", "px;}", ";"], StyledFileUpload, StyledFileList, props => props.theme.space.base * 2, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
|
-
StyledFileListItem.defaultProps = {
|
|
21
|
-
theme: DEFAULT_THEME
|
|
22
|
-
};
|
|
23
20
|
|
|
24
21
|
export { StyledFileListItem };
|