@mirohq/design-system-button 3.2.0-icon-types.0 → 4.0.0-button-api-changes.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.
package/dist/main.js CHANGED
@@ -2,35 +2,65 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var React = require('react');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
6
  var designSystemSpinner = require('@mirohq/design-system-spinner');
7
+ var designSystemUtils = require('@mirohq/design-system-utils');
8
+ var React = require('react');
9
+ var designSystemBaseButton = require('@mirohq/design-system-base-button');
10
+ var designSystemBaseIcon = require('@mirohq/design-system-base-icon');
7
11
  var designSystemPrimitive = require('@mirohq/design-system-primitive');
8
12
  var designSystemStitches = require('@mirohq/design-system-stitches');
9
- var designSystemBaseButton = require('@mirohq/design-system-base-button');
10
- var designSystemIcons = require('@mirohq/design-system-icons');
13
+ var designSystemStyles = require('@mirohq/design-system-styles');
11
14
 
12
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
16
 
14
17
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
18
 
19
+ const ButtonContext = React.createContext({});
20
+ const ButtonProvider = ({
21
+ children,
22
+ ...restProps
23
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
24
+ ButtonContext.Provider,
25
+ {
26
+ value: {
27
+ ...restProps
28
+ },
29
+ children
30
+ }
31
+ );
32
+ const useButtonContext = () => React.useContext(ButtonContext);
33
+
16
34
  const StyledIconSlot = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {});
17
- const isIcon = (child) => child.type.__Type === designSystemIcons.IconTypeSymbol;
35
+ const buttonIconSizes = {
36
+ small: "small",
37
+ medium: "small",
38
+ large: "medium",
39
+ "x-large": "medium"
40
+ };
41
+ const buttonIconWeights = {
42
+ small: "thin",
43
+ medium: "thin",
44
+ large: "normal",
45
+ "x-large": "normal"
46
+ };
18
47
  const IconSlot = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => {
19
- const child = React__default["default"].Children.only(children);
20
- const isDsIcon = isIcon(child);
21
- const iconElement = isDsIcon ? React__default["default"].cloneElement(child, { size: "small" }) : child;
22
- return /* @__PURE__ */ React__default["default"].createElement(StyledIconSlot, {
23
- ...restProps,
24
- ref: forwardRef,
25
- "aria-hidden": true,
26
- asChild: true,
27
- "data-icon": isDsIcon ? "" : void 0
28
- }, iconElement);
48
+ const { size } = useButtonContext();
49
+ const formattedChildren = designSystemUtils.addPropsToChildren(
50
+ children,
51
+ (child) => designSystemBaseIcon.isIconComponent(child),
52
+ {
53
+ "data-icon-component": "",
54
+ size: buttonIconSizes[size],
55
+ weight: buttonIconWeights[size]
56
+ }
57
+ );
58
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledIconSlot, { ...restProps, ref: forwardRef, "aria-hidden": true, asChild: true, children: formattedChildren });
29
59
  });
30
60
 
31
- const activeSelector = "&:active, &[data-pressed]";
32
61
  const disabledSelector = '&[disabled], &[aria-disabled="true"]';
33
- const iconSlotSelector = `& ${StyledIconSlot}`;
62
+ const iconSlotSelector = "& ".concat(StyledIconSlot);
63
+ const externalIconSelector = "& svg:not([data-icon-component]), & img:not([data-icon-component])";
34
64
  const solidDisabled = {
35
65
  [disabledSelector]: {
36
66
  backgroundColor: "$background-neutrals-disabled",
@@ -61,51 +91,65 @@ const ghostDisabled = {
61
91
  };
62
92
  const LABEL_OFFSET = 2;
63
93
  const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButton, {
64
- userSelect: "none",
65
94
  whiteSpace: "nowrap",
66
95
  textOverflow: "ellipsis",
67
96
  textAlign: "center",
68
97
  position: "relative",
69
98
  width: "fit-content",
70
99
  maxWidth: "100%",
71
- lineHeight: 1.5,
100
+ lineHeight: 1,
72
101
  border: "1px solid transparent",
73
- "&[data-focused]": {
102
+ // to make outline and solid/ghost variants the same width
103
+ ...designSystemStyles.focus.css({
74
104
  boxShadow: "$focus-small-outline",
75
- borderColor: "$blue-500 !important"
76
- },
77
- [`& ${StyledIconSlot}:first-child`]: {
105
+ borderColor: "$blue-400 !important"
106
+ }),
107
+ ["& ".concat(StyledIconSlot, ":first-child")]: {
78
108
  marginLeft: -LABEL_OFFSET,
79
- marginRight: `calc($50 + ${LABEL_OFFSET}px)`
109
+ marginRight: "calc($50 + ".concat(LABEL_OFFSET, "px)")
80
110
  },
81
- [`& ${StyledIconSlot}:last-child`]: {
111
+ ["& ".concat(StyledIconSlot, ":last-child")]: {
82
112
  marginRight: -LABEL_OFFSET,
83
- marginLeft: `calc($50 + ${LABEL_OFFSET}px)`
113
+ marginLeft: "calc($50 + ".concat(LABEL_OFFSET, "px)")
84
114
  },
85
115
  variants: {
86
116
  variant: {
87
- "solid-prominent": {
117
+ primary: {
88
118
  backgroundColor: "$background-primary-prominent",
89
119
  color: "$text-primary-inverted",
90
120
  [iconSlotSelector]: {
91
121
  color: "$icon-primary-inverted"
92
122
  },
93
- "&:hover": {
123
+ "&[data-hovered]": {
94
124
  backgroundColor: "$background-primary-prominent-hover"
95
125
  },
96
- [activeSelector]: {
126
+ "&[data-pressed]": {
97
127
  backgroundColor: "$background-primary-prominent-active"
98
128
  },
99
129
  ...solidDisabled
100
130
  },
101
- "outline-prominent": {
131
+ secondary: {
132
+ backgroundColor: "$background-neutrals-subtle",
133
+ color: "$text-neutrals",
134
+ [iconSlotSelector]: {
135
+ color: "$icon-neutrals"
136
+ },
137
+ "&[data-hovered]": {
138
+ backgroundColor: "$background-neutrals-subtle-hover"
139
+ },
140
+ "&[data-pressed]": {
141
+ backgroundColor: "$background-neutrals-subtle-active"
142
+ },
143
+ ...solidDisabled
144
+ },
145
+ tertiary: {
102
146
  backgroundColor: "$background-neutrals",
103
147
  borderColor: "$border-primary",
104
148
  color: "$text-primary",
105
149
  [iconSlotSelector]: {
106
150
  color: "$icon-primary"
107
151
  },
108
- "&:hover": {
152
+ "&[data-hovered]": {
109
153
  backgroundColor: "$background-primary-subtle-hover",
110
154
  borderColor: "$border-primary-hover",
111
155
  color: "$text-primary-hover",
@@ -113,7 +157,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
113
157
  color: "$icon-primary-hover"
114
158
  }
115
159
  },
116
- [activeSelector]: {
160
+ "&[data-pressed]": {
117
161
  backgroundColor: "$background-primary-subtle-active",
118
162
  borderColor: "$border-primary-active",
119
163
  color: "$text-primary-active",
@@ -123,17 +167,17 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
123
167
  },
124
168
  ...outlineDisabled
125
169
  },
126
- "ghost-prominent": {
170
+ ghost: {
127
171
  backgroundColor: "transparent",
128
172
  color: "$text-primary",
129
- "&:hover": {
173
+ "&[data-hovered]": {
130
174
  backgroundColor: "$background-primary-subtle-hover",
131
175
  color: "$text-primary-hover",
132
176
  [iconSlotSelector]: {
133
177
  color: "$icon-primary-hover"
134
178
  }
135
179
  },
136
- [activeSelector]: {
180
+ "&[data-pressed]": {
137
181
  backgroundColor: "$background-primary-subtle-active",
138
182
  color: "$text-primary-active",
139
183
  [iconSlotSelector]: {
@@ -142,81 +186,49 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
142
186
  },
143
187
  ...ghostDisabled
144
188
  },
145
- "solid-subtle": {
146
- backgroundColor: "$background-neutrals-subtle",
147
- color: "$text-neutrals",
148
- [iconSlotSelector]: {
149
- color: "$icon-neutrals"
150
- },
151
- "&:hover": {
152
- backgroundColor: "$background-neutrals-subtle-hover"
153
- },
154
- [activeSelector]: {
155
- backgroundColor: "$background-neutrals-subtle-active"
156
- },
157
- ...solidDisabled
158
- },
159
- "outline-subtle": {
160
- backgroundColor: "$background-neutrals",
161
- border: "1px solid $border-neutrals",
162
- color: "$text-neutrals",
163
- [iconSlotSelector]: {
164
- color: "$icon-neutrals"
165
- },
166
- "&:hover": {
167
- backgroundColor: "$background-neutrals-subtle-hover",
168
- borderColor: "$border-neutrals-hover"
169
- },
170
- [activeSelector]: {
171
- backgroundColor: "$background-neutrals-subtle-active",
172
- borderColor: "$border-neutrals-active"
173
- },
174
- ...outlineDisabled
175
- },
176
189
  "ghost-subtle": {
177
190
  backgroundColor: "transparent",
178
191
  color: "$text-neutrals",
179
192
  [iconSlotSelector]: {
180
193
  color: "$icon-neutrals"
181
194
  },
182
- "&:hover": {
195
+ "&[data-hovered]": {
183
196
  backgroundColor: "$background-neutrals-subtle-hover"
184
197
  },
185
- [activeSelector]: {
198
+ "&[data-pressed]": {
186
199
  backgroundColor: "$background-neutrals-subtle-active"
187
200
  },
188
201
  ...ghostDisabled
189
202
  },
190
- "solid-danger": {
203
+ danger: {
191
204
  backgroundColor: "$background-danger-prominent",
192
205
  color: "$text-danger-inverted",
193
206
  [iconSlotSelector]: {
194
207
  color: "$icon-danger-inverted"
195
208
  },
196
- "&:hover": {
209
+ "&[data-hovered]": {
197
210
  backgroundColor: "$background-danger-prominent-hover"
198
211
  },
199
- [activeSelector]: {
212
+ "&[data-pressed]": {
200
213
  backgroundColor: "$background-danger-prominent-active"
201
214
  },
202
215
  ...solidDisabled
203
216
  },
204
- "outline-danger": {
205
- backgroundColor: "$background-neutrals",
217
+ "danger-secondary": {
206
218
  borderColor: "$border-danger",
207
219
  color: "$text-danger",
208
220
  [iconSlotSelector]: {
209
221
  color: "$icon-danger"
210
222
  },
211
- "&:hover": {
212
- backgroundColor: "$background-danger",
223
+ "&[data-hovered]": {
224
+ backgroundColor: "$background-danger-subtle",
213
225
  color: "$text-danger-hover",
214
226
  [iconSlotSelector]: {
215
227
  color: "$icon-danger-hover"
216
228
  }
217
229
  },
218
- [activeSelector]: {
219
- backgroundColor: "$background-danger-hover",
230
+ "&[data-pressed]": {
231
+ backgroundColor: "$background-danger-subtle-hover",
220
232
  color: "$text-danger-active",
221
233
  [iconSlotSelector]: {
222
234
  color: "$icon-danger-active"
@@ -230,15 +242,15 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
230
242
  [iconSlotSelector]: {
231
243
  color: "$icon-danger"
232
244
  },
233
- "&:hover": {
234
- backgroundColor: "$background-danger",
245
+ "&[data-hovered]": {
246
+ backgroundColor: "$background-danger-subtle",
235
247
  color: "$text-danger-hover",
236
248
  [iconSlotSelector]: {
237
249
  color: "$icon-danger-hover"
238
250
  }
239
251
  },
240
- [activeSelector]: {
241
- backgroundColor: "$background-danger-hover",
252
+ "&[data-pressed]": {
253
+ backgroundColor: "$background-danger-subtle-hover",
242
254
  color: "$text-danger-active",
243
255
  [iconSlotSelector]: {
244
256
  color: "$icon-danger-active"
@@ -251,45 +263,43 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
251
263
  "x-large": {
252
264
  height: designSystemBaseButton.sizes.xLarge,
253
265
  fontSize: "$200",
254
- paddingX: `calc($200 + ${LABEL_OFFSET}px)`,
255
- [iconSlotSelector]: {
256
- width: "$icon-300",
257
- height: "$icon-300"
266
+ paddingX: "calc($200 + ".concat(LABEL_OFFSET, "px)"),
267
+ [externalIconSelector]: {
268
+ ...designSystemBaseIcon.styles.size.medium,
269
+ ...designSystemBaseIcon.styles.weight.normal
258
270
  }
259
271
  },
260
272
  large: {
261
273
  height: designSystemBaseButton.sizes.large,
262
274
  fontSize: "$200",
263
- paddingX: `calc($150 + ${LABEL_OFFSET}px)`,
264
- [iconSlotSelector]: {
265
- width: "$icon-300",
266
- height: "$icon-300"
275
+ paddingX: "calc($150 + ".concat(LABEL_OFFSET, "px)"),
276
+ [externalIconSelector]: {
277
+ ...designSystemBaseIcon.styles.size.medium,
278
+ ...designSystemBaseIcon.styles.weight.normal
267
279
  }
268
280
  },
269
281
  medium: {
270
282
  height: designSystemBaseButton.sizes.medium,
271
283
  fontSize: "$175",
272
- paddingX: `calc($100 + ${LABEL_OFFSET}px)`,
273
- [iconSlotSelector]: {
274
- width: "$icon-200",
275
- height: "$icon-200",
276
- "--svg-stroke-width": "$stroke-width$thin"
284
+ paddingX: "calc($100 + ".concat(LABEL_OFFSET, "px)"),
285
+ [externalIconSelector]: {
286
+ ...designSystemBaseIcon.styles.size.small,
287
+ ...designSystemBaseIcon.styles.weight.thin
277
288
  }
278
289
  },
279
290
  small: {
280
291
  fontSize: "$175",
281
292
  height: "$6",
282
- paddingX: `calc($100 + ${LABEL_OFFSET}px)`,
283
- [iconSlotSelector]: {
284
- width: "$icon-200",
285
- height: "$icon-200",
286
- "--svg-stroke-width": "$stroke-width$thin"
293
+ paddingX: "calc($100 + ".concat(LABEL_OFFSET, "px)"),
294
+ [externalIconSelector]: {
295
+ ...designSystemBaseIcon.styles.size.small,
296
+ ...designSystemBaseIcon.styles.weight.thin
287
297
  }
288
298
  }
289
299
  },
290
300
  rounded: {
291
301
  true: {
292
- borderRadius: "$half"
302
+ borderRadius: "$round"
293
303
  }
294
304
  },
295
305
  fluid: {
@@ -322,12 +332,13 @@ Label.displayName = "Label";
322
332
 
323
333
  const Button = React__default["default"].forwardRef(
324
334
  ({
325
- variant = "solid-prominent",
335
+ variant = "primary",
326
336
  size = "large",
327
337
  loading = false,
328
338
  rounded = false,
329
339
  fluid = false,
330
340
  "aria-disabled": ariaDisabled,
341
+ asChild = false,
331
342
  children,
332
343
  ...restProps
333
344
  }, forwardRef) => {
@@ -335,19 +346,41 @@ const Button = React__default["default"].forwardRef(
335
346
  if (typeof size === "string" && ["small", "medium"].includes(size)) {
336
347
  spinnerSize = "small";
337
348
  }
338
- const shouldHaveAriaDisabled = ariaDisabled === "true" || ariaDisabled === true || loading;
339
- const Content = loading ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(StyledSpinnerBox, null, /* @__PURE__ */ React__default["default"].createElement(designSystemSpinner.Spinner, {
340
- size: spinnerSize
341
- })), /* @__PURE__ */ React__default["default"].createElement(StyledHiddenContent, null, children)) : children;
342
- return /* @__PURE__ */ React__default["default"].createElement(StyledButton, {
343
- ...restProps,
344
- variant,
345
- rounded,
346
- fluid,
347
- size,
348
- "aria-disabled": shouldHaveAriaDisabled ? true : void 0,
349
- ref: forwardRef
350
- }, Content);
349
+ const shouldHaveAriaDisabled = designSystemUtils.booleanify(ariaDisabled) || loading;
350
+ let formattedChildren = children;
351
+ if (loading) {
352
+ const spinnerTestId = process.env.NODE_ENV === "test" ? "button-spinner" : void 0;
353
+ if (asChild && React__default["default"].Children.toArray(children).length === 1 && React__default["default"].isValidElement(children)) {
354
+ const firstLevelChild = React__default["default"].Children.only(children);
355
+ const { children: secondLevelChildren, ...childProps } = firstLevelChild.props;
356
+ formattedChildren = React__default["default"].cloneElement(firstLevelChild, {
357
+ ...childProps,
358
+ children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
359
+ /* @__PURE__ */ jsxRuntime.jsx(StyledSpinnerBox, { "data-testid": spinnerTestId, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemSpinner.Spinner, { size: spinnerSize }) }),
360
+ /* @__PURE__ */ jsxRuntime.jsx(StyledHiddenContent, { children: secondLevelChildren })
361
+ ] })
362
+ });
363
+ } else {
364
+ formattedChildren = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
365
+ /* @__PURE__ */ jsxRuntime.jsx(StyledSpinnerBox, { "data-testid": spinnerTestId, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemSpinner.Spinner, { size: spinnerSize }) }),
366
+ /* @__PURE__ */ jsxRuntime.jsx(StyledHiddenContent, { children })
367
+ ] });
368
+ }
369
+ }
370
+ return /* @__PURE__ */ jsxRuntime.jsx(ButtonProvider, { size, children: /* @__PURE__ */ jsxRuntime.jsx(
371
+ StyledButton,
372
+ {
373
+ ...restProps,
374
+ asChild,
375
+ variant,
376
+ rounded,
377
+ fluid,
378
+ size,
379
+ "aria-disabled": shouldHaveAriaDisabled ? true : void 0,
380
+ ref: forwardRef,
381
+ children: formattedChildren
382
+ }
383
+ ) });
351
384
  }
352
385
  );
353
386
  Button.IconSlot = IconSlot;
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import React from 'react'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { IconTypeSymbol } from '@mirohq/design-system-icons'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nconst isIcon = (child: React.ReactElement): boolean =>\n // @ts-expect-error\n child.type.__Type === IconTypeSymbol\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => {\n const child = React.Children.only(children) as React.ReactElement\n\n const isDsIcon = isIcon(child)\n\n const iconElement = isDsIcon\n ? React.cloneElement(child, { size: 'small' })\n : child\n\n return (\n <StyledIconSlot\n {...restProps}\n ref={forwardRef}\n aria-hidden\n asChild\n data-icon={isDsIcon ? '' : undefined}\n >\n {iconElement}\n </StyledIconSlot>\n )\n})\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\n\nconst solidDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst outlineDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst ghostDisabled: CSS = {\n [disabledSelector]: {\n color: '$text-neutrals-disabled',\n backgroundColor: '$transparent',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst LABEL_OFFSET = 2\n\nexport const StyledButton = styled(BaseButton, {\n userSelect: 'none',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n position: 'relative',\n width: 'fit-content',\n maxWidth: '100%',\n\n lineHeight: 1.5,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n '&[data-focused]': {\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n },\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$text-primary-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&:hover': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n\n ...solidDisabled,\n },\n 'outline-prominent': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-primary',\n color: '$text-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n '&:hover': {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&:hover': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...solidDisabled,\n },\n\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n 'ghost-subtle': {\n backgroundColor: 'transparent',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...ghostDisabled,\n },\n 'solid-danger': {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'outline-danger': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...ghostDisabled,\n },\n },\n size: {\n 'x-large': {\n height: sizes.xLarge,\n fontSize: '$200',\n paddingX: `calc($200 + ${LABEL_OFFSET}px)`,\n\n [iconSlotSelector]: {\n width: '$icon-300',\n height: '$icon-300',\n },\n },\n large: {\n height: sizes.large,\n fontSize: '$200',\n paddingX: `calc($150 + ${LABEL_OFFSET}px)`,\n\n [iconSlotSelector]: {\n width: '$icon-300',\n height: '$icon-300',\n },\n },\n medium: {\n height: sizes.medium,\n fontSize: '$175',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [iconSlotSelector]: {\n width: '$icon-200',\n height: '$icon-200',\n '--svg-stroke-width': '$stroke-width$thin',\n },\n },\n small: {\n fontSize: '$175',\n height: '$6',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [iconSlotSelector]: {\n width: '$icon-200',\n height: '$icon-200',\n '--svg-stroke-width': '$stroke-width$thin',\n },\n },\n },\n rounded: {\n true: {\n borderRadius: '$half',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { Spinner } from '@mirohq/design-system-spinner'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\nexport interface ButtonProps extends StyledButtonProps {\n /**\n * Change the button style.\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n */\n fluid?: StyledButtonProps['fluid']\n}\n\nexport const Button = React.forwardRef<\n ElementRef<typeof StyledButton>,\n ButtonProps\n>(\n (\n {\n variant = 'solid-prominent',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled =\n ariaDisabled === 'true' || ariaDisabled === true || loading\n\n const Content = loading ? (\n <>\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{children}</StyledHiddenContent>\n </>\n ) : (\n children\n )\n\n return (\n <StyledButton\n {...restProps}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {Content}\n </StyledButton>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["styled","Primitive","IconTypeSymbol","React","BaseButton","sizes","Spinner"],"mappings":";;;;;;;;;;;;;;;AAMO,MAAM,cAAiB,GAAAA,2BAAA,CAAOC,+BAAU,CAAA,GAAA,EAAK,EAAE,CAAA,CAAA;AAUtD,MAAM,MAAS,GAAA,CAAC,KAEd,KAAA,KAAA,CAAM,KAAK,MAAW,KAAAC,gCAAA,CAAA;AAEX,MAAA,QAAA,GAAWC,0BAAM,UAG5B,CAAA,CAAC,EAAE,QAAa,EAAA,GAAA,SAAA,IAAa,UAAe,KAAA;AAC5C,EAAA,MAAM,KAAQ,GAAAA,yBAAA,CAAM,QAAS,CAAA,IAAA,CAAK,QAAQ,CAAA,CAAA;AAE1C,EAAM,MAAA,QAAA,GAAW,OAAO,KAAK,CAAA,CAAA;AAE7B,EAAM,MAAA,WAAA,GAAc,WAChBA,yBAAM,CAAA,YAAA,CAAa,OAAO,EAAE,IAAA,EAAM,OAAQ,EAAC,CAC3C,GAAA,KAAA,CAAA;AAEJ,EAAA,uBACGA,yBAAA,CAAA,aAAA,CAAA,cAAA,EAAA;AAAA,IACE,GAAG,SAAA;AAAA,IACJ,GAAK,EAAA,UAAA;AAAA,IACL,aAAW,EAAA,IAAA;AAAA,IACX,OAAO,EAAA,IAAA;AAAA,IACP,WAAA,EAAW,WAAW,EAAK,GAAA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CAAC,mBAAqB,EAAA,IAAA,EAAA,QAAS,CACjC,CAEA,GAAA,QAAA,CAAA;AAGF,IAAA,uBACGA,yBAAA,CAAA,aAAA,CAAA,YAAA,EAAA;AAAA,MACE,GAAG,SAAA;AAAA,MACJ,OAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MAEA,eAAA,EAAe,yBAAyB,IAAO,GAAA,KAAA,CAAA;AAAA,MAC/C,GAAK,EAAA,UAAA;AAAA,KAAA,EAEJ,OACH,CAAA,CAAA;AAAA,GAEJ;AACF,EAAA;AAUA,MAAA,CAAO,QAAW,GAAA,QAAA,CAAA;AAClB,MAAA,CAAO,KAAQ,GAAA,KAAA;;;;"}
1
+ {"version":3,"file":"main.js","sources":["../src/hooks/use-button-context.tsx","../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { PropsWithChildren } from 'react'\n\nimport type { StyledButtonProps } from '../button.styled'\n\ninterface ButtonProps {\n size?: StyledButtonProps['size']\n}\n\ninterface ButtonContextProps extends ButtonProps {}\n\nexport type ButtonProviderProps = ButtonProps\n\nconst ButtonContext = createContext<ButtonContextProps>({} as any)\n\nexport const ButtonProvider = ({\n children,\n ...restProps\n}: PropsWithChildren<ButtonProviderProps>): JSX.Element => (\n <ButtonContext.Provider\n value={{\n ...restProps,\n }}\n >\n {children}\n </ButtonContext.Provider>\n)\n\nexport const useButtonContext = (): ButtonContextProps =>\n useContext(ButtonContext)\n","import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport type {\n IconReactElement,\n IconSizes,\n IconWeights,\n} from '@mirohq/design-system-base-icon'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\n\nimport { useButtonContext } from '../hooks/use-button-context'\nimport type { StyledButtonProps } from '../button.styled'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\ntype ButtonSize = ExtractValidKeys<StyledButtonProps['size']>\n\nconst buttonIconSizes: { [key in ButtonSize]: IconSizes } = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n 'x-large': 'medium',\n}\n\nconst buttonIconWeights: { [key in ButtonSize]: IconWeights } = {\n small: 'thin',\n medium: 'thin',\n large: 'normal',\n 'x-large': 'normal',\n}\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => {\n const { size } = useButtonContext()\n\n const formattedChildren = addPropsToChildren(\n children,\n child => isIconComponent(child as IconReactElement),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n weight: buttonIconWeights[size as ButtonSize],\n }\n )\n\n return (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {formattedChildren}\n </StyledIconSlot>\n )\n})\n","import { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\nimport type { ComponentPropsWithRef } from 'react'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nconst solidDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst outlineDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst ghostDisabled: CSS = {\n [disabledSelector]: {\n color: '$text-neutrals-disabled',\n backgroundColor: '$transparent',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst LABEL_OFFSET = 2\n\nexport const StyledButton = styled(BaseButton, {\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n position: 'relative',\n width: 'fit-content',\n maxWidth: '100%',\n\n lineHeight: 1,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-400 !important',\n }),\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n\n variants: {\n variant: {\n primary: {\n backgroundColor: '$background-primary-prominent',\n color: '$text-primary-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-active',\n },\n\n ...solidDisabled,\n },\n secondary: {\n backgroundColor: '$background-neutrals-subtle',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...solidDisabled,\n },\n\n tertiary: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-primary',\n color: '$text-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n ghost: {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n 'ghost-subtle': {\n backgroundColor: 'transparent',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...ghostDisabled,\n },\n danger: {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-prominent-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'danger-secondary': {\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...ghostDisabled,\n },\n },\n size: {\n 'x-large': {\n height: sizes.xLarge,\n fontSize: '$200',\n paddingX: `calc($200 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n large: {\n height: sizes.large,\n fontSize: '$200',\n paddingX: `calc($150 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n medium: {\n height: sizes.medium,\n fontSize: '$175',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n ...baseIconStyles.weight.thin,\n },\n },\n small: {\n fontSize: '$175',\n height: '$6',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n ...baseIconStyles.weight.thin,\n },\n },\n },\n rounded: {\n true: {\n borderRadius: '$round',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import type { BaseButtonProps } from '@mirohq/design-system-base-button'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { ButtonProvider } from './hooks/use-button-context'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\nexport type ButtonProps = {\n /**\n * Change the button style.\n * @default 'primary'\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n * @default 'large'\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n * @default false\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n * @default false\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n * @default false\n */\n fluid?: StyledButtonProps['fluid']\n} & BaseButtonProps\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n asChild = false,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n let formattedChildren = children\n\n if (loading) {\n const spinnerTestId =\n process.env.NODE_ENV === 'test' ? 'button-spinner' : undefined\n\n if (\n asChild &&\n React.Children.toArray(children).length === 1 &&\n React.isValidElement(children)\n ) {\n // when using asChild we need to render element to merge props with first,\n // and spinner wrapper should be rendered between the element and its content\n const firstLevelChild = React.Children.only(children)\n\n const { children: secondLevelChildren, ...childProps } =\n firstLevelChild.props\n\n formattedChildren = React.cloneElement(firstLevelChild, {\n ...childProps,\n children: (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{secondLevelChildren}</StyledHiddenContent>\n </>\n ),\n })\n } else {\n formattedChildren = (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{children}</StyledHiddenContent>\n </>\n )\n }\n }\n\n return (\n <ButtonProvider size={size}>\n <StyledButton\n {...restProps}\n asChild={asChild}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {formattedChildren}\n </StyledButton>\n </ButtonProvider>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["createContext","jsx","useContext","styled","Primitive","React","addPropsToChildren","isIconComponent","BaseButton","focus","sizes","baseIconStyles","booleanify","jsxs","Fragment","Spinner"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,MAAM,aAAA,GAAgBA,mBAAkC,CAAA,EAAS,CAAA,CAAA;AAE1D,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,GAAG,SAAA;AACL,CACE,qBAAAC,cAAA;AAAA,EAAC,aAAc,CAAA,QAAA;AAAA,EAAd;AAAA,IACC,KAAO,EAAA;AAAA,MACL,GAAG,SAA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