@zendeskgarden/react-forms 9.0.0-next.8 → 9.0.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.
Files changed (111) hide show
  1. package/dist/esm/elements/MediaInput.js +2 -2
  2. package/dist/esm/elements/Select.js +1 -0
  3. package/dist/esm/elements/Textarea.js +1 -1
  4. package/dist/esm/elements/common/Hint.js +1 -1
  5. package/dist/esm/elements/common/Label.js +2 -2
  6. package/dist/esm/elements/common/Message.js +2 -2
  7. package/dist/esm/elements/faux-input/components/EndIcon.js +16 -3
  8. package/dist/esm/elements/faux-input/components/StartIcon.js +16 -3
  9. package/dist/esm/elements/file-list/components/File.js +3 -2
  10. package/dist/esm/elements/tiles/components/Description.js +1 -1
  11. package/dist/esm/elements/tiles/components/Icon.js +1 -1
  12. package/dist/esm/elements/tiles/components/Label.js +1 -1
  13. package/dist/esm/elements/tiles/components/Tile.js +1 -3
  14. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-circle-stroke.svg.js +1 -1
  15. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-sm-fill.svg.js +1 -1
  16. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/circle-sm-fill.svg.js +1 -1
  17. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/dash-fill.svg.js +1 -1
  18. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-document-stroke.svg.js +1 -1
  19. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-error-stroke.svg.js +1 -1
  20. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-generic-stroke.svg.js +1 -1
  21. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-image-stroke.svg.js +1 -1
  22. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-pdf-stroke.svg.js +1 -1
  23. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-presentation-stroke.svg.js +1 -1
  24. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-spreadsheet-stroke.svg.js +1 -1
  25. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/file-zip-stroke.svg.js +1 -1
  26. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/trash-stroke.svg.js +1 -1
  27. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/x-stroke.svg.js +1 -1
  28. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +1 -1
  29. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js +1 -1
  30. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js +1 -1
  31. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +1 -1
  32. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/circle-sm-fill.svg.js +1 -1
  33. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-document-stroke.svg.js +1 -1
  34. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-error-stroke.svg.js +1 -1
  35. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-generic-stroke.svg.js +1 -1
  36. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-image-stroke.svg.js +1 -1
  37. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-pdf-stroke.svg.js +1 -1
  38. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-presentation-stroke.svg.js +1 -1
  39. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-spreadsheet-stroke.svg.js +1 -1
  40. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/file-zip-stroke.svg.js +1 -1
  41. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/trash-stroke.svg.js +1 -1
  42. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +1 -1
  43. package/dist/esm/styled/checkbox/StyledCheckHint.js +2 -5
  44. package/dist/esm/styled/checkbox/StyledCheckInput.js +55 -14
  45. package/dist/esm/styled/checkbox/StyledCheckLabel.js +2 -5
  46. package/dist/esm/styled/checkbox/StyledCheckMessage.js +2 -5
  47. package/dist/esm/styled/checkbox/StyledCheckSvg.js +2 -5
  48. package/dist/esm/styled/checkbox/StyledDashSvg.js +2 -5
  49. package/dist/esm/styled/common/StyledField.js +2 -5
  50. package/dist/esm/styled/common/StyledFieldset.js +2 -5
  51. package/dist/esm/styled/common/StyledHint.js +6 -6
  52. package/dist/esm/styled/common/StyledLabel.js +6 -6
  53. package/dist/esm/styled/common/StyledLegend.js +2 -5
  54. package/dist/esm/styled/common/StyledMessage.js +33 -19
  55. package/dist/esm/styled/common/StyledMessageIcon.js +4 -6
  56. package/dist/esm/styled/file-list/StyledFile.js +49 -31
  57. package/dist/esm/styled/file-list/StyledFileClose.js +6 -6
  58. package/dist/esm/styled/file-list/StyledFileDelete.js +6 -6
  59. package/dist/esm/styled/file-list/StyledFileIcon.js +22 -14
  60. package/dist/esm/styled/file-list/StyledFileList.js +2 -5
  61. package/dist/esm/styled/file-list/StyledFileListItem.js +2 -5
  62. package/dist/esm/styled/file-upload/StyledFileUpload.js +89 -23
  63. package/dist/esm/styled/input-group/StyledInputGroup.js +2 -5
  64. package/dist/esm/styled/radio/StyledRadioHint.js +2 -5
  65. package/dist/esm/styled/radio/StyledRadioInput.js +85 -27
  66. package/dist/esm/styled/radio/StyledRadioLabel.js +2 -5
  67. package/dist/esm/styled/radio/StyledRadioMessage.js +2 -5
  68. package/dist/esm/styled/radio/StyledRadioSvg.js +2 -5
  69. package/dist/esm/styled/range/StyledRangeInput.js +76 -26
  70. package/dist/esm/styled/select/StyledSelect.js +35 -14
  71. package/dist/esm/styled/select/StyledSelectWrapper.js +12 -7
  72. package/dist/esm/styled/text/StyledTextFauxInput.js +31 -26
  73. package/dist/esm/styled/text/StyledTextInput.js +103 -61
  74. package/dist/esm/styled/text/StyledTextMediaFigure.js +37 -29
  75. package/dist/esm/styled/text/StyledTextMediaInput.js +2 -5
  76. package/dist/esm/styled/text/StyledTextarea.js +2 -5
  77. package/dist/esm/styled/tiles/StyledTile.js +93 -37
  78. package/dist/esm/styled/tiles/StyledTileDescription.js +13 -16
  79. package/dist/esm/styled/tiles/StyledTileIcon.js +52 -16
  80. package/dist/esm/styled/tiles/StyledTileInput.js +1 -5
  81. package/dist/esm/styled/tiles/StyledTileLabel.js +13 -18
  82. package/dist/esm/styled/toggle/StyledToggleHint.js +2 -5
  83. package/dist/esm/styled/toggle/StyledToggleInput.js +38 -16
  84. package/dist/esm/styled/toggle/StyledToggleLabel.js +2 -5
  85. package/dist/esm/styled/toggle/StyledToggleMessage.js +2 -5
  86. package/dist/esm/styled/toggle/StyledToggleSvg.js +2 -5
  87. package/dist/index.cjs.js +977 -577
  88. package/dist/typings/elements/common/Field.d.ts +1 -1
  89. package/dist/typings/elements/common/Fieldset.d.ts +3 -1
  90. package/dist/typings/elements/faux-input/FauxInput.d.ts +3 -1
  91. package/dist/typings/elements/faux-input/components/EndIcon.d.ts +1 -1
  92. package/dist/typings/elements/faux-input/components/StartIcon.d.ts +1 -1
  93. package/dist/typings/elements/file-list/FileList.d.ts +3 -1
  94. package/dist/typings/elements/file-list/components/File.d.ts +3 -1
  95. package/dist/typings/elements/tiles/Tiles.d.ts +3 -1
  96. package/dist/typings/styled/common/StyledMessageIcon.d.ts +2 -1
  97. package/dist/typings/styled/file-list/StyledFileIcon.d.ts +7 -2
  98. package/dist/typings/styled/select/StyledSelect.d.ts +0 -3
  99. package/dist/typings/styled/select/StyledSelectWrapper.d.ts +3 -1
  100. package/dist/typings/styled/text/StyledTextFauxInput.d.ts +0 -4
  101. package/dist/typings/styled/text/StyledTextMediaFigure.d.ts +6 -7
  102. package/dist/typings/styled/tiles/StyledTile.d.ts +4 -7
  103. package/dist/typings/types/index.d.ts +3 -3
  104. package/dist/typings/utils/useFieldContext.d.ts +0 -1
  105. package/dist/typings/utils/useFieldsetContext.d.ts +0 -1
  106. package/dist/typings/utils/useFileContext.d.ts +0 -1
  107. package/dist/typings/utils/useInputContext.d.ts +0 -1
  108. package/dist/typings/utils/useInputGroupContext.d.ts +0 -1
  109. package/dist/typings/utils/useTilesContext.d.ts +0 -1
  110. package/package.json +7 -8
  111. package/LICENSE.md +0 -176
