@mirohq/design-system-button 3.1.11 → 3.1.13
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 +10 -9
- package/dist/main.js.map +1 -1
- package/dist/module.js +10 -9
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +63 -0
- package/package.json +8 -8
package/dist/main.js
CHANGED
|
@@ -20,6 +20,7 @@ const StyledIconSlot = designSystemStitches.styled(designSystemPrimitive.Primiti
|
|
|
20
20
|
const IconSlot = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledIconSlot, { ...restProps, ref: forwardRef, "aria-hidden": true, asChild: true, children }));
|
|
21
21
|
|
|
22
22
|
const activeSelector = "&:active, &[data-pressed]";
|
|
23
|
+
const hoverSelector = "&:hover, &[data-hovered]";
|
|
23
24
|
const disabledSelector = '&[disabled], &[aria-disabled="true"]';
|
|
24
25
|
const iconSlotSelector = "& ".concat(StyledIconSlot);
|
|
25
26
|
const externalIconSelector = "& svg:not([data-icon-component]), & img:not([data-icon-component])";
|
|
@@ -82,7 +83,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
82
83
|
[iconSlotSelector]: {
|
|
83
84
|
color: "$icon-primary-inverted"
|
|
84
85
|
},
|
|
85
|
-
|
|
86
|
+
[hoverSelector]: {
|
|
86
87
|
backgroundColor: "$background-primary-prominent-hover"
|
|
87
88
|
},
|
|
88
89
|
[activeSelector]: {
|
|
@@ -97,7 +98,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
97
98
|
[iconSlotSelector]: {
|
|
98
99
|
color: "$icon-primary"
|
|
99
100
|
},
|
|
100
|
-
|
|
101
|
+
[hoverSelector]: {
|
|
101
102
|
backgroundColor: "$background-primary-subtle-hover",
|
|
102
103
|
borderColor: "$border-primary-hover",
|
|
103
104
|
color: "$text-primary-hover",
|
|
@@ -118,7 +119,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
118
119
|
"ghost-prominent": {
|
|
119
120
|
backgroundColor: "transparent",
|
|
120
121
|
color: "$text-primary",
|
|
121
|
-
|
|
122
|
+
[hoverSelector]: {
|
|
122
123
|
backgroundColor: "$background-primary-subtle-hover",
|
|
123
124
|
color: "$text-primary-hover",
|
|
124
125
|
[iconSlotSelector]: {
|
|
@@ -140,7 +141,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
140
141
|
[iconSlotSelector]: {
|
|
141
142
|
color: "$icon-neutrals"
|
|
142
143
|
},
|
|
143
|
-
|
|
144
|
+
[hoverSelector]: {
|
|
144
145
|
backgroundColor: "$background-neutrals-subtle-hover"
|
|
145
146
|
},
|
|
146
147
|
[activeSelector]: {
|
|
@@ -155,7 +156,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
155
156
|
[iconSlotSelector]: {
|
|
156
157
|
color: "$icon-neutrals"
|
|
157
158
|
},
|
|
158
|
-
|
|
159
|
+
[hoverSelector]: {
|
|
159
160
|
backgroundColor: "$background-neutrals-subtle-hover",
|
|
160
161
|
borderColor: "$border-neutrals-hover"
|
|
161
162
|
},
|
|
@@ -171,7 +172,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
171
172
|
[iconSlotSelector]: {
|
|
172
173
|
color: "$icon-neutrals"
|
|
173
174
|
},
|
|
174
|
-
|
|
175
|
+
[hoverSelector]: {
|
|
175
176
|
backgroundColor: "$background-neutrals-subtle-hover"
|
|
176
177
|
},
|
|
177
178
|
[activeSelector]: {
|
|
@@ -185,7 +186,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
185
186
|
[iconSlotSelector]: {
|
|
186
187
|
color: "$icon-danger-inverted"
|
|
187
188
|
},
|
|
188
|
-
|
|
189
|
+
[hoverSelector]: {
|
|
189
190
|
backgroundColor: "$background-danger-prominent-hover"
|
|
190
191
|
},
|
|
191
192
|
[activeSelector]: {
|
|
@@ -200,7 +201,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
200
201
|
[iconSlotSelector]: {
|
|
201
202
|
color: "$icon-danger"
|
|
202
203
|
},
|
|
203
|
-
|
|
204
|
+
[hoverSelector]: {
|
|
204
205
|
backgroundColor: "$background-danger-subtle",
|
|
205
206
|
color: "$text-danger-hover",
|
|
206
207
|
[iconSlotSelector]: {
|
|
@@ -222,7 +223,7 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
222
223
|
[iconSlotSelector]: {
|
|
223
224
|
color: "$icon-danger"
|
|
224
225
|
},
|
|
225
|
-
|
|
226
|
+
[hoverSelector]: {
|
|
226
227
|
backgroundColor: "$background-danger-subtle",
|
|
227
228
|
color: "$text-danger-hover",
|
|
228
229
|
[iconSlotSelector]: {
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {children}\n </StyledIconSlot>\n))\n","import { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport type { ComponentPropsWithRef } from 'react'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\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.5,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n }),\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$text-primary-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&:hover': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n\n ...solidDisabled,\n },\n 'outline-prominent': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-primary',\n color: '$text-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n '&:hover': {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&:hover': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...solidDisabled,\n },\n\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n 'ghost-subtle': {\n backgroundColor: 'transparent',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...ghostDisabled,\n },\n 'solid-danger': {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'outline-danger': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\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: '$half',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import React from 'react'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport { addPropsToChildren, booleanify } from '@mirohq/design-system-utils'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { IconSizes, IconWeights } from '@mirohq/design-system-base-icon'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\nimport type { BaseButtonProps } from '@mirohq/design-system-base-button'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\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 type ButtonProps = {\n /**\n * Change the button style.\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n */\n fluid?: StyledButtonProps['fluid']\n} & BaseButtonProps\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'solid-prominent',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n const formattedChildren = React.Children.map(\n React.Children.toArray(children),\n child => {\n if (React.isValidElement(child) && child.type === IconSlot) {\n const iconSlotChildren = addPropsToChildren(\n child.props.children,\n innerChild => isIconComponent(innerChild),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n weight: buttonIconWeights[size as ButtonSize],\n }\n )\n\n return React.cloneElement(child, { ...child.props }, iconSlotChildren)\n }\n return child\n }\n )\n\n const Content = loading ? (\n <>\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{formattedChildren}</StyledHiddenContent>\n </>\n ) : (\n formattedChildren\n )\n\n return (\n <StyledButton\n {...restProps}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {Content}\n </StyledButton>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["styled","Primitive","React","BaseButton","focus","sizes","baseIconStyles","booleanify","addPropsToChildren","isIconComponent","jsxs","Fragment","jsx","Spinner"],"mappings":";;;;;;;;;;;;;;;;;;AAKO,MAAM,cAAiB,GAAAA,2BAAA,CAAOC,+BAAU,CAAA,GAAA,EAAK,EAAE,CAAA,CAAA;AAUzC,MAAA,QAAA,GAAWC,0BAAM,UAG5B,CAAA,CAAC,EAAE,QAAU,EAAA,GAAG,WAAa,EAAA,UAAA,oCAC5B,cAAgB,EAAA,EAAA,GAAG,WAAW,GAAK,EAAA,UAAA,EAAY,eAAW,IAAC,EAAA,OAAA,EAAO,IAChE,EAAA,QAAA,EACH,CACD,CAAA;;ACZD,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,gBAAmB,GAAA,sCAAA,CAAA;AAIzB,MAAM,mBAAmB,IAAK,CAAA,MAAA,CAAA,cAAA,CAAA,CAAA;AAC9B,MAAM,oBACJ,GAAA,oEAAA,CAAA;AAEF,MAAM,aAAqB,GAAA;AAAA,EACzB,CAAC,gBAAgB,GAAG;AAAA,IAClB,eAAiB,EAAA,+BAAA;AAAA,IACjB,KAAO,EAAA,yBAAA;AAAA,IAEP,CAAC,gBAAgB,GAAG;AAAA,MAClB,KAAO,EAAA,yBAAA;AAAA,KACT;AAAA,GACF;AACF,CAAA,CAAA;AAEA,MAAM,eAAuB,GAAA;AAAA,EAC3B,CAAC,gBAAgB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cC,qCAAgB,UAAU,CAAA;AAAA,YACxC;AAAA,cACE,qBAAuB,EAAA,EAAA;AAAA,cACvB,IAAA,EAAM,gBAAgB,IAAkB,CAAA;AAAA,cACxC,MAAA,EAAQ,kBAAkB,IAAkB,CAAA;AAAA,aAC9C;AAAA,WACF,CAAA;AAEA,UAAO,OAAAP,yBAAA,CAAM,aAAa,KAAO,EAAA,EAAE,GAAG,KAAM,CAAA,KAAA,IAAS,gBAAgB,CAAA,CAAA;AAAA,SACvE;AACA,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAAA,KACF,CAAA;AAEA,IAAM,MAAA,OAAA,GAAU,0BAEZQ,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAAC,cAAA,CAAC,gBACC,EAAA,EAAA,QAAA,kBAAAA,cAAA,CAACC,2BAAQ,EAAA,EAAA,IAAA,EAAM,aAAa,CAC9B,EAAA,CAAA;AAAA,sBACAD,cAAA,CAAC,uBAAqB,QAAkB,EAAA,iBAAA,EAAA,CAAA;AAAA,KAAA,EAC1C,CAEA,GAAA,iBAAA,CAAA;AAGF,IACE,uBAAAA,cAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAA;AAAA,QACJ,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,OAAA;AAAA,OAAA;AAAA,KACH,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/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {children}\n </StyledIconSlot>\n))\n","import { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport type { ComponentPropsWithRef } from 'react'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst hoverSelector = '&:hover, &[data-hovered]'\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.5,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n }),\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$text-primary-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n\n ...solidDisabled,\n },\n 'outline-prominent': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-primary',\n color: '$text-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n [hoverSelector]: {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...solidDisabled,\n },\n\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n 'ghost-subtle': {\n backgroundColor: 'transparent',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...ghostDisabled,\n },\n 'solid-danger': {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-danger-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'outline-danger': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\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: '$half',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import React from 'react'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport { addPropsToChildren, booleanify } from '@mirohq/design-system-utils'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { IconSizes, IconWeights } from '@mirohq/design-system-base-icon'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\nimport type { BaseButtonProps } from '@mirohq/design-system-base-button'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\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 type ButtonProps = {\n /**\n * Change the button style.\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n */\n fluid?: StyledButtonProps['fluid']\n} & BaseButtonProps\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'solid-prominent',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n const formattedChildren = React.Children.map(\n React.Children.toArray(children),\n child => {\n if (React.isValidElement(child) && child.type === IconSlot) {\n const iconSlotChildren = addPropsToChildren(\n child.props.children,\n innerChild => isIconComponent(innerChild),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n weight: buttonIconWeights[size as ButtonSize],\n }\n )\n\n return React.cloneElement(child, { ...child.props }, iconSlotChildren)\n }\n return child\n }\n )\n\n const Content = loading ? (\n <>\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{formattedChildren}</StyledHiddenContent>\n </>\n ) : (\n formattedChildren\n )\n\n return (\n <StyledButton\n {...restProps}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {Content}\n </StyledButton>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["styled","Primitive","React","BaseButton","focus","sizes","baseIconStyles","booleanify","addPropsToChildren","isIconComponent","jsxs","Fragment","jsx","Spinner"],"mappings":";;;;;;;;;;;;;;;;;;AAKO,MAAM,cAAiB,GAAAA,2BAAA,CAAOC,+BAAU,CAAA,GAAA,EAAK,EAAE,CAAA,CAAA;AAUzC,MAAA,QAAA,GAAWC,0BAAM,UAG5B,CAAA,CAAC,EAAE,QAAU,EAAA,GAAG,WAAa,EAAA,UAAA,oCAC5B,cAAgB,EAAA,EAAA,GAAG,WAAW,GAAK,E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AC,uBAAqB,QAAkB,EAAA,iBAAA,EAAA,CAAA;AAAA,KAAA,EAC1C,CAEA,GAAA,iBAAA,CAAA;AAGF,IACE,uBAAAA,cAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAA;AAAA,QACJ,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,OAAA;AAAA,OAAA;AAAA,KACH,CAAA;AAAA,GAEJ;AACF,EAAA;AAUA,MAAA,CAAO,QAAW,GAAA,QAAA,CAAA;AAClB,MAAA,CAAO,KAAQ,GAAA,KAAA;;;;"}
|
package/dist/module.js
CHANGED
|
@@ -12,6 +12,7 @@ const StyledIconSlot = styled(Primitive.div, {});
|
|
|
12
12
|
const IconSlot = React.forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsx(StyledIconSlot, { ...restProps, ref: forwardRef, "aria-hidden": true, asChild: true, children }));
|
|
13
13
|
|
|
14
14
|
const activeSelector = "&:active, &[data-pressed]";
|
|
15
|
+
const hoverSelector = "&:hover, &[data-hovered]";
|
|
15
16
|
const disabledSelector = '&[disabled], &[aria-disabled="true"]';
|
|
16
17
|
const iconSlotSelector = "& ".concat(StyledIconSlot);
|
|
17
18
|
const externalIconSelector = "& svg:not([data-icon-component]), & img:not([data-icon-component])";
|
|
@@ -74,7 +75,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
74
75
|
[iconSlotSelector]: {
|
|
75
76
|
color: "$icon-primary-inverted"
|
|
76
77
|
},
|
|
77
|
-
|
|
78
|
+
[hoverSelector]: {
|
|
78
79
|
backgroundColor: "$background-primary-prominent-hover"
|
|
79
80
|
},
|
|
80
81
|
[activeSelector]: {
|
|
@@ -89,7 +90,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
89
90
|
[iconSlotSelector]: {
|
|
90
91
|
color: "$icon-primary"
|
|
91
92
|
},
|
|
92
|
-
|
|
93
|
+
[hoverSelector]: {
|
|
93
94
|
backgroundColor: "$background-primary-subtle-hover",
|
|
94
95
|
borderColor: "$border-primary-hover",
|
|
95
96
|
color: "$text-primary-hover",
|
|
@@ -110,7 +111,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
110
111
|
"ghost-prominent": {
|
|
111
112
|
backgroundColor: "transparent",
|
|
112
113
|
color: "$text-primary",
|
|
113
|
-
|
|
114
|
+
[hoverSelector]: {
|
|
114
115
|
backgroundColor: "$background-primary-subtle-hover",
|
|
115
116
|
color: "$text-primary-hover",
|
|
116
117
|
[iconSlotSelector]: {
|
|
@@ -132,7 +133,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
132
133
|
[iconSlotSelector]: {
|
|
133
134
|
color: "$icon-neutrals"
|
|
134
135
|
},
|
|
135
|
-
|
|
136
|
+
[hoverSelector]: {
|
|
136
137
|
backgroundColor: "$background-neutrals-subtle-hover"
|
|
137
138
|
},
|
|
138
139
|
[activeSelector]: {
|
|
@@ -147,7 +148,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
147
148
|
[iconSlotSelector]: {
|
|
148
149
|
color: "$icon-neutrals"
|
|
149
150
|
},
|
|
150
|
-
|
|
151
|
+
[hoverSelector]: {
|
|
151
152
|
backgroundColor: "$background-neutrals-subtle-hover",
|
|
152
153
|
borderColor: "$border-neutrals-hover"
|
|
153
154
|
},
|
|
@@ -163,7 +164,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
163
164
|
[iconSlotSelector]: {
|
|
164
165
|
color: "$icon-neutrals"
|
|
165
166
|
},
|
|
166
|
-
|
|
167
|
+
[hoverSelector]: {
|
|
167
168
|
backgroundColor: "$background-neutrals-subtle-hover"
|
|
168
169
|
},
|
|
169
170
|
[activeSelector]: {
|
|
@@ -177,7 +178,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
177
178
|
[iconSlotSelector]: {
|
|
178
179
|
color: "$icon-danger-inverted"
|
|
179
180
|
},
|
|
180
|
-
|
|
181
|
+
[hoverSelector]: {
|
|
181
182
|
backgroundColor: "$background-danger-prominent-hover"
|
|
182
183
|
},
|
|
183
184
|
[activeSelector]: {
|
|
@@ -192,7 +193,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
192
193
|
[iconSlotSelector]: {
|
|
193
194
|
color: "$icon-danger"
|
|
194
195
|
},
|
|
195
|
-
|
|
196
|
+
[hoverSelector]: {
|
|
196
197
|
backgroundColor: "$background-danger-subtle",
|
|
197
198
|
color: "$text-danger-hover",
|
|
198
199
|
[iconSlotSelector]: {
|
|
@@ -214,7 +215,7 @@ const StyledButton = styled(BaseButton, {
|
|
|
214
215
|
[iconSlotSelector]: {
|
|
215
216
|
color: "$icon-danger"
|
|
216
217
|
},
|
|
217
|
-
|
|
218
|
+
[hoverSelector]: {
|
|
218
219
|
backgroundColor: "$background-danger-subtle",
|
|
219
220
|
color: "$text-danger-hover",
|
|
220
221
|
[iconSlotSelector]: {
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {children}\n </StyledIconSlot>\n))\n","import { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport type { ComponentPropsWithRef } from 'react'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\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.5,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n }),\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$text-primary-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&:hover': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n\n ...solidDisabled,\n },\n 'outline-prominent': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-primary',\n color: '$text-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n '&:hover': {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&:hover': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...solidDisabled,\n },\n\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n 'ghost-subtle': {\n backgroundColor: 'transparent',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...ghostDisabled,\n },\n 'solid-danger': {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'outline-danger': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&:hover': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\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: '$half',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import React from 'react'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport { addPropsToChildren, booleanify } from '@mirohq/design-system-utils'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { IconSizes, IconWeights } from '@mirohq/design-system-base-icon'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\nimport type { BaseButtonProps } from '@mirohq/design-system-base-button'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\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 type ButtonProps = {\n /**\n * Change the button style.\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n */\n fluid?: StyledButtonProps['fluid']\n} & BaseButtonProps\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'solid-prominent',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n const formattedChildren = React.Children.map(\n React.Children.toArray(children),\n child => {\n if (React.isValidElement(child) && child.type === IconSlot) {\n const iconSlotChildren = addPropsToChildren(\n child.props.children,\n innerChild => isIconComponent(innerChild),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n weight: buttonIconWeights[size as ButtonSize],\n }\n )\n\n return React.cloneElement(child, { ...child.props }, iconSlotChildren)\n }\n return child\n }\n )\n\n const Content = loading ? (\n <>\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{formattedChildren}</StyledHiddenContent>\n </>\n ) : (\n formattedChildren\n )\n\n return (\n <StyledButton\n {...restProps}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {Content}\n </StyledButton>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["baseIconStyles"],"mappings":";;;;;;;;;;AAKO,MAAM,cAAiB,GAAA,MAAA,CAAO,SAAU,CAAA,GAAA,EAAK,EAAE,CAAA,CAAA;AAUzC,MAAA,QAAA,GAAW,MAAM,UAG5B,CAAA,CAAC,EAAE,QAAU,EAAA,GAAG,WAAa,EAAA,UAAA,yBAC5B,cAAgB,EAAA,EAAA,GAAG,WAAW,GAAK,EAAA,UAAA,EAAY,eAAW,IAAC,EAAA,OAAA,EAAO,IAChE,EAAA,QAAA,EACH,CACD,CAAA;;ACZD,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,gBAAmB,GAAA,sCAAA,CAAA;AAIzB,MAAM,mBAAmB,IAAK,CAAA,MAAA,CAAA,cAAA,CAAA,CAAA;AAC9B,MAAM,oBACJ,GAAA,oEAAA,CAAA;AAEF,MAAM,aAAqB,GAAA;AAAA,EACzB,CAAC,gBAAgB,GAAG;AAAA,IAClB,eAAiB,EAAA,+BAAA;AAAA,IACjB,KAAO,EAAA,yBAAA;AAAA,IAEP,CAAC,gBAAgB,GAAG;AAAA,MAClB,KAAO,EAAA,yBAAA;AAAA,KACT;AAAA,GACF;AACF,CAAA,CAAA;AAEA,MAAM,eAAuB,GAAA;AAAA,EAC3B,CAAC,gBAAgB,GAAG;AAAA,IAClB,eAAiB,E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,cACvB,IAAA,EAAM,gBAAgB,IAAkB,CAAA;AAAA,cACxC,MAAA,EAAQ,kBAAkB,IAAkB,CAAA;AAAA,aAC9C;AAAA,WACF,CAAA;AAEA,UAAO,OAAA,KAAA,CAAM,aAAa,KAAO,EAAA,EAAE,GAAG,KAAM,CAAA,KAAA,IAAS,gBAAgB,CAAA,CAAA;AAAA,SACvE;AACA,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAAA,KACF,CAAA;AAEA,IAAM,MAAA,OAAA,GAAU,0BAEZ,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,gBACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,OAAQ,EAAA,EAAA,IAAA,EAAM,aAAa,CAC9B,EAAA,CAAA;AAAA,sBACA,GAAA,CAAC,uBAAqB,QAAkB,EAAA,iBAAA,EAAA,CAAA;AAAA,KAAA,EAC1C,CAEA,GAAA,iBAAA,CAAA;AAGF,IACE,uBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAA;AAAA,QACJ,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,OAAA;AAAA,OAAA;AAAA,KACH,CAAA;AAAA,GAEJ;AACF,EAAA;AAUA,MAAA,CAAO,QAAW,GAAA,QAAA,CAAA;AAClB,MAAA,CAAO,KAAQ,GAAA,KAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {children}\n </StyledIconSlot>\n))\n","import { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport type { ComponentPropsWithRef } from 'react'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst hoverSelector = '&:hover, &[data-hovered]'\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.5,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n }),\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$text-primary-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n\n ...solidDisabled,\n },\n 'outline-prominent': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-primary',\n color: '$text-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n [hoverSelector]: {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...solidDisabled,\n },\n\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n 'ghost-subtle': {\n backgroundColor: 'transparent',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...ghostDisabled,\n },\n 'solid-danger': {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-danger-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'outline-danger': {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n [hoverSelector]: {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n [activeSelector]: {\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: '$half',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import React from 'react'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport { addPropsToChildren, booleanify } from '@mirohq/design-system-utils'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { IconSizes, IconWeights } from '@mirohq/design-system-base-icon'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\nimport type { BaseButtonProps } from '@mirohq/design-system-base-button'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\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 type ButtonProps = {\n /**\n * Change the button style.\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n */\n fluid?: StyledButtonProps['fluid']\n} & BaseButtonProps\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'solid-prominent',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n const formattedChildren = React.Children.map(\n React.Children.toArray(children),\n child => {\n if (React.isValidElement(child) && child.type === IconSlot) {\n const iconSlotChildren = addPropsToChildren(\n child.props.children,\n innerChild => isIconComponent(innerChild),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n weight: buttonIconWeights[size as ButtonSize],\n }\n )\n\n return React.cloneElement(child, { ...child.props }, iconSlotChildren)\n }\n return child\n }\n )\n\n const Content = loading ? (\n <>\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{formattedChildren}</StyledHiddenContent>\n </>\n ) : (\n formattedChildren\n )\n\n return (\n <StyledButton\n {...restProps}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {Content}\n </StyledButton>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["baseIconStyles"],"mappings":";;;;;;;;;;AAKO,MAAM,cAAiB,GAAA,MAAA,CAAO,SAAU,CAAA,GAAA,EAAK,EAAE,CAAA,CAAA;AAUzC,MAAA,QAAA,GAAW,MAAM,UAG5B,CAAA,CAAC,EAAE,QAAU,EAAA,GAAG,WAAa,EAAA,UAAA,yBAC5B,cAAgB,EAAA,EAAA,GAAG,WAAW,GAAK,EAAA,UAAA,EAAY,eAAW,IAAC,EAAA,OAAA,EAAO,IAChE,EAAA,QAAA,EACH,CACD,CAAA;;ACZD,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,aAAgB,GAAA,0BAAA,CAAA;AACtB,MAAM,gBAAm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A;AAAA,QAEA,eAAA,EAAe,yBAAyB,IAAO,GAAA,KAAA,CAAA;AAAA,QAC/C,GAAK,EAAA,UAAA;AAAA,QAEJ,QAAA,EAAA,OAAA;AAAA,OAAA;AAAA,KACH,CAAA;AAAA,GAEJ;AACF,EAAA;AAUA,MAAA,CAAO,QAAW,GAAA,QAAA,CAAA;AAClB,MAAA,CAAO,KAAQ,GAAA,KAAA;;;;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -110,17 +110,26 @@ declare const StyledButton: react.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
110
110
|
"background-neutrals-page"?: any;
|
|
111
111
|
"background-neutrals-page-subtle"?: any;
|
|
112
112
|
"background-neutrals-scrolls"?: any;
|
|
113
|
+
"background-neutrals-scrolls-expanded"?: any;
|
|
113
114
|
"background-neutrals-scrolls-hover"?: any;
|
|
115
|
+
"background-neutrals-scrolls-pressed"?: any;
|
|
116
|
+
"background-neutrals-scrolls-pressed-hover"?: any;
|
|
114
117
|
"background-neutrals-subtle"?: any;
|
|
115
118
|
"background-neutrals-subtle-active"?: any;
|
|
116
119
|
"background-neutrals-subtle-hover"?: any;
|
|
117
120
|
"background-primary-prominent"?: any;
|
|
118
121
|
"background-primary-prominent-active"?: any;
|
|
122
|
+
"background-primary-prominent-expanded"?: any;
|
|
119
123
|
"background-primary-prominent-hover"?: any;
|
|
124
|
+
"background-primary-prominent-pressed"?: any;
|
|
125
|
+
"background-primary-prominent-pressed-hover"?: any;
|
|
120
126
|
"background-primary-prominent-selected"?: any;
|
|
121
127
|
"background-primary-subtle"?: any;
|
|
122
128
|
"background-primary-subtle-active"?: any;
|
|
129
|
+
"background-primary-subtle-expanded"?: any;
|
|
123
130
|
"background-primary-subtle-hover"?: any;
|
|
131
|
+
"background-primary-subtle-pressed"?: any;
|
|
132
|
+
"background-primary-subtle-pressed-hover"?: any;
|
|
124
133
|
"background-primary-subtle-selected"?: any;
|
|
125
134
|
"background-success"?: any;
|
|
126
135
|
"background-warning-prominent"?: any;
|
|
@@ -568,17 +577,26 @@ declare const StyledButton: react.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
568
577
|
"background-neutrals-page"?: any;
|
|
569
578
|
"background-neutrals-page-subtle"?: any;
|
|
570
579
|
"background-neutrals-scrolls"?: any;
|
|
580
|
+
"background-neutrals-scrolls-expanded"?: any;
|
|
571
581
|
"background-neutrals-scrolls-hover"?: any;
|
|
582
|
+
"background-neutrals-scrolls-pressed"?: any;
|
|
583
|
+
"background-neutrals-scrolls-pressed-hover"?: any;
|
|
572
584
|
"background-neutrals-subtle"?: any;
|
|
573
585
|
"background-neutrals-subtle-active"?: any;
|
|
574
586
|
"background-neutrals-subtle-hover"?: any;
|
|
575
587
|
"background-primary-prominent"?: any;
|
|
576
588
|
"background-primary-prominent-active"?: any;
|
|
589
|
+
"background-primary-prominent-expanded"?: any;
|
|
577
590
|
"background-primary-prominent-hover"?: any;
|
|
591
|
+
"background-primary-prominent-pressed"?: any;
|
|
592
|
+
"background-primary-prominent-pressed-hover"?: any;
|
|
578
593
|
"background-primary-prominent-selected"?: any;
|
|
579
594
|
"background-primary-subtle"?: any;
|
|
580
595
|
"background-primary-subtle-active"?: any;
|
|
596
|
+
"background-primary-subtle-expanded"?: any;
|
|
581
597
|
"background-primary-subtle-hover"?: any;
|
|
598
|
+
"background-primary-subtle-pressed"?: any;
|
|
599
|
+
"background-primary-subtle-pressed-hover"?: any;
|
|
582
600
|
"background-primary-subtle-selected"?: any;
|
|
583
601
|
"background-success"?: any;
|
|
584
602
|
"background-warning-prominent"?: any;
|
|
@@ -1028,17 +1046,26 @@ declare const StyledButton: react.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
1028
1046
|
"background-neutrals-page"?: any;
|
|
1029
1047
|
"background-neutrals-page-subtle"?: any;
|
|
1030
1048
|
"background-neutrals-scrolls"?: any;
|
|
1049
|
+
"background-neutrals-scrolls-expanded"?: any;
|
|
1031
1050
|
"background-neutrals-scrolls-hover"?: any;
|
|
1051
|
+
"background-neutrals-scrolls-pressed"?: any;
|
|
1052
|
+
"background-neutrals-scrolls-pressed-hover"?: any;
|
|
1032
1053
|
"background-neutrals-subtle"?: any;
|
|
1033
1054
|
"background-neutrals-subtle-active"?: any;
|
|
1034
1055
|
"background-neutrals-subtle-hover"?: any;
|
|
1035
1056
|
"background-primary-prominent"?: any;
|
|
1036
1057
|
"background-primary-prominent-active"?: any;
|
|
1058
|
+
"background-primary-prominent-expanded"?: any;
|
|
1037
1059
|
"background-primary-prominent-hover"?: any;
|
|
1060
|
+
"background-primary-prominent-pressed"?: any;
|
|
1061
|
+
"background-primary-prominent-pressed-hover"?: any;
|
|
1038
1062
|
"background-primary-prominent-selected"?: any;
|
|
1039
1063
|
"background-primary-subtle"?: any;
|
|
1040
1064
|
"background-primary-subtle-active"?: any;
|
|
1065
|
+
"background-primary-subtle-expanded"?: any;
|
|
1041
1066
|
"background-primary-subtle-hover"?: any;
|
|
1067
|
+
"background-primary-subtle-pressed"?: any;
|
|
1068
|
+
"background-primary-subtle-pressed-hover"?: any;
|
|
1042
1069
|
"background-primary-subtle-selected"?: any;
|
|
1043
1070
|
"background-success"?: any;
|
|
1044
1071
|
"background-warning-prominent"?: any;
|
|
@@ -1488,17 +1515,26 @@ declare const StyledButton: react.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
1488
1515
|
"background-neutrals-page"?: any;
|
|
1489
1516
|
"background-neutrals-page-subtle"?: any;
|
|
1490
1517
|
"background-neutrals-scrolls"?: any;
|
|
1518
|
+
"background-neutrals-scrolls-expanded"?: any;
|
|
1491
1519
|
"background-neutrals-scrolls-hover"?: any;
|
|
1520
|
+
"background-neutrals-scrolls-pressed"?: any;
|
|
1521
|
+
"background-neutrals-scrolls-pressed-hover"?: any;
|
|
1492
1522
|
"background-neutrals-subtle"?: any;
|
|
1493
1523
|
"background-neutrals-subtle-active"?: any;
|
|
1494
1524
|
"background-neutrals-subtle-hover"?: any;
|
|
1495
1525
|
"background-primary-prominent"?: any;
|
|
1496
1526
|
"background-primary-prominent-active"?: any;
|
|
1527
|
+
"background-primary-prominent-expanded"?: any;
|
|
1497
1528
|
"background-primary-prominent-hover"?: any;
|
|
1529
|
+
"background-primary-prominent-pressed"?: any;
|
|
1530
|
+
"background-primary-prominent-pressed-hover"?: any;
|
|
1498
1531
|
"background-primary-prominent-selected"?: any;
|
|
1499
1532
|
"background-primary-subtle"?: any;
|
|
1500
1533
|
"background-primary-subtle-active"?: any;
|
|
1534
|
+
"background-primary-subtle-expanded"?: any;
|
|
1501
1535
|
"background-primary-subtle-hover"?: any;
|
|
1536
|
+
"background-primary-subtle-pressed"?: any;
|
|
1537
|
+
"background-primary-subtle-pressed-hover"?: any;
|
|
1502
1538
|
"background-primary-subtle-selected"?: any;
|
|
1503
1539
|
"background-success"?: any;
|
|
1504
1540
|
"background-warning-prominent"?: any;
|
|
@@ -1950,17 +1986,26 @@ declare const StyledButton: react.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
1950
1986
|
"background-neutrals-page"?: any;
|
|
1951
1987
|
"background-neutrals-page-subtle"?: any;
|
|
1952
1988
|
"background-neutrals-scrolls"?: any;
|
|
1989
|
+
"background-neutrals-scrolls-expanded"?: any;
|
|
1953
1990
|
"background-neutrals-scrolls-hover"?: any;
|
|
1991
|
+
"background-neutrals-scrolls-pressed"?: any;
|
|
1992
|
+
"background-neutrals-scrolls-pressed-hover"?: any;
|
|
1954
1993
|
"background-neutrals-subtle"?: any;
|
|
1955
1994
|
"background-neutrals-subtle-active"?: any;
|
|
1956
1995
|
"background-neutrals-subtle-hover"?: any;
|
|
1957
1996
|
"background-primary-prominent"?: any;
|
|
1958
1997
|
"background-primary-prominent-active"?: any;
|
|
1998
|
+
"background-primary-prominent-expanded"?: any;
|
|
1959
1999
|
"background-primary-prominent-hover"?: any;
|
|
2000
|
+
"background-primary-prominent-pressed"?: any;
|
|
2001
|
+
"background-primary-prominent-pressed-hover"?: any;
|
|
1960
2002
|
"background-primary-prominent-selected"?: any;
|
|
1961
2003
|
"background-primary-subtle"?: any;
|
|
1962
2004
|
"background-primary-subtle-active"?: any;
|
|
2005
|
+
"background-primary-subtle-expanded"?: any;
|
|
1963
2006
|
"background-primary-subtle-hover"?: any;
|
|
2007
|
+
"background-primary-subtle-pressed"?: any;
|
|
2008
|
+
"background-primary-subtle-pressed-hover"?: any;
|
|
1964
2009
|
"background-primary-subtle-selected"?: any;
|
|
1965
2010
|
"background-success"?: any;
|
|
1966
2011
|
"background-warning-prominent"?: any;
|
|
@@ -2412,17 +2457,26 @@ declare const StyledButton: react.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
2412
2457
|
"background-neutrals-page"?: any;
|
|
2413
2458
|
"background-neutrals-page-subtle"?: any;
|
|
2414
2459
|
"background-neutrals-scrolls"?: any;
|
|
2460
|
+
"background-neutrals-scrolls-expanded"?: any;
|
|
2415
2461
|
"background-neutrals-scrolls-hover"?: any;
|
|
2462
|
+
"background-neutrals-scrolls-pressed"?: any;
|
|
2463
|
+
"background-neutrals-scrolls-pressed-hover"?: any;
|
|
2416
2464
|
"background-neutrals-subtle"?: any;
|
|
2417
2465
|
"background-neutrals-subtle-active"?: any;
|
|
2418
2466
|
"background-neutrals-subtle-hover"?: any;
|
|
2419
2467
|
"background-primary-prominent"?: any;
|
|
2420
2468
|
"background-primary-prominent-active"?: any;
|
|
2469
|
+
"background-primary-prominent-expanded"?: any;
|
|
2421
2470
|
"background-primary-prominent-hover"?: any;
|
|
2471
|
+
"background-primary-prominent-pressed"?: any;
|
|
2472
|
+
"background-primary-prominent-pressed-hover"?: any;
|
|
2422
2473
|
"background-primary-prominent-selected"?: any;
|
|
2423
2474
|
"background-primary-subtle"?: any;
|
|
2424
2475
|
"background-primary-subtle-active"?: any;
|
|
2476
|
+
"background-primary-subtle-expanded"?: any;
|
|
2425
2477
|
"background-primary-subtle-hover"?: any;
|
|
2478
|
+
"background-primary-subtle-pressed"?: any;
|
|
2479
|
+
"background-primary-subtle-pressed-hover"?: any;
|
|
2426
2480
|
"background-primary-subtle-selected"?: any;
|
|
2427
2481
|
"background-success"?: any;
|
|
2428
2482
|
"background-warning-prominent"?: any;
|
|
@@ -2884,17 +2938,26 @@ declare const StyledIconSlot: react__default.ForwardRefExoticComponent<Omit<Omit
|
|
|
2884
2938
|
"background-neutrals-page"?: any;
|
|
2885
2939
|
"background-neutrals-page-subtle"?: any;
|
|
2886
2940
|
"background-neutrals-scrolls"?: any;
|
|
2941
|
+
"background-neutrals-scrolls-expanded"?: any;
|
|
2887
2942
|
"background-neutrals-scrolls-hover"?: any;
|
|
2943
|
+
"background-neutrals-scrolls-pressed"?: any;
|
|
2944
|
+
"background-neutrals-scrolls-pressed-hover"?: any;
|
|
2888
2945
|
"background-neutrals-subtle"?: any;
|
|
2889
2946
|
"background-neutrals-subtle-active"?: any;
|
|
2890
2947
|
"background-neutrals-subtle-hover"?: any;
|
|
2891
2948
|
"background-primary-prominent"?: any;
|
|
2892
2949
|
"background-primary-prominent-active"?: any;
|
|
2950
|
+
"background-primary-prominent-expanded"?: any;
|
|
2893
2951
|
"background-primary-prominent-hover"?: any;
|
|
2952
|
+
"background-primary-prominent-pressed"?: any;
|
|
2953
|
+
"background-primary-prominent-pressed-hover"?: any;
|
|
2894
2954
|
"background-primary-prominent-selected"?: any;
|
|
2895
2955
|
"background-primary-subtle"?: any;
|
|
2896
2956
|
"background-primary-subtle-active"?: any;
|
|
2957
|
+
"background-primary-subtle-expanded"?: any;
|
|
2897
2958
|
"background-primary-subtle-hover"?: any;
|
|
2959
|
+
"background-primary-subtle-pressed"?: any;
|
|
2960
|
+
"background-primary-subtle-pressed-hover"?: any;
|
|
2898
2961
|
"background-primary-subtle-selected"?: any;
|
|
2899
2962
|
"background-success"?: any;
|
|
2900
2963
|
"background-warning-prominent"?: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-button",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@react-aria/utils": "^3.13.0",
|
|
30
|
-
"@mirohq/design-system-
|
|
31
|
-
"@mirohq/design-system-
|
|
32
|
-
"@mirohq/design-system-
|
|
33
|
-
"@mirohq/design-system-stitches": "^2.3.
|
|
34
|
-
"@mirohq/design-system-
|
|
35
|
-
"@mirohq/design-system-types": "^0.6.
|
|
36
|
-
"@mirohq/design-system-utils": "^0.14.
|
|
30
|
+
"@mirohq/design-system-spinner": "^1.1.19",
|
|
31
|
+
"@mirohq/design-system-styles": "^1.1.4",
|
|
32
|
+
"@mirohq/design-system-primitive": "^1.1.1",
|
|
33
|
+
"@mirohq/design-system-stitches": "^2.3.8",
|
|
34
|
+
"@mirohq/design-system-base-button": "^0.4.17",
|
|
35
|
+
"@mirohq/design-system-types": "^0.6.1",
|
|
36
|
+
"@mirohq/design-system-utils": "^0.14.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/lodash.capitalize": "^4.2.7",
|