@zendeskgarden/react-buttons 9.0.0-next.1 → 9.0.0-next.11

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 (35) hide show
  1. package/README.md +0 -27
  2. package/dist/esm/elements/Anchor.js +54 -0
  3. package/dist/esm/elements/Button.js +49 -0
  4. package/dist/esm/elements/ChevronButton.js +27 -0
  5. package/dist/esm/elements/IconButton.js +50 -0
  6. package/dist/esm/elements/SplitButton.js +29 -0
  7. package/dist/esm/elements/ToggleButton.js +30 -0
  8. package/dist/esm/elements/ToggleIconButton.js +32 -0
  9. package/dist/esm/elements/components/EndIcon.js +28 -0
  10. package/dist/esm/elements/components/StartIcon.js +28 -0
  11. package/dist/esm/index.js +13 -0
  12. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/new-window-stroke.svg.js +27 -0
  13. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +25 -0
  14. package/dist/esm/styled/StyledAnchor.js +27 -0
  15. package/dist/esm/styled/StyledButton.js +316 -0
  16. package/dist/esm/styled/StyledExternalIcon.js +23 -0
  17. package/dist/esm/styled/StyledIcon.js +31 -0
  18. package/dist/esm/styled/StyledIconButton.js +61 -0
  19. package/dist/esm/styled/StyledSplitButton.js +22 -0
  20. package/dist/esm/types/index.js +9 -0
  21. package/dist/esm/utils/useSplitButtonContext.js +14 -0
  22. package/dist/index.cjs.js +296 -195
  23. package/dist/typings/elements/Button.d.ts +1 -7
  24. package/dist/typings/elements/components/EndIcon.d.ts +1 -1
  25. package/dist/typings/elements/components/StartIcon.d.ts +1 -1
  26. package/dist/typings/index.d.ts +2 -3
  27. package/dist/typings/styled/StyledAnchor.d.ts +1 -1
  28. package/dist/typings/styled/StyledIcon.d.ts +4 -4
  29. package/dist/typings/styled/{StyledButtonGroup.d.ts → StyledSplitButton.d.ts} +1 -1
  30. package/dist/typings/styled/index.d.ts +1 -1
  31. package/dist/typings/types/index.d.ts +1 -13
  32. package/package.json +6 -7
  33. package/dist/index.esm.js +0 -559
  34. package/dist/typings/elements/ButtonGroup.d.ts +0 -14
  35. package/dist/typings/utils/useButtonGroupContext.d.ts +0 -14
@@ -0,0 +1,316 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled, { css } from 'styled-components';
8
+ import { math, em } from 'polished';
9
+ import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, DEFAULT_THEME, getColor, focusStyles, getFocusBoxShadow } from '@zendeskgarden/react-theming';
10
+ import { StyledSplitButton } from './StyledSplitButton.js';
11
+ import { StyledIcon } from './StyledIcon.js';
12
+
13
+ const COMPONENT_ID = 'buttons.button';
14
+ const getBorderRadius = props => {
15
+ if (props.isPill) {
16
+ return '100px';
17
+ }
18
+ return props.theme.borderRadii.md;
19
+ };
20
+ const getHeight = props => {
21
+ if (props.size === 'small') {
22
+ return `${props.theme.space.base * 8}px`;
23
+ } else if (props.size === 'large') {
24
+ return `${props.theme.space.base * 12}px`;
25
+ }
26
+ return `${props.theme.space.base * 10}px`;
27
+ };
28
+ const colorStyles = _ref => {
29
+ let {
30
+ theme,
31
+ isLink,
32
+ isBasic,
33
+ isDanger,
34
+ isNeutral,
35
+ isPrimary,
36
+ focusInset
37
+ } = _ref;
38
+ let retVal;
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,
83
+ condition: false,
84
+ styles: {
85
+ color: foregroundColor ,
86
+ outlineColor: focusOutlineColor
87
+ }
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
+ })
125
+ } : undefined
126
+ }), activeBackgroundColor, disabledBackgroundColor, disabledForegroundColor);
127
+ } else {
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
+ focusBorderColor = getColor(borderOptions);
168
+ } else {
169
+ borderColor = getColor(borderOptions);
170
+ }
171
+ hoverBorderColor = getColor({
172
+ ...borderOptions,
173
+ ...offset100
174
+ });
175
+ activeBorderColor = getColor({
176
+ ...borderOptions,
177
+ ...offset200
178
+ });
179
+ }
180
+ backgroundVariable = 'background.primaryEmphasis';
181
+ foregroundVariable = isNeutral ? 'foreground.default' : 'foreground.primary';
182
+ }
183
+ const hoverBackgroundColor = getColor({
184
+ theme,
185
+ variable: backgroundVariable,
186
+ transparency: theme.opacity[100]
187
+ });
188
+ const activeBackgroundColor = getColor({
189
+ theme,
190
+ variable: backgroundVariable,
191
+ transparency: theme.opacity[200]
192
+ });
193
+ const foregroundOptions = {
194
+ theme,
195
+ variable: foregroundVariable
196
+ };
197
+ const foregroundColor = getColor(foregroundOptions);
198
+ let hoverForegroundColor;
199
+ let activeForegroundColor;
200
+ let iconForegroundColor;
201
+ let hoverIconForegroundColor;
202
+ let activeIconForegroundColor;
203
+ if (isNeutral) {
204
+ const iconOptions = {
205
+ theme,
206
+ variable: 'foreground.subtle'
207
+ };
208
+ iconForegroundColor = getColor(iconOptions);
209
+ hoverIconForegroundColor = getColor({
210
+ ...iconOptions,
211
+ ...offset100
212
+ });
213
+ activeIconForegroundColor = getColor({
214
+ ...iconOptions,
215
+ ...offset200
216
+ });
217
+ } else {
218
+ hoverForegroundColor = getColor({
219
+ ...foregroundOptions,
220
+ ...offset100
221
+ });
222
+ activeForegroundColor = getColor({
223
+ ...foregroundOptions,
224
+ ...offset200
225
+ });
226
+ }
227
+ 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({
228
+ theme,
229
+ inset: focusInset,
230
+ styles: {
231
+ borderColor: focusBorderColor
232
+ }
233
+ }), activeBorderColor, activeBackgroundColor, activeForegroundColor, disabledBackgroundColor, disabledForegroundColor, StyledIcon, iconForegroundColor, StyledIcon, StyledIcon, hoverIconForegroundColor, StyledIcon, activeIconForegroundColor, StyledIcon, disabledForegroundColor);
234
+ }
235
+ return retVal;
236
+ };
237
+ const groupStyles = _ref2 => {
238
+ let {
239
+ theme,
240
+ isPrimary,
241
+ isBasic,
242
+ isPill,
243
+ focusInset
244
+ } = _ref2;
245
+ const {
246
+ rtl,
247
+ borderWidths,
248
+ borders
249
+ } = theme;
250
+ const startPosition = rtl ? 'right' : 'left';
251
+ const endPosition = rtl ? 'left' : 'right';
252
+ const marginOffset = borderWidths.sm;
253
+ const marginDisplacement = `${isPrimary || isBasic ? '' : '-'}${marginOffset}`;
254
+ const iconMarginDisplacement = isPill && '-2px';
255
+ const disabledBackgroundColor = !isPrimary && getColor({
256
+ theme,
257
+ variable: 'background.disabled'
258
+ });
259
+ const borderColor = isBasic ? 'transparent' : 'revert';
260
+ const focusColor = getColor({
261
+ theme,
262
+ variable: 'border.primaryEmphasis'
263
+ });
264
+ const focusBoxShadow = isBasic && !isPrimary && getFocusBoxShadow({
265
+ theme,
266
+ inset: focusInset,
267
+ spacerColor: {
268
+ hue: focusColor
269
+ },
270
+ color: {
271
+ hue: 'transparent'
272
+ }
273
+ });
274
+ 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);
275
+ };
276
+ const iconStyles = props => {
277
+ const size = props.size === 'small' ? props.theme.iconSizes.sm : props.theme.iconSizes.md;
278
+ return css(["width:", ";min-width:", ";height:", ";vertical-align:", ";"], size, size, size, props.isLink && 'middle');
279
+ };
280
+ const sizeStyles = props => {
281
+ let retVal;
282
+ if (props.isLink) {
283
+ retVal = css(["padding:0;font-size:inherit;"]);
284
+ } else {
285
+ const height = getHeight(props);
286
+ const lineHeight = math(`${height} - (${props.theme.borderWidths.sm} * 2)`);
287
+ let padding;
288
+ let fontSize;
289
+ if (props.size === 'small') {
290
+ fontSize = props.theme.fontSizes.sm;
291
+ padding = `${props.theme.space.base * 3}px`;
292
+ } else {
293
+ fontSize = props.theme.fontSizes.md;
294
+ if (props.size === 'large') {
295
+ padding = `${props.theme.space.base * 5}px`;
296
+ } else {
297
+ padding = `${props.theme.space.base * 4}px`;
298
+ }
299
+ }
300
+ retVal = css(["padding:0 ", ";height:", ";line-height:", ";font-size:", ";"], em(math(`${padding} - ${props.theme.borderWidths.sm}`), fontSize), height, lineHeight, fontSize);
301
+ }
302
+ return retVal;
303
+ };
304
+ const StyledButton = styled.button.attrs(props => ({
305
+ 'data-garden-id': COMPONENT_ID,
306
+ 'data-garden-version': '9.0.0-next.11',
307
+ type: props.type || 'button'
308
+ })).withConfig({
309
+ displayName: "StyledButton",
310
+ componentId: "sc-qe3ace-0"
311
+ })(["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));
312
+ StyledButton.defaultProps = {
313
+ theme: DEFAULT_THEME
314
+ };
315
+
316
+ export { StyledButton, getHeight };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import SvgNewWindowStroke from '../node_modules/@zendeskgarden/svg-icons/src/12/new-window-stroke.svg.js';
9
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
10
+
11
+ const COMPONENT_ID = 'buttons.external_icon';
12
+ const StyledExternalIcon = styled(SvgNewWindowStroke).attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.0.0-next.11'
15
+ }).withConfig({
16
+ displayName: "StyledExternalIcon",
17
+ componentId: "sc-16oz07e-0"
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
+
23
+ export { StyledExternalIcon };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled, { css } from 'styled-components';
8
+ import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'buttons.icon';
11
+ const sizeStyles = props => {
12
+ let marginProperty;
13
+ if (props.$position === 'start') {
14
+ marginProperty = `margin-${props.theme.rtl ? 'left' : 'right'}`;
15
+ } else if (props.$position === 'end') {
16
+ marginProperty = `margin-${props.theme.rtl ? 'right' : 'left'}`;
17
+ }
18
+ return marginProperty && css(["", ":", "px;"], marginProperty, props.theme.space.base * 2);
19
+ };
20
+ const StyledIcon = styled(StyledBaseIcon).attrs({
21
+ 'data-garden-id': COMPONENT_ID,
22
+ 'data-garden-version': '9.0.0-next.11'
23
+ }).withConfig({
24
+ displayName: "StyledIcon",
25
+ componentId: "sc-19meqgg-0"
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
+
31
+ export { StyledIcon };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9
+ import { StyledButton, getHeight } from './StyledButton.js';
10
+ import { StyledIcon } from './StyledIcon.js';
11
+
12
+ const COMPONENT_ID = 'buttons.icon_button';
13
+ const iconColorStyles = _ref => {
14
+ let {
15
+ theme
16
+ } = _ref;
17
+ const options = {
18
+ theme,
19
+ variable: 'foreground.default'
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
+ });
40
+ return css(["color:", ";&:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}"], baseColor, hoverColor, activeColor);
41
+ };
42
+ const iconButtonStyles = props => {
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');
45
+ };
46
+ const iconStyles = props => {
47
+ const size = props.theme.iconSizes.md;
48
+ return css(["width:", ";height:", ";& > svg{transition:opacity 0.15s ease-in-out;}"], size, size);
49
+ };
50
+ const StyledIconButton = styled(StyledButton).attrs({
51
+ 'data-garden-id': COMPONENT_ID,
52
+ 'data-garden-version': '9.0.0-next.11'
53
+ }).withConfig({
54
+ displayName: "StyledIconButton",
55
+ componentId: "sc-1t0ughp-0"
56
+ })(["", ";& ", "{", "}", ";"], props => iconButtonStyles(props), StyledIcon, props => iconStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
57
+ StyledIconButton.defaultProps = {
58
+ theme: DEFAULT_THEME
59
+ };
60
+
61
+ export { StyledIconButton };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'buttons.button_group_view';
11
+ const StyledSplitButton = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.11'
14
+ }).withConfig({
15
+ displayName: "StyledSplitButton",
16
+ componentId: "sc-1u4v04v-0"
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
+
22
+ export { StyledSplitButton };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ const SIZE = ['small', 'medium', 'large'];
8
+
9
+ export { SIZE };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { createContext, useContext } from 'react';
8
+
9
+ const SplitButtonContext = createContext(undefined);
10
+ const useSplitButtonContext = () => {
11
+ return useContext(SplitButtonContext);
12
+ };
13
+
14
+ export { SplitButtonContext, useSplitButtonContext };