@radix-ui/react-tooltip 1.0.6-rc.1 → 1.0.6-rc.11

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.
@@ -0,0 +1,96 @@
1
+ import * as React from "react";
2
+ import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
3
+ import * as PopperPrimitive from "@radix-ui/react-popper";
4
+ import { Portal as _Portal1 } from "@radix-ui/react-portal";
5
+ import * as Radix from "@radix-ui/react-primitive";
6
+ import { Primitive } from "@radix-ui/react-primitive";
7
+ export const createTooltipScope: import("@radix-ui/react-context").CreateScope;
8
+ interface TooltipProviderProps {
9
+ children: React.ReactNode;
10
+ /**
11
+ * The duration from when the pointer enters the trigger until the tooltip gets opened.
12
+ * @defaultValue 700
13
+ */
14
+ delayDuration?: number;
15
+ /**
16
+ * How much time a user has to enter another trigger without incurring a delay again.
17
+ * @defaultValue 300
18
+ */
19
+ skipDelayDuration?: number;
20
+ /**
21
+ * When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
22
+ * @defaultValue false
23
+ */
24
+ disableHoverableContent?: boolean;
25
+ }
26
+ export const TooltipProvider: React.FC<TooltipProviderProps>;
27
+ export interface TooltipProps {
28
+ children?: React.ReactNode;
29
+ open?: boolean;
30
+ defaultOpen?: boolean;
31
+ onOpenChange?: (open: boolean) => void;
32
+ /**
33
+ * The duration from when the pointer enters the trigger until the tooltip gets opened. This will
34
+ * override the prop with the same name passed to Provider.
35
+ * @defaultValue 700
36
+ */
37
+ delayDuration?: number;
38
+ /**
39
+ * When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
40
+ * @defaultValue false
41
+ */
42
+ disableHoverableContent?: boolean;
43
+ }
44
+ export const Tooltip: React.FC<TooltipProps>;
45
+ type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
46
+ export interface TooltipTriggerProps extends PrimitiveButtonProps {
47
+ }
48
+ export const TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
49
+ type PortalProps = React.ComponentPropsWithoutRef<typeof _Portal1>;
50
+ export interface TooltipPortalProps extends Omit<PortalProps, 'asChild'> {
51
+ children?: React.ReactNode;
52
+ /**
53
+ * Used to force mounting when more control is needed. Useful when
54
+ * controlling animation with React animation libraries.
55
+ */
56
+ forceMount?: true;
57
+ }
58
+ export const TooltipPortal: React.FC<TooltipPortalProps>;
59
+ export interface TooltipContentProps extends TooltipContentImplProps {
60
+ /**
61
+ * Used to force mounting when more control is needed. Useful when
62
+ * controlling animation with React animation libraries.
63
+ */
64
+ forceMount?: true;
65
+ }
66
+ export const TooltipContent: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
67
+ type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
68
+ type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
69
+ interface TooltipContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {
70
+ /**
71
+ * A more descriptive label for accessibility purpose
72
+ */
73
+ 'aria-label'?: string;
74
+ /**
75
+ * Event handler called when the escape key is down.
76
+ * Can be prevented.
77
+ */
78
+ onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
79
+ /**
80
+ * Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.
81
+ * Can be prevented.
82
+ */
83
+ onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
84
+ }
85
+ type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
86
+ export interface TooltipArrowProps extends PopperArrowProps {
87
+ }
88
+ export const TooltipArrow: React.ForwardRefExoticComponent<TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
89
+ export const Provider: React.FC<TooltipProviderProps>;
90
+ export const Root: React.FC<TooltipProps>;
91
+ export const Trigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
92
+ export const Portal: React.FC<TooltipPortalProps>;
93
+ export const Content: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
94
+ export const Arrow: React.ForwardRefExoticComponent<TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
95
+
96
+ //# sourceMappingURL=index.d.ts.map
@@ -540,4 +540,4 @@ const $a093c7e1ec25a057$export$21b07c8f274aebd5 = $a093c7e1ec25a057$export$c27ee
540
540
 
541
541
 
542
542
  export {$a093c7e1ec25a057$export$1c540a2224f0d865 as createTooltipScope, $a093c7e1ec25a057$export$f78649fb9ca566b8 as TooltipProvider, $a093c7e1ec25a057$export$28c660c63b792dea as Tooltip, $a093c7e1ec25a057$export$8c610744efcf8a1d as TooltipTrigger, $a093c7e1ec25a057$export$7b36b8f925ab7497 as TooltipPortal, $a093c7e1ec25a057$export$e9003e2be37ec060 as TooltipContent, $a093c7e1ec25a057$export$c27ee0ad710f7559 as TooltipArrow, $a093c7e1ec25a057$export$2881499e37b75b9a as Provider, $a093c7e1ec25a057$export$be92b6f5f03c0fe9 as Root, $a093c7e1ec25a057$export$41fb9f06171c75f4 as Trigger, $a093c7e1ec25a057$export$602eac185826482c as Portal, $a093c7e1ec25a057$export$7c6e2c02157bb7d2 as Content, $a093c7e1ec25a057$export$21b07c8f274aebd5 as Arrow};
543
- //# sourceMappingURL=index.module.js.map
543
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;A;;;;;;;;;;;;;;;ACmBA,MAAM,CAAC2B,0CAAD,EAAuB3B,yCAAvB,CAAA,GAA6CgB,yBAAkB,CAAC,SAAD,EAAY;IAC/EI,wBAD+E;CAAZ,CAArE,AAAA;AAGA,MAAMQ,oCAAc,GAAGR,wBAAiB,EAAxC,AAAA;AAEA;;oGAEA,CAEA,MAAMS,mCAAa,GAAG,iBAAtB,AAAA;AACA,MAAMC,4CAAsB,GAAG,GAA/B,AAAA;AACA,MAAMC,kCAAY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AAClE,CAAvB,CAAA,AAAjC,EAA4DqE,SAAS,CAACF,GAAV,EAAA,CAA5D;iBACK,MADL;SAED;QACDE,SAAS,CAACD,IAAV,CAAeJ,CAAf,CAAAK,CAAAA;KACD;IACDA,SAAS,CAACF,GAAV,EAAAE,CAAAA;IAEA,IACEN,SAAS,CAACb,MAAV,KAAqB,CAArB,IACAmB,SAAS,CAACnB,MAAV,KAAqB,CADrB,IAEAa,SAAS,CAAC,CAAD,CAAT,CAAa/D,CAAb,KAAmBqE,SAAS,CAAC,CAAD,CAAT,CAAarE,CAFhC,IAGA+D,SAAS,CAAC,CAAD,CAAT,CAAa7D,CAAb,KAAmBmE,SAAS,CAAC,CAAD,CAAT,CAAanE,CAJlC,EAME,OAAO6D,SAAP,CAAA;SAEA,OAAOA,SAAS,CAACO,MAAV,CAAiBD,SAAjB,CAAP,CAAA;CAEH;AAED,MAAM9L,yCAAQ,GAAGN,yCAAjB,AAAA;AACA,MAAMO,yCAAI,GAAGN,yCAAb,AAAA;AACA,MAAMO,yCAAO,GAAGN,yCAAhB,AAAA;AACA,MAAMO,yCAAM,GAAGN,yCAAf,AAAA;AACA,MAAMO,yCAAO,GAAGN,yCAAhB,AAAA;AACA,MAAMO,yCAAK,GAAGN,yCAAd,AAAA;;ADlsBA","sources":["packages/react/tooltip/src/index.ts","packages/react/tooltip/src/Tooltip.tsx"],"sourcesContent":["export {\n createTooltipScope,\n //\n TooltipProvider,\n Tooltip,\n TooltipTrigger,\n TooltipPortal,\n TooltipContent,\n TooltipArrow,\n //\n Provider,\n Root,\n Trigger,\n Portal,\n Content,\n Arrow,\n} from './Tooltip';\nexport type {\n TooltipProps,\n TooltipTriggerProps,\n TooltipPortalProps,\n TooltipContentProps,\n TooltipArrowProps,\n} from './Tooltip';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slottable } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype ScopedProps<P = {}> = P & { __scopeTooltip?: Scope };\nconst [createTooltipContext, createTooltipScope] = createContextScope('Tooltip', [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipProvider\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROVIDER_NAME = 'TooltipProvider';\nconst DEFAULT_DELAY_DURATION = 700;\nconst TOOLTIP_OPEN = 'tooltip.open';\n\ntype TooltipProviderContextValue = {\n isOpenDelayed: boolean;\n delayDuration: number;\n onOpen(): void;\n onClose(): void;\n onPointerInTransitChange(inTransit: boolean): void;\n isPointerInTransitRef: React.MutableRefObject<boolean>;\n disableHoverableContent: boolean;\n};\n\nconst [TooltipProviderContextProvider, useTooltipProviderContext] =\n createTooltipContext<TooltipProviderContextValue>(PROVIDER_NAME);\n\ninterface TooltipProviderProps {\n children: React.ReactNode;\n /**\n * The duration from when the pointer enters the trigger until the tooltip gets opened.\n * @defaultValue 700\n */\n delayDuration?: number;\n /**\n * How much time a user has to enter another trigger without incurring a delay again.\n * @defaultValue 300\n */\n skipDelayDuration?: number;\n /**\n * When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.\n * @defaultValue false\n */\n disableHoverableContent?: boolean;\n}\n\nconst TooltipProvider: React.FC<TooltipProviderProps> = (\n props: ScopedProps<TooltipProviderProps>\n) => {\n const {\n __scopeTooltip,\n delayDuration = DEFAULT_DELAY_DURATION,\n skipDelayDuration = 300,\n disableHoverableContent = false,\n children,\n } = props;\n const [isOpenDelayed, setIsOpenDelayed] = React.useState(true);\n const isPointerInTransitRef = React.useRef(false);\n const skipDelayTimerRef = React.useRef(0);\n\n React.useEffect(() => {\n const skipDelayTimer = skipDelayTimerRef.current;\n return () => window.clearTimeout(skipDelayTimer);\n }, []);\n\n return (\n <TooltipProviderContextProvider\n scope={__scopeTooltip}\n isOpenDelayed={isOpenDelayed}\n delayDuration={delayDuration}\n onOpen={React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n setIsOpenDelayed(false);\n }, [])}\n onClose={React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => setIsOpenDelayed(true),\n skipDelayDuration\n );\n }, [skipDelayDuration])}\n isPointerInTransitRef={isPointerInTransitRef}\n onPointerInTransitChange={React.useCallback((inTransit: boolean) => {\n isPointerInTransitRef.current = inTransit;\n }, [])}\n disableHoverableContent={disableHoverableContent}\n >\n {children}\n </TooltipProviderContextProvider>\n );\n};\n\nTooltipProvider.displayName = PROVIDER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Tooltip\n * -----------------------------------------------------------------------------------------------*/\n\nconst TOOLTIP_NAME = 'Tooltip';\n\ntype TooltipContextValue = {\n contentId: string;\n open: boolean;\n stateAttribute: 'closed' | 'delayed-open' | 'instant-open';\n trigger: TooltipTriggerElement | null;\n onTriggerChange(trigger: TooltipTriggerElement | null): void;\n onTriggerEnter(): void;\n onTriggerLeave(): void;\n onOpen(): void;\n onClose(): void;\n disableHoverableContent: boolean;\n};\n\nconst [TooltipContextProvider, useTooltipContext] =\n createTooltipContext<TooltipContextValue>(TOOLTIP_NAME);\n\ninterface TooltipProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * The duration from when the pointer enters the trigger until the tooltip gets opened. This will\n * override the prop with the same name passed to Provider.\n * @defaultValue 700\n */\n delayDuration?: number;\n /**\n * When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.\n * @defaultValue false\n */\n disableHoverableContent?: boolean;\n}\n\nconst Tooltip: React.FC<TooltipProps> = (props: ScopedProps<TooltipProps>) => {\n const {\n __scopeTooltip,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disableHoverableContent: disableHoverableContentProp,\n delayDuration: delayDurationProp,\n } = props;\n const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const [trigger, setTrigger] = React.useState<HTMLButtonElement | null>(null);\n const contentId = useId();\n const openTimerRef = React.useRef(0);\n const disableHoverableContent =\n disableHoverableContentProp ?? providerContext.disableHoverableContent;\n const delayDuration = delayDurationProp ?? providerContext.delayDuration;\n const wasOpenDelayedRef = React.useRef(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: (open) => {\n if (open) {\n providerContext.onOpen();\n\n // as `onChange` is called within a lifecycle method we\n // avoid dispatching via `dispatchDiscreteCustomEvent`.\n document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));\n } else {\n providerContext.onClose();\n }\n onOpenChange?.(open);\n },\n });\n const stateAttribute = React.useMemo(() => {\n return open ? (wasOpenDelayedRef.current ? 'delayed-open' : 'instant-open') : 'closed';\n }, [open]);\n\n const handleOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n wasOpenDelayedRef.current = false;\n setOpen(true);\n }, [setOpen]);\n\n const handleClose = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n setOpen(false);\n }, [setOpen]);\n\n const handleDelayedOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = window.setTimeout(() => {\n wasOpenDelayedRef.current = true;\n setOpen(true);\n }, delayDuration);\n }, [delayDuration, setOpen]);\n\n React.useEffect(() => {\n return () => window.clearTimeout(openTimerRef.current);\n }, []);\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <TooltipContextProvider\n scope={__scopeTooltip}\n contentId={contentId}\n open={open}\n stateAttribute={stateAttribute}\n trigger={trigger}\n onTriggerChange={setTrigger}\n onTriggerEnter={React.useCallback(() => {\n if (providerContext.isOpenDelayed) handleDelayedOpen();\n else handleOpen();\n }, [providerContext.isOpenDelayed, handleDelayedOpen, handleOpen])}\n onTriggerLeave={React.useCallback(() => {\n if (disableHoverableContent) {\n handleClose();\n } else {\n // Clear the timer in case the pointer leaves the trigger before the tooltip is opened.\n window.clearTimeout(openTimerRef.current);\n }\n }, [handleClose, disableHoverableContent])}\n onOpen={handleOpen}\n onClose={handleClose}\n disableHoverableContent={disableHoverableContent}\n >\n {children}\n </TooltipContextProvider>\n </PopperPrimitive.Root>\n );\n};\n\nTooltip.displayName = TOOLTIP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'TooltipTrigger';\n\ntype TooltipTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface TooltipTriggerProps extends PrimitiveButtonProps {}\n\nconst TooltipTrigger = React.forwardRef<TooltipTriggerElement, TooltipTriggerProps>(\n (props: ScopedProps<TooltipTriggerProps>, forwardedRef) => {\n const { __scopeTooltip, ...triggerProps } = props;\n const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);\n const providerContext = useTooltipProviderContext(TRIGGER_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const ref = React.useRef<TooltipTriggerElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);\n const isPointerDownRef = React.useRef(false);\n const hasPointerMoveOpenedRef = React.useRef(false);\n const handlePointerUp = React.useCallback(() => (isPointerDownRef.current = false), []);\n\n React.useEffect(() => {\n return () => document.removeEventListener('pointerup', handlePointerUp);\n }, [handlePointerUp]);\n\n return (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n <Primitive.button\n // We purposefully avoid adding `type=button` here because tooltip triggers are also\n // commonly anchors and the anchor `type` attribute signifies MIME type.\n aria-describedby={context.open ? context.contentId : undefined}\n data-state={context.stateAttribute}\n {...triggerProps}\n ref={composedRefs}\n onPointerMove={composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType === 'touch') return;\n if (\n !hasPointerMoveOpenedRef.current &&\n !providerContext.isPointerInTransitRef.current\n ) {\n context.onTriggerEnter();\n hasPointerMoveOpenedRef.current = true;\n }\n })}\n onPointerLeave={composeEventHandlers(props.onPointerLeave, () => {\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n })}\n onPointerDown={composeEventHandlers(props.onPointerDown, () => {\n isPointerDownRef.current = true;\n document.addEventListener('pointerup', handlePointerUp, { once: true });\n })}\n onFocus={composeEventHandlers(props.onFocus, () => {\n if (!isPointerDownRef.current) context.onOpen();\n })}\n onBlur={composeEventHandlers(props.onBlur, context.onClose)}\n onClick={composeEventHandlers(props.onClick, context.onClose)}\n />\n </PopperPrimitive.Anchor>\n );\n }\n);\n\nTooltipTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'TooltipPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createTooltipContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface TooltipPortalProps extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst TooltipPortal: React.FC<TooltipPortalProps> = (props: ScopedProps<TooltipPortalProps>) => {\n const { __scopeTooltip, forceMount, children, container } = props;\n const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);\n return (\n <PortalProvider scope={__scopeTooltip} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nTooltipPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'TooltipContent';\n\ntype TooltipContentElement = TooltipContentImplElement;\ninterface TooltipContentProps extends TooltipContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst TooltipContent = React.forwardRef<TooltipContentElement, TooltipContentProps>(\n (props: ScopedProps<TooltipContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);\n const { forceMount = portalContext.forceMount, side = 'top', ...contentProps } = props;\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n\n return (\n <Presence present={forceMount || context.open}>\n {context.disableHoverableContent ? (\n <TooltipContentImpl side={side} {...contentProps} ref={forwardedRef} />\n ) : (\n <TooltipContentHoverable side={side} {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\ntype Point = { x: number; y: number };\ntype Polygon = Point[];\n\ntype TooltipContentHoverableElement = TooltipContentImplElement;\ninterface TooltipContentHoverableProps extends TooltipContentImplProps {}\n\nconst TooltipContentHoverable = React.forwardRef<\n TooltipContentHoverableElement,\n TooltipContentHoverableProps\n>((props: ScopedProps<TooltipContentHoverableProps>, forwardedRef) => {\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n const providerContext = useTooltipProviderContext(CONTENT_NAME, props.__scopeTooltip);\n const ref = React.useRef<TooltipContentHoverableElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [pointerGraceArea, setPointerGraceArea] = React.useState<Polygon | null>(null);\n\n const { trigger, onClose } = context;\n const content = ref.current;\n\n const { onPointerInTransitChange } = providerContext;\n\n const handleRemoveGraceArea = React.useCallback(() => {\n setPointerGraceArea(null);\n onPointerInTransitChange(false);\n }, [onPointerInTransitChange]);\n\n const handleCreateGraceArea = React.useCallback(\n (event: PointerEvent, hoverTarget: HTMLElement) => {\n const currentTarget = event.currentTarget as HTMLElement;\n const exitPoint = { x: event.clientX, y: event.clientY };\n const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());\n\n const bleed = exitSide === 'right' || exitSide === 'bottom' ? -5 : 5;\n const isXAxis = exitSide === 'right' || exitSide === 'left';\n const startPoint = isXAxis\n ? { x: event.clientX + bleed, y: event.clientY }\n : { x: event.clientX, y: event.clientY + bleed };\n\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n const graceArea = getHull([startPoint, ...hoverTargetPoints]);\n setPointerGraceArea(graceArea);\n onPointerInTransitChange(true);\n },\n [onPointerInTransitChange]\n );\n\n React.useEffect(() => {\n return () => handleRemoveGraceArea();\n }, [handleRemoveGraceArea]);\n\n React.useEffect(() => {\n if (trigger && content) {\n const handleTriggerLeave = (event: PointerEvent) => handleCreateGraceArea(event, content);\n const handleContentLeave = (event: PointerEvent) => handleCreateGraceArea(event, trigger);\n\n trigger.addEventListener('pointerleave', handleTriggerLeave);\n content.addEventListener('pointerleave', handleContentLeave);\n return () => {\n trigger.removeEventListener('pointerleave', handleTriggerLeave);\n content.removeEventListener('pointerleave', handleContentLeave);\n };\n }\n }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);\n\n React.useEffect(() => {\n if (pointerGraceArea) {\n const handleTrackPointerGrace = (event: PointerEvent) => {\n const target = event.target as HTMLElement;\n const pointerPosition = { x: event.clientX, y: event.clientY };\n const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);\n const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);\n\n if (hasEnteredTarget) {\n handleRemoveGraceArea();\n } else if (isPointerOutsideGraceArea) {\n handleRemoveGraceArea();\n onClose();\n }\n };\n document.addEventListener('pointermove', handleTrackPointerGrace);\n return () => document.removeEventListener('pointermove', handleTrackPointerGrace);\n }\n }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);\n\n return <TooltipContentImpl {...props} ref={composedRefs} />;\n});\n\nconst [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] =\n createTooltipContext(TOOLTIP_NAME, { isInside: false });\n\ntype TooltipContentImplElement = React.ElementRef<typeof PopperPrimitive.Content>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ninterface TooltipContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {\n /**\n * A more descriptive label for accessibility purpose\n */\n 'aria-label'?: string;\n\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n}\n\nconst TooltipContentImpl = React.forwardRef<TooltipContentImplElement, TooltipContentImplProps>(\n (props: ScopedProps<TooltipContentImplProps>, forwardedRef) => {\n const {\n __scopeTooltip,\n children,\n 'aria-label': ariaLabel,\n onEscapeKeyDown,\n onPointerDownOutside,\n ...contentProps\n } = props;\n const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const { onClose } = context;\n\n // Close this tooltip if another one opens\n React.useEffect(() => {\n document.addEventListener(TOOLTIP_OPEN, onClose);\n return () => document.removeEventListener(TOOLTIP_OPEN, onClose);\n }, [onClose]);\n\n // Close the tooltip if the trigger is scrolled\n React.useEffect(() => {\n if (context.trigger) {\n const handleScroll = (event: Event) => {\n const target = event.target as HTMLElement;\n if (target?.contains(context.trigger)) onClose();\n };\n window.addEventListener('scroll', handleScroll, { capture: true });\n return () => window.removeEventListener('scroll', handleScroll, { capture: true });\n }\n }, [context.trigger, onClose]);\n\n return (\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={false}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={(event) => event.preventDefault()}\n onDismiss={onClose}\n >\n <PopperPrimitive.Content\n data-state={context.stateAttribute}\n {...popperScope}\n {...contentProps}\n ref={forwardedRef}\n style={{\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-tooltip-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-tooltip-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-tooltip-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-tooltip-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-tooltip-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n >\n <Slottable>{children}</Slottable>\n <VisuallyHiddenContentContextProvider scope={__scopeTooltip} isInside={true}>\n <VisuallyHiddenPrimitive.Root id={context.contentId} role=\"tooltip\">\n {ariaLabel || children}\n </VisuallyHiddenPrimitive.Root>\n </VisuallyHiddenContentContextProvider>\n </PopperPrimitive.Content>\n </DismissableLayer>\n );\n }\n);\n\nTooltipContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'TooltipArrow';\n\ntype TooltipArrowElement = React.ElementRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface TooltipArrowProps extends PopperArrowProps {}\n\nconst TooltipArrow = React.forwardRef<TooltipArrowElement, TooltipArrowProps>(\n (props: ScopedProps<TooltipArrowProps>, forwardedRef) => {\n const { __scopeTooltip, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeTooltip);\n const visuallyHiddenContentContext = useVisuallyHiddenContentContext(\n ARROW_NAME,\n __scopeTooltip\n );\n // if the arrow is inside the `VisuallyHidden`, we don't want to render it all to\n // prevent issues in positioning the arrow due to the duplicate\n return visuallyHiddenContentContext.isInside ? null : (\n <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />\n );\n }\n);\n\nTooltipArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getExitSideFromRect(point: Point, rect: DOMRect) {\n const top = Math.abs(rect.top - point.y);\n const bottom = Math.abs(rect.bottom - point.y);\n const right = Math.abs(rect.right - point.x);\n const left = Math.abs(rect.left - point.x);\n\n switch (Math.min(top, bottom, right, left)) {\n case left:\n return 'left';\n case right:\n return 'right';\n case top:\n return 'top';\n case bottom:\n return 'bottom';\n default:\n return null;\n }\n}\n\nfunction getPointsFromRect(rect: DOMRect) {\n const { top, right, bottom, left } = rect;\n return [\n { x: left, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom },\n ];\n}\n\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n\n // prettier-ignore\n const intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n\n return inside;\n}\n\n// Returns a new array of points representing the convex hull of the given set of points.\n// https://www.nayuki.io/page/convex-hull-algorithm\nfunction getHull<P extends Point>(points: Readonly<Array<P>>): Array<P> {\n const newPoints: Array<P> = points.slice();\n newPoints.sort((a: Point, b: Point) => {\n if (a.x < b.x) return -1;\n else if (a.x > b.x) return +1;\n else if (a.y < b.y) return -1;\n else if (a.y > b.y) return +1;\n else return 0;\n });\n return getHullPresorted(newPoints);\n}\n\n// Returns the convex hull, assuming that each points[i] <= points[i + 1]. Runs in O(n) time.\nfunction getHullPresorted<P extends Point>(points: Readonly<Array<P>>): Array<P> {\n if (points.length <= 1) return points.slice();\n\n const upperHull: Array<P> = [];\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n while (upperHull.length >= 2) {\n const q = upperHull[upperHull.length - 1];\n const r = upperHull[upperHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();\n else break;\n }\n upperHull.push(p);\n }\n upperHull.pop();\n\n const lowerHull: Array<P> = [];\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n while (lowerHull.length >= 2) {\n const q = lowerHull[lowerHull.length - 1];\n const r = lowerHull[lowerHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();\n else break;\n }\n lowerHull.push(p);\n }\n lowerHull.pop();\n\n if (\n upperHull.length === 1 &&\n lowerHull.length === 1 &&\n upperHull[0].x === lowerHull[0].x &&\n upperHull[0].y === lowerHull[0].y\n ) {\n return upperHull;\n } else {\n return upperHull.concat(lowerHull);\n }\n}\n\nconst Provider = TooltipProvider;\nconst Root = Tooltip;\nconst Trigger = TooltipTrigger;\nconst Portal = TooltipPortal;\nconst Content = TooltipContent;\nconst Arrow = TooltipArrow;\n\nexport {\n createTooltipScope,\n //\n TooltipProvider,\n Tooltip,\n TooltipTrigger,\n TooltipPortal,\n TooltipContent,\n TooltipArrow,\n //\n Provider,\n Root,\n Trigger,\n Portal,\n Content,\n Arrow,\n};\nexport type {\n TooltipProps,\n TooltipTriggerProps,\n TooltipPortalProps,\n TooltipContentProps,\n TooltipArrowProps,\n};\n"],"names":["createTooltipScope","TooltipProvider","Tooltip","TooltipTrigger","TooltipPortal","TooltipContent","TooltipArrow","Provider","Root","Trigger","Portal","Content","Arrow","React","composeEventHandlers","useComposedRefs","createContextScope","DismissableLayer","useId","PopperPrimitive","createPopperScope","PortalPrimitive","Presence","Primitive","Slottable","useControllableState","VisuallyHiddenPrimitive","createTooltipContext","usePopperScope","PROVIDER_NAME","DEFAULT_DELAY_DURATION","TOOLTIP_OPEN","TooltipProviderContextProvider","useTooltipProviderContext","props","__scopeTooltip","delayDuration","skipDelayDuration","disableHoverableContent","children","isOpenDelayed","setIsOpenDelayed","useState","isPointerInTransitRef","useRef","skipDelayTimerRef","useEffect","skipDelayTimer","current","window","clearTimeout","useCallback","setTimeout","inTransit","TOOLTIP_NAME","TooltipContextProvider","useTooltipContext","open","openProp","defaultOpen","onOpenChange","disableHoverableContentProp","delayDurationProp","providerContext","popperScope","trigger","setTrigger","contentId","openTimerRef","wasOpenDelayedRef","setOpen","prop","defaultProp","onChange","onOpen","document","dispatchEvent","CustomEvent","onClose","stateAttribute","useMemo","handleOpen","handleClose","handleDelayedOpen","TRIGGER_NAME","forwardRef","forwardedRef","triggerProps","context","ref","composedRefs","onTriggerChange","isPointerDownRef","hasPointerMoveOpenedRef","handlePointerUp","removeEventListener","undefined","onPointerMove","event","pointerType","onTriggerEnter","onPointerLeave","onTriggerLeave","onPointerDown","addEventListener","once","onFocus","onBlur","onClick","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","container","CONTENT_NAME","portalContext","side","contentProps","TooltipContentHoverable","pointerGraceArea","setPointerGraceArea","content","onPointerInTransitChange","handleRemoveGraceArea","handleCreateGraceArea","hoverTarget","currentTarget","exitPoint","x","clientX","y","clientY","exitSide","getExitSideFromRect","getBoundingClientRect","bleed","isXAxis","startPoint","hoverTargetPoints","getPointsFromRect","graceArea","getHull","handleTriggerLeave","handleContentLeave","handleTrackPointerGrace","target","pointerPosition","hasEnteredTarget","contains","isPointerOutsideGraceArea","isPointInPolygon","VisuallyHiddenContentContextProvider","useVisuallyHiddenContentContext","isInside","TooltipContentImpl","ariaLabel","onEscapeKeyDown","onPointerDownOutside","handleScroll","capture","preventDefault","style","ARROW_NAME","arrowProps","visuallyHiddenContentContext","point","rect","top","Math","abs","bottom","right","left","min","polygon","inside","i","j","length","xi","yi","xj","yj","intersect","points","newPoints","slice","sort","a","b","getHullPresorted","upperHull","p","q","r","pop","push","lowerHull","concat"],"version":3,"file":"index.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;A;;;;;;;;;;;;;;;ACmBA,MAAM,CAAC2B,0CAAD,EAAuB3B,yCAAvB,CAAA,GAA6CgB,yBAAkB,CAAC,SAAD,EAAY;IAC/EI,wBAD+E;CAAZ,CAArE,AAAA;AAGA,MAAMQ,oCAAc,GAAGR,wBAAiB,EAAxC,AAAA;AAEA;;oGAEA,CAEA,MAAMS,mCAAa,GAAG,iBAAtB,AAAA;AACA,MAAMC,4CAAsB,GAAG,GAA/B,AAAA;AACA,MAAMC,kCAAY,GAAG,cAArB,AAAA;AAYA,MAAM,CAACC,oDAAD,EAAiCC,+CAAjC,CAAA,GACJN,0CAAoB,CAA8BE,mCAA9B,CADtB,AAAA;AAsBA,MAAM5B,yCAA+C,GACnDiC,CAAAA,KADsD,GAEnD;IACH,MAAM,E,gBACJC,cADI,CAAA,iBAEJC,aAAa,GAAGN,4CAFZ,sBAGJO,iBAAiB,GAAG,GAHhB,4BAIJC,uBAAuB,GAAG,KAJtB,G,UAKJC,QAAAA,CAAAA,EALI,GAMFL,KANJ,AAAM;IAON,MAAM,CAACM,aAAD,EAAgBC,gBAAhB,CAAA,GAAoC5B,eAAA,CAAe,IAAf,CAA1C,AAAA;IACA,MAAM8B,qBAAqB,GAAG9B,aAAA,CAAa,KAAb,CAA9B,AAAA;IACA,MAAMgC,iBAAiB,GAAGhC,aAAA,CAAa,CAAb,CAA1B,AAAA;IAEAA,gBAAA,CAAgB,IAAM;QACpB,MAAMkC,cAAc,GAAGF,iBAAiB,CAACG,OAAzC,AAAA;QACA,OAAO,IAAMC,MAAM,CAACC,YAAP,CAAoBH,cAApB,CAAb;QAAA,CAAA;KAFF,EAGG,EAHH,CAGC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yCAAO,GAAGN,yCAAhB,AAAA;AACA,MAAMO,yCAAK,GAAGN,yCAAd,AAAA;;ADlsBA","sources":["packages/react/tooltip/src/index.ts","packages/react/tooltip/src/Tooltip.tsx"],"sourcesContent":["export {\n createTooltipScope,\n //\n TooltipProvider,\n Tooltip,\n TooltipTrigger,\n TooltipPortal,\n TooltipContent,\n TooltipArrow,\n //\n Provider,\n Root,\n Trigger,\n Portal,\n Content,\n Arrow,\n} from './Tooltip';\nexport type {\n TooltipProps,\n TooltipTriggerProps,\n TooltipPortalProps,\n TooltipContentProps,\n TooltipArrowProps,\n} from './Tooltip';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slottable } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype ScopedProps<P = {}> = P & { __scopeTooltip?: Scope };\nconst [createTooltipContext, createTooltipScope] = createContextScope('Tooltip', [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipProvider\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROVIDER_NAME = 'TooltipProvider';\nconst DEFAULT_DELAY_DURATION = 700;\nconst TOOLTIP_OPEN = 'tooltip.open';\n\ntype TooltipProviderContextValue = {\n isOpenDelayed: boolean;\n delayDuration: number;\n onOpen(): void;\n onClose(): void;\n onPointerInTransitChange(inTransit: boolean): void;\n isPointerInTransitRef: React.MutableRefObject<boolean>;\n disableHoverableContent: boolean;\n};\n\nconst [TooltipProviderContextProvider, useTooltipProviderContext] =\n createTooltipContext<TooltipProviderContextValue>(PROVIDER_NAME);\n\ninterface TooltipProviderProps {\n children: React.ReactNode;\n /**\n * The duration from when the pointer enters the trigger until the tooltip gets opened.\n * @defaultValue 700\n */\n delayDuration?: number;\n /**\n * How much time a user has to enter another trigger without incurring a delay again.\n * @defaultValue 300\n */\n skipDelayDuration?: number;\n /**\n * When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.\n * @defaultValue false\n */\n disableHoverableContent?: boolean;\n}\n\nconst TooltipProvider: React.FC<TooltipProviderProps> = (\n props: ScopedProps<TooltipProviderProps>\n) => {\n const {\n __scopeTooltip,\n delayDuration = DEFAULT_DELAY_DURATION,\n skipDelayDuration = 300,\n disableHoverableContent = false,\n children,\n } = props;\n const [isOpenDelayed, setIsOpenDelayed] = React.useState(true);\n const isPointerInTransitRef = React.useRef(false);\n const skipDelayTimerRef = React.useRef(0);\n\n React.useEffect(() => {\n const skipDelayTimer = skipDelayTimerRef.current;\n return () => window.clearTimeout(skipDelayTimer);\n }, []);\n\n return (\n <TooltipProviderContextProvider\n scope={__scopeTooltip}\n isOpenDelayed={isOpenDelayed}\n delayDuration={delayDuration}\n onOpen={React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n setIsOpenDelayed(false);\n }, [])}\n onClose={React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => setIsOpenDelayed(true),\n skipDelayDuration\n );\n }, [skipDelayDuration])}\n isPointerInTransitRef={isPointerInTransitRef}\n onPointerInTransitChange={React.useCallback((inTransit: boolean) => {\n isPointerInTransitRef.current = inTransit;\n }, [])}\n disableHoverableContent={disableHoverableContent}\n >\n {children}\n </TooltipProviderContextProvider>\n );\n};\n\nTooltipProvider.displayName = PROVIDER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Tooltip\n * -----------------------------------------------------------------------------------------------*/\n\nconst TOOLTIP_NAME = 'Tooltip';\n\ntype TooltipContextValue = {\n contentId: string;\n open: boolean;\n stateAttribute: 'closed' | 'delayed-open' | 'instant-open';\n trigger: TooltipTriggerElement | null;\n onTriggerChange(trigger: TooltipTriggerElement | null): void;\n onTriggerEnter(): void;\n onTriggerLeave(): void;\n onOpen(): void;\n onClose(): void;\n disableHoverableContent: boolean;\n};\n\nconst [TooltipContextProvider, useTooltipContext] =\n createTooltipContext<TooltipContextValue>(TOOLTIP_NAME);\n\ninterface TooltipProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * The duration from when the pointer enters the trigger until the tooltip gets opened. This will\n * override the prop with the same name passed to Provider.\n * @defaultValue 700\n */\n delayDuration?: number;\n /**\n * When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.\n * @defaultValue false\n */\n disableHoverableContent?: boolean;\n}\n\nconst Tooltip: React.FC<TooltipProps> = (props: ScopedProps<TooltipProps>) => {\n const {\n __scopeTooltip,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disableHoverableContent: disableHoverableContentProp,\n delayDuration: delayDurationProp,\n } = props;\n const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const [trigger, setTrigger] = React.useState<HTMLButtonElement | null>(null);\n const contentId = useId();\n const openTimerRef = React.useRef(0);\n const disableHoverableContent =\n disableHoverableContentProp ?? providerContext.disableHoverableContent;\n const delayDuration = delayDurationProp ?? providerContext.delayDuration;\n const wasOpenDelayedRef = React.useRef(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: (open) => {\n if (open) {\n providerContext.onOpen();\n\n // as `onChange` is called within a lifecycle method we\n // avoid dispatching via `dispatchDiscreteCustomEvent`.\n document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));\n } else {\n providerContext.onClose();\n }\n onOpenChange?.(open);\n },\n });\n const stateAttribute = React.useMemo(() => {\n return open ? (wasOpenDelayedRef.current ? 'delayed-open' : 'instant-open') : 'closed';\n }, [open]);\n\n const handleOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n wasOpenDelayedRef.current = false;\n setOpen(true);\n }, [setOpen]);\n\n const handleClose = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n setOpen(false);\n }, [setOpen]);\n\n const handleDelayedOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = window.setTimeout(() => {\n wasOpenDelayedRef.current = true;\n setOpen(true);\n }, delayDuration);\n }, [delayDuration, setOpen]);\n\n React.useEffect(() => {\n return () => window.clearTimeout(openTimerRef.current);\n }, []);\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <TooltipContextProvider\n scope={__scopeTooltip}\n contentId={contentId}\n open={open}\n stateAttribute={stateAttribute}\n trigger={trigger}\n onTriggerChange={setTrigger}\n onTriggerEnter={React.useCallback(() => {\n if (providerContext.isOpenDelayed) handleDelayedOpen();\n else handleOpen();\n }, [providerContext.isOpenDelayed, handleDelayedOpen, handleOpen])}\n onTriggerLeave={React.useCallback(() => {\n if (disableHoverableContent) {\n handleClose();\n } else {\n // Clear the timer in case the pointer leaves the trigger before the tooltip is opened.\n window.clearTimeout(openTimerRef.current);\n }\n }, [handleClose, disableHoverableContent])}\n onOpen={handleOpen}\n onClose={handleClose}\n disableHoverableContent={disableHoverableContent}\n >\n {children}\n </TooltipContextProvider>\n </PopperPrimitive.Root>\n );\n};\n\nTooltip.displayName = TOOLTIP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'TooltipTrigger';\n\ntype TooltipTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface TooltipTriggerProps extends PrimitiveButtonProps {}\n\nconst TooltipTrigger = React.forwardRef<TooltipTriggerElement, TooltipTriggerProps>(\n (props: ScopedProps<TooltipTriggerProps>, forwardedRef) => {\n const { __scopeTooltip, ...triggerProps } = props;\n const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);\n const providerContext = useTooltipProviderContext(TRIGGER_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const ref = React.useRef<TooltipTriggerElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);\n const isPointerDownRef = React.useRef(false);\n const hasPointerMoveOpenedRef = React.useRef(false);\n const handlePointerUp = React.useCallback(() => (isPointerDownRef.current = false), []);\n\n React.useEffect(() => {\n return () => document.removeEventListener('pointerup', handlePointerUp);\n }, [handlePointerUp]);\n\n return (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n <Primitive.button\n // We purposefully avoid adding `type=button` here because tooltip triggers are also\n // commonly anchors and the anchor `type` attribute signifies MIME type.\n aria-describedby={context.open ? context.contentId : undefined}\n data-state={context.stateAttribute}\n {...triggerProps}\n ref={composedRefs}\n onPointerMove={composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType === 'touch') return;\n if (\n !hasPointerMoveOpenedRef.current &&\n !providerContext.isPointerInTransitRef.current\n ) {\n context.onTriggerEnter();\n hasPointerMoveOpenedRef.current = true;\n }\n })}\n onPointerLeave={composeEventHandlers(props.onPointerLeave, () => {\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n })}\n onPointerDown={composeEventHandlers(props.onPointerDown, () => {\n isPointerDownRef.current = true;\n document.addEventListener('pointerup', handlePointerUp, { once: true });\n })}\n onFocus={composeEventHandlers(props.onFocus, () => {\n if (!isPointerDownRef.current) context.onOpen();\n })}\n onBlur={composeEventHandlers(props.onBlur, context.onClose)}\n onClick={composeEventHandlers(props.onClick, context.onClose)}\n />\n </PopperPrimitive.Anchor>\n );\n }\n);\n\nTooltipTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'TooltipPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createTooltipContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface TooltipPortalProps extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst TooltipPortal: React.FC<TooltipPortalProps> = (props: ScopedProps<TooltipPortalProps>) => {\n const { __scopeTooltip, forceMount, children, container } = props;\n const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);\n return (\n <PortalProvider scope={__scopeTooltip} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nTooltipPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'TooltipContent';\n\ntype TooltipContentElement = TooltipContentImplElement;\ninterface TooltipContentProps extends TooltipContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst TooltipContent = React.forwardRef<TooltipContentElement, TooltipContentProps>(\n (props: ScopedProps<TooltipContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);\n const { forceMount = portalContext.forceMount, side = 'top', ...contentProps } = props;\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n\n return (\n <Presence present={forceMount || context.open}>\n {context.disableHoverableContent ? (\n <TooltipContentImpl side={side} {...contentProps} ref={forwardedRef} />\n ) : (\n <TooltipContentHoverable side={side} {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\ntype Point = { x: number; y: number };\ntype Polygon = Point[];\n\ntype TooltipContentHoverableElement = TooltipContentImplElement;\ninterface TooltipContentHoverableProps extends TooltipContentImplProps {}\n\nconst TooltipContentHoverable = React.forwardRef<\n TooltipContentHoverableElement,\n TooltipContentHoverableProps\n>((props: ScopedProps<TooltipContentHoverableProps>, forwardedRef) => {\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n const providerContext = useTooltipProviderContext(CONTENT_NAME, props.__scopeTooltip);\n const ref = React.useRef<TooltipContentHoverableElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [pointerGraceArea, setPointerGraceArea] = React.useState<Polygon | null>(null);\n\n const { trigger, onClose } = context;\n const content = ref.current;\n\n const { onPointerInTransitChange } = providerContext;\n\n const handleRemoveGraceArea = React.useCallback(() => {\n setPointerGraceArea(null);\n onPointerInTransitChange(false);\n }, [onPointerInTransitChange]);\n\n const handleCreateGraceArea = React.useCallback(\n (event: PointerEvent, hoverTarget: HTMLElement) => {\n const currentTarget = event.currentTarget as HTMLElement;\n const exitPoint = { x: event.clientX, y: event.clientY };\n const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());\n\n const bleed = exitSide === 'right' || exitSide === 'bottom' ? -5 : 5;\n const isXAxis = exitSide === 'right' || exitSide === 'left';\n const startPoint = isXAxis\n ? { x: event.clientX + bleed, y: event.clientY }\n : { x: event.clientX, y: event.clientY + bleed };\n\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n const graceArea = getHull([startPoint, ...hoverTargetPoints]);\n setPointerGraceArea(graceArea);\n onPointerInTransitChange(true);\n },\n [onPointerInTransitChange]\n );\n\n React.useEffect(() => {\n return () => handleRemoveGraceArea();\n }, [handleRemoveGraceArea]);\n\n React.useEffect(() => {\n if (trigger && content) {\n const handleTriggerLeave = (event: PointerEvent) => handleCreateGraceArea(event, content);\n const handleContentLeave = (event: PointerEvent) => handleCreateGraceArea(event, trigger);\n\n trigger.addEventListener('pointerleave', handleTriggerLeave);\n content.addEventListener('pointerleave', handleContentLeave);\n return () => {\n trigger.removeEventListener('pointerleave', handleTriggerLeave);\n content.removeEventListener('pointerleave', handleContentLeave);\n };\n }\n }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);\n\n React.useEffect(() => {\n if (pointerGraceArea) {\n const handleTrackPointerGrace = (event: PointerEvent) => {\n const target = event.target as HTMLElement;\n const pointerPosition = { x: event.clientX, y: event.clientY };\n const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);\n const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);\n\n if (hasEnteredTarget) {\n handleRemoveGraceArea();\n } else if (isPointerOutsideGraceArea) {\n handleRemoveGraceArea();\n onClose();\n }\n };\n document.addEventListener('pointermove', handleTrackPointerGrace);\n return () => document.removeEventListener('pointermove', handleTrackPointerGrace);\n }\n }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);\n\n return <TooltipContentImpl {...props} ref={composedRefs} />;\n});\n\nconst [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] =\n createTooltipContext(TOOLTIP_NAME, { isInside: false });\n\ntype TooltipContentImplElement = React.ElementRef<typeof PopperPrimitive.Content>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ninterface TooltipContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {\n /**\n * A more descriptive label for accessibility purpose\n */\n 'aria-label'?: string;\n\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n}\n\nconst TooltipContentImpl = React.forwardRef<TooltipContentImplElement, TooltipContentImplProps>(\n (props: ScopedProps<TooltipContentImplProps>, forwardedRef) => {\n const {\n __scopeTooltip,\n children,\n 'aria-label': ariaLabel,\n onEscapeKeyDown,\n onPointerDownOutside,\n ...contentProps\n } = props;\n const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const { onClose } = context;\n\n // Close this tooltip if another one opens\n React.useEffect(() => {\n document.addEventListener(TOOLTIP_OPEN, onClose);\n return () => document.removeEventListener(TOOLTIP_OPEN, onClose);\n }, [onClose]);\n\n // Close the tooltip if the trigger is scrolled\n React.useEffect(() => {\n if (context.trigger) {\n const handleScroll = (event: Event) => {\n const target = event.target as HTMLElement;\n if (target?.contains(context.trigger)) onClose();\n };\n window.addEventListener('scroll', handleScroll, { capture: true });\n return () => window.removeEventListener('scroll', handleScroll, { capture: true });\n }\n }, [context.trigger, onClose]);\n\n return (\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={false}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={(event) => event.preventDefault()}\n onDismiss={onClose}\n >\n <PopperPrimitive.Content\n data-state={context.stateAttribute}\n {...popperScope}\n {...contentProps}\n ref={forwardedRef}\n style={{\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-tooltip-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-tooltip-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-tooltip-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-tooltip-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-tooltip-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n >\n <Slottable>{children}</Slottable>\n <VisuallyHiddenContentContextProvider scope={__scopeTooltip} isInside={true}>\n <VisuallyHiddenPrimitive.Root id={context.contentId} role=\"tooltip\">\n {ariaLabel || children}\n </VisuallyHiddenPrimitive.Root>\n </VisuallyHiddenContentContextProvider>\n </PopperPrimitive.Content>\n </DismissableLayer>\n );\n }\n);\n\nTooltipContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * TooltipArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'TooltipArrow';\n\ntype TooltipArrowElement = React.ElementRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface TooltipArrowProps extends PopperArrowProps {}\n\nconst TooltipArrow = React.forwardRef<TooltipArrowElement, TooltipArrowProps>(\n (props: ScopedProps<TooltipArrowProps>, forwardedRef) => {\n const { __scopeTooltip, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeTooltip);\n const visuallyHiddenContentContext = useVisuallyHiddenContentContext(\n ARROW_NAME,\n __scopeTooltip\n );\n // if the arrow is inside the `VisuallyHidden`, we don't want to render it all to\n // prevent issues in positioning the arrow due to the duplicate\n return visuallyHiddenContentContext.isInside ? null : (\n <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />\n );\n }\n);\n\nTooltipArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getExitSideFromRect(point: Point, rect: DOMRect) {\n const top = Math.abs(rect.top - point.y);\n const bottom = Math.abs(rect.bottom - point.y);\n const right = Math.abs(rect.right - point.x);\n const left = Math.abs(rect.left - point.x);\n\n switch (Math.min(top, bottom, right, left)) {\n case left:\n return 'left';\n case right:\n return 'right';\n case top:\n return 'top';\n case bottom:\n return 'bottom';\n default:\n return null;\n }\n}\n\nfunction getPointsFromRect(rect: DOMRect) {\n const { top, right, bottom, left } = rect;\n return [\n { x: left, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom },\n ];\n}\n\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n\n // prettier-ignore\n const intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n\n return inside;\n}\n\n// Returns a new array of points representing the convex hull of the given set of points.\n// https://www.nayuki.io/page/convex-hull-algorithm\nfunction getHull<P extends Point>(points: Readonly<Array<P>>): Array<P> {\n const newPoints: Array<P> = points.slice();\n newPoints.sort((a: Point, b: Point) => {\n if (a.x < b.x) return -1;\n else if (a.x > b.x) return +1;\n else if (a.y < b.y) return -1;\n else if (a.y > b.y) return +1;\n else return 0;\n });\n return getHullPresorted(newPoints);\n}\n\n// Returns the convex hull, assuming that each points[i] <= points[i + 1]. Runs in O(n) time.\nfunction getHullPresorted<P extends Point>(points: Readonly<Array<P>>): Array<P> {\n if (points.length <= 1) return points.slice();\n\n const upperHull: Array<P> = [];\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n while (upperHull.length >= 2) {\n const q = upperHull[upperHull.length - 1];\n const r = upperHull[upperHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();\n else break;\n }\n upperHull.push(p);\n }\n upperHull.pop();\n\n const lowerHull: Array<P> = [];\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n while (lowerHull.length >= 2) {\n const q = lowerHull[lowerHull.length - 1];\n const r = lowerHull[lowerHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();\n else break;\n }\n lowerHull.push(p);\n }\n lowerHull.pop();\n\n if (\n upperHull.length === 1 &&\n lowerHull.length === 1 &&\n upperHull[0].x === lowerHull[0].x &&\n upperHull[0].y === lowerHull[0].y\n ) {\n return upperHull;\n } else {\n return upperHull.concat(lowerHull);\n }\n}\n\nconst Provider = TooltipProvider;\nconst Root = Tooltip;\nconst Trigger = TooltipTrigger;\nconst Portal = TooltipPortal;\nconst Content = TooltipContent;\nconst Arrow = TooltipArrow;\n\nexport {\n createTooltipScope,\n //\n TooltipProvider,\n Tooltip,\n TooltipTrigger,\n TooltipPortal,\n TooltipContent,\n TooltipArrow,\n //\n Provider,\n Root,\n Trigger,\n Portal,\n Content,\n Arrow,\n};\nexport type {\n TooltipProps,\n TooltipTriggerProps,\n TooltipPortalProps,\n TooltipContentProps,\n TooltipArrowProps,\n};\n"],"names":["createTooltipScope","TooltipProvider","Tooltip","TooltipTrigger","TooltipPortal","TooltipContent","TooltipArrow","Provider","Root","Trigger","Portal","Content","Arrow","React","composeEventHandlers","useComposedRefs","createContextScope","DismissableLayer","useId","PopperPrimitive","createPopperScope","PortalPrimitive","Presence","Primitive","Slottable","useControllableState","VisuallyHiddenPrimitive","createTooltipContext","usePopperScope","PROVIDER_NAME","DEFAULT_DELAY_DURATION","TOOLTIP_OPEN","TooltipProviderContextProvider","useTooltipProviderContext","props","__scopeTooltip","delayDuration","skipDelayDuration","disableHoverableContent","children","isOpenDelayed","setIsOpenDelayed","useState","isPointerInTransitRef","useRef","skipDelayTimerRef","useEffect","skipDelayTimer","current","window","clearTimeout","useCallback","setTimeout","inTransit","TOOLTIP_NAME","TooltipContextProvider","useTooltipContext","open","openProp","defaultOpen","onOpenChange","disableHoverableContentProp","delayDurationProp","providerContext","popperScope","trigger","setTrigger","contentId","openTimerRef","wasOpenDelayedRef","setOpen","prop","defaultProp","onChange","onOpen","document","dispatchEvent","CustomEvent","onClose","stateAttribute","useMemo","handleOpen","handleClose","handleDelayedOpen","TRIGGER_NAME","forwardRef","forwardedRef","triggerProps","context","ref","composedRefs","onTriggerChange","isPointerDownRef","hasPointerMoveOpenedRef","handlePointerUp","removeEventListener","undefined","onPointerMove","event","pointerType","onTriggerEnter","onPointerLeave","onTriggerLeave","onPointerDown","addEventListener","once","onFocus","onBlur","onClick","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","container","CONTENT_NAME","portalContext","side","contentProps","TooltipContentHoverable","pointerGraceArea","setPointerGraceArea","content","onPointerInTransitChange","handleRemoveGraceArea","handleCreateGraceArea","hoverTarget","currentTarget","exitPoint","x","clientX","y","clientY","exitSide","getExitSideFromRect","getBoundingClientRect","bleed","isXAxis","startPoint","hoverTargetPoints","getPointsFromRect","graceArea","getHull","handleTriggerLeave","handleContentLeave","handleTrackPointerGrace","target","pointerPosition","hasEnteredTarget","contains","isPointerOutsideGraceArea","isPointInPolygon","VisuallyHiddenContentContextProvider","useVisuallyHiddenContentContext","isInside","TooltipContentImpl","ariaLabel","onEscapeKeyDown","onPointerDownOutside","handleScroll","capture","preventDefault","style","ARROW_NAME","arrowProps","visuallyHiddenContentContext","point","rect","top","Math","abs","bottom","right","left","min","polygon","inside","i","j","length","xi","yi","xj","yj","intersect","points","newPoints","slice","sort","a","b","getHullPresorted","upperHull","p","q","r","pop","push","lowerHull","concat"],"version":3,"file":"index.mjs.map"}
package/package.json CHANGED
@@ -1,11 +1,23 @@
1
1
  {
2
2
  "name": "@radix-ui/react-tooltip",
3
- "version": "1.0.6-rc.1",
3
+ "version": "1.0.6-rc.11",
4
4
  "license": "MIT",
5
- "source": "src/index.ts",
6
- "main": "dist/index.js",
7
- "module": "dist/index.module.js",
8
- "types": "dist/index.d.ts",
5
+ "exports": {
6
+ ".": {
7
+ "import": {
8
+ "types": "./dist/index.d.mts",
9
+ "default": "./dist/index.mjs"
10
+ },
11
+ "require": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ }
15
+ }
16
+ },
17
+ "source": "./src/index.ts",
18
+ "main": "./dist/index.js",
19
+ "module": "./dist/index.mjs",
20
+ "types": "./dist/index.d.ts",
9
21
  "files": [
10
22
  "dist",
11
23
  "README.md"
@@ -17,18 +29,18 @@
17
29
  },
18
30
  "dependencies": {
19
31
  "@babel/runtime": "^7.13.10",
20
- "@radix-ui/primitive": "1.0.0",
21
- "@radix-ui/react-compose-refs": "1.0.0",
22
- "@radix-ui/react-context": "1.0.0",
23
- "@radix-ui/react-dismissable-layer": "1.0.3",
24
- "@radix-ui/react-id": "1.0.0",
25
- "@radix-ui/react-popper": "1.1.2-rc.1",
26
- "@radix-ui/react-portal": "1.0.2",
27
- "@radix-ui/react-presence": "1.0.0",
28
- "@radix-ui/react-primitive": "1.0.2",
29
- "@radix-ui/react-slot": "1.0.1",
30
- "@radix-ui/react-use-controllable-state": "1.0.0",
31
- "@radix-ui/react-visually-hidden": "1.0.2"
32
+ "@radix-ui/primitive": "1.0.1-rc.1",
33
+ "@radix-ui/react-compose-refs": "1.0.1-rc.1",
34
+ "@radix-ui/react-context": "1.0.1-rc.1",
35
+ "@radix-ui/react-dismissable-layer": "1.0.4-rc.6",
36
+ "@radix-ui/react-id": "1.0.1-rc.1",
37
+ "@radix-ui/react-popper": "1.1.2-rc.11",
38
+ "@radix-ui/react-portal": "1.0.3-rc.6",
39
+ "@radix-ui/react-presence": "1.0.1-rc.1",
40
+ "@radix-ui/react-primitive": "1.0.3-rc.6",
41
+ "@radix-ui/react-slot": "1.0.2-rc.6",
42
+ "@radix-ui/react-use-controllable-state": "1.0.1-rc.1",
43
+ "@radix-ui/react-visually-hidden": "1.0.3-rc.6"
32
44
  },
33
45
  "peerDependencies": {
34
46
  "react": "^16.8 || ^17.0 || ^18.0",