@mirohq/design-system-button 3.2.0-deprecated-button.0 → 3.2.0-deprecated-button.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -2
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +3 -604
- package/package.json +4 -12
package/dist/main.js
CHANGED
|
@@ -340,7 +340,7 @@ const Button = React__default["default"].forwardRef(
|
|
|
340
340
|
spinnerSize = "medium";
|
|
341
341
|
}
|
|
342
342
|
const _loading = loading === "true" || loading === true;
|
|
343
|
-
const shouldBeDisabled = disabled || _loading;
|
|
343
|
+
const shouldBeDisabled = disabled === true || _loading;
|
|
344
344
|
const asLink = href != null;
|
|
345
345
|
const ref = React.useRef(null);
|
|
346
346
|
const refWithFallback = forwardRef != null ? forwardRef : ref;
|
|
@@ -349,10 +349,10 @@ const Button = React__default["default"].forwardRef(
|
|
|
349
349
|
isDisabled: shouldBeDisabled,
|
|
350
350
|
href,
|
|
351
351
|
onPress: onPress != null ? onPress : onClick,
|
|
352
|
-
// @ts-expect-error
|
|
353
352
|
allowFocusWhenDisabled: false,
|
|
354
353
|
...restProps
|
|
355
354
|
},
|
|
355
|
+
// @ts-expect-error
|
|
356
356
|
refWithFallback
|
|
357
357
|
);
|
|
358
358
|
const { linkProps } = link.useLink(
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/button.styled.ts","../src/button.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nexport const focusFilled = {\n '&[data-focused]': {\n boxShadow: `inset 0 0 0 1px white, 0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n },\n}\n\nexport const focusOutline = {\n '&[data-focused]': {\n boxShadow: `0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n borderColor: 'transparent',\n },\n}\n\nconst focusDefault = {\n '&[data-focused]': {\n boxShadow: `0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n },\n}\n\nconst pressedSelector = '&:active, &[data-pressed]'\n\nexport const StyledButton = styled(Primitive.button, {\n boxSizing: 'border-box',\n display: 'inline-block',\n outline: 'none',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n verticalAlign: 'middle',\n userSelect: 'none',\n fontFamily: 'inherit',\n fontStyle: 'normal',\n fontStretch: 'normal',\n letterSpacing: 'normal',\n fontWeight: 'normal',\n position: 'relative',\n cursor: 'pointer',\n border: 'none',\n textDecoration: 'none',\n backgroundColor: 'transparent',\n '&[disabled]': {\n pointerEvents: 'none',\n opacity: 0.4,\n },\n variants: {\n variant: {\n primary: {},\n secondary: {},\n danger: {},\n },\n appearance: {\n filled: {},\n outlined: {},\n flat: {},\n },\n size: {\n large: {\n padding: '14px 32px 18px 32px',\n fontSize: '20px',\n lineHeight: '28px',\n height: '60px',\n },\n medium: {\n padding: '11px 24px 13px 24px',\n fontSize: '16px',\n lineHeight: '24px',\n height: '48px',\n },\n small: {\n padding: '7px 16px 9px 16px',\n fontSize: '14px',\n lineHeight: '20px',\n height: '36px',\n },\n 'x-small': {\n padding: '5px 12px 7px',\n fontSize: '14px',\n lineHeight: '20px',\n height: '32px',\n },\n 'xx-small': {\n padding: '3px 12px',\n fontSize: '12px',\n lineHeight: '18px',\n height: '24px',\n },\n },\n rounded: {\n true: {\n borderRadius: '$half',\n },\n },\n loading: {\n true: {\n '&[disabled]': {\n cursor: 'default',\n opacity: 1,\n pointerEvents: 'none',\n '& > span': {\n visibility: 'hidden',\n },\n },\n },\n },\n fluid: {\n true: {\n width: '100%',\n display: 'block',\n },\n },\n },\n compoundVariants: [\n {\n size: 'small',\n rounded: true,\n css: {\n padding: '10px 16px',\n height: '40px',\n },\n },\n {\n size: 'large',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'medium',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'small',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'x-small',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'xx-small',\n rounded: false,\n css: {\n borderRadius: '$25',\n },\n },\n {\n variant: 'primary',\n appearance: 'filled',\n css: {\n color: '#FFFFFF',\n backgroundColor: '#3859FF',\n ...focusFilled,\n '&:hover': {\n color: '#FFFFFF',\n backgroundColor: '#3F53D9',\n },\n [pressedSelector]: {\n backgroundColor: '#122277',\n },\n },\n },\n {\n variant: 'primary',\n appearance: 'outlined',\n css: {\n color: 'rgba(66, 98, 255, 1)',\n border: '1px solid rgba(66, 98, 255, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(66, 98, 255, 1)',\n backgroundColor: 'rgba(244, 246, 255, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(240, 242, 255, 1)',\n },\n },\n },\n {\n variant: 'primary',\n appearance: 'flat',\n css: {\n color: 'rgba(66, 98, 255, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(69, 91, 237, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n [pressedSelector]: {\n color: 'rgba(61, 81, 212, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'filled',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n ...focusFilled,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(240, 240, 243, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(235, 235, 239, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'outlined',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n border: '1px solid rgba(205, 204, 215, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(235, 235, 239, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'flat',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'filled',\n css: {\n color: '#FFFFFF',\n backgroundColor: 'rgba(217, 41, 41, 1)',\n ...focusFilled,\n '&:hover': {\n backgroundColor: 'rgba(199, 20, 20, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(184, 13, 13, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'outlined',\n css: {\n color: 'rgba(217, 41, 41, 1)',\n border: '1px solid rgba(217, 41, 41, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(217, 41, 41, 1)',\n backgroundColor: 'rgba(254, 247, 247, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(253, 242, 242, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'flat',\n css: {\n color: 'rgba(217, 41, 41, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(217, 41, 41, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n },\n },\n ],\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 React, { useRef } from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport { useButton } from '@react-aria/button'\nimport type { AriaButtonProps } from '@react-types/button'\nimport { mergeProps } from '@react-aria/utils'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport { useLink } from '@react-aria/link'\nimport { useFocusRing } from '@react-aria/focus'\n\nimport type { StyledButtonProps } from './button.styled'\nimport { StyledButton, StyledSpinnerBox } from './button.styled'\n\ntype ButtonPropsA11y = StyledButtonProps & AriaButtonProps\n\nexport interface ButtonProps\n extends Omit<ButtonPropsA11y, 'onClick' | 'isDisabled' | 'elementType'> {\n /**\n * The content\n */\n children: ReactNode\n\n /**\n * Change the button color\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button style\n */\n appearance?: StyledButtonProps['appearance']\n\n /**\n * Change the button height and font-size\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make border-radius circle\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable\n */\n loading?: StyledButtonProps['loading']\n\n /**\n * Make width 100%\n */\n fluid?: StyledButtonProps['fluid']\n\n /**\n * Prevent pointer events\n */\n disabled?: boolean\n\n /**\n * A URL to link when using the button as a link\n */\n href?: string\n\n /**\n * The target window using the button as a link\n */\n target?: string\n\n /**\n * The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel)\n */\n rel?: string\n\n /**\n * Alias for onPress\n */\n onClick?: AriaButtonProps['onPress']\n}\n\nexport const Button = React.forwardRef<\n ElementRef<typeof StyledButton | 'a'>,\n ButtonProps\n>(\n (\n {\n variant = 'primary',\n appearance = 'filled',\n size = 'medium',\n loading = false,\n rounded = false,\n fluid = false,\n disabled = false,\n href,\n target,\n rel,\n children,\n onPress,\n onClick,\n asChild,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size']\n\n if (typeof size === 'string') {\n spinnerSize = ['x-small', 'xx-small'].includes(size) ? 'small' : 'medium'\n } else {\n spinnerSize = 'medium'\n }\n\n const _loading = loading === 'true' || loading === true\n const shouldBeDisabled = disabled || _loading\n\n const asLink = href != null\n\n const ref = useRef<HTMLButtonElement | HTMLAnchorElement>(null)\n const refWithFallback = forwardRef ?? ref\n const { buttonProps, isPressed } = useButton(\n {\n isDisabled: shouldBeDisabled,\n href,\n onPress: onPress ?? onClick,\n // @ts-expect-error\n allowFocusWhenDisabled: false,\n ...restProps,\n },\n refWithFallback\n )\n\n const { linkProps } = useLink(\n {\n isDisabled: disabled,\n onPress: onPress ?? onClick,\n ...restProps,\n },\n // @ts-expect-error\n refWithFallback\n )\n\n const Content = (\n <>\n {_loading && (\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n )}\n <span>{children}</span>\n </>\n )\n\n const tabIndexProp = shouldBeDisabled && {\n tabIndex: -1,\n }\n\n const { isFocusVisible, focusProps } = useFocusRing()\n\n const elementProps = mergeProps(\n restProps,\n asLink ? linkProps : buttonProps,\n focusProps\n )\n\n return (\n <StyledButton\n {...elementProps}\n variant={variant}\n appearance={appearance}\n size={size}\n loading={loading}\n rounded={rounded}\n fluid={fluid}\n disabled={shouldBeDisabled}\n asChild={asLink || asChild}\n {...tabIndexProp}\n data-pressed={isPressed ? '' : undefined}\n data-focused={isFocusVisible ? '' : undefined}\n // @ts-expect-error\n ref={refWithFallback}\n >\n {asLink ? (\n <a\n href={href}\n target={target}\n rel={target === '_blank' ? `noopener noreferrer ${rel}` : rel}\n >\n {Content}\n </a>\n ) : (\n Content\n )}\n </StyledButton>\n )\n }\n)\n"],"names":["styled","Primitive","React","useRef","useButton","useLink","jsxs","Fragment","jsx","Spinner","useFocusRing","mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;AAIO,MAAM,WAAc,GAAA;AAAA,EACzB,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,2FAAA;AAAA,GACb;AACF,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA;AAAA,EAC1B,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,oEAAA;AAAA,IACX,WAAa,EAAA,aAAA;AAAA,GACf;AACF,CAAA,CAAA;AAEA,MAAM,YAAe,GAAA;AAA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GAAAC,gBAAA;AAAA,MACnB,SAAA;AAAA,MACA,SAAS,SAAY,GAAA,WAAA;AAAA,MACrB,UAAA;AAAA,KACF,CAAA;AAEA,IACE,uBAAAH,cAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,YAAA;AAAA,QACJ,OAAA;AAAA,QACA,UAAA;AAAA,QACA,IAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,QAAU,EAAA,gBAAA;AAAA,QACV,SAAS,MAAU,IAAA,OAAA;AAAA,QAClB,GAAG,YAAA;AAAA,QACJ,cAAA,EAAc,YAAY,EAAK,GAAA,KAAA,CAAA;AAAA,QAC/B,cAAA,EAAc,iBAAiB,EAAK,GAAA,KAAA,CAAA;AAAA,QAEpC,GAAK,EAAA,eAAA;AAAA,QAEJ,QACC,EAAA,MAAA,mBAAAA,cAAA;AAAA,UAAC,GAAA;AAAA,UAAA;AAAA,YACC,IAAA;AAAA,YACA,MAAA;AAAA,YACA,GAAK,EAAA,MAAA,KAAW,QAAW,GAAA,sBAAA,CAAuB,MAAQ,CAAA,GAAA,CAAA,GAAA,GAAA;AAAA,YAEzD,QAAA,EAAA,OAAA;AAAA,WAAA;AAAA,SAGH,GAAA,OAAA;AAAA,OAAA;AAAA,KAEJ,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/button.styled.ts","../src/button.tsx"],"sourcesContent":["import { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nexport const focusFilled = {\n '&[data-focused]': {\n boxShadow: `inset 0 0 0 1px white, 0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n },\n}\n\nexport const focusOutline = {\n '&[data-focused]': {\n boxShadow: `0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n borderColor: 'transparent',\n },\n}\n\nconst focusDefault = {\n '&[data-focused]': {\n boxShadow: `0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n },\n}\n\nconst pressedSelector = '&:active, &[data-pressed]'\n\nexport const StyledButton = styled(Primitive.button, {\n boxSizing: 'border-box',\n display: 'inline-block',\n outline: 'none',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n verticalAlign: 'middle',\n userSelect: 'none',\n fontFamily: 'inherit',\n fontStyle: 'normal',\n fontStretch: 'normal',\n letterSpacing: 'normal',\n fontWeight: 'normal',\n position: 'relative',\n cursor: 'pointer',\n border: 'none',\n textDecoration: 'none',\n backgroundColor: 'transparent',\n '&[disabled]': {\n pointerEvents: 'none',\n opacity: 0.4,\n },\n variants: {\n variant: {\n primary: {},\n secondary: {},\n danger: {},\n },\n appearance: {\n filled: {},\n outlined: {},\n flat: {},\n },\n size: {\n large: {\n padding: '14px 32px 18px 32px',\n fontSize: '20px',\n lineHeight: '28px',\n height: '60px',\n },\n medium: {\n padding: '11px 24px 13px 24px',\n fontSize: '16px',\n lineHeight: '24px',\n height: '48px',\n },\n small: {\n padding: '7px 16px 9px 16px',\n fontSize: '14px',\n lineHeight: '20px',\n height: '36px',\n },\n 'x-small': {\n padding: '5px 12px 7px',\n fontSize: '14px',\n lineHeight: '20px',\n height: '32px',\n },\n 'xx-small': {\n padding: '3px 12px',\n fontSize: '12px',\n lineHeight: '18px',\n height: '24px',\n },\n },\n rounded: {\n true: {\n borderRadius: '$half',\n },\n },\n loading: {\n true: {\n '&[disabled]': {\n cursor: 'default',\n opacity: 1,\n pointerEvents: 'none',\n '& > span': {\n visibility: 'hidden',\n },\n },\n },\n },\n fluid: {\n true: {\n width: '100%',\n display: 'block',\n },\n },\n },\n compoundVariants: [\n {\n size: 'small',\n rounded: true,\n css: {\n padding: '10px 16px',\n height: '40px',\n },\n },\n {\n size: 'large',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'medium',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'small',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'x-small',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'xx-small',\n rounded: false,\n css: {\n borderRadius: '$25',\n },\n },\n {\n variant: 'primary',\n appearance: 'filled',\n css: {\n color: '#FFFFFF',\n backgroundColor: '#3859FF',\n ...focusFilled,\n '&:hover': {\n color: '#FFFFFF',\n backgroundColor: '#3F53D9',\n },\n [pressedSelector]: {\n backgroundColor: '#122277',\n },\n },\n },\n {\n variant: 'primary',\n appearance: 'outlined',\n css: {\n color: 'rgba(66, 98, 255, 1)',\n border: '1px solid rgba(66, 98, 255, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(66, 98, 255, 1)',\n backgroundColor: 'rgba(244, 246, 255, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(240, 242, 255, 1)',\n },\n },\n },\n {\n variant: 'primary',\n appearance: 'flat',\n css: {\n color: 'rgba(66, 98, 255, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(69, 91, 237, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n [pressedSelector]: {\n color: 'rgba(61, 81, 212, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'filled',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n ...focusFilled,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(240, 240, 243, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(235, 235, 239, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'outlined',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n border: '1px solid rgba(205, 204, 215, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(235, 235, 239, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'flat',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'filled',\n css: {\n color: '#FFFFFF',\n backgroundColor: 'rgba(217, 41, 41, 1)',\n ...focusFilled,\n '&:hover': {\n backgroundColor: 'rgba(199, 20, 20, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(184, 13, 13, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'outlined',\n css: {\n color: 'rgba(217, 41, 41, 1)',\n border: '1px solid rgba(217, 41, 41, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(217, 41, 41, 1)',\n backgroundColor: 'rgba(254, 247, 247, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(253, 242, 242, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'flat',\n css: {\n color: 'rgba(217, 41, 41, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(217, 41, 41, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n },\n },\n ],\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","import React, { useRef } from 'react'\nimport type { ElementRef } from 'react'\nimport { useButton } from '@react-aria/button'\nimport { mergeProps } from '@react-aria/utils'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport { useLink } from '@react-aria/link'\nimport { useFocusRing } from '@react-aria/focus'\n\nimport { StyledButton, StyledSpinnerBox } from './button.styled'\n\nexport type ButtonProps = any\n\nexport const Button = React.forwardRef<\n ElementRef<typeof StyledButton | 'a'>,\n ButtonProps\n>(\n (\n {\n variant = 'primary',\n appearance = 'filled',\n size = 'medium',\n loading = false,\n rounded = false,\n fluid = false,\n disabled = false,\n href,\n target,\n rel,\n children,\n onPress,\n onClick,\n asChild,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size']\n\n if (typeof size === 'string') {\n spinnerSize = ['x-small', 'xx-small'].includes(size) ? 'small' : 'medium'\n } else {\n spinnerSize = 'medium'\n }\n\n const _loading = loading === 'true' || loading === true\n const shouldBeDisabled = disabled === true || _loading\n\n const asLink = href != null\n\n const ref = useRef<HTMLButtonElement | HTMLAnchorElement>(null)\n const refWithFallback = forwardRef ?? ref\n const { buttonProps, isPressed } = useButton(\n {\n isDisabled: shouldBeDisabled,\n href,\n onPress: onPress ?? onClick,\n allowFocusWhenDisabled: false,\n ...restProps,\n },\n // @ts-expect-error\n refWithFallback\n )\n\n const { linkProps } = useLink(\n {\n isDisabled: disabled,\n onPress: onPress ?? onClick,\n ...restProps,\n },\n // @ts-expect-error\n refWithFallback\n )\n\n const Content = (\n <>\n {_loading && (\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n )}\n <span>{children}</span>\n </>\n )\n\n const tabIndexProp = shouldBeDisabled && {\n tabIndex: -1,\n }\n\n const { isFocusVisible, focusProps } = useFocusRing()\n\n const elementProps = mergeProps(\n restProps,\n asLink ? linkProps : buttonProps,\n focusProps\n )\n\n return (\n <StyledButton\n {...elementProps}\n variant={variant}\n appearance={appearance}\n size={size}\n loading={loading}\n rounded={rounded}\n fluid={fluid}\n disabled={shouldBeDisabled}\n asChild={asLink || asChild}\n {...tabIndexProp}\n data-pressed={isPressed ? '' : undefined}\n data-focused={isFocusVisible ? '' : undefined}\n ref={refWithFallback}\n >\n {asLink ? (\n <a\n href={href}\n target={target}\n rel={target === '_blank' ? `noopener noreferrer ${rel}` : rel}\n >\n {Content}\n </a>\n ) : (\n Content\n )}\n </StyledButton>\n )\n }\n)\n"],"names":["styled","Primitive","React","useRef","useButton","useLink","jsxs","Fragment","jsx","Spinner","useFocusRing","mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,MAAM,WAAc,GAAA;AAAA,EACzB,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,2FAAA;AAAA,GACb;AACF,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA;AAAA,EAC1B,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,oEAAA;AAAA,IACX,WAAa,EAAA,aAAA;AAAA,GACf;AACF,CAAA,CAAA;AAEA,MAAM,YAAe,GAAA;AAAA,EACnB,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,oEAAA;AAAA,GACb;AACF,CAAA,CAAA;AAEA,MAAM,eAAkB,GAAA,2BAAA,CAAA;AAEX,MAAA,YAAA,GAAeA,2BAAO,CAAAC,+BAAA,CAAU,MAAQ,EAAA;AAAA,EACnD,SAAW,EAAA,YAAA;AAAA,EACX,OAAS,EAAA,cAAA;AAAA,EACT,OAAS,EAAA,MAAA;AAAA,EACT,UAAY,EAAA,QAAA;AAAA,EACZ,YAAc,EAAA,UAAA;AAAA,EACd,SAAW,EAAA,QAAA;AAAA,EACX,aAAe,EAAA,QAAA;AAAA,EACf,UAAY,EAAA,MAAA;AAAA,EACZ,UAAY,EAAA,SAAA;AAAA,EACZ,SAAW,EAAA,QAAA;AAAA,EACX,WAAa,EAAA,QAAA;AAAA,EACb,aAAe,EAAA,QAAA;AAAA,EACf,UAAY,EAAA,QAAA;AAAA,EACZ,QAAU,EAAA,UAAA;AAAA,EACV,MAAQ,EAAA,SAAA;AAAA,EACR,MAAQ,EAAA,MAAA;AAAA,EACR,cAAgB,EAAA,MAAA;AAAA,EAChB,eAAiB,EAAA,aAAA;AAAA,EACjB,aAAe,EAAA;AAAA,IACb,aAAe,EAAA,MAAA;AAAA,IACf,OAAS,EAAA,GAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,I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AEJ;AACF;;;;"}
|
package/dist/module.js
CHANGED
|
@@ -332,7 +332,7 @@ const Button = React.forwardRef(
|
|
|
332
332
|
spinnerSize = "medium";
|
|
333
333
|
}
|
|
334
334
|
const _loading = loading === "true" || loading === true;
|
|
335
|
-
const shouldBeDisabled = disabled || _loading;
|
|
335
|
+
const shouldBeDisabled = disabled === true || _loading;
|
|
336
336
|
const asLink = href != null;
|
|
337
337
|
const ref = useRef(null);
|
|
338
338
|
const refWithFallback = forwardRef != null ? forwardRef : ref;
|
|
@@ -341,10 +341,10 @@ const Button = React.forwardRef(
|
|
|
341
341
|
isDisabled: shouldBeDisabled,
|
|
342
342
|
href,
|
|
343
343
|
onPress: onPress != null ? onPress : onClick,
|
|
344
|
-
// @ts-expect-error
|
|
345
344
|
allowFocusWhenDisabled: false,
|
|
346
345
|
...restProps
|
|
347
346
|
},
|
|
347
|
+
// @ts-expect-error
|
|
348
348
|
refWithFallback
|
|
349
349
|
);
|
|
350
350
|
const { linkProps } = useLink(
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/button.styled.ts","../src/button.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nexport const focusFilled = {\n '&[data-focused]': {\n boxShadow: `inset 0 0 0 1px white, 0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n },\n}\n\nexport const focusOutline = {\n '&[data-focused]': {\n boxShadow: `0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n borderColor: 'transparent',\n },\n}\n\nconst focusDefault = {\n '&[data-focused]': {\n boxShadow: `0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n },\n}\n\nconst pressedSelector = '&:active, &[data-pressed]'\n\nexport const StyledButton = styled(Primitive.button, {\n boxSizing: 'border-box',\n display: 'inline-block',\n outline: 'none',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n verticalAlign: 'middle',\n userSelect: 'none',\n fontFamily: 'inherit',\n fontStyle: 'normal',\n fontStretch: 'normal',\n letterSpacing: 'normal',\n fontWeight: 'normal',\n position: 'relative',\n cursor: 'pointer',\n border: 'none',\n textDecoration: 'none',\n backgroundColor: 'transparent',\n '&[disabled]': {\n pointerEvents: 'none',\n opacity: 0.4,\n },\n variants: {\n variant: {\n primary: {},\n secondary: {},\n danger: {},\n },\n appearance: {\n filled: {},\n outlined: {},\n flat: {},\n },\n size: {\n large: {\n padding: '14px 32px 18px 32px',\n fontSize: '20px',\n lineHeight: '28px',\n height: '60px',\n },\n medium: {\n padding: '11px 24px 13px 24px',\n fontSize: '16px',\n lineHeight: '24px',\n height: '48px',\n },\n small: {\n padding: '7px 16px 9px 16px',\n fontSize: '14px',\n lineHeight: '20px',\n height: '36px',\n },\n 'x-small': {\n padding: '5px 12px 7px',\n fontSize: '14px',\n lineHeight: '20px',\n height: '32px',\n },\n 'xx-small': {\n padding: '3px 12px',\n fontSize: '12px',\n lineHeight: '18px',\n height: '24px',\n },\n },\n rounded: {\n true: {\n borderRadius: '$half',\n },\n },\n loading: {\n true: {\n '&[disabled]': {\n cursor: 'default',\n opacity: 1,\n pointerEvents: 'none',\n '& > span': {\n visibility: 'hidden',\n },\n },\n },\n },\n fluid: {\n true: {\n width: '100%',\n display: 'block',\n },\n },\n },\n compoundVariants: [\n {\n size: 'small',\n rounded: true,\n css: {\n padding: '10px 16px',\n height: '40px',\n },\n },\n {\n size: 'large',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'medium',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'small',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'x-small',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'xx-small',\n rounded: false,\n css: {\n borderRadius: '$25',\n },\n },\n {\n variant: 'primary',\n appearance: 'filled',\n css: {\n color: '#FFFFFF',\n backgroundColor: '#3859FF',\n ...focusFilled,\n '&:hover': {\n color: '#FFFFFF',\n backgroundColor: '#3F53D9',\n },\n [pressedSelector]: {\n backgroundColor: '#122277',\n },\n },\n },\n {\n variant: 'primary',\n appearance: 'outlined',\n css: {\n color: 'rgba(66, 98, 255, 1)',\n border: '1px solid rgba(66, 98, 255, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(66, 98, 255, 1)',\n backgroundColor: 'rgba(244, 246, 255, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(240, 242, 255, 1)',\n },\n },\n },\n {\n variant: 'primary',\n appearance: 'flat',\n css: {\n color: 'rgba(66, 98, 255, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(69, 91, 237, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n [pressedSelector]: {\n color: 'rgba(61, 81, 212, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'filled',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n ...focusFilled,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(240, 240, 243, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(235, 235, 239, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'outlined',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n border: '1px solid rgba(205, 204, 215, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(235, 235, 239, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'flat',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'filled',\n css: {\n color: '#FFFFFF',\n backgroundColor: 'rgba(217, 41, 41, 1)',\n ...focusFilled,\n '&:hover': {\n backgroundColor: 'rgba(199, 20, 20, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(184, 13, 13, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'outlined',\n css: {\n color: 'rgba(217, 41, 41, 1)',\n border: '1px solid rgba(217, 41, 41, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(217, 41, 41, 1)',\n backgroundColor: 'rgba(254, 247, 247, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(253, 242, 242, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'flat',\n css: {\n color: 'rgba(217, 41, 41, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(217, 41, 41, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n },\n },\n ],\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 React, { useRef } from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport { useButton } from '@react-aria/button'\nimport type { AriaButtonProps } from '@react-types/button'\nimport { mergeProps } from '@react-aria/utils'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport { useLink } from '@react-aria/link'\nimport { useFocusRing } from '@react-aria/focus'\n\nimport type { StyledButtonProps } from './button.styled'\nimport { StyledButton, StyledSpinnerBox } from './button.styled'\n\ntype ButtonPropsA11y = StyledButtonProps & AriaButtonProps\n\nexport interface ButtonProps\n extends Omit<ButtonPropsA11y, 'onClick' | 'isDisabled' | 'elementType'> {\n /**\n * The content\n */\n children: ReactNode\n\n /**\n * Change the button color\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button style\n */\n appearance?: StyledButtonProps['appearance']\n\n /**\n * Change the button height and font-size\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make border-radius circle\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable\n */\n loading?: StyledButtonProps['loading']\n\n /**\n * Make width 100%\n */\n fluid?: StyledButtonProps['fluid']\n\n /**\n * Prevent pointer events\n */\n disabled?: boolean\n\n /**\n * A URL to link when using the button as a link\n */\n href?: string\n\n /**\n * The target window using the button as a link\n */\n target?: string\n\n /**\n * The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel)\n */\n rel?: string\n\n /**\n * Alias for onPress\n */\n onClick?: AriaButtonProps['onPress']\n}\n\nexport const Button = React.forwardRef<\n ElementRef<typeof StyledButton | 'a'>,\n ButtonProps\n>(\n (\n {\n variant = 'primary',\n appearance = 'filled',\n size = 'medium',\n loading = false,\n rounded = false,\n fluid = false,\n disabled = false,\n href,\n target,\n rel,\n children,\n onPress,\n onClick,\n asChild,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size']\n\n if (typeof size === 'string') {\n spinnerSize = ['x-small', 'xx-small'].includes(size) ? 'small' : 'medium'\n } else {\n spinnerSize = 'medium'\n }\n\n const _loading = loading === 'true' || loading === true\n const shouldBeDisabled = disabled || _loading\n\n const asLink = href != null\n\n const ref = useRef<HTMLButtonElement | HTMLAnchorElement>(null)\n const refWithFallback = forwardRef ?? ref\n const { buttonProps, isPressed } = useButton(\n {\n isDisabled: shouldBeDisabled,\n href,\n onPress: onPress ?? onClick,\n // @ts-expect-error\n allowFocusWhenDisabled: false,\n ...restProps,\n },\n refWithFallback\n )\n\n const { linkProps } = useLink(\n {\n isDisabled: disabled,\n onPress: onPress ?? onClick,\n ...restProps,\n },\n // @ts-expect-error\n refWithFallback\n )\n\n const Content = (\n <>\n {_loading && (\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n )}\n <span>{children}</span>\n </>\n )\n\n const tabIndexProp = shouldBeDisabled && {\n tabIndex: -1,\n }\n\n const { isFocusVisible, focusProps } = useFocusRing()\n\n const elementProps = mergeProps(\n restProps,\n asLink ? linkProps : buttonProps,\n focusProps\n )\n\n return (\n <StyledButton\n {...elementProps}\n variant={variant}\n appearance={appearance}\n size={size}\n loading={loading}\n rounded={rounded}\n fluid={fluid}\n disabled={shouldBeDisabled}\n asChild={asLink || asChild}\n {...tabIndexProp}\n data-pressed={isPressed ? '' : undefined}\n data-focused={isFocusVisible ? '' : undefined}\n // @ts-expect-error\n ref={refWithFallback}\n >\n {asLink ? (\n <a\n href={href}\n target={target}\n rel={target === '_blank' ? `noopener noreferrer ${rel}` : rel}\n >\n {Content}\n </a>\n ) : (\n Content\n )}\n </StyledButton>\n )\n }\n)\n"],"names":[],"mappings":";;;;;;;;;;AAIO,MAAM,WAAc,GAAA;AAAA,EACzB,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,2FAAA;AAAA,GACb;AACF,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA;AAAA,EAC1B,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,oEAAA;AAAA,IACX,WAAa,EAAA,aAAA;AAAA,GACf;AACF,CAAA,CAAA;AAEA,MAAM,YAAe,GAAA;AAAA,EACnB,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,oEAAA;AAAA,GACb;AACF,CAAA,CAAA;AAEA,MAAM,eAAkB,GAAA,2BAAA,CAAA;AAEX,MAAA,YAAA,GAAe,MAAO,CAAA,SAAA,CAAU,MAAQ,EAAA;AAAA,EACnD,SAAW,EAAA,YAAA;AAAA,EACX,OAAS,EAAA,cAAA;AAAA,EACT,OAAS,EAAA,MAAA;AAAA,EACT,UAAY,EAAA,QAAA;AAAA,EACZ,YAAc,EAA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AA,QAClB,GAAG,YAAA;AAAA,QACJ,cAAA,EAAc,YAAY,EAAK,GAAA,KAAA,CAAA;AAAA,QAC/B,cAAA,EAAc,iBAAiB,EAAK,GAAA,KAAA,CAAA;AAAA,QAEpC,GAAK,EAAA,eAAA;AAAA,QAEJ,QACC,EAAA,MAAA,mBAAA,GAAA;AAAA,UAAC,GAAA;AAAA,UAAA;AAAA,YACC,IAAA;AAAA,YACA,MAAA;AAAA,YACA,GAAK,EAAA,MAAA,KAAW,QAAW,GAAA,sBAAA,CAAuB,MAAQ,CAAA,GAAA,CAAA,GAAA,GAAA;AAAA,YAEzD,QAAA,EAAA,OAAA;AAAA,WAAA;AAAA,SAGH,GAAA,OAAA;AAAA,OAAA;AAAA,KAEJ,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/button.styled.ts","../src/button.tsx"],"sourcesContent":["import { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nexport const focusFilled = {\n '&[data-focused]': {\n boxShadow: `inset 0 0 0 1px white, 0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n },\n}\n\nexport const focusOutline = {\n '&[data-focused]': {\n boxShadow: `0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n borderColor: 'transparent',\n },\n}\n\nconst focusDefault = {\n '&[data-focused]': {\n boxShadow: `0 0 0 1px rgba(104, 129, 255, 1), 0 0 0 5px rgba(217, 224, 255, 1)`,\n },\n}\n\nconst pressedSelector = '&:active, &[data-pressed]'\n\nexport const StyledButton = styled(Primitive.button, {\n boxSizing: 'border-box',\n display: 'inline-block',\n outline: 'none',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n verticalAlign: 'middle',\n userSelect: 'none',\n fontFamily: 'inherit',\n fontStyle: 'normal',\n fontStretch: 'normal',\n letterSpacing: 'normal',\n fontWeight: 'normal',\n position: 'relative',\n cursor: 'pointer',\n border: 'none',\n textDecoration: 'none',\n backgroundColor: 'transparent',\n '&[disabled]': {\n pointerEvents: 'none',\n opacity: 0.4,\n },\n variants: {\n variant: {\n primary: {},\n secondary: {},\n danger: {},\n },\n appearance: {\n filled: {},\n outlined: {},\n flat: {},\n },\n size: {\n large: {\n padding: '14px 32px 18px 32px',\n fontSize: '20px',\n lineHeight: '28px',\n height: '60px',\n },\n medium: {\n padding: '11px 24px 13px 24px',\n fontSize: '16px',\n lineHeight: '24px',\n height: '48px',\n },\n small: {\n padding: '7px 16px 9px 16px',\n fontSize: '14px',\n lineHeight: '20px',\n height: '36px',\n },\n 'x-small': {\n padding: '5px 12px 7px',\n fontSize: '14px',\n lineHeight: '20px',\n height: '32px',\n },\n 'xx-small': {\n padding: '3px 12px',\n fontSize: '12px',\n lineHeight: '18px',\n height: '24px',\n },\n },\n rounded: {\n true: {\n borderRadius: '$half',\n },\n },\n loading: {\n true: {\n '&[disabled]': {\n cursor: 'default',\n opacity: 1,\n pointerEvents: 'none',\n '& > span': {\n visibility: 'hidden',\n },\n },\n },\n },\n fluid: {\n true: {\n width: '100%',\n display: 'block',\n },\n },\n },\n compoundVariants: [\n {\n size: 'small',\n rounded: true,\n css: {\n padding: '10px 16px',\n height: '40px',\n },\n },\n {\n size: 'large',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'medium',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'small',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'x-small',\n rounded: false,\n css: {\n borderRadius: '$50',\n },\n },\n {\n size: 'xx-small',\n rounded: false,\n css: {\n borderRadius: '$25',\n },\n },\n {\n variant: 'primary',\n appearance: 'filled',\n css: {\n color: '#FFFFFF',\n backgroundColor: '#3859FF',\n ...focusFilled,\n '&:hover': {\n color: '#FFFFFF',\n backgroundColor: '#3F53D9',\n },\n [pressedSelector]: {\n backgroundColor: '#122277',\n },\n },\n },\n {\n variant: 'primary',\n appearance: 'outlined',\n css: {\n color: 'rgba(66, 98, 255, 1)',\n border: '1px solid rgba(66, 98, 255, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(66, 98, 255, 1)',\n backgroundColor: 'rgba(244, 246, 255, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(240, 242, 255, 1)',\n },\n },\n },\n {\n variant: 'primary',\n appearance: 'flat',\n css: {\n color: 'rgba(66, 98, 255, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(69, 91, 237, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n [pressedSelector]: {\n color: 'rgba(61, 81, 212, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'filled',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n ...focusFilled,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(240, 240, 243, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(235, 235, 239, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'outlined',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n border: '1px solid rgba(205, 204, 215, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(235, 235, 239, 1)',\n },\n },\n },\n {\n variant: 'secondary',\n appearance: 'flat',\n css: {\n color: 'rgba(5, 0, 56, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(5, 0, 56, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'filled',\n css: {\n color: '#FFFFFF',\n backgroundColor: 'rgba(217, 41, 41, 1)',\n ...focusFilled,\n '&:hover': {\n backgroundColor: 'rgba(199, 20, 20, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(184, 13, 13, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'outlined',\n css: {\n color: 'rgba(217, 41, 41, 1)',\n border: '1px solid rgba(217, 41, 41, 1)',\n ...focusOutline,\n '&:hover': {\n color: 'rgba(217, 41, 41, 1)',\n backgroundColor: 'rgba(254, 247, 247, 1)',\n },\n [pressedSelector]: {\n backgroundColor: 'rgba(253, 242, 242, 1)',\n },\n },\n },\n {\n variant: 'danger',\n appearance: 'flat',\n css: {\n color: 'rgba(217, 41, 41, 1)',\n ...focusDefault,\n '&:hover': {\n color: 'rgba(217, 41, 41, 1)',\n backgroundColor: 'rgba(245, 245, 247, 1)',\n },\n },\n },\n ],\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","import React, { useRef } from 'react'\nimport type { ElementRef } from 'react'\nimport { useButton } from '@react-aria/button'\nimport { mergeProps } from '@react-aria/utils'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport { useLink } from '@react-aria/link'\nimport { useFocusRing } from '@react-aria/focus'\n\nimport { StyledButton, StyledSpinnerBox } from './button.styled'\n\nexport type ButtonProps = any\n\nexport const Button = React.forwardRef<\n ElementRef<typeof StyledButton | 'a'>,\n ButtonProps\n>(\n (\n {\n variant = 'primary',\n appearance = 'filled',\n size = 'medium',\n loading = false,\n rounded = false,\n fluid = false,\n disabled = false,\n href,\n target,\n rel,\n children,\n onPress,\n onClick,\n asChild,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size']\n\n if (typeof size === 'string') {\n spinnerSize = ['x-small', 'xx-small'].includes(size) ? 'small' : 'medium'\n } else {\n spinnerSize = 'medium'\n }\n\n const _loading = loading === 'true' || loading === true\n const shouldBeDisabled = disabled === true || _loading\n\n const asLink = href != null\n\n const ref = useRef<HTMLButtonElement | HTMLAnchorElement>(null)\n const refWithFallback = forwardRef ?? ref\n const { buttonProps, isPressed } = useButton(\n {\n isDisabled: shouldBeDisabled,\n href,\n onPress: onPress ?? onClick,\n allowFocusWhenDisabled: false,\n ...restProps,\n },\n // @ts-expect-error\n refWithFallback\n )\n\n const { linkProps } = useLink(\n {\n isDisabled: disabled,\n onPress: onPress ?? onClick,\n ...restProps,\n },\n // @ts-expect-error\n refWithFallback\n )\n\n const Content = (\n <>\n {_loading && (\n <StyledSpinnerBox>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n )}\n <span>{children}</span>\n </>\n )\n\n const tabIndexProp = shouldBeDisabled && {\n tabIndex: -1,\n }\n\n const { isFocusVisible, focusProps } = useFocusRing()\n\n const elementProps = mergeProps(\n restProps,\n asLink ? linkProps : buttonProps,\n focusProps\n )\n\n return (\n <StyledButton\n {...elementProps}\n variant={variant}\n appearance={appearance}\n size={size}\n loading={loading}\n rounded={rounded}\n fluid={fluid}\n disabled={shouldBeDisabled}\n asChild={asLink || asChild}\n {...tabIndexProp}\n data-pressed={isPressed ? '' : undefined}\n data-focused={isFocusVisible ? '' : undefined}\n ref={refWithFallback}\n >\n {asLink ? (\n <a\n href={href}\n target={target}\n rel={target === '_blank' ? `noopener noreferrer ${rel}` : rel}\n >\n {Content}\n </a>\n ) : (\n Content\n )}\n </StyledButton>\n )\n }\n)\n"],"names":[],"mappings":";;;;;;;;;;AAGO,MAAM,WAAc,GAAA;AAAA,EACzB,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,2FAAA;AAAA,GACb;AACF,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA;AAAA,EAC1B,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,oEAAA;AAAA,IACX,WAAa,EAAA,aAAA;AAAA,GACf;AACF,CAAA,CAAA;AAEA,MAAM,YAAe,GAAA;AAAA,EACnB,iBAAmB,EAAA;AAAA,IACjB,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SAAY,GAAA,WAAA;AAAA,MACrB,UAAA;AAAA,KACF,CAAA;AAEA,IACE,uBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,YAAA;AAAA,QACJ,OAAA;AAAA,QACA,UAAA;AAAA,QACA,IAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,QAAU,EAAA,gBAAA;AAAA,QACV,SAAS,MAAU,IAAA,OAAA;AAAA,QAClB,GAAG,YAAA;AAAA,QACJ,cAAA,EAAc,YAAY,EAAK,GAAA,KAAA,CAAA;AAAA,QAC/B,cAAA,EAAc,iBAAiB,EAAK,GAAA,KAAA,CAAA;AAAA,QACpC,GAAK,EAAA,eAAA;AAAA,QAEJ,QACC,EAAA,MAAA,mBAAA,GAAA;AAAA,UAAC,GAAA;AAAA,UAAA;AAAA,YACC,IAAA;AAAA,YACA,MAAA;AAAA,YACA,GAAK,EAAA,MAAA,KAAW,QAAW,GAAA,sBAAA,CAAuB,MAAQ,CAAA,GAAA,CAAA,GAAA,GAAA;AAAA,YAEzD,QAAA,EAAA,OAAA;AAAA,WAAA;AAAA,SAGH,GAAA,OAAA;AAAA,OAAA;AAAA,KAEJ,CAAA;AAAA,GAEJ;AACF;;;;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,607 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import react__default, { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
|
-
import { AriaButtonProps } from '@react-types/button';
|
|
4
|
-
import * as _mirohq_design_system_stitches from '@mirohq/design-system-stitches';
|
|
5
|
-
import * as _stitches_react_types_styled_component from '@stitches/react/types/styled-component';
|
|
6
|
-
import * as _stitches_react_types_css_util from '@stitches/react/types/css-util';
|
|
7
|
-
import * as _mirohq_design_system_primitive from '@mirohq/design-system-primitive';
|
|
1
|
+
import React from 'react';
|
|
8
2
|
|
|
9
|
-
declare
|
|
10
|
-
|
|
11
|
-
readonly none: 0;
|
|
12
|
-
readonly sm: "1px";
|
|
13
|
-
readonly md: "2px";
|
|
14
|
-
readonly lg: "4px";
|
|
15
|
-
};
|
|
16
|
-
colors: {
|
|
17
|
-
readonly black: any;
|
|
18
|
-
readonly 'blue-50': any;
|
|
19
|
-
readonly 'blue-100': any;
|
|
20
|
-
readonly 'blue-150': any;
|
|
21
|
-
readonly 'blue-200': any;
|
|
22
|
-
readonly 'blue-250': any;
|
|
23
|
-
readonly 'blue-300': any;
|
|
24
|
-
readonly 'blue-350': any;
|
|
25
|
-
readonly 'blue-400': any;
|
|
26
|
-
readonly 'blue-450': any;
|
|
27
|
-
readonly 'blue-500': any;
|
|
28
|
-
readonly 'blue-550': any;
|
|
29
|
-
readonly 'blue-600': any;
|
|
30
|
-
readonly 'blue-650': any;
|
|
31
|
-
readonly 'blue-700': any;
|
|
32
|
-
readonly 'blue-750': any;
|
|
33
|
-
readonly 'blue-800': any;
|
|
34
|
-
readonly 'blue-850': any;
|
|
35
|
-
readonly 'blue-900': any;
|
|
36
|
-
readonly 'blue-950': any;
|
|
37
|
-
readonly 'gray-50': any;
|
|
38
|
-
readonly 'gray-100': any;
|
|
39
|
-
readonly 'gray-150': any;
|
|
40
|
-
readonly 'gray-200': any;
|
|
41
|
-
readonly 'gray-250': any;
|
|
42
|
-
readonly 'gray-300': any;
|
|
43
|
-
readonly 'gray-350': any;
|
|
44
|
-
readonly 'gray-400': any;
|
|
45
|
-
readonly 'gray-450': any;
|
|
46
|
-
readonly 'gray-500': any;
|
|
47
|
-
readonly 'gray-550': any;
|
|
48
|
-
readonly 'gray-600': any;
|
|
49
|
-
readonly 'gray-650': any;
|
|
50
|
-
readonly 'gray-700': any;
|
|
51
|
-
readonly 'gray-750': any;
|
|
52
|
-
readonly 'gray-800': any;
|
|
53
|
-
readonly 'gray-850': any;
|
|
54
|
-
readonly 'gray-900': any;
|
|
55
|
-
readonly 'gray-950': any;
|
|
56
|
-
readonly 'green-50': any;
|
|
57
|
-
readonly 'green-100': any;
|
|
58
|
-
readonly 'green-150': any;
|
|
59
|
-
readonly 'green-200': any;
|
|
60
|
-
readonly 'green-250': any;
|
|
61
|
-
readonly 'green-300': any;
|
|
62
|
-
readonly 'green-350': any;
|
|
63
|
-
readonly 'green-400': any;
|
|
64
|
-
readonly 'green-450': any;
|
|
65
|
-
readonly 'green-500': any;
|
|
66
|
-
readonly 'green-550': any;
|
|
67
|
-
readonly 'green-600': any;
|
|
68
|
-
readonly 'green-650': any;
|
|
69
|
-
readonly 'green-700': any;
|
|
70
|
-
readonly 'green-750': any;
|
|
71
|
-
readonly 'green-800': any;
|
|
72
|
-
readonly 'green-850': any;
|
|
73
|
-
readonly 'green-900': any;
|
|
74
|
-
readonly 'green-950': any;
|
|
75
|
-
readonly 'red-50': any;
|
|
76
|
-
readonly 'red-100': any;
|
|
77
|
-
readonly 'red-150': any;
|
|
78
|
-
readonly 'red-200': any;
|
|
79
|
-
readonly 'red-250': any;
|
|
80
|
-
readonly 'red-300': any;
|
|
81
|
-
readonly 'red-350': any;
|
|
82
|
-
readonly 'red-400': any;
|
|
83
|
-
readonly 'red-450': any;
|
|
84
|
-
readonly 'red-500': any;
|
|
85
|
-
readonly 'red-550': any;
|
|
86
|
-
readonly 'red-600': any;
|
|
87
|
-
readonly 'red-650': any;
|
|
88
|
-
readonly 'red-700': any;
|
|
89
|
-
readonly 'red-750': any;
|
|
90
|
-
readonly 'red-800': any;
|
|
91
|
-
readonly 'red-850': any;
|
|
92
|
-
readonly 'red-900': any;
|
|
93
|
-
readonly 'red-950': any;
|
|
94
|
-
readonly transparent: any;
|
|
95
|
-
readonly white: any;
|
|
96
|
-
readonly 'yellow-50': any;
|
|
97
|
-
readonly 'yellow-100': any;
|
|
98
|
-
readonly 'yellow-150': any;
|
|
99
|
-
readonly 'yellow-200': any;
|
|
100
|
-
readonly 'yellow-250': any;
|
|
101
|
-
readonly 'yellow-300': any;
|
|
102
|
-
readonly 'yellow-350': any;
|
|
103
|
-
readonly 'yellow-400': any;
|
|
104
|
-
readonly 'yellow-450': any;
|
|
105
|
-
readonly 'yellow-500': any;
|
|
106
|
-
readonly 'yellow-550': any;
|
|
107
|
-
readonly 'yellow-600': any;
|
|
108
|
-
readonly 'yellow-650': any;
|
|
109
|
-
readonly 'yellow-700': any;
|
|
110
|
-
readonly 'yellow-750': any;
|
|
111
|
-
readonly 'yellow-800': any;
|
|
112
|
-
readonly 'yellow-850': any;
|
|
113
|
-
readonly 'yellow-900': any;
|
|
114
|
-
readonly 'yellow-950': any;
|
|
115
|
-
"background-alpha-active"?: any;
|
|
116
|
-
"background-alpha-hover"?: any;
|
|
117
|
-
"background-danger-prominent"?: any;
|
|
118
|
-
"background-danger-prominent-active"?: any;
|
|
119
|
-
"background-danger-prominent-hover"?: any;
|
|
120
|
-
"background-danger-subtle"?: any;
|
|
121
|
-
"background-danger-subtle-active"?: any;
|
|
122
|
-
"background-danger-subtle-hover"?: any;
|
|
123
|
-
"background-neutrals"?: any;
|
|
124
|
-
"background-neutrals-active"?: any;
|
|
125
|
-
"background-neutrals-container"?: any;
|
|
126
|
-
"background-neutrals-controls-disabled"?: any;
|
|
127
|
-
"background-neutrals-disabled"?: any;
|
|
128
|
-
"background-neutrals-hover"?: any;
|
|
129
|
-
"background-neutrals-inactive"?: any;
|
|
130
|
-
"background-neutrals-inactive-hover"?: any;
|
|
131
|
-
"background-neutrals-inverted"?: any;
|
|
132
|
-
"background-neutrals-inverted-subtle"?: any;
|
|
133
|
-
"background-neutrals-page"?: any;
|
|
134
|
-
"background-neutrals-page-subtle"?: any;
|
|
135
|
-
"background-neutrals-scrollbar"?: any;
|
|
136
|
-
"background-neutrals-scrollbar-active"?: any;
|
|
137
|
-
"background-neutrals-scrollbar-hover"?: any;
|
|
138
|
-
"background-neutrals-subtle"?: any;
|
|
139
|
-
"background-neutrals-subtle-active"?: any;
|
|
140
|
-
"background-neutrals-subtle-hover"?: any;
|
|
141
|
-
"background-primary-prominent"?: any;
|
|
142
|
-
"background-primary-prominent-active"?: any;
|
|
143
|
-
"background-primary-prominent-hover"?: any;
|
|
144
|
-
"background-primary-prominent-selected"?: any;
|
|
145
|
-
"background-primary-subtle"?: any;
|
|
146
|
-
"background-primary-subtle-active"?: any;
|
|
147
|
-
"background-primary-subtle-hover"?: any;
|
|
148
|
-
"background-primary-subtle-selected"?: any;
|
|
149
|
-
"background-success"?: any;
|
|
150
|
-
"background-success-prominent"?: any;
|
|
151
|
-
"background-success-prominent-active"?: any;
|
|
152
|
-
"background-success-prominent-hover"?: any;
|
|
153
|
-
"background-warning-prominent"?: any;
|
|
154
|
-
"background-warning-subtle"?: any;
|
|
155
|
-
"border-danger"?: any;
|
|
156
|
-
"border-danger-active"?: any;
|
|
157
|
-
"border-danger-hover"?: any;
|
|
158
|
-
"border-focus-error-inner"?: any;
|
|
159
|
-
"border-focus-error-middle"?: any;
|
|
160
|
-
"border-focus-error-outer"?: any;
|
|
161
|
-
"border-focus-inner"?: any;
|
|
162
|
-
"border-focus-middle"?: any;
|
|
163
|
-
"border-focus-outer"?: any;
|
|
164
|
-
"border-focus-success-inner"?: any;
|
|
165
|
-
"border-focus-success-middle"?: any;
|
|
166
|
-
"border-focus-success-outer"?: any;
|
|
167
|
-
"border-neutrals"?: any;
|
|
168
|
-
"border-neutrals-active"?: any;
|
|
169
|
-
"border-neutrals-controls"?: any;
|
|
170
|
-
"border-neutrals-controls-disabled"?: any;
|
|
171
|
-
"border-neutrals-disabled"?: any;
|
|
172
|
-
"border-neutrals-hover"?: any;
|
|
173
|
-
"border-neutrals-inverted"?: any;
|
|
174
|
-
"border-neutrals-subtle"?: any;
|
|
175
|
-
"border-neutrals-text"?: any;
|
|
176
|
-
"border-neutrals-text-active"?: any;
|
|
177
|
-
"border-neutrals-text-hover"?: any;
|
|
178
|
-
"border-neutrals-text-subtle"?: any;
|
|
179
|
-
"border-neutrals-text-subtle-active"?: any;
|
|
180
|
-
"border-neutrals-text-subtle-hover"?: any;
|
|
181
|
-
"border-neutrals-transparent"?: any;
|
|
182
|
-
"border-primary"?: any;
|
|
183
|
-
"border-primary-active"?: any;
|
|
184
|
-
"border-primary-hover"?: any;
|
|
185
|
-
"border-primary-inverted"?: any;
|
|
186
|
-
"border-success"?: any;
|
|
187
|
-
"border-success-active"?: any;
|
|
188
|
-
"border-success-hover"?: any;
|
|
189
|
-
"border-warning"?: any;
|
|
190
|
-
"icon-danger"?: any;
|
|
191
|
-
"icon-danger-active"?: any;
|
|
192
|
-
"icon-danger-hover"?: any;
|
|
193
|
-
"icon-danger-inverted"?: any;
|
|
194
|
-
"icon-neutrals"?: any;
|
|
195
|
-
"icon-neutrals-disabled"?: any;
|
|
196
|
-
"icon-neutrals-inactive"?: any;
|
|
197
|
-
"icon-neutrals-inactive-hover"?: any;
|
|
198
|
-
"icon-neutrals-inverted"?: any;
|
|
199
|
-
"icon-neutrals-search"?: any;
|
|
200
|
-
"icon-neutrals-subtle"?: any;
|
|
201
|
-
"icon-neutrals-text"?: any;
|
|
202
|
-
"icon-primary"?: any;
|
|
203
|
-
"icon-primary-active"?: any;
|
|
204
|
-
"icon-primary-hover"?: any;
|
|
205
|
-
"icon-primary-inverted"?: any;
|
|
206
|
-
"icon-primary-selected"?: any;
|
|
207
|
-
"icon-success"?: any;
|
|
208
|
-
"icon-success-active"?: any;
|
|
209
|
-
"icon-success-hover"?: any;
|
|
210
|
-
"icon-success-inverted"?: any;
|
|
211
|
-
"icon-warning"?: any;
|
|
212
|
-
"icon-warning-prominent"?: any;
|
|
213
|
-
"icon-warning-subtle"?: any;
|
|
214
|
-
"text-danger"?: any;
|
|
215
|
-
"text-danger-active"?: any;
|
|
216
|
-
"text-danger-hover"?: any;
|
|
217
|
-
"text-danger-inverted"?: any;
|
|
218
|
-
"text-neutrals"?: any;
|
|
219
|
-
"text-neutrals-active"?: any;
|
|
220
|
-
"text-neutrals-disabled"?: any;
|
|
221
|
-
"text-neutrals-hover"?: any;
|
|
222
|
-
"text-neutrals-inverted"?: any;
|
|
223
|
-
"text-neutrals-placeholder"?: any;
|
|
224
|
-
"text-neutrals-placeholder-only"?: any;
|
|
225
|
-
"text-neutrals-subtle"?: any;
|
|
226
|
-
"text-neutrals-subtle-active"?: any;
|
|
227
|
-
"text-neutrals-subtle-hover"?: any;
|
|
228
|
-
"text-primary"?: any;
|
|
229
|
-
"text-primary-active"?: any;
|
|
230
|
-
"text-primary-hover"?: any;
|
|
231
|
-
"text-primary-inverted"?: any;
|
|
232
|
-
"text-primary-inverted-subtle"?: any;
|
|
233
|
-
"text-primary-selected"?: any;
|
|
234
|
-
"text-success"?: any;
|
|
235
|
-
"text-success-active"?: any;
|
|
236
|
-
"text-success-hover"?: any;
|
|
237
|
-
"text-success-inverted"?: any;
|
|
238
|
-
"text-warning"?: any;
|
|
239
|
-
"text-warning-subtle"?: any;
|
|
240
|
-
};
|
|
241
|
-
'font-sizes': {
|
|
242
|
-
readonly 150: "0.75rem";
|
|
243
|
-
readonly 175: "0.875rem";
|
|
244
|
-
readonly 200: "1rem";
|
|
245
|
-
readonly 225: "1.125rem";
|
|
246
|
-
readonly 250: "1.25rem";
|
|
247
|
-
readonly 300: "1.5rem";
|
|
248
|
-
readonly 400: "2rem";
|
|
249
|
-
readonly 500: "2.5rem";
|
|
250
|
-
readonly 600: "3rem";
|
|
251
|
-
readonly 800: "4rem";
|
|
252
|
-
readonly 900: "4.5rem";
|
|
253
|
-
};
|
|
254
|
-
fonts: {
|
|
255
|
-
readonly heading: "Roobert, sans-serif";
|
|
256
|
-
readonly body: "Open Sans, sans-serif";
|
|
257
|
-
};
|
|
258
|
-
radii: {
|
|
259
|
-
readonly 25: "2px";
|
|
260
|
-
readonly 50: "4px";
|
|
261
|
-
readonly 75: "6px";
|
|
262
|
-
readonly 100: "8px";
|
|
263
|
-
readonly 200: "16px";
|
|
264
|
-
readonly half: "999px";
|
|
265
|
-
readonly none: "0px";
|
|
266
|
-
};
|
|
267
|
-
shadows: {
|
|
268
|
-
50: any;
|
|
269
|
-
100: any;
|
|
270
|
-
"focus-small": any;
|
|
271
|
-
"focus-small-outline": any;
|
|
272
|
-
"focus-large": any;
|
|
273
|
-
"focus-controls": any;
|
|
274
|
-
"focus-controls-error": any;
|
|
275
|
-
"focus-controls-success": any;
|
|
276
|
-
};
|
|
277
|
-
sizes: {
|
|
278
|
-
readonly number: string;
|
|
279
|
-
readonly 'icon-200': "16px";
|
|
280
|
-
readonly 'icon-300': "24px";
|
|
281
|
-
readonly 'icon-400': "32px";
|
|
282
|
-
};
|
|
283
|
-
space: {
|
|
284
|
-
readonly 0: "0px";
|
|
285
|
-
readonly 25: "2px";
|
|
286
|
-
readonly 50: "4px";
|
|
287
|
-
readonly 100: "8px";
|
|
288
|
-
readonly 150: "12px";
|
|
289
|
-
readonly 200: "16px";
|
|
290
|
-
readonly 300: "24px";
|
|
291
|
-
readonly 400: "32px";
|
|
292
|
-
readonly 500: "40px";
|
|
293
|
-
readonly 600: "48px";
|
|
294
|
-
readonly 700: "56px";
|
|
295
|
-
readonly 800: "64px";
|
|
296
|
-
readonly 1200: "96px";
|
|
297
|
-
readonly 1600: "128px";
|
|
298
|
-
};
|
|
299
|
-
'space-gap': {
|
|
300
|
-
readonly 0: any;
|
|
301
|
-
readonly 50: any;
|
|
302
|
-
readonly 100: any;
|
|
303
|
-
readonly 200: any;
|
|
304
|
-
readonly 300: any;
|
|
305
|
-
};
|
|
306
|
-
'space-inset': {
|
|
307
|
-
readonly 0: any;
|
|
308
|
-
readonly 50: any;
|
|
309
|
-
readonly 100: any;
|
|
310
|
-
readonly 150: any;
|
|
311
|
-
readonly 200: any;
|
|
312
|
-
readonly 300: any;
|
|
313
|
-
readonly 400: any;
|
|
314
|
-
readonly 500: any;
|
|
315
|
-
readonly 600: any;
|
|
316
|
-
readonly 700: any;
|
|
317
|
-
readonly 800: any;
|
|
318
|
-
readonly 1200: any;
|
|
319
|
-
readonly 1600: any;
|
|
320
|
-
};
|
|
321
|
-
'space-offset': {
|
|
322
|
-
readonly 0: any;
|
|
323
|
-
readonly 50: any;
|
|
324
|
-
readonly 100: any;
|
|
325
|
-
readonly 150: any;
|
|
326
|
-
readonly 200: any;
|
|
327
|
-
readonly 300: any;
|
|
328
|
-
readonly 400: any;
|
|
329
|
-
readonly 600: any;
|
|
330
|
-
readonly 800: any;
|
|
331
|
-
readonly 1200: any;
|
|
332
|
-
readonly 1600: any;
|
|
333
|
-
readonly 'stacking-0': any;
|
|
334
|
-
readonly 'stacking-100': any;
|
|
335
|
-
readonly 'stacking-200': any;
|
|
336
|
-
readonly 'stacking-300': any;
|
|
337
|
-
readonly 'stacking-400': any;
|
|
338
|
-
readonly 'stacking-500': any;
|
|
339
|
-
readonly 'stacking-800': any;
|
|
340
|
-
};
|
|
341
|
-
'stroke-width': {
|
|
342
|
-
readonly thin: "1.5px";
|
|
343
|
-
readonly normal: "2px";
|
|
344
|
-
readonly bold: "4px";
|
|
345
|
-
};
|
|
346
|
-
'z-indices': {
|
|
347
|
-
readonly dropdownMenu: 100;
|
|
348
|
-
readonly select: 200;
|
|
349
|
-
readonly popover: 300;
|
|
350
|
-
readonly tooltip: 400;
|
|
351
|
-
};
|
|
352
|
-
}, {
|
|
353
|
-
readonly background: "colors";
|
|
354
|
-
readonly backgroundColor: "colors";
|
|
355
|
-
readonly backgroundImage: "colors";
|
|
356
|
-
readonly blockSize: "sizes";
|
|
357
|
-
readonly border: "colors";
|
|
358
|
-
readonly borderBlock: "colors";
|
|
359
|
-
readonly borderBlockEnd: "colors";
|
|
360
|
-
readonly borderBlockStart: "colors";
|
|
361
|
-
readonly borderBottom: "colors";
|
|
362
|
-
readonly borderBottomColor: "colors";
|
|
363
|
-
readonly borderBottomLeftRadius: "radii";
|
|
364
|
-
readonly borderBottomRightRadius: "radii";
|
|
365
|
-
readonly borderBottomStyle: "border-styles";
|
|
366
|
-
readonly borderBottomWidth: "border-widths";
|
|
367
|
-
readonly borderColor: "colors";
|
|
368
|
-
readonly borderImage: "colors";
|
|
369
|
-
readonly borderInline: "colors";
|
|
370
|
-
readonly borderInlineEnd: "colors";
|
|
371
|
-
readonly borderInlineStart: "colors";
|
|
372
|
-
readonly borderLeft: "colors";
|
|
373
|
-
readonly borderLeftColor: "colors";
|
|
374
|
-
readonly borderLeftStyle: "border-styles";
|
|
375
|
-
readonly borderLeftWidth: "border-widths";
|
|
376
|
-
readonly borderRadius: "radii";
|
|
377
|
-
readonly borderRight: "colors";
|
|
378
|
-
readonly borderRightColor: "colors";
|
|
379
|
-
readonly borderRightStyle: "border-styles";
|
|
380
|
-
readonly borderRightWidth: "border-widths";
|
|
381
|
-
readonly borderSpacing: "space-offset";
|
|
382
|
-
readonly borderStyle: "border-styles";
|
|
383
|
-
readonly borderTop: "colors";
|
|
384
|
-
readonly borderTopColor: "colors";
|
|
385
|
-
readonly borderTopLeftRadius: "radii";
|
|
386
|
-
readonly borderTopRightRadius: "radii";
|
|
387
|
-
readonly borderTopStyle: "border-styles";
|
|
388
|
-
readonly borderTopWidth: "border-widths";
|
|
389
|
-
readonly borderWidth: "border-widths";
|
|
390
|
-
readonly bottom: "space";
|
|
391
|
-
readonly boxShadow: "shadows";
|
|
392
|
-
readonly caretColor: "colors";
|
|
393
|
-
readonly color: "colors";
|
|
394
|
-
readonly columnGap: "space-gap";
|
|
395
|
-
readonly columnRuleColor: "colors";
|
|
396
|
-
readonly fill: "colors";
|
|
397
|
-
readonly flexBasis: "sizes";
|
|
398
|
-
readonly fontFamily: "fonts";
|
|
399
|
-
readonly fontSize: "font-sizes";
|
|
400
|
-
readonly fontWeight: "font-weights";
|
|
401
|
-
readonly gap: "space-gap";
|
|
402
|
-
readonly gridColumnGap: "space-gap";
|
|
403
|
-
readonly gridGap: "space-gap";
|
|
404
|
-
readonly gridRowGap: "space-gap";
|
|
405
|
-
readonly gridTemplateColumns: "sizes";
|
|
406
|
-
readonly gridTemplateRows: "sizes";
|
|
407
|
-
readonly height: "sizes";
|
|
408
|
-
readonly inlineSize: "sizes";
|
|
409
|
-
readonly inset: "space-inset";
|
|
410
|
-
readonly insetBlock: "space-inset";
|
|
411
|
-
readonly insetBlockEnd: "space-inset";
|
|
412
|
-
readonly insetBlockStart: "space-inset";
|
|
413
|
-
readonly insetInline: "space-inset";
|
|
414
|
-
readonly insetInlineEnd: "space-inset";
|
|
415
|
-
readonly insetInlineStart: "space-inset";
|
|
416
|
-
readonly left: "space";
|
|
417
|
-
readonly letterSpacing: "letter-spacings";
|
|
418
|
-
readonly lineHeight: "line-heights";
|
|
419
|
-
readonly margin: "space-offset";
|
|
420
|
-
readonly marginBlock: "space-offset";
|
|
421
|
-
readonly marginBlockEnd: "space-offset";
|
|
422
|
-
readonly marginBlockStart: "space-offset";
|
|
423
|
-
readonly marginBottom: "space-offset";
|
|
424
|
-
readonly marginInline: "space-offset";
|
|
425
|
-
readonly marginInlineEnd: "space-offset";
|
|
426
|
-
readonly marginInlineStart: "space-offset";
|
|
427
|
-
readonly marginLeft: "space-offset";
|
|
428
|
-
readonly marginRight: "space-offset";
|
|
429
|
-
readonly marginTop: "space-offset";
|
|
430
|
-
readonly maxBlockSize: "sizes";
|
|
431
|
-
readonly maxHeight: "sizes";
|
|
432
|
-
readonly maxInlineSize: "sizes";
|
|
433
|
-
readonly maxWidth: "sizes";
|
|
434
|
-
readonly minBlockSize: "sizes";
|
|
435
|
-
readonly minHeight: "sizes";
|
|
436
|
-
readonly minInlineSize: "sizes";
|
|
437
|
-
readonly minWidth: "sizes";
|
|
438
|
-
readonly outline: "colors";
|
|
439
|
-
readonly outlineColor: "colors";
|
|
440
|
-
readonly padding: "space-inset";
|
|
441
|
-
readonly paddingBlock: "space-inset";
|
|
442
|
-
readonly paddingBlockEnd: "space-inset";
|
|
443
|
-
readonly paddingBlockStart: "space-inset";
|
|
444
|
-
readonly paddingBottom: "space-inset";
|
|
445
|
-
readonly paddingInline: "space-inset";
|
|
446
|
-
readonly paddingInlineEnd: "space-inset";
|
|
447
|
-
readonly paddingInlineStart: "space-inset";
|
|
448
|
-
readonly paddingLeft: "space-inset";
|
|
449
|
-
readonly paddingRight: "space-inset";
|
|
450
|
-
readonly paddingTop: "space-inset";
|
|
451
|
-
readonly right: "space";
|
|
452
|
-
readonly rowGap: "space-gap";
|
|
453
|
-
readonly scrollMargin: "space-offset";
|
|
454
|
-
readonly scrollMarginBlock: "space-offset";
|
|
455
|
-
readonly scrollMarginBlockEnd: "space-offset";
|
|
456
|
-
readonly scrollMarginBlockStart: "space-offset";
|
|
457
|
-
readonly scrollMarginBottom: "space-offset";
|
|
458
|
-
readonly scrollMarginInline: "space-offset";
|
|
459
|
-
readonly scrollMarginInlineEnd: "space-offset";
|
|
460
|
-
readonly scrollMarginInlineStart: "space-offset";
|
|
461
|
-
readonly scrollMarginLeft: "space-offset";
|
|
462
|
-
readonly scrollMarginRight: "space-offset";
|
|
463
|
-
readonly scrollMarginTop: "space-offset";
|
|
464
|
-
readonly scrollPadding: "space-inset";
|
|
465
|
-
readonly scrollPaddingBlock: "space-inset";
|
|
466
|
-
readonly scrollPaddingBlockEnd: "space-inset";
|
|
467
|
-
readonly scrollPaddingBlockStart: "space-inset";
|
|
468
|
-
readonly scrollPaddingBottom: "space-inset";
|
|
469
|
-
readonly scrollPaddingInline: "space-inset";
|
|
470
|
-
readonly scrollPaddingInlineEnd: "space-inset";
|
|
471
|
-
readonly scrollPaddingInlineStart: "space-inset";
|
|
472
|
-
readonly scrollPaddingLeft: "space-inset";
|
|
473
|
-
readonly scrollPaddingRight: "space-inset";
|
|
474
|
-
readonly scrollPaddingTop: "space-inset";
|
|
475
|
-
readonly stroke: "colors";
|
|
476
|
-
readonly strokeWidth: "stroke-width";
|
|
477
|
-
readonly textDecorationColor: "colors";
|
|
478
|
-
readonly textShadow: "shadows";
|
|
479
|
-
readonly top: "space";
|
|
480
|
-
readonly transition: "transitions";
|
|
481
|
-
readonly width: "sizes";
|
|
482
|
-
readonly zIndex: "z-indices";
|
|
483
|
-
}, {
|
|
484
|
-
paddingX: (value: {
|
|
485
|
-
readonly [$$PropertyValue]: "padding";
|
|
486
|
-
}) => {
|
|
487
|
-
paddingLeft: {
|
|
488
|
-
readonly [$$PropertyValue]: "padding";
|
|
489
|
-
};
|
|
490
|
-
paddingRight: {
|
|
491
|
-
readonly [$$PropertyValue]: "padding";
|
|
492
|
-
};
|
|
493
|
-
};
|
|
494
|
-
paddingY: (value: {
|
|
495
|
-
readonly [$$PropertyValue]: "padding";
|
|
496
|
-
}) => {
|
|
497
|
-
paddingTop: {
|
|
498
|
-
readonly [$$PropertyValue]: "padding";
|
|
499
|
-
};
|
|
500
|
-
paddingBottom: {
|
|
501
|
-
readonly [$$PropertyValue]: "padding";
|
|
502
|
-
};
|
|
503
|
-
};
|
|
504
|
-
marginX: (value: {
|
|
505
|
-
readonly [$$PropertyValue]: "margin";
|
|
506
|
-
}) => {
|
|
507
|
-
marginLeft: {
|
|
508
|
-
readonly [$$PropertyValue]: "margin";
|
|
509
|
-
};
|
|
510
|
-
marginRight: {
|
|
511
|
-
readonly [$$PropertyValue]: "margin";
|
|
512
|
-
};
|
|
513
|
-
};
|
|
514
|
-
marginY: (value: {
|
|
515
|
-
readonly [$$PropertyValue]: "margin";
|
|
516
|
-
}) => {
|
|
517
|
-
marginTop: {
|
|
518
|
-
readonly [$$PropertyValue]: "margin";
|
|
519
|
-
};
|
|
520
|
-
marginBottom: {
|
|
521
|
-
readonly [$$PropertyValue]: "margin";
|
|
522
|
-
};
|
|
523
|
-
};
|
|
524
|
-
square: (value: {
|
|
525
|
-
readonly [$$PropertyValue]: "width";
|
|
526
|
-
}) => {
|
|
527
|
-
width: {
|
|
528
|
-
readonly [$$PropertyValue]: "width";
|
|
529
|
-
};
|
|
530
|
-
height: {
|
|
531
|
-
readonly [$$PropertyValue]: "width";
|
|
532
|
-
};
|
|
533
|
-
};
|
|
534
|
-
_hover: (css: _stitches_react_types_css_util.CSSProperties) => {
|
|
535
|
-
'&:hover, &[data-hovered]': _stitches_react_types_css_util.CSSProperties;
|
|
536
|
-
};
|
|
537
|
-
}>>>, "size" | "loading" | "appearance" | "variant" | "rounded" | "fluid"> & _stitches_react_types_styled_component.TransformProps<{
|
|
538
|
-
variant?: "primary" | "secondary" | "danger" | undefined;
|
|
539
|
-
appearance?: "filled" | "flat" | "outlined" | undefined;
|
|
540
|
-
size?: "small" | "medium" | "large" | "x-small" | "xx-small" | undefined;
|
|
541
|
-
rounded?: boolean | "true" | undefined;
|
|
542
|
-
loading?: boolean | "true" | undefined;
|
|
543
|
-
fluid?: boolean | "true" | undefined;
|
|
544
|
-
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>, {
|
|
545
|
-
variant?: "primary" | "secondary" | "danger" | undefined;
|
|
546
|
-
appearance?: "filled" | "flat" | "outlined" | undefined;
|
|
547
|
-
size?: "small" | "medium" | "large" | "x-small" | "xx-small" | undefined;
|
|
548
|
-
rounded?: boolean | "true" | undefined;
|
|
549
|
-
loading?: boolean | "true" | undefined;
|
|
550
|
-
fluid?: boolean | "true" | undefined;
|
|
551
|
-
}, {}>;
|
|
552
|
-
declare type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>;
|
|
553
|
-
|
|
554
|
-
declare type ButtonPropsA11y = StyledButtonProps & AriaButtonProps;
|
|
555
|
-
interface ButtonProps extends Omit<ButtonPropsA11y, 'onClick' | 'isDisabled' | 'elementType'> {
|
|
556
|
-
/**
|
|
557
|
-
* The content
|
|
558
|
-
*/
|
|
559
|
-
children: ReactNode;
|
|
560
|
-
/**
|
|
561
|
-
* Change the button color
|
|
562
|
-
*/
|
|
563
|
-
variant?: StyledButtonProps['variant'];
|
|
564
|
-
/**
|
|
565
|
-
* Change the button style
|
|
566
|
-
*/
|
|
567
|
-
appearance?: StyledButtonProps['appearance'];
|
|
568
|
-
/**
|
|
569
|
-
* Change the button height and font-size
|
|
570
|
-
*/
|
|
571
|
-
size?: StyledButtonProps['size'];
|
|
572
|
-
/**
|
|
573
|
-
* Make border-radius circle
|
|
574
|
-
*/
|
|
575
|
-
rounded?: StyledButtonProps['rounded'];
|
|
576
|
-
/**
|
|
577
|
-
* Add spinner and disable
|
|
578
|
-
*/
|
|
579
|
-
loading?: StyledButtonProps['loading'];
|
|
580
|
-
/**
|
|
581
|
-
* Make width 100%
|
|
582
|
-
*/
|
|
583
|
-
fluid?: StyledButtonProps['fluid'];
|
|
584
|
-
/**
|
|
585
|
-
* Prevent pointer events
|
|
586
|
-
*/
|
|
587
|
-
disabled?: boolean;
|
|
588
|
-
/**
|
|
589
|
-
* A URL to link when using the button as a link
|
|
590
|
-
*/
|
|
591
|
-
href?: string;
|
|
592
|
-
/**
|
|
593
|
-
* The target window using the button as a link
|
|
594
|
-
*/
|
|
595
|
-
target?: string;
|
|
596
|
-
/**
|
|
597
|
-
* The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel)
|
|
598
|
-
*/
|
|
599
|
-
rel?: string;
|
|
600
|
-
/**
|
|
601
|
-
* Alias for onPress
|
|
602
|
-
*/
|
|
603
|
-
onClick?: AriaButtonProps['onPress'];
|
|
604
|
-
}
|
|
605
|
-
declare const Button: react__default.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
3
|
+
declare type ButtonProps = any;
|
|
4
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
606
5
|
|
|
607
6
|
export { Button, ButtonProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-button",
|
|
3
|
-
"version": "3.2.0-deprecated-button.
|
|
3
|
+
"version": "3.2.0-deprecated-button.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -30,17 +30,9 @@
|
|
|
30
30
|
"@react-aria/focus": "^3.10.0",
|
|
31
31
|
"@react-aria/link": "^3.3.0",
|
|
32
32
|
"@react-aria/utils": "^3.13.0",
|
|
33
|
-
"@
|
|
34
|
-
"@mirohq/design-system-
|
|
35
|
-
"@mirohq/design-system-
|
|
36
|
-
"@mirohq/design-system-spinner": "^1.1.35",
|
|
37
|
-
"@mirohq/design-system-stitches": "^2.6.1",
|
|
38
|
-
"@mirohq/design-system-types": "^0.6.2",
|
|
39
|
-
"@mirohq/design-system-utils": "^0.15.0"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@types/lodash.capitalize": "^4.2.7",
|
|
43
|
-
"lodash.capitalize": "^3.0.0"
|
|
33
|
+
"@mirohq/design-system-stitches": "^2.6.14",
|
|
34
|
+
"@mirohq/design-system-spinner": "^1.1.48",
|
|
35
|
+
"@mirohq/design-system-primitive": "^1.1.2"
|
|
44
36
|
},
|
|
45
37
|
"scripts": {
|
|
46
38
|
"build": "rollup -c ../../../rollup.config.js",
|