@mirohq/design-system-icon-button 1.3.22 → 1.3.23

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 CHANGED
@@ -29,7 +29,7 @@ const StyledIconButton = designSystemStitches.styled(designSystemBaseButton.Base
29
29
  ...designSystemStyles.focus.css({
30
30
  boxShadow: "$focus-small"
31
31
  }),
32
- "&:hover": {
32
+ _hover: {
33
33
  backgroundColor: "$background-primary-prominent-hover"
34
34
  },
35
35
  [activeSelector]: {
@@ -46,7 +46,7 @@ const StyledIconButton = designSystemStitches.styled(designSystemBaseButton.Base
46
46
  ...designSystemStyles.focus.css({
47
47
  boxShadow: "$focus-small"
48
48
  }),
49
- "&:hover": {
49
+ _hover: {
50
50
  backgroundColor: "$background-neutrals-subtle-hover"
51
51
  },
52
52
  [activeSelector]: {
@@ -65,7 +65,7 @@ const StyledIconButton = designSystemStitches.styled(designSystemBaseButton.Base
65
65
  boxShadow: "$focus-small-outline",
66
66
  borderColor: "$blue-500 !important"
67
67
  }),
68
- "&:hover": {
68
+ _hover: {
69
69
  backgroundColor: "$background-neutrals-subtle-hover",
70
70
  borderColor: "$border-neutrals-hover"
71
71
  },
@@ -85,7 +85,7 @@ const StyledIconButton = designSystemStitches.styled(designSystemBaseButton.Base
85
85
  ...designSystemStyles.focus.css({
86
86
  boxShadow: "$focus-small"
87
87
  }),
88
- "&:hover": {
88
+ _hover: {
89
89
  backgroundColor: "$background-neutrals-subtle-hover"
90
90
  },
91
91
  [activeSelector]: {
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/icon-buttons.styled.ts","../src/icon-button.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport type { ComponentPropsWithRef } from 'react'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nexport const StyledIconButton = styled(BaseButton, {\n justifyContent: 'center',\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$icon-primary-inverted',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n '&:hover': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$icon-neutrals-disabled',\n },\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$icon-neutrals',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$icon-neutrals-disabled',\n },\n },\n outline: {\n backgroundColor: '$background-neutrals',\n color: '$icon-neutrals',\n border: '1px solid $border-neutrals',\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n }),\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n color: '$icon-neutrals-disabled',\n borderColor: '$border-neutrals-disabled',\n },\n },\n ghost: {\n color: '$icon-neutrals',\n backgroundColor: 'transparent',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n [disabledSelector]: {\n color: '$icon-neutrals-disabled',\n backgroundColor: '$transparent',\n },\n },\n },\n size: {\n medium: {\n height: sizes.medium,\n width: sizes.medium,\n paddingX: '$50',\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n ...baseIconStyles.weight.thin,\n },\n },\n large: {\n height: sizes.large,\n width: sizes.large,\n paddingX: '$100',\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n 'x-large': {\n height: sizes.xLarge,\n width: sizes.xLarge,\n paddingX: '$150',\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n },\n },\n})\n\nexport type StyledIconButtonProps = ComponentPropsWithRef<\n typeof StyledIconButton\n>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport type { TooltipContentProps } from '@mirohq/design-system-tooltip'\nimport { Tooltip } from '@mirohq/design-system-tooltip'\nimport { Badge } from '@mirohq/design-system-badge'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { IconReactElement } from '@mirohq/design-system-base-icon'\nimport type { BaseButtonProps } from '@mirohq/design-system-base-button'\n\nimport type { StyledIconButtonProps } from './icon-buttons.styled'\nimport { StyledIconButton } from './icon-buttons.styled'\n\nexport type IconButtonProps = {\n /**\n * Change the Icon button style\n */\n variant?: StyledIconButtonProps['variant']\n\n /**\n * Change the Icon button size\n */\n size?: StyledIconButtonProps['size']\n\n /**\n * Icon button label used to provide a description.\n */\n label: string\n\n /**\n * The duration of a the delay before a tooltip is shown.\n */\n tooltipOpen?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n tooltipOnOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n tooltipOnClose?: () => void\n\n /**\n * The duration of a the delay before a tooltip is shown.\n */\n tooltipDelayDuration?: number\n\n /**\n * \tHow much time a user has to enter another trigger without incurring a\n * \tdelay again.\n */\n tooltipSkipDelayDuration?: number\n\n /**\n * The preferred side of the trigger to render against when open. Will be\n * reversed when collisions occur and avoidCollisions is enabled.\n */\n tooltipSide?: TooltipContentProps['side']\n\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n tooltipAlign?: TooltipContentProps['align']\n\n /**\n * Wraps the Icon button with a badge.\n */\n showBadge?: boolean\n\n /**\n * The content to be displayed inside of the badge.\n */\n badgeContent?: string\n} & BaseButtonProps\n\nexport const IconButton = React.forwardRef<\n ElementRef<typeof StyledIconButton>,\n IconButtonProps\n>(\n (\n {\n children,\n showBadge = false,\n badgeContent,\n label,\n tooltipOpen,\n tooltipOnOpen,\n tooltipOnClose,\n tooltipDelayDuration,\n tooltipSkipDelayDuration,\n tooltipAlign = 'center',\n tooltipSide = 'bottom',\n variant = 'ghost',\n size = 'large',\n 'aria-label': ariaLabel,\n ...restProps\n },\n forwardRef\n ) => {\n const isIcon = isIconComponent(children as IconReactElement)\n const iconComponentProps = {\n 'data-icon-component': '',\n size: size === 'medium' ? 'small' : 'medium',\n weight: size === 'medium' ? 'thin' : 'normal',\n }\n\n const formattedChildren = addPropsToChildren(children, () => true, {\n 'aria-hidden': 'true',\n ...(isIcon && iconComponentProps),\n })\n\n let badgeOffset = {}\n if (size === 'medium') {\n badgeOffset =\n badgeContent !== undefined && badgeContent !== ''\n ? { offsetX: -7, offsetY: -5 }\n : { offsetX: 3, offsetY: -3 }\n }\n\n return (\n <Tooltip\n open={tooltipOpen}\n onOpen={tooltipOnOpen}\n onClose={tooltipOnClose}\n delayDuration={tooltipDelayDuration}\n skipDelayDuration={tooltipSkipDelayDuration}\n >\n <Tooltip.Trigger asChild>\n <StyledIconButton\n {...restProps}\n variant={variant}\n size={size}\n ref={forwardRef}\n aria-label={ariaLabel ?? label}\n >\n <Badge\n {...badgeOffset}\n show={showBadge}\n content={badgeContent}\n inverted={variant === 'solid-prominent'}\n >\n {formattedChildren}\n </Badge>\n </StyledIconButton>\n </Tooltip.Trigger>\n <Tooltip.Content\n align={tooltipAlign}\n side={tooltipSide}\n hideWhenDetached\n >\n {label}\n </Tooltip.Content>\n </Tooltip>\n )\n }\n)\n"],"names":["styled","BaseButton","focus","sizes","baseIconStyles","React","isIconComponent","addPropsToChildren","jsxs","Tooltip","jsx","Badge"],"mappings":";;;;;;;;;;;;;;;;;;AAMA,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,gBAAmB,GAAA,sCAAA,CAAA;AACzB,MAAM,oBACJ,GAAA,oEAAA,CAAA;AAEW,MAAA,gBAAA,GAAmBA,4BAAOC,iCAAY,EAAA;AAAA,EACjD,cAAgB,EAAA,QAAA;AAAA,EAChB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,iBAAmB,EAAA;AAAA,QACjB,eAAiB,EAAA,+BAAA;AAAA,QACjB,KAAO,EAAA,wBAAA;AAAA,QAEP,GAAGC,yBAAM,GAAI,CAAA;AAAA,UACX,SAAW,EAAA,cAAA;AAAA,SACZ,CAAA;AAAA,QAED,SAAW,EAAA;AAAA,UACT,eAAiB,EAAA,qCAAA;AAAA,SACnB;AAAA,QACA,CAAC,cAAc,GAAG;AAAA,UAChB,eAAiB,EAAA,sCAAA;AAAA,SACnB;AAAA,QACA,CAAC,gBAAgB,GAAG;AAAA,UAClB,eAAiB,EAAA,+BAAA;AAAA,UACjB,KAAO,EAAA,yBAAA;AAAA,SACT;AAAA,OACF;AAAA,MACA,cAAgB,EAAA;AAAA,QACd,eAAiB,EAAA,6BAAA;AAAA,QACjB,KAAO,EAAA,gBAAA;AAAA,QAEP,GAAGA,yBAAM,GAAI,CAAA;AAAA,UACX,SAAW,EAAA,cAAA;AAAA,SACZ,CAAA;AAAA,QAED,SAAW,EAAA;AAAA,UACT,eAAiB,EAAA,mCAAA;AAAA,SACnB;AAAA,QACA,CAAC,cAAc,GAAG;AAAA,UAChB,eAAiB,EAAA,oCAAA;AAAA,SACnB;AAAA,QACA,CAAC,gBAAgB,GAAG;AAAA,UAClB,eAAiB,EAAA,+BAAA;AAAA,U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AA,kBACJ,IAAM,EAAA,SAAA;AAAA,kBACN,OAAS,EAAA,YAAA;AAAA,kBACT,UAAU,OAAY,KAAA,iBAAA;AAAA,kBAErB,QAAA,EAAA,iBAAA;AAAA,iBAAA;AAAA,eACH;AAAA,aAAA;AAAA,WAEJ,EAAA,CAAA;AAAA,0BACAD,cAAA;AAAA,YAACD,2BAAQ,CAAA,OAAA;AAAA,YAAR;AAAA,cACC,KAAO,EAAA,YAAA;AAAA,cACP,IAAM,EAAA,WAAA;AAAA,cACN,gBAAgB,EAAA,IAAA;AAAA,cAEf,QAAA,EAAA,KAAA;AAAA,aAAA;AAAA,WACH;AAAA,SAAA;AAAA,OAAA;AAAA,KACF,CAAA;AAAA,GAEJ;AACF;;;;"}
1
+ {"version":3,"file":"main.js","sources":["../src/icon-buttons.styled.ts","../src/icon-button.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport type { ComponentPropsWithRef } from 'react'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nexport const StyledIconButton = styled(BaseButton, {\n justifyContent: 'center',\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$icon-primary-inverted',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n _hover: {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$icon-neutrals-disabled',\n },\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$icon-neutrals',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n _hover: {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$icon-neutrals-disabled',\n },\n },\n outline: {\n backgroundColor: '$background-neutrals',\n color: '$icon-neutrals',\n border: '1px solid $border-neutrals',\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n }),\n\n _hover: {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n color: '$icon-neutrals-disabled',\n borderColor: '$border-neutrals-disabled',\n },\n },\n ghost: {\n color: '$icon-neutrals',\n backgroundColor: 'transparent',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n _hover: {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n [disabledSelector]: {\n color: '$icon-neutrals-disabled',\n backgroundColor: '$transparent',\n },\n },\n },\n size: {\n medium: {\n height: sizes.medium,\n width: sizes.medium,\n paddingX: '$50',\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n ...baseIconStyles.weight.thin,\n },\n },\n large: {\n height: sizes.large,\n width: sizes.large,\n paddingX: '$100',\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n 'x-large': {\n height: sizes.xLarge,\n width: sizes.xLarge,\n paddingX: '$150',\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n },\n },\n})\n\nexport type StyledIconButtonProps = ComponentPropsWithRef<\n typeof StyledIconButton\n>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport type { TooltipContentProps } from '@mirohq/design-system-tooltip'\nimport { Tooltip } from '@mirohq/design-system-tooltip'\nimport { Badge } from '@mirohq/design-system-badge'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { IconReactElement } from '@mirohq/design-system-base-icon'\nimport type { BaseButtonProps } from '@mirohq/design-system-base-button'\n\nimport type { StyledIconButtonProps } from './icon-buttons.styled'\nimport { StyledIconButton } from './icon-buttons.styled'\n\nexport type IconButtonProps = {\n /**\n * Change the Icon button style\n */\n variant?: StyledIconButtonProps['variant']\n\n /**\n * Change the Icon button size\n */\n size?: StyledIconButtonProps['size']\n\n /**\n * Icon button label used to provide a description.\n */\n label: string\n\n /**\n * The duration of a the delay before a tooltip is shown.\n */\n tooltipOpen?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n tooltipOnOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n tooltipOnClose?: () => void\n\n /**\n * The duration of a the delay before a tooltip is shown.\n */\n tooltipDelayDuration?: number\n\n /**\n * \tHow much time a user has to enter another trigger without incurring a\n * \tdelay again.\n */\n tooltipSkipDelayDuration?: number\n\n /**\n * The preferred side of the trigger to render against when open. Will be\n * reversed when collisions occur and avoidCollisions is enabled.\n */\n tooltipSide?: TooltipContentProps['side']\n\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n tooltipAlign?: TooltipContentProps['align']\n\n /**\n * Wraps the Icon button with a badge.\n */\n showBadge?: boolean\n\n /**\n * The content to be displayed inside of the badge.\n */\n badgeContent?: string\n} & BaseButtonProps\n\nexport const IconButton = React.forwardRef<\n ElementRef<typeof StyledIconButton>,\n IconButtonProps\n>(\n (\n {\n children,\n showBadge = false,\n badgeContent,\n label,\n tooltipOpen,\n tooltipOnOpen,\n tooltipOnClose,\n tooltipDelayDuration,\n tooltipSkipDelayDuration,\n tooltipAlign = 'center',\n tooltipSide = 'bottom',\n variant = 'ghost',\n size = 'large',\n 'aria-label': ariaLabel,\n ...restProps\n },\n forwardRef\n ) => {\n const isIcon = isIconComponent(children as IconReactElement)\n const iconComponentProps = {\n 'data-icon-component': '',\n size: size === 'medium' ? 'small' : 'medium',\n weight: size === 'medium' ? 'thin' : 'normal',\n }\n\n const formattedChildren = addPropsToChildren(children, () => true, {\n 'aria-hidden': 'true',\n ...(isIcon && iconComponentProps),\n })\n\n let badgeOffset = {}\n if (size === 'medium') {\n badgeOffset =\n badgeContent !== undefined && badgeContent !== ''\n ? { offsetX: -7, offsetY: -5 }\n : { offsetX: 3, offsetY: -3 }\n }\n\n return (\n <Tooltip\n open={tooltipOpen}\n onOpen={tooltipOnOpen}\n onClose={tooltipOnClose}\n delayDuration={tooltipDelayDuration}\n skipDelayDuration={tooltipSkipDelayDuration}\n >\n <Tooltip.Trigger asChild>\n <StyledIconButton\n {...restProps}\n variant={variant}\n size={size}\n ref={forwardRef}\n aria-label={ariaLabel ?? label}\n >\n <Badge\n {...badgeOffset}\n show={showBadge}\n content={badgeContent}\n inverted={variant === 'solid-prominent'}\n >\n {formattedChildren}\n </Badge>\n </StyledIconButton>\n </Tooltip.Trigger>\n <Tooltip.Content\n align={tooltipAlign}\n side={tooltipSide}\n hideWhenDetached\n >\n {label}\n </Tooltip.Content>\n </Tooltip>\n )\n }\n)\n"],"names":["styled","BaseButton","focus","sizes","baseIconStyles","React","isIconComponent","addPropsToChildren","jsxs","Tooltip","jsx","Badge"],"mappings":";;;;;;;;;;;;;;;;;;AAMA,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,gBAAmB,GAAA,sCAAA,CAAA;AACzB,MAAM,oBACJ,GAAA,oEAAA,CAAA;AAEW,MAAA,gBAAA,GAAmBA,4BAAOC,iCAAY,EAAA;AAAA,EACjD,cAAgB,EAAA,QAAA;AAAA,EAChB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,iBAAmB,EAAA;AAAA,QACjB,eAAiB,EAAA,+BAAA;AAAA,QACjB,KAAO,EAAA,wBAAA;AAAA,QAEP,GAAGC,yBAAM,GAAI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css({
22
22
  boxShadow: "$focus-small"
23
23
  }),
24
- "&:hover": {
24
+ _hover: {
25
25
  backgroundColor: "$background-primary-prominent-hover"
26
26
  },
27
27
  [activeSelector]: {
@@ -38,7 +38,7 @@ const StyledIconButton = styled(BaseButton, {
38
38
  ...focus.css({
39
39
  boxShadow: "$focus-small"
40
40
  }),
41
- "&:hover": {
41
+ _hover: {
42
42
  backgroundColor: "$background-neutrals-subtle-hover"
43
43
  },
44
44
  [activeSelector]: {
@@ -57,7 +57,7 @@ const StyledIconButton = styled(BaseButton, {
57
57
  boxShadow: "$focus-small-outline",
58
58
  borderColor: "$blue-500 !important"
59
59
  }),
60
- "&:hover": {
60
+ _hover: {
61
61
  backgroundColor: "$background-neutrals-subtle-hover",
62
62
  borderColor: "$border-neutrals-hover"
63
63
  },
@@ -77,7 +77,7 @@ const StyledIconButton = styled(BaseButton, {
77
77
  ...focus.css({
78
78
  boxShadow: "$focus-small"
79
79
  }),
80
- "&:hover": {
80
+ _hover: {
81
81
  backgroundColor: "$background-neutrals-subtle-hover"
82
82
  },
83
83
  [activeSelector]: {
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../src/icon-buttons.styled.ts","../src/icon-button.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport type { ComponentPropsWithRef } from 'react'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nexport const StyledIconButton = styled(BaseButton, {\n justifyContent: 'center',\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$icon-primary-inverted',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n '&:hover': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$icon-neutrals-disabled',\n },\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$icon-neutrals',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$icon-neutrals-disabled',\n },\n },\n outline: {\n backgroundColor: '$background-neutrals',\n color: '$icon-neutrals',\n border: '1px solid $border-neutrals',\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n }),\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n color: '$icon-neutrals-disabled',\n borderColor: '$border-neutrals-disabled',\n },\n },\n ghost: {\n color: '$icon-neutrals',\n backgroundColor: 'transparent',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n '&:hover': {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n [disabledSelector]: {\n color: '$icon-neutrals-disabled',\n backgroundColor: '$transparent',\n },\n },\n },\n size: {\n medium: {\n height: sizes.medium,\n width: sizes.medium,\n paddingX: '$50',\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n ...baseIconStyles.weight.thin,\n },\n },\n large: {\n height: sizes.large,\n width: sizes.large,\n paddingX: '$100',\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n 'x-large': {\n height: sizes.xLarge,\n width: sizes.xLarge,\n paddingX: '$150',\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n },\n },\n})\n\nexport type StyledIconButtonProps = ComponentPropsWithRef<\n typeof StyledIconButton\n>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport type { TooltipContentProps } from '@mirohq/design-system-tooltip'\nimport { Tooltip } from '@mirohq/design-system-tooltip'\nimport { Badge } from '@mirohq/design-system-badge'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { IconReactElement } from '@mirohq/design-system-base-icon'\nimport type { BaseButtonProps } from '@mirohq/design-system-base-button'\n\nimport type { StyledIconButtonProps } from './icon-buttons.styled'\nimport { StyledIconButton } from './icon-buttons.styled'\n\nexport type IconButtonProps = {\n /**\n * Change the Icon button style\n */\n variant?: StyledIconButtonProps['variant']\n\n /**\n * Change the Icon button size\n */\n size?: StyledIconButtonProps['size']\n\n /**\n * Icon button label used to provide a description.\n */\n label: string\n\n /**\n * The duration of a the delay before a tooltip is shown.\n */\n tooltipOpen?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n tooltipOnOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n tooltipOnClose?: () => void\n\n /**\n * The duration of a the delay before a tooltip is shown.\n */\n tooltipDelayDuration?: number\n\n /**\n * \tHow much time a user has to enter another trigger without incurring a\n * \tdelay again.\n */\n tooltipSkipDelayDuration?: number\n\n /**\n * The preferred side of the trigger to render against when open. Will be\n * reversed when collisions occur and avoidCollisions is enabled.\n */\n tooltipSide?: TooltipContentProps['side']\n\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n tooltipAlign?: TooltipContentProps['align']\n\n /**\n * Wraps the Icon button with a badge.\n */\n showBadge?: boolean\n\n /**\n * The content to be displayed inside of the badge.\n */\n badgeContent?: string\n} & BaseButtonProps\n\nexport const IconButton = React.forwardRef<\n ElementRef<typeof StyledIconButton>,\n IconButtonProps\n>(\n (\n {\n children,\n showBadge = false,\n badgeContent,\n label,\n tooltipOpen,\n tooltipOnOpen,\n tooltipOnClose,\n tooltipDelayDuration,\n tooltipSkipDelayDuration,\n tooltipAlign = 'center',\n tooltipSide = 'bottom',\n variant = 'ghost',\n size = 'large',\n 'aria-label': ariaLabel,\n ...restProps\n },\n forwardRef\n ) => {\n const isIcon = isIconComponent(children as IconReactElement)\n const iconComponentProps = {\n 'data-icon-component': '',\n size: size === 'medium' ? 'small' : 'medium',\n weight: size === 'medium' ? 'thin' : 'normal',\n }\n\n const formattedChildren = addPropsToChildren(children, () => true, {\n 'aria-hidden': 'true',\n ...(isIcon && iconComponentProps),\n })\n\n let badgeOffset = {}\n if (size === 'medium') {\n badgeOffset =\n badgeContent !== undefined && badgeContent !== ''\n ? { offsetX: -7, offsetY: -5 }\n : { offsetX: 3, offsetY: -3 }\n }\n\n return (\n <Tooltip\n open={tooltipOpen}\n onOpen={tooltipOnOpen}\n onClose={tooltipOnClose}\n delayDuration={tooltipDelayDuration}\n skipDelayDuration={tooltipSkipDelayDuration}\n >\n <Tooltip.Trigger asChild>\n <StyledIconButton\n {...restProps}\n variant={variant}\n size={size}\n ref={forwardRef}\n aria-label={ariaLabel ?? label}\n >\n <Badge\n {...badgeOffset}\n show={showBadge}\n content={badgeContent}\n inverted={variant === 'solid-prominent'}\n >\n {formattedChildren}\n </Badge>\n </StyledIconButton>\n </Tooltip.Trigger>\n <Tooltip.Content\n align={tooltipAlign}\n side={tooltipSide}\n hideWhenDetached\n >\n {label}\n </Tooltip.Content>\n </Tooltip>\n )\n }\n)\n"],"names":["baseIconStyles"],"mappings":";;;;;;;;;;AAMA,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,gBAAmB,GAAA,sCAAA,CAAA;AACzB,MAAM,oBACJ,GAAA,oEAAA,CAAA;AAEW,MAAA,gBAAA,GAAmB,OAAO,UAAY,EAAA;AAAA,EACjD,cAAgB,EAAA,QAAA;AAAA,E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AAA,KACF,CAAA;AAAA,GAEJ;AACF;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../src/icon-buttons.styled.ts","../src/icon-button.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport type { ComponentPropsWithRef } from 'react'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nexport const StyledIconButton = styled(BaseButton, {\n justifyContent: 'center',\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '$background-primary-prominent',\n color: '$icon-primary-inverted',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n _hover: {\n backgroundColor: '$background-primary-prominent-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-primary-prominent-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$icon-neutrals-disabled',\n },\n },\n 'solid-subtle': {\n backgroundColor: '$background-neutrals-subtle',\n color: '$icon-neutrals',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n _hover: {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$icon-neutrals-disabled',\n },\n },\n outline: {\n backgroundColor: '$background-neutrals',\n color: '$icon-neutrals',\n border: '1px solid $border-neutrals',\n\n ...focus.css({\n boxShadow: '$focus-small-outline',\n borderColor: '$blue-500 !important',\n }),\n\n _hover: {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n color: '$icon-neutrals-disabled',\n borderColor: '$border-neutrals-disabled',\n },\n },\n ghost: {\n color: '$icon-neutrals',\n backgroundColor: 'transparent',\n\n ...focus.css({\n boxShadow: '$focus-small',\n }),\n\n _hover: {\n backgroundColor: '$background-neutrals-subtle-hover',\n },\n [activeSelector]: {\n backgroundColor: '$background-neutrals-subtle-active',\n },\n [disabledSelector]: {\n color: '$icon-neutrals-disabled',\n backgroundColor: '$transparent',\n },\n },\n },\n size: {\n medium: {\n height: sizes.medium,\n width: sizes.medium,\n paddingX: '$50',\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n ...baseIconStyles.weight.thin,\n },\n },\n large: {\n height: sizes.large,\n width: sizes.large,\n paddingX: '$100',\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n 'x-large': {\n height: sizes.xLarge,\n width: sizes.xLarge,\n paddingX: '$150',\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n ...baseIconStyles.weight.normal,\n },\n },\n },\n },\n})\n\nexport type StyledIconButtonProps = ComponentPropsWithRef<\n typeof StyledIconButton\n>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport type { TooltipContentProps } from '@mirohq/design-system-tooltip'\nimport { Tooltip } from '@mirohq/design-system-tooltip'\nimport { Badge } from '@mirohq/design-system-badge'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { IconReactElement } from '@mirohq/design-system-base-icon'\nimport type { BaseButtonProps } from '@mirohq/design-system-base-button'\n\nimport type { StyledIconButtonProps } from './icon-buttons.styled'\nimport { StyledIconButton } from './icon-buttons.styled'\n\nexport type IconButtonProps = {\n /**\n * Change the Icon button style\n */\n variant?: StyledIconButtonProps['variant']\n\n /**\n * Change the Icon button size\n */\n size?: StyledIconButtonProps['size']\n\n /**\n * Icon button label used to provide a description.\n */\n label: string\n\n /**\n * The duration of a the delay before a tooltip is shown.\n */\n tooltipOpen?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n tooltipOnOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n tooltipOnClose?: () => void\n\n /**\n * The duration of a the delay before a tooltip is shown.\n */\n tooltipDelayDuration?: number\n\n /**\n * \tHow much time a user has to enter another trigger without incurring a\n * \tdelay again.\n */\n tooltipSkipDelayDuration?: number\n\n /**\n * The preferred side of the trigger to render against when open. Will be\n * reversed when collisions occur and avoidCollisions is enabled.\n */\n tooltipSide?: TooltipContentProps['side']\n\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n tooltipAlign?: TooltipContentProps['align']\n\n /**\n * Wraps the Icon button with a badge.\n */\n showBadge?: boolean\n\n /**\n * The content to be displayed inside of the badge.\n */\n badgeContent?: string\n} & BaseButtonProps\n\nexport const IconButton = React.forwardRef<\n ElementRef<typeof StyledIconButton>,\n IconButtonProps\n>(\n (\n {\n children,\n showBadge = false,\n badgeContent,\n label,\n tooltipOpen,\n tooltipOnOpen,\n tooltipOnClose,\n tooltipDelayDuration,\n tooltipSkipDelayDuration,\n tooltipAlign = 'center',\n tooltipSide = 'bottom',\n variant = 'ghost',\n size = 'large',\n 'aria-label': ariaLabel,\n ...restProps\n },\n forwardRef\n ) => {\n const isIcon = isIconComponent(children as IconReactElement)\n const iconComponentProps = {\n 'data-icon-component': '',\n size: size === 'medium' ? 'small' : 'medium',\n weight: size === 'medium' ? 'thin' : 'normal',\n }\n\n const formattedChildren = addPropsToChildren(children, () => true, {\n 'aria-hidden': 'true',\n ...(isIcon && iconComponentProps),\n })\n\n let badgeOffset = {}\n if (size === 'medium') {\n badgeOffset =\n badgeContent !== undefined && badgeContent !== ''\n ? { offsetX: -7, offsetY: -5 }\n : { offsetX: 3, offsetY: -3 }\n }\n\n return (\n <Tooltip\n open={tooltipOpen}\n onOpen={tooltipOnOpen}\n onClose={tooltipOnClose}\n delayDuration={tooltipDelayDuration}\n skipDelayDuration={tooltipSkipDelayDuration}\n >\n <Tooltip.Trigger asChild>\n <StyledIconButton\n {...restProps}\n variant={variant}\n size={size}\n ref={forwardRef}\n aria-label={ariaLabel ?? label}\n >\n <Badge\n {...badgeOffset}\n show={showBadge}\n content={badgeContent}\n inverted={variant === 'solid-prominent'}\n >\n {formattedChildren}\n </Badge>\n </StyledIconButton>\n </Tooltip.Trigger>\n <Tooltip.Content\n align={tooltipAlign}\n side={tooltipSide}\n hideWhenDetached\n >\n {label}\n </Tooltip.Content>\n </Tooltip>\n )\n }\n)\n"],"names":["baseIconStyles"],"mappings":";;;;;;;;;;AAMA,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,gBAAmB,GAAA,sCAAA,CAAA;AACzB,MAAM,oBACJ,GAAA,oEAAA,CAAA;AAEW,MAAA,gBAAA,GAAmB,OAAO,UAAY,EAAA;AAAA,EACjD,cAAgB,EAAA,QAAA;AAAA,EAChB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,iBAAmB,EAAA;AAAA,QACjB,eAAiB,EAAA,+BAAA;AAAA,QACjB,KAAO,EAAA,wBAAA;AAAA,QAEP,GAAG,MAAM,GAAI,CAAA;AAAA,UACX,SAAW,EAAA,cAAA;AAAA,SACZ,CAAA;AAAA,QAED,MAAQ,EAAA;AAAA,UACN,eAAiB,EAAA,qCAAA;AAAA,SACnB;AAAA,QACA,CAAC,cAAc,GAAG;AAAA,UAChB,eAAiB,EAAA,sCAAA;AAAA,SACnB;AAAA,QACA,CAAC,gBAAgB,GAAG;AAAA,UAClB,eAAiB,EAAA,+BAAA;AAAA,UACjB,KAAO,EAAA,yBAAA;AAAA,SACT;AAAA,OACF;AAAA,MACA,cAAgB,EAAA;AAAA,QACd,eAAiB,EAAA,6BAAA;AAAA,QACjB,KAAO,EAAA,gBAAA;AAAA,QAEP,GAAG,MAAM,GAAI,CAAA;AAAA,UACX,SAAW,EAAA,cAAA;AAAA,SACZ,CAAA;AAAA,QAED,MAAQ,EA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A,UAAA;AAAA,cACL,cAAY,SAAa,IAAA,IAAA,GAAA,SAAA,GAAA,KAAA;AAAA,cAEzB,QAAA,kBAAA,GAAA;AAAA,gBAAC,KAAA;AAAA,gBAAA;AAAA,kBACE,GAAG,WAAA;AAAA,kBACJ,IAAM,EAAA,SAAA;AAAA,kBACN,OAAS,EAAA,YAAA;AAAA,kBACT,UAAU,OAAY,KAAA,iBAAA;AAAA,kBAErB,QAAA,EAAA,iBAAA;AAAA,iBAAA;AAAA,eACH;AAAA,aAAA;AAAA,WAEJ,EAAA,CAAA;AAAA,0BACA,GAAA;AAAA,YAAC,OAAQ,CAAA,OAAA;AAAA,YAAR;AAAA,cACC,KAAO,EAAA,YAAA;AAAA,cACP,IAAM,EAAA,WAAA;AAAA,cACN,gBAAgB,EAAA,IAAA;AAAA,cAEf,QAAA,EAAA,KAAA;AAAA,aAAA;AAAA,WACH;AAAA,SAAA;AAAA,OAAA;AAAA,KACF,CAAA;AAAA,GAEJ;AACF;;;;"}
package/dist/types.d.ts CHANGED
@@ -3,6 +3,7 @@ import * as _mirohq_design_system_hooks_use_press from '@mirohq/design-system-ho
3
3
  import * as _mirohq_design_system_stitches from '@mirohq/design-system-stitches';
4
4
  import * as _stitches_react_types_styled_component from '@stitches/react/types/styled-component';
5
5
  import * as _stitches_react_types_css_util from '@stitches/react/types/css-util';
6
+ import * as _stitches_react from '@stitches/react';
6
7
  import * as _mirohq_design_system_components_primitive from '@mirohq/design-system-components/primitive';
7
8
  import * as react from 'react';
8
9
  import react__default, { ComponentPropsWithRef } from 'react';
@@ -494,6 +495,19 @@ declare const StyledIconButton: react.ForwardRefExoticComponent<Omit<Omit<_miroh
494
495
  readonly [$$PropertyValue]: "width";
495
496
  };
496
497
  };
498
+ _hover: (css: _stitches_react.CSS<{
499
+ media: {};
500
+ theme: {};
501
+ themeMap: {};
502
+ utils: {};
503
+ }>) => {
504
+ '&:hover, &[data-hovered]': _stitches_react.CSS<{
505
+ media: {};
506
+ theme: {};
507
+ themeMap: {};
508
+ utils: {};
509
+ }>;
510
+ };
497
511
  }>>>, 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<_stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<_mirohq_design_system_components_primitive.PrimitiveProps<"button">>, {}, {}, _stitches_react_types_css_util.CSS<{}, {
498
512
  'border-widths': {
499
513
  readonly none: 0;
@@ -979,6 +993,19 @@ declare const StyledIconButton: react.ForwardRefExoticComponent<Omit<Omit<_miroh
979
993
  readonly [$$PropertyValue]: "width";
980
994
  };
981
995
  };
996
+ _hover: (css: _stitches_react.CSS<{
997
+ media: {};
998
+ theme: {};
999
+ themeMap: {};
1000
+ utils: {};
1001
+ }>) => {
1002
+ '&:hover, &[data-hovered]': _stitches_react.CSS<{
1003
+ media: {};
1004
+ theme: {};
1005
+ themeMap: {};
1006
+ utils: {};
1007
+ }>;
1008
+ };
982
1009
  }>>>, 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"> & {
983
1010
  href: string;
984
1011
  }, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>, {}, {}, _stitches_react_types_css_util.CSS<{}, {
@@ -1466,6 +1493,19 @@ declare const StyledIconButton: react.ForwardRefExoticComponent<Omit<Omit<_miroh
1466
1493
  readonly [$$PropertyValue]: "width";
1467
1494
  };
1468
1495
  };
1496
+ _hover: (css: _stitches_react.CSS<{
1497
+ media: {};
1498
+ theme: {};
1499
+ themeMap: {};
1500
+ utils: {};
1501
+ }>) => {
1502
+ '&:hover, &[data-hovered]': _stitches_react.CSS<{
1503
+ media: {};
1504
+ theme: {};
1505
+ themeMap: {};
1506
+ utils: {};
1507
+ }>;
1508
+ };
1469
1509
  }>>>, "size" | "variant"> & _stitches_react_types_styled_component.TransformProps<{
1470
1510
  variant?: "outline" | "solid-prominent" | "solid-subtle" | "ghost" | undefined;
1471
1511
  size?: "medium" | "large" | "x-large" | undefined;
@@ -1954,6 +1994,19 @@ declare const StyledIconButton: react.ForwardRefExoticComponent<Omit<Omit<_miroh
1954
1994
  readonly [$$PropertyValue]: "width";
1955
1995
  };
1956
1996
  };
1997
+ _hover: (css: _stitches_react.CSS<{
1998
+ media: {};
1999
+ theme: {};
2000
+ themeMap: {};
2001
+ utils: {};
2002
+ }>) => {
2003
+ '&:hover, &[data-hovered]': _stitches_react.CSS<{
2004
+ media: {};
2005
+ theme: {};
2006
+ themeMap: {};
2007
+ utils: {};
2008
+ }>;
2009
+ };
1957
2010
  }>>>, 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<_stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<_mirohq_design_system_components_primitive.PrimitiveProps<"button">>, {}, {}, _stitches_react_types_css_util.CSS<{}, {
1958
2011
  'border-widths': {
1959
2012
  readonly none: 0;
@@ -2439,6 +2492,19 @@ declare const StyledIconButton: react.ForwardRefExoticComponent<Omit<Omit<_miroh
2439
2492
  readonly [$$PropertyValue]: "width";
2440
2493
  };
2441
2494
  };
2495
+ _hover: (css: _stitches_react.CSS<{
2496
+ media: {};
2497
+ theme: {};
2498
+ themeMap: {};
2499
+ utils: {};
2500
+ }>) => {
2501
+ '&:hover, &[data-hovered]': _stitches_react.CSS<{
2502
+ media: {};
2503
+ theme: {};
2504
+ themeMap: {};
2505
+ utils: {};
2506
+ }>;
2507
+ };
2442
2508
  }>>>, 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"> & {
2443
2509
  href: string;
2444
2510
  }, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>, {
@@ -3037,6 +3103,19 @@ declare const IconButton: react__default.ForwardRefExoticComponent<(Omit<{
3037
3103
  readonly [$$PropertyValue]: "width";
3038
3104
  };
3039
3105
  };
3106
+ _hover: (css: _stitches_react.CSS<{
3107
+ media: {};
3108
+ theme: {};
3109
+ themeMap: {};
3110
+ utils: {};
3111
+ }>) => {
3112
+ '&:hover, &[data-hovered]': _stitches_react.CSS<{
3113
+ media: {};
3114
+ theme: {};
3115
+ themeMap: {};
3116
+ utils: {};
3117
+ }>;
3118
+ };
3040
3119
  }>>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react__default.RefAttributes<HTMLButtonElement> & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents, "ref"> | Omit<{
3041
3120
  /**
3042
3121
  * Change the Icon button style
@@ -3574,6 +3653,19 @@ declare const IconButton: react__default.ForwardRefExoticComponent<(Omit<{
3574
3653
  readonly [$$PropertyValue]: "width";
3575
3654
  };
3576
3655
  };
3656
+ _hover: (css: _stitches_react.CSS<{
3657
+ media: {};
3658
+ theme: {};
3659
+ themeMap: {};
3660
+ utils: {};
3661
+ }>) => {
3662
+ '&:hover, &[data-hovered]': _stitches_react.CSS<{
3663
+ media: {};
3664
+ theme: {};
3665
+ themeMap: {};
3666
+ utils: {};
3667
+ }>;
3668
+ };
3577
3669
  }>>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react__default.RefAttributes<HTMLButtonElement> & _mirohq_design_system_hooks_use_press.PressProps & packages_components_internal_base_button_src_base_button.HoverEvents & react__default.AnchorHTMLAttributes<"a"> & {
3578
3670
  href: string;
3579
3671
  }, "ref">) & react__default.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirohq/design-system-icon-button",
3
- "version": "1.3.22",
3
+ "version": "1.3.23",
4
4
  "description": "",
5
5
  "author": "Miro",
6
6
  "source": "src/index.ts",
@@ -26,10 +26,10 @@
26
26
  "react": "^16.14 || ^17 || ^18"
27
27
  },
28
28
  "dependencies": {
29
- "@mirohq/design-system-badge": "^0.3.26",
30
- "@mirohq/design-system-base-button": "^0.4.28",
31
- "@mirohq/design-system-stitches": "^2.4.1",
32
- "@mirohq/design-system-tooltip": "^3.2.34"
29
+ "@mirohq/design-system-base-button": "^0.4.29",
30
+ "@mirohq/design-system-badge": "^0.3.27",
31
+ "@mirohq/design-system-stitches": "^2.5.0",
32
+ "@mirohq/design-system-tooltip": "^3.2.35"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "rollup -c ../../../rollup.config.js",