@zendeskgarden/react-forms 9.0.0-next.6 → 9.0.0-next.8
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 +97 -0
- package/dist/esm/elements/FileUpload.js +75 -0
- package/dist/esm/elements/Input.js +93 -0
- package/dist/esm/elements/MediaInput.js +156 -0
- package/dist/esm/elements/Radio.js +81 -0
- package/dist/esm/elements/Range.js +108 -0
- package/dist/esm/elements/Select.js +97 -0
- package/dist/esm/elements/Textarea.js +170 -0
- package/dist/esm/elements/Toggle.js +81 -0
- package/dist/esm/elements/common/Field.js +97 -0
- package/dist/esm/elements/common/Fieldset.js +73 -0
- package/dist/esm/elements/common/Hint.js +92 -0
- package/dist/esm/elements/common/Label.js +134 -0
- package/dist/esm/elements/common/Legend.js +63 -0
- package/dist/esm/elements/common/Message.js +113 -0
- package/dist/esm/elements/faux-input/FauxInput.js +100 -0
- package/dist/esm/elements/faux-input/components/EndIcon.js +59 -0
- package/dist/esm/elements/faux-input/components/StartIcon.js +59 -0
- package/dist/esm/elements/file-list/FileList.js +66 -0
- package/dist/esm/elements/file-list/components/Close.js +75 -0
- package/dist/esm/elements/file-list/components/Delete.js +75 -0
- package/dist/esm/elements/file-list/components/File.js +94 -0
- package/dist/esm/elements/file-list/components/Item.js +64 -0
- package/dist/esm/elements/file-list/utils.js +50 -0
- package/dist/esm/elements/input-group/InputGroup.js +75 -0
- package/dist/esm/elements/tiles/Tiles.js +64 -0
- package/dist/esm/elements/tiles/components/Description.js +64 -0
- package/dist/esm/elements/tiles/components/Icon.js +64 -0
- package/dist/esm/elements/tiles/components/Label.js +73 -0
- package/dist/esm/elements/tiles/components/Tile.js +91 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-circle-stroke.svg.js +33 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-sm-fill.svg.js +29 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/circle-sm-fill.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/dash-fill.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-document-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-error-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-generic-stroke.svg.js +26 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-image-stroke.svg.js +33 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-pdf-stroke.svg.js +35 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-presentation-stroke.svg.js +26 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-spreadsheet-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-zip-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/trash-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/x-stroke.svg.js +26 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +37 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js +32 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js +33 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +25 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/circle-sm-fill.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-document-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-error-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-generic-stroke.svg.js +26 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-image-stroke.svg.js +32 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-pdf-stroke.svg.js +35 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-presentation-stroke.svg.js +26 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-spreadsheet-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-zip-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/trash-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
- package/dist/esm/styled/checkbox/StyledCheckHint.js +23 -0
- package/dist/esm/styled/checkbox/StyledCheckInput.js +34 -0
- package/dist/esm/styled/checkbox/StyledCheckLabel.js +23 -0
- package/dist/esm/styled/checkbox/StyledCheckMessage.js +23 -0
- package/dist/esm/styled/checkbox/StyledCheckSvg.js +25 -0
- package/dist/esm/styled/checkbox/StyledDashSvg.js +25 -0
- package/dist/esm/styled/common/StyledField.js +22 -0
- package/dist/esm/styled/common/StyledFieldset.js +24 -0
- package/dist/esm/styled/common/StyledHint.js +22 -0
- package/dist/esm/styled/common/StyledLabel.js +23 -0
- package/dist/esm/styled/common/StyledLegend.js +24 -0
- package/dist/esm/styled/common/StyledMessage.js +40 -0
- package/dist/esm/styled/common/StyledMessageIcon.js +45 -0
- package/dist/esm/styled/file-list/StyledFile.js +76 -0
- package/dist/esm/styled/file-list/StyledFileClose.js +22 -0
- package/dist/esm/styled/file-list/StyledFileDelete.js +23 -0
- package/dist/esm/styled/file-list/StyledFileIcon.js +31 -0
- package/dist/esm/styled/file-list/StyledFileList.js +22 -0
- package/dist/esm/styled/file-list/StyledFileListItem.js +24 -0
- package/dist/esm/styled/file-upload/StyledFileUpload.js +47 -0
- package/dist/esm/styled/input-group/StyledInputGroup.js +35 -0
- package/dist/esm/styled/radio/StyledRadioHint.js +24 -0
- package/dist/esm/styled/radio/StyledRadioInput.js +61 -0
- package/dist/esm/styled/radio/StyledRadioLabel.js +30 -0
- package/dist/esm/styled/radio/StyledRadioMessage.js +24 -0
- package/dist/esm/styled/radio/StyledRadioSvg.js +25 -0
- package/dist/esm/styled/range/StyledRangeInput.js +160 -0
- package/dist/esm/styled/select/StyledSelect.js +36 -0
- package/dist/esm/styled/select/StyledSelectWrapper.js +24 -0
- package/dist/esm/styled/text/StyledTextFauxInput.js +61 -0
- package/dist/esm/styled/text/StyledTextInput.js +107 -0
- package/dist/esm/styled/text/StyledTextMediaFigure.js +57 -0
- package/dist/esm/styled/text/StyledTextMediaInput.js +24 -0
- package/dist/esm/styled/text/StyledTextarea.js +33 -0
- package/dist/esm/styled/tiles/StyledTile.js +55 -0
- package/dist/esm/styled/tiles/StyledTileDescription.js +34 -0
- package/dist/esm/styled/tiles/StyledTileIcon.js +38 -0
- package/dist/esm/styled/tiles/StyledTileInput.js +18 -0
- package/dist/esm/styled/tiles/StyledTileLabel.js +36 -0
- package/dist/esm/styled/toggle/StyledToggleHint.js +24 -0
- package/dist/esm/styled/toggle/StyledToggleInput.js +40 -0
- package/dist/esm/styled/toggle/StyledToggleLabel.js +28 -0
- package/dist/esm/styled/toggle/StyledToggleMessage.js +25 -0
- package/dist/esm/styled/toggle/StyledToggleSvg.js +23 -0
- package/dist/esm/types/index.js +11 -0
- package/dist/esm/utils/useFieldContext.js +15 -0
- package/dist/esm/utils/useFieldsetContext.js +15 -0
- package/dist/esm/utils/useFileContext.js +14 -0
- package/dist/esm/utils/useInputContext.js +14 -0
- package/dist/esm/utils/useInputGroupContext.js +14 -0
- package/dist/esm/utils/useTilesContext.js +14 -0
- package/dist/index.cjs.js +95 -101
- package/package.json +5 -5
- package/dist/index.esm.js +0 -2720
|
@@ -0,0 +1,23 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import { hideVisually } from 'polished';
|
|
9
|
+
import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'forms.input_label';
|
|
12
|
+
const StyledLabel = styled.label.attrs(props => ({
|
|
13
|
+
'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
|
|
14
|
+
'data-garden-version': props['data-garden-version'] || '9.0.0-next.8'
|
|
15
|
+
})).withConfig({
|
|
16
|
+
displayName: "StyledLabel",
|
|
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 => getColorV8('foreground', 600 , props.theme), props => props.theme.fontSizes.md, props => props.isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, props => props.isRadio ? 'inline-block' : 'inline', props => props.isRadio && 'top', props => props.isRadio && '-100%', props => props.isRadio && '0', props => !props.isRadio && hideVisually(), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
+
StyledLabel.defaultProps = {
|
|
20
|
+
theme: DEFAULT_THEME
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { StyledLabel };
|
|
@@ -0,0 +1,24 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledLabel } from './StyledLabel.js';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'forms.fieldset_legend';
|
|
12
|
+
const StyledLegend = styled(StyledLabel).attrs({
|
|
13
|
+
as: 'legend',
|
|
14
|
+
'data-garden-id': COMPONENT_ID,
|
|
15
|
+
'data-garden-version': '9.0.0-next.8'
|
|
16
|
+
}).withConfig({
|
|
17
|
+
displayName: "StyledLegend",
|
|
18
|
+
componentId: "sc-6s0zwq-0"
|
|
19
|
+
})(["padding:0;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
|
+
StyledLegend.defaultProps = {
|
|
21
|
+
theme: DEFAULT_THEME
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { StyledLegend };
|
|
@@ -0,0 +1,40 @@
|
|
|
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 styled, { css } from 'styled-components';
|
|
8
|
+
import { math } from 'polished';
|
|
9
|
+
import { getLineHeight, retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
|
|
10
|
+
import { StyledMessageIcon } from './StyledMessageIcon.js';
|
|
11
|
+
import { StyledLabel } from './StyledLabel.js';
|
|
12
|
+
|
|
13
|
+
const validationStyles = props => {
|
|
14
|
+
const rtl = props.theme.rtl;
|
|
15
|
+
const padding = math(`${props.theme.space.base} * 2px + ${props.theme.iconSizes.md}`);
|
|
16
|
+
let color;
|
|
17
|
+
if (props.validation === 'error') {
|
|
18
|
+
color = getColorV8('dangerHue', 600, props.theme);
|
|
19
|
+
} else if (props.validation === 'success') {
|
|
20
|
+
color = getColorV8('successHue', 600, props.theme);
|
|
21
|
+
} else if (props.validation === 'warning') {
|
|
22
|
+
color = getColorV8('warningHue', 700, props.theme);
|
|
23
|
+
} else {
|
|
24
|
+
color = getColorV8('neutralHue', 700, props.theme);
|
|
25
|
+
}
|
|
26
|
+
return css(["padding-", ":", ";color:", ";"], rtl ? 'right' : 'left', props.validation && padding, color);
|
|
27
|
+
};
|
|
28
|
+
const COMPONENT_ID = 'forms.input_message';
|
|
29
|
+
const StyledMessage = styled.div.attrs(props => ({
|
|
30
|
+
'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
|
|
31
|
+
'data-garden-version': props['data-garden-version'] || '9.0.0-next.8'
|
|
32
|
+
})).withConfig({
|
|
33
|
+
displayName: "StyledMessage",
|
|
34
|
+
componentId: "sc-30hgg7-0"
|
|
35
|
+
})(["direction:", ";display:inline-block;position:relative;vertical-align:middle;line-height:", ";font-size:", ";", ";& ", "{position:absolute;top:-1px;", ":0;}", ":not([hidden]) + &{display:block;margin-top:", ";}", ";"], props => props.theme.rtl && 'rtl', props => getLineHeight(props.theme.iconSizes.md, props.theme.fontSizes.sm), props => props.theme.fontSizes.sm, props => validationStyles(props), StyledMessageIcon, props => props.theme.rtl ? 'right' : 'left', StyledLabel, props => math(`${props.theme.space.base} * 1px`), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
36
|
+
StyledMessage.defaultProps = {
|
|
37
|
+
theme: DEFAULT_THEME
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export { StyledMessage };
|
|
@@ -0,0 +1,45 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import React__default, { Children } from 'react';
|
|
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';
|
|
13
|
+
|
|
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
|
+
const COMPONENT_ID = 'forms.input_message_icon';
|
|
33
|
+
const StyledMessageIcon = styled(MessageIcon).attrs({
|
|
34
|
+
'data-garden-id': COMPONENT_ID,
|
|
35
|
+
'data-garden-version': '9.0.0-next.8',
|
|
36
|
+
'aria-hidden': null
|
|
37
|
+
}).withConfig({
|
|
38
|
+
displayName: "StyledMessageIcon",
|
|
39
|
+
componentId: "sc-1ph2gba-0"
|
|
40
|
+
})(["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
|
+
|
|
45
|
+
export { StyledMessageIcon };
|
|
@@ -0,0 +1,76 @@
|
|
|
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 styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledFileClose } from './StyledFileClose.js';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'forms.file';
|
|
12
|
+
const colorStyles = props => {
|
|
13
|
+
let borderColor;
|
|
14
|
+
let focusBorderColor;
|
|
15
|
+
let foregroundColor;
|
|
16
|
+
if (props.validation === 'success') {
|
|
17
|
+
borderColor = getColorV8('successHue', 600, props.theme);
|
|
18
|
+
focusBorderColor = borderColor;
|
|
19
|
+
foregroundColor = borderColor;
|
|
20
|
+
} else if (props.validation === 'error') {
|
|
21
|
+
borderColor = getColorV8('dangerHue', 600, props.theme);
|
|
22
|
+
focusBorderColor = borderColor;
|
|
23
|
+
foregroundColor = borderColor;
|
|
24
|
+
} else {
|
|
25
|
+
borderColor = getColorV8('neutralHue', 300, props.theme);
|
|
26
|
+
focusBorderColor = getColorV8('primaryHue', 600, props.theme);
|
|
27
|
+
foregroundColor = getColorV8('foreground', 600 , props.theme);
|
|
28
|
+
}
|
|
29
|
+
return css(["border-color:", ";color:", ";", ""], borderColor, foregroundColor, focusStyles({
|
|
30
|
+
theme: props.theme,
|
|
31
|
+
inset: props.focusInset,
|
|
32
|
+
color: {
|
|
33
|
+
hue: focusBorderColor
|
|
34
|
+
},
|
|
35
|
+
styles: {
|
|
36
|
+
borderColor: focusBorderColor
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
const sizeStyles = props => {
|
|
41
|
+
const size = `${props.theme.space.base * (props.isCompact ? 7 : 10)}px`;
|
|
42
|
+
const spacing = `${props.theme.space.base * (props.isCompact ? 2 : 3)}px`;
|
|
43
|
+
const fontSize = props.theme.fontSizes.md;
|
|
44
|
+
const lineHeight = getLineHeight(props.theme.space.base * 5, fontSize);
|
|
45
|
+
return `
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
border: ${props.theme.borders.sm};
|
|
48
|
+
border-radius: ${props.theme.borderRadii.md};
|
|
49
|
+
padding: 0 ${spacing};
|
|
50
|
+
height: ${size};
|
|
51
|
+
line-height: ${lineHeight};
|
|
52
|
+
font-size: ${fontSize};
|
|
53
|
+
|
|
54
|
+
& > span {
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
& > ${StyledFileClose} {
|
|
59
|
+
width: ${size};
|
|
60
|
+
height: ${size};
|
|
61
|
+
margin-${props.theme.rtl ? 'left' : 'right'}: -${spacing};
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
};
|
|
65
|
+
const StyledFile = styled.div.attrs({
|
|
66
|
+
'data-garden-id': COMPONENT_ID,
|
|
67
|
+
'data-garden-version': '9.0.0-next.8'
|
|
68
|
+
}).withConfig({
|
|
69
|
+
displayName: "StyledFile",
|
|
70
|
+
componentId: "sc-195lzp1-0"
|
|
71
|
+
})(["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
|
+
|
|
76
|
+
export { StyledFile };
|
|
@@ -0,0 +1,22 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'forms.file.close';
|
|
11
|
+
const StyledFileClose = styled.button.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledFileClose",
|
|
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 => getColorV8('foreground', 600 , props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
+
StyledFileClose.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledFileClose };
|
|
@@ -0,0 +1,23 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledFileClose } from './StyledFileClose.js';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'forms.file.delete';
|
|
12
|
+
const StyledFileDelete = styled(StyledFileClose).attrs({
|
|
13
|
+
'data-garden-id': COMPONENT_ID,
|
|
14
|
+
'data-garden-version': '9.0.0-next.8'
|
|
15
|
+
}).withConfig({
|
|
16
|
+
displayName: "StyledFileDelete",
|
|
17
|
+
componentId: "sc-a8nnhx-0"
|
|
18
|
+
})(["color:", ";", ";"], props => getColorV8('dangerHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
+
StyledFileDelete.defaultProps = {
|
|
20
|
+
theme: DEFAULT_THEME
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { StyledFileDelete };
|
|
@@ -0,0 +1,31 @@
|
|
|
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, { Children } from 'react';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'forms.file.icon';
|
|
12
|
+
const StyledFileIcon = styled(_ref => {
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
isCompact,
|
|
16
|
+
theme,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
19
|
+
return React__default.cloneElement(Children.only(children), props);
|
|
20
|
+
}).attrs({
|
|
21
|
+
'data-garden-id': COMPONENT_ID,
|
|
22
|
+
'data-garden-version': '9.0.0-next.8'
|
|
23
|
+
}).withConfig({
|
|
24
|
+
displayName: "StyledFileIcon",
|
|
25
|
+
componentId: "sc-7b3q0c-0"
|
|
26
|
+
})(["flex-shrink:0;width:", ";margin-", ":", "px;", ";"], props => props.isCompact ? props.theme.iconSizes.sm : props.theme.iconSizes.md, props => props.theme.rtl ? 'left' : 'right', props => props.theme.space.base * 2, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
27
|
+
StyledFileIcon.defaultProps = {
|
|
28
|
+
theme: DEFAULT_THEME
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { StyledFileIcon };
|
|
@@ -0,0 +1,22 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'forms.file_list';
|
|
11
|
+
const StyledFileList = styled.ul.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledFileList",
|
|
16
|
+
componentId: "sc-gbahjg-0"
|
|
17
|
+
})(["margin:0;padding:0;list-style:none;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
+
StyledFileList.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledFileList };
|
|
@@ -0,0 +1,24 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledFileList } from './StyledFileList.js';
|
|
10
|
+
import { StyledFileUpload } from '../file-upload/StyledFileUpload.js';
|
|
11
|
+
|
|
12
|
+
const COMPONENT_ID = 'forms.file_list.item';
|
|
13
|
+
const StyledFileListItem = styled.li.attrs({
|
|
14
|
+
'data-garden-id': COMPONENT_ID,
|
|
15
|
+
'data-garden-version': '9.0.0-next.8'
|
|
16
|
+
}).withConfig({
|
|
17
|
+
displayName: "StyledFileListItem",
|
|
18
|
+
componentId: "sc-1ova3lo-0"
|
|
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
|
+
|
|
24
|
+
export { StyledFileListItem };
|
|
@@ -0,0 +1,47 @@
|
|
|
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 styled, { css } from 'styled-components';
|
|
8
|
+
import { rgba, math } from 'polished';
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
|
|
10
|
+
import { StyledLabel } from '../common/StyledLabel.js';
|
|
11
|
+
import { StyledHint } from '../common/StyledHint.js';
|
|
12
|
+
import { StyledMessage } from '../common/StyledMessage.js';
|
|
13
|
+
|
|
14
|
+
const COMPONENT_ID = 'forms.file_upload';
|
|
15
|
+
const colorStyles = props => {
|
|
16
|
+
const baseColor = getColorV8('primaryHue', 600, props.theme);
|
|
17
|
+
const hoverColor = getColorV8('primaryHue', 700, props.theme);
|
|
18
|
+
const activeColor = getColorV8('primaryHue', 800, props.theme);
|
|
19
|
+
const disabledBackgroundColor = getColorV8('neutralHue', 200, props.theme);
|
|
20
|
+
const disabledForegroundColor = getColorV8('neutralHue', 400, props.theme);
|
|
21
|
+
return css(["border-color:", ";background-color:", ";color:", ";&:hover{border-color:", ";background-color:", ";color:", ";}", " &:active{border-color:", ";background-color:", ";color:", ";}&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], props.isDragging ? activeColor : getColorV8('neutralHue', 600, props.theme), props.isDragging && rgba(baseColor, 0.2), props.isDragging ? activeColor : baseColor, hoverColor, rgba(baseColor, 0.08), hoverColor, focusStyles({
|
|
22
|
+
theme: props.theme,
|
|
23
|
+
color: {
|
|
24
|
+
hue: baseColor
|
|
25
|
+
}
|
|
26
|
+
}), activeColor, rgba(baseColor, 0.2), activeColor, disabledForegroundColor, disabledBackgroundColor, disabledForegroundColor);
|
|
27
|
+
};
|
|
28
|
+
const sizeStyles = props => {
|
|
29
|
+
const marginTop = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
|
|
30
|
+
const paddingHorizontal = `${props.isCompact ? 2 : 4}em`;
|
|
31
|
+
const paddingVertical = math(`${props.theme.space.base * (props.isCompact ? 2.5 : 5)} - ${props.theme.borderWidths.sm}`);
|
|
32
|
+
const fontSize = props.theme.fontSizes.md;
|
|
33
|
+
const lineHeight = getLineHeight(props.theme.space.base * 5, fontSize);
|
|
34
|
+
return css(["padding:", " ", ";min-width:4em;line-height:", ";font-size:", ";", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}"], paddingVertical, paddingHorizontal, lineHeight, fontSize, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, marginTop);
|
|
35
|
+
};
|
|
36
|
+
const StyledFileUpload = styled.div.attrs({
|
|
37
|
+
'data-garden-id': COMPONENT_ID,
|
|
38
|
+
'data-garden-version': '9.0.0-next.8'
|
|
39
|
+
}).withConfig({
|
|
40
|
+
displayName: "StyledFileUpload",
|
|
41
|
+
componentId: "sc-1rodjgn-0"
|
|
42
|
+
})(["display:flex;align-items:center;justify-content:center;box-sizing:border-box;direction:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:dashed ", ";border-radius:", ";cursor:pointer;text-align:center;user-select:none;", ";&[aria-disabled='true']{cursor:default;}", ";", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', props => props.theme.borderWidths.sm, props => props.theme.borderRadii.md, sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
43
|
+
StyledFileUpload.defaultProps = {
|
|
44
|
+
theme: DEFAULT_THEME
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { StyledFileUpload };
|
|
@@ -0,0 +1,35 @@
|
|
|
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 styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledTextInput } from '../text/StyledTextInput.js';
|
|
10
|
+
import { StyledLabel } from '../common/StyledLabel.js';
|
|
11
|
+
import { StyledHint } from '../common/StyledHint.js';
|
|
12
|
+
import { StyledMessage } from '../common/StyledMessage.js';
|
|
13
|
+
|
|
14
|
+
const COMPONENT_ID = 'forms.input_group';
|
|
15
|
+
const positionStyles = props => {
|
|
16
|
+
const topMargin = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
|
|
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
|
+
};
|
|
19
|
+
const itemStyles = props => {
|
|
20
|
+
const startDirection = props.theme.rtl ? 'right' : 'left';
|
|
21
|
+
const endDirection = props.theme.rtl ? 'left' : 'right';
|
|
22
|
+
return css(["& > *{z-index:-1;}& > ", "{z-index:0;}& > ", ":disabled{z-index:-2;}& > ", ":hover,& > button:hover,& > ", ":focus-visible,& > button:focus-visible,& > ", ":active,& > button:active,& > button[aria-pressed='true'],& > button[aria-pressed='mixed']{z-index:1;}& > button:disabled{border-top-width:0;border-bottom-width:0;}& > *:not(:first-child){margin-", ":-", ";}& > *:first-child:not(:last-child){border-top-", "-radius:0;border-bottom-", "-radius:0;}& > *:last-child:not(:first-child){border-top-", "-radius:0;border-bottom-", "-radius:0;}& > *:not(:first-child):not(:last-child){border-radius:0;}"], StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, StyledTextInput, startDirection, props.theme.borderWidths.sm, endDirection, endDirection, startDirection, startDirection);
|
|
23
|
+
};
|
|
24
|
+
const StyledInputGroup = styled.div.attrs({
|
|
25
|
+
'data-garden-id': COMPONENT_ID,
|
|
26
|
+
'data-garden-version': '9.0.0-next.8'
|
|
27
|
+
}).withConfig({
|
|
28
|
+
displayName: "StyledInputGroup",
|
|
29
|
+
componentId: "sc-kjh1f0-0"
|
|
30
|
+
})(["display:inline-flex;position:relative;flex-wrap:nowrap;align-items:stretch;z-index:0;width:100%;", ";", ";", ";"], props => positionStyles(props), props => itemStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
31
|
+
StyledInputGroup.defaultProps = {
|
|
32
|
+
theme: DEFAULT_THEME
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { StyledInputGroup };
|
|
@@ -0,0 +1,24 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import { math } from 'polished';
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
|
+
import { StyledHint } from '../common/StyledHint.js';
|
|
11
|
+
|
|
12
|
+
const COMPONENT_ID = 'forms.radio_hint';
|
|
13
|
+
const StyledRadioHint = styled(StyledHint).attrs({
|
|
14
|
+
'data-garden-id': COMPONENT_ID,
|
|
15
|
+
'data-garden-version': '9.0.0-next.8'
|
|
16
|
+
}).withConfig({
|
|
17
|
+
displayName: "StyledRadioHint",
|
|
18
|
+
componentId: "sc-eo8twg-0"
|
|
19
|
+
})(["padding-", ":", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * 6px`), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
|
+
StyledRadioHint.defaultProps = {
|
|
21
|
+
theme: DEFAULT_THEME
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { StyledRadioHint };
|
|
@@ -0,0 +1,61 @@
|
|
|
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 styled, { css } from 'styled-components';
|
|
8
|
+
import { math } from 'polished';
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles } from '@zendeskgarden/react-theming';
|
|
10
|
+
import { StyledRadioLabel } from './StyledRadioLabel.js';
|
|
11
|
+
import { StyledMessage } from '../common/StyledMessage.js';
|
|
12
|
+
|
|
13
|
+
const COMPONENT_ID = 'forms.radio';
|
|
14
|
+
const colorStyles = props => {
|
|
15
|
+
const SHADE = 600;
|
|
16
|
+
const borderColor = getColorV8('neutralHue', SHADE - 300, props.theme);
|
|
17
|
+
const backgroundColor = getColorV8('background', 600 , props.theme);
|
|
18
|
+
const iconColor = backgroundColor;
|
|
19
|
+
const hoverBackgroundColor = getColorV8('primaryHue', SHADE, props.theme, 0.08);
|
|
20
|
+
const hoverBorderColor = getColorV8('primaryHue', SHADE, props.theme);
|
|
21
|
+
const focusBorderColor = hoverBorderColor;
|
|
22
|
+
const activeBackgroundColor = getColorV8('primaryHue', SHADE, props.theme, 0.2);
|
|
23
|
+
const activeBorderColor = focusBorderColor;
|
|
24
|
+
const checkedBorderColor = focusBorderColor;
|
|
25
|
+
const checkedBackgroundColor = checkedBorderColor;
|
|
26
|
+
const checkedHoverBorderColor = getColorV8('primaryHue', SHADE + 100, props.theme);
|
|
27
|
+
const checkedHoverBackgroundColor = checkedHoverBorderColor;
|
|
28
|
+
const checkedActiveBorderColor = getColorV8('primaryHue', SHADE + 200, props.theme);
|
|
29
|
+
const checkedActiveBackgroundColor = checkedActiveBorderColor;
|
|
30
|
+
const disabledBackgroundColor = getColorV8('neutralHue', SHADE - 400, props.theme);
|
|
31
|
+
return css(["& ~ ", "::before{border-color:", ";background-color:", ";}& ~ ", " > svg{color:", ";}& ~ ", ":hover::before{border-color:", ";background-color:", ";}", " & ~ ", ":active::before{border-color:", ";background-color:", ";}&:checked ~ ", "::before{border-color:", ";background-color:", ";}&:enabled:checked ~ ", ":hover::before{border-color:", ";background-color:", ";}&:enabled:checked ~ ", ":active::before{border-color:", ";background-color:", ";}&:disabled ~ ", "::before{border-color:transparent;background-color:", ";}"], StyledRadioLabel, borderColor, backgroundColor, StyledRadioLabel, iconColor, StyledRadioLabel, hoverBorderColor, hoverBackgroundColor, focusStyles({
|
|
32
|
+
theme: props.theme,
|
|
33
|
+
styles: {
|
|
34
|
+
borderColor: focusBorderColor
|
|
35
|
+
},
|
|
36
|
+
selector: `&:focus-visible ~ ${StyledRadioLabel}::before`
|
|
37
|
+
}), StyledRadioLabel, activeBorderColor, activeBackgroundColor, StyledRadioLabel, checkedBorderColor, checkedBackgroundColor, StyledRadioLabel, checkedHoverBorderColor, checkedHoverBackgroundColor, StyledRadioLabel, checkedActiveBorderColor, checkedActiveBackgroundColor, StyledRadioLabel, disabledBackgroundColor);
|
|
38
|
+
};
|
|
39
|
+
const sizeStyles = props => {
|
|
40
|
+
const lineHeight = `${props.theme.space.base * 5}px`;
|
|
41
|
+
const size = `${props.theme.space.base * 4}px`;
|
|
42
|
+
const top = math(`(${lineHeight} - ${size}) / 2`);
|
|
43
|
+
const iconSize = props.theme.iconSizes.sm;
|
|
44
|
+
const iconPosition = math(`(${size} - ${iconSize}) / 2`);
|
|
45
|
+
const iconTop = math(`${iconPosition} + ${top}`);
|
|
46
|
+
const marginTop = `${props.theme.space.base * (props.isCompact ? 1 : 2)}px`;
|
|
47
|
+
return css(["top:", ";width:", ";height:", ";& ~ ", "::before{top:", ";background-size:", ";width:", ";height:", ";box-sizing:border-box;}& ~ ", " > svg{top:", ";", ":", ";width:", ";height:", ";}&& ~ ", " ~ ", "{margin-top:", ";}"], top, size, size, StyledRadioLabel, top, props.theme.iconSizes.sm, size, size, StyledRadioLabel, iconTop, props.theme.rtl ? 'right' : 'left', iconPosition, iconSize, iconSize, StyledRadioLabel, StyledMessage, marginTop);
|
|
48
|
+
};
|
|
49
|
+
const StyledRadioInput = styled.input.attrs({
|
|
50
|
+
'data-garden-id': COMPONENT_ID,
|
|
51
|
+
'data-garden-version': '9.0.0-next.8',
|
|
52
|
+
type: 'radio'
|
|
53
|
+
}).withConfig({
|
|
54
|
+
displayName: "StyledRadioInput",
|
|
55
|
+
componentId: "sc-qsavpv-0"
|
|
56
|
+
})(["position:absolute;opacity:0;margin:0;& ~ ", "::before{position:absolute;", ":0;transition:border-color .25s ease-in-out,box-shadow .1s ease-in-out,background-color .25s ease-in-out,color .25s ease-in-out;border:", ";border-radius:50%;background-repeat:no-repeat;background-position:center;content:'';}& ~ ", " > svg{position:absolute;}", ";&:focus ~ ", "::before{outline:none;}& ~ ", ":active::before{transition:border-color 0.1s ease-in-out,background-color 0.1s ease-in-out,color 0.1s ease-in-out;}", ";&:disabled ~ ", "{cursor:default;}", ";"], StyledRadioLabel, props => props.theme.rtl ? 'right' : 'left', props => props.theme.borders.sm, StyledRadioLabel, props => sizeStyles(props), StyledRadioLabel, StyledRadioLabel, props => colorStyles(props), StyledRadioLabel, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
57
|
+
StyledRadioInput.defaultProps = {
|
|
58
|
+
theme: DEFAULT_THEME
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { StyledRadioInput };
|
|
@@ -0,0 +1,30 @@
|
|
|
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 styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledLabel } from '../common/StyledLabel.js';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'forms.radio_label';
|
|
12
|
+
const sizeStyles = props => {
|
|
13
|
+
const size = props.theme.space.base * 4;
|
|
14
|
+
const padding = size + props.theme.space.base * 2;
|
|
15
|
+
const lineHeight = props.theme.space.base * 5;
|
|
16
|
+
return css(["padding-", ":", "px;&[hidden]{padding-", ":", "px;line-height:", "px;}"], props.theme.rtl ? 'right' : 'left', padding, props.theme.rtl ? 'right' : 'left', size, lineHeight);
|
|
17
|
+
};
|
|
18
|
+
const StyledRadioLabel = styled(StyledLabel).attrs({
|
|
19
|
+
'data-garden-id': COMPONENT_ID,
|
|
20
|
+
'data-garden-version': '9.0.0-next.8',
|
|
21
|
+
isRadio: true
|
|
22
|
+
}).withConfig({
|
|
23
|
+
displayName: "StyledRadioLabel",
|
|
24
|
+
componentId: "sc-1aq2e5t-0"
|
|
25
|
+
})(["display:inline-block;position:relative;cursor:pointer;", ";", ";"], props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
26
|
+
StyledRadioLabel.defaultProps = {
|
|
27
|
+
theme: DEFAULT_THEME
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { StyledRadioLabel };
|
|
@@ -0,0 +1,24 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import { math } from 'polished';
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
|
+
import { StyledMessage } from '../common/StyledMessage.js';
|
|
11
|
+
|
|
12
|
+
const COMPONENT_ID = 'forms.radio_message';
|
|
13
|
+
const StyledRadioMessage = styled(StyledMessage).attrs({
|
|
14
|
+
'data-garden-id': COMPONENT_ID,
|
|
15
|
+
'data-garden-version': '9.0.0-next.8'
|
|
16
|
+
}).withConfig({
|
|
17
|
+
displayName: "StyledRadioMessage",
|
|
18
|
+
componentId: "sc-1pmi0q8-0"
|
|
19
|
+
})(["padding-", ":", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => math(`${props.theme.space.base} * 6px`), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
|
+
StyledRadioMessage.defaultProps = {
|
|
21
|
+
theme: DEFAULT_THEME
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { StyledRadioMessage };
|
|
@@ -0,0 +1,25 @@
|
|
|
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 styled from 'styled-components';
|
|
8
|
+
import SvgCircleSmFill from '../../node_modules/@zendeskgarden/svg-icons/src/12/circle-sm-fill.svg.js';
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
|
+
import { StyledRadioInput } from './StyledRadioInput.js';
|
|
11
|
+
import { StyledRadioLabel } from './StyledRadioLabel.js';
|
|
12
|
+
|
|
13
|
+
const COMPONENT_ID = 'forms.radio_svg';
|
|
14
|
+
const StyledRadioSvg = styled(SvgCircleSmFill).attrs({
|
|
15
|
+
'data-garden-id': COMPONENT_ID,
|
|
16
|
+
'data-garden-version': '9.0.0-next.8'
|
|
17
|
+
}).withConfig({
|
|
18
|
+
displayName: "StyledRadioSvg",
|
|
19
|
+
componentId: "sc-1r1qtr1-0"
|
|
20
|
+
})(["transition:opacity 0.25s ease-in-out;opacity:0;", ":checked ~ ", " > &{opacity:1;}", ";"], StyledRadioInput, StyledRadioLabel, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
|
+
StyledRadioSvg.defaultProps = {
|
|
22
|
+
theme: DEFAULT_THEME
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { StyledRadioSvg };
|