@zendeskgarden/react-buttons 9.0.0 → 9.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
@@ -17,12 +17,13 @@ import { useText } from '@zendeskgarden/react-theming';
17
17
  const Anchor = forwardRef((_ref, ref) => {
18
18
  let {
19
19
  children,
20
- isExternal,
21
20
  externalIconLabel,
21
+ isDanger,
22
+ isExternal,
22
23
  isUnderlined = true,
23
- ...otherProps
24
+ ...other
24
25
  } = _ref;
25
- let anchorProps = otherProps;
26
+ let anchorProps = other;
26
27
  if (isExternal) {
27
28
  anchorProps = {
28
29
  target: '_blank',
@@ -38,6 +39,7 @@ const Anchor = forwardRef((_ref, ref) => {
38
39
  const iconAriaLabel = useText(Anchor, checkProps, isExternal ? 'externalIconLabel' : 'noIconLabel', '(opens in a new tab)');
39
40
  return React__default.createElement(StyledAnchor, Object.assign({
40
41
  ref: ref,
42
+ $isDanger: isDanger,
41
43
  $isUnderlined: isUnderlined
42
44
  }, anchorProps), children, !!isExternal &&
43
45
  React__default.createElement(StyledExternalIcon, {
@@ -17,26 +17,43 @@ import { useSplitButtonContext } from '../utils/useSplitButtonContext.js';
17
17
  import { StartIcon } from './components/StartIcon.js';
18
18
  import { EndIcon } from './components/EndIcon.js';
19
19
 
20
- const ButtonComponent = forwardRef((props, ref) => {
21
- const splitButtonContext = useSplitButtonContext();
22
- const computedProps = {
23
- ...props,
24
- focusInset: props.focusInset || splitButtonContext,
25
- $isUnderlined: props.isLink
26
- };
27
- return React__default.createElement(StyledButton, Object.assign({}, computedProps, {
20
+ const ButtonComponent = forwardRef((_ref, ref) => {
21
+ let {
22
+ focusInset,
23
+ isBasic,
24
+ isDanger,
25
+ isLink,
26
+ isNeutral,
27
+ isPill,
28
+ isPrimary,
29
+ isStretched,
30
+ size,
31
+ ...other
32
+ } = _ref;
33
+ const splitButtonFocusInset = useSplitButtonContext();
34
+ return React__default.createElement(StyledButton, Object.assign({}, other, {
35
+ $focusInset: focusInset || splitButtonFocusInset,
36
+ $isBasic: isBasic,
37
+ $isDanger: isDanger,
38
+ $isLink: isLink,
39
+ $isNeutral: isNeutral,
40
+ $isPill: isPill,
41
+ $isPrimary: isPrimary,
42
+ $isStretched: isStretched,
43
+ $isUnderlined: isLink,
44
+ $size: size,
28
45
  ref: ref
29
46
  }));
30
47
  });
31
48
  ButtonComponent.displayName = 'Button';
32
49
  ButtonComponent.propTypes = {
33
- isNeutral: PropTypes.bool,
34
- isPrimary: PropTypes.bool,
35
- isDanger: PropTypes.bool,
36
- isPill: PropTypes.bool,
37
- isBasic: PropTypes.bool,
38
50
  focusInset: PropTypes.bool,
51
+ isBasic: PropTypes.bool,
52
+ isDanger: PropTypes.bool,
39
53
  isLink: PropTypes.bool,
54
+ isNeutral: PropTypes.bool,
55
+ isPill: PropTypes.bool,
56
+ isPrimary: PropTypes.bool,
40
57
  isStretched: PropTypes.bool,
41
58
  size: PropTypes.oneOf(SIZE)
42
59
  };
@@ -8,14 +8,9 @@ import React__default, { forwardRef } from 'react';
8
8
  import { IconButton } from './IconButton.js';
9
9
  import SvgChevronDownStroke from '../node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js';
10
10
 
11
- const ChevronButton = forwardRef((_ref, ref) => {
12
- let {
13
- ...buttonProps
14
- } = _ref;
15
- return React__default.createElement(IconButton, Object.assign({
16
- ref: ref
17
- }, buttonProps), React__default.createElement(SvgChevronDownStroke, null));
18
- });
11
+ const ChevronButton = forwardRef((props, ref) => React__default.createElement(IconButton, Object.assign({
12
+ ref: ref
13
+ }, props), React__default.createElement(SvgChevronDownStroke, null)));
19
14
  ChevronButton.displayName = 'ChevronButton';
20
15
  ChevronButton.propTypes = IconButton.propTypes;
21
16
  ChevronButton.defaultProps = {
@@ -18,28 +18,40 @@ import { useSplitButtonContext } from '../utils/useSplitButtonContext.js';
18
18
  const IconButton = forwardRef((_ref, ref) => {
19
19
  let {
20
20
  children,
21
+ focusInset,
22
+ isBasic,
23
+ isDanger,
24
+ isNeutral,
25
+ isPill,
26
+ isPrimary,
21
27
  isRotated,
22
- ...otherProps
28
+ size,
29
+ ...other
23
30
  } = _ref;
24
- const focusInset = useSplitButtonContext();
25
- return React__default.createElement(StyledIconButton, Object.assign({
31
+ const splitButtonFocusInset = useSplitButtonContext();
32
+ return React__default.createElement(StyledIconButton, Object.assign({}, other, {
33
+ $isBasic: isBasic,
34
+ $isDanger: isDanger,
35
+ $isNeutral: isNeutral,
36
+ $isPill: isPill,
37
+ $isPrimary: isPrimary,
38
+ $size: size,
39
+ $focusInset: focusInset || splitButtonFocusInset,
26
40
  ref: ref
27
- }, otherProps, {
28
- focusInset: otherProps.focusInset || focusInset
29
41
  }), React__default.createElement(StyledIcon, {
30
42
  $isRotated: isRotated
31
43
  }, children));
32
44
  });
33
45
  IconButton.displayName = 'IconButton';
34
46
  IconButton.propTypes = {
47
+ focusInset: PropTypes.bool,
48
+ isBasic: PropTypes.bool,
35
49
  isDanger: PropTypes.bool,
36
- size: PropTypes.oneOf(SIZE),
37
50
  isNeutral: PropTypes.bool,
38
- isPrimary: PropTypes.bool,
39
- isBasic: PropTypes.bool,
40
51
  isPill: PropTypes.bool,
41
- focusInset: PropTypes.bool,
42
- isRotated: PropTypes.bool
52
+ isPrimary: PropTypes.bool,
53
+ isRotated: PropTypes.bool,
54
+ size: PropTypes.oneOf(SIZE)
43
55
  };
44
56
  IconButton.defaultProps = {
45
57
  isPill: true,
@@ -11,10 +11,10 @@ import { StyledButton } from './StyledButton.js';
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',
14
+ 'data-garden-version': '9.1.1',
15
15
  as: 'a',
16
16
  dir: props.theme.rtl ? 'rtl' : undefined,
17
- isLink: true,
17
+ $isLink: true,
18
18
  type: undefined
19
19
  })).withConfig({
20
20
  displayName: "StyledAnchor",
@@ -12,15 +12,15 @@ import { StyledIcon } from './StyledIcon.js';
12
12
 
13
13
  const COMPONENT_ID = 'buttons.button';
14
14
  const getBorderRadius = props => {
15
- if (props.isPill) {
15
+ if (props.$isPill) {
16
16
  return '100px';
17
17
  }
18
18
  return props.theme.borderRadii.md;
19
19
  };
20
20
  const getHeight = props => {
21
- if (props.size === 'small') {
21
+ if (props.$size === 'small') {
22
22
  return `${props.theme.space.base * 8}px`;
23
- } else if (props.size === 'large') {
23
+ } else if (props.$size === 'large') {
24
24
  return `${props.theme.space.base * 12}px`;
25
25
  }
26
26
  return `${props.theme.space.base * 10}px`;
@@ -28,12 +28,12 @@ const getHeight = props => {
28
28
  const colorStyles = _ref => {
29
29
  let {
30
30
  theme,
31
- isLink,
32
- isBasic,
33
- isDanger,
34
- isNeutral,
35
- isPrimary,
36
- focusInset
31
+ $isLink,
32
+ $isBasic,
33
+ $isDanger,
34
+ $isNeutral,
35
+ $isPrimary,
36
+ $focusInset
37
37
  } = _ref;
38
38
  let retVal;
39
39
  const disabledBackgroundColor = getColor({
@@ -60,10 +60,10 @@ const colorStyles = _ref => {
60
60
  offset: 200
61
61
  }
62
62
  };
63
- if (isLink) {
63
+ if ($isLink) {
64
64
  const options = {
65
65
  theme,
66
- variable: isDanger ? 'foreground.danger' : 'foreground.primary'
66
+ variable: $isDanger ? 'foreground.danger' : 'foreground.primary'
67
67
  };
68
68
  const foregroundColor = getColor(options);
69
69
  const hoverForegroundColor = getColor({
@@ -86,11 +86,11 @@ const colorStyles = _ref => {
86
86
  outlineColor: focusOutlineColor
87
87
  }
88
88
  }), hoverForegroundColor, activeForegroundColor, disabledForegroundColor);
89
- } else if (isPrimary) {
89
+ } else if ($isPrimary) {
90
90
  let backgroundVariable;
91
- if (isDanger) {
91
+ if ($isDanger) {
92
92
  backgroundVariable = 'background.dangerEmphasis';
93
- } else if (isNeutral) {
93
+ } else if ($isNeutral) {
94
94
  backgroundVariable = 'background.emphasis';
95
95
  } else {
96
96
  backgroundVariable = 'background.primaryEmphasis';
@@ -114,10 +114,10 @@ const colorStyles = _ref => {
114
114
  });
115
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
116
  theme,
117
- inset: focusInset,
118
- shadowWidth: focusInset ? 'sm' : 'md',
119
- spacerWidth: focusInset ? 'sm' : 'xs',
120
- styles: (isDanger || isNeutral) && focusInset ? {
117
+ inset: $focusInset,
118
+ shadowWidth: $focusInset ? 'sm' : 'md',
119
+ spacerWidth: $focusInset ? 'sm' : 'xs',
120
+ styles: ($isDanger || $isNeutral) && $focusInset ? {
121
121
  borderColor: getColor({
122
122
  theme,
123
123
  variable: 'border.primaryEmphasis'
@@ -131,8 +131,8 @@ const colorStyles = _ref => {
131
131
  let focusBorderColor;
132
132
  let backgroundVariable;
133
133
  let foregroundVariable;
134
- if (isDanger) {
135
- if (!isBasic) {
134
+ if ($isDanger) {
135
+ if (!$isBasic) {
136
136
  const borderOptions = {
137
137
  theme,
138
138
  variable: 'border.dangerEmphasis'
@@ -146,19 +146,19 @@ const colorStyles = _ref => {
146
146
  ...borderOptions,
147
147
  ...offset200
148
148
  });
149
- if (isNeutral) {
149
+ if ($isNeutral) {
150
150
  focusBorderColor = getColor(borderOptions);
151
151
  }
152
152
  }
153
153
  backgroundVariable = 'background.dangerEmphasis';
154
- foregroundVariable = isNeutral ? 'foreground.default' : 'foreground.danger';
154
+ foregroundVariable = $isNeutral ? 'foreground.default' : 'foreground.danger';
155
155
  } else {
156
- if (!isBasic) {
156
+ if (!$isBasic) {
157
157
  const borderOptions = {
158
158
  theme,
159
159
  variable: 'border.primaryEmphasis'
160
160
  };
161
- if (isNeutral) {
161
+ if ($isNeutral) {
162
162
  borderColor = getColor({
163
163
  theme,
164
164
  variable: 'border.default',
@@ -183,7 +183,7 @@ const colorStyles = _ref => {
183
183
  }
184
184
  }
185
185
  backgroundVariable = 'background.primaryEmphasis';
186
- foregroundVariable = isNeutral ? 'foreground.default' : 'foreground.primary';
186
+ foregroundVariable = $isNeutral ? 'foreground.default' : 'foreground.primary';
187
187
  }
188
188
  const hoverBackgroundColor = getColor({
189
189
  theme,
@@ -205,7 +205,7 @@ const colorStyles = _ref => {
205
205
  let iconForegroundColor;
206
206
  let hoverIconForegroundColor;
207
207
  let activeIconForegroundColor;
208
- if (isNeutral) {
208
+ if ($isNeutral) {
209
209
  const iconOptions = {
210
210
  theme,
211
211
  variable: 'foreground.subtle'
@@ -231,7 +231,7 @@ const colorStyles = _ref => {
231
231
  }
232
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
233
  theme,
234
- inset: focusInset,
234
+ inset: $focusInset,
235
235
  styles: {
236
236
  borderColor: focusBorderColor
237
237
  }
@@ -242,10 +242,10 @@ const colorStyles = _ref => {
242
242
  const groupStyles = _ref2 => {
243
243
  let {
244
244
  theme,
245
- isPrimary,
246
- isBasic,
247
- isPill,
248
- focusInset
245
+ $isPrimary,
246
+ $isBasic,
247
+ $isPill,
248
+ $focusInset
249
249
  } = _ref2;
250
250
  const {
251
251
  rtl,
@@ -255,20 +255,20 @@ const groupStyles = _ref2 => {
255
255
  const startPosition = rtl ? 'right' : 'left';
256
256
  const endPosition = rtl ? 'left' : 'right';
257
257
  const marginOffset = borderWidths.sm;
258
- const marginDisplacement = `${isPrimary || isBasic ? '' : '-'}${marginOffset}`;
259
- const iconMarginDisplacement = isPill && '-2px';
260
- const disabledBackgroundColor = !isPrimary && getColor({
258
+ const marginDisplacement = `${$isPrimary || $isBasic ? '' : '-'}${marginOffset}`;
259
+ const iconMarginDisplacement = $isPill && '-2px';
260
+ const disabledBackgroundColor = !$isPrimary && getColor({
261
261
  theme,
262
262
  variable: 'background.disabled'
263
263
  });
264
- const borderColor = isBasic ? 'transparent' : 'revert';
264
+ const borderColor = $isBasic ? 'transparent' : 'revert';
265
265
  const focusColor = getColor({
266
266
  theme,
267
267
  variable: 'border.primaryEmphasis'
268
268
  });
269
- const focusBoxShadow = isBasic && !isPrimary && getFocusBoxShadow({
269
+ const focusBoxShadow = $isBasic && !$isPrimary && getFocusBoxShadow({
270
270
  theme,
271
- inset: focusInset,
271
+ inset: $focusInset,
272
272
  spacerColor: {
273
273
  hue: focusColor
274
274
  },
@@ -279,24 +279,24 @@ const groupStyles = _ref2 => {
279
279
  return css(["position:relative;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,margin-", " 0.1s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;border:", " ", ";", "{border-color:", ";box-shadow:", ";}&:hover,&:active,", "{z-index:1;}&:disabled{z-index:-1;background-color:", ";}&:not(:first-of-type){margin-", ":", ";}&:not(:first-of-type):disabled{margin-", ":", ";}&:not(:first-of-type):not(:last-of-type){border-radius:0;}&:first-of-type:not(:last-of-type){border-top-", "-radius:0;border-bottom-", "-radius:0;}&:last-of-type:not(:first-of-type){border-top-", "-radius:0;border-bottom-", "-radius:0;}&:first-of-type:not(:last-of-type) ", "{margin-", ":", ";}&:last-of-type:not(:first-of-type) ", "{margin-", ":", ";}"], startPosition, borders.sm, borderColor, SELECTOR_FOCUS_VISIBLE, focusColor, focusBoxShadow, SELECTOR_FOCUS_VISIBLE, disabledBackgroundColor, startPosition, marginDisplacement, startPosition, marginOffset, endPosition, endPosition, startPosition, startPosition, StyledIcon, endPosition, iconMarginDisplacement, StyledIcon, startPosition, iconMarginDisplacement);
280
280
  };
281
281
  const iconStyles = props => {
282
- const size = props.size === 'small' ? props.theme.iconSizes.sm : props.theme.iconSizes.md;
283
- return css(["width:", ";min-width:", ";height:", ";vertical-align:", ";"], size, size, size, props.isLink && 'middle');
282
+ const $size = props.$size === 'small' ? props.theme.iconSizes.sm : props.theme.iconSizes.md;
283
+ return css(["width:", ";min-width:", ";height:", ";vertical-align:", ";"], $size, $size, $size, props.$isLink && 'middle');
284
284
  };
285
285
  const sizeStyles = props => {
286
286
  let retVal;
287
- if (props.isLink) {
287
+ if (props.$isLink) {
288
288
  retVal = css(["padding:0;font-size:inherit;"]);
289
289
  } else {
290
290
  const height = getHeight(props);
291
291
  const lineHeight = math(`${height} - (${props.theme.borderWidths.sm} * 2)`);
292
292
  let padding;
293
293
  let fontSize;
294
- if (props.size === 'small') {
294
+ if (props.$size === 'small') {
295
295
  fontSize = props.theme.fontSizes.sm;
296
296
  padding = `${props.theme.space.base * 3}px`;
297
297
  } else {
298
298
  fontSize = props.theme.fontSizes.md;
299
- if (props.size === 'large') {
299
+ if (props.$size === 'large') {
300
300
  padding = `${props.theme.space.base * 5}px`;
301
301
  } else {
302
302
  padding = `${props.theme.space.base * 4}px`;
@@ -308,11 +308,11 @@ const sizeStyles = props => {
308
308
  };
309
309
  const StyledButton = styled.button.attrs(props => ({
310
310
  'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
311
- 'data-garden-version': '9.0.0',
311
+ 'data-garden-version': '9.1.1',
312
312
  type: props.type || 'button'
313
313
  })).withConfig({
314
314
  displayName: "StyledButton",
315
315
  componentId: "sc-qe3ace-0"
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));
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));
317
317
 
318
318
  export { COMPONENT_ID, StyledButton, getHeight };
@@ -11,7 +11,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
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'
14
+ 'data-garden-version': '9.1.1'
15
15
  }).withConfig({
16
16
  displayName: "StyledExternalIcon",
17
17
  componentId: "sc-16oz07e-0"
@@ -19,7 +19,7 @@ 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'
22
+ 'data-garden-version': '9.1.1'
23
23
  }).withConfig({
24
24
  displayName: "StyledIcon",
25
25
  componentId: "sc-19meqgg-0"
@@ -41,7 +41,7 @@ const iconColorStyles = _ref => {
41
41
  };
42
42
  const iconButtonStyles = props => {
43
43
  const width = getHeight(props);
44
- return css(["border:", ";padding:0;width:", ";min-width:", ";", ";&:disabled{background-color:", ";}"], props.isBasic && 'none', width, width, props.isBasic && !(props.isPrimary || props.isDanger || props.disabled) && iconColorStyles(props), !props.isPrimary && 'transparent');
44
+ return css(["border:", ";padding:0;width:", ";min-width:", ";", ";&:disabled{background-color:", ";}"], props.$isBasic && 'none', width, width, props.$isBasic && !(props.$isPrimary || props.$isDanger || props.disabled) && iconColorStyles(props), !props.$isPrimary && 'transparent');
45
45
  };
46
46
  const iconStyles = props => {
47
47
  const size = props.theme.iconSizes.md;
@@ -51,11 +51,11 @@ const StyledIconButton = styled(StyledButton).attrs(props => {
51
51
  const externalId = props['data-garden-id'];
52
52
  return {
53
53
  'data-garden-id': externalId && externalId !== COMPONENT_ID$1 ? externalId : COMPONENT_ID,
54
- 'data-garden-version': '9.0.0'
54
+ 'data-garden-version': '9.1.1'
55
55
  };
56
56
  }).withConfig({
57
57
  displayName: "StyledIconButton",
58
58
  componentId: "sc-1t0ughp-0"
59
- })(["", ";& ", "{", "}", ";"], props => iconButtonStyles(props), StyledIcon, props => iconStyles(props), props => retrieveComponentStyles(props['data-garden-id'], props));
59
+ })(["", ";& ", "{", "}", ";"], iconButtonStyles, StyledIcon, iconStyles, props => retrieveComponentStyles(props['data-garden-id'], props));
60
60
 
61
61
  export { COMPONENT_ID, StyledIconButton };
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
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'
13
+ 'data-garden-version': '9.1.1'
14
14
  }).withConfig({
15
15
  displayName: "StyledSplitButton",
16
16
  componentId: "sc-1u4v04v-0"
package/dist/index.cjs.js CHANGED
@@ -41,7 +41,7 @@ const SIZE = ['small', 'medium', 'large'];
41
41
  const COMPONENT_ID$5 = 'buttons.button_group_view';
42
42
  const StyledSplitButton = styled__default.default.div.attrs({
43
43
  'data-garden-id': COMPONENT_ID$5,
44
- 'data-garden-version': '9.0.0'
44
+ 'data-garden-version': '9.1.1'
45
45
  }).withConfig({
46
46
  displayName: "StyledSplitButton",
47
47
  componentId: "sc-1u4v04v-0"
@@ -59,7 +59,7 @@ const sizeStyles$1 = props => {
59
59
  };
60
60
  const StyledIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
61
61
  'data-garden-id': COMPONENT_ID$4,
62
- 'data-garden-version': '9.0.0'
62
+ 'data-garden-version': '9.1.1'
63
63
  }).withConfig({
64
64
  displayName: "StyledIcon",
65
65
  componentId: "sc-19meqgg-0"
@@ -67,15 +67,15 @@ const StyledIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
67
67
 
68
68
  const COMPONENT_ID$3 = 'buttons.button';
69
69
  const getBorderRadius = props => {
70
- if (props.isPill) {
70
+ if (props.$isPill) {
71
71
  return '100px';
72
72
  }
73
73
  return props.theme.borderRadii.md;
74
74
  };
75
75
  const getHeight = props => {
76
- if (props.size === 'small') {
76
+ if (props.$size === 'small') {
77
77
  return `${props.theme.space.base * 8}px`;
78
- } else if (props.size === 'large') {
78
+ } else if (props.$size === 'large') {
79
79
  return `${props.theme.space.base * 12}px`;
80
80
  }
81
81
  return `${props.theme.space.base * 10}px`;
@@ -83,12 +83,12 @@ const getHeight = props => {
83
83
  const colorStyles = _ref => {
84
84
  let {
85
85
  theme,
86
- isLink,
87
- isBasic,
88
- isDanger,
89
- isNeutral,
90
- isPrimary,
91
- focusInset
86
+ $isLink,
87
+ $isBasic,
88
+ $isDanger,
89
+ $isNeutral,
90
+ $isPrimary,
91
+ $focusInset
92
92
  } = _ref;
93
93
  let retVal;
94
94
  const disabledBackgroundColor = reactTheming.getColor({
@@ -115,10 +115,10 @@ const colorStyles = _ref => {
115
115
  offset: 200
116
116
  }
117
117
  };
118
- if (isLink) {
118
+ if ($isLink) {
119
119
  const options = {
120
120
  theme,
121
- variable: isDanger ? 'foreground.danger' : 'foreground.primary'
121
+ variable: $isDanger ? 'foreground.danger' : 'foreground.primary'
122
122
  };
123
123
  const foregroundColor = reactTheming.getColor(options);
124
124
  const hoverForegroundColor = reactTheming.getColor({
@@ -141,11 +141,11 @@ const colorStyles = _ref => {
141
141
  outlineColor: focusOutlineColor
142
142
  }
143
143
  }), hoverForegroundColor, activeForegroundColor, disabledForegroundColor);
144
- } else if (isPrimary) {
144
+ } else if ($isPrimary) {
145
145
  let backgroundVariable;
146
- if (isDanger) {
146
+ if ($isDanger) {
147
147
  backgroundVariable = 'background.dangerEmphasis';
148
- } else if (isNeutral) {
148
+ } else if ($isNeutral) {
149
149
  backgroundVariable = 'background.emphasis';
150
150
  } else {
151
151
  backgroundVariable = 'background.primaryEmphasis';
@@ -169,10 +169,10 @@ const colorStyles = _ref => {
169
169
  });
170
170
  retVal = styled.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, reactTheming.focusStyles({
171
171
  theme,
172
- inset: focusInset,
173
- shadowWidth: focusInset ? 'sm' : 'md',
174
- spacerWidth: focusInset ? 'sm' : 'xs',
175
- styles: (isDanger || isNeutral) && focusInset ? {
172
+ inset: $focusInset,
173
+ shadowWidth: $focusInset ? 'sm' : 'md',
174
+ spacerWidth: $focusInset ? 'sm' : 'xs',
175
+ styles: ($isDanger || $isNeutral) && $focusInset ? {
176
176
  borderColor: reactTheming.getColor({
177
177
  theme,
178
178
  variable: 'border.primaryEmphasis'
@@ -186,8 +186,8 @@ const colorStyles = _ref => {
186
186
  let focusBorderColor;
187
187
  let backgroundVariable;
188
188
  let foregroundVariable;
189
- if (isDanger) {
190
- if (!isBasic) {
189
+ if ($isDanger) {
190
+ if (!$isBasic) {
191
191
  const borderOptions = {
192
192
  theme,
193
193
  variable: 'border.dangerEmphasis'
@@ -201,19 +201,19 @@ const colorStyles = _ref => {
201
201
  ...borderOptions,
202
202
  ...offset200
203
203
  });
204
- if (isNeutral) {
204
+ if ($isNeutral) {
205
205
  focusBorderColor = reactTheming.getColor(borderOptions);
206
206
  }
207
207
  }
208
208
  backgroundVariable = 'background.dangerEmphasis';
209
- foregroundVariable = isNeutral ? 'foreground.default' : 'foreground.danger';
209
+ foregroundVariable = $isNeutral ? 'foreground.default' : 'foreground.danger';
210
210
  } else {
211
- if (!isBasic) {
211
+ if (!$isBasic) {
212
212
  const borderOptions = {
213
213
  theme,
214
214
  variable: 'border.primaryEmphasis'
215
215
  };
216
- if (isNeutral) {
216
+ if ($isNeutral) {
217
217
  borderColor = reactTheming.getColor({
218
218
  theme,
219
219
  variable: 'border.default',
@@ -238,7 +238,7 @@ const colorStyles = _ref => {
238
238
  }
239
239
  }
240
240
  backgroundVariable = 'background.primaryEmphasis';
241
- foregroundVariable = isNeutral ? 'foreground.default' : 'foreground.primary';
241
+ foregroundVariable = $isNeutral ? 'foreground.default' : 'foreground.primary';
242
242
  }
243
243
  const hoverBackgroundColor = reactTheming.getColor({
244
244
  theme,
@@ -260,7 +260,7 @@ const colorStyles = _ref => {
260
260
  let iconForegroundColor;
261
261
  let hoverIconForegroundColor;
262
262
  let activeIconForegroundColor;
263
- if (isNeutral) {
263
+ if ($isNeutral) {
264
264
  const iconOptions = {
265
265
  theme,
266
266
  variable: 'foreground.subtle'
@@ -286,7 +286,7 @@ const colorStyles = _ref => {
286
286
  }
287
287
  retVal = styled.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, reactTheming.focusStyles({
288
288
  theme,
289
- inset: focusInset,
289
+ inset: $focusInset,
290
290
  styles: {
291
291
  borderColor: focusBorderColor
292
292
  }
@@ -297,10 +297,10 @@ const colorStyles = _ref => {
297
297
  const groupStyles = _ref2 => {
298
298
  let {
299
299
  theme,
300
- isPrimary,
301
- isBasic,
302
- isPill,
303
- focusInset
300
+ $isPrimary,
301
+ $isBasic,
302
+ $isPill,
303
+ $focusInset
304
304
  } = _ref2;
305
305
  const {
306
306
  rtl,
@@ -310,20 +310,20 @@ const groupStyles = _ref2 => {
310
310
  const startPosition = rtl ? 'right' : 'left';
311
311
  const endPosition = rtl ? 'left' : 'right';
312
312
  const marginOffset = borderWidths.sm;
313
- const marginDisplacement = `${isPrimary || isBasic ? '' : '-'}${marginOffset}`;
314
- const iconMarginDisplacement = isPill && '-2px';
315
- const disabledBackgroundColor = !isPrimary && reactTheming.getColor({
313
+ const marginDisplacement = `${$isPrimary || $isBasic ? '' : '-'}${marginOffset}`;
314
+ const iconMarginDisplacement = $isPill && '-2px';
315
+ const disabledBackgroundColor = !$isPrimary && reactTheming.getColor({
316
316
  theme,
317
317
  variable: 'background.disabled'
318
318
  });
319
- const borderColor = isBasic ? 'transparent' : 'revert';
319
+ const borderColor = $isBasic ? 'transparent' : 'revert';
320
320
  const focusColor = reactTheming.getColor({
321
321
  theme,
322
322
  variable: 'border.primaryEmphasis'
323
323
  });
324
- const focusBoxShadow = isBasic && !isPrimary && reactTheming.getFocusBoxShadow({
324
+ const focusBoxShadow = $isBasic && !$isPrimary && reactTheming.getFocusBoxShadow({
325
325
  theme,
326
- inset: focusInset,
326
+ inset: $focusInset,
327
327
  spacerColor: {
328
328
  hue: focusColor
329
329
  },
@@ -334,24 +334,24 @@ const groupStyles = _ref2 => {
334
334
  return styled.css(["position:relative;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,margin-", " 0.1s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;border:", " ", ";", "{border-color:", ";box-shadow:", ";}&:hover,&:active,", "{z-index:1;}&:disabled{z-index:-1;background-color:", ";}&:not(:first-of-type){margin-", ":", ";}&:not(:first-of-type):disabled{margin-", ":", ";}&:not(:first-of-type):not(:last-of-type){border-radius:0;}&:first-of-type:not(:last-of-type){border-top-", "-radius:0;border-bottom-", "-radius:0;}&:last-of-type:not(:first-of-type){border-top-", "-radius:0;border-bottom-", "-radius:0;}&:first-of-type:not(:last-of-type) ", "{margin-", ":", ";}&:last-of-type:not(:first-of-type) ", "{margin-", ":", ";}"], startPosition, borders.sm, borderColor, reactTheming.SELECTOR_FOCUS_VISIBLE, focusColor, focusBoxShadow, reactTheming.SELECTOR_FOCUS_VISIBLE, disabledBackgroundColor, startPosition, marginDisplacement, startPosition, marginOffset, endPosition, endPosition, startPosition, startPosition, StyledIcon, endPosition, iconMarginDisplacement, StyledIcon, startPosition, iconMarginDisplacement);
335
335
  };
336
336
  const iconStyles$1 = props => {
337
- const size = props.size === 'small' ? props.theme.iconSizes.sm : props.theme.iconSizes.md;
338
- return styled.css(["width:", ";min-width:", ";height:", ";vertical-align:", ";"], size, size, size, props.isLink && 'middle');
337
+ const $size = props.$size === 'small' ? props.theme.iconSizes.sm : props.theme.iconSizes.md;
338
+ return styled.css(["width:", ";min-width:", ";height:", ";vertical-align:", ";"], $size, $size, $size, props.$isLink && 'middle');
339
339
  };
340
340
  const sizeStyles = props => {
341
341
  let retVal;
342
- if (props.isLink) {
342
+ if (props.$isLink) {
343
343
  retVal = styled.css(["padding:0;font-size:inherit;"]);
344
344
  } else {
345
345
  const height = getHeight(props);
346
346
  const lineHeight = polished.math(`${height} - (${props.theme.borderWidths.sm} * 2)`);
347
347
  let padding;
348
348
  let fontSize;
349
- if (props.size === 'small') {
349
+ if (props.$size === 'small') {
350
350
  fontSize = props.theme.fontSizes.sm;
351
351
  padding = `${props.theme.space.base * 3}px`;
352
352
  } else {
353
353
  fontSize = props.theme.fontSizes.md;
354
- if (props.size === 'large') {
354
+ if (props.$size === 'large') {
355
355
  padding = `${props.theme.space.base * 5}px`;
356
356
  } else {
357
357
  padding = `${props.theme.space.base * 4}px`;
@@ -363,20 +363,20 @@ const sizeStyles = props => {
363
363
  };
364
364
  const StyledButton = styled__default.default.button.attrs(props => ({
365
365
  'data-garden-id': props['data-garden-id'] || COMPONENT_ID$3,
366
- 'data-garden-version': '9.0.0',
366
+ 'data-garden-version': '9.1.1',
367
367
  type: props.type || 'button'
368
368
  })).withConfig({
369
369
  displayName: "StyledButton",
370
370
  componentId: "sc-qe3ace-0"
371
- })(["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), reactTheming.SELECTOR_FOCUS_VISIBLE, props => props.isLink ? 'underline' : 'none', props => props.isLink ? 'underline' : 'none', props => colorStyles(props), props => props.isLink && 'none', StyledIcon, props => iconStyles$1(props), StyledSplitButton, props => groupStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
371
+ })(["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), reactTheming.SELECTOR_FOCUS_VISIBLE, props => props.$isLink ? 'underline' : 'none', props => props.$isLink ? 'underline' : 'none', props => colorStyles(props), props => props.$isLink && 'none', StyledIcon, props => iconStyles$1(props), StyledSplitButton, props => groupStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
372
372
 
373
373
  const COMPONENT_ID$2 = 'buttons.anchor';
374
374
  const StyledAnchor = styled__default.default(StyledButton).attrs(props => ({
375
375
  'data-garden-id': COMPONENT_ID$2,
376
- 'data-garden-version': '9.0.0',
376
+ 'data-garden-version': '9.1.1',
377
377
  as: 'a',
378
378
  dir: props.theme.rtl ? 'rtl' : undefined,
379
- isLink: true,
379
+ $isLink: true,
380
380
  type: undefined
381
381
  })).withConfig({
382
382
  displayName: "StyledAnchor",
@@ -404,7 +404,7 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
404
404
  const COMPONENT_ID$1 = 'buttons.external_icon';
405
405
  const StyledExternalIcon = styled__default.default(SvgNewWindowStroke).attrs({
406
406
  'data-garden-id': COMPONENT_ID$1,
407
- 'data-garden-version': '9.0.0'
407
+ 'data-garden-version': '9.1.1'
408
408
  }).withConfig({
409
409
  displayName: "StyledExternalIcon",
410
410
  componentId: "sc-16oz07e-0"
@@ -442,7 +442,7 @@ const iconColorStyles = _ref => {
442
442
  };
443
443
  const iconButtonStyles = props => {
444
444
  const width = getHeight(props);
445
- return styled.css(["border:", ";padding:0;width:", ";min-width:", ";", ";&:disabled{background-color:", ";}"], props.isBasic && 'none', width, width, props.isBasic && !(props.isPrimary || props.isDanger || props.disabled) && iconColorStyles(props), !props.isPrimary && 'transparent');
445
+ return styled.css(["border:", ";padding:0;width:", ";min-width:", ";", ";&:disabled{background-color:", ";}"], props.$isBasic && 'none', width, width, props.$isBasic && !(props.$isPrimary || props.$isDanger || props.disabled) && iconColorStyles(props), !props.$isPrimary && 'transparent');
446
446
  };
447
447
  const iconStyles = props => {
448
448
  const size = props.theme.iconSizes.md;
@@ -452,12 +452,12 @@ const StyledIconButton = styled__default.default(StyledButton).attrs(props => {
452
452
  const externalId = props['data-garden-id'];
453
453
  return {
454
454
  'data-garden-id': externalId && externalId !== COMPONENT_ID$3 ? externalId : COMPONENT_ID,
455
- 'data-garden-version': '9.0.0'
455
+ 'data-garden-version': '9.1.1'
456
456
  };
457
457
  }).withConfig({
458
458
  displayName: "StyledIconButton",
459
459
  componentId: "sc-1t0ughp-0"
460
- })(["", ";& ", "{", "}", ";"], props => iconButtonStyles(props), StyledIcon, props => iconStyles(props), props => reactTheming.retrieveComponentStyles(props['data-garden-id'], props));
460
+ })(["", ";& ", "{", "}", ";"], iconButtonStyles, StyledIcon, iconStyles, props => reactTheming.retrieveComponentStyles(props['data-garden-id'], props));
461
461
 
462
462
  const SplitButtonContext = React.createContext(undefined);
463
463
  const useSplitButtonContext = () => {
@@ -490,26 +490,43 @@ const EndIconComponent = _ref => {
490
490
  EndIconComponent.displayName = 'Button.EndIcon';
491
491
  const EndIcon = EndIconComponent;
492
492
 
493
- const ButtonComponent = React.forwardRef((props, ref) => {
494
- const splitButtonContext = useSplitButtonContext();
495
- const computedProps = {
496
- ...props,
497
- focusInset: props.focusInset || splitButtonContext,
498
- $isUnderlined: props.isLink
499
- };
500
- return React__namespace.default.createElement(StyledButton, Object.assign({}, computedProps, {
493
+ const ButtonComponent = React.forwardRef((_ref, ref) => {
494
+ let {
495
+ focusInset,
496
+ isBasic,
497
+ isDanger,
498
+ isLink,
499
+ isNeutral,
500
+ isPill,
501
+ isPrimary,
502
+ isStretched,
503
+ size,
504
+ ...other
505
+ } = _ref;
506
+ const splitButtonFocusInset = useSplitButtonContext();
507
+ return React__namespace.default.createElement(StyledButton, Object.assign({}, other, {
508
+ $focusInset: focusInset || splitButtonFocusInset,
509
+ $isBasic: isBasic,
510
+ $isDanger: isDanger,
511
+ $isLink: isLink,
512
+ $isNeutral: isNeutral,
513
+ $isPill: isPill,
514
+ $isPrimary: isPrimary,
515
+ $isStretched: isStretched,
516
+ $isUnderlined: isLink,
517
+ $size: size,
501
518
  ref: ref
502
519
  }));
503
520
  });
504
521
  ButtonComponent.displayName = 'Button';
505
522
  ButtonComponent.propTypes = {
506
- isNeutral: PropTypes__default.default.bool,
507
- isPrimary: PropTypes__default.default.bool,
508
- isDanger: PropTypes__default.default.bool,
509
- isPill: PropTypes__default.default.bool,
510
- isBasic: PropTypes__default.default.bool,
511
523
  focusInset: PropTypes__default.default.bool,
524
+ isBasic: PropTypes__default.default.bool,
525
+ isDanger: PropTypes__default.default.bool,
512
526
  isLink: PropTypes__default.default.bool,
527
+ isNeutral: PropTypes__default.default.bool,
528
+ isPill: PropTypes__default.default.bool,
529
+ isPrimary: PropTypes__default.default.bool,
513
530
  isStretched: PropTypes__default.default.bool,
514
531
  size: PropTypes__default.default.oneOf(SIZE)
515
532
  };
@@ -523,12 +540,13 @@ Button.StartIcon = StartIcon;
523
540
  const Anchor = React.forwardRef((_ref, ref) => {
524
541
  let {
525
542
  children,
526
- isExternal,
527
543
  externalIconLabel,
544
+ isDanger,
545
+ isExternal,
528
546
  isUnderlined = true,
529
- ...otherProps
547
+ ...other
530
548
  } = _ref;
531
- let anchorProps = otherProps;
549
+ let anchorProps = other;
532
550
  if (isExternal) {
533
551
  anchorProps = {
534
552
  target: '_blank',
@@ -544,6 +562,7 @@ const Anchor = React.forwardRef((_ref, ref) => {
544
562
  const iconAriaLabel = reactTheming.useText(Anchor, checkProps, isExternal ? 'externalIconLabel' : 'noIconLabel', '(opens in a new tab)');
545
563
  return React__namespace.default.createElement(StyledAnchor, Object.assign({
546
564
  ref: ref,
565
+ $isDanger: isDanger,
547
566
  $isUnderlined: isUnderlined
548
567
  }, anchorProps), children, !!isExternal &&
549
568
  React__namespace.default.createElement(StyledExternalIcon, {
@@ -563,28 +582,40 @@ Anchor.propTypes = {
563
582
  const IconButton = React.forwardRef((_ref, ref) => {
564
583
  let {
565
584
  children,
585
+ focusInset,
586
+ isBasic,
587
+ isDanger,
588
+ isNeutral,
589
+ isPill,
590
+ isPrimary,
566
591
  isRotated,
567
- ...otherProps
592
+ size,
593
+ ...other
568
594
  } = _ref;
569
- const focusInset = useSplitButtonContext();
570
- return React__namespace.default.createElement(StyledIconButton, Object.assign({
595
+ const splitButtonFocusInset = useSplitButtonContext();
596
+ return React__namespace.default.createElement(StyledIconButton, Object.assign({}, other, {
597
+ $isBasic: isBasic,
598
+ $isDanger: isDanger,
599
+ $isNeutral: isNeutral,
600
+ $isPill: isPill,
601
+ $isPrimary: isPrimary,
602
+ $size: size,
603
+ $focusInset: focusInset || splitButtonFocusInset,
571
604
  ref: ref
572
- }, otherProps, {
573
- focusInset: otherProps.focusInset || focusInset
574
605
  }), React__namespace.default.createElement(StyledIcon, {
575
606
  $isRotated: isRotated
576
607
  }, children));
577
608
  });
578
609
  IconButton.displayName = 'IconButton';
579
610
  IconButton.propTypes = {
611
+ focusInset: PropTypes__default.default.bool,
612
+ isBasic: PropTypes__default.default.bool,
580
613
  isDanger: PropTypes__default.default.bool,
581
- size: PropTypes__default.default.oneOf(SIZE),
582
614
  isNeutral: PropTypes__default.default.bool,
583
- isPrimary: PropTypes__default.default.bool,
584
- isBasic: PropTypes__default.default.bool,
585
615
  isPill: PropTypes__default.default.bool,
586
- focusInset: PropTypes__default.default.bool,
587
- isRotated: PropTypes__default.default.bool
616
+ isPrimary: PropTypes__default.default.bool,
617
+ isRotated: PropTypes__default.default.bool,
618
+ size: PropTypes__default.default.oneOf(SIZE)
588
619
  };
589
620
  IconButton.defaultProps = {
590
621
  isPill: true,
@@ -608,14 +639,9 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
608
639
  })));
609
640
  };
610
641
 
611
- const ChevronButton = React.forwardRef((_ref, ref) => {
612
- let {
613
- ...buttonProps
614
- } = _ref;
615
- return React__namespace.default.createElement(IconButton, Object.assign({
616
- ref: ref
617
- }, buttonProps), React__namespace.default.createElement(SvgChevronDownStroke, null));
618
- });
642
+ const ChevronButton = React.forwardRef((props, ref) => React__namespace.default.createElement(IconButton, Object.assign({
643
+ ref: ref
644
+ }, props), React__namespace.default.createElement(SvgChevronDownStroke, null)));
619
645
  ChevronButton.displayName = 'ChevronButton';
620
646
  ChevronButton.propTypes = IconButton.propTypes;
621
647
  ChevronButton.defaultProps = {
@@ -4,11 +4,21 @@
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 { ButtonHTMLAttributes } from 'react';
7
8
  import { DefaultTheme, ThemeProps } from 'styled-components';
8
9
  import { IButtonProps } from '../types';
9
10
  export declare const COMPONENT_ID = "buttons.button";
10
- export interface IStyledButtonProps extends IButtonProps {
11
+ export interface IStyledButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
11
12
  $isUnderlined?: boolean;
13
+ $isDanger?: boolean;
14
+ $size?: IButtonProps['size'];
15
+ $isStretched?: boolean;
16
+ $isNeutral?: boolean;
17
+ $isPrimary?: boolean;
18
+ $isBasic?: boolean;
19
+ $isLink?: boolean;
20
+ $isPill?: boolean;
21
+ $focusInset?: boolean;
12
22
  }
13
23
  export declare const getHeight: (props: IStyledButtonProps & ThemeProps<DefaultTheme>) => string;
14
24
  export declare const StyledButton: import("styled-components").StyledComponent<"button", DefaultTheme, IStyledButtonProps, never>;
@@ -9,7 +9,7 @@ interface IStyledIconProps {
9
9
  $isRotated: boolean;
10
10
  $position?: 'start' | 'end';
11
11
  }
12
- export declare const StyledIcon: import("styled-components").StyledComponent<({ children, theme, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>, DefaultTheme, {
12
+ export declare const StyledIcon: import("styled-components").StyledComponent<({ children, theme, ...props }: any) => React.DetailedReactHTMLElement<any, HTMLElement>, DefaultTheme, {
13
13
  'data-garden-id': string;
14
14
  'data-garden-version': string;
15
15
  } & IStyledIconProps, "data-garden-id" | "data-garden-version">;
@@ -5,5 +5,9 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
+ import { IStyledButtonProps } from './StyledButton';
8
9
  export declare const COMPONENT_ID = "buttons.icon_button";
9
- export declare const StyledIconButton: import("styled-components").StyledComponent<"button", DefaultTheme, import("./StyledButton").IStyledButtonProps, never>;
10
+ export declare const StyledIconButton: import("styled-components").StyledComponent<"button", DefaultTheme, IStyledButtonProps & {
11
+ 'data-garden-id': string;
12
+ 'data-garden-version': string;
13
+ }, "data-garden-id" | "data-garden-version">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-buttons",
3
- "version": "9.0.0",
3
+ "version": "9.1.1",
4
4
  "description": "Components relating to buttons in the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -27,14 +27,14 @@
27
27
  "react-merge-refs": "^2.0.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "@zendeskgarden/react-theming": ">=9.0.0-next",
30
+ "@zendeskgarden/react-theming": ">=9.0.0",
31
31
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
32
32
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
33
33
  "styled-components": "^5.3.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@zendeskgarden/react-theming": "^9.0.0",
37
- "@zendeskgarden/svg-icons": "7.2.0"
36
+ "@zendeskgarden/react-theming": "^9.1.1",
37
+ "@zendeskgarden/svg-icons": "7.3.0"
38
38
  },
39
39
  "keywords": [
40
40
  "components",
@@ -45,5 +45,6 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "zendeskgarden:src": "src/index.ts"
48
+ "zendeskgarden:src": "src/index.ts",
49
+ "gitHead": "21eaf7b57f27f1a846ed332f1b8e655d6bc0a13b"
49
50
  }