@zendeskgarden/react-forms 9.0.0-next.13 → 9.0.0-next.14

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.
Files changed (60) hide show
  1. package/LICENSE.md +176 -0
  2. package/dist/esm/elements/Select.js +1 -0
  3. package/dist/esm/elements/faux-input/components/EndIcon.js +4 -0
  4. package/dist/esm/elements/faux-input/components/StartIcon.js +4 -0
  5. package/dist/esm/elements/file-list/components/File.js +2 -1
  6. package/dist/esm/elements/tiles/components/Tile.js +1 -3
  7. package/dist/esm/styled/checkbox/StyledCheckHint.js +1 -1
  8. package/dist/esm/styled/checkbox/StyledCheckInput.js +55 -11
  9. package/dist/esm/styled/checkbox/StyledCheckLabel.js +1 -1
  10. package/dist/esm/styled/checkbox/StyledCheckMessage.js +1 -1
  11. package/dist/esm/styled/checkbox/StyledCheckSvg.js +1 -1
  12. package/dist/esm/styled/checkbox/StyledDashSvg.js +1 -1
  13. package/dist/esm/styled/common/StyledField.js +1 -1
  14. package/dist/esm/styled/common/StyledFieldset.js +1 -1
  15. package/dist/esm/styled/common/StyledHint.js +1 -1
  16. package/dist/esm/styled/common/StyledLabel.js +1 -1
  17. package/dist/esm/styled/common/StyledLegend.js +1 -1
  18. package/dist/esm/styled/common/StyledMessage.js +1 -1
  19. package/dist/esm/styled/common/StyledMessageIcon.js +1 -1
  20. package/dist/esm/styled/file-list/StyledFile.js +49 -28
  21. package/dist/esm/styled/file-list/StyledFileClose.js +6 -3
  22. package/dist/esm/styled/file-list/StyledFileDelete.js +6 -3
  23. package/dist/esm/styled/file-list/StyledFileIcon.js +24 -4
  24. package/dist/esm/styled/file-list/StyledFileList.js +1 -1
  25. package/dist/esm/styled/file-list/StyledFileListItem.js +1 -1
  26. package/dist/esm/styled/file-upload/StyledFileUpload.js +89 -20
  27. package/dist/esm/styled/input-group/StyledInputGroup.js +1 -1
  28. package/dist/esm/styled/radio/StyledRadioHint.js +1 -1
  29. package/dist/esm/styled/radio/StyledRadioInput.js +85 -24
  30. package/dist/esm/styled/radio/StyledRadioLabel.js +1 -1
  31. package/dist/esm/styled/radio/StyledRadioMessage.js +1 -1
  32. package/dist/esm/styled/radio/StyledRadioSvg.js +1 -1
  33. package/dist/esm/styled/range/StyledRangeInput.js +83 -26
  34. package/dist/esm/styled/select/StyledSelect.js +35 -11
  35. package/dist/esm/styled/select/StyledSelectWrapper.js +11 -3
  36. package/dist/esm/styled/text/StyledTextFauxInput.js +31 -23
  37. package/dist/esm/styled/text/StyledTextInput.js +103 -58
  38. package/dist/esm/styled/text/StyledTextMediaFigure.js +35 -10
  39. package/dist/esm/styled/text/StyledTextMediaInput.js +1 -1
  40. package/dist/esm/styled/text/StyledTextarea.js +1 -1
  41. package/dist/esm/styled/tiles/StyledTile.js +93 -34
  42. package/dist/esm/styled/tiles/StyledTileDescription.js +13 -13
  43. package/dist/esm/styled/tiles/StyledTileIcon.js +52 -13
  44. package/dist/esm/styled/tiles/StyledTileInput.js +1 -1
  45. package/dist/esm/styled/tiles/StyledTileLabel.js +13 -15
  46. package/dist/esm/styled/toggle/StyledToggleHint.js +1 -1
  47. package/dist/esm/styled/toggle/StyledToggleInput.js +38 -13
  48. package/dist/esm/styled/toggle/StyledToggleLabel.js +1 -1
  49. package/dist/esm/styled/toggle/StyledToggleMessage.js +1 -1
  50. package/dist/esm/styled/toggle/StyledToggleSvg.js +1 -1
  51. package/dist/index.cjs.js +892 -377
  52. package/dist/typings/elements/faux-input/components/EndIcon.d.ts +1 -1
  53. package/dist/typings/elements/faux-input/components/StartIcon.d.ts +1 -1
  54. package/dist/typings/styled/file-list/StyledFileIcon.d.ts +7 -1
  55. package/dist/typings/styled/select/StyledSelect.d.ts +0 -3
  56. package/dist/typings/styled/select/StyledSelectWrapper.d.ts +3 -1
  57. package/dist/typings/styled/text/StyledTextFauxInput.d.ts +0 -4
  58. package/dist/typings/styled/tiles/StyledTile.d.ts +4 -7
  59. package/dist/typings/types/index.d.ts +3 -3
  60. package/package.json +4 -3
@@ -4,17 +4,37 @@
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, DEFAULT_THEME } from '@zendeskgarden/react-theming';
7
+ import styled, { css } from 'styled-components';
8
+ import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME, 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.0.0-next.13'
33
+ 'data-garden-version': '9.0.0-next.14'
14
34
  }).withConfig({
15
35
  displayName: "StyledFileIcon",
16
36
  componentId: "sc-7b3q0c-0"
17
- })(["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));
37
+ })(["flex-shrink:0;", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
18
38
  StyledFileIcon.defaultProps = {
19
39
  theme: DEFAULT_THEME
20
40
  };
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
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.0.0-next.13'
13
+ 'data-garden-version': '9.0.0-next.14'
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.0.0-next.13'
15
+ 'data-garden-version': '9.0.0-next.14'
16
16
  }).withConfig({
17
17
  displayName: "StyledFileListItem",
18
18
  componentId: "sc-1ova3lo-0"
@@ -5,37 +5,106 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
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';
8
+ import { math } from 'polished';
9
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
10
10
  import { StyledLabel } from '../common/StyledLabel.js';
11
11
  import { StyledHint } from '../common/StyledHint.js';
12
12
  import { StyledMessage } from '../common/StyledMessage.js';
13
13
 
14
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
15
+ const colorStyles = _ref => {
16
+ let {
17
+ theme,
18
+ isDragging
19
+ } = _ref;
20
+ const borderOptions = {
21
+ theme,
22
+ variable: 'border.primaryEmphasis'
23
+ };
24
+ const backgroundOptions = {
25
+ theme,
26
+ variable: 'background.primaryEmphasis'
27
+ };
28
+ const foregroundOptions = {
29
+ theme,
30
+ variable: 'foreground.primary'
31
+ };
32
+ const offset100 = {
33
+ dark: {
34
+ offset: -100
35
+ },
36
+ light: {
37
+ offset: 100
25
38
  }
26
- }), activeColor, rgba(baseColor, 0.2), activeColor, disabledForegroundColor, disabledBackgroundColor, disabledForegroundColor);
39
+ };
40
+ const offset200 = {
41
+ dark: {
42
+ offset: -200
43
+ },
44
+ light: {
45
+ offset: 200
46
+ }
47
+ };
48
+ const borderColor = getColor({
49
+ theme,
50
+ variable: 'border.emphasis'
51
+ });
52
+ const foregroundColor = getColor(foregroundOptions);
53
+ const hoverBorderColor = getColor({
54
+ ...borderOptions,
55
+ ...offset100
56
+ });
57
+ const hoverBackgroundColor = getColor({
58
+ ...backgroundOptions,
59
+ transparency: theme.opacity[100]
60
+ });
61
+ const hoverForegroundColor = getColor({
62
+ ...foregroundOptions,
63
+ ...offset100
64
+ });
65
+ const activeBorderColor = getColor({
66
+ ...borderOptions,
67
+ ...offset200
68
+ });
69
+ const activeBackgroundColor = getColor({
70
+ ...backgroundOptions,
71
+ transparency: theme.opacity[200]
72
+ });
73
+ const activeForegroundColor = getColor({
74
+ ...foregroundOptions,
75
+ ...offset200
76
+ });
77
+ const disabledBorderColor = getColor({
78
+ theme,
79
+ variable: 'border.disabled'
80
+ });
81
+ const disabledBackgroundColor = getColor({
82
+ theme,
83
+ variable: 'background.disabled'
84
+ });
85
+ const disabledForegroundColor = getColor({
86
+ theme,
87
+ variable: 'foreground.disabled'
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({
90
+ theme
91
+ }), activeBorderColor, activeBackgroundColor, activeForegroundColor, disabledBorderColor, disabledBackgroundColor, disabledForegroundColor);
27
92
  };
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);
93
+ const sizeStyles = _ref2 => {
94
+ let {
95
+ theme,
96
+ isCompact
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}`);
101
+ const fontSize = theme.fontSizes.md;
102
+ const lineHeight = getLineHeight(theme.space.base * 5, fontSize);
34
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);
35
104
  };
36
105
  const StyledFileUpload = styled.div.attrs({
37
106
  'data-garden-id': COMPONENT_ID,
38
- 'data-garden-version': '9.0.0-next.13'
107
+ 'data-garden-version': '9.0.0-next.14'
39
108
  }).withConfig({
40
109
  displayName: "StyledFileUpload",
41
110
  componentId: "sc-1rodjgn-0"
@@ -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.0.0-next.13'
26
+ 'data-garden-version': '9.0.0-next.14'
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.0.0-next.13'
15
+ 'data-garden-version': '9.0.0-next.14'
16
16
  }).withConfig({
17
17
  displayName: "StyledRadioHint",
18
18
  componentId: "sc-eo8twg-0"
@@ -6,54 +6,115 @@
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
8
  import { math } from 'polished';
9
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles } from '@zendeskgarden/react-theming';
9
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor, focusStyles } from '@zendeskgarden/react-theming';
10
10
  import { StyledRadioLabel } from './StyledRadioLabel.js';
11
11
  import { StyledMessage } from '../common/StyledMessage.js';
12
12
 
13
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);
14
+ const colorStyles = _ref => {
15
+ let {
16
+ theme
17
+ } = _ref;
18
+ const borderColor = getColor({
19
+ theme,
20
+ variable: 'border.emphasis'
21
+ });
22
+ const backgroundColor = getColor({
23
+ theme,
24
+ variable: 'background.default'
25
+ });
26
+ const iconColor = getColor({
27
+ theme,
28
+ variable: 'foreground.onEmphasis'
29
+ });
30
+ const backgroundOptions = {
31
+ theme,
32
+ variable: 'background.primaryEmphasis'
33
+ };
34
+ const borderOptions = {
35
+ theme,
36
+ variable: 'border.primaryEmphasis'
37
+ };
38
+ const hoverBackgroundColor = getColor({
39
+ ...backgroundOptions,
40
+ transparency: theme.opacity[100]
41
+ });
42
+ const hoverBorderColor = getColor(borderOptions);
21
43
  const focusBorderColor = hoverBorderColor;
22
- const activeBackgroundColor = getColorV8('primaryHue', SHADE, props.theme, 0.2);
44
+ const activeBackgroundColor = getColor({
45
+ ...backgroundOptions,
46
+ transparency: theme.opacity[200]
47
+ });
23
48
  const activeBorderColor = focusBorderColor;
49
+ const checkedBackgroundColor = getColor(backgroundOptions);
24
50
  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);
51
+ const offset100 = {
52
+ dark: {
53
+ offset: -100
54
+ },
55
+ light: {
56
+ offset: 100
57
+ }
58
+ };
59
+ const offset200 = {
60
+ dark: {
61
+ offset: -200
62
+ },
63
+ light: {
64
+ offset: 200
65
+ }
66
+ };
67
+ const checkedHoverBackgroundColor = getColor({
68
+ ...backgroundOptions,
69
+ ...offset100
70
+ });
71
+ const checkedHoverBorderColor = getColor({
72
+ ...borderOptions,
73
+ ...offset100
74
+ });
75
+ const checkedActiveBackgroundColor = getColor({
76
+ ...backgroundOptions,
77
+ ...offset200
78
+ });
79
+ const checkedActiveBorderColor = getColor({
80
+ ...borderOptions,
81
+ ...offset200
82
+ });
83
+ const disabledBackgroundColor = getColor({
84
+ theme,
85
+ variable: 'background.disabled',
86
+ transparency: theme.opacity[300]
87
+ });
31
88
  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,
89
+ theme,
33
90
  styles: {
34
91
  borderColor: focusBorderColor
35
92
  },
36
93
  selector: `&:focus-visible ~ ${StyledRadioLabel}::before`
37
94
  }), StyledRadioLabel, activeBorderColor, activeBackgroundColor, StyledRadioLabel, checkedBorderColor, checkedBackgroundColor, StyledRadioLabel, checkedHoverBorderColor, checkedHoverBackgroundColor, StyledRadioLabel, checkedActiveBorderColor, checkedActiveBackgroundColor, StyledRadioLabel, disabledBackgroundColor);
38
95
  };
39
- const sizeStyles = props => {
40
- const lineHeight = `${props.theme.space.base * 5}px`;
41
- const size = `${props.theme.space.base * 4}px`;
96
+ const sizeStyles = _ref2 => {
97
+ let {
98
+ theme,
99
+ isCompact
100
+ } = _ref2;
101
+ const lineHeight = `${theme.space.base * 5}px`;
102
+ const size = `${theme.space.base * 4}px`;
42
103
  const top = math(`(${lineHeight} - ${size}) / 2`);
43
- const iconSize = props.theme.iconSizes.sm;
104
+ const iconSize = theme.iconSizes.sm;
44
105
  const iconPosition = math(`(${size} - ${iconSize}) / 2`);
45
106
  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);
107
+ const marginTop = `${theme.space.base * (isCompact ? 1 : 2)}px`;
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);
48
109
  };
49
110
  const StyledRadioInput = styled.input.attrs({
50
111
  'data-garden-id': COMPONENT_ID,
51
- 'data-garden-version': '9.0.0-next.13',
112
+ 'data-garden-version': '9.0.0-next.14',
52
113
  type: 'radio'
53
114
  }).withConfig({
54
115
  displayName: "StyledRadioInput",
55
116
  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));
117
+ })(["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-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', StyledRadioLabel, sizeStyles, StyledRadioLabel, StyledRadioLabel, colorStyles, StyledRadioLabel, props => retrieveComponentStyles(COMPONENT_ID, props));
57
118
  StyledRadioInput.defaultProps = {
58
119
  theme: DEFAULT_THEME
59
120
  };
@@ -17,7 +17,7 @@ const sizeStyles = props => {
17
17
  };
18
18
  const StyledRadioLabel = styled(StyledLabel).attrs({
19
19
  'data-garden-id': COMPONENT_ID,
20
- 'data-garden-version': '9.0.0-next.13',
20
+ 'data-garden-version': '9.0.0-next.14',
21
21
  isRadio: true
22
22
  }).withConfig({
23
23
  displayName: "StyledRadioLabel",
@@ -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.0.0-next.13'
15
+ 'data-garden-version': '9.0.0-next.14'
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.0.0-next.13'
16
+ 'data-garden-version': '9.0.0-next.14'
17
17
  }).withConfig({
18
18
  displayName: "StyledRadioSvg",
19
19
  componentId: "sc-1r1qtr1-0"
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
8
  import { math } from 'polished';
9
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, getFocusBoxShadow } from '@zendeskgarden/react-theming';
9
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor, getFocusBoxShadow } from '@zendeskgarden/react-theming';
10
10
  import { StyledHint } from '../common/StyledHint.js';
11
11
  import { StyledLabel } from '../common/StyledLabel.js';
12
12
  import { StyledMessage } from '../common/StyledMessage.js';
@@ -56,28 +56,81 @@ const trackLowerStyles = function (styles) {
56
56
  }
57
57
  `;
58
58
  };
59
- const colorStyles = props => {
60
- const SHADE = 600;
61
- const thumbBackgroundColor = getColorV8('primaryHue', SHADE, props.theme);
59
+ const colorStyles = _ref => {
60
+ let {
61
+ theme,
62
+ hasLowerTrack
63
+ } = _ref;
64
+ const options = {
65
+ theme,
66
+ variable: 'background.primaryEmphasis'
67
+ };
68
+ const thumbBackgroundColor = getColor(options);
62
69
  const thumbBorderColor = thumbBackgroundColor;
63
- const thumbBoxShadow = props.theme.shadows.lg(math(`${props.theme.space.base} * 1px`), math(`${props.theme.space.base} * 2px`), getColorV8('neutralHue', SHADE + 200, props.theme, 0.24));
70
+ const thumbBoxShadow = theme.shadows.lg(`${theme.space.base}px`, `${theme.space.base * 2}px`, getColor({
71
+ theme,
72
+ hue: 'neutralHue',
73
+ shade: 1200,
74
+ dark: {
75
+ transparency: theme.opacity[1100]
76
+ },
77
+ light: {
78
+ transparency: theme.opacity[200]
79
+ }
80
+ }));
64
81
  const thumbFocusBoxShadow = getFocusBoxShadow({
65
- theme: props.theme
82
+ theme
83
+ });
84
+ const thumbActiveBackgroundColor = getColor({
85
+ ...options,
86
+ dark: {
87
+ offset: -200
88
+ },
89
+ light: {
90
+ offset: 200
91
+ }
66
92
  });
67
- const thumbActiveBackgroundColor = getColorV8('primaryHue', SHADE + 100, props.theme);
68
93
  const thumbActiveBorderColor = thumbBorderColor;
69
- const thumbDisabledBackgroundColor = getColorV8('neutralHue', SHADE - 300, props.theme);
94
+ const thumbDisabledBackgroundColor = getColor({
95
+ theme,
96
+ variable: 'border.emphasis'
97
+ });
70
98
  const thumbDisabledBorderColor = thumbDisabledBackgroundColor;
71
- const thumbHoverBackgroundColor = thumbActiveBackgroundColor;
99
+ const thumbHoverBackgroundColor = getColor({
100
+ ...options,
101
+ dark: {
102
+ offset: -100
103
+ },
104
+ light: {
105
+ offset: 100
106
+ }
107
+ });
72
108
  const thumbHoverBorderColor = thumbHoverBackgroundColor;
73
- const trackBackgroundColor = getColorV8('neutralHue', SHADE - 400, props.theme);
74
- const trackLowerBackgroundColor = props.hasLowerTrack ? thumbBackgroundColor : '';
75
- const trackBackgroundImage = props.hasLowerTrack ? `linear-gradient(${trackLowerBackgroundColor}, ${trackLowerBackgroundColor})` : '';
76
- const trackDisabledLowerBackgroundColor = props.hasLowerTrack ? thumbDisabledBackgroundColor : '';
77
- const trackDisabledBackgroundImage = props.hasLowerTrack ? `linear-gradient(${trackDisabledLowerBackgroundColor}, ${trackDisabledLowerBackgroundColor})` : '';
109
+ const trackBackgroundColor = getColor({
110
+ theme,
111
+ variable: 'border.emphasis',
112
+ dark: {
113
+ offset: 100
114
+ },
115
+ light: {
116
+ offset: -200
117
+ }
118
+ });
119
+ const trackLowerBackgroundColor = hasLowerTrack ? thumbBackgroundColor : '';
120
+ const trackBackgroundImage = hasLowerTrack ? `linear-gradient(${trackLowerBackgroundColor}, ${trackLowerBackgroundColor})` : '';
121
+ const trackDisabledBackgroundColor = getColor({
122
+ theme,
123
+ variable: 'background.disabled',
124
+ transparency: theme.opacity[200]
125
+ });
126
+ const trackDisabledLowerBackgroundColor = hasLowerTrack ? getColor({
127
+ theme,
128
+ variable: 'border.emphasis'
129
+ }) : '';
130
+ const trackDisabledBackgroundImage = hasLowerTrack ? `linear-gradient(${trackDisabledLowerBackgroundColor}, ${trackDisabledLowerBackgroundColor})` : '';
78
131
  return css(["", " ", " ", " ", " ", " ", " ", " ", " ", ""], trackStyles(`
79
132
  background-color: ${trackBackgroundColor};
80
- background-image: ${trackBackgroundImage}; /* provide means for styling lower range on WebKit */
133
+ background-image: ${trackBackgroundImage}; /* [1] */
81
134
  `), thumbStyles(`
82
135
  border-color: ${thumbBorderColor};
83
136
  box-shadow: ${thumbBoxShadow};
@@ -96,6 +149,7 @@ const colorStyles = props => {
96
149
  border-color: ${thumbActiveBorderColor};
97
150
  background-color: ${thumbActiveBackgroundColor};
98
151
  `, ':active'), trackStyles(`
152
+ background-color: ${trackDisabledBackgroundColor};
99
153
  background-image: ${trackDisabledBackgroundImage};
100
154
  `, ':disabled'), thumbStyles(`
101
155
  border-color: ${thumbDisabledBorderColor};
@@ -105,29 +159,32 @@ const colorStyles = props => {
105
159
  background-color: ${trackDisabledLowerBackgroundColor};
106
160
  `, ':disabled'));
107
161
  };
108
- const sizeStyles = props => {
109
- const thumbSize = math(`${props.theme.space.base} * 5px`);
110
- const trackHeight = math(`${props.theme.space.base} * 1.5px`);
162
+ const sizeStyles = _ref2 => {
163
+ let {
164
+ theme
165
+ } = _ref2;
166
+ const thumbSize = `${theme.space.base * 5}px`;
167
+ const trackHeight = `${theme.space.base * 1.5}px`;
111
168
  const trackBorderRadius = trackHeight;
112
- const trackMargin = math(`(${thumbSize} - ${trackHeight}) / 2 + ${props.theme.shadowWidths.md}`);
169
+ const trackMargin = math(`(${thumbSize} - ${trackHeight}) / 2 + ${theme.shadowWidths.md}`);
113
170
  const thumbMargin = math(`(${trackHeight} - ${thumbSize}) / 2`);
114
- return css(["", ":not([hidden]) + &,", " + &,", " + &,& + ", ",& + ", "{margin-top:", ";}", ";", " ", ""], StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, math(`${props.theme.space.base} * 2px`), trackStyles(`
171
+ return css(["", ":not([hidden]) + &,", " + &,", " + &,& + ", ",& + ", "{margin-top:", ";}", ";", " ", ""], StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, `${theme.space.base * 2}px`, trackStyles(`
115
172
  margin: ${trackMargin} 0;
116
173
  border-radius: ${trackBorderRadius};
117
174
  height: ${trackHeight};
118
175
  `), thumbStyles(`
119
- margin: ${thumbMargin} 0; /* reset for IE */
176
+ margin: ${thumbMargin} 0; /* [1] */
120
177
  width: ${thumbSize};
121
178
  height: ${thumbSize};
122
179
  `), trackLowerStyles(`
123
- border-top-${props.theme.rtl ? 'right' : 'left'}-radius: ${trackBorderRadius};
124
- border-bottom-${props.theme.rtl ? 'right' : 'left'}-radius: ${trackBorderRadius};
180
+ border-top-${theme.rtl ? 'right' : 'left'}-radius: ${trackBorderRadius};
181
+ border-bottom-${theme.rtl ? 'right' : 'left'}-radius: ${trackBorderRadius};
125
182
  height: ${trackHeight};
126
183
  `));
127
184
  };
128
185
  const StyledRangeInput = styled.input.attrs(props => ({
129
186
  'data-garden-id': COMPONENT_ID,
130
- 'data-garden-version': '9.0.0-next.13',
187
+ 'data-garden-version': '9.0.0-next.14',
131
188
  type: 'range',
132
189
  style: {
133
190
  backgroundSize: props.hasLowerTrack && props.backgroundSize
@@ -144,13 +201,13 @@ const StyledRangeInput = styled.input.attrs(props => ({
144
201
  width: 99.8%; /* fix for IE which cuts off the upper track's border radius */
145
202
  color: transparent; /* reset for IE */
146
203
  box-sizing: border-box; /* reset for IE */
147
- `), props => sizeStyles(props), props => thumbStyles(`
204
+ `), sizeStyles, props => thumbStyles(`
148
205
  appearance: none;
149
206
  transition: box-shadow .1s ease-in-out;
150
207
  border: ${props.theme.borders.md};
151
208
  border-radius: 100%;
152
209
  box-sizing: border-box;
153
- `), props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
210
+ `), colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
154
211
  StyledRangeInput.defaultProps = {
155
212
  backgroundSize: '0%',
156
213
  hasLowerTrack: true,
@@ -6,29 +6,53 @@
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
8
  import { math } from 'polished';
9
- import { getColorV8, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { getColor, DEFAULT_THEME } from '@zendeskgarden/react-theming';
10
10
  import { StyledTextInput } from '../text/StyledTextInput.js';
11
11
  import { StyledTextMediaFigure } from '../text/StyledTextMediaFigure.js';
12
12
 
13
13
  const COMPONENT_ID = 'forms.select';
14
- const colorStyles = props => {
15
- const color = getColorV8('neutralHue', 700, props.theme);
16
- return css(["&:hover + ", ",&:focus + ", ",&:focus-visible + ", "{color:", ";}"], StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, color);
14
+ const colorStyles = _ref => {
15
+ let {
16
+ theme
17
+ } = _ref;
18
+ const color = getColor({
19
+ theme,
20
+ variable: 'foreground.subtle',
21
+ dark: {
22
+ offset: -100
23
+ },
24
+ light: {
25
+ offset: 100
26
+ }
27
+ });
28
+ const disabledColor = getColor({
29
+ theme,
30
+ variable: 'foreground.disabled'
31
+ });
32
+ return css(["&:hover + ", ",&:focus + ", ",&:focus-visible + ", "{color:", ";}&:disabled + ", "{color:", ";}"], StyledTextMediaFigure, StyledTextMediaFigure, StyledTextMediaFigure, color, StyledTextMediaFigure, disabledColor);
17
33
  };
18
- const sizeStyles = props => {
19
- const padding = math(`${props.theme.iconSizes.md} + ${props.theme.space.base * 5}`);
20
- const iconVerticalPosition = `${props.theme.space.base * (props.isCompact ? 1.5 : 2.5) + 1}px`;
21
- const iconHorizontalPosition = `${props.theme.space.base * 3}px`;
22
- return css(["padding-", ":", ";& + ", "{top:", ";", ":", ";}"], props.theme.rtl ? 'left' : 'right', !props.isBare && padding, StyledTextMediaFigure, iconVerticalPosition, props.theme.rtl ? 'left' : 'right', iconHorizontalPosition);
34
+ const sizeStyles = _ref2 => {
35
+ let {
36
+ theme,
37
+ isBare,
38
+ isCompact
39
+ } = _ref2;
40
+ const padding = isBare ? undefined : math(`${theme.iconSizes.md} + ${theme.space.base * 5}`);
41
+ const iconVerticalPosition = `${theme.space.base * (isCompact ? 1.5 : 2.5) + 1}px`;
42
+ const iconHorizontalPosition = `${theme.space.base * 3}px`;
43
+ return css(["padding-", ":", ";& + ", "{top:", ";", ":", ";}"], theme.rtl ? 'left' : 'right', padding, StyledTextMediaFigure, iconVerticalPosition, theme.rtl ? 'left' : 'right', iconHorizontalPosition);
23
44
  };
24
45
  const StyledSelect = styled(StyledTextInput).attrs({
25
46
  'data-garden-id': COMPONENT_ID,
26
- 'data-garden-version': '9.0.0-next.13',
47
+ 'data-garden-version': '9.0.0-next.14',
27
48
  as: 'select'
28
49
  }).withConfig({
29
50
  displayName: "StyledSelect",
30
51
  componentId: "sc-8xdxpt-0"
31
- })(["cursor:pointer;text-overflow:ellipsis;", ";", ";&::-ms-expand{display:none;}&::-ms-value{background-color:transparent;color:inherit;}&:-moz-focusring{transition:none;text-shadow:0 0 0 ", ";color:transparent;}& + ", "{position:absolute;pointer-events:none;}"], props => sizeStyles(props), props => colorStyles(props), props => getColorV8('foreground', 600 , props.theme), StyledTextMediaFigure);
52
+ })(["cursor:pointer;text-overflow:ellipsis;", ";", ";&::-ms-expand{display:none;}&::-ms-value{background-color:transparent;color:inherit;}&:-moz-focusring{transition:none;text-shadow:0 0 0 ", ";color:transparent;}& + ", "{position:absolute;pointer-events:none;}"], sizeStyles, colorStyles, props => getColor({
53
+ theme: props.theme,
54
+ variable: 'foreground.default'
55
+ }), StyledTextMediaFigure);
32
56
  StyledSelect.defaultProps = {
33
57
  theme: DEFAULT_THEME
34
58
  };