{"version":3,"names":["FloatingDelayGroup","TooltipProviderContext","TooltipProvider","props","contextValue","delay","closeDelay","timeout","delayValue","open","close","children"],"sources":["tooltip-provider.tsx"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\n\nimport { FloatingDelayGroup } from \"../../internals/floating-ui/components/floating-delay-group\";\nimport {\n\tTooltipProviderContext,\n\ttype TooltipProviderContextValue,\n} from \"../tooltip-provider-context\";\n\nexport interface TooltipProviderProps {\n\t/** Tooltip children. */\n\tchildren?: JSX.Element;\n\t/**\n\t * How long to wait before opening a tooltip. Specified in milliseconds.\n\t */\n\tdelay?: number | undefined;\n\t/**\n\t * How long to wait before closing a tooltip. Specified in milliseconds.\n\t */\n\tcloseDelay?: number | undefined;\n\t/**\n\t * Another tooltip will open instantly if the previous tooltip\n\t * is closed within this timeout. Specified in milliseconds.\n\t * @default 400\n\t */\n\ttimeout?: number | undefined;\n}\n\n/**\n * Provides a shared delay for multiple tooltips. The grouping logic ensures\n * that once a tooltip becomes visible, the adjacent tooltips will be shown\n * instantly. Mirrors Base UI React's `<Tooltip.Provider>`.\n *\n * Solid 2 notes:\n *\n * - `FloatingDelayGroup` lives under the floating-ui-react Solid port and\n *   owns the `delayRef` / instant-phase coordination. The provider only\n *   contributes the consumer-configurable `delay` / `closeDelay` values —\n *   sibling triggers read them via `useTooltipProviderContext`.\n * - Timeout defaults to 400 ms (matches React).\n */\nexport function TooltipProvider(props: TooltipProviderProps): JSX.Element {\n\tconst contextValue: TooltipProviderContextValue = {\n\t\tget delay() {\n\t\t\treturn props.delay;\n\t\t},\n\t\tget closeDelay() {\n\t\t\treturn props.closeDelay;\n\t\t},\n\t};\n\n\tconst timeout = (): number => props.timeout ?? 400;\n\n\t// `FloatingDelayGroup` expects a `Delay` object (or number). We construct\n\t// one lazily so the provider re-renders pick up `delay` / `closeDelay`\n\t// prop changes without dropping the group context.\n\tconst delayValue = {\n\t\tget open() {\n\t\t\treturn props.delay;\n\t\t},\n\t\tget close() {\n\t\t\treturn props.closeDelay;\n\t\t},\n\t};\n\n\treturn (\n\t\t<TooltipProviderContext value={contextValue}>\n\t\t\t<FloatingDelayGroup delay={delayValue} timeoutMs={timeout()}>\n\t\t\t\t{props.children}\n\t\t\t</FloatingDelayGroup>\n\t\t</TooltipProviderContext>\n\t);\n}\n"],"mappings":"AAEA,SAASA,kBAAkB,QAAQ,6DAA6D;AAChG,SACCC,sBAAsB,QAEhB,6BAA6B;AAqBpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,KAA2B,EAAe;EACzE,MAAMC,YAAyC,GAAG;IACjD,IAAIC,KAAKA,CAAA,EAAG;MACX,OAAOF,KAAK,CAACE,KAAK;IACnB,CAAC;IACD,IAAIC,UAAUA,CAAA,EAAG;MAChB,OAAOH,KAAK,CAACG,UAAU;IACxB;EACD,CAAC;EAED,MAAMC,OAAO,GAAGA,CAAA,KAAcJ,KAAK,CAACI,OAAO,IAAI,GAAG;;EAElD;EACA;EACA;EACA,MAAMC,UAAU,GAAG;IAClB,IAAIC,IAAIA,CAAA,EAAG;MACV,OAAON,KAAK,CAACE,KAAK;IACnB,CAAC;IACD,IAAIK,KAAKA,CAAA,EAAG;MACX,OAAOP,KAAK,CAACG,UAAU;IACxB;EACD,CAAC;EAED,OACC,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAACF,YAAY,CAAC;AAC9C,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAACI,UAAU,CAAC,CAAC,SAAS,CAAC,CAACD,OAAO,CAAC,CAAC,CAAC;AAC/D,IAAI,CAACJ,KAAK,CAACQ,QAAQ;AACnB,GAAG,EAAE,kBAAkB;AACvB,EAAE,EAAE,sBAAsB,CAAC;AAE3B","ignoreList":[]}