@mirohq/design-system-tooltip 3.3.10 → 3.3.12

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
@@ -122,18 +122,20 @@ const Tooltip = ({
122
122
  clearDelaysOnUnmount = process.env.NODE_ENV === "test",
123
123
  children
124
124
  }) => {
125
+ var _a;
125
126
  const context = useTooltipContext();
126
127
  const isMounted = React.useRef(false);
128
+ const _skipDelayDuration = (_a = skipDelayDuration != null ? skipDelayDuration : context.skipDelayDuration) != null ? _a : DEFAULT_SKIP_DELAY_DURATION;
127
129
  const [openState, setOpenState] = React.useState(defaultOpen);
128
130
  const setDelayedOpen = React.useCallback(
129
131
  (newOpenState) => {
130
- var _a, _b;
132
+ var _a2;
131
133
  clearTimeout(delayTimer);
132
134
  clearTimeout(skipDelayTimer);
133
135
  if (!newOpenState) {
134
136
  skipDelayTimer = setTimeout(() => {
135
137
  shouldSkipDelay = false;
136
- }, (_a = skipDelayDuration != null ? skipDelayDuration : context.skipDelayDuration) != null ? _a : DEFAULT_SKIP_DELAY_DURATION);
138
+ }, _skipDelayDuration);
137
139
  setOpenState(false);
138
140
  onClose == null ? void 0 : onClose();
139
141
  return;
@@ -146,14 +148,14 @@ const Tooltip = ({
146
148
  if (document.querySelector("[data-tooltip-trigger]:hover") == null && process.env.NODE_ENV !== "test") {
147
149
  return;
148
150
  }
149
- shouldSkipDelay = true;
151
+ shouldSkipDelay = _skipDelayDuration !== 0;
150
152
  if (isMounted.current) {
151
153
  setOpenState(true);
152
154
  onOpen == null ? void 0 : onOpen();
153
155
  }
154
- }, (_b = delayDuration != null ? delayDuration : context.delayDuration) != null ? _b : DEFAULT_DELAY_DURATION);
156
+ }, (_a2 = delayDuration != null ? delayDuration : context.delayDuration) != null ? _a2 : DEFAULT_DELAY_DURATION);
155
157
  },
156
- [delayDuration, skipDelayDuration, context, onClose, onOpen]
158
+ [delayDuration, context.delayDuration, _skipDelayDuration, onClose, onOpen]
157
159
  );
158
160
  const handleOpenChange = React.useCallback(
159
161
  (newState) => {
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/partials/hotkey.styled.tsx","../src/partials/hotkey.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: '5px',\n transform: 'translateY(-1px)',\n width: '15px',\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 * @default 'center'\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n * @default 5\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 * @default 'top'\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n * @default true\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n * @default 0\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 * @default 'partial'\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n * @default true (false in test environment)\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 hideWhenDetached = process.env.NODE_ENV !== 'test',\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 hideWhenDetached={hideWhenDetached}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n\nContent.displayName = 'Tooltip.Content'\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\nTrigger.displayName = 'Tooltip.Trigger'\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 /**\n * The content\n */\n children?: React.ReactNode\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\nProvider.displayName = 'Tooltip.Provider'\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 type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledHotkey = styled(Primitive.span, {\n marginLeft: '$100',\n})\n\nexport type StyledHotkeyProps = StrictComponentProps<typeof StyledHotkey>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { Hotkey as BaseHotkey } from '@mirohq/design-system-base-hotkey'\n\nimport type { StyledHotkeyProps } from './hotkey.styled'\nimport { StyledHotkey } from './hotkey.styled'\n\nexport interface HotkeyProps extends StyledHotkeyProps {\n /**\n * The content.\n */\n children: string\n}\n\nexport const Hotkey = React.forwardRef<\n ElementRef<typeof StyledHotkey>,\n HotkeyProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledHotkey {...restProps} ref={forwardRef}>\n <BaseHotkey variant='inverted'>{children}</BaseHotkey>\n </StyledHotkey>\n))\n","import React, { useState, useCallback, useEffect, useRef } 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'\nimport { Hotkey } from './partials/hotkey'\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 /**\n * The content\n */\n children: React.ReactNode\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 isMounted = useRef(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n (newOpenState: boolean) => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (!newOpenState) {\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 (isMounted.current) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, onClose, onOpen]\n )\n\n const handleOpenChange = useCallback(\n (newState: boolean) => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n },\n [open, onOpen, onClose, setDelayedOpen]\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 isMounted.current = true\n return () => {\n isMounted.current = false\n }\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={handleOpenChange}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n Hotkey: typeof Hotkey\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\nTooltip.Hotkey = Hotkey\n"],"names":["styled","RadixArrow","RadixContent","animations","React","jsxs","Trigger","jsx","createContext","useContext","RadixPortal","Primitive","BaseHotkey","useRef","useState","useCallback","useEffect","RadixProvider","RadixTooltip"],"mappings":";;;;;;;;;;;;;;;;AAQa,MAAA,eAAA,GAAkBA,4BAAOC,kBAAY,EAAA;AAAA,EAChD,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA,KAAA;AAAA,EACR,SAAW,EAAA,kBAAA;AAAA,EACX,KAAO,EAAA,MAAA;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,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AA,CAAA;AAC3B,QAAkB,eAAA,GAAA,KAAA,CAAA;AAAA,OACpB;AAAA,KACF;AAAA,IACA,CAAC,oBAAoB,CAAA;AAAA,GACvB,CAAA;AAEA,EAAAA,eAAA,CAAU,MAAM;AACd,IAAA,SAAA,CAAU,OAAU,GAAA,IAAA,CAAA;AACpB,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,CAAU,OAAU,GAAA,KAAA,CAAA;AAAA,KACtB,CAAA;AAAA,GACF,EAAG,EAAE,CAAA,CAAA;AAEL,EAAA,uBACGT,cAAA,CAAAU,qBAAA,EAAA,EAAc,aAAe,EAAA,CAAA,EAAG,mBAAmB,CAClD,EAAA,QAAA,kBAAAV,cAAA;AAAA,IAACW,iBAAA;AAAA,IAAA;AAAA,MACC,uBAAA;AAAA,MACA,MAAM,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,SAAA;AAAA,MACd,aAAe,EAAA,CAAA;AAAA,MACf,YAAc,EAAA,gBAAA;AAAA,MAEb,QAAA;AAAA,KAAA;AAAA,GAEL,EAAA,CAAA,CAAA;AAEJ,EAAA;AAaA,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,CAAA;AACjB,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/partials/hotkey.styled.tsx","../src/partials/hotkey.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: '5px',\n transform: 'translateY(-1px)',\n width: '15px',\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 * @default 'center'\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n * @default 5\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 * @default 'top'\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n * @default true\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n * @default 0\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 * @default 'partial'\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n * @default true (false in test environment)\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 hideWhenDetached = process.env.NODE_ENV !== 'test',\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 hideWhenDetached={hideWhenDetached}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n\nContent.displayName = 'Tooltip.Content'\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\nTrigger.displayName = 'Tooltip.Trigger'\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 * When set to `0`, when hovering between triggers there wont be delay duration.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * The content\n */\n children?: React.ReactNode\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\nProvider.displayName = 'Tooltip.Provider'\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 type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledHotkey = styled(Primitive.span, {\n marginLeft: '$100',\n})\n\nexport type StyledHotkeyProps = StrictComponentProps<typeof StyledHotkey>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { Hotkey as BaseHotkey } from '@mirohq/design-system-base-hotkey'\n\nimport type { StyledHotkeyProps } from './hotkey.styled'\nimport { StyledHotkey } from './hotkey.styled'\n\nexport interface HotkeyProps extends StyledHotkeyProps {\n /**\n * The content.\n */\n children: string\n}\n\nexport const Hotkey = React.forwardRef<\n ElementRef<typeof StyledHotkey>,\n HotkeyProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledHotkey {...restProps} ref={forwardRef}>\n <BaseHotkey variant='inverted'>{children}</BaseHotkey>\n </StyledHotkey>\n))\n","import React, { useState, useCallback, useEffect, useRef } 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'\nimport { Hotkey } from './partials/hotkey'\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 /**\n * The content\n */\n children: React.ReactNode\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 isMounted = useRef(false)\n const _skipDelayDuration =\n skipDelayDuration ??\n context.skipDelayDuration ??\n DEFAULT_SKIP_DELAY_DURATION\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n (newOpenState: boolean) => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (!newOpenState) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, _skipDelayDuration)\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 /* when skipDelayDuration is 0 no skip delay should happen. */\n shouldSkipDelay = _skipDelayDuration !== 0\n\n if (isMounted.current) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, context.delayDuration, _skipDelayDuration, onClose, onOpen]\n )\n\n const handleOpenChange = useCallback(\n (newState: boolean) => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n },\n [open, onOpen, onClose, setDelayedOpen]\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 isMounted.current = true\n return () => {\n isMounted.current = false\n }\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={handleOpenChange}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n Hotkey: typeof Hotkey\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\nTooltip.Hotkey = Hotkey\n"],"names":["styled","RadixArrow","RadixContent","animations","React","jsxs","Trigger","jsx","createContext","useContext","RadixPortal","Primitive","BaseHotkey","useRef","useState","useCallback","_a","useEffect","RadixProvider","RadixTooltip"],"mappings":";;;;;;;;;;;;;;;;AAQa,MAAA,eAAA,GAAkBA,4BAAOC,kBAAY,EAAA;AAAA,EAChD,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA,KAAA;AAAA,EACR,SAAW,EAAA,kBAAA;AAAA,EACX,KAAO,EAAA,MAAA;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,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IAAA,CAAA;AACpB,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,CAAU,OAAU,GAAA,KAAA,CAAA;AAAA,KACtB,CAAA;AAAA,GACF,EAAG,EAAE,CAAA,CAAA;AAEL,EAAA,uBACGV,cAAA,CAAAW,qBAAA,EAAA,EAAc,aAAe,EAAA,CAAA,EAAG,mBAAmB,CAClD,EAAA,QAAA,kBAAAX,cAAA;AAAA,IAACY,iBAAA;AAAA,IAAA;AAAA,MACC,uBAAA;AAAA,MACA,MAAM,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,SAAA;AAAA,MACd,aAAe,EAAA,CAAA;AAAA,MACf,YAAc,EAAA,gBAAA;AAAA,MAEb,QAAA;AAAA,KAAA;AAAA,GAEL,EAAA,CAAA,CAAA;AAEJ,EAAA;AAaA,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,CAAA;AACjB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;;;;"}
package/dist/module.js CHANGED
@@ -114,18 +114,20 @@ const Tooltip = ({
114
114
  clearDelaysOnUnmount = process.env.NODE_ENV === "test",
115
115
  children
116
116
  }) => {
117
+ var _a;
117
118
  const context = useTooltipContext();
118
119
  const isMounted = useRef(false);
120
+ const _skipDelayDuration = (_a = skipDelayDuration != null ? skipDelayDuration : context.skipDelayDuration) != null ? _a : DEFAULT_SKIP_DELAY_DURATION;
119
121
  const [openState, setOpenState] = useState(defaultOpen);
120
122
  const setDelayedOpen = useCallback(
121
123
  (newOpenState) => {
122
- var _a, _b;
124
+ var _a2;
123
125
  clearTimeout(delayTimer);
124
126
  clearTimeout(skipDelayTimer);
125
127
  if (!newOpenState) {
126
128
  skipDelayTimer = setTimeout(() => {
127
129
  shouldSkipDelay = false;
128
- }, (_a = skipDelayDuration != null ? skipDelayDuration : context.skipDelayDuration) != null ? _a : DEFAULT_SKIP_DELAY_DURATION);
130
+ }, _skipDelayDuration);
129
131
  setOpenState(false);
130
132
  onClose == null ? void 0 : onClose();
131
133
  return;
@@ -138,14 +140,14 @@ const Tooltip = ({
138
140
  if (document.querySelector("[data-tooltip-trigger]:hover") == null && process.env.NODE_ENV !== "test") {
139
141
  return;
140
142
  }
141
- shouldSkipDelay = true;
143
+ shouldSkipDelay = _skipDelayDuration !== 0;
142
144
  if (isMounted.current) {
143
145
  setOpenState(true);
144
146
  onOpen == null ? void 0 : onOpen();
145
147
  }
146
- }, (_b = delayDuration != null ? delayDuration : context.delayDuration) != null ? _b : DEFAULT_DELAY_DURATION);
148
+ }, (_a2 = delayDuration != null ? delayDuration : context.delayDuration) != null ? _a2 : DEFAULT_DELAY_DURATION);
147
149
  },
148
- [delayDuration, skipDelayDuration, context, onClose, onOpen]
150
+ [delayDuration, context.delayDuration, _skipDelayDuration, onClose, onOpen]
149
151
  );
150
152
  const handleOpenChange = useCallback(
151
153
  (newState) => {
@@ -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/partials/hotkey.styled.tsx","../src/partials/hotkey.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: '5px',\n transform: 'translateY(-1px)',\n width: '15px',\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 * @default 'center'\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n * @default 5\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 * @default 'top'\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n * @default true\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n * @default 0\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 * @default 'partial'\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n * @default true (false in test environment)\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 hideWhenDetached = process.env.NODE_ENV !== 'test',\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 hideWhenDetached={hideWhenDetached}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n\nContent.displayName = 'Tooltip.Content'\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\nTrigger.displayName = 'Tooltip.Trigger'\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 /**\n * The content\n */\n children?: React.ReactNode\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\nProvider.displayName = 'Tooltip.Provider'\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 type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledHotkey = styled(Primitive.span, {\n marginLeft: '$100',\n})\n\nexport type StyledHotkeyProps = StrictComponentProps<typeof StyledHotkey>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { Hotkey as BaseHotkey } from '@mirohq/design-system-base-hotkey'\n\nimport type { StyledHotkeyProps } from './hotkey.styled'\nimport { StyledHotkey } from './hotkey.styled'\n\nexport interface HotkeyProps extends StyledHotkeyProps {\n /**\n * The content.\n */\n children: string\n}\n\nexport const Hotkey = React.forwardRef<\n ElementRef<typeof StyledHotkey>,\n HotkeyProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledHotkey {...restProps} ref={forwardRef}>\n <BaseHotkey variant='inverted'>{children}</BaseHotkey>\n </StyledHotkey>\n))\n","import React, { useState, useCallback, useEffect, useRef } 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'\nimport { Hotkey } from './partials/hotkey'\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 /**\n * The content\n */\n children: React.ReactNode\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 isMounted = useRef(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n (newOpenState: boolean) => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (!newOpenState) {\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 (isMounted.current) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, onClose, onOpen]\n )\n\n const handleOpenChange = useCallback(\n (newState: boolean) => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n },\n [open, onOpen, onClose, setDelayedOpen]\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 isMounted.current = true\n return () => {\n isMounted.current = false\n }\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={handleOpenChange}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n Hotkey: typeof Hotkey\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\nTooltip.Hotkey = Hotk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,CAAQ,QAAW,GAAA,QAAA,CAAA;AACnB,OAAA,CAAQ,MAAS,GAAA,MAAA,CAAA;AACjB,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/partials/hotkey.styled.tsx","../src/partials/hotkey.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: '5px',\n transform: 'translateY(-1px)',\n width: '15px',\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 * @default 'center'\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n * @default 5\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 * @default 'top'\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n * @default true\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n * @default 0\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 * @default 'partial'\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n * @default true (false in test environment)\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 hideWhenDetached = process.env.NODE_ENV !== 'test',\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 hideWhenDetached={hideWhenDetached}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n\nContent.displayName = 'Tooltip.Content'\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\nTrigger.displayName = 'Tooltip.Trigger'\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 * When set to `0`, when hovering between triggers there wont be delay duration.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * The content\n */\n children?: React.ReactNode\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\nProvider.displayName = 'Tooltip.Provider'\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 type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledHotkey = styled(Primitive.span, {\n marginLeft: '$100',\n})\n\nexport type StyledHotkeyProps = StrictComponentProps<typeof StyledHotkey>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { Hotkey as BaseHotkey } from '@mirohq/design-system-base-hotkey'\n\nimport type { StyledHotkeyProps } from './hotkey.styled'\nimport { StyledHotkey } from './hotkey.styled'\n\nexport interface HotkeyProps extends StyledHotkeyProps {\n /**\n * The content.\n */\n children: string\n}\n\nexport const Hotkey = React.forwardRef<\n ElementRef<typeof StyledHotkey>,\n HotkeyProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledHotkey {...restProps} ref={forwardRef}>\n <BaseHotkey variant='inverted'>{children}</BaseHotkey>\n </StyledHotkey>\n))\n","import React, { useState, useCallback, useEffect, useRef } 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'\nimport { Hotkey } from './partials/hotkey'\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 /**\n * The content\n */\n children: React.ReactNode\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 isMounted = useRef(false)\n const _skipDelayDuration =\n skipDelayDuration ??\n context.skipDelayDuration ??\n DEFAULT_SKIP_DELAY_DURATION\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n (newOpenState: boolean) => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (!newOpenState) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, _skipDelayDuration)\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 /* when skipDelayDuration is 0 no skip delay should happen. */\n shouldSkipDelay = _skipDelayDuration !== 0\n\n if (isMounted.current) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, context.delayDuration, _skipDelayDuration, onClose, onOpen]\n )\n\n const handleOpenChange = useCallback(\n (newState: boolean) => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n },\n [open, onOpen, onClose, setDelayedOpen]\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 isMounted.current = true\n return () => {\n isMounted.current = false\n }\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={handleOpenChange}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n Hotkey: typeof Hotkey\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\nTooltip.Hotkey = Hotkey\n"],"names":["RadixArrow","RadixContent","Trigger","RadixPortal","BaseHotkey","_a","RadixProvider","RadixTooltip"],"mappings":";;;;;;;;AAQa,MAAA,eAAA,GAAkB,OAAOA,KAAY,EAAA;AAAA,EAChD,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA,KAAA;AAAA,EACR,SAAW,EAAA,kBAAA;AAAA,EACX,KAAO,EAAA,MAAA;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;AA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A;AAEA,EAAA,SAAA;AAAA,IACE,MAAM,MAAM;AACV,MAAA,IAAI,oBAAsB,EAAA;AACxB,QAAA,YAAA,CAAa,UAAU,CAAA,CAAA;AACvB,QAAA,YAAA,CAAa,cAAc,CAAA,CAAA;AAC3B,QAAkB,eAAA,GAAA,KAAA,CAAA;AAAA,OACpB;AAAA,KACF;AAAA,IACA,CAAC,oBAAoB,CAAA;AAAA,GACvB,CAAA;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,SAAA,CAAU,OAAU,GAAA,IAAA,CAAA;AACpB,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,CAAU,OAAU,GAAA,KAAA,CAAA;AAAA,KACtB,CAAA;AAAA,GACF,EAAG,EAAE,CAAA,CAAA;AAEL,EAAA,uBACG,GAAA,CAAAC,UAAA,EAAA,EAAc,aAAe,EAAA,CAAA,EAAG,mBAAmB,CAClD,EAAA,QAAA,kBAAA,GAAA;AAAA,IAACC,IAAA;AAAA,IAAA;AAAA,MACC,uBAAA;AAAA,MACA,MAAM,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,SAAA;AAAA,MACd,aAAe,EAAA,CAAA;AAAA,MACf,YAAc,EAAA,gBAAA;AAAA,MAEb,QAAA;AAAA,KAAA;AAAA,GAEL,EAAA,CAAA,CAAA;AAEJ,EAAA;AAaA,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,CAAA;AACjB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;"}
package/dist/types.d.ts CHANGED
@@ -274,8 +274,8 @@ declare const StyledContent: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_d
274
274
  "focus-small-outline": any;
275
275
  "focus-large": any;
276
276
  "focus-controls": any;
277
+ "focus-small-error": any;
277
278
  "focus-controls-error": any;
278
- "focus-controls-error-small": any;
279
279
  "focus-controls-success": any;
280
280
  };
281
281
  sizes: {
@@ -852,8 +852,8 @@ declare const StyledTrigger: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_d
852
852
  "focus-small-outline": any;
853
853
  "focus-large": any;
854
854
  "focus-controls": any;
855
+ "focus-small-error": any;
855
856
  "focus-controls-error": any;
856
- "focus-controls-error-small": any;
857
857
  "focus-controls-success": any;
858
858
  };
859
859
  sizes: {
@@ -1094,6 +1094,8 @@ interface ProviderProps {
1094
1094
  /**
1095
1095
  * How much time a user has to enter another trigger without incurring
1096
1096
  * a delay again.
1097
+ * When set to `0`, when hovering between triggers there wont be delay duration.
1098
+ * @default 500
1097
1099
  */
1098
1100
  skipDelayDuration?: number;
1099
1101
  /**
@@ -1383,8 +1385,8 @@ declare const StyledHotkey: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_de
1383
1385
  "focus-small-outline": any;
1384
1386
  "focus-large": any;
1385
1387
  "focus-controls": any;
1388
+ "focus-small-error": any;
1386
1389
  "focus-controls-error": any;
1387
- "focus-controls-error-small": any;
1388
1390
  "focus-controls-success": any;
1389
1391
  };
1390
1392
  sizes: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirohq/design-system-tooltip",
3
- "version": "3.3.10",
3
+ "version": "3.3.12",
4
4
  "description": "",
5
5
  "author": "Miro",
6
6
  "source": "src/index.ts",
@@ -28,12 +28,12 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@radix-ui/react-tooltip": "^1.0.3",
31
- "@mirohq/design-system-base-hotkey": "^0.1.6",
31
+ "@mirohq/design-system-base-hotkey": "^0.1.7",
32
32
  "@mirohq/design-system-primitive": "^1.1.2",
33
- "@mirohq/design-system-stitches": "^2.6.5",
33
+ "@mirohq/design-system-styles": "^1.2.5",
34
+ "@mirohq/design-system-stitches": "^2.6.6",
34
35
  "@mirohq/design-system-utils": "^0.15.1",
35
- "@mirohq/design-tokens": "^5.0.0",
36
- "@mirohq/design-system-styles": "^1.2.4"
36
+ "@mirohq/design-tokens": "^5.0.0"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "rollup -c ../../../rollup.config.js",