@zendeskgarden/react-buttons 9.0.0-next.9 → 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.
@@ -19,6 +19,7 @@ const Anchor = forwardRef((_ref, ref) => {
19
19
  children,
20
20
  isExternal,
21
21
  externalIconLabel,
22
+ isUnderlined = true,
22
23
  ...otherProps
23
24
  } = _ref;
24
25
  let anchorProps = otherProps;
@@ -36,8 +37,9 @@ const Anchor = forwardRef((_ref, ref) => {
36
37
  };
37
38
  const iconAriaLabel = useText(Anchor, checkProps, isExternal ? 'externalIconLabel' : 'noIconLabel', '(opens in a new tab)');
38
39
  return React__default.createElement(StyledAnchor, Object.assign({
39
- ref: ref
40
- }, anchorProps), children, isExternal &&
40
+ ref: ref,
41
+ $isUnderlined: isUnderlined
42
+ }, anchorProps), children, !!isExternal &&
41
43
  React__default.createElement(StyledExternalIcon, {
42
44
  role: "img",
43
45
  "aria-label": iconAriaLabel,
@@ -48,6 +50,7 @@ Anchor.displayName = 'Anchor';
48
50
  Anchor.propTypes = {
49
51
  isExternal: PropTypes.bool,
50
52
  isDanger: PropTypes.bool,
53
+ isUnderlined: PropTypes.bool,
51
54
  externalIconLabel: PropTypes.string
52
55
  };
53
56
 
@@ -21,7 +21,8 @@ const ButtonComponent = forwardRef((props, ref) => {
21
21
  const splitButtonContext = useSplitButtonContext();
22
22
  const computedProps = {
23
23
  ...props,
24
- focusInset: props.focusInset || splitButtonContext
24
+ focusInset: props.focusInset || splitButtonContext,
25
+ $isUnderlined: props.isLink
25
26
  };
26
27
  return React__default.createElement(StyledButton, Object.assign({}, computedProps, {
27
28
  ref: ref
@@ -7,7 +7,7 @@
7
7
  import * as React from 'react';
8
8
 
9
9
  var _path;
10
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
10
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
11
11
  var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
12
12
  return /*#__PURE__*/React.createElement("svg", _extends({
13
13
  xmlns: "http://www.w3.org/2000/svg",
@@ -7,7 +7,7 @@
7
7
  import * as React from 'react';
8
8
 
9
9
  var _path;
10
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
10
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
11
11
  var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
12
12
  return /*#__PURE__*/React.createElement("svg", _extends({
13
13
  xmlns: "http://www.w3.org/2000/svg",
@@ -5,13 +5,13 @@
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 { StyledButton } from './StyledButton.js';
10
10
 
11
11
  const COMPONENT_ID = 'buttons.anchor';
12
12
  const StyledAnchor = styled(StyledButton).attrs(props => ({
13
13
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.9',
14
+ 'data-garden-version': '9.0.0',
15
15
  as: 'a',
16
16
  dir: props.theme.rtl ? 'rtl' : undefined,
17
17
  isLink: true,
@@ -19,9 +19,6 @@ const StyledAnchor = styled(StyledButton).attrs(props => ({
19
19
  })).withConfig({
20
20
  displayName: "StyledAnchor",
21
21
  componentId: "sc-xshgmo-0"
22
- })(["direction:", ";", ";"], props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID, props));
23
- StyledAnchor.defaultProps = {
24
- theme: DEFAULT_THEME
25
- };
22
+ })(["direction:", ";", ";"], props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(props['data-garden-id'], props));
26
23
 
27
24
  export { StyledAnchor };
@@ -5,8 +5,8 @@
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, em } from 'polished';
9
- import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles, getFocusBoxShadow } from '@zendeskgarden/react-theming';
8
+ import { math, em } from 'polished';
9
+ import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, getColor, focusStyles, getFocusBoxShadow } from '@zendeskgarden/react-theming';
10
10
  import { StyledSplitButton } from './StyledSplitButton.js';
11
11
  import { StyledIcon } from './StyledIcon.js';
12
12
 
@@ -17,9 +17,6 @@ const getBorderRadius = props => {
17
17
  }
18
18
  return props.theme.borderRadii.md;
19
19
  };
20
- const getDisabledBackgroundColor = props => {
21
- return getColorV8('neutralHue', 200, props.theme);
22
- };
23
20
  const getHeight = props => {
24
21
  if (props.size === 'small') {
25
22
  return `${props.theme.space.base * 8}px`;
@@ -28,65 +25,228 @@ const getHeight = props => {
28
25
  }
29
26
  return `${props.theme.space.base * 10}px`;
30
27
  };
31
- const colorStyles = props => {
28
+ const colorStyles = _ref => {
29
+ let {
30
+ theme,
31
+ isLink,
32
+ isBasic,
33
+ isDanger,
34
+ isNeutral,
35
+ isPrimary,
36
+ focusInset
37
+ } = _ref;
32
38
  let retVal;
33
- let hue;
34
- if (props.disabled || props.isNeutral && props.isPrimary && !props.isDanger) {
35
- hue = 'neutralHue';
36
- } else if (props.isDanger) {
37
- hue = 'dangerHue';
38
- } else {
39
- hue = 'primaryHue';
40
- }
41
- const shade = 600;
42
- const baseColor = getColorV8(hue, shade, props.theme);
43
- const hoverColor = getColorV8(hue, shade + 100, props.theme);
44
- const activeColor = getColorV8(hue, shade + 200, props.theme);
45
- const focusColor = getColorV8('primaryHue', shade, props.theme);
46
- const disabledBackgroundColor = getDisabledBackgroundColor(props);
47
- const disabledForegroundColor = getColorV8(hue, shade - 200, props.theme);
48
- if (props.isLink) {
49
- retVal = css(["outline-color:transparent;background-color:transparent;color:", ";", " &:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}&:disabled{color:", ";}"], baseColor, focusStyles({
50
- theme: props.theme,
39
+ const disabledBackgroundColor = getColor({
40
+ theme,
41
+ variable: 'background.disabled'
42
+ });
43
+ const disabledForegroundColor = getColor({
44
+ theme,
45
+ variable: 'foreground.disabled'
46
+ });
47
+ const offset100 = {
48
+ dark: {
49
+ offset: -100
50
+ },
51
+ light: {
52
+ offset: 100
53
+ }
54
+ };
55
+ const offset200 = {
56
+ dark: {
57
+ offset: -200
58
+ },
59
+ light: {
60
+ offset: 200
61
+ }
62
+ };
63
+ if (isLink) {
64
+ const options = {
65
+ theme,
66
+ variable: isDanger ? 'foreground.danger' : 'foreground.primary'
67
+ };
68
+ const foregroundColor = getColor(options);
69
+ const hoverForegroundColor = getColor({
70
+ ...options,
71
+ ...offset100
72
+ });
73
+ const activeForegroundColor = getColor({
74
+ ...options,
75
+ ...offset200
76
+ });
77
+ const focusOutlineColor = getColor({
78
+ theme,
79
+ variable: 'border.primaryEmphasis'
80
+ });
81
+ retVal = css(["outline-color:transparent;background-color:transparent;color:", ";", " &:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}&:disabled{color:", ";}"], foregroundColor, focusStyles({
82
+ theme,
51
83
  condition: false,
52
84
  styles: {
53
- color: baseColor,
54
- outlineColor: focusColor
85
+ color: foregroundColor ,
86
+ outlineColor: focusOutlineColor
55
87
  }
56
- }), hoverColor, activeColor, disabledForegroundColor);
57
- } else if (props.isPrimary) {
58
- retVal = css(["outline-color:transparent;background-color:", ";color:", ";&:hover{background-color:", ";}", " &:active{background-color:", ";}&[aria-pressed='true'],&[aria-pressed='mixed']{background-color:", ";}&:disabled{background-color:", ";color:", ";}"], baseColor, props.theme.palette.white, hoverColor, focusStyles({
59
- theme: props.theme,
60
- inset: props.focusInset,
61
- shadowWidth: props.focusInset ? 'sm' : 'md',
62
- spacerWidth: props.focusInset ? 'sm' : 'xs',
63
- styles: props.isDanger && props.focusInset ? {
64
- borderColor: focusColor
88
+ }), hoverForegroundColor, activeForegroundColor, disabledForegroundColor);
89
+ } else if (isPrimary) {
90
+ let backgroundVariable;
91
+ if (isDanger) {
92
+ backgroundVariable = 'background.dangerEmphasis';
93
+ } else if (isNeutral) {
94
+ backgroundVariable = 'background.emphasis';
95
+ } else {
96
+ backgroundVariable = 'background.primaryEmphasis';
97
+ }
98
+ const options = {
99
+ theme,
100
+ variable: backgroundVariable
101
+ };
102
+ const backgroundColor = getColor(options);
103
+ const hoverBackgroundColor = getColor({
104
+ ...options,
105
+ ...offset100
106
+ });
107
+ const activeBackgroundColor = getColor({
108
+ ...options,
109
+ ...offset200
110
+ });
111
+ const foregroundColor = getColor({
112
+ theme,
113
+ variable: 'foreground.onEmphasis'
114
+ });
115
+ retVal = css(["outline-color:transparent;background-color:", ";color:", ";&:hover{background-color:", ";}", " &:active,&[aria-pressed='true'],&[aria-pressed='mixed']{background-color:", ";}&:disabled{background-color:", ";color:", ";}"], backgroundColor, foregroundColor, hoverBackgroundColor, focusStyles({
116
+ theme,
117
+ inset: focusInset,
118
+ shadowWidth: focusInset ? 'sm' : 'md',
119
+ spacerWidth: focusInset ? 'sm' : 'xs',
120
+ styles: (isDanger || isNeutral) && focusInset ? {
121
+ borderColor: getColor({
122
+ theme,
123
+ variable: 'border.primaryEmphasis'
124
+ })
65
125
  } : undefined
66
- }), activeColor, props.isPrimary && activeColor, disabledBackgroundColor, disabledForegroundColor);
126
+ }), activeBackgroundColor, disabledBackgroundColor, disabledForegroundColor);
67
127
  } else {
68
- const borderColor = props.isNeutral && !props.isDanger ? getColorV8('neutralHue', 300, props.theme) : baseColor;
69
- const foregroundColor = props.isNeutral ? getColorV8('foreground', 600 , props.theme) : baseColor;
70
- const hoverBorderColor = props.isNeutral && !props.isDanger ? baseColor : hoverColor;
71
- const hoverForegroundColor = props.isNeutral ? foregroundColor : hoverColor;
72
- retVal = css(["outline-color:transparent;border-color:", ";background-color:transparent;color:", ";&:hover{border-color:", ";background-color:", ";color:", ";}", " &:active,&[aria-pressed='true'],&[aria-pressed='mixed']{border-color:", ";background-color:", ";color:", ";}&:disabled{border-color:transparent;background-color:", ";color:", ";}& ", "{color:", ";}&:hover ", ",&:focus-visible ", "{color:", ";}&:active ", "{color:", ";}&:disabled ", "{color:", ";}"], !props.isBasic && borderColor, foregroundColor, !props.isBasic && hoverBorderColor, rgba(baseColor, 0.08), hoverForegroundColor, focusStyles({
73
- theme: props.theme,
74
- inset: props.focusInset,
75
- styles: props.isNeutral ? {
76
- borderColor: baseColor
77
- } : undefined
78
- }), !props.isBasic && activeColor, rgba(baseColor, 0.2), !props.isNeutral && activeColor, disabledBackgroundColor, disabledForegroundColor, StyledIcon, props.isNeutral && getColorV8('neutralHue', shade, props.theme), StyledIcon, StyledIcon, props.isNeutral && getColorV8('neutralHue', shade + 100, props.theme), StyledIcon, props.isNeutral && foregroundColor, StyledIcon, disabledForegroundColor);
128
+ let borderColor;
129
+ let hoverBorderColor;
130
+ let activeBorderColor;
131
+ let focusBorderColor;
132
+ let backgroundVariable;
133
+ let foregroundVariable;
134
+ if (isDanger) {
135
+ if (!isBasic) {
136
+ const borderOptions = {
137
+ theme,
138
+ variable: 'border.dangerEmphasis'
139
+ };
140
+ borderColor = getColor(borderOptions);
141
+ hoverBorderColor = getColor({
142
+ ...borderOptions,
143
+ ...offset100
144
+ });
145
+ activeBorderColor = getColor({
146
+ ...borderOptions,
147
+ ...offset200
148
+ });
149
+ if (isNeutral) {
150
+ focusBorderColor = getColor(borderOptions);
151
+ }
152
+ }
153
+ backgroundVariable = 'background.dangerEmphasis';
154
+ foregroundVariable = isNeutral ? 'foreground.default' : 'foreground.danger';
155
+ } else {
156
+ if (!isBasic) {
157
+ const borderOptions = {
158
+ theme,
159
+ variable: 'border.primaryEmphasis'
160
+ };
161
+ if (isNeutral) {
162
+ borderColor = getColor({
163
+ theme,
164
+ variable: 'border.default',
165
+ ...offset100
166
+ });
167
+ hoverBorderColor = getColor(borderOptions);
168
+ focusBorderColor = hoverBorderColor;
169
+ activeBorderColor = getColor({
170
+ ...borderOptions,
171
+ ...offset100
172
+ });
173
+ } else {
174
+ borderColor = getColor(borderOptions);
175
+ hoverBorderColor = getColor({
176
+ ...borderOptions,
177
+ ...offset100
178
+ });
179
+ activeBorderColor = getColor({
180
+ ...borderOptions,
181
+ ...offset200
182
+ });
183
+ }
184
+ }
185
+ backgroundVariable = 'background.primaryEmphasis';
186
+ foregroundVariable = isNeutral ? 'foreground.default' : 'foreground.primary';
187
+ }
188
+ const hoverBackgroundColor = getColor({
189
+ theme,
190
+ variable: backgroundVariable,
191
+ transparency: theme.opacity[100]
192
+ });
193
+ const activeBackgroundColor = getColor({
194
+ theme,
195
+ variable: backgroundVariable,
196
+ transparency: theme.opacity[200]
197
+ });
198
+ const foregroundOptions = {
199
+ theme,
200
+ variable: foregroundVariable
201
+ };
202
+ const foregroundColor = getColor(foregroundOptions);
203
+ let hoverForegroundColor;
204
+ let activeForegroundColor;
205
+ let iconForegroundColor;
206
+ let hoverIconForegroundColor;
207
+ let activeIconForegroundColor;
208
+ if (isNeutral) {
209
+ const iconOptions = {
210
+ theme,
211
+ variable: 'foreground.subtle'
212
+ };
213
+ iconForegroundColor = getColor(iconOptions);
214
+ hoverIconForegroundColor = getColor({
215
+ ...iconOptions,
216
+ ...offset100
217
+ });
218
+ activeIconForegroundColor = getColor({
219
+ ...iconOptions,
220
+ ...offset200
221
+ });
222
+ } else {
223
+ hoverForegroundColor = getColor({
224
+ ...foregroundOptions,
225
+ ...offset100
226
+ });
227
+ activeForegroundColor = getColor({
228
+ ...foregroundOptions,
229
+ ...offset200
230
+ });
231
+ }
232
+ retVal = css(["outline-color:transparent;border-color:", ";background-color:transparent;color:", ";&:hover{border-color:", ";background-color:", ";color:", ";}", " &:active,&[aria-pressed='true'],&[aria-pressed='mixed']{border-color:", ";background-color:", ";color:", ";}&:disabled{border-color:transparent;background-color:", ";color:", ";}& ", "{color:", ";}&:hover ", ",&:focus-visible ", "{color:", ";}&:active ", "{color:", ";}&:disabled ", "{color:", ";}"], borderColor, foregroundColor, hoverBorderColor, hoverBackgroundColor, hoverForegroundColor, focusStyles({
233
+ theme,
234
+ inset: focusInset,
235
+ styles: {
236
+ borderColor: focusBorderColor
237
+ }
238
+ }), activeBorderColor, activeBackgroundColor, activeForegroundColor, disabledBackgroundColor, disabledForegroundColor, StyledIcon, iconForegroundColor, StyledIcon, StyledIcon, hoverIconForegroundColor, StyledIcon, activeIconForegroundColor, StyledIcon, disabledForegroundColor);
79
239
  }
80
240
  return retVal;
81
241
  };
82
- const groupStyles = props => {
83
- const {
242
+ const groupStyles = _ref2 => {
243
+ let {
84
244
  theme,
85
245
  isPrimary,
86
246
  isBasic,
87
247
  isPill,
88
248
  focusInset
89
- } = props;
249
+ } = _ref2;
90
250
  const {
91
251
  rtl,
92
252
  borderWidths,
@@ -97,9 +257,15 @@ const groupStyles = props => {
97
257
  const marginOffset = borderWidths.sm;
98
258
  const marginDisplacement = `${isPrimary || isBasic ? '' : '-'}${marginOffset}`;
99
259
  const iconMarginDisplacement = isPill && '-2px';
100
- const disabledBackgroundColor = !isPrimary && getDisabledBackgroundColor(props);
260
+ const disabledBackgroundColor = !isPrimary && getColor({
261
+ theme,
262
+ variable: 'background.disabled'
263
+ });
101
264
  const borderColor = isBasic ? 'transparent' : 'revert';
102
- const focusColor = getColorV8('primaryHue', 600, theme);
265
+ const focusColor = getColor({
266
+ theme,
267
+ variable: 'border.primaryEmphasis'
268
+ });
103
269
  const focusBoxShadow = isBasic && !isPrimary && getFocusBoxShadow({
104
270
  theme,
105
271
  inset: focusInset,
@@ -141,15 +307,12 @@ const sizeStyles = props => {
141
307
  return retVal;
142
308
  };
143
309
  const StyledButton = styled.button.attrs(props => ({
144
- 'data-garden-id': COMPONENT_ID,
145
- 'data-garden-version': '9.0.0-next.9',
310
+ 'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
311
+ 'data-garden-version': '9.0.0',
146
312
  type: props.type || 'button'
147
313
  })).withConfig({
148
314
  displayName: "StyledButton",
149
315
  componentId: "sc-qe3ace-0"
150
- })(["display:", ";align-items:", ";justify-content:", ";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,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;margin:0;border:", ";border-radius:", ";cursor:pointer;width:", ";overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:", ";font-family:inherit;font-weight:", ";-webkit-font-smoothing:subpixel-antialiased;box-sizing:border-box;user-select:", ";-webkit-touch-callout:none;", ";&::-moz-focus-inner{border:0;padding:0;}", "{text-decoration:none;}&:hover{text-decoration:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{transition:border-color 0.1s ease-in-out,background-color 0.1s ease-in-out,box-shadow 0.1s ease-in-out,color 0.1s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;text-decoration:", ";}", ";&:disabled{cursor:default;text-decoration:", ";}& ", "{", "}", " &&{", "}", ""], props => props.isLink ? 'inline' : 'inline-flex', props => !props.isLink && 'center', props => !props.isLink && 'center', props => `${props.isLink ? `0px solid` : props.theme.borders.sm} transparent`, props => getBorderRadius(props), props => props.isStretched ? '100%' : '', props => !props.isLink && 'nowrap', props => props.isLink ? 'inherit' : props.theme.fontWeights.regular, props => !props.isLink && 'none', props => sizeStyles(props), SELECTOR_FOCUS_VISIBLE, props => props.isLink ? 'underline' : 'none', props => props.isLink ? 'underline' : 'none', props => colorStyles(props), props => props.isLink && 'none', StyledIcon, props => iconStyles(props), StyledSplitButton, props => groupStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
151
- StyledButton.defaultProps = {
152
- theme: DEFAULT_THEME
153
- };
316
+ })(["display:", ";align-items:", ";justify-content:", ";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,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;margin:0;border:", ";border-radius:", ";cursor:pointer;width:", ";overflow:hidden;text-decoration:", ";text-overflow:ellipsis;white-space:", ";font-family:inherit;font-weight:", ";-webkit-font-smoothing:subpixel-antialiased;box-sizing:border-box;user-select:", ";-webkit-touch-callout:none;", ";&::-moz-focus-inner{border:0;padding:0;}", "{text-decoration:none;}&:hover{text-decoration:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{transition:border-color 0.1s ease-in-out,background-color 0.1s ease-in-out,box-shadow 0.1s ease-in-out,color 0.1s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;text-decoration:", ";}", ";&:disabled{cursor:default;text-decoration:", ";}& ", "{", "}", " &&{", "}", ""], props => props.isLink ? 'inline' : 'inline-flex', props => !props.isLink && 'center', props => !props.isLink && 'center', props => `${props.isLink ? `0px solid` : props.theme.borders.sm} transparent`, props => getBorderRadius(props), props => props.isStretched ? '100%' : '', props => props.$isUnderlined ? 'underline' : 'none', props => !props.isLink && 'nowrap', props => props.isLink ? 'inherit' : props.theme.fontWeights.regular, props => !props.isLink && 'none', props => sizeStyles(props), SELECTOR_FOCUS_VISIBLE, props => props.isLink ? 'underline' : 'none', props => props.isLink ? 'underline' : 'none', props => colorStyles(props), props => props.isLink && 'none', StyledIcon, props => iconStyles(props), StyledSplitButton, props => groupStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
154
317
 
155
- export { StyledButton, getHeight };
318
+ export { COMPONENT_ID, StyledButton, getHeight };
@@ -6,18 +6,15 @@
6
6
  */
7
7
  import styled from 'styled-components';
8
8
  import SvgNewWindowStroke from '../node_modules/@zendeskgarden/svg-icons/src/12/new-window-stroke.svg.js';
9
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
10
10
 
11
11
  const COMPONENT_ID = 'buttons.external_icon';
12
12
  const StyledExternalIcon = styled(SvgNewWindowStroke).attrs({
13
13
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.9'
14
+ 'data-garden-version': '9.0.0'
15
15
  }).withConfig({
16
16
  displayName: "StyledExternalIcon",
17
17
  componentId: "sc-16oz07e-0"
18
18
  })(["transform:", ";margin-bottom:-0.085em;padding-left:0.25em;box-sizing:content-box;width:0.85em;height:0.85em;", ";"], props => props.theme.rtl && 'scaleX(-1)', props => retrieveComponentStyles(COMPONENT_ID, props));
19
- StyledExternalIcon.defaultProps = {
20
- theme: DEFAULT_THEME
21
- };
22
19
 
23
20
  export { StyledExternalIcon };
@@ -5,7 +5,7 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
- import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { StyledBaseIcon, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'buttons.icon';
11
11
  const sizeStyles = props => {
@@ -19,13 +19,10 @@ const sizeStyles = props => {
19
19
  };
20
20
  const StyledIcon = styled(StyledBaseIcon).attrs({
21
21
  'data-garden-id': COMPONENT_ID,
22
- 'data-garden-version': '9.0.0-next.9'
22
+ 'data-garden-version': '9.0.0'
23
23
  }).withConfig({
24
24
  displayName: "StyledIcon",
25
25
  componentId: "sc-19meqgg-0"
26
26
  })(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", ";"], props => props.$isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
27
- StyledIcon.defaultProps = {
28
- theme: DEFAULT_THEME
29
- };
30
27
 
31
28
  export { StyledIcon };
@@ -5,16 +5,38 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
9
- import { StyledButton, getHeight } from './StyledButton.js';
8
+ import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9
+ import { StyledButton, COMPONENT_ID as COMPONENT_ID$1, getHeight } from './StyledButton.js';
10
10
  import { StyledIcon } from './StyledIcon.js';
11
11
 
12
12
  const COMPONENT_ID = 'buttons.icon_button';
13
- const iconColorStyles = props => {
14
- const shade = 600;
15
- const baseColor = getColorV8('neutralHue', shade, props.theme);
16
- const hoverColor = getColorV8('neutralHue', shade + 100, props.theme);
17
- const activeColor = getColorV8('neutralHue', shade + 200, props.theme);
13
+ const iconColorStyles = _ref => {
14
+ let {
15
+ theme
16
+ } = _ref;
17
+ const options = {
18
+ theme,
19
+ variable: 'foreground.subtle'
20
+ };
21
+ const baseColor = getColor(options);
22
+ const hoverColor = getColor({
23
+ ...options,
24
+ dark: {
25
+ offset: -100
26
+ },
27
+ light: {
28
+ offset: 100
29
+ }
30
+ });
31
+ const activeColor = getColor({
32
+ ...options,
33
+ dark: {
34
+ offset: -200
35
+ },
36
+ light: {
37
+ offset: 200
38
+ }
39
+ });
18
40
  return css(["color:", ";&:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}"], baseColor, hoverColor, activeColor);
19
41
  };
20
42
  const iconButtonStyles = props => {
@@ -25,15 +47,15 @@ const iconStyles = props => {
25
47
  const size = props.theme.iconSizes.md;
26
48
  return css(["width:", ";height:", ";& > svg{transition:opacity 0.15s ease-in-out;}"], size, size);
27
49
  };
28
- const StyledIconButton = styled(StyledButton).attrs({
29
- 'data-garden-id': COMPONENT_ID,
30
- 'data-garden-version': '9.0.0-next.9'
50
+ const StyledIconButton = styled(StyledButton).attrs(props => {
51
+ const externalId = props['data-garden-id'];
52
+ return {
53
+ 'data-garden-id': externalId && externalId !== COMPONENT_ID$1 ? externalId : COMPONENT_ID,
54
+ 'data-garden-version': '9.0.0'
55
+ };
31
56
  }).withConfig({
32
57
  displayName: "StyledIconButton",
33
58
  componentId: "sc-1t0ughp-0"
34
- })(["", ";& ", "{", "}", ";"], props => iconButtonStyles(props), StyledIcon, props => iconStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
35
- StyledIconButton.defaultProps = {
36
- theme: DEFAULT_THEME
37
- };
59
+ })(["", ";& ", "{", "}", ";"], props => iconButtonStyles(props), StyledIcon, props => iconStyles(props), props => retrieveComponentStyles(props['data-garden-id'], props));
38
60
 
39
- export { StyledIconButton };
61
+ export { COMPONENT_ID, StyledIconButton };
@@ -5,18 +5,15 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'buttons.button_group_view';
11
11
  const StyledSplitButton = styled.div.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.0.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledSplitButton",
16
16
  componentId: "sc-1u4v04v-0"
17
17
  })(["display:inline-flex;position:relative;z-index:0;direction:", ";white-space:nowrap;", ";"], props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledSplitButton.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledSplitButton };