@mirohq/design-system-button 4.3.0-new-focus-keyboard.1 → 5.0.0-pdl-removing-ffs.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 +29 -130
- package/dist/main.js.map +1 -1
- package/dist/module.js +29 -130
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +25 -16
- package/package.json +9 -10
package/dist/main.js
CHANGED
|
@@ -6,7 +6,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var designSystemSpinner = require('@mirohq/design-system-spinner');
|
|
7
7
|
var designSystemUtils = require('@mirohq/design-system-utils');
|
|
8
8
|
var React = require('react');
|
|
9
|
-
var designSystemExperiments = require('@mirohq/design-system-experiments');
|
|
10
9
|
var designSystemBaseButton = require('@mirohq/design-system-base-button');
|
|
11
10
|
var designSystemBaseIcon = require('@mirohq/design-system-base-icon');
|
|
12
11
|
var designSystemPrimitive = require('@mirohq/design-system-primitive');
|
|
@@ -95,6 +94,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
95
94
|
whiteSpace: "nowrap",
|
|
96
95
|
textOverflow: "ellipsis",
|
|
97
96
|
textAlign: "center",
|
|
97
|
+
fontWeight: "$semibold",
|
|
98
98
|
position: "relative",
|
|
99
99
|
width: "fit-content",
|
|
100
100
|
maxWidth: "100%",
|
|
@@ -110,18 +110,16 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
110
110
|
marginLeft: "calc($50 + ".concat(LABEL_OFFSET, "px)")
|
|
111
111
|
},
|
|
112
112
|
...designSystemStyles.focus.css({
|
|
113
|
-
boxShadow: "$focus
|
|
113
|
+
boxShadow: "$focus"
|
|
114
114
|
}),
|
|
115
115
|
variants: {
|
|
116
|
-
v1: {
|
|
117
|
-
false: {},
|
|
118
|
-
true: {
|
|
119
|
-
fontWeight: "$semibold"
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
116
|
variant: {
|
|
123
117
|
primary: {
|
|
124
118
|
backgroundColor: "$background-primary-prominent",
|
|
119
|
+
color: "$text-neutrals-inverted",
|
|
120
|
+
"&[data-pressed]": {
|
|
121
|
+
backgroundColor: "$background-primary-prominent-pressed"
|
|
122
|
+
},
|
|
125
123
|
[iconSlotSelector]: {
|
|
126
124
|
color: "$icon-primary-inverted"
|
|
127
125
|
},
|
|
@@ -131,8 +129,8 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
131
129
|
...solidDisabled
|
|
132
130
|
},
|
|
133
131
|
tertiary: {
|
|
134
|
-
borderColor: "$border-primary",
|
|
135
132
|
color: "$text-primary",
|
|
133
|
+
border: "1.5px solid $border-primary",
|
|
136
134
|
[iconSlotSelector]: {
|
|
137
135
|
color: "$icon-primary"
|
|
138
136
|
},
|
|
@@ -175,6 +173,15 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
175
173
|
},
|
|
176
174
|
secondary: {
|
|
177
175
|
color: "$text-neutrals",
|
|
176
|
+
backgroundColor: "$button-background-secondary",
|
|
177
|
+
"&[data-hovered]": {
|
|
178
|
+
color: "$text-neutrals-hover",
|
|
179
|
+
backgroundColor: "$button-background-secondary-hover"
|
|
180
|
+
},
|
|
181
|
+
"&[data-pressed]": {
|
|
182
|
+
color: "$text-neutrals-active",
|
|
183
|
+
backgroundColor: "$button-background-secondary-pressed"
|
|
184
|
+
},
|
|
178
185
|
[iconSlotSelector]: {
|
|
179
186
|
color: "$icon-neutrals"
|
|
180
187
|
},
|
|
@@ -202,6 +209,14 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
202
209
|
[iconSlotSelector]: {
|
|
203
210
|
color: "$icon-neutrals"
|
|
204
211
|
},
|
|
212
|
+
"&[data-hovered]": {
|
|
213
|
+
backgroundColor: "$button-background-secondary-hover",
|
|
214
|
+
color: "$text-neutrals-hover"
|
|
215
|
+
},
|
|
216
|
+
"&[data-pressed]": {
|
|
217
|
+
backgroundColor: "$button-background-secondary-pressed",
|
|
218
|
+
color: "$text-neutrals-pressed"
|
|
219
|
+
},
|
|
205
220
|
...ghostDisabled
|
|
206
221
|
},
|
|
207
222
|
danger: {
|
|
@@ -225,13 +240,15 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
225
240
|
color: "$icon-danger"
|
|
226
241
|
},
|
|
227
242
|
"&[data-hovered]": {
|
|
228
|
-
|
|
243
|
+
borderColor: "$border-danger-hover",
|
|
244
|
+
backgroundColor: "$background-danger-subtle-hover",
|
|
229
245
|
[iconSlotSelector]: {
|
|
230
246
|
color: "$icon-danger-hover"
|
|
231
247
|
}
|
|
232
248
|
},
|
|
233
249
|
"&[data-pressed]": {
|
|
234
|
-
|
|
250
|
+
borderColor: "$border-danger-active",
|
|
251
|
+
backgroundColor: "$background-danger-subtle-active",
|
|
235
252
|
[iconSlotSelector]: {
|
|
236
253
|
color: "$icon-danger-active"
|
|
237
254
|
}
|
|
@@ -312,123 +329,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
312
329
|
width: "100%"
|
|
313
330
|
}
|
|
314
331
|
}
|
|
315
|
-
}
|
|
316
|
-
compoundVariants: [
|
|
317
|
-
{
|
|
318
|
-
variant: "primary",
|
|
319
|
-
v1: false,
|
|
320
|
-
css: {
|
|
321
|
-
color: "$text-primary-inverted",
|
|
322
|
-
"&[data-pressed]": {
|
|
323
|
-
backgroundColor: "$background-primary-prominent-active"
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
variant: "primary",
|
|
329
|
-
v1: true,
|
|
330
|
-
css: {
|
|
331
|
-
color: "$text-neutrals-inverted",
|
|
332
|
-
"&[data-pressed]": {
|
|
333
|
-
backgroundColor: "$background-primary-prominent-pressed"
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
variant: "tertiary",
|
|
339
|
-
v1: false,
|
|
340
|
-
css: {
|
|
341
|
-
backgroundColor: "$background-neutrals"
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
variant: "tertiary",
|
|
346
|
-
v1: true,
|
|
347
|
-
css: {
|
|
348
|
-
border: "1.5px solid $border-primary"
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
variant: "secondary",
|
|
353
|
-
v1: false,
|
|
354
|
-
css: {
|
|
355
|
-
backgroundColor: "$background-neutrals-subtle",
|
|
356
|
-
"&[data-hovered]": {
|
|
357
|
-
backgroundColor: "$background-neutrals-subtle-hover"
|
|
358
|
-
},
|
|
359
|
-
"&[data-pressed]": {
|
|
360
|
-
backgroundColor: "$background-neutrals-subtle-active"
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
variant: "secondary",
|
|
366
|
-
v1: true,
|
|
367
|
-
css: {
|
|
368
|
-
backgroundColor: "$button-background-secondary",
|
|
369
|
-
"&[data-hovered]": {
|
|
370
|
-
color: "$text-neutrals-hover",
|
|
371
|
-
backgroundColor: "$button-background-secondary-hover"
|
|
372
|
-
},
|
|
373
|
-
"&[data-pressed]": {
|
|
374
|
-
color: "$text-neutrals-active",
|
|
375
|
-
backgroundColor: "$button-background-secondary-pressed"
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
variant: "danger-secondary",
|
|
381
|
-
v1: false,
|
|
382
|
-
css: {
|
|
383
|
-
"&[data-hovered]": {
|
|
384
|
-
backgroundColor: "$background-danger-subtle"
|
|
385
|
-
},
|
|
386
|
-
"&[data-pressed]": {
|
|
387
|
-
backgroundColor: "$background-danger-subtle-hover"
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
variant: "danger-secondary",
|
|
393
|
-
v1: true,
|
|
394
|
-
css: {
|
|
395
|
-
"&[data-hovered]": {
|
|
396
|
-
borderColor: "$border-danger-hover",
|
|
397
|
-
backgroundColor: "$background-danger-subtle-hover"
|
|
398
|
-
},
|
|
399
|
-
"&[data-pressed]": {
|
|
400
|
-
borderColor: "$border-danger-active",
|
|
401
|
-
backgroundColor: "$background-danger-subtle-active"
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
variant: "ghost",
|
|
407
|
-
v1: false,
|
|
408
|
-
css: {
|
|
409
|
-
"&[data-hovered]": {
|
|
410
|
-
backgroundColor: "$background-neutrals-subtle-hover"
|
|
411
|
-
},
|
|
412
|
-
"&[data-pressed]": {
|
|
413
|
-
backgroundColor: "$background-neutrals-subtle-active"
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
variant: "ghost",
|
|
419
|
-
v1: true,
|
|
420
|
-
css: {
|
|
421
|
-
"&[data-hovered]": {
|
|
422
|
-
backgroundColor: "$button-background-secondary-hover",
|
|
423
|
-
color: "$text-neutrals-hover"
|
|
424
|
-
},
|
|
425
|
-
"&[data-pressed]": {
|
|
426
|
-
backgroundColor: "$button-background-secondary-pressed",
|
|
427
|
-
color: "$text-neutrals-pressed"
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
]
|
|
332
|
+
}
|
|
432
333
|
});
|
|
433
334
|
const StyledHiddenContent = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
434
335
|
visibility: "hidden"
|
|
@@ -461,7 +362,6 @@ const Button = React__default["default"].forwardRef(
|
|
|
461
362
|
...restProps
|
|
462
363
|
}, forwardRef) => {
|
|
463
364
|
let spinnerSize = "medium";
|
|
464
|
-
const [v1] = designSystemExperiments.useNewDesignLanguage();
|
|
465
365
|
if (typeof size === "string" && ["small", "medium"].includes(size)) {
|
|
466
366
|
spinnerSize = "small";
|
|
467
367
|
}
|
|
@@ -490,7 +390,6 @@ const Button = React__default["default"].forwardRef(
|
|
|
490
390
|
StyledButton,
|
|
491
391
|
{
|
|
492
392
|
...restProps,
|
|
493
|
-
v1,
|
|
494
393
|
asChild,
|
|
495
394
|
variant,
|
|
496
395
|
rounded,
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 [`& ${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 ...focus.css({\n boxShadow: '$focus-keyboard',\n }),\n\n variants: {\n v1: {\n false: {},\n true: {\n fontWeight: '$semibold',\n },\n },\n variant: {\n primary: {\n backgroundColor: '$background-primary-prominent',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n\n ...solidDisabled,\n },\n tertiary: {\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-prominent': {\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 secondary: {\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n ...solidDisabled,\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 '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n ghost: {\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\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 color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\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 compoundVariants: [\n {\n variant: 'primary',\n v1: false,\n css: {\n color: '$text-primary-inverted',\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-active',\n },\n },\n },\n {\n variant: 'primary',\n v1: true,\n css: {\n color: '$text-neutrals-inverted',\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-pressed',\n },\n },\n },\n {\n variant: 'tertiary',\n v1: false,\n css: {\n backgroundColor: '$background-neutrals',\n },\n },\n {\n variant: 'tertiary',\n v1: true,\n css: {\n border: '1.5px solid $border-primary',\n },\n },\n {\n variant: 'secondary',\n v1: false,\n css: {\n backgroundColor: '$background-neutrals-subtle',\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n },\n },\n {\n variant: 'secondary',\n v1: true,\n css: {\n backgroundColor: '$button-background-secondary',\n '&[data-hovered]': {\n color: '$text-neutrals-hover',\n backgroundColor: '$button-background-secondary-hover',\n },\n '&[data-pressed]': {\n color: '$text-neutrals-active',\n backgroundColor: '$button-background-secondary-pressed',\n },\n },\n },\n {\n variant: 'danger-secondary',\n v1: false,\n css: {\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n },\n },\n },\n {\n variant: 'danger-secondary',\n v1: true,\n css: {\n '&[data-hovered]': {\n borderColor: '$border-danger-hover',\n backgroundColor: '$background-danger-subtle-hover',\n },\n '&[data-pressed]': {\n borderColor: '$border-danger-active',\n backgroundColor: '$background-danger-subtle-active',\n },\n },\n },\n {\n variant: 'ghost',\n v1: false,\n css: {\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n },\n },\n {\n variant: 'ghost',\n v1: true,\n css: {\n '&[data-hovered]': {\n backgroundColor: '$button-background-secondary-hover',\n color: '$text-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-secondary-pressed',\n color: '$text-neutrals-pressed',\n },\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'\nimport { useNewDesignLanguage } from '@mirohq/design-system-experiments'\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 const [v1] = useNewDesignLanguage()\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 v1={v1}\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","useNewDesignLanguage","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,SAAA;AAAA,KACL;AAAA,IAEC,QAAA;AAAA,GAAA;AACH,CAAA,CAAA;AAGW,MAAA,gBAAA,GAAmB,MAC9BC,gBAAA,CAAW,aAAa,CAAA;;ACbnB,MAAM,cAAiB,GAAAC,2BAAA,CAAOC,+BAAU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BAAqB,QAAoB,EAAA,mBAAA,EAAA,CAAA;AAAA,WAC5C,EAAA,CAAA;AAAA,SAEH,CAAA,CAAA;AAAA,OACI,MAAA;AACL,QAAA,iBAAA,mBAEIa,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAAd,cAAA,CAAC,oBAAiB,aAAa,EAAA,aAAA,EAC7B,yCAACe,2BAAQ,EAAA,EAAA,IAAA,EAAM,aAAa,CAC9B,EAAA,CAAA;AAAA,0BACAf,cAAA,CAAC,uBAAqB,QAAS,EAAA,CAAA;AAAA,SACjC,EAAA,CAAA,CAAA;AAAA,OAEJ;AAAA,KACF;AAEA,IACE,uBAAAA,cAAA,CAAC,kBAAe,IACd,EAAA,QAAA,kBAAAA,cAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAA;AAAA,QACJ,EAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,IAAA;AAAA,QAEA,eAAA,EAAe,yBAAyB,IAAO,GAAA,KAAA,CAAA;AAAA,QAC/C,GAAK,EAAA,UAAA;AAAA,QAEJ,QAAA,EAAA,iBAAA;AAAA,OAAA;AAAA,KAEL,EAAA,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'\n\nimport type { StyledButtonProps } from '../button.styled'\n\ninterface ButtonProps {\n size?: StyledButtonProps['size']\n}\n\ninterface ButtonContextProps extends ButtonProps {}\n\nexport interface ButtonProviderProps extends ButtonProps {\n children: React.ReactNode\n}\n\nconst ButtonContext = createContext<ButtonContextProps>({} as any)\n\nexport const ButtonProvider = ({\n children,\n ...restProps\n}: 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 fontWeight: '$semibold',\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 [`& ${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 ...focus.css({\n boxShadow: '$focus',\n }),\n\n variants: {\n variant: {\n primary: {\n backgroundColor: '$background-primary-prominent',\n color: '$text-neutrals-inverted',\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n\n ...solidDisabled,\n },\n tertiary: {\n color: '$text-primary',\n border: '1.5px solid $border-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-prominent': {\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 secondary: {\n color: '$text-neutrals',\n backgroundColor: '$button-background-secondary',\n '&[data-hovered]': {\n color: '$text-neutrals-hover',\n backgroundColor: '$button-background-secondary-hover',\n },\n '&[data-pressed]': {\n color: '$text-neutrals-active',\n backgroundColor: '$button-background-secondary-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n ...solidDisabled,\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 '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n ghost: {\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-secondary-hover',\n color: '$text-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-secondary-pressed',\n color: '$text-neutrals-pressed',\n },\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 borderColor: '$border-danger-hover',\n backgroundColor: '$background-danger-subtle-hover',\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n borderColor: '$border-danger-active',\n backgroundColor: '$background-danger-subtle-active',\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":";;;;;;;;;;;;;;;;;;AAcA,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,SAAA;AAAA,KACL;AAAA,IAEC,QAAA;AAAA,GAAA;AACH,CAAA,CAAA;AAGW,MAAA,gBAAA,GAAmB,MAC9BC,gBAAA,CAAW,aAAa,CAAA;;ACdnB,MAAM,cAAiB,GAAAC,2BAAA,CAAOC,+BAAU,CAAA,GAAA,EAAK,EAAE,CAAA,CAAA;AAKtD,MAAM,eAAsD,GAAA;AAAA,EAC1D,KAAO,EAAA,OAAA;AAAA,EACP,MAAQ,EAAA,OAAA;AAAA,EACR,KAAO,EAAA,QAAA;AAAA,EACP,SAAW,EAAA,QAAA;AACb,CAAA,CAAA;AAEA,MAAM,iBAA0D,GAAA;AAAA,EAC9D,KAAO,EAAA,MAAA;AAAA,EACP,MAAQ,EAAA,MAAA;AAAA,EACR,KAAO,EAAA,QAAA;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A,EAAM,aAAa,CAC9B,EAAA,CAAA;AAAA,4BACAd,cAAA,CAAC,uBAAqB,QAAoB,EAAA,mBAAA,EAAA,CAAA;AAAA,WAC5C,EAAA,CAAA;AAAA,SAEH,CAAA,CAAA;AAAA,OACI,MAAA;AACL,QAAA,iBAAA,mBAEIY,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAAb,cAAA,CAAC,oBAAiB,aAAa,EAAA,aAAA,EAC7B,yCAACc,2BAAQ,EAAA,EAAA,IAAA,EAAM,aAAa,CAC9B,EAAA,CAAA;AAAA,0BACAd,cAAA,CAAC,uBAAqB,QAAS,EAAA,CAAA;AAAA,SACjC,EAAA,CAAA,CAAA;AAAA,OAEJ;AAAA,KACF;AAEA,IACE,uBAAAA,cAAA,CAAC,kBAAe,IACd,EAAA,QAAA,kBAAAA,cAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAA;AAAA,QACJ,OAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,IAAA;AAAA,QAEA,eAAA,EAAe,yBAAyB,IAAO,GAAA,KAAA,CAAA;AAAA,QAC/C,GAAK,EAAA,UAAA;AAAA,QAEJ,QAAA,EAAA,iBAAA;AAAA,OAAA;AAAA,KAEL,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,EAAA;AAUA,MAAA,CAAO,QAAW,GAAA,QAAA,CAAA;AAClB,MAAA,CAAO,KAAQ,GAAA,KAAA;;;;"}
|
package/dist/module.js
CHANGED
|
@@ -2,7 +2,6 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Spinner } from '@mirohq/design-system-spinner';
|
|
3
3
|
import { addPropsToChildren, booleanify } from '@mirohq/design-system-utils';
|
|
4
4
|
import React, { createContext, useContext } from 'react';
|
|
5
|
-
import { useNewDesignLanguage } from '@mirohq/design-system-experiments';
|
|
6
5
|
import { BaseButton, sizes } from '@mirohq/design-system-base-button';
|
|
7
6
|
import { isIconComponent, styles } from '@mirohq/design-system-base-icon';
|
|
8
7
|
import { Primitive } from '@mirohq/design-system-primitive';
|
|
@@ -87,6 +86,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
87
86
|
whiteSpace: "nowrap",
|
|
88
87
|
textOverflow: "ellipsis",
|
|
89
88
|
textAlign: "center",
|
|
89
|
+
fontWeight: "$semibold",
|
|
90
90
|
position: "relative",
|
|
91
91
|
width: "fit-content",
|
|
92
92
|
maxWidth: "100%",
|
|
@@ -102,18 +102,16 @@ const StyledButton = styled(BaseButton, {
|
|
|
102
102
|
marginLeft: "calc($50 + ".concat(LABEL_OFFSET, "px)")
|
|
103
103
|
},
|
|
104
104
|
...focus.css({
|
|
105
|
-
boxShadow: "$focus
|
|
105
|
+
boxShadow: "$focus"
|
|
106
106
|
}),
|
|
107
107
|
variants: {
|
|
108
|
-
v1: {
|
|
109
|
-
false: {},
|
|
110
|
-
true: {
|
|
111
|
-
fontWeight: "$semibold"
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
108
|
variant: {
|
|
115
109
|
primary: {
|
|
116
110
|
backgroundColor: "$background-primary-prominent",
|
|
111
|
+
color: "$text-neutrals-inverted",
|
|
112
|
+
"&[data-pressed]": {
|
|
113
|
+
backgroundColor: "$background-primary-prominent-pressed"
|
|
114
|
+
},
|
|
117
115
|
[iconSlotSelector]: {
|
|
118
116
|
color: "$icon-primary-inverted"
|
|
119
117
|
},
|
|
@@ -123,8 +121,8 @@ const StyledButton = styled(BaseButton, {
|
|
|
123
121
|
...solidDisabled
|
|
124
122
|
},
|
|
125
123
|
tertiary: {
|
|
126
|
-
borderColor: "$border-primary",
|
|
127
124
|
color: "$text-primary",
|
|
125
|
+
border: "1.5px solid $border-primary",
|
|
128
126
|
[iconSlotSelector]: {
|
|
129
127
|
color: "$icon-primary"
|
|
130
128
|
},
|
|
@@ -167,6 +165,15 @@ const StyledButton = styled(BaseButton, {
|
|
|
167
165
|
},
|
|
168
166
|
secondary: {
|
|
169
167
|
color: "$text-neutrals",
|
|
168
|
+
backgroundColor: "$button-background-secondary",
|
|
169
|
+
"&[data-hovered]": {
|
|
170
|
+
color: "$text-neutrals-hover",
|
|
171
|
+
backgroundColor: "$button-background-secondary-hover"
|
|
172
|
+
},
|
|
173
|
+
"&[data-pressed]": {
|
|
174
|
+
color: "$text-neutrals-active",
|
|
175
|
+
backgroundColor: "$button-background-secondary-pressed"
|
|
176
|
+
},
|
|
170
177
|
[iconSlotSelector]: {
|
|
171
178
|
color: "$icon-neutrals"
|
|
172
179
|
},
|
|
@@ -194,6 +201,14 @@ const StyledButton = styled(BaseButton, {
|
|
|
194
201
|
[iconSlotSelector]: {
|
|
195
202
|
color: "$icon-neutrals"
|
|
196
203
|
},
|
|
204
|
+
"&[data-hovered]": {
|
|
205
|
+
backgroundColor: "$button-background-secondary-hover",
|
|
206
|
+
color: "$text-neutrals-hover"
|
|
207
|
+
},
|
|
208
|
+
"&[data-pressed]": {
|
|
209
|
+
backgroundColor: "$button-background-secondary-pressed",
|
|
210
|
+
color: "$text-neutrals-pressed"
|
|
211
|
+
},
|
|
197
212
|
...ghostDisabled
|
|
198
213
|
},
|
|
199
214
|
danger: {
|
|
@@ -217,13 +232,15 @@ const StyledButton = styled(BaseButton, {
|
|
|
217
232
|
color: "$icon-danger"
|
|
218
233
|
},
|
|
219
234
|
"&[data-hovered]": {
|
|
220
|
-
|
|
235
|
+
borderColor: "$border-danger-hover",
|
|
236
|
+
backgroundColor: "$background-danger-subtle-hover",
|
|
221
237
|
[iconSlotSelector]: {
|
|
222
238
|
color: "$icon-danger-hover"
|
|
223
239
|
}
|
|
224
240
|
},
|
|
225
241
|
"&[data-pressed]": {
|
|
226
|
-
|
|
242
|
+
borderColor: "$border-danger-active",
|
|
243
|
+
backgroundColor: "$background-danger-subtle-active",
|
|
227
244
|
[iconSlotSelector]: {
|
|
228
245
|
color: "$icon-danger-active"
|
|
229
246
|
}
|
|
@@ -304,123 +321,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
304
321
|
width: "100%"
|
|
305
322
|
}
|
|
306
323
|
}
|
|
307
|
-
}
|
|
308
|
-
compoundVariants: [
|
|
309
|
-
{
|
|
310
|
-
variant: "primary",
|
|
311
|
-
v1: false,
|
|
312
|
-
css: {
|
|
313
|
-
color: "$text-primary-inverted",
|
|
314
|
-
"&[data-pressed]": {
|
|
315
|
-
backgroundColor: "$background-primary-prominent-active"
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
variant: "primary",
|
|
321
|
-
v1: true,
|
|
322
|
-
css: {
|
|
323
|
-
color: "$text-neutrals-inverted",
|
|
324
|
-
"&[data-pressed]": {
|
|
325
|
-
backgroundColor: "$background-primary-prominent-pressed"
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
variant: "tertiary",
|
|
331
|
-
v1: false,
|
|
332
|
-
css: {
|
|
333
|
-
backgroundColor: "$background-neutrals"
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
variant: "tertiary",
|
|
338
|
-
v1: true,
|
|
339
|
-
css: {
|
|
340
|
-
border: "1.5px solid $border-primary"
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
variant: "secondary",
|
|
345
|
-
v1: false,
|
|
346
|
-
css: {
|
|
347
|
-
backgroundColor: "$background-neutrals-subtle",
|
|
348
|
-
"&[data-hovered]": {
|
|
349
|
-
backgroundColor: "$background-neutrals-subtle-hover"
|
|
350
|
-
},
|
|
351
|
-
"&[data-pressed]": {
|
|
352
|
-
backgroundColor: "$background-neutrals-subtle-active"
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
variant: "secondary",
|
|
358
|
-
v1: true,
|
|
359
|
-
css: {
|
|
360
|
-
backgroundColor: "$button-background-secondary",
|
|
361
|
-
"&[data-hovered]": {
|
|
362
|
-
color: "$text-neutrals-hover",
|
|
363
|
-
backgroundColor: "$button-background-secondary-hover"
|
|
364
|
-
},
|
|
365
|
-
"&[data-pressed]": {
|
|
366
|
-
color: "$text-neutrals-active",
|
|
367
|
-
backgroundColor: "$button-background-secondary-pressed"
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
variant: "danger-secondary",
|
|
373
|
-
v1: false,
|
|
374
|
-
css: {
|
|
375
|
-
"&[data-hovered]": {
|
|
376
|
-
backgroundColor: "$background-danger-subtle"
|
|
377
|
-
},
|
|
378
|
-
"&[data-pressed]": {
|
|
379
|
-
backgroundColor: "$background-danger-subtle-hover"
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
variant: "danger-secondary",
|
|
385
|
-
v1: true,
|
|
386
|
-
css: {
|
|
387
|
-
"&[data-hovered]": {
|
|
388
|
-
borderColor: "$border-danger-hover",
|
|
389
|
-
backgroundColor: "$background-danger-subtle-hover"
|
|
390
|
-
},
|
|
391
|
-
"&[data-pressed]": {
|
|
392
|
-
borderColor: "$border-danger-active",
|
|
393
|
-
backgroundColor: "$background-danger-subtle-active"
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
variant: "ghost",
|
|
399
|
-
v1: false,
|
|
400
|
-
css: {
|
|
401
|
-
"&[data-hovered]": {
|
|
402
|
-
backgroundColor: "$background-neutrals-subtle-hover"
|
|
403
|
-
},
|
|
404
|
-
"&[data-pressed]": {
|
|
405
|
-
backgroundColor: "$background-neutrals-subtle-active"
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
variant: "ghost",
|
|
411
|
-
v1: true,
|
|
412
|
-
css: {
|
|
413
|
-
"&[data-hovered]": {
|
|
414
|
-
backgroundColor: "$button-background-secondary-hover",
|
|
415
|
-
color: "$text-neutrals-hover"
|
|
416
|
-
},
|
|
417
|
-
"&[data-pressed]": {
|
|
418
|
-
backgroundColor: "$button-background-secondary-pressed",
|
|
419
|
-
color: "$text-neutrals-pressed"
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
]
|
|
324
|
+
}
|
|
424
325
|
});
|
|
425
326
|
const StyledHiddenContent = styled(Primitive.span, {
|
|
426
327
|
visibility: "hidden"
|
|
@@ -453,7 +354,6 @@ const Button = React.forwardRef(
|
|
|
453
354
|
...restProps
|
|
454
355
|
}, forwardRef) => {
|
|
455
356
|
let spinnerSize = "medium";
|
|
456
|
-
const [v1] = useNewDesignLanguage();
|
|
457
357
|
if (typeof size === "string" && ["small", "medium"].includes(size)) {
|
|
458
358
|
spinnerSize = "small";
|
|
459
359
|
}
|
|
@@ -482,7 +382,6 @@ const Button = React.forwardRef(
|
|
|
482
382
|
StyledButton,
|
|
483
383
|
{
|
|
484
384
|
...restProps,
|
|
485
|
-
v1,
|
|
486
385
|
asChild,
|
|
487
386
|
variant,
|
|
488
387
|
rounded,
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.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 [`& ${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 ...focus.css({\n boxShadow: '$focus-keyboard',\n }),\n\n variants: {\n v1: {\n false: {},\n true: {\n fontWeight: '$semibold',\n },\n },\n variant: {\n primary: {\n backgroundColor: '$background-primary-prominent',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n\n ...solidDisabled,\n },\n tertiary: {\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-prominent': {\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 secondary: {\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n ...solidDisabled,\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 '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n ghost: {\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\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 color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\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 compoundVariants: [\n {\n variant: 'primary',\n v1: false,\n css: {\n color: '$text-primary-inverted',\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-active',\n },\n },\n },\n {\n variant: 'primary',\n v1: true,\n css: {\n color: '$text-neutrals-inverted',\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-pressed',\n },\n },\n },\n {\n variant: 'tertiary',\n v1: false,\n css: {\n backgroundColor: '$background-neutrals',\n },\n },\n {\n variant: 'tertiary',\n v1: true,\n css: {\n border: '1.5px solid $border-primary',\n },\n },\n {\n variant: 'secondary',\n v1: false,\n css: {\n backgroundColor: '$background-neutrals-subtle',\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n },\n },\n {\n variant: 'secondary',\n v1: true,\n css: {\n backgroundColor: '$button-background-secondary',\n '&[data-hovered]': {\n color: '$text-neutrals-hover',\n backgroundColor: '$button-background-secondary-hover',\n },\n '&[data-pressed]': {\n color: '$text-neutrals-active',\n backgroundColor: '$button-background-secondary-pressed',\n },\n },\n },\n {\n variant: 'danger-secondary',\n v1: false,\n css: {\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n },\n },\n },\n {\n variant: 'danger-secondary',\n v1: true,\n css: {\n '&[data-hovered]': {\n borderColor: '$border-danger-hover',\n backgroundColor: '$background-danger-subtle-hover',\n },\n '&[data-pressed]': {\n borderColor: '$border-danger-active',\n backgroundColor: '$background-danger-subtle-active',\n },\n },\n },\n {\n variant: 'ghost',\n v1: false,\n css: {\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n },\n },\n {\n variant: 'ghost',\n v1: true,\n css: {\n '&[data-hovered]': {\n backgroundColor: '$button-background-secondary-hover',\n color: '$text-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-secondary-pressed',\n color: '$text-neutrals-pressed',\n },\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'\nimport { useNewDesignLanguage } from '@mirohq/design-system-experiments'\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 const [v1] = useNewDesignLanguage()\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 v1={v1}\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":["baseIconStyles"],"mapp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GAAA,KAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"module.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'\n\nimport type { StyledButtonProps } from '../button.styled'\n\ninterface ButtonProps {\n size?: StyledButtonProps['size']\n}\n\ninterface ButtonContextProps extends ButtonProps {}\n\nexport interface ButtonProviderProps extends ButtonProps {\n children: React.ReactNode\n}\n\nconst ButtonContext = createContext<ButtonContextProps>({} as any)\n\nexport const ButtonProvider = ({\n children,\n ...restProps\n}: 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 fontWeight: '$semibold',\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 [`& ${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 ...focus.css({\n boxShadow: '$focus',\n }),\n\n variants: {\n variant: {\n primary: {\n backgroundColor: '$background-primary-prominent',\n color: '$text-neutrals-inverted',\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n\n ...solidDisabled,\n },\n tertiary: {\n color: '$text-primary',\n border: '1.5px solid $border-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-prominent': {\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 secondary: {\n color: '$text-neutrals',\n backgroundColor: '$button-background-secondary',\n '&[data-hovered]': {\n color: '$text-neutrals-hover',\n backgroundColor: '$button-background-secondary-hover',\n },\n '&[data-pressed]': {\n color: '$text-neutrals-active',\n backgroundColor: '$button-background-secondary-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n ...solidDisabled,\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 '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n ghost: {\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-secondary-hover',\n color: '$text-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-secondary-pressed',\n color: '$text-neutrals-pressed',\n },\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 borderColor: '$border-danger-hover',\n backgroundColor: '$background-danger-subtle-hover',\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n borderColor: '$border-danger-active',\n backgroundColor: '$background-danger-subtle-active',\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":["baseIconStyles"],"mappings":";;;;;;;;;;AAcA,MAAM,aAAA,GAAgB,aAAkC,CAAA,EAAS,CAAA,CAAA;AAE1D,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,GAAG,SAAA;AACL,CACE,qBAAA,GAAA;AAAA,EAAC,aAAc,CAAA,QAAA;AAAA,EAAd;AAAA,IACC,KAAO,EAAA;AAAA,MACL,GAAG,SAAA;AAAA,KACL;AAAA,IAEC,QAAA;AAAA,GAAA;AACH,CAAA,CAAA;AAGW,MAAA,gBAAA,GAAmB,MAC9B,UAAA,CAAW,aAAa,CAAA;;ACdnB,MAAM,cAAiB,GAAA,MAAA,CAAO,SAAU,CAAA,GAAA,EAAK,EAAE,CAAA,CAAA;AAKtD,MAAM,eAAsD,GAAA;AAAA,EAC1D,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from 'react';
|
|
3
|
-
import react__default, { ComponentPropsWithRef } from 'react';
|
|
3
|
+
import react__default, { ComponentPropsWithRef, ForwardRefExoticComponent } from 'react';
|
|
4
4
|
import * as packages_components_internal_base_button_src_base_button from 'packages/components/internal/base-button/src/base-button';
|
|
5
5
|
import * as _mirohq_design_system_hooks_use_press from '@mirohq/design-system-hooks/use-press';
|
|
6
6
|
import * as _stitches_react_types_styled_component from '@stitches/react/types/styled-component';
|
|
7
7
|
import * as _mirohq_design_system_stitches from '@mirohq/design-system-stitches';
|
|
8
8
|
import * as _mirohq_design_system_primitive from '@mirohq/design-system-primitive';
|
|
9
9
|
|
|
10
|
-
declare const StyledButton: react.ForwardRefExoticComponent<(Omit<Omit<Omit<Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
10
|
+
declare const StyledButton: react.ForwardRefExoticComponent<(Omit<Omit<Omit<Omit<Omit<Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
11
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
|
12
|
+
} & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents, "ref"> & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>, "ref"> & {
|
|
13
|
+
ref?: ((instance: HTMLAnchorElement | HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLAnchorElement | HTMLButtonElement> | null | undefined;
|
|
14
|
+
}, _mirohq_design_system_stitches.ForbiddenProps> & {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}, "size" | "variant" | "rounded" | "fluid"> & _stitches_react_types_styled_component.TransformProps<{
|
|
14
17
|
variant?: "primary" | "tertiary" | "ghost-prominent" | "secondary" | "outline-subtle" | "ghost" | "danger" | "danger-secondary" | "ghost-danger" | undefined;
|
|
15
18
|
size?: "small" | "medium" | "large" | "x-large" | undefined;
|
|
16
19
|
rounded?: boolean | "true" | undefined;
|
|
17
20
|
fluid?: boolean | "true" | undefined;
|
|
18
|
-
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> | Omit<Omit<Omit<Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement
|
|
21
|
+
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> | Omit<Omit<Omit<Omit<Omit<Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
22
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
|
23
|
+
} & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents & react.AnchorHTMLAttributes<"a"> & {
|
|
19
24
|
href: string;
|
|
20
|
-
}, "ref"> & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>,
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
25
|
+
}, "ref"> & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>, "ref"> & {
|
|
26
|
+
ref?: ((instance: HTMLAnchorElement | HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLAnchorElement | HTMLButtonElement> | null | undefined;
|
|
27
|
+
}, _mirohq_design_system_stitches.ForbiddenProps> & {
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}, "size" | "variant" | "rounded" | "fluid"> & _stitches_react_types_styled_component.TransformProps<{
|
|
24
30
|
variant?: "primary" | "tertiary" | "ghost-prominent" | "secondary" | "outline-subtle" | "ghost" | "danger" | "danger-secondary" | "ghost-danger" | undefined;
|
|
25
31
|
size?: "small" | "medium" | "large" | "x-large" | undefined;
|
|
26
32
|
rounded?: boolean | "true" | undefined;
|
|
27
33
|
fluid?: boolean | "true" | undefined;
|
|
28
|
-
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<(Omit<Omit<Omit<
|
|
34
|
+
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<(Omit<Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
35
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
|
36
|
+
} & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents, "ref"> | Omit<Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
37
|
+
ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
|
|
38
|
+
} & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents & react.AnchorHTMLAttributes<"a"> & {
|
|
29
39
|
href: string;
|
|
30
40
|
}, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>, {
|
|
31
|
-
v1?: boolean | "false" | "true" | undefined;
|
|
32
41
|
variant?: "primary" | "tertiary" | "ghost-prominent" | "secondary" | "outline-subtle" | "ghost" | "danger" | "danger-secondary" | "ghost-danger" | undefined;
|
|
33
42
|
size?: "small" | "medium" | "large" | "x-large" | undefined;
|
|
34
43
|
rounded?: boolean | "true" | undefined;
|
|
35
44
|
fluid?: boolean | "true" | undefined;
|
|
36
45
|
}, {}>;
|
|
37
|
-
|
|
46
|
+
type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>;
|
|
38
47
|
|
|
39
48
|
declare const StyledIconSlot: react__default.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react__default.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"div">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react__default.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react__default.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"div">>, {}, {}>;
|
|
40
|
-
|
|
49
|
+
type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>;
|
|
41
50
|
interface IconSlotProps extends StyledIconSlotProps {
|
|
42
51
|
/**
|
|
43
52
|
* The icon.
|
|
@@ -48,7 +57,7 @@ declare const IconSlot: react__default.ForwardRefExoticComponent<Omit<IconSlotPr
|
|
|
48
57
|
|
|
49
58
|
declare const Label: react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>;
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
type ButtonProps = {
|
|
52
61
|
/**
|
|
53
62
|
* Change the button style.
|
|
54
63
|
* @default 'primary'
|
|
@@ -75,7 +84,7 @@ declare type ButtonProps = {
|
|
|
75
84
|
*/
|
|
76
85
|
fluid?: StyledButtonProps['fluid'];
|
|
77
86
|
} & BaseButtonProps;
|
|
78
|
-
declare const Button:
|
|
87
|
+
declare const Button: ForwardRefExoticComponent<ButtonProps> & Partials;
|
|
79
88
|
interface Partials {
|
|
80
89
|
IconSlot: typeof IconSlot;
|
|
81
90
|
Label: typeof Label;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-button",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-pdl-removing-ffs.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -26,15 +26,14 @@
|
|
|
26
26
|
"react": "^16.14 || ^17 || ^18"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@mirohq/design-system-base-
|
|
30
|
-
"@mirohq/design-system-
|
|
31
|
-
"@mirohq/design-system-
|
|
32
|
-
"@mirohq/design-system-spinner": "^
|
|
33
|
-
"@mirohq/design-system-
|
|
34
|
-
"@mirohq/design-system-
|
|
35
|
-
"@mirohq/design-system-
|
|
36
|
-
"@mirohq/design-system-
|
|
37
|
-
"@mirohq/design-system-stitches": "^2.6.31-new-focus-keyboard.1"
|
|
29
|
+
"@mirohq/design-system-base-button": "^1.0.0-pdl-removing-ffs.0",
|
|
30
|
+
"@mirohq/design-system-base-icon": "^1.0.0-pdl-removing-ffs.0",
|
|
31
|
+
"@mirohq/design-system-primitive": "^2.0.0-pdl-removing-ffs.0",
|
|
32
|
+
"@mirohq/design-system-spinner": "^2.0.0-pdl-removing-ffs.0",
|
|
33
|
+
"@mirohq/design-system-stitches": "^3.0.0-pdl-removing-ffs.0",
|
|
34
|
+
"@mirohq/design-system-styles": "^2.0.0-pdl-removing-ffs.0",
|
|
35
|
+
"@mirohq/design-system-types": "^1.0.0-pdl-removing-ffs.0",
|
|
36
|
+
"@mirohq/design-system-utils": "^1.0.0-pdl-removing-ffs.0"
|
|
38
37
|
},
|
|
39
38
|
"scripts": {
|
|
40
39
|
"build": "rollup -c ../../../rollup.config.js",
|