@@ -6,31 +6,52 @@
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 } 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.8',
47
+ 'data-garden-version': '9.0.0',
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);
32
- StyledSelect.defaultProps = {
33
- theme: DEFAULT_THEME
34
- };
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);
35
56
 
36
57
  export { StyledSelect };
@@ -4,21 +4,26 @@
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 { SELECTOR_FOCUS_VISIBLE, DEFAULT_THEME } from '@zendeskgarden/react-theming';
7
+ import styled, { css } from 'styled-components';
8
+ import { SELECTOR_FOCUS_VISIBLE } from '@zendeskgarden/react-theming';
9
9
  import { StyledTextFauxInput } from '../text/StyledTextFauxInput.js';
10
10
  import { StyledSelect } from './StyledSelect.js';
11
11
 
12
12
  const COMPONENT_ID = 'forms.select_wrapper';
13
+ const sizeStyles = _ref => {
14
+ let {
15
+ theme,
16
+ isCompact
17
+ } = _ref;
18
+ const height = `${theme.space.base * (isCompact ? 8 : 10)}px`;
19
+ return css(["max-height:", ";"], height);
20
+ };
13
21
  const StyledSelectWrapper = styled(StyledTextFauxInput).attrs({
14
22
  'data-garden-id': COMPONENT_ID,
15
- 'data-garden-version': '9.0.0-next.8'
23
+ 'data-garden-version': '9.0.0'
16
24
  }).withConfig({
17
25
  displayName: "StyledSelectWrapper",
18
26
  componentId: "sc-i7b6hw-0"
19
- })(["position:relative;padding:0;overflow:visible;& > ", "{border-color:transparent;background-color:transparent;", "{box-shadow:unset;}}"], StyledSelect, SELECTOR_FOCUS_VISIBLE);
20
- StyledSelectWrapper.defaultProps = {
21
- theme: DEFAULT_THEME
22
- };
27
+ })(["position:relative;padding:0;overflow:visible;", ";& > ", "{border-color:transparent;background-color:transparent;", "{box-shadow:unset;}}"], sizeStyles, StyledSelect, SELECTOR_FOCUS_VISIBLE);
23
28
 
24
29
  export { StyledSelectWrapper };
@@ -5,43 +5,51 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
- import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, DEFAULT_THEME, focusStyles, getColorV8 } from '@zendeskgarden/react-theming';
8
+ import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, getColor, focusStyles } from '@zendeskgarden/react-theming';
9
9
  import { StyledTextInput } from './StyledTextInput.js';
10
10
  import { StyledTextMediaFigure } from './StyledTextMediaFigure.js';
11
11
 
12
12
  const COMPONENT_ID = 'forms.faux_input';
13
- const VALIDATION_HUES = {
14
- success: 'successHue',
15
- warning: 'warningHue',
16
- error: 'dangerHue'
17
- };
18
- function getValidationHue(validation) {
19
- let defaultHue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'primaryHue';
20
- if (validation) {
21
- return VALIDATION_HUES[validation];
22
- }
23
- return defaultHue;
24
- }
25
- const colorStyles = props => {
26
- const {
13
+ const colorStyles = _ref => {
14
+ let {
27
15
  theme,
28
16
  validation,
29
17
  focusInset,
30
18
  isBare,
31
19
  isFocused
32
- } = props;
20
+ } = _ref;
21
+ let borderVariable;
22
+ let focusBorderColor;
23
+ if (validation) {
24
+ if (validation === 'success') {
25
+ borderVariable = 'border.successEmphasis';
26
+ } else if (validation === 'warning') {
27
+ borderVariable = 'border.warningEmphasis';
28
+ } else if (validation === 'error') {
29
+ borderVariable = 'border.dangerEmphasis';
30
+ }
31
+ focusBorderColor = getColor({
32
+ theme,
33
+ variable: borderVariable
34
+ });
35
+ } else {
36
+ borderVariable = 'border.primaryEmphasis';
37
+ focusBorderColor = getColor({
38
+ theme,
39
+ variable: borderVariable
40
+ });
41
+ }
33
42
  return css(["", ""], focusStyles({
34
43
  theme,
35
44
  inset: focusInset,
36
- condition: !isBare,
37
45
  color: {
38
- hue: getValidationHue(validation),
39
- shade: validation === 'warning' ? 700 : 600
46
+ variable: borderVariable
40
47
  },
41
48
  selector: isFocused ? '&' : '&:focus-within',
42
49
  styles: {
43
- borderColor: getColorV8(getValidationHue(validation), 600, theme)
44
- }
50
+ borderColor: focusBorderColor
51
+ },
52
+ condition: !isBare
45
53
  }));
46
54
  };
47
55
  const StyledTextFauxInput = styled(StyledTextInput).attrs(props => ({
@@ -49,13 +57,10 @@ const StyledTextFauxInput = styled(StyledTextInput).attrs(props => ({
49
57
  'aria-readonly': props.isReadOnly,
50
58
  'aria-disabled': props.isDisabled,
51
59
  'data-garden-id': COMPONENT_ID,
52
- 'data-garden-version': '9.0.0-next.8'
60
+ 'data-garden-version': '9.0.0'
53
61
  })).withConfig({
54
62
  displayName: "StyledTextFauxInput",
55
63
  componentId: "sc-yqw7j9-0"
56
64
  })(["display:", ";align-items:", ";cursor:", ";overflow:hidden;", " & > ", "{vertical-align:", ";", "{box-shadow:unset;}}& > ", "{flex-shrink:", ";}", ";"], props => props.mediaLayout ? 'inline-flex' : 'inline-block', props => props.mediaLayout && 'baseline', props => props.mediaLayout && !props.isDisabled ? 'text' : 'default', colorStyles, StyledTextInput, props => !props.mediaLayout && 'baseline', SELECTOR_FOCUS_VISIBLE, StyledTextMediaFigure, props => props.mediaLayout && '0', props => retrieveComponentStyles(COMPONENT_ID, props));
57
- StyledTextFauxInput.defaultProps = {
58
- theme: DEFAULT_THEME
59
- };
60
65
 
61
- export { StyledTextFauxInput, getValidationHue };
66
+ export { StyledTextFauxInput };
@@ -4,9 +4,12 @@
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 React__default from 'react';
8
+ import { renderToString } from 'react-dom/server';
7
9
  import styled, { css } from 'styled-components';
8
10
  import { math, em } from 'polished';
9
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
11
+ import { retrieveComponentStyles, getColor, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
12
+ import SvgChevronDownStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js';
10
13
  import { StyledHint } from '../common/StyledHint.js';
11
14
  import { StyledLabel } from '../common/StyledLabel.js';
12
15
  import { StyledMessage } from '../common/StyledMessage.js';
@@ -15,93 +18,132 @@ const COMPONENT_ID = 'forms.input';
15
18
  const isInvalid = validation => {
16
19
  return validation === 'warning' || validation === 'error';
17
20
  };
18
- const colorStyles = props => {
19
- const HUE = 'primaryHue';
20
- const SHADE = 600;
21
- const placeholderColor = getColorV8('neutralHue', SHADE - 200, props.theme);
21
+ const colorStyles = _ref => {
22
+ let {
23
+ theme,
24
+ isBare,
25
+ isHovered,
26
+ focusInset,
27
+ validation
28
+ } = _ref;
29
+ const foregroundColor = getColor({
30
+ theme,
31
+ variable: 'foreground.default'
32
+ });
33
+ const backgroundColor = isBare ? 'transparent' : getColor({
34
+ theme,
35
+ variable: 'background.default'
36
+ });
22
37
  let borderColor;
23
38
  let hoverBorderColor;
39
+ let borderVariable;
24
40
  let focusBorderColor;
25
- let focusRingHue = HUE;
26
- let focusRingShade = SHADE;
27
- if (props.validation) {
28
- let hue = HUE;
29
- if (props.validation === 'success') {
30
- hue = 'successHue';
31
- } else if (props.validation === 'warning') {
32
- hue = 'warningHue';
33
- focusRingShade = 700;
34
- } else if (props.validation === 'error') {
35
- hue = 'dangerHue';
41
+ if (validation) {
42
+ if (validation === 'success') {
43
+ borderVariable = 'border.successEmphasis';
44
+ } else if (validation === 'warning') {
45
+ borderVariable = 'border.warningEmphasis';
46
+ } else if (validation === 'error') {
47
+ borderVariable = 'border.dangerEmphasis';
36
48
  }
37
- borderColor = getColorV8(hue, SHADE, props.theme);
49
+ borderColor = getColor({
50
+ theme,
51
+ variable: borderVariable
52
+ });
38
53
  hoverBorderColor = borderColor;
39
54
  focusBorderColor = borderColor;
40
- focusRingHue = hue;
41
55
  } else {
42
- borderColor = getColorV8('neutralHue', SHADE - 300, props.theme);
43
- hoverBorderColor = getColorV8('primaryHue', SHADE, props.theme);
56
+ borderColor = getColor({
57
+ theme,
58
+ variable: 'border.default',
59
+ dark: {
60
+ offset: -100
61
+ },
62
+ light: {
63
+ offset: 100
64
+ }
65
+ });
66
+ borderVariable = 'border.primaryEmphasis';
67
+ hoverBorderColor = getColor({
68
+ theme,
69
+ variable: borderVariable
70
+ });
44
71
  focusBorderColor = hoverBorderColor;
45
72
  }
46
- const readOnlyBackgroundColor = getColorV8('neutralHue', SHADE - 500, props.theme);
47
- const readOnlyBorderColor = getColorV8('neutralHue', SHADE - 300, props.theme);
48
- const disabledBackgroundColor = readOnlyBackgroundColor;
49
- const disabledBorderColor = getColorV8('neutralHue', SHADE - 400, props.theme);
50
- const disabledForegroundColor = getColorV8('neutralHue', SHADE - 200, props.theme);
51
- let controlledBorderColor = borderColor;
52
- if (props.isFocused) {
53
- controlledBorderColor = focusBorderColor;
54
- }
55
- if (props.isHovered) {
56
- controlledBorderColor = hoverBorderColor;
57
- }
58
- return css(["border-color:", ";background-color:", ";color:", ";&::placeholder{color:", ";}&[readonly],&[aria-readonly='true']{border-color:", ";background-color:", ";}&:hover{border-color:", ";}", " &:disabled,&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], controlledBorderColor, props.isBare ? 'transparent' : getColorV8('background', 600 , props.theme), getColorV8('foreground', 600 , props.theme), placeholderColor, readOnlyBorderColor, !props.isBare && readOnlyBackgroundColor, hoverBorderColor, focusStyles({
59
- theme: props.theme,
60
- inset: props.focusInset,
61
- condition: !props.isBare,
73
+ const disabledBackgroundColor = isBare ? undefined : getColor({
74
+ theme,
75
+ variable: 'background.disabled'
76
+ });
77
+ const disabledBorderColor = getColor({
78
+ theme,
79
+ variable: 'border.disabled'
80
+ });
81
+ const disabledForegroundColor = getColor({
82
+ theme,
83
+ variable: 'foreground.disabled'
84
+ });
85
+ const placeholderColor = disabledForegroundColor;
86
+ const readOnlyBackgroundColor = disabledBackgroundColor;
87
+ const calendarPickerColor = getColor({
88
+ theme,
89
+ variable: 'foreground.subtle'
90
+ });
91
+ const calendarPickerIcon = renderToString( React__default.createElement(SvgChevronDownStroke, {
92
+ color: calendarPickerColor
93
+ }));
94
+ const calendarPickerBackgroundImage = `url("data:image/svg+xml,${encodeURIComponent(calendarPickerIcon)}")`;
95
+ return css(["border-color:", ";background-color:", ";color:", ";&::placeholder{opacity:1;color:", ";}&::-webkit-datetime-edit{color:", ";}&::-webkit-calendar-picker-indicator{background-image:", ";}&[readonly],&[aria-readonly='true']{background-color:", ";}&:hover{border-color:", ";}", " &::-webkit-calendar-picker-indicator:focus-visible{", "}&:disabled,&[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], isHovered ? hoverBorderColor : borderColor, backgroundColor, foregroundColor, placeholderColor, placeholderColor, calendarPickerBackgroundImage, readOnlyBackgroundColor, hoverBorderColor, focusStyles({
96
+ theme,
97
+ inset: focusInset,
62
98
  color: {
63
- hue: focusRingHue,
64
- shade: focusRingShade
99
+ variable: borderVariable
65
100
  },
66
101
  styles: {
67
102
  borderColor: focusBorderColor
68
- }
69
- }), disabledBorderColor, !props.isBare && disabledBackgroundColor, disabledForegroundColor);
103
+ },
104
+ condition: !isBare
105
+ }), focusStyles({
106
+ theme
107
+ }), disabledBorderColor, disabledBackgroundColor, disabledForegroundColor);
70
108
  };
71
- const sizeStyles = props => {
72
- const fontSize = props.theme.fontSizes.md;
73
- const paddingHorizontal = `${props.theme.space.base * 3}px`;
109
+ const sizeStyles = _ref2 => {
110
+ let {
111
+ theme,
112
+ isBare,
113
+ isCompact
114
+ } = _ref2;
115
+ const fontSize = theme.fontSizes.md;
116
+ const paddingHorizontal = `${theme.space.base * 3}px`;
74
117
  let height;
75
118
  let paddingVertical;
76
119
  let browseFontSize;
77
120
  let swatchHeight;
78
- if (props.isCompact) {
79
- height = `${props.theme.space.base * 8}px`;
80
- paddingVertical = `${props.theme.space.base * 1.5}px`;
81
- browseFontSize = math(`${props.theme.fontSizes.sm} - 1`);
82
- swatchHeight = `${props.theme.space.base * 6}px`;
121
+ if (isCompact) {
122
+ height = `${theme.space.base * 8}px`;
123
+ paddingVertical = `${theme.space.base * 1.5}px`;
124
+ browseFontSize = math(`${theme.fontSizes.sm} - 1`);
125
+ swatchHeight = `${theme.space.base * 6}px`;
83
126
  } else {
84
- height = `${props.theme.space.base * 10}px`;
85
- paddingVertical = `${props.theme.space.base * 2.5}px`;
86
- browseFontSize = props.theme.fontSizes.sm;
87
- swatchHeight = `${props.theme.space.base * 7}px`;
127
+ height = `${theme.space.base * 10}px`;
128
+ paddingVertical = `${theme.space.base * 2.5}px`;
129
+ browseFontSize = theme.fontSizes.sm;
130
+ swatchHeight = `${theme.space.base * 7}px`;
88
131
  }
89
- const lineHeight = math(`${height} - (${paddingVertical} * 2) - (${props.theme.borderWidths.sm} * 2)`);
90
- const padding = props.isBare ? '0' : `${em(paddingVertical, fontSize)} ${em(paddingHorizontal, fontSize)}`;
132
+ const lineHeight = math(`${height} - (${paddingVertical} * 2) - (${theme.borderWidths.sm} * 2)`);
133
+ const padding = isBare ? '0' : `${em(paddingVertical, fontSize)} ${em(paddingHorizontal, fontSize)}`;
91
134
  const swatchMarginVertical = math(`(${lineHeight} - ${swatchHeight}) / 2`);
92
135
  const swatchMarginHorizontal = math(`${paddingVertical} + ${swatchMarginVertical} - ${paddingHorizontal}`);
93
- return css(["padding:", ";min-height:", ";line-height:", ";font-size:", ";&::-ms-browse{font-size:", ";}&[type='date'],&[type='datetime-local'],&[type='file'],&[type='month'],&[type='time'],&[type='week']{max-height:", ";}&[type='file']{line-height:1;}@supports (-ms-ime-align:auto){&[type='color']{padding:", ";}}&::-moz-color-swatch{margin-top:", ";margin-left:", ";width:calc(100% + ", ");height:", ";}&::-webkit-color-swatch{margin:", " ", ";}", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", "px;}"], padding, props.isBare ? '1em' : height, getLineHeight(lineHeight, fontSize), fontSize, browseFontSize, height, props.isCompact ? '0 2px' : '1px 3px', swatchMarginVertical, swatchMarginHorizontal, math(`${swatchMarginHorizontal} * -2`), swatchHeight, swatchMarginVertical, swatchMarginHorizontal, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, props.theme.space.base * (props.isCompact ? 1 : 2));
136
+ const calendarPickerSize = `${theme.space.base * 5}px`;
137
+ const calendarPickerBackgroundSize = theme.iconSizes.md;
138
+ return css(["padding:", ";min-height:", ";line-height:", ";font-size:", ";&::-ms-browse{font-size:", ";}&[type='date'],&[type='datetime-local'],&[type='file'],&[type='month'],&[type='time'],&[type='week']{max-height:", ";}&[type='file']{line-height:1;}@supports (-ms-ime-align:auto){&[type='color']{padding:", ";}}&::-moz-color-swatch{margin-top:", ";margin-left:", ";width:calc(100% + ", ");height:", ";}&::-webkit-calendar-picker-indicator{background-position:center;background-size:", ";padding:0;width:", ";height:", ";}&::-webkit-color-swatch{margin:", " ", ";}", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& ~ ", "{margin-top:", "px;}"], padding, isBare ? '1em' : height, getLineHeight(lineHeight, fontSize), fontSize, browseFontSize, height, isCompact ? '0 2px' : '1px 3px', swatchMarginVertical, swatchMarginHorizontal, math(`${swatchMarginHorizontal} * -2`), swatchHeight, calendarPickerBackgroundSize, calendarPickerSize, calendarPickerSize, swatchMarginVertical, swatchMarginHorizontal, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, theme.space.base * (isCompact ? 1 : 2));
94
139
  };
95
140
  const StyledTextInput = styled.input.attrs(props => ({
96
141
  'data-garden-id': COMPONENT_ID,
97
- 'data-garden-version': '9.0.0-next.8',
142
+ 'data-garden-version': '9.0.0',
98
143
  'aria-invalid': isInvalid(props.validation)
99
144
  })).withConfig({
100
145
  displayName: "StyledTextInput",
101
- componentId: "sc-k12n8x-0"
102
- })(["appearance:none;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;direction:", ";border:", ";border-radius:", ";width:100%;box-sizing:border-box;vertical-align:middle;font-family:inherit;&::-ms-browse{border-radius:", ";}&::-ms-clear,&::-ms-reveal{display:none;}&::-moz-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch-wrapper{padding:0;}&::-webkit-clear-button,&::-webkit-inner-spin-button,&::-webkit-search-cancel-button,&::-webkit-search-results-button{display:none;}&::-webkit-datetime-edit{direction:", ";line-height:1;}&::placeholder{opacity:1;}&:invalid{box-shadow:none;}&[type='file']::-ms-value{display:none;}@media screen and (min--moz-device-pixel-ratio:0){&[type='number']{appearance:textfield;}}", ";", ";&:disabled{cursor:default;}", ";"], props => props.theme.rtl && 'rtl', props => props.isBare ? 'none' : props.theme.borders.sm, props => props.isBare ? '0' : props.theme.borderRadii.md, props => props.theme.borderRadii.sm, props => props.theme.borderRadii.sm, props => props.theme.borderRadii.sm, props => props.theme.rtl && 'rtl', props => sizeStyles(props), props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
103
- StyledTextInput.defaultProps = {
104
- theme: DEFAULT_THEME
105
- };
146
+ componentId: "sc-1r6733h-0"
147
+ })(["appearance:none;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;direction:", ";border:", ";border-radius:", ";width:100%;box-sizing:border-box;vertical-align:middle;font-family:inherit;&::-ms-browse{border-radius:", ";}&::-ms-clear,&::-ms-reveal{display:none;}&::-moz-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch{border:none;border-radius:", ";}&::-webkit-color-swatch-wrapper{padding:0;}&::-webkit-clear-button,&::-webkit-inner-spin-button,&::-webkit-search-cancel-button,&::-webkit-search-results-button{display:none;}&::-webkit-datetime-edit{direction:", ";line-height:1;}&::-webkit-calendar-picker-indicator{border-radius:100%;}&:invalid{box-shadow:none;}&[type='file']::-ms-value{display:none;}@media screen and (min--moz-device-pixel-ratio:0){&[type='number']{appearance:textfield;}}", ";", ";&:disabled{cursor:default;}", ";"], props => props.theme.rtl && 'rtl', props => props.isBare ? 'none' : props.theme.borders.sm, props => props.isBare ? '0' : props.theme.borderRadii.md, props => props.theme.borderRadii.sm, props => props.theme.borderRadii.sm, props => props.theme.borderRadii.sm, props => props.theme.rtl && 'rtl', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
106
148
 
107
149
  export { StyledTextInput };
@@ -5,53 +5,61 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
- import React__default, { Children } from 'react';
9
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
8
+ import { StyledBaseIcon, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
10
9
 
11
10
  const COMPONENT_ID = 'forms.media_figure';
12
- const colorStyles = props => {
13
- let shade = 600;
14
- if (props.isDisabled) {
15
- shade = 400;
16
- } else if (props.isHovered || props.isFocused) {
17
- shade = 700;
11
+ const colorStyles = _ref => {
12
+ let {
13
+ theme,
14
+ $isDisabled,
15
+ $isHovered,
16
+ $isFocused
17
+ } = _ref;
18
+ let color;
19
+ if ($isDisabled) {
20
+ color = getColor({
21
+ theme,
22
+ variable: 'foreground.disabled'
23
+ });
24
+ } else {
25
+ const options = {
26
+ theme,
27
+ variable: 'foreground.subtle'
28
+ };
29
+ if ($isHovered || $isFocused) {
30
+ color = getColor({
31
+ ...options,
32
+ dark: {
33
+ offset: -100
34
+ },
35
+ light: {
36
+ offset: 100
37
+ }
38
+ });
39
+ } else {
40
+ color = getColor(options);
41
+ }
18
42
  }
19
- return css(["color:", ";"], getColorV8('neutralHue', shade, props.theme));
43
+ return css(["color:", ";"], color);
20
44
  };
21
45
  const sizeStyles = props => {
22
46
  const size = props.theme.iconSizes.md;
23
47
  const marginFirst = `1px ${props.theme.space.base * 2}px auto 0`;
24
48
  const marginLast = `1px 0 auto ${props.theme.space.base * 2}px`;
25
49
  let margin;
26
- if (props.position === 'start') {
50
+ if (props.$position === 'start') {
27
51
  margin = props.theme.rtl ? marginLast : marginFirst;
28
52
  } else {
29
53
  margin = props.theme.rtl ? marginFirst : marginLast;
30
54
  }
31
55
  return css(["margin:", ";width:", ";height:", ";"], margin, size, size);
32
56
  };
33
- const StyledTextMediaFigure = styled(
34
- _ref => {
35
- let {
36
- children,
37
- position,
38
- isHovered,
39
- isFocused,
40
- isDisabled,
41
- isRotated,
42
- theme,
43
- ...props
44
- } = _ref;
45
- return React__default.cloneElement(Children.only(children), props);
46
- }).attrs({
57
+ const StyledTextMediaFigure = styled(StyledBaseIcon).attrs({
47
58
  'data-garden-id': COMPONENT_ID,
48
- 'data-garden-version': '9.0.0-next.8'
59
+ 'data-garden-version': '9.0.0'
49
60
  }).withConfig({
50
61
  displayName: "StyledTextMediaFigure",
51
62
  componentId: "sc-1qepknj-0"
52
- })(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", " ", ";"], props => props.isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => colorStyles(props), props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
53
- StyledTextMediaFigure.defaultProps = {
54
- theme: DEFAULT_THEME
55
- };
63
+ })(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", " ", ";"], props => props.$isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
56
64
 
57
65
  export { StyledTextMediaFigure };
@@ -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, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
  import { StyledTextInput } from './StyledTextInput.js';
10
10
 
11
11
  const COMPONENT_ID = 'forms.media_input';
12
12
  const StyledTextMediaInput = styled(StyledTextInput).attrs({
13
13
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.8',
14
+ 'data-garden-version': '9.0.0',
15
15
  isBare: true
16
16
  }).withConfig({
17
17
  displayName: "StyledTextMediaInput",
18
18
  componentId: "sc-12i9xfi-0"
19
19
  })(["flex-grow:1;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
20
- StyledTextMediaInput.defaultProps = {
21
- theme: DEFAULT_THEME
22
- };
23
20
 
24
21
  export { StyledTextMediaInput };
@@ -5,7 +5,7 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
  import { StyledTextInput } from './StyledTextInput.js';
10
10
 
11
11
  const COMPONENT_ID = 'forms.textarea';
@@ -21,13 +21,10 @@ const hiddenStyles = `
21
21
  const StyledTextarea = styled(StyledTextInput).attrs({
22
22
  as: 'textarea',
23
23
  'data-garden-id': COMPONENT_ID,
24
- 'data-garden-version': '9.0.0-next.8'
24
+ 'data-garden-version': '9.0.0'
25
25
  }).withConfig({
26
26
  displayName: "StyledTextarea",
27
27
  componentId: "sc-wxschl-0"
28
28
  })(["resize:", ";overflow:auto;", ";", ";"], props => props.isResizable ? 'vertical' : 'none', props => props.isHidden && hiddenStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
29
- StyledTextarea.defaultProps = {
30
- theme: DEFAULT_THEME
31
- };
32
29
 
33
30
  export { StyledTextarea };