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