@mirohq/design-system-button 3.2.0-deprecated-button.1 → 4.0.0-button.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
@@ -4,304 +4,318 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
- var button = require('@react-aria/button');
8
- var utils = require('@react-aria/utils');
7
+ var designSystemUtils = require('@mirohq/design-system-utils');
9
8
  var designSystemSpinner = require('@mirohq/design-system-spinner');
10
- var link = require('@react-aria/link');
11
- var focus = require('@react-aria/focus');
12
9
  var designSystemPrimitive = require('@mirohq/design-system-primitive');
13
10
  var designSystemStitches = require('@mirohq/design-system-stitches');
11
+ var designSystemBaseButton = require('@mirohq/design-system-base-button');
12
+ var designSystemBaseIcon = require('@mirohq/design-system-base-icon');
13
+ var designSystemStyles = require('@mirohq/design-system-styles');
14
14
 
15
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
16
 
17
17
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
18
18
 
19
- const focusFilled = {
20
- "&[data-focused]": {
21
- boxShadow: "inset 0 0 0 1px white, 0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)"
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
22
30
  }
31
+ );
32
+ const useButtonContext = () => React.useContext(ButtonContext);
33
+
34
+ const StyledIconSlot = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {});
35
+ const buttonIconSizes = {
36
+ small: "small",
37
+ medium: "small",
38
+ large: "medium",
39
+ "x-large": "medium"
23
40
  };
24
- const focusOutline = {
25
- "&[data-focused]": {
26
- boxShadow: "0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)",
27
- borderColor: "transparent"
41
+ const buttonIconWeights = {
42
+ small: "thin",
43
+ medium: "thin",
44
+ large: "normal",
45
+ "x-large": "normal"
46
+ };
47
+ const IconSlot = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => {
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 });
59
+ });
60
+
61
+ const disabledSelector = '&[disabled], &[aria-disabled="true"]';
62
+ const iconSlotSelector = "& ".concat(StyledIconSlot);
63
+ const externalIconSelector = "& svg:not([data-icon-component]), & img:not([data-icon-component])";
64
+ const solidDisabled = {
65
+ [disabledSelector]: {
66
+ backgroundColor: "$background-neutrals-disabled",
67
+ color: "$text-neutrals-disabled",
68
+ [iconSlotSelector]: {
69
+ color: "$icon-neutrals-disabled"
70
+ }
71
+ }
72
+ };
73
+ const outlineDisabled = {
74
+ [disabledSelector]: {
75
+ backgroundColor: "$background-neutrals",
76
+ borderColor: "$border-neutrals-disabled",
77
+ color: "$text-neutrals-disabled",
78
+ [iconSlotSelector]: {
79
+ color: "$icon-neutrals-disabled"
80
+ }
28
81
  }
29
82
  };
30
- const focusDefault = {
31
- "&[data-focused]": {
32
- boxShadow: "0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)"
83
+ const ghostDisabled = {
84
+ [disabledSelector]: {
85
+ color: "$text-neutrals-disabled",
86
+ backgroundColor: "$transparent",
87
+ [iconSlotSelector]: {
88
+ color: "$icon-neutrals-disabled"
89
+ }
33
90
  }
34
91
  };
35
- const pressedSelector = "&:active, &[data-pressed]";
36
- const StyledButton = designSystemStitches.styled(designSystemPrimitive.Primitive.button, {
37
- boxSizing: "border-box",
38
- display: "inline-block",
39
- outline: "none",
92
+ const LABEL_OFFSET = 2;
93
+ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButton, {
40
94
  whiteSpace: "nowrap",
41
95
  textOverflow: "ellipsis",
42
96
  textAlign: "center",
43
- verticalAlign: "middle",
44
- userSelect: "none",
45
- fontFamily: "inherit",
46
- fontStyle: "normal",
47
- fontStretch: "normal",
48
- letterSpacing: "normal",
49
- fontWeight: "normal",
50
97
  position: "relative",
51
- cursor: "pointer",
52
- border: "none",
53
- textDecoration: "none",
54
- backgroundColor: "transparent",
55
- "&[disabled]": {
56
- pointerEvents: "none",
57
- opacity: 0.4
98
+ width: "fit-content",
99
+ maxWidth: "100%",
100
+ lineHeight: 1,
101
+ fontWeight: "$semibold",
102
+ border: "1px solid transparent",
103
+ // to make outline and solid/ghost variants the same width
104
+ ...designSystemStyles.focus.css({
105
+ // TODO https://miro.atlassian.net/browse/MDS-1284 use `$focus-small` token after updating themes/web/local/shadows.ts :oliver.l 2024-09-05
106
+ boxShadow: "0px 0px 0px 2px $colors$border-focus-inner, 0px 0px 0px 4px $colors$focus-keyboard"
107
+ }),
108
+ ["& ".concat(StyledIconSlot, ":first-child")]: {
109
+ marginLeft: -LABEL_OFFSET,
110
+ marginRight: "calc($50 + ".concat(LABEL_OFFSET, "px)")
111
+ },
112
+ ["& ".concat(StyledIconSlot, ":last-child")]: {
113
+ marginRight: -LABEL_OFFSET,
114
+ marginLeft: "calc($50 + ".concat(LABEL_OFFSET, "px)")
58
115
  },
59
116
  variants: {
60
117
  variant: {
61
- primary: {},
62
- secondary: {},
63
- danger: {}
64
- },
65
- appearance: {
66
- filled: {},
67
- outlined: {},
68
- flat: {}
69
- },
70
- size: {
71
- large: {
72
- padding: "14px 32px 18px 32px",
73
- fontSize: "20px",
74
- lineHeight: "28px",
75
- height: "60px"
118
+ primary: {
119
+ backgroundColor: "$background-primary-prominent",
120
+ color: "$text-neutrals-inverted",
121
+ [iconSlotSelector]: {
122
+ color: "$icon-primary-inverted"
123
+ },
124
+ "&[data-hovered]": {
125
+ backgroundColor: "$background-primary-prominent-hover"
126
+ },
127
+ "&[data-pressed]": {
128
+ backgroundColor: "$background-primary-prominent-active"
129
+ },
130
+ ...solidDisabled
76
131
  },
77
- medium: {
78
- padding: "11px 24px 13px 24px",
79
- fontSize: "16px",
80
- lineHeight: "24px",
81
- height: "48px"
132
+ secondary: {
133
+ backgroundColor: "$button-background-secondary",
134
+ color: "$text-neutrals",
135
+ [iconSlotSelector]: {
136
+ color: "$icon-neutrals"
137
+ },
138
+ "&[data-hovered]": {
139
+ color: "$text-neutrals-hover",
140
+ backgroundColor: "$button-background-secondary-hover"
141
+ },
142
+ "&[data-pressed]": {
143
+ color: "$text-neutrals-active",
144
+ backgroundColor: "$button-background-secondary-pressed"
145
+ },
146
+ ...solidDisabled
82
147
  },
83
- small: {
84
- padding: "7px 16px 9px 16px",
85
- fontSize: "14px",
86
- lineHeight: "20px",
87
- height: "36px"
148
+ tertiary: {
149
+ borderColor: "$border-primary",
150
+ color: "$text-primary",
151
+ [iconSlotSelector]: {
152
+ color: "$icon-primary"
153
+ },
154
+ "&[data-hovered]": {
155
+ backgroundColor: "$background-primary-subtle-hover",
156
+ borderColor: "$border-primary-hover",
157
+ color: "$text-primary-hover",
158
+ [iconSlotSelector]: {
159
+ color: "$icon-primary-hover"
160
+ }
161
+ },
162
+ "&[data-pressed]": {
163
+ backgroundColor: "$background-primary-subtle-active",
164
+ borderColor: "$border-primary-active",
165
+ color: "$text-primary-active",
166
+ [iconSlotSelector]: {
167
+ color: "$icon-primary-active"
168
+ }
169
+ },
170
+ ...outlineDisabled
171
+ },
172
+ ghost: {
173
+ backgroundColor: "transparent",
174
+ color: "$text-neutrals",
175
+ "&[data-hovered]": {
176
+ backgroundColor: "$button-background-secondary-hover",
177
+ color: "$text-neutrals-hover",
178
+ [iconSlotSelector]: {
179
+ color: "$icon-primary-hover"
180
+ }
181
+ },
182
+ "&[data-pressed]": {
183
+ backgroundColor: "$button-background-secondary-pressed",
184
+ color: "$text-neutrals-active",
185
+ [iconSlotSelector]: {
186
+ color: "$icon-primary-active"
187
+ }
188
+ },
189
+ ...ghostDisabled
88
190
  },
89
- "x-small": {
90
- padding: "5px 12px 7px",
91
- fontSize: "14px",
92
- lineHeight: "20px",
93
- height: "32px"
191
+ "ghost-subtle": {
192
+ backgroundColor: "transparent",
193
+ color: "$text-neutrals",
194
+ [iconSlotSelector]: {
195
+ color: "$icon-neutrals"
196
+ },
197
+ "&[data-hovered]": {
198
+ backgroundColor: "$background-neutrals-subtle-hover"
199
+ },
200
+ "&[data-pressed]": {
201
+ backgroundColor: "$background-neutrals-subtle-active"
202
+ },
203
+ ...ghostDisabled
94
204
  },
95
- "xx-small": {
96
- padding: "3px 12px",
97
- fontSize: "12px",
98
- lineHeight: "18px",
99
- height: "24px"
100
- }
101
- },
102
- rounded: {
103
- true: {
104
- borderRadius: "$half"
105
- }
106
- },
107
- loading: {
108
- true: {
109
- "&[disabled]": {
110
- cursor: "default",
111
- opacity: 1,
112
- pointerEvents: "none",
113
- "& > span": {
114
- visibility: "hidden"
205
+ danger: {
206
+ backgroundColor: "$background-danger-prominent",
207
+ color: "$text-danger-inverted",
208
+ [iconSlotSelector]: {
209
+ color: "$icon-danger-inverted"
210
+ },
211
+ "&[data-hovered]": {
212
+ backgroundColor: "$background-danger-prominent-hover"
213
+ },
214
+ "&[data-pressed]": {
215
+ backgroundColor: "$background-danger-prominent-active"
216
+ },
217
+ ...solidDisabled
218
+ },
219
+ "danger-secondary": {
220
+ borderColor: "$border-danger",
221
+ color: "$text-danger",
222
+ [iconSlotSelector]: {
223
+ color: "$icon-danger"
224
+ },
225
+ "&[data-hovered]": {
226
+ backgroundColor: "$background-danger-subtle-hover",
227
+ color: "$text-danger-hover",
228
+ [iconSlotSelector]: {
229
+ color: "$icon-danger-hover"
115
230
  }
116
- }
117
- }
118
- },
119
- fluid: {
120
- true: {
121
- width: "100%",
122
- display: "block"
123
- }
124
- }
125
- },
126
- compoundVariants: [
127
- {
128
- size: "small",
129
- rounded: true,
130
- css: {
131
- padding: "10px 16px",
132
- height: "40px"
133
- }
134
- },
135
- {
136
- size: "large",
137
- rounded: false,
138
- css: {
139
- borderRadius: "$50"
140
- }
141
- },
142
- {
143
- size: "medium",
144
- rounded: false,
145
- css: {
146
- borderRadius: "$50"
147
- }
148
- },
149
- {
150
- size: "small",
151
- rounded: false,
152
- css: {
153
- borderRadius: "$50"
154
- }
155
- },
156
- {
157
- size: "x-small",
158
- rounded: false,
159
- css: {
160
- borderRadius: "$50"
161
- }
162
- },
163
- {
164
- size: "xx-small",
165
- rounded: false,
166
- css: {
167
- borderRadius: "$25"
168
- }
169
- },
170
- {
171
- variant: "primary",
172
- appearance: "filled",
173
- css: {
174
- color: "#FFFFFF",
175
- backgroundColor: "#3859FF",
176
- ...focusFilled,
177
- "&:hover": {
178
- color: "#FFFFFF",
179
- backgroundColor: "#3F53D9"
180
231
  },
181
- [pressedSelector]: {
182
- backgroundColor: "#122277"
183
- }
184
- }
185
- },
186
- {
187
- variant: "primary",
188
- appearance: "outlined",
189
- css: {
190
- color: "rgba(66, 98, 255, 1)",
191
- border: "1px solid rgba(66, 98, 255, 1)",
192
- ...focusOutline,
193
- "&:hover": {
194
- color: "rgba(66, 98, 255, 1)",
195
- backgroundColor: "rgba(244, 246, 255, 1)"
232
+ "&[data-pressed]": {
233
+ backgroundColor: "$background-danger-subtle-active",
234
+ color: "$text-danger-active",
235
+ [iconSlotSelector]: {
236
+ color: "$icon-danger-active"
237
+ }
196
238
  },
197
- [pressedSelector]: {
198
- backgroundColor: "rgba(240, 242, 255, 1)"
199
- }
200
- }
201
- },
202
- {
203
- variant: "primary",
204
- appearance: "flat",
205
- css: {
206
- color: "rgba(66, 98, 255, 1)",
207
- ...focusDefault,
208
- "&:hover": {
209
- color: "rgba(69, 91, 237, 1)",
210
- backgroundColor: "rgba(245, 245, 247, 1)"
239
+ ...outlineDisabled
240
+ },
241
+ "ghost-danger": {
242
+ backgroundColor: "transparent",
243
+ color: "$text-danger",
244
+ [iconSlotSelector]: {
245
+ color: "$icon-danger"
211
246
  },
212
- [pressedSelector]: {
213
- color: "rgba(61, 81, 212, 1)"
214
- }
215
- }
216
- },
217
- {
218
- variant: "secondary",
219
- appearance: "filled",
220
- css: {
221
- color: "rgba(5, 0, 56, 1)",
222
- backgroundColor: "rgba(245, 245, 247, 1)",
223
- ...focusFilled,
224
- "&:hover": {
225
- color: "rgba(5, 0, 56, 1)",
226
- backgroundColor: "rgba(240, 240, 243, 1)"
247
+ "&[data-hovered]": {
248
+ backgroundColor: "$background-danger-subtle",
249
+ color: "$text-danger-hover",
250
+ [iconSlotSelector]: {
251
+ color: "$icon-danger-hover"
252
+ }
227
253
  },
228
- [pressedSelector]: {
229
- backgroundColor: "rgba(235, 235, 239, 1)"
230
- }
231
- }
232
- },
233
- {
234
- variant: "secondary",
235
- appearance: "outlined",
236
- css: {
237
- color: "rgba(5, 0, 56, 1)",
238
- border: "1px solid rgba(205, 204, 215, 1)",
239
- ...focusOutline,
240
- "&:hover": {
241
- color: "rgba(5, 0, 56, 1)",
242
- backgroundColor: "rgba(245, 245, 247, 1)"
254
+ "&[data-pressed]": {
255
+ backgroundColor: "$background-danger-subtle-hover",
256
+ color: "$text-danger-active",
257
+ [iconSlotSelector]: {
258
+ color: "$icon-danger-active"
259
+ }
243
260
  },
244
- [pressedSelector]: {
245
- backgroundColor: "rgba(235, 235, 239, 1)"
246
- }
261
+ ...ghostDisabled
247
262
  }
248
263
  },
249
- {
250
- variant: "secondary",
251
- appearance: "flat",
252
- css: {
253
- color: "rgba(5, 0, 56, 1)",
254
- ...focusDefault,
255
- "&:hover": {
256
- color: "rgba(5, 0, 56, 1)",
257
- backgroundColor: "rgba(245, 245, 247, 1)"
264
+ size: {
265
+ "x-large": {
266
+ height: designSystemBaseButton.sizes.xLarge,
267
+ fontSize: "$200",
268
+ paddingX: "calc($200 + ".concat(LABEL_OFFSET, "px)"),
269
+ [externalIconSelector]: {
270
+ ...designSystemBaseIcon.styles.size.medium,
271
+ ...designSystemBaseIcon.styles.weight.normal
258
272
  }
259
- }
260
- },
261
- {
262
- variant: "danger",
263
- appearance: "filled",
264
- css: {
265
- color: "#FFFFFF",
266
- backgroundColor: "rgba(217, 41, 41, 1)",
267
- ...focusFilled,
268
- "&:hover": {
269
- backgroundColor: "rgba(199, 20, 20, 1)"
270
- },
271
- [pressedSelector]: {
272
- backgroundColor: "rgba(184, 13, 13, 1)"
273
+ },
274
+ large: {
275
+ height: designSystemBaseButton.sizes.large,
276
+ fontSize: "$200",
277
+ paddingX: "calc($150 + ".concat(LABEL_OFFSET, "px)"),
278
+ [externalIconSelector]: {
279
+ ...designSystemBaseIcon.styles.size.medium,
280
+ ...designSystemBaseIcon.styles.weight.normal
281
+ }
282
+ },
283
+ medium: {
284
+ height: designSystemBaseButton.sizes.medium,
285
+ fontSize: "$175",
286
+ paddingX: "calc($100 + ".concat(LABEL_OFFSET, "px)"),
287
+ [externalIconSelector]: {
288
+ ...designSystemBaseIcon.styles.size.small,
289
+ ...designSystemBaseIcon.styles.weight.thin
290
+ }
291
+ },
292
+ small: {
293
+ fontSize: "$175",
294
+ height: "$6",
295
+ paddingX: "calc($100 + ".concat(LABEL_OFFSET, "px)"),
296
+ [externalIconSelector]: {
297
+ ...designSystemBaseIcon.styles.size.small,
298
+ ...designSystemBaseIcon.styles.weight.thin
273
299
  }
274
300
  }
275
301
  },
276
- {
277
- variant: "danger",
278
- appearance: "outlined",
279
- css: {
280
- color: "rgba(217, 41, 41, 1)",
281
- border: "1px solid rgba(217, 41, 41, 1)",
282
- ...focusOutline,
283
- "&:hover": {
284
- color: "rgba(217, 41, 41, 1)",
285
- backgroundColor: "rgba(254, 247, 247, 1)"
286
- },
287
- [pressedSelector]: {
288
- backgroundColor: "rgba(253, 242, 242, 1)"
289
- }
302
+ rounded: {
303
+ true: {
304
+ borderRadius: "$round"
290
305
  }
291
306
  },
292
- {
293
- variant: "danger",
294
- appearance: "flat",
295
- css: {
296
- color: "rgba(217, 41, 41, 1)",
297
- ...focusDefault,
298
- "&:hover": {
299
- color: "rgba(217, 41, 41, 1)",
300
- backgroundColor: "rgba(245, 245, 247, 1)"
301
- }
307
+ fluid: {
308
+ true: {
309
+ display: "flex",
310
+ justifyContent: "center",
311
+ maxWidth: "100%",
312
+ width: "100%"
302
313
  }
303
314
  }
304
- ]
315
+ }
316
+ });
317
+ const StyledHiddenContent = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
318
+ visibility: "hidden"
305
319
  });
306
320
  const StyledSpinnerBox = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
307
321
  display: "flex",
@@ -315,97 +329,64 @@ const StyledSpinnerBox = designSystemStitches.styled(designSystemPrimitive.Primi
315
329
  margin: "auto"
316
330
  });
317
331
 
332
+ const Label = designSystemPrimitive.Primitive.span;
333
+ Label.displayName = "Label";
334
+
318
335
  const Button = React__default["default"].forwardRef(
319
336
  ({
320
337
  variant = "primary",
321
- appearance = "filled",
322
- size = "medium",
338
+ size = "large",
323
339
  loading = false,
324
340
  rounded = false,
325
341
  fluid = false,
326
- disabled = false,
327
- href,
328
- target,
329
- rel,
342
+ "aria-disabled": ariaDisabled,
343
+ asChild = false,
330
344
  children,
331
- onPress,
332
- onClick,
333
- asChild,
334
345
  ...restProps
335
346
  }, forwardRef) => {
336
- let spinnerSize;
337
- if (typeof size === "string") {
338
- spinnerSize = ["x-small", "xx-small"].includes(size) ? "small" : "medium";
339
- } else {
340
- spinnerSize = "medium";
347
+ let spinnerSize = "medium";
348
+ if (typeof size === "string" && ["small", "medium"].includes(size)) {
349
+ spinnerSize = "small";
341
350
  }
342
- const _loading = loading === "true" || loading === true;
343
- const shouldBeDisabled = disabled === true || _loading;
344
- const asLink = href != null;
345
- const ref = React.useRef(null);
346
- const refWithFallback = forwardRef != null ? forwardRef : ref;
347
- const { buttonProps, isPressed } = button.useButton(
348
- {
349
- isDisabled: shouldBeDisabled,
350
- href,
351
- onPress: onPress != null ? onPress : onClick,
352
- allowFocusWhenDisabled: false,
353
- ...restProps
354
- },
355
- // @ts-expect-error
356
- refWithFallback
357
- );
358
- const { linkProps } = link.useLink(
359
- {
360
- isDisabled: disabled,
361
- onPress: onPress != null ? onPress : onClick,
362
- ...restProps
363
- },
364
- // @ts-expect-error
365
- refWithFallback
366
- );
367
- const Content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
368
- _loading && /* @__PURE__ */ jsxRuntime.jsx(StyledSpinnerBox, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystemSpinner.Spinner, { size: spinnerSize }) }),
369
- /* @__PURE__ */ jsxRuntime.jsx("span", { children })
370
- ] });
371
- const tabIndexProp = shouldBeDisabled && {
372
- tabIndex: -1
373
- };
374
- const { isFocusVisible, focusProps } = focus.useFocusRing();
375
- const elementProps = utils.mergeProps(
376
- restProps,
377
- asLink ? linkProps : buttonProps,
378
- focusProps
379
- );
380
- return /* @__PURE__ */ jsxRuntime.jsx(
351
+ const shouldHaveAriaDisabled = designSystemUtils.booleanify(ariaDisabled) || loading;
352
+ let formattedChildren = children;
353
+ if (loading) {
354
+ const spinnerTestId = process.env.NODE_ENV === "test" ? "button-spinner" : void 0;
355
+ if (asChild && React__default["default"].Children.toArray(children).length === 1 && React__default["default"].isValidElement(children)) {
356
+ const firstLevelChild = React__default["default"].Children.only(children);
357
+ const { children: secondLevelChildren, ...childProps } = firstLevelChild.props;
358
+ formattedChildren = React__default["default"].cloneElement(firstLevelChild, {
359
+ ...childProps,
360
+ children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
361
+ /* @__PURE__ */ jsxRuntime.jsx(StyledSpinnerBox, { "data-testid": spinnerTestId, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemSpinner.Spinner, { size: spinnerSize }) }),
362
+ /* @__PURE__ */ jsxRuntime.jsx(StyledHiddenContent, { children: secondLevelChildren })
363
+ ] })
364
+ });
365
+ } else {
366
+ formattedChildren = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
367
+ /* @__PURE__ */ jsxRuntime.jsx(StyledSpinnerBox, { "data-testid": spinnerTestId, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemSpinner.Spinner, { size: spinnerSize }) }),
368
+ /* @__PURE__ */ jsxRuntime.jsx(StyledHiddenContent, { children })
369
+ ] });
370
+ }
371
+ }
372
+ return /* @__PURE__ */ jsxRuntime.jsx(ButtonProvider, { size, children: /* @__PURE__ */ jsxRuntime.jsx(
381
373
  StyledButton,
382
374
  {
383
- ...elementProps,
375
+ ...restProps,
376
+ asChild,
384
377
  variant,
385
- appearance,
386
- size,
387
- loading,
388
378
  rounded,
389
379
  fluid,
390
- disabled: shouldBeDisabled,
391
- asChild: asLink || asChild,
392
- ...tabIndexProp,
393
- "data-pressed": isPressed ? "" : void 0,
394
- "data-focused": isFocusVisible ? "" : void 0,
395
- ref: refWithFallback,
396
- children: asLink ? /* @__PURE__ */ jsxRuntime.jsx(
397
- "a",
398
- {
399
- href,
400
- target,
401
- rel: target === "_blank" ? "noopener noreferrer ".concat(rel) : rel,
402
- children: Content
403
- }
404
- ) : Content
380
+ size,
381
+ "aria-disabled": shouldHaveAriaDisabled ? true : void 0,
382
+ ref: forwardRef,
383
+ children: formattedChildren
405
384
  }
406
- );
385
+ ) });
407
386
  }
408
387
  );
388
+ Button.IconSlot = IconSlot;
389
+ Button.Label = Label;
409
390
 
410
391
  exports.Button = Button;
411
392
  //# sourceMappingURL=main.js.map