@mirohq/design-system-tooltip 3.1.6 → 3.1.8-colors.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -89,7 +89,7 @@ let delayTimer;
89
89
  let skipDelayTimer;
90
90
  let shouldSkipDelay = false;
91
91
  const DEFAULT_SKIP_DELAY_DURATION = 500;
92
- const DEFAULT_DELAY_DURATION = 400;
92
+ const DEFAULT_DELAY_DURATION = 200;
93
93
  const Tooltip = ({
94
94
  defaultOpen = false,
95
95
  open,
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/provider.tsx","../src/partials/portal.tsx","../src/tooltip.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport {\n Content as RadixContent,\n Arrow as RadixArrow,\n} from '@radix-ui/react-tooltip'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { animations } from '@mirohq/design-system-styles'\n\nexport const StyledArrowIcon = styled(RadixArrow, {\n fill: '$black',\n height: '$1',\n width: '$3',\n})\n\nexport const StyledContent = styled(RadixContent, {\n backgroundColor: '$black',\n borderRadius: '$50',\n color: '$white',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '20px',\n fontFamily: 'inherit',\n padding: '$150',\n '@media (prefers-reduced-motion: no-preference)': {\n animationDuration: '220ms',\n animationTimingFunction: 'ease',\n willChange: 'opacity',\n '&[data-state=\"delayed-open\"]': {\n animationName: animations.fadeIn,\n },\n '&[data-state=\"closed\"]': {\n animationName: animations.fadeOut,\n },\n },\n zIndex: '$tooltip',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledContent, StyledArrowIcon } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type { PointerDownOutsideEvent, Side, Align } from '../types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n */\n sideOffset?: number\n\n /** The preferred side of the trigger to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n */\n collisionPadding?: number\n\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. It inherits from Tooltip.Portal.\n */\n forceMount?: true\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check.\n */\n collisionBoundary?: Element | null\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in\n * the boundary as long as the trigger is at least partially in the boundary\n * whilst \"always\" will keep the content in the boundary regardless.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n hideWhenDetached?: boolean\n\n /**\n * Event handler called when the escape key is down. It can be prevented by\n * calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n align = 'center',\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 0,\n children,\n side = 'top',\n sideOffset = 5,\n sticky = 'partial',\n ...restProps\n },\n forwardRef\n ) => (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Trigger } from '@radix-ui/react-tooltip'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledTrigger = styled(Trigger)\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import React from 'react'\nimport type { ElementRef, DOMAttributes } from 'react'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n /**\n * temporary the same as onClick, later will be added touch events support\n */\n onPress?: DOMAttributes<HTMLElement>['onClick']\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ onPress, onClick, ...restProps }, forwardRef) => (\n <StyledTrigger\n {...restProps}\n onClick={onPress ?? onClick}\n data-tooltip-trigger=''\n ref={forwardRef}\n />\n))\n","import React, { createContext, useContext } from 'react'\n\nexport interface ProviderProps {\n /**\n * The duration from when the mouse enters a tooltip trigger until\n * the tooltip opens.\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n */\n skipDelayDuration?: number\n}\n\nexport const ProviderContext = createContext<ProviderProps>({} as any)\n\nexport const Provider: React.FC<ProviderProps> = ({\n children,\n ...restProps\n}) => (\n <ProviderContext.Provider value={restProps}>\n {children}\n </ProviderContext.Provider>\n)\n\nexport const useTooltipContext = (): ProviderProps =>\n useContext(ProviderContext)\n","import React from 'react'\nimport type { TooltipPortalProps } from '@radix-ui/react-tooltip'\nimport { Portal as RadixPortal } from '@radix-ui/react-tooltip'\n\nexport interface PortalProps extends TooltipPortalProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. If used on this part, it will be\n * inherited by Tooltip.Content.\n */\n forceMount?: true\n\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import React, { useState, useCallback, useEffect } from 'react'\nimport {\n Provider as RadixProvider,\n Root as RadixTooltip,\n} from '@radix-ui/react-tooltip'\n\nimport { Content } from './partials/content'\nimport { Trigger } from './partials/trigger'\nimport { Provider, useTooltipContext } from './partials/provider'\nimport { Portal } from './partials/portal'\n\nexport interface TooltipProps {\n /**\n * The open state of the tooltip when it is initially rendered. Use when you\n * do not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The current state of the tooltip.\n */\n open?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n onClose?: () => void\n\n /**\n * Overrides the duration given to the `Provider` to customize the open delay\n * for a specific tooltip.\n * @default 400\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * Clears the delayDuration and skipDelayDuration timeouts when the component\n * is unmounted. This flag is `true` by default when using NODE_ENV=test.\n * @default false\n */\n clearDelaysOnUnmount?: boolean\n\n /**\n * Closes the tooltip as soon as the pointer leaves the trigger making it\n * impossible to hover the content.\n */\n disableHoverableContent?: boolean\n}\n\nlet delayTimer: ReturnType<typeof setTimeout> | undefined\nlet skipDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet shouldSkipDelay = false\n\nexport const DEFAULT_SKIP_DELAY_DURATION = 500\nexport const DEFAULT_DELAY_DURATION = 400\n\nexport const Tooltip: React.FC<TooltipProps> & Partials = ({\n defaultOpen = false,\n open,\n onOpen,\n onClose,\n skipDelayDuration,\n delayDuration,\n disableHoverableContent,\n clearDelaysOnUnmount = process.env.NODE_ENV === 'test',\n children,\n}) => {\n const context = useTooltipContext()\n const [mounted, setMounted] = useState(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n newOpenState => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (newOpenState === false) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, skipDelayDuration ?? context.skipDelayDuration ?? DEFAULT_SKIP_DELAY_DURATION)\n\n setOpenState(false)\n onClose?.()\n return\n }\n\n if (\n shouldSkipDelay ||\n document.querySelector('[data-tooltip-trigger]:focus') != null\n ) {\n setOpenState(newOpenState)\n return\n }\n\n delayTimer = setTimeout(() => {\n // ignore it if the the user quickly hover the trigger and leave before the timeout\n // (unfortunately JSDOM seems not to support :hover selector)\n if (\n document.querySelector('[data-tooltip-trigger]:hover') == null &&\n process.env.NODE_ENV !== 'test'\n ) {\n return\n }\n\n shouldSkipDelay = true\n\n if (mounted) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, mounted, onClose, onOpen]\n )\n\n useEffect(\n () => () => {\n if (clearDelaysOnUnmount) {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n shouldSkipDelay = false\n }\n },\n [clearDelaysOnUnmount]\n )\n\n useEffect(() => {\n setMounted(true)\n return () => setMounted(false)\n }, [])\n\n return (\n <RadixProvider delayDuration={0} skipDelayDuration={0}>\n <RadixTooltip\n disableHoverableContent={disableHoverableContent}\n open={open ?? openState}\n delayDuration={0} // we control it manually\n onOpenChange={newState => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n }}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\n"],"names":["styled","RadixArrow","RadixContent","animations","React","Trigger","createContext","useContext","RadixPortal","useState","useCallback","useEffect","RadixProvider","RadixTooltip"],"mappings":";;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AA;AAAA,IACf,cAAc,CAAY,QAAA,KAAA;AACxB,MAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,QAAA,cAAA,CAAe,QAAQ,CAAA,CAAA;AACvB,QAAA,OAAA;AAAA,OACF;AAEA,MAAA,QAAA,GAAW,MAAa,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,EAAA,GAAA,OAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,OAAA,EAAA,CAAA;AAAA,KAC1B;AAAA,GAAA,EAEC,QACH,CACF,CAAA,CAAA;AAEJ,EAAA;AAYA,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,QAAW,GAAA,QAAA,CAAA;AACnB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.js","sources":["../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/provider.tsx","../src/partials/portal.tsx","../src/tooltip.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport {\n Content as RadixContent,\n Arrow as RadixArrow,\n} from '@radix-ui/react-tooltip'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { animations } from '@mirohq/design-system-styles'\n\nexport const StyledArrowIcon = styled(RadixArrow, {\n fill: '$black',\n height: '$1',\n width: '$3',\n})\n\nexport const StyledContent = styled(RadixContent, {\n backgroundColor: '$black',\n borderRadius: '$50',\n color: '$white',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '20px',\n fontFamily: 'inherit',\n padding: '$150',\n '@media (prefers-reduced-motion: no-preference)': {\n animationDuration: '220ms',\n animationTimingFunction: 'ease',\n willChange: 'opacity',\n '&[data-state=\"delayed-open\"]': {\n animationName: animations.fadeIn,\n },\n '&[data-state=\"closed\"]': {\n animationName: animations.fadeOut,\n },\n },\n zIndex: '$tooltip',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledContent, StyledArrowIcon } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type { PointerDownOutsideEvent, Side, Align } from '../types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n */\n sideOffset?: number\n\n /** The preferred side of the trigger to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n */\n collisionPadding?: number\n\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. It inherits from Tooltip.Portal.\n */\n forceMount?: true\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check.\n */\n collisionBoundary?: Element | null\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in\n * the boundary as long as the trigger is at least partially in the boundary\n * whilst \"always\" will keep the content in the boundary regardless.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n hideWhenDetached?: boolean\n\n /**\n * Event handler called when the escape key is down. It can be prevented by\n * calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n align = 'center',\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 0,\n children,\n side = 'top',\n sideOffset = 5,\n sticky = 'partial',\n ...restProps\n },\n forwardRef\n ) => (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Trigger } from '@radix-ui/react-tooltip'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledTrigger = styled(Trigger)\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import React from 'react'\nimport type { ElementRef, DOMAttributes } from 'react'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n /**\n * temporary the same as onClick, later will be added touch events support\n */\n onPress?: DOMAttributes<HTMLElement>['onClick']\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ onPress, onClick, ...restProps }, forwardRef) => (\n <StyledTrigger\n {...restProps}\n onClick={onPress ?? onClick}\n data-tooltip-trigger=''\n ref={forwardRef}\n />\n))\n","import React, { createContext, useContext } from 'react'\n\nexport interface ProviderProps {\n /**\n * The duration from when the mouse enters a tooltip trigger until\n * the tooltip opens.\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n */\n skipDelayDuration?: number\n}\n\nexport const ProviderContext = createContext<ProviderProps>({} as any)\n\nexport const Provider: React.FC<ProviderProps> = ({\n children,\n ...restProps\n}) => (\n <ProviderContext.Provider value={restProps}>\n {children}\n </ProviderContext.Provider>\n)\n\nexport const useTooltipContext = (): ProviderProps =>\n useContext(ProviderContext)\n","import React from 'react'\nimport type { TooltipPortalProps } from '@radix-ui/react-tooltip'\nimport { Portal as RadixPortal } from '@radix-ui/react-tooltip'\n\nexport interface PortalProps extends TooltipPortalProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. If used on this part, it will be\n * inherited by Tooltip.Content.\n */\n forceMount?: true\n\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import React, { useState, useCallback, useEffect } from 'react'\nimport {\n Provider as RadixProvider,\n Root as RadixTooltip,\n} from '@radix-ui/react-tooltip'\n\nimport { Content } from './partials/content'\nimport { Trigger } from './partials/trigger'\nimport { Provider, useTooltipContext } from './partials/provider'\nimport { Portal } from './partials/portal'\n\nexport interface TooltipProps {\n /**\n * The open state of the tooltip when it is initially rendered. Use when you\n * do not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The current state of the tooltip.\n */\n open?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n onClose?: () => void\n\n /**\n * Overrides the duration given to the `Provider` to customize the open delay\n * for a specific tooltip.\n * @default 200\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * Clears the delayDuration and skipDelayDuration timeouts when the component\n * is unmounted. This flag is `true` by default when using NODE_ENV=test.\n * @default false\n */\n clearDelaysOnUnmount?: boolean\n\n /**\n * Closes the tooltip as soon as the pointer leaves the trigger making it\n * impossible to hover the content.\n */\n disableHoverableContent?: boolean\n}\n\nlet delayTimer: ReturnType<typeof setTimeout> | undefined\nlet skipDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet shouldSkipDelay = false\n\nexport const DEFAULT_SKIP_DELAY_DURATION = 500\nexport const DEFAULT_DELAY_DURATION = 200\n\nexport const Tooltip: React.FC<TooltipProps> & Partials = ({\n defaultOpen = false,\n open,\n onOpen,\n onClose,\n skipDelayDuration,\n delayDuration,\n disableHoverableContent,\n clearDelaysOnUnmount = process.env.NODE_ENV === 'test',\n children,\n}) => {\n const context = useTooltipContext()\n const [mounted, setMounted] = useState(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n newOpenState => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (newOpenState === false) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, skipDelayDuration ?? context.skipDelayDuration ?? DEFAULT_SKIP_DELAY_DURATION)\n\n setOpenState(false)\n onClose?.()\n return\n }\n\n if (\n shouldSkipDelay ||\n document.querySelector('[data-tooltip-trigger]:focus') != null\n ) {\n setOpenState(newOpenState)\n return\n }\n\n delayTimer = setTimeout(() => {\n // ignore it if the the user quickly hover the trigger and leave before the timeout\n // (unfortunately JSDOM seems not to support :hover selector)\n if (\n document.querySelector('[data-tooltip-trigger]:hover') == null &&\n process.env.NODE_ENV !== 'test'\n ) {\n return\n }\n\n shouldSkipDelay = true\n\n if (mounted) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, mounted, onClose, onOpen]\n )\n\n useEffect(\n () => () => {\n if (clearDelaysOnUnmount) {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n shouldSkipDelay = false\n }\n },\n [clearDelaysOnUnmount]\n )\n\n useEffect(() => {\n setMounted(true)\n return () => setMounted(false)\n }, [])\n\n return (\n <RadixProvider delayDuration={0} skipDelayDuration={0}>\n <RadixTooltip\n disableHoverableContent={disableHoverableContent}\n open={open ?? openState}\n delayDuration={0} // we control it manually\n onOpenChange={newState => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n }}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\n"],"names":["styled","RadixArrow","RadixContent","animations","React","Trigger","createContext","useContext","RadixPortal","useState","useCallback","useEffect","RadixProvider","RadixTooltip"],"mappings":";;;;;;;;;;;;;AAQa,MAAA,eAAA,GAAkBA,4BAAOC,kBAAY,EAAA;AAAA,EAChD,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA,IAAA;AAAA,EACR,KAAO,EAAA,IAAA;AACT,CAAC,CAAA,CAAA;AAEY,MAAA,aAAA,GAAgBD,4BAAOE,oBAAc,EAAA;AAAA,EAChD,eAAiB,EAAA,QAAA;AAAA,EACjB,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA,QAAA;AAAA,EACP,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,KAAA;AAAA,EACZ,UAAY,EAAA,MAAA;AAAA,EACZ,UAAY,EAAA,SAAA;AAAA,EACZ,OAAS,EAAA,MAAA;AAAA,EACT,gDAAkD,EAAA;AAAA,IAChD,iBAAmB,EAAA,OAAA;AAAA,IACnB,uBAAyB,EAAA,MAAA;AAAA,IACzB,UAAY,EAAA,SAAA;AAAA,IACZ,8BAAgC,EAAA;AAAA,MAC9B,eAAeC,6BAAW,CAAA,MAAA;AAAA,KAC5B;AAAA,IACA,wBAA0B,EAAA;AAAA,MACxB,eAAeA,6BAAW,CAAA,OAAA;AAAA,KAC5B;AAAA,GACF;AAAA,EACA,MAAQ,EAAA,UAAA;AACV,CAAC,CAAA;;AC4CM,MAAM,UAAUC,yBAAM,CAAA,UAAA;AAAA,EAI3B,CACE;AAAA,IACE,KAAQ,GAAA,QAAA;AAAA,IACR,WAAc,GAAA,CAAA;AAAA,IACd,eAAkB,GAAA,IAAA;AAAA,IAClB,gBAAmB,GAAA,CAAA;AAAA,IACnB,QAAA;AAAA,IACA,IAAO,GAAA,KAAA;AAAA,IACP,UAAa,GAAA,CAAA;AAAA,IACb,MAAS,GAAA,SAAA;A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kBACjDR,yBAAA,CAAA,aAAA,CAAAS,iBAAA,EAAA;AAAA,IACC,uBAAA;AAAA,IACA,MAAM,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,SAAA;AAAA,IACd,aAAe,EAAA,CAAA;AAAA,IACf,cAAc,CAAY,QAAA,KAAA;AACxB,MAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,QAAA,cAAA,CAAe,QAAQ,CAAA,CAAA;AACvB,QAAA,OAAA;AAAA,OACF;AAEA,MAAA,QAAA,GAAW,MAAa,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,EAAA,GAAA,OAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,OAAA,EAAA,CAAA;AAAA,KAC1B;AAAA,GAAA,EAEC,QACH,CACF,CAAA,CAAA;AAEJ,EAAA;AAYA,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,QAAW,GAAA,QAAA,CAAA;AACnB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;;;;"}
package/dist/module.js CHANGED
@@ -81,7 +81,7 @@ let delayTimer;
81
81
  let skipDelayTimer;
82
82
  let shouldSkipDelay = false;
83
83
  const DEFAULT_SKIP_DELAY_DURATION = 500;
84
- const DEFAULT_DELAY_DURATION = 400;
84
+ const DEFAULT_DELAY_DURATION = 200;
85
85
  const Tooltip = ({
86
86
  defaultOpen = false,
87
87
  open,
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/provider.tsx","../src/partials/portal.tsx","../src/tooltip.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport {\n Content as RadixContent,\n Arrow as RadixArrow,\n} from '@radix-ui/react-tooltip'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { animations } from '@mirohq/design-system-styles'\n\nexport const StyledArrowIcon = styled(RadixArrow, {\n fill: '$black',\n height: '$1',\n width: '$3',\n})\n\nexport const StyledContent = styled(RadixContent, {\n backgroundColor: '$black',\n borderRadius: '$50',\n color: '$white',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '20px',\n fontFamily: 'inherit',\n padding: '$150',\n '@media (prefers-reduced-motion: no-preference)': {\n animationDuration: '220ms',\n animationTimingFunction: 'ease',\n willChange: 'opacity',\n '&[data-state=\"delayed-open\"]': {\n animationName: animations.fadeIn,\n },\n '&[data-state=\"closed\"]': {\n animationName: animations.fadeOut,\n },\n },\n zIndex: '$tooltip',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledContent, StyledArrowIcon } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type { PointerDownOutsideEvent, Side, Align } from '../types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n */\n sideOffset?: number\n\n /** The preferred side of the trigger to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n */\n collisionPadding?: number\n\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. It inherits from Tooltip.Portal.\n */\n forceMount?: true\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check.\n */\n collisionBoundary?: Element | null\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in\n * the boundary as long as the trigger is at least partially in the boundary\n * whilst \"always\" will keep the content in the boundary regardless.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n hideWhenDetached?: boolean\n\n /**\n * Event handler called when the escape key is down. It can be prevented by\n * calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n align = 'center',\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 0,\n children,\n side = 'top',\n sideOffset = 5,\n sticky = 'partial',\n ...restProps\n },\n forwardRef\n ) => (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Trigger } from '@radix-ui/react-tooltip'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledTrigger = styled(Trigger)\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import React from 'react'\nimport type { ElementRef, DOMAttributes } from 'react'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n /**\n * temporary the same as onClick, later will be added touch events support\n */\n onPress?: DOMAttributes<HTMLElement>['onClick']\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ onPress, onClick, ...restProps }, forwardRef) => (\n <StyledTrigger\n {...restProps}\n onClick={onPress ?? onClick}\n data-tooltip-trigger=''\n ref={forwardRef}\n />\n))\n","import React, { createContext, useContext } from 'react'\n\nexport interface ProviderProps {\n /**\n * The duration from when the mouse enters a tooltip trigger until\n * the tooltip opens.\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n */\n skipDelayDuration?: number\n}\n\nexport const ProviderContext = createContext<ProviderProps>({} as any)\n\nexport const Provider: React.FC<ProviderProps> = ({\n children,\n ...restProps\n}) => (\n <ProviderContext.Provider value={restProps}>\n {children}\n </ProviderContext.Provider>\n)\n\nexport const useTooltipContext = (): ProviderProps =>\n useContext(ProviderContext)\n","import React from 'react'\nimport type { TooltipPortalProps } from '@radix-ui/react-tooltip'\nimport { Portal as RadixPortal } from '@radix-ui/react-tooltip'\n\nexport interface PortalProps extends TooltipPortalProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. If used on this part, it will be\n * inherited by Tooltip.Content.\n */\n forceMount?: true\n\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import React, { useState, useCallback, useEffect } from 'react'\nimport {\n Provider as RadixProvider,\n Root as RadixTooltip,\n} from '@radix-ui/react-tooltip'\n\nimport { Content } from './partials/content'\nimport { Trigger } from './partials/trigger'\nimport { Provider, useTooltipContext } from './partials/provider'\nimport { Portal } from './partials/portal'\n\nexport interface TooltipProps {\n /**\n * The open state of the tooltip when it is initially rendered. Use when you\n * do not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The current state of the tooltip.\n */\n open?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n onClose?: () => void\n\n /**\n * Overrides the duration given to the `Provider` to customize the open delay\n * for a specific tooltip.\n * @default 400\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * Clears the delayDuration and skipDelayDuration timeouts when the component\n * is unmounted. This flag is `true` by default when using NODE_ENV=test.\n * @default false\n */\n clearDelaysOnUnmount?: boolean\n\n /**\n * Closes the tooltip as soon as the pointer leaves the trigger making it\n * impossible to hover the content.\n */\n disableHoverableContent?: boolean\n}\n\nlet delayTimer: ReturnType<typeof setTimeout> | undefined\nlet skipDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet shouldSkipDelay = false\n\nexport const DEFAULT_SKIP_DELAY_DURATION = 500\nexport const DEFAULT_DELAY_DURATION = 400\n\nexport const Tooltip: React.FC<TooltipProps> & Partials = ({\n defaultOpen = false,\n open,\n onOpen,\n onClose,\n skipDelayDuration,\n delayDuration,\n disableHoverableContent,\n clearDelaysOnUnmount = process.env.NODE_ENV === 'test',\n children,\n}) => {\n const context = useTooltipContext()\n const [mounted, setMounted] = useState(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n newOpenState => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (newOpenState === false) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, skipDelayDuration ?? context.skipDelayDuration ?? DEFAULT_SKIP_DELAY_DURATION)\n\n setOpenState(false)\n onClose?.()\n return\n }\n\n if (\n shouldSkipDelay ||\n document.querySelector('[data-tooltip-trigger]:focus') != null\n ) {\n setOpenState(newOpenState)\n return\n }\n\n delayTimer = setTimeout(() => {\n // ignore it if the the user quickly hover the trigger and leave before the timeout\n // (unfortunately JSDOM seems not to support :hover selector)\n if (\n document.querySelector('[data-tooltip-trigger]:hover') == null &&\n process.env.NODE_ENV !== 'test'\n ) {\n return\n }\n\n shouldSkipDelay = true\n\n if (mounted) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, mounted, onClose, onOpen]\n )\n\n useEffect(\n () => () => {\n if (clearDelaysOnUnmount) {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n shouldSkipDelay = false\n }\n },\n [clearDelaysOnUnmount]\n )\n\n useEffect(() => {\n setMounted(true)\n return () => setMounted(false)\n }, [])\n\n return (\n <RadixProvider delayDuration={0} skipDelayDuration={0}>\n <RadixTooltip\n disableHoverableContent={disableHoverableContent}\n open={open ?? openState}\n delayDuration={0} // we control it manually\n onOpenChange={newState => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n }}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\n"],"names":["RadixArrow","RadixContent","Trigger","RadixPortal","RadixProvider","RadixTooltip"],"mappings":";;;;;AAQa,MAAA,eAAA,GAAkB,OAAOA,KAAY,EAAA;AAAA,EAChD,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA,IAAA;AAAA,EACR,KAAO,EAAA,IAAA;AACT,CAAC,CAAA,CAAA;AAEY,MAAA,aAAA,GAAgB,OAAOC,SAAc,EAAA;AAAA,EAChD,eAAiB,EAAA,QAAA;AAAA,EACjB,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA,QAAA;AAAA,EACP,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,KAAA;AAAA,EACZ,UAAY,EAAA,MAAA;AAAA,EACZ,UAAY,EAAA,SAAA;AAAA,EACZ,OAAS,EAAA,MAAA;AAAA,EACT,gDAAkD,EAAA;AAAA,IAChD,iBAAmB,EAAA,OAAA;AAAA,IACnB,uBAAyB,EAAA,MAAA;AAAA,IACzB,UAAY,EAAA,SAAA;AAAA,IACZ,8BAAgC,EAAA;AAAA,MAC9B,eAAe,UAAW,CAAA,MAAA;AAAA,KAC5B;AAAA,IACA,wBAA0B,EAAA;AAAA,MACxB,eAAe,UAAW,CAAA,OAAA;AAAA,KAC5B;AA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AAAA,GACvB,CAAA;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,UAAA,CAAW,IAAI,CAAA,CAAA;AACf,IAAO,OAAA,MAAM,WAAW,KAAK,CAAA,CAAA;AAAA,GAC/B,EAAG,EAAE,CAAA,CAAA;AAEL,EAAA,uBACG,KAAA,CAAA,aAAA,CAAAC,UAAA,EAAA;AAAA,IAAc,aAAe,EAAA,CAAA;AAAA,IAAG,iBAAmB,EAAA,CAAA;AAAA,GAAA,kBACjD,KAAA,CAAA,aAAA,CAAAC,IAAA,EAAA;AAAA,IACC,uBAAA;AAAA,IACA,MAAM,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,SAAA;AAAA,IACd,aAAe,EAAA,CAAA;AAAA,IACf,cAAc,CAAY,QAAA,KAAA;AACxB,MAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,QAAA,cAAA,CAAe,QAAQ,CAAA,CAAA;AACvB,QAAA,OAAA;AAAA,OACF;AAEA,MAAA,QAAA,GAAW,MAAa,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,EAAA,GAAA,OAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,OAAA,EAAA,CAAA;AAAA,KAC1B;AAAA,GAAA,EAEC,QACH,CACF,CAAA,CAAA;AAEJ,EAAA;AAYA,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,QAAW,GAAA,QAAA,CAAA;AACnB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/provider.tsx","../src/partials/portal.tsx","../src/tooltip.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport {\n Content as RadixContent,\n Arrow as RadixArrow,\n} from '@radix-ui/react-tooltip'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { animations } from '@mirohq/design-system-styles'\n\nexport const StyledArrowIcon = styled(RadixArrow, {\n fill: '$black',\n height: '$1',\n width: '$3',\n})\n\nexport const StyledContent = styled(RadixContent, {\n backgroundColor: '$black',\n borderRadius: '$50',\n color: '$white',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '20px',\n fontFamily: 'inherit',\n padding: '$150',\n '@media (prefers-reduced-motion: no-preference)': {\n animationDuration: '220ms',\n animationTimingFunction: 'ease',\n willChange: 'opacity',\n '&[data-state=\"delayed-open\"]': {\n animationName: animations.fadeIn,\n },\n '&[data-state=\"closed\"]': {\n animationName: animations.fadeOut,\n },\n },\n zIndex: '$tooltip',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledContent, StyledArrowIcon } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type { PointerDownOutsideEvent, Side, Align } from '../types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n */\n sideOffset?: number\n\n /** The preferred side of the trigger to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n */\n collisionPadding?: number\n\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. It inherits from Tooltip.Portal.\n */\n forceMount?: true\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check.\n */\n collisionBoundary?: Element | null\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in\n * the boundary as long as the trigger is at least partially in the boundary\n * whilst \"always\" will keep the content in the boundary regardless.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n hideWhenDetached?: boolean\n\n /**\n * Event handler called when the escape key is down. It can be prevented by\n * calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n align = 'center',\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 0,\n children,\n side = 'top',\n sideOffset = 5,\n sticky = 'partial',\n ...restProps\n },\n forwardRef\n ) => (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Trigger } from '@radix-ui/react-tooltip'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledTrigger = styled(Trigger)\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import React from 'react'\nimport type { ElementRef, DOMAttributes } from 'react'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n /**\n * temporary the same as onClick, later will be added touch events support\n */\n onPress?: DOMAttributes<HTMLElement>['onClick']\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ onPress, onClick, ...restProps }, forwardRef) => (\n <StyledTrigger\n {...restProps}\n onClick={onPress ?? onClick}\n data-tooltip-trigger=''\n ref={forwardRef}\n />\n))\n","import React, { createContext, useContext } from 'react'\n\nexport interface ProviderProps {\n /**\n * The duration from when the mouse enters a tooltip trigger until\n * the tooltip opens.\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n */\n skipDelayDuration?: number\n}\n\nexport const ProviderContext = createContext<ProviderProps>({} as any)\n\nexport const Provider: React.FC<ProviderProps> = ({\n children,\n ...restProps\n}) => (\n <ProviderContext.Provider value={restProps}>\n {children}\n </ProviderContext.Provider>\n)\n\nexport const useTooltipContext = (): ProviderProps =>\n useContext(ProviderContext)\n","import React from 'react'\nimport type { TooltipPortalProps } from '@radix-ui/react-tooltip'\nimport { Portal as RadixPortal } from '@radix-ui/react-tooltip'\n\nexport interface PortalProps extends TooltipPortalProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. If used on this part, it will be\n * inherited by Tooltip.Content.\n */\n forceMount?: true\n\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import React, { useState, useCallback, useEffect } from 'react'\nimport {\n Provider as RadixProvider,\n Root as RadixTooltip,\n} from '@radix-ui/react-tooltip'\n\nimport { Content } from './partials/content'\nimport { Trigger } from './partials/trigger'\nimport { Provider, useTooltipContext } from './partials/provider'\nimport { Portal } from './partials/portal'\n\nexport interface TooltipProps {\n /**\n * The open state of the tooltip when it is initially rendered. Use when you\n * do not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The current state of the tooltip.\n */\n open?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n onClose?: () => void\n\n /**\n * Overrides the duration given to the `Provider` to customize the open delay\n * for a specific tooltip.\n * @default 200\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * Clears the delayDuration and skipDelayDuration timeouts when the component\n * is unmounted. This flag is `true` by default when using NODE_ENV=test.\n * @default false\n */\n clearDelaysOnUnmount?: boolean\n\n /**\n * Closes the tooltip as soon as the pointer leaves the trigger making it\n * impossible to hover the content.\n */\n disableHoverableContent?: boolean\n}\n\nlet delayTimer: ReturnType<typeof setTimeout> | undefined\nlet skipDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet shouldSkipDelay = false\n\nexport const DEFAULT_SKIP_DELAY_DURATION = 500\nexport const DEFAULT_DELAY_DURATION = 200\n\nexport const Tooltip: React.FC<TooltipProps> & Partials = ({\n defaultOpen = false,\n open,\n onOpen,\n onClose,\n skipDelayDuration,\n delayDuration,\n disableHoverableContent,\n clearDelaysOnUnmount = process.env.NODE_ENV === 'test',\n children,\n}) => {\n const context = useTooltipContext()\n const [mounted, setMounted] = useState(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n newOpenState => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (newOpenState === false) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, skipDelayDuration ?? context.skipDelayDuration ?? DEFAULT_SKIP_DELAY_DURATION)\n\n setOpenState(false)\n onClose?.()\n return\n }\n\n if (\n shouldSkipDelay ||\n document.querySelector('[data-tooltip-trigger]:focus') != null\n ) {\n setOpenState(newOpenState)\n return\n }\n\n delayTimer = setTimeout(() => {\n // ignore it if the the user quickly hover the trigger and leave before the timeout\n // (unfortunately JSDOM seems not to support :hover selector)\n if (\n document.querySelector('[data-tooltip-trigger]:hover') == null &&\n process.env.NODE_ENV !== 'test'\n ) {\n return\n }\n\n shouldSkipDelay = true\n\n if (mounted) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, mounted, onClose, onOpen]\n )\n\n useEffect(\n () => () => {\n if (clearDelaysOnUnmount) {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n shouldSkipDelay = false\n }\n },\n [clearDelaysOnUnmount]\n )\n\n useEffect(() => {\n setMounted(true)\n return () => setMounted(false)\n }, [])\n\n return (\n <RadixProvider delayDuration={0} skipDelayDuration={0}>\n <RadixTooltip\n disableHoverableContent={disableHoverableContent}\n open={open ?? openState}\n delayDuration={0} // we control it manually\n onOpenChange={newState => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n }}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\ninterface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\n"],"names":["RadixArrow","RadixContent","Trigger","RadixPortal","RadixProvider","RadixTooltip"],"mappings":";;;;;AAQa,MAAA,eAAA,GAAkB,OAAOA,KAAY,EAAA;AAAA,EAChD,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA,IAAA;AAAA,EACR,KAAO,EAAA,IAAA;AACT,CAAC,CAAA,CAAA;AAEY,MAAA,aAAA,GAAgB,OAAOC,SAAc,EAAA;AAAA,EAChD,eAAiB,EAAA,QAAA;AAAA,EACjB,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA,QAAA;AAAA,EACP,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,KAAA;AAAA,EACZ,UAAY,EAAA,MAAA;AAAA,EACZ,UAAY,EAAA,SAAA;AAAA,EACZ,OAAS,EAAA,MAAA;AAAA,EACT,gDAAkD,EAAA;AAAA,IAChD,iBAAmB,EAAA,OAAA;AAAA,IACnB,uBAAyB,EAAA,MAAA;AAAA,IACzB,UAAY,EAAA,SAAA;AAAA,IACZ,8BAAgC,EAAA;AAAA,MAC9B,eAAe,UAAW,CAAA,MAAA;AAAA,KAC5B;AAAA,IACA,wBAA0B,EAAA;AA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,OACpB;AAAA,KACF;AAAA,IACA,CAAC,oBAAoB,CAAA;AAAA,GACvB,CAAA;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,UAAA,CAAW,IAAI,CAAA,CAAA;AACf,IAAO,OAAA,MAAM,WAAW,KAAK,CAAA,CAAA;AAAA,GAC/B,EAAG,EAAE,CAAA,CAAA;AAEL,EAAA,uBACG,KAAA,CAAA,aAAA,CAAAC,UAAA,EAAA;AAAA,IAAc,aAAe,EAAA,CAAA;AAAA,IAAG,iBAAmB,EAAA,CAAA;AAAA,GAAA,kBACjD,KAAA,CAAA,aAAA,CAAAC,IAAA,EAAA;AAAA,IACC,uBAAA;AAAA,IACA,MAAM,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,SAAA;AAAA,IACd,aAAe,EAAA,CAAA;AAAA,IACf,cAAc,CAAY,QAAA,KAAA;AACxB,MAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,QAAA,cAAA,CAAe,QAAQ,CAAA,CAAA;AACvB,QAAA,OAAA;AAAA,OACF;AAEA,MAAA,QAAA,GAAW,MAAa,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,EAAA,GAAA,OAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,OAAA,EAAA,CAAA;AAAA,KAC1B;AAAA,GAAA,EAEC,QACH,CACF,CAAA,CAAA;AAEJ,EAAA;AAYA,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,QAAW,GAAA,QAAA,CAAA;AACnB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;"}
package/dist/types.d.ts CHANGED
@@ -15,80 +15,141 @@ declare const StyledContent: react.ForwardRefExoticComponent<Pick<Omit<{}, never
15
15
  readonly lg: "4px";
16
16
  };
17
17
  colors: {
18
+ readonly 'blue-100': any;
19
+ readonly 'blue-200': any;
20
+ readonly 'blue-300': any;
21
+ readonly 'blue-400': any;
22
+ readonly 'blue-500': any;
23
+ readonly 'blue-600': any;
24
+ readonly 'blue-700': any;
25
+ readonly 'blue-800': any;
26
+ readonly 'blue-900': any;
27
+ readonly 'blue-1000': any;
28
+ readonly 'gray-100': any;
29
+ readonly 'gray-200': any;
30
+ readonly 'gray-300': any;
31
+ readonly 'gray-400': any;
32
+ readonly 'gray-500': any;
33
+ readonly 'gray-600': any;
34
+ readonly 'gray-700': any;
35
+ readonly 'gray-800': any;
36
+ readonly 'gray-900': any;
37
+ readonly 'indigo-100': any;
38
+ readonly 'indigo-200': any;
39
+ readonly 'indigo-300': any;
40
+ readonly 'indigo-400': any;
41
+ readonly 'indigo-500': any;
42
+ readonly 'indigo-600': any;
43
+ readonly 'indigo-700': any;
44
+ readonly 'indigo-800': any;
45
+ readonly 'indigo-900': any;
46
+ readonly 'red-100': any;
47
+ readonly 'red-200': any;
48
+ readonly 'red-300': any;
49
+ readonly 'red-400': any;
50
+ readonly 'red-500': any;
51
+ readonly 'red-600': any;
52
+ readonly 'red-700': any;
53
+ readonly 'red-800': any;
54
+ readonly 'red-900': any;
55
+ readonly 'yellow-100': any;
56
+ readonly 'yellow-200': any;
57
+ readonly 'yellow-300': any;
58
+ readonly 'yellow-400': any;
59
+ readonly 'yellow-500': any;
60
+ readonly 'yellow-600': any;
61
+ readonly 'yellow-700': any;
62
+ readonly 'yellow-800': any;
63
+ readonly 'yellow-900': any;
64
+ readonly 'green-100': any;
65
+ readonly 'green-200': any;
66
+ readonly 'green-300': any;
67
+ readonly 'green-400': any;
68
+ readonly 'green-500': any;
69
+ readonly 'green-600': any;
70
+ readonly 'green-700': any;
71
+ readonly 'green-800': any;
72
+ readonly 'green-900': any;
18
73
  readonly black: any;
19
- readonly 'blue-10': any;
20
- readonly 'blue-20': any;
21
- readonly 'blue-50': any;
22
- readonly 'blue-60': any;
23
- readonly 'blue-70': any;
24
- readonly 'blue-80': any;
25
- readonly 'gray-20': any;
26
- readonly 'gray-30': any;
27
- readonly 'gray-40': any;
28
- readonly 'gray-50': any;
29
- readonly 'green-70': any;
30
- readonly 'indigo-20': any;
31
- readonly 'indigo-30': any;
32
- readonly 'indigo-50': any;
33
- readonly 'indigo-70': any;
34
- readonly 'indigo-90': any;
35
- readonly 'pink-20': any;
36
- readonly 'pink-50': any;
37
- readonly 'red-10': any;
38
- readonly 'red-20': any;
39
- readonly 'red-30': any;
40
- readonly 'red-50': any;
41
- readonly 'red-60': any;
42
- readonly transparent: any;
43
74
  readonly white: any;
44
- readonly 'yellow-20': any;
45
- readonly 'yellow-60': any;
46
- readonly 'background-cta-active'?: any;
47
- readonly 'background-cta-disabled'?: any;
48
- readonly 'background-cta-hover'?: any;
49
- readonly 'background-cta-idle'?: any;
50
- readonly 'background-danger-active'?: any;
75
+ readonly transparent: any;
76
+ readonly 'background-neutrals'?: any;
77
+ readonly 'background-neutrals-body'?: any;
78
+ readonly 'background-neutrals-container'?: any;
79
+ readonly 'background-neutrals-inverted'?: any;
80
+ readonly 'background-neutrals-subtle'?: any;
81
+ readonly 'background-neutrals-subtle-hover'?: any;
82
+ readonly 'background-neutrals-subtle-active'?: any;
83
+ readonly 'background-neutrals-disabled'?: any;
84
+ readonly 'background-neutrals-disabled-controls'?: any;
85
+ readonly 'background-neutrals-scrolls'?: any;
86
+ readonly 'background-neutrals-inactive'?: any;
87
+ readonly 'background-neutrals-inactive-hover'?: any;
88
+ readonly 'background-primary-prominent'?: any;
89
+ readonly 'background-primary-prominent-hover'?: any;
90
+ readonly 'background-primary-prominent-active'?: any;
91
+ readonly 'background-primary-prominent-selected'?: any;
92
+ readonly 'background-primary-subtle'?: any;
93
+ readonly 'background-primary-subtle-hover'?: any;
94
+ readonly 'background-primary-subtle-active'?: any;
95
+ readonly 'background-primary-subtle-selected'?: any;
96
+ readonly 'background-danger-prominent'?: any;
97
+ readonly 'background-danger-prominent-hover'?: any;
98
+ readonly 'background-danger-prominent-active'?: any;
99
+ readonly 'background-danger'?: any;
51
100
  readonly 'background-danger-hover'?: any;
52
- readonly 'background-danger-idle'?: any;
53
- readonly 'background-default-active'?: any;
54
- readonly 'background-default-disabled'?: any;
55
- readonly 'background-default-hover'?: any;
56
- readonly 'background-default-idle'?: any;
57
- readonly 'background-default-selected'?: any;
58
- readonly 'background-default-selected-active'?: any;
59
- readonly 'background-info-idle'?: any;
60
- readonly 'background-primary'?: any;
61
- readonly 'background-secondary'?: any;
62
- readonly 'background-success-idle'?: any;
63
- readonly 'background-warning-idle'?: any;
64
- readonly 'border-cta-idle'?: any;
65
- readonly 'border-default-active'?: any;
66
- readonly 'border-default-error'?: any;
67
- readonly 'border-default-hover'?: any;
68
- readonly 'border-default-idle'?: any;
69
- readonly 'border-default-selected'?: any;
70
- readonly 'canvas-primary'?: any;
71
- readonly 'divider-default'?: any;
72
- readonly 'focus-ring-default'?: any;
73
- readonly 'font-cta-idle'?: any;
74
- readonly 'font-default-active'?: any;
75
- readonly 'font-default-disabled'?: any;
76
- readonly 'font-default-error'?: any;
77
- readonly 'font-default-hover'?: any;
78
- readonly 'font-default-idle'?: any;
79
- readonly 'font-default-selected'?: any;
80
- readonly 'font-default-visited'?: any;
81
- readonly 'font-primary'?: any;
82
- readonly 'font-secondary'?: any;
83
- readonly 'font-tertiary'?: any;
84
- readonly 'icon-cta-idle'?: any;
85
- readonly 'icon-default'?: any;
86
- readonly 'icon-default-active'?: any;
87
- readonly 'icon-default-disabled'?: any;
88
- readonly 'icon-default-error'?: any;
89
- readonly 'icon-default-hover'?: any;
90
- readonly 'icon-default-idle'?: any;
91
- readonly 'icon-default-selected'?: any;
101
+ readonly 'background-success'?: any;
102
+ readonly 'background-warning-subtle'?: any;
103
+ readonly 'background-warning-prominent'?: any;
104
+ readonly 'text-neutrals-inverted'?: any;
105
+ readonly 'text-neutrals'?: any;
106
+ readonly 'text-neutrals-secondary'?: any;
107
+ readonly 'text-neutrals-placeholder-only'?: any;
108
+ readonly 'text-neutrals-placeholder'?: any;
109
+ readonly 'text-neutrals-disabled'?: any;
110
+ readonly 'text-primary-inverted'?: any;
111
+ readonly 'text-primary'?: any;
112
+ readonly 'text-primary-hover'?: any;
113
+ readonly 'text-primary-active'?: any;
114
+ readonly 'text-primary-selected'?: any;
115
+ readonly 'text-danger-inverted'?: any;
116
+ readonly 'text-danger'?: any;
117
+ readonly 'text-danger-hover'?: any;
118
+ readonly 'text-danger-active'?: any;
119
+ readonly 'text-success'?: any;
120
+ readonly 'text-warning'?: any;
121
+ readonly 'icon-neutrals-inverted'?: any;
122
+ readonly 'icon-neutrals'?: any;
123
+ readonly 'icon-neutrals-secondary'?: any;
124
+ readonly 'icon-neutrals-disabled'?: any;
125
+ readonly 'icon-neutrals-search'?: any;
126
+ readonly 'icon-primary-inverted'?: any;
127
+ readonly 'icon-primary'?: any;
128
+ readonly 'icon-primary-hover'?: any;
129
+ readonly 'icon-primary-active'?: any;
130
+ readonly 'icon-primary-selected'?: any;
131
+ readonly 'icon-danger-inverted'?: any;
132
+ readonly 'icon-danger'?: any;
133
+ readonly 'icon-danger-hover'?: any;
134
+ readonly 'icon-danger-active'?: any;
135
+ readonly 'icon-success-inverted'?: any;
136
+ readonly 'icon-success'?: any;
137
+ readonly 'icon-warning'?: any;
138
+ readonly 'border-neutrals'?: any;
139
+ readonly 'border-neutrals-hover'?: any;
140
+ readonly 'border-neutrals-active'?: any;
141
+ readonly 'border-neutrals-disabled'?: any;
142
+ readonly 'border-neutrals-controls'?: any;
143
+ readonly 'border-neutrals-controls-disabled'?: any;
144
+ readonly 'border-neutrals-subtle'?: any;
145
+ readonly 'border-neutrals-inverted'?: any;
146
+ readonly 'border-primary'?: any;
147
+ readonly 'border-primary-hover'?: any;
148
+ readonly 'border-primary-active'?: any;
149
+ readonly 'border-primary-inverted'?: any;
150
+ readonly 'border-danger'?: any;
151
+ readonly 'border-success'?: any;
152
+ readonly 'border-warning'?: any;
92
153
  };
93
154
  'font-sizes': {
94
155
  readonly 150: "0.75rem";
@@ -441,80 +502,141 @@ declare const StyledTrigger: react.ForwardRefExoticComponent<Pick<Omit<{}, never
441
502
  readonly lg: "4px";
442
503
  };
443
504
  colors: {
505
+ readonly 'blue-100': any;
506
+ readonly 'blue-200': any;
507
+ readonly 'blue-300': any;
508
+ readonly 'blue-400': any;
509
+ readonly 'blue-500': any;
510
+ readonly 'blue-600': any;
511
+ readonly 'blue-700': any;
512
+ readonly 'blue-800': any;
513
+ readonly 'blue-900': any;
514
+ readonly 'blue-1000': any;
515
+ readonly 'gray-100': any;
516
+ readonly 'gray-200': any;
517
+ readonly 'gray-300': any;
518
+ readonly 'gray-400': any;
519
+ readonly 'gray-500': any;
520
+ readonly 'gray-600': any;
521
+ readonly 'gray-700': any;
522
+ readonly 'gray-800': any;
523
+ readonly 'gray-900': any;
524
+ readonly 'indigo-100': any;
525
+ readonly 'indigo-200': any;
526
+ readonly 'indigo-300': any;
527
+ readonly 'indigo-400': any;
528
+ readonly 'indigo-500': any;
529
+ readonly 'indigo-600': any;
530
+ readonly 'indigo-700': any;
531
+ readonly 'indigo-800': any;
532
+ readonly 'indigo-900': any;
533
+ readonly 'red-100': any;
534
+ readonly 'red-200': any;
535
+ readonly 'red-300': any;
536
+ readonly 'red-400': any;
537
+ readonly 'red-500': any;
538
+ readonly 'red-600': any;
539
+ readonly 'red-700': any;
540
+ readonly 'red-800': any;
541
+ readonly 'red-900': any;
542
+ readonly 'yellow-100': any;
543
+ readonly 'yellow-200': any;
544
+ readonly 'yellow-300': any;
545
+ readonly 'yellow-400': any;
546
+ readonly 'yellow-500': any;
547
+ readonly 'yellow-600': any;
548
+ readonly 'yellow-700': any;
549
+ readonly 'yellow-800': any;
550
+ readonly 'yellow-900': any;
551
+ readonly 'green-100': any;
552
+ readonly 'green-200': any;
553
+ readonly 'green-300': any;
554
+ readonly 'green-400': any;
555
+ readonly 'green-500': any;
556
+ readonly 'green-600': any;
557
+ readonly 'green-700': any;
558
+ readonly 'green-800': any;
559
+ readonly 'green-900': any;
444
560
  readonly black: any;
445
- readonly 'blue-10': any;
446
- readonly 'blue-20': any;
447
- readonly 'blue-50': any;
448
- readonly 'blue-60': any;
449
- readonly 'blue-70': any;
450
- readonly 'blue-80': any;
451
- readonly 'gray-20': any;
452
- readonly 'gray-30': any;
453
- readonly 'gray-40': any;
454
- readonly 'gray-50': any;
455
- readonly 'green-70': any;
456
- readonly 'indigo-20': any;
457
- readonly 'indigo-30': any;
458
- readonly 'indigo-50': any;
459
- readonly 'indigo-70': any;
460
- readonly 'indigo-90': any;
461
- readonly 'pink-20': any;
462
- readonly 'pink-50': any;
463
- readonly 'red-10': any;
464
- readonly 'red-20': any;
465
- readonly 'red-30': any;
466
- readonly 'red-50': any;
467
- readonly 'red-60': any;
468
- readonly transparent: any;
469
561
  readonly white: any;
470
- readonly 'yellow-20': any;
471
- readonly 'yellow-60': any;
472
- readonly 'background-cta-active'?: any;
473
- readonly 'background-cta-disabled'?: any;
474
- readonly 'background-cta-hover'?: any;
475
- readonly 'background-cta-idle'?: any;
476
- readonly 'background-danger-active'?: any;
562
+ readonly transparent: any;
563
+ readonly 'background-neutrals'?: any;
564
+ readonly 'background-neutrals-body'?: any;
565
+ readonly 'background-neutrals-container'?: any;
566
+ readonly 'background-neutrals-inverted'?: any;
567
+ readonly 'background-neutrals-subtle'?: any;
568
+ readonly 'background-neutrals-subtle-hover'?: any;
569
+ readonly 'background-neutrals-subtle-active'?: any;
570
+ readonly 'background-neutrals-disabled'?: any;
571
+ readonly 'background-neutrals-disabled-controls'?: any;
572
+ readonly 'background-neutrals-scrolls'?: any;
573
+ readonly 'background-neutrals-inactive'?: any;
574
+ readonly 'background-neutrals-inactive-hover'?: any;
575
+ readonly 'background-primary-prominent'?: any;
576
+ readonly 'background-primary-prominent-hover'?: any;
577
+ readonly 'background-primary-prominent-active'?: any;
578
+ readonly 'background-primary-prominent-selected'?: any;
579
+ readonly 'background-primary-subtle'?: any;
580
+ readonly 'background-primary-subtle-hover'?: any;
581
+ readonly 'background-primary-subtle-active'?: any;
582
+ readonly 'background-primary-subtle-selected'?: any;
583
+ readonly 'background-danger-prominent'?: any;
584
+ readonly 'background-danger-prominent-hover'?: any;
585
+ readonly 'background-danger-prominent-active'?: any;
586
+ readonly 'background-danger'?: any;
477
587
  readonly 'background-danger-hover'?: any;
478
- readonly 'background-danger-idle'?: any;
479
- readonly 'background-default-active'?: any;
480
- readonly 'background-default-disabled'?: any;
481
- readonly 'background-default-hover'?: any;
482
- readonly 'background-default-idle'?: any;
483
- readonly 'background-default-selected'?: any;
484
- readonly 'background-default-selected-active'?: any;
485
- readonly 'background-info-idle'?: any;
486
- readonly 'background-primary'?: any;
487
- readonly 'background-secondary'?: any;
488
- readonly 'background-success-idle'?: any;
489
- readonly 'background-warning-idle'?: any;
490
- readonly 'border-cta-idle'?: any;
491
- readonly 'border-default-active'?: any;
492
- readonly 'border-default-error'?: any;
493
- readonly 'border-default-hover'?: any;
494
- readonly 'border-default-idle'?: any;
495
- readonly 'border-default-selected'?: any;
496
- readonly 'canvas-primary'?: any;
497
- readonly 'divider-default'?: any;
498
- readonly 'focus-ring-default'?: any;
499
- readonly 'font-cta-idle'?: any;
500
- readonly 'font-default-active'?: any;
501
- readonly 'font-default-disabled'?: any;
502
- readonly 'font-default-error'?: any;
503
- readonly 'font-default-hover'?: any;
504
- readonly 'font-default-idle'?: any;
505
- readonly 'font-default-selected'?: any;
506
- readonly 'font-default-visited'?: any;
507
- readonly 'font-primary'?: any;
508
- readonly 'font-secondary'?: any;
509
- readonly 'font-tertiary'?: any;
510
- readonly 'icon-cta-idle'?: any;
511
- readonly 'icon-default'?: any;
512
- readonly 'icon-default-active'?: any;
513
- readonly 'icon-default-disabled'?: any;
514
- readonly 'icon-default-error'?: any;
515
- readonly 'icon-default-hover'?: any;
516
- readonly 'icon-default-idle'?: any;
517
- readonly 'icon-default-selected'?: any;
588
+ readonly 'background-success'?: any;
589
+ readonly 'background-warning-subtle'?: any;
590
+ readonly 'background-warning-prominent'?: any;
591
+ readonly 'text-neutrals-inverted'?: any;
592
+ readonly 'text-neutrals'?: any;
593
+ readonly 'text-neutrals-secondary'?: any;
594
+ readonly 'text-neutrals-placeholder-only'?: any;
595
+ readonly 'text-neutrals-placeholder'?: any;
596
+ readonly 'text-neutrals-disabled'?: any;
597
+ readonly 'text-primary-inverted'?: any;
598
+ readonly 'text-primary'?: any;
599
+ readonly 'text-primary-hover'?: any;
600
+ readonly 'text-primary-active'?: any;
601
+ readonly 'text-primary-selected'?: any;
602
+ readonly 'text-danger-inverted'?: any;
603
+ readonly 'text-danger'?: any;
604
+ readonly 'text-danger-hover'?: any;
605
+ readonly 'text-danger-active'?: any;
606
+ readonly 'text-success'?: any;
607
+ readonly 'text-warning'?: any;
608
+ readonly 'icon-neutrals-inverted'?: any;
609
+ readonly 'icon-neutrals'?: any;
610
+ readonly 'icon-neutrals-secondary'?: any;
611
+ readonly 'icon-neutrals-disabled'?: any;
612
+ readonly 'icon-neutrals-search'?: any;
613
+ readonly 'icon-primary-inverted'?: any;
614
+ readonly 'icon-primary'?: any;
615
+ readonly 'icon-primary-hover'?: any;
616
+ readonly 'icon-primary-active'?: any;
617
+ readonly 'icon-primary-selected'?: any;
618
+ readonly 'icon-danger-inverted'?: any;
619
+ readonly 'icon-danger'?: any;
620
+ readonly 'icon-danger-hover'?: any;
621
+ readonly 'icon-danger-active'?: any;
622
+ readonly 'icon-success-inverted'?: any;
623
+ readonly 'icon-success'?: any;
624
+ readonly 'icon-warning'?: any;
625
+ readonly 'border-neutrals'?: any;
626
+ readonly 'border-neutrals-hover'?: any;
627
+ readonly 'border-neutrals-active'?: any;
628
+ readonly 'border-neutrals-disabled'?: any;
629
+ readonly 'border-neutrals-controls'?: any;
630
+ readonly 'border-neutrals-controls-disabled'?: any;
631
+ readonly 'border-neutrals-subtle'?: any;
632
+ readonly 'border-neutrals-inverted'?: any;
633
+ readonly 'border-primary'?: any;
634
+ readonly 'border-primary-hover'?: any;
635
+ readonly 'border-primary-active'?: any;
636
+ readonly 'border-primary-inverted'?: any;
637
+ readonly 'border-danger'?: any;
638
+ readonly 'border-success'?: any;
639
+ readonly 'border-warning'?: any;
518
640
  };
519
641
  'font-sizes': {
520
642
  readonly 150: "0.75rem";
@@ -837,7 +959,7 @@ interface TooltipProps {
837
959
  /**
838
960
  * Overrides the duration given to the `Provider` to customize the open delay
839
961
  * for a specific tooltip.
840
- * @default 400
962
+ * @default 200
841
963
  */
842
964
  delayDuration?: number;
843
965
  /**
@@ -859,7 +981,7 @@ interface TooltipProps {
859
981
  disableHoverableContent?: boolean;
860
982
  }
861
983
  declare const DEFAULT_SKIP_DELAY_DURATION = 500;
862
- declare const DEFAULT_DELAY_DURATION = 400;
984
+ declare const DEFAULT_DELAY_DURATION = 200;
863
985
  declare const Tooltip: react__default.FC<TooltipProps> & Partials;
864
986
  interface Partials {
865
987
  Trigger: typeof Trigger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirohq/design-system-tooltip",
3
- "version": "3.1.6",
3
+ "version": "3.1.8-colors.0",
4
4
  "description": "",
5
5
  "author": "Miro",
6
6
  "source": "src/index.ts",
@@ -28,14 +28,14 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@radix-ui/react-tooltip": "^1.0.0",
31
- "@mirohq/design-system-stitches": "^2.0.9",
32
- "@mirohq/design-system-styles": "^1.0.9",
31
+ "@mirohq/design-system-stitches": "^2.0.10-colors.0",
32
+ "@mirohq/design-system-styles": "^1.0.10-colors.0",
33
33
  "@mirohq/design-system-utils": "^0.10.0",
34
- "@mirohq/design-tokens": "^1.6.0"
34
+ "@mirohq/design-tokens": "^2.0.0-colors.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@mirohq/design-system-button": "^2.0.13",
38
- "@mirohq/design-system-flex": "^2.0.10"
37
+ "@mirohq/design-system-button": "^2.0.14-colors.0",
38
+ "@mirohq/design-system-flex": "^2.0.11-colors.0"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "rollup -c ../../../rollup.config.js",