@mirohq/design-system-button 3.2.0-deprecated-button.1 → 4.0.0-button-api-changes.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
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,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,EAAA,UAAA;AAAA,EACd,SAAW,EAAA,QAAA;AAAA,EACX,aAAe,EAAA,QAAA;A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AAK,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;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../src/hooks/use-button-context.tsx","../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { PropsWithChildren } from 'react'\n\nimport type { StyledButtonProps } from '../button.styled'\n\ninterface ButtonProps {\n size?: StyledButtonProps['size']\n}\n\ninterface ButtonContextProps extends ButtonProps {}\n\nexport type ButtonProviderProps = ButtonProps\n\nconst ButtonContext = createContext<ButtonContextProps>({} as any)\n\nexport const ButtonProvider = ({\n children,\n ...restProps\n}: PropsWithChildren<ButtonProviderProps>): JSX.Element => (\n <ButtonContext.Provider\n value={{\n ...restProps,\n }}\n >\n {children}\n </ButtonContext.Provider>\n)\n\nexport const useButtonContext = (): ButtonContextProps =>\n useContext(ButtonContext)\n","import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport type {\n IconReactElement,\n IconSizes,\n IconWeights,\n} from '@mirohq/design-system-base-icon'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\n\nimport { useButtonContext } from '../hooks/use-button-context'\nimport type { StyledButtonProps } from '../button.styled'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\ntype ButtonSize = ExtractValidKeys<StyledButtonProps['size']>\n\nconst buttonIconSizes: { [key in ButtonSize]: IconSizes } = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n 'x-large': 'medium',\n}\n\nconst buttonIconWeights: { [key in ButtonSize]: IconWeights } = {\n small: 'thin',\n medium: 'thin',\n large: 'normal',\n 'x-large': 'normal',\n}\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => {\n const { size } = useButtonContext()\n\n const formattedChildren = addPropsToChildren(\n children,\n child => isIconComponent(child as IconReactElement),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n weight: buttonIconWeights[size as ButtonSize],\n }\n )\n\n return (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {formattedChildren}\n </StyledIconSlot>\n )\n})\n","import { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\nimport type { ComponentPropsWithRef } from 'react'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nconst solidDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst outlineDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst ghostDisabled: CSS = {\n [disabledSelector]: {\n color: '$text-neutrals-disabled',\n backgroundColor: '$transparent',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst LABEL_OFFSET = 2\n\nexport const StyledButton = styled(BaseButton, {\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n position: 'relative',\n width: 'fit-content',\n maxWidth: '100%',\n\n lineHeight: 1,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-400 !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 primary: {\n backgroundColor: '$background-primary-prominent',\n color: '$text-primary-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-active',\n },\n\n ...solidDisabled,\n },\n secondary: {\n backgroundColor: '$background-neutrals-subtle',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...solidDisabled,\n },\n\n tertiary: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-primary',\n color: '$text-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n ghost: {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n 'ghost-subtle': {\n backgroundColor: 'transparent',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n ...ghostDisabled,\n },\n danger: {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-prominent-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'danger-secondary': {\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...ghostDisabled,\n },\n },\n size: {\n 'x-large': {\n height: sizes.xLarge,\n fontSize: '$200',\n paddingX: `calc($200 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n large: {\n height: sizes.large,\n fontSize: '$200',\n paddingX: `calc($150 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n medium: {\n height: sizes.medium,\n fontSize: '$175',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n ...baseIconStyles.weight.thin,\n },\n },\n small: {\n fontSize: '$175',\n height: '$6',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n ...baseIconStyles.weight.thin,\n },\n },\n },\n rounded: {\n true: {\n borderRadius: '$round',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import type { BaseButtonProps } from '@mirohq/design-system-base-button'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { ButtonProvider } from './hooks/use-button-context'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\nexport type ButtonProps = {\n /**\n * Change the button style.\n * @default 'primary'\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n * @default 'large'\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n * @default false\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n * @default false\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n * @default false\n */\n fluid?: StyledButtonProps['fluid']\n} & BaseButtonProps\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n asChild = false,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n let formattedChildren = children\n\n if (loading) {\n const spinnerTestId =\n process.env.NODE_ENV === 'test' ? 'button-spinner' : undefined\n\n if (\n asChild &&\n React.Children.toArray(children).length === 1 &&\n React.isValidElement(children)\n ) {\n // when using asChild we need to render element to merge props with first,\n // and spinner wrapper should be rendered between the element and its content\n const firstLevelChild = React.Children.only(children)\n\n const { children: secondLevelChildren, ...childProps } =\n firstLevelChild.props\n\n formattedChildren = React.cloneElement(firstLevelChild, {\n ...childProps,\n children: (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{secondLevelChildren}</StyledHiddenContent>\n </>\n ),\n })\n } else {\n formattedChildren = (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{children}</StyledHiddenContent>\n </>\n )\n }\n }\n\n return (\n <ButtonProvider size={size}>\n <StyledButton\n {...restProps}\n asChild={asChild}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {formattedChildren}\n </StyledButton>\n </ButtonProvider>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["baseIconStyles"],"mappings":";;;;;;;;;;AAaA,MAAM,aAAA,GAAgB,aAAkC,CAAA,EAAS,CAAA,CAAA;AAE1D,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,GAAG,SAAA;AACL,CACE,qBAAA,GAAA;AAAA,EAAC,aAAc,CAAA,QAAA;AAAA,EAAd;AAAA,IACC,KAAO,EAAA;AAAA,MACL,GAAG,SAAA;AAAA,KACL;AAAA,IAEC,QAAA;AAAA,GAAA;AACH,CAAA,CAAA;AAGW,MAAA,gBAAA,GAAmB,MAC9B,UAAA,CAAW,aAA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AA,iBAAA,mBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,oBAAiB,aAAa,EAAA,aAAA,EAC7B,8BAAC,OAAQ,EAAA,EAAA,IAAA,EAAM,aAAa,CAC9B,EAAA,CAAA;AAAA,0BACA,GAAA,CAAC,uBAAqB,QAAS,EAAA,CAAA;AAAA,SACjC,EAAA,CAAA,CAAA;AAAA,OAEJ;AAAA,KACF;AAEA,IACE,uBAAA,GAAA,CAAC,kBAAe,IACd,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAA;AAAA,QACJ,OAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,IAAA;AAAA,QAEA,eAAA,EAAe,yBAAyB,IAAO,GAAA,KAAA,CAAA;AAAA,QAC/C,GAAK,EAAA,UAAA;AAAA,QAEJ,QAAA,EAAA,iBAAA;AAAA,OAAA;AAAA,KAEL,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,EAAA;AAUA,MAAA,CAAO,QAAW,GAAA,QAAA,CAAA;AAClB,MAAA,CAAO,KAAQ,GAAA,KAAA;;;;"}
package/dist/types.d.ts CHANGED
@@ -1,6 +1,81 @@
1
- import React from 'react';
1
+ import { BaseButtonProps } from '@mirohq/design-system-base-button';
2
+ import * as react from 'react';
3
+ import react__default, { ComponentPropsWithRef } from 'react';
4
+ import * as packages_components_internal_base_button_src_base_button from 'packages/components/internal/base-button/src/base-button';
5
+ import * as _mirohq_design_system_hooks_use_press from '@mirohq/design-system-hooks/use-press';
6
+ import * as _stitches_react_types_styled_component from '@stitches/react/types/styled-component';
7
+ import * as _mirohq_design_system_stitches from '@mirohq/design-system-stitches';
8
+ import * as _mirohq_design_system_primitive from '@mirohq/design-system-primitive';
2
9
 
3
- declare type ButtonProps = any;
4
- declare const Button: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
10
+ declare const StyledButton: react.ForwardRefExoticComponent<(Omit<Omit<Omit<Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement> & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents, "ref"> & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>, _mirohq_design_system_stitches.ForbiddenProps> & {
11
+ children?: react.ReactNode;
12
+ }, "size" | "variant" | "rounded" | "fluid"> & _stitches_react_types_styled_component.TransformProps<{
13
+ variant?: "primary" | "secondary" | "tertiary" | "ghost" | "ghost-subtle" | "danger" | "danger-secondary" | "ghost-danger" | undefined;
14
+ size?: "small" | "medium" | "large" | "x-large" | undefined;
15
+ rounded?: boolean | "true" | undefined;
16
+ fluid?: boolean | "true" | undefined;
17
+ }, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> | Omit<Omit<Omit<Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement> & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents & react.AnchorHTMLAttributes<"a"> & {
18
+ href: string;
19
+ }, "ref"> & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>, _mirohq_design_system_stitches.ForbiddenProps> & {
20
+ children?: react.ReactNode;
21
+ }, "size" | "variant" | "rounded" | "fluid"> & _stitches_react_types_styled_component.TransformProps<{
22
+ variant?: "primary" | "secondary" | "tertiary" | "ghost" | "ghost-subtle" | "danger" | "danger-secondary" | "ghost-danger" | undefined;
23
+ size?: "small" | "medium" | "large" | "x-large" | undefined;
24
+ rounded?: boolean | "true" | undefined;
25
+ fluid?: boolean | "true" | undefined;
26
+ }, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<(Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement> & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents, "ref"> | Omit<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement> & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents & react.AnchorHTMLAttributes<"a"> & {
27
+ href: string;
28
+ }, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>, {
29
+ variant?: "primary" | "secondary" | "tertiary" | "ghost" | "ghost-subtle" | "danger" | "danger-secondary" | "ghost-danger" | undefined;
30
+ size?: "small" | "medium" | "large" | "x-large" | undefined;
31
+ rounded?: boolean | "true" | undefined;
32
+ fluid?: boolean | "true" | undefined;
33
+ }, {}>;
34
+ declare type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>;
35
+
36
+ declare const StyledIconSlot: react__default.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react__default.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"div">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react__default.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react__default.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"div">>, {}, {}>;
37
+ declare type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>;
38
+ interface IconSlotProps extends StyledIconSlotProps {
39
+ /**
40
+ * The icon.
41
+ */
42
+ children: react__default.ReactNode;
43
+ }
44
+ declare const IconSlot: react__default.ForwardRefExoticComponent<Omit<IconSlotProps, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
45
+
46
+ declare const Label: react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>;
47
+
48
+ declare type ButtonProps = {
49
+ /**
50
+ * Change the button style.
51
+ * @default 'primary'
52
+ */
53
+ variant?: StyledButtonProps['variant'];
54
+ /**
55
+ * Change the button size.
56
+ * @default 'large'
57
+ */
58
+ size?: StyledButtonProps['size'];
59
+ /**
60
+ * Make button border rounded.
61
+ * @default false
62
+ */
63
+ rounded?: StyledButtonProps['rounded'];
64
+ /**
65
+ * Add spinner and disable.
66
+ * @default false
67
+ */
68
+ loading?: boolean;
69
+ /**
70
+ * Make width 100%.
71
+ * @default false
72
+ */
73
+ fluid?: StyledButtonProps['fluid'];
74
+ } & BaseButtonProps;
75
+ declare const Button: react__default.ForwardRefExoticComponent<ButtonProps> & Partials;
76
+ interface Partials {
77
+ IconSlot: typeof IconSlot;
78
+ Label: typeof Label;
79
+ }
5
80
 
6
81
  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.1",
3
+ "version": "4.0.0-button-api-changes.0",
4
4
  "description": "",
5
5
  "author": "Miro",
6
6
  "source": "src/index.ts",
@@ -26,13 +26,14 @@
26
26
  "react": "^16.14 || ^17 || ^18"
27
27
  },
28
28
  "dependencies": {
29
- "@react-aria/button": "^3.5.0",
30
- "@react-aria/focus": "^3.10.0",
31
- "@react-aria/link": "^3.3.0",
32
- "@react-aria/utils": "^3.13.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"
29
+ "@mirohq/design-system-base-button": "^0.4.56",
30
+ "@mirohq/design-system-base-icon": "^0.1.33",
31
+ "@mirohq/design-system-primitive": "^1.1.2",
32
+ "@mirohq/design-system-stitches": "^2.6.19",
33
+ "@mirohq/design-system-spinner": "^1.1.53",
34
+ "@mirohq/design-system-styles": "^1.2.19",
35
+ "@mirohq/design-system-types": "^0.10.0",
36
+ "@mirohq/design-system-utils": "^0.15.4"
36
37
  },
37
38
  "scripts": {
38
39
  "build": "rollup -c ../../../rollup.config.js",