Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popover/dist/index.d.ts +85 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popover/dist/index.mjs +320 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.d.mts +46 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.d.ts +46 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.js +325 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.js.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.mjs +303 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.mjs.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.d.mts +14 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.d.ts +14 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.js +55 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.js.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.mjs +23 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.mjs.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.d.mts +12 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.d.ts +12 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.js +171 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.js.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.mjs +139 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.mjs.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.d.mts +52 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.d.ts +52 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.js +80 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.js.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.mjs +47 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.mjs.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.d.mts +17 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.d.ts +17 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.js +138 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.js.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.mjs +105 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.mjs.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.d.mts +21 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.d.ts +21 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.js +192 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.js.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.mjs +160 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.mjs.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.d.mts +101 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.d.ts +101 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.js +540 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.js.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.mjs +508 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.mjs.map +7 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/LICENSE +21 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/README.md +3 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.d.mts +20 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.d.ts +20 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.js +76 -0
- platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.js.map +7 -0
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popover/dist/index.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
| 4 |
+
import { FocusScope } from '@radix-ui/react-focus-scope';
|
| 5 |
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
| 6 |
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
| 7 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 8 |
+
|
| 9 |
+
declare const createPopoverScope: _radix_ui_react_context.CreateScope;
|
| 10 |
+
interface PopoverProps {
|
| 11 |
+
children?: React.ReactNode;
|
| 12 |
+
open?: boolean;
|
| 13 |
+
defaultOpen?: boolean;
|
| 14 |
+
onOpenChange?: (open: boolean) => void;
|
| 15 |
+
modal?: boolean;
|
| 16 |
+
}
|
| 17 |
+
declare const Popover: React.FC<PopoverProps>;
|
| 18 |
+
type PopperAnchorProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
| 19 |
+
interface PopoverAnchorProps extends PopperAnchorProps {
|
| 20 |
+
}
|
| 21 |
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
| 22 |
+
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
| 23 |
+
interface PopoverTriggerProps extends PrimitiveButtonProps {
|
| 24 |
+
}
|
| 25 |
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
| 26 |
+
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
| 27 |
+
interface PopoverPortalProps {
|
| 28 |
+
children?: React.ReactNode;
|
| 29 |
+
/**
|
| 30 |
+
* Specify a container element to portal the content into.
|
| 31 |
+
*/
|
| 32 |
+
container?: PortalProps['container'];
|
| 33 |
+
/**
|
| 34 |
+
* Used to force mounting when more control is needed. Useful when
|
| 35 |
+
* controlling animation with React animation libraries.
|
| 36 |
+
*/
|
| 37 |
+
forceMount?: true;
|
| 38 |
+
}
|
| 39 |
+
declare const PopoverPortal: React.FC<PopoverPortalProps>;
|
| 40 |
+
interface PopoverContentProps extends PopoverContentTypeProps {
|
| 41 |
+
/**
|
| 42 |
+
* Used to force mounting when more control is needed. Useful when
|
| 43 |
+
* controlling animation with React animation libraries.
|
| 44 |
+
*/
|
| 45 |
+
forceMount?: true;
|
| 46 |
+
}
|
| 47 |
+
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 48 |
+
interface PopoverContentTypeProps extends Omit<PopoverContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
| 49 |
+
}
|
| 50 |
+
type FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;
|
| 51 |
+
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
| 52 |
+
type PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
| 53 |
+
interface PopoverContentImplProps extends Omit<PopperContentProps, 'onPlaced'>, Omit<DismissableLayerProps, 'onDismiss'> {
|
| 54 |
+
/**
|
| 55 |
+
* Whether focus should be trapped within the `Popover`
|
| 56 |
+
* (default: false)
|
| 57 |
+
*/
|
| 58 |
+
trapFocus?: FocusScopeProps['trapped'];
|
| 59 |
+
/**
|
| 60 |
+
* Event handler called when auto-focusing on open.
|
| 61 |
+
* Can be prevented.
|
| 62 |
+
*/
|
| 63 |
+
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
| 64 |
+
/**
|
| 65 |
+
* Event handler called when auto-focusing on close.
|
| 66 |
+
* Can be prevented.
|
| 67 |
+
*/
|
| 68 |
+
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
| 69 |
+
}
|
| 70 |
+
interface PopoverCloseProps extends PrimitiveButtonProps {
|
| 71 |
+
}
|
| 72 |
+
declare const PopoverClose: React.ForwardRefExoticComponent<PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
| 73 |
+
type PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
| 74 |
+
interface PopoverArrowProps extends PopperArrowProps {
|
| 75 |
+
}
|
| 76 |
+
declare const PopoverArrow: React.ForwardRefExoticComponent<PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 77 |
+
declare const Root: React.FC<PopoverProps>;
|
| 78 |
+
declare const Anchor: React.ForwardRefExoticComponent<PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
| 79 |
+
declare const Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
| 80 |
+
declare const Portal: React.FC<PopoverPortalProps>;
|
| 81 |
+
declare const Content: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 82 |
+
declare const Close: React.ForwardRefExoticComponent<PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
| 83 |
+
declare const Arrow: React.ForwardRefExoticComponent<PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 84 |
+
|
| 85 |
+
export { Anchor, Arrow, Close, Content, Popover, PopoverAnchor, type PopoverAnchorProps, PopoverArrow, type PopoverArrowProps, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverPortalProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, Portal, Root, Trigger, createPopoverScope };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popover/dist/index.mjs
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
// src/popover.tsx
|
| 4 |
+
import * as React from "react";
|
| 5 |
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
| 6 |
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
| 7 |
+
import { createContextScope } from "@radix-ui/react-context";
|
| 8 |
+
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
| 9 |
+
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
| 10 |
+
import { FocusScope } from "@radix-ui/react-focus-scope";
|
| 11 |
+
import { useId } from "@radix-ui/react-id";
|
| 12 |
+
import * as PopperPrimitive from "@radix-ui/react-popper";
|
| 13 |
+
import { createPopperScope } from "@radix-ui/react-popper";
|
| 14 |
+
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
| 15 |
+
import { Presence } from "@radix-ui/react-presence";
|
| 16 |
+
import { Primitive } from "@radix-ui/react-primitive";
|
| 17 |
+
import { createSlot } from "@radix-ui/react-slot";
|
| 18 |
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
| 19 |
+
import { hideOthers } from "aria-hidden";
|
| 20 |
+
import { RemoveScroll } from "react-remove-scroll";
|
| 21 |
+
import { jsx } from "react/jsx-runtime";
|
| 22 |
+
var POPOVER_NAME = "Popover";
|
| 23 |
+
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
| 24 |
+
createPopperScope
|
| 25 |
+
]);
|
| 26 |
+
var usePopperScope = createPopperScope();
|
| 27 |
+
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
| 28 |
+
var Popover = (props) => {
|
| 29 |
+
const {
|
| 30 |
+
__scopePopover,
|
| 31 |
+
children,
|
| 32 |
+
open: openProp,
|
| 33 |
+
defaultOpen,
|
| 34 |
+
onOpenChange,
|
| 35 |
+
modal = false
|
| 36 |
+
} = props;
|
| 37 |
+
const popperScope = usePopperScope(__scopePopover);
|
| 38 |
+
const triggerRef = React.useRef(null);
|
| 39 |
+
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
| 40 |
+
const [open, setOpen] = useControllableState({
|
| 41 |
+
prop: openProp,
|
| 42 |
+
defaultProp: defaultOpen ?? false,
|
| 43 |
+
onChange: onOpenChange,
|
| 44 |
+
caller: POPOVER_NAME
|
| 45 |
+
});
|
| 46 |
+
return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(
|
| 47 |
+
PopoverProvider,
|
| 48 |
+
{
|
| 49 |
+
scope: __scopePopover,
|
| 50 |
+
contentId: useId(),
|
| 51 |
+
triggerRef,
|
| 52 |
+
open,
|
| 53 |
+
onOpenChange: setOpen,
|
| 54 |
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
| 55 |
+
hasCustomAnchor,
|
| 56 |
+
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
|
| 57 |
+
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
|
| 58 |
+
modal,
|
| 59 |
+
children
|
| 60 |
+
}
|
| 61 |
+
) });
|
| 62 |
+
};
|
| 63 |
+
Popover.displayName = POPOVER_NAME;
|
| 64 |
+
var ANCHOR_NAME = "PopoverAnchor";
|
| 65 |
+
var PopoverAnchor = React.forwardRef(
|
| 66 |
+
(props, forwardedRef) => {
|
| 67 |
+
const { __scopePopover, ...anchorProps } = props;
|
| 68 |
+
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
| 69 |
+
const popperScope = usePopperScope(__scopePopover);
|
| 70 |
+
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
| 71 |
+
React.useEffect(() => {
|
| 72 |
+
onCustomAnchorAdd();
|
| 73 |
+
return () => onCustomAnchorRemove();
|
| 74 |
+
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
| 75 |
+
return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
| 76 |
+
}
|
| 77 |
+
);
|
| 78 |
+
PopoverAnchor.displayName = ANCHOR_NAME;
|
| 79 |
+
var TRIGGER_NAME = "PopoverTrigger";
|
| 80 |
+
var PopoverTrigger = React.forwardRef(
|
| 81 |
+
(props, forwardedRef) => {
|
| 82 |
+
const { __scopePopover, ...triggerProps } = props;
|
| 83 |
+
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
| 84 |
+
const popperScope = usePopperScope(__scopePopover);
|
| 85 |
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
| 86 |
+
const trigger = /* @__PURE__ */ jsx(
|
| 87 |
+
Primitive.button,
|
| 88 |
+
{
|
| 89 |
+
type: "button",
|
| 90 |
+
"aria-haspopup": "dialog",
|
| 91 |
+
"aria-expanded": context.open,
|
| 92 |
+
"aria-controls": context.contentId,
|
| 93 |
+
"data-state": getState(context.open),
|
| 94 |
+
...triggerProps,
|
| 95 |
+
ref: composedTriggerRef,
|
| 96 |
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
| 97 |
+
}
|
| 98 |
+
);
|
| 99 |
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });
|
| 100 |
+
}
|
| 101 |
+
);
|
| 102 |
+
PopoverTrigger.displayName = TRIGGER_NAME;
|
| 103 |
+
var PORTAL_NAME = "PopoverPortal";
|
| 104 |
+
var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
|
| 105 |
+
forceMount: void 0
|
| 106 |
+
});
|
| 107 |
+
var PopoverPortal = (props) => {
|
| 108 |
+
const { __scopePopover, forceMount, children, container } = props;
|
| 109 |
+
const context = usePopoverContext(PORTAL_NAME, __scopePopover);
|
| 110 |
+
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });
|
| 111 |
+
};
|
| 112 |
+
PopoverPortal.displayName = PORTAL_NAME;
|
| 113 |
+
var CONTENT_NAME = "PopoverContent";
|
| 114 |
+
var PopoverContent = React.forwardRef(
|
| 115 |
+
(props, forwardedRef) => {
|
| 116 |
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
|
| 117 |
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
| 118 |
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
| 119 |
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
| 120 |
+
}
|
| 121 |
+
);
|
| 122 |
+
PopoverContent.displayName = CONTENT_NAME;
|
| 123 |
+
var Slot = createSlot("PopoverContent.RemoveScroll");
|
| 124 |
+
var PopoverContentModal = React.forwardRef(
|
| 125 |
+
(props, forwardedRef) => {
|
| 126 |
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
| 127 |
+
const contentRef = React.useRef(null);
|
| 128 |
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
| 129 |
+
const isRightClickOutsideRef = React.useRef(false);
|
| 130 |
+
React.useEffect(() => {
|
| 131 |
+
const content = contentRef.current;
|
| 132 |
+
if (content) return hideOthers(content);
|
| 133 |
+
}, []);
|
| 134 |
+
return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(
|
| 135 |
+
PopoverContentImpl,
|
| 136 |
+
{
|
| 137 |
+
...props,
|
| 138 |
+
ref: composedRefs,
|
| 139 |
+
trapFocus: context.open,
|
| 140 |
+
disableOutsidePointerEvents: true,
|
| 141 |
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
| 142 |
+
event.preventDefault();
|
| 143 |
+
if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
|
| 144 |
+
}),
|
| 145 |
+
onPointerDownOutside: composeEventHandlers(
|
| 146 |
+
props.onPointerDownOutside,
|
| 147 |
+
(event) => {
|
| 148 |
+
const originalEvent = event.detail.originalEvent;
|
| 149 |
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
| 150 |
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
| 151 |
+
isRightClickOutsideRef.current = isRightClick;
|
| 152 |
+
},
|
| 153 |
+
{ checkForDefaultPrevented: false }
|
| 154 |
+
),
|
| 155 |
+
onFocusOutside: composeEventHandlers(
|
| 156 |
+
props.onFocusOutside,
|
| 157 |
+
(event) => event.preventDefault(),
|
| 158 |
+
{ checkForDefaultPrevented: false }
|
| 159 |
+
)
|
| 160 |
+
}
|
| 161 |
+
) });
|
| 162 |
+
}
|
| 163 |
+
);
|
| 164 |
+
var PopoverContentNonModal = React.forwardRef(
|
| 165 |
+
(props, forwardedRef) => {
|
| 166 |
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
| 167 |
+
const hasInteractedOutsideRef = React.useRef(false);
|
| 168 |
+
const hasPointerDownOutsideRef = React.useRef(false);
|
| 169 |
+
return /* @__PURE__ */ jsx(
|
| 170 |
+
PopoverContentImpl,
|
| 171 |
+
{
|
| 172 |
+
...props,
|
| 173 |
+
ref: forwardedRef,
|
| 174 |
+
trapFocus: false,
|
| 175 |
+
disableOutsidePointerEvents: false,
|
| 176 |
+
onCloseAutoFocus: (event) => {
|
| 177 |
+
props.onCloseAutoFocus?.(event);
|
| 178 |
+
if (!event.defaultPrevented) {
|
| 179 |
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
| 180 |
+
event.preventDefault();
|
| 181 |
+
}
|
| 182 |
+
hasInteractedOutsideRef.current = false;
|
| 183 |
+
hasPointerDownOutsideRef.current = false;
|
| 184 |
+
},
|
| 185 |
+
onInteractOutside: (event) => {
|
| 186 |
+
props.onInteractOutside?.(event);
|
| 187 |
+
if (!event.defaultPrevented) {
|
| 188 |
+
hasInteractedOutsideRef.current = true;
|
| 189 |
+
if (event.detail.originalEvent.type === "pointerdown") {
|
| 190 |
+
hasPointerDownOutsideRef.current = true;
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
const target = event.target;
|
| 194 |
+
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
| 195 |
+
if (targetIsTrigger) event.preventDefault();
|
| 196 |
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
| 197 |
+
event.preventDefault();
|
| 198 |
+
}
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
);
|
| 202 |
+
}
|
| 203 |
+
);
|
| 204 |
+
var PopoverContentImpl = React.forwardRef(
|
| 205 |
+
(props, forwardedRef) => {
|
| 206 |
+
const {
|
| 207 |
+
__scopePopover,
|
| 208 |
+
trapFocus,
|
| 209 |
+
onOpenAutoFocus,
|
| 210 |
+
onCloseAutoFocus,
|
| 211 |
+
disableOutsidePointerEvents,
|
| 212 |
+
onEscapeKeyDown,
|
| 213 |
+
onPointerDownOutside,
|
| 214 |
+
onFocusOutside,
|
| 215 |
+
onInteractOutside,
|
| 216 |
+
...contentProps
|
| 217 |
+
} = props;
|
| 218 |
+
const context = usePopoverContext(CONTENT_NAME, __scopePopover);
|
| 219 |
+
const popperScope = usePopperScope(__scopePopover);
|
| 220 |
+
useFocusGuards();
|
| 221 |
+
return /* @__PURE__ */ jsx(
|
| 222 |
+
FocusScope,
|
| 223 |
+
{
|
| 224 |
+
asChild: true,
|
| 225 |
+
loop: true,
|
| 226 |
+
trapped: trapFocus,
|
| 227 |
+
onMountAutoFocus: onOpenAutoFocus,
|
| 228 |
+
onUnmountAutoFocus: onCloseAutoFocus,
|
| 229 |
+
children: /* @__PURE__ */ jsx(
|
| 230 |
+
DismissableLayer,
|
| 231 |
+
{
|
| 232 |
+
asChild: true,
|
| 233 |
+
disableOutsidePointerEvents,
|
| 234 |
+
onInteractOutside,
|
| 235 |
+
onEscapeKeyDown,
|
| 236 |
+
onPointerDownOutside,
|
| 237 |
+
onFocusOutside,
|
| 238 |
+
onDismiss: () => context.onOpenChange(false),
|
| 239 |
+
children: /* @__PURE__ */ jsx(
|
| 240 |
+
PopperPrimitive.Content,
|
| 241 |
+
{
|
| 242 |
+
"data-state": getState(context.open),
|
| 243 |
+
role: "dialog",
|
| 244 |
+
id: context.contentId,
|
| 245 |
+
...popperScope,
|
| 246 |
+
...contentProps,
|
| 247 |
+
ref: forwardedRef,
|
| 248 |
+
style: {
|
| 249 |
+
...contentProps.style,
|
| 250 |
+
// re-namespace exposed content custom properties
|
| 251 |
+
...{
|
| 252 |
+
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
| 253 |
+
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
| 254 |
+
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
| 255 |
+
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
| 256 |
+
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
}
|
| 260 |
+
)
|
| 261 |
+
}
|
| 262 |
+
)
|
| 263 |
+
}
|
| 264 |
+
);
|
| 265 |
+
}
|
| 266 |
+
);
|
| 267 |
+
var CLOSE_NAME = "PopoverClose";
|
| 268 |
+
var PopoverClose = React.forwardRef(
|
| 269 |
+
(props, forwardedRef) => {
|
| 270 |
+
const { __scopePopover, ...closeProps } = props;
|
| 271 |
+
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
| 272 |
+
return /* @__PURE__ */ jsx(
|
| 273 |
+
Primitive.button,
|
| 274 |
+
{
|
| 275 |
+
type: "button",
|
| 276 |
+
...closeProps,
|
| 277 |
+
ref: forwardedRef,
|
| 278 |
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
| 279 |
+
}
|
| 280 |
+
);
|
| 281 |
+
}
|
| 282 |
+
);
|
| 283 |
+
PopoverClose.displayName = CLOSE_NAME;
|
| 284 |
+
var ARROW_NAME = "PopoverArrow";
|
| 285 |
+
var PopoverArrow = React.forwardRef(
|
| 286 |
+
(props, forwardedRef) => {
|
| 287 |
+
const { __scopePopover, ...arrowProps } = props;
|
| 288 |
+
const popperScope = usePopperScope(__scopePopover);
|
| 289 |
+
return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
| 290 |
+
}
|
| 291 |
+
);
|
| 292 |
+
PopoverArrow.displayName = ARROW_NAME;
|
| 293 |
+
function getState(open) {
|
| 294 |
+
return open ? "open" : "closed";
|
| 295 |
+
}
|
| 296 |
+
var Root2 = Popover;
|
| 297 |
+
var Anchor2 = PopoverAnchor;
|
| 298 |
+
var Trigger = PopoverTrigger;
|
| 299 |
+
var Portal = PopoverPortal;
|
| 300 |
+
var Content2 = PopoverContent;
|
| 301 |
+
var Close = PopoverClose;
|
| 302 |
+
var Arrow2 = PopoverArrow;
|
| 303 |
+
export {
|
| 304 |
+
Anchor2 as Anchor,
|
| 305 |
+
Arrow2 as Arrow,
|
| 306 |
+
Close,
|
| 307 |
+
Content2 as Content,
|
| 308 |
+
Popover,
|
| 309 |
+
PopoverAnchor,
|
| 310 |
+
PopoverArrow,
|
| 311 |
+
PopoverClose,
|
| 312 |
+
PopoverContent,
|
| 313 |
+
PopoverPortal,
|
| 314 |
+
PopoverTrigger,
|
| 315 |
+
Portal,
|
| 316 |
+
Root2 as Root,
|
| 317 |
+
Trigger,
|
| 318 |
+
createPopoverScope
|
| 319 |
+
};
|
| 320 |
+
//# sourceMappingURL=index.mjs.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.d.mts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
import * as ArrowPrimitive from '@radix-ui/react-arrow';
|
| 4 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 5 |
+
import { Measurable } from '@radix-ui/rect';
|
| 6 |
+
|
| 7 |
+
declare const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"];
|
| 8 |
+
declare const ALIGN_OPTIONS: readonly ["start", "center", "end"];
|
| 9 |
+
type Side = (typeof SIDE_OPTIONS)[number];
|
| 10 |
+
type Align = (typeof ALIGN_OPTIONS)[number];
|
| 11 |
+
declare const createPopperScope: _radix_ui_react_context.CreateScope;
|
| 12 |
+
interface PopperProps {
|
| 13 |
+
children?: React.ReactNode;
|
| 14 |
+
}
|
| 15 |
+
declare const Popper: React.FC<PopperProps>;
|
| 16 |
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
| 17 |
+
interface PopperAnchorProps extends PrimitiveDivProps {
|
| 18 |
+
virtualRef?: React.RefObject<Measurable>;
|
| 19 |
+
}
|
| 20 |
+
declare const PopperAnchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
| 21 |
+
type Boundary = Element | null;
|
| 22 |
+
interface PopperContentProps extends PrimitiveDivProps {
|
| 23 |
+
side?: Side;
|
| 24 |
+
sideOffset?: number;
|
| 25 |
+
align?: Align;
|
| 26 |
+
alignOffset?: number;
|
| 27 |
+
arrowPadding?: number;
|
| 28 |
+
avoidCollisions?: boolean;
|
| 29 |
+
collisionBoundary?: Boundary | Boundary[];
|
| 30 |
+
collisionPadding?: number | Partial<Record<Side, number>>;
|
| 31 |
+
sticky?: 'partial' | 'always';
|
| 32 |
+
hideWhenDetached?: boolean;
|
| 33 |
+
updatePositionStrategy?: 'optimized' | 'always';
|
| 34 |
+
onPlaced?: () => void;
|
| 35 |
+
}
|
| 36 |
+
declare const PopperContent: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 37 |
+
type ArrowProps = React.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;
|
| 38 |
+
interface PopperArrowProps extends ArrowProps {
|
| 39 |
+
}
|
| 40 |
+
declare const PopperArrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 41 |
+
declare const Root: React.FC<PopperProps>;
|
| 42 |
+
declare const Anchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
| 43 |
+
declare const Content: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 44 |
+
declare const Arrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 45 |
+
|
| 46 |
+
export { ALIGN_OPTIONS, Anchor, Arrow, Content, Popper, PopperAnchor, type PopperAnchorProps, PopperArrow, type PopperArrowProps, PopperContent, type PopperContentProps, type PopperProps, Root, SIDE_OPTIONS, createPopperScope };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
import * as ArrowPrimitive from '@radix-ui/react-arrow';
|
| 4 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 5 |
+
import { Measurable } from '@radix-ui/rect';
|
| 6 |
+
|
| 7 |
+
declare const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"];
|
| 8 |
+
declare const ALIGN_OPTIONS: readonly ["start", "center", "end"];
|
| 9 |
+
type Side = (typeof SIDE_OPTIONS)[number];
|
| 10 |
+
type Align = (typeof ALIGN_OPTIONS)[number];
|
| 11 |
+
declare const createPopperScope: _radix_ui_react_context.CreateScope;
|
| 12 |
+
interface PopperProps {
|
| 13 |
+
children?: React.ReactNode;
|
| 14 |
+
}
|
| 15 |
+
declare const Popper: React.FC<PopperProps>;
|
| 16 |
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
| 17 |
+
interface PopperAnchorProps extends PrimitiveDivProps {
|
| 18 |
+
virtualRef?: React.RefObject<Measurable>;
|
| 19 |
+
}
|
| 20 |
+
declare const PopperAnchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
| 21 |
+
type Boundary = Element | null;
|
| 22 |
+
interface PopperContentProps extends PrimitiveDivProps {
|
| 23 |
+
side?: Side;
|
| 24 |
+
sideOffset?: number;
|
| 25 |
+
align?: Align;
|
| 26 |
+
alignOffset?: number;
|
| 27 |
+
arrowPadding?: number;
|
| 28 |
+
avoidCollisions?: boolean;
|
| 29 |
+
collisionBoundary?: Boundary | Boundary[];
|
| 30 |
+
collisionPadding?: number | Partial<Record<Side, number>>;
|
| 31 |
+
sticky?: 'partial' | 'always';
|
| 32 |
+
hideWhenDetached?: boolean;
|
| 33 |
+
updatePositionStrategy?: 'optimized' | 'always';
|
| 34 |
+
onPlaced?: () => void;
|
| 35 |
+
}
|
| 36 |
+
declare const PopperContent: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 37 |
+
type ArrowProps = React.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;
|
| 38 |
+
interface PopperArrowProps extends ArrowProps {
|
| 39 |
+
}
|
| 40 |
+
declare const PopperArrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 41 |
+
declare const Root: React.FC<PopperProps>;
|
| 42 |
+
declare const Anchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
| 43 |
+
declare const Content: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 44 |
+
declare const Arrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 45 |
+
|
| 46 |
+
export { ALIGN_OPTIONS, Anchor, Arrow, Content, Popper, PopperAnchor, type PopperAnchorProps, PopperArrow, type PopperArrowProps, PopperContent, type PopperContentProps, type PopperProps, Root, SIDE_OPTIONS, createPopperScope };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.js
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
"use client";
|
| 3 |
+
var __create = Object.create;
|
| 4 |
+
var __defProp = Object.defineProperty;
|
| 5 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 6 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 7 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 8 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 9 |
+
var __export = (target, all) => {
|
| 10 |
+
for (var name in all)
|
| 11 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 12 |
+
};
|
| 13 |
+
var __copyProps = (to, from, except, desc) => {
|
| 14 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 15 |
+
for (let key of __getOwnPropNames(from))
|
| 16 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 17 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 18 |
+
}
|
| 19 |
+
return to;
|
| 20 |
+
};
|
| 21 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 22 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 23 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 24 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 25 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 26 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 27 |
+
mod
|
| 28 |
+
));
|
| 29 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 30 |
+
|
| 31 |
+
// src/index.ts
|
| 32 |
+
var index_exports = {};
|
| 33 |
+
__export(index_exports, {
|
| 34 |
+
ALIGN_OPTIONS: () => ALIGN_OPTIONS,
|
| 35 |
+
Anchor: () => Anchor,
|
| 36 |
+
Arrow: () => Arrow,
|
| 37 |
+
Content: () => Content,
|
| 38 |
+
Popper: () => Popper,
|
| 39 |
+
PopperAnchor: () => PopperAnchor,
|
| 40 |
+
PopperArrow: () => PopperArrow,
|
| 41 |
+
PopperContent: () => PopperContent,
|
| 42 |
+
Root: () => Root2,
|
| 43 |
+
SIDE_OPTIONS: () => SIDE_OPTIONS,
|
| 44 |
+
createPopperScope: () => createPopperScope
|
| 45 |
+
});
|
| 46 |
+
module.exports = __toCommonJS(index_exports);
|
| 47 |
+
|
| 48 |
+
// src/popper.tsx
|
| 49 |
+
var React = __toESM(require("react"));
|
| 50 |
+
var import_react_dom = require("@floating-ui/react-dom");
|
| 51 |
+
var ArrowPrimitive = __toESM(require("@radix-ui/react-arrow"));
|
| 52 |
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
| 53 |
+
var import_react_context = require("@radix-ui/react-context");
|
| 54 |
+
var import_react_primitive = require("@radix-ui/react-primitive");
|
| 55 |
+
var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref");
|
| 56 |
+
var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect");
|
| 57 |
+
var import_react_use_size = require("@radix-ui/react-use-size");
|
| 58 |
+
var import_jsx_runtime = require("react/jsx-runtime");
|
| 59 |
+
var SIDE_OPTIONS = ["top", "right", "bottom", "left"];
|
| 60 |
+
var ALIGN_OPTIONS = ["start", "center", "end"];
|
| 61 |
+
var POPPER_NAME = "Popper";
|
| 62 |
+
var [createPopperContext, createPopperScope] = (0, import_react_context.createContextScope)(POPPER_NAME);
|
| 63 |
+
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
| 64 |
+
var Popper = (props) => {
|
| 65 |
+
const { __scopePopper, children } = props;
|
| 66 |
+
const [anchor, setAnchor] = React.useState(null);
|
| 67 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
| 68 |
+
};
|
| 69 |
+
Popper.displayName = POPPER_NAME;
|
| 70 |
+
var ANCHOR_NAME = "PopperAnchor";
|
| 71 |
+
var PopperAnchor = React.forwardRef(
|
| 72 |
+
(props, forwardedRef) => {
|
| 73 |
+
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
| 74 |
+
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
| 75 |
+
const ref = React.useRef(null);
|
| 76 |
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref);
|
| 77 |
+
React.useEffect(() => {
|
| 78 |
+
context.onAnchorChange(virtualRef?.current || ref.current);
|
| 79 |
+
});
|
| 80 |
+
return virtualRef ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...anchorProps, ref: composedRefs });
|
| 81 |
+
}
|
| 82 |
+
);
|
| 83 |
+
PopperAnchor.displayName = ANCHOR_NAME;
|
| 84 |
+
var CONTENT_NAME = "PopperContent";
|
| 85 |
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
| 86 |
+
var PopperContent = React.forwardRef(
|
| 87 |
+
(props, forwardedRef) => {
|
| 88 |
+
const {
|
| 89 |
+
__scopePopper,
|
| 90 |
+
side = "bottom",
|
| 91 |
+
sideOffset = 0,
|
| 92 |
+
align = "center",
|
| 93 |
+
alignOffset = 0,
|
| 94 |
+
arrowPadding = 0,
|
| 95 |
+
avoidCollisions = true,
|
| 96 |
+
collisionBoundary = [],
|
| 97 |
+
collisionPadding: collisionPaddingProp = 0,
|
| 98 |
+
sticky = "partial",
|
| 99 |
+
hideWhenDetached = false,
|
| 100 |
+
updatePositionStrategy = "optimized",
|
| 101 |
+
onPlaced,
|
| 102 |
+
...contentProps
|
| 103 |
+
} = props;
|
| 104 |
+
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
| 105 |
+
const [content, setContent] = React.useState(null);
|
| 106 |
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setContent(node));
|
| 107 |
+
const [arrow, setArrow] = React.useState(null);
|
| 108 |
+
const arrowSize = (0, import_react_use_size.useSize)(arrow);
|
| 109 |
+
const arrowWidth = arrowSize?.width ?? 0;
|
| 110 |
+
const arrowHeight = arrowSize?.height ?? 0;
|
| 111 |
+
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
| 112 |
+
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
|
| 113 |
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
| 114 |
+
const hasExplicitBoundaries = boundary.length > 0;
|
| 115 |
+
const detectOverflowOptions = {
|
| 116 |
+
padding: collisionPadding,
|
| 117 |
+
boundary: boundary.filter(isNotNull),
|
| 118 |
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
| 119 |
+
altBoundary: hasExplicitBoundaries
|
| 120 |
+
};
|
| 121 |
+
const { refs, floatingStyles, placement, isPositioned, middlewareData } = (0, import_react_dom.useFloating)({
|
| 122 |
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
| 123 |
+
strategy: "fixed",
|
| 124 |
+
placement: desiredPlacement,
|
| 125 |
+
whileElementsMounted: (...args) => {
|
| 126 |
+
const cleanup = (0, import_react_dom.autoUpdate)(...args, {
|
| 127 |
+
animationFrame: updatePositionStrategy === "always"
|
| 128 |
+
});
|
| 129 |
+
return cleanup;
|
| 130 |
+
},
|
| 131 |
+
elements: {
|
| 132 |
+
reference: context.anchor
|
| 133 |
+
},
|
| 134 |
+
middleware: [
|
| 135 |
+
(0, import_react_dom.offset)({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
| 136 |
+
avoidCollisions && (0, import_react_dom.shift)({
|
| 137 |
+
mainAxis: true,
|
| 138 |
+
crossAxis: false,
|
| 139 |
+
limiter: sticky === "partial" ? (0, import_react_dom.limitShift)() : void 0,
|
| 140 |
+
...detectOverflowOptions
|
| 141 |
+
}),
|
| 142 |
+
avoidCollisions && (0, import_react_dom.flip)({ ...detectOverflowOptions }),
|
| 143 |
+
(0, import_react_dom.size)({
|
| 144 |
+
...detectOverflowOptions,
|
| 145 |
+
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
| 146 |
+
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
| 147 |
+
const contentStyle = elements.floating.style;
|
| 148 |
+
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
| 149 |
+
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
| 150 |
+
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
| 151 |
+
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
| 152 |
+
}
|
| 153 |
+
}),
|
| 154 |
+
arrow && (0, import_react_dom.arrow)({ element: arrow, padding: arrowPadding }),
|
| 155 |
+
transformOrigin({ arrowWidth, arrowHeight }),
|
| 156 |
+
hideWhenDetached && (0, import_react_dom.hide)({ strategy: "referenceHidden", ...detectOverflowOptions })
|
| 157 |
+
]
|
| 158 |
+
});
|
| 159 |
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
| 160 |
+
const handlePlaced = (0, import_react_use_callback_ref.useCallbackRef)(onPlaced);
|
| 161 |
+
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
|
| 162 |
+
if (isPositioned) {
|
| 163 |
+
handlePlaced?.();
|
| 164 |
+
}
|
| 165 |
+
}, [isPositioned, handlePlaced]);
|
| 166 |
+
const arrowX = middlewareData.arrow?.x;
|
| 167 |
+
const arrowY = middlewareData.arrow?.y;
|
| 168 |
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
| 169 |
+
const [contentZIndex, setContentZIndex] = React.useState();
|
| 170 |
+
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
|
| 171 |
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
| 172 |
+
}, [content]);
|
| 173 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 174 |
+
"div",
|
| 175 |
+
{
|
| 176 |
+
ref: refs.setFloating,
|
| 177 |
+
"data-radix-popper-content-wrapper": "",
|
| 178 |
+
style: {
|
| 179 |
+
...floatingStyles,
|
| 180 |
+
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
| 181 |
+
// keep off the page when measuring
|
| 182 |
+
minWidth: "max-content",
|
| 183 |
+
zIndex: contentZIndex,
|
| 184 |
+
["--radix-popper-transform-origin"]: [
|
| 185 |
+
middlewareData.transformOrigin?.x,
|
| 186 |
+
middlewareData.transformOrigin?.y
|
| 187 |
+
].join(" "),
|
| 188 |
+
// hide the content if using the hide middleware and should be hidden
|
| 189 |
+
// set visibility to hidden and disable pointer events so the UI behaves
|
| 190 |
+
// as if the PopperContent isn't there at all
|
| 191 |
+
...middlewareData.hide?.referenceHidden && {
|
| 192 |
+
visibility: "hidden",
|
| 193 |
+
pointerEvents: "none"
|
| 194 |
+
}
|
| 195 |
+
},
|
| 196 |
+
dir: props.dir,
|
| 197 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 198 |
+
PopperContentProvider,
|
| 199 |
+
{
|
| 200 |
+
scope: __scopePopper,
|
| 201 |
+
placedSide,
|
| 202 |
+
onArrowChange: setArrow,
|
| 203 |
+
arrowX,
|
| 204 |
+
arrowY,
|
| 205 |
+
shouldHideArrow: cannotCenterArrow,
|
| 206 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 207 |
+
import_react_primitive.Primitive.div,
|
| 208 |
+
{
|
| 209 |
+
"data-side": placedSide,
|
| 210 |
+
"data-align": placedAlign,
|
| 211 |
+
...contentProps,
|
| 212 |
+
ref: composedRefs,
|
| 213 |
+
style: {
|
| 214 |
+
...contentProps.style,
|
| 215 |
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
| 216 |
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
| 217 |
+
animation: !isPositioned ? "none" : void 0
|
| 218 |
+
}
|
| 219 |
+
}
|
| 220 |
+
)
|
| 221 |
+
}
|
| 222 |
+
)
|
| 223 |
+
}
|
| 224 |
+
);
|
| 225 |
+
}
|
| 226 |
+
);
|
| 227 |
+
PopperContent.displayName = CONTENT_NAME;
|
| 228 |
+
var ARROW_NAME = "PopperArrow";
|
| 229 |
+
var OPPOSITE_SIDE = {
|
| 230 |
+
top: "bottom",
|
| 231 |
+
right: "left",
|
| 232 |
+
bottom: "top",
|
| 233 |
+
left: "right"
|
| 234 |
+
};
|
| 235 |
+
var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
| 236 |
+
const { __scopePopper, ...arrowProps } = props;
|
| 237 |
+
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
| 238 |
+
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
| 239 |
+
return (
|
| 240 |
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
| 241 |
+
// doesn't report size as we'd expect on SVG elements.
|
| 242 |
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
| 243 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 244 |
+
"span",
|
| 245 |
+
{
|
| 246 |
+
ref: contentContext.onArrowChange,
|
| 247 |
+
style: {
|
| 248 |
+
position: "absolute",
|
| 249 |
+
left: contentContext.arrowX,
|
| 250 |
+
top: contentContext.arrowY,
|
| 251 |
+
[baseSide]: 0,
|
| 252 |
+
transformOrigin: {
|
| 253 |
+
top: "",
|
| 254 |
+
right: "0 0",
|
| 255 |
+
bottom: "center 0",
|
| 256 |
+
left: "100% 0"
|
| 257 |
+
}[contentContext.placedSide],
|
| 258 |
+
transform: {
|
| 259 |
+
top: "translateY(100%)",
|
| 260 |
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
| 261 |
+
bottom: `rotate(180deg)`,
|
| 262 |
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
| 263 |
+
}[contentContext.placedSide],
|
| 264 |
+
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
| 265 |
+
},
|
| 266 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 267 |
+
ArrowPrimitive.Root,
|
| 268 |
+
{
|
| 269 |
+
...arrowProps,
|
| 270 |
+
ref: forwardedRef,
|
| 271 |
+
style: {
|
| 272 |
+
...arrowProps.style,
|
| 273 |
+
// ensures the element can be measured correctly (mostly for if SVG)
|
| 274 |
+
display: "block"
|
| 275 |
+
}
|
| 276 |
+
}
|
| 277 |
+
)
|
| 278 |
+
}
|
| 279 |
+
)
|
| 280 |
+
);
|
| 281 |
+
});
|
| 282 |
+
PopperArrow.displayName = ARROW_NAME;
|
| 283 |
+
function isNotNull(value) {
|
| 284 |
+
return value !== null;
|
| 285 |
+
}
|
| 286 |
+
var transformOrigin = (options) => ({
|
| 287 |
+
name: "transformOrigin",
|
| 288 |
+
options,
|
| 289 |
+
fn(data) {
|
| 290 |
+
const { placement, rects, middlewareData } = data;
|
| 291 |
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
| 292 |
+
const isArrowHidden = cannotCenterArrow;
|
| 293 |
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
| 294 |
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
| 295 |
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
| 296 |
+
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
| 297 |
+
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
| 298 |
+
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
| 299 |
+
let x = "";
|
| 300 |
+
let y = "";
|
| 301 |
+
if (placedSide === "bottom") {
|
| 302 |
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
| 303 |
+
y = `${-arrowHeight}px`;
|
| 304 |
+
} else if (placedSide === "top") {
|
| 305 |
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
| 306 |
+
y = `${rects.floating.height + arrowHeight}px`;
|
| 307 |
+
} else if (placedSide === "right") {
|
| 308 |
+
x = `${-arrowHeight}px`;
|
| 309 |
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
| 310 |
+
} else if (placedSide === "left") {
|
| 311 |
+
x = `${rects.floating.width + arrowHeight}px`;
|
| 312 |
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
| 313 |
+
}
|
| 314 |
+
return { data: { x, y } };
|
| 315 |
+
}
|
| 316 |
+
});
|
| 317 |
+
function getSideAndAlignFromPlacement(placement) {
|
| 318 |
+
const [side, align = "center"] = placement.split("-");
|
| 319 |
+
return [side, align];
|
| 320 |
+
}
|
| 321 |
+
var Root2 = Popper;
|
| 322 |
+
var Anchor = PopperAnchor;
|
| 323 |
+
var Content = PopperContent;
|
| 324 |
+
var Arrow = PopperArrow;
|
| 325 |
+
//# sourceMappingURL=index.js.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/popper.tsx"],
|
| 4 |
+
"sourcesContent": ["'use client';\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n //\n SIDE_OPTIONS,\n ALIGN_OPTIONS,\n} from './popper';\nexport type {\n PopperProps,\n PopperAnchorProps,\n PopperContentProps,\n PopperArrowProps,\n} from './popper';\n", "import * as React from 'react';\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size,\n} from '@floating-ui/react-dom';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useSize } from '@radix-ui/react-use-size';\n\nimport type { Placement, Middleware } from '@floating-ui/react-dom';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Measurable } from '@radix-ui/rect';\n\nconst SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const;\nconst ALIGN_OPTIONS = ['start', 'center', 'end'] as const;\n\ntype Side = (typeof SIDE_OPTIONS)[number];\ntype Align = (typeof ALIGN_OPTIONS)[number];\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n placedSide: Side;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n arrowX?: number;\n arrowY?: number;\n shouldHideArrow: boolean;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype Boundary = Element | null;\n\ntype PopperContentElement = React.ComponentRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n arrowPadding?: number;\n avoidCollisions?: boolean;\n collisionBoundary?: Boundary | Boundary[];\n collisionPadding?: number | Partial<Record<Side, number>>;\n sticky?: 'partial' | 'always';\n hideWhenDetached?: boolean;\n updatePositionStrategy?: 'optimized' | 'always';\n onPlaced?: () => void;\n}\n\nconst PopperContent = React.forwardRef<PopperContentElement, PopperContentProps>(\n (props: ScopedProps<PopperContentProps>, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset = 0,\n align = 'center',\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = 'partial',\n hideWhenDetached = false,\n updatePositionStrategy = 'optimized',\n onPlaced,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const [arrow, setArrow] = React.useState<HTMLSpanElement | null>(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n\n const desiredPlacement = (side + (align !== 'center' ? '-' + align : '')) as Placement;\n\n const collisionPadding =\n typeof collisionPaddingProp === 'number'\n ? collisionPaddingProp\n : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries,\n };\n\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: 'fixed',\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === 'always',\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor,\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === 'partial' ? limitShift() : undefined,\n ...detectOverflowOptions,\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);\n contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);\n contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);\n contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);\n },\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: 'referenceHidden', ...detectOverflowOptions }),\n ],\n });\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n\n const [contentZIndex, setContentZIndex] = React.useState<string>();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n return (\n <div\n ref={refs.setFloating}\n data-radix-popper-content-wrapper=\"\"\n style={{\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)', // keep off the page when measuring\n minWidth: 'max-content',\n zIndex: contentZIndex,\n ['--radix-popper-transform-origin' as any]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y,\n ].join(' '),\n\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...(middlewareData.hide?.referenceHidden && {\n visibility: 'hidden',\n pointerEvents: 'none',\n }),\n }}\n // Floating UI interally calculates logical alignment based the `dir` attribute on\n // the reference/floating node, we must add this attribute here to ensure\n // this is calculated when portalled as well as inline.\n dir={props.dir}\n >\n <PopperContentProvider\n scope={__scopePopper}\n placedSide={placedSide}\n onArrowChange={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n shouldHideArrow={cannotCenterArrow}\n >\n <Primitive.div\n data-side={placedSide}\n data-align={placedAlign}\n {...contentProps}\n ref={composedRefs}\n style={{\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? 'none' : undefined,\n }}\n />\n </PopperContentProvider>\n </div>\n );\n }\n);\n\nPopperContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopperArrow';\n\nconst OPPOSITE_SIDE: Record<Side, Side> = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n};\n\ntype PopperArrowElement = React.ComponentRef<typeof ArrowPrimitive.Root>;\ntype ArrowProps = React.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;\ninterface PopperArrowProps extends ArrowProps {}\n\nconst PopperArrow = React.forwardRef<PopperArrowElement, PopperArrowProps>(function PopperArrow(\n props: ScopedProps<PopperArrowProps>,\n forwardedRef\n) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n <span\n ref={contentContext.onArrowChange}\n style={{\n position: 'absolute',\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: '',\n right: '0 0',\n bottom: 'center 0',\n left: '100% 0',\n }[contentContext.placedSide],\n transform: {\n top: 'translateY(100%)',\n right: 'translateY(50%) rotate(90deg) translateX(-50%)',\n bottom: `rotate(180deg)`,\n left: 'translateY(50%) rotate(-90deg) translateX(50%)',\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? 'hidden' : undefined,\n }}\n >\n <ArrowPrimitive.Root\n {...arrowProps}\n ref={forwardedRef}\n style={{\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: 'block',\n }}\n />\n </span>\n );\n});\n\nPopperArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isNotNull<T>(value: T | null): value is T {\n return value !== null;\n}\n\nconst transformOrigin = (options: { arrowWidth: number; arrowHeight: number }): Middleware => ({\n name: 'transformOrigin',\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: '0%', center: '50%', end: '100%' }[placedAlign];\n\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n\n let x = '';\n let y = '';\n\n if (placedSide === 'bottom') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === 'top') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === 'right') {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === 'left') {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n },\n});\n\nfunction getSideAndAlignFromPlacement(placement: Placement) {\n const [side, align = 'center'] = placement.split('-');\n return [side as Side, align as Align] as const;\n}\n\nconst Root = Popper;\nconst Anchor = PopperAnchor;\nconst Content = PopperContent;\nconst Arrow = PopperArrow;\n\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n //\n SIDE_OPTIONS,\n ALIGN_OPTIONS,\n};\nexport type { PopperProps, PopperAnchorProps, PopperContentProps, PopperArrowProps };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,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AO,KAAK,KAAK,cAAc;AAEpE,QAAI,IAAI;AACR,QAAI,IAAI;AAER,QAAI,eAAe,UAAU;AAC3B,UAAI,gBAAgB,eAAe,GAAG,YAAY;AAClD,UAAI,GAAG,CAAC,WAAW;AAAA,IACrB,WAAW,eAAe,OAAO;AAC/B,UAAI,gBAAgB,eAAe,GAAG,YAAY;AAClD,UAAI,GAAG,MAAM,SAAS,SAAS,WAAW;AAAA,IAC5C,WAAW,eAAe,SAAS;AACjC,UAAI,GAAG,CAAC,WAAW;AACnB,UAAI,gBAAgB,eAAe,GAAG,YAAY;AAAA,IACpD,WAAW,eAAe,QAAQ;AAChC,UAAI,GAAG,MAAM,SAAS,QAAQ,WAAW;AACzC,UAAI,gBAAgB,eAAe,GAAG,YAAY;AAAA,IACpD;AACA,WAAO,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;AAAA,EAC1B;AACF;AAEA,SAAS,6BAA6B,WAAsB;AAC1D,QAAM,CAAC,MAAM,QAAQ,QAAQ,IAAI,UAAU,MAAM,GAAG;AACpD,SAAO,CAAC,MAAc,KAAc;AACtC;AAEA,IAAMC,QAAO;AACb,IAAM,SAAS;AACf,IAAM,UAAU;AAChB,IAAM,QAAQ;",
|
| 6 |
+
"names": ["Root", "floatingUIarrow", "PopperArrow", "Root"]
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.mjs
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
// src/popper.tsx
|
| 4 |
+
import * as React from "react";
|
| 5 |
+
import {
|
| 6 |
+
useFloating,
|
| 7 |
+
autoUpdate,
|
| 8 |
+
offset,
|
| 9 |
+
shift,
|
| 10 |
+
limitShift,
|
| 11 |
+
hide,
|
| 12 |
+
arrow as floatingUIarrow,
|
| 13 |
+
flip,
|
| 14 |
+
size
|
| 15 |
+
} from "@floating-ui/react-dom";
|
| 16 |
+
import * as ArrowPrimitive from "@radix-ui/react-arrow";
|
| 17 |
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
| 18 |
+
import { createContextScope } from "@radix-ui/react-context";
|
| 19 |
+
import { Primitive } from "@radix-ui/react-primitive";
|
| 20 |
+
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
|
| 21 |
+
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
| 22 |
+
import { useSize } from "@radix-ui/react-use-size";
|
| 23 |
+
import { jsx } from "react/jsx-runtime";
|
| 24 |
+
var SIDE_OPTIONS = ["top", "right", "bottom", "left"];
|
| 25 |
+
var ALIGN_OPTIONS = ["start", "center", "end"];
|
| 26 |
+
var POPPER_NAME = "Popper";
|
| 27 |
+
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
| 28 |
+
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
| 29 |
+
var Popper = (props) => {
|
| 30 |
+
const { __scopePopper, children } = props;
|
| 31 |
+
const [anchor, setAnchor] = React.useState(null);
|
| 32 |
+
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
| 33 |
+
};
|
| 34 |
+
Popper.displayName = POPPER_NAME;
|
| 35 |
+
var ANCHOR_NAME = "PopperAnchor";
|
| 36 |
+
var PopperAnchor = React.forwardRef(
|
| 37 |
+
(props, forwardedRef) => {
|
| 38 |
+
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
| 39 |
+
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
| 40 |
+
const ref = React.useRef(null);
|
| 41 |
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
| 42 |
+
React.useEffect(() => {
|
| 43 |
+
context.onAnchorChange(virtualRef?.current || ref.current);
|
| 44 |
+
});
|
| 45 |
+
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
| 46 |
+
}
|
| 47 |
+
);
|
| 48 |
+
PopperAnchor.displayName = ANCHOR_NAME;
|
| 49 |
+
var CONTENT_NAME = "PopperContent";
|
| 50 |
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
| 51 |
+
var PopperContent = React.forwardRef(
|
| 52 |
+
(props, forwardedRef) => {
|
| 53 |
+
const {
|
| 54 |
+
__scopePopper,
|
| 55 |
+
side = "bottom",
|
| 56 |
+
sideOffset = 0,
|
| 57 |
+
align = "center",
|
| 58 |
+
alignOffset = 0,
|
| 59 |
+
arrowPadding = 0,
|
| 60 |
+
avoidCollisions = true,
|
| 61 |
+
collisionBoundary = [],
|
| 62 |
+
collisionPadding: collisionPaddingProp = 0,
|
| 63 |
+
sticky = "partial",
|
| 64 |
+
hideWhenDetached = false,
|
| 65 |
+
updatePositionStrategy = "optimized",
|
| 66 |
+
onPlaced,
|
| 67 |
+
...contentProps
|
| 68 |
+
} = props;
|
| 69 |
+
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
| 70 |
+
const [content, setContent] = React.useState(null);
|
| 71 |
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
| 72 |
+
const [arrow, setArrow] = React.useState(null);
|
| 73 |
+
const arrowSize = useSize(arrow);
|
| 74 |
+
const arrowWidth = arrowSize?.width ?? 0;
|
| 75 |
+
const arrowHeight = arrowSize?.height ?? 0;
|
| 76 |
+
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
| 77 |
+
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
|
| 78 |
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
| 79 |
+
const hasExplicitBoundaries = boundary.length > 0;
|
| 80 |
+
const detectOverflowOptions = {
|
| 81 |
+
padding: collisionPadding,
|
| 82 |
+
boundary: boundary.filter(isNotNull),
|
| 83 |
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
| 84 |
+
altBoundary: hasExplicitBoundaries
|
| 85 |
+
};
|
| 86 |
+
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
| 87 |
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
| 88 |
+
strategy: "fixed",
|
| 89 |
+
placement: desiredPlacement,
|
| 90 |
+
whileElementsMounted: (...args) => {
|
| 91 |
+
const cleanup = autoUpdate(...args, {
|
| 92 |
+
animationFrame: updatePositionStrategy === "always"
|
| 93 |
+
});
|
| 94 |
+
return cleanup;
|
| 95 |
+
},
|
| 96 |
+
elements: {
|
| 97 |
+
reference: context.anchor
|
| 98 |
+
},
|
| 99 |
+
middleware: [
|
| 100 |
+
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
| 101 |
+
avoidCollisions && shift({
|
| 102 |
+
mainAxis: true,
|
| 103 |
+
crossAxis: false,
|
| 104 |
+
limiter: sticky === "partial" ? limitShift() : void 0,
|
| 105 |
+
...detectOverflowOptions
|
| 106 |
+
}),
|
| 107 |
+
avoidCollisions && flip({ ...detectOverflowOptions }),
|
| 108 |
+
size({
|
| 109 |
+
...detectOverflowOptions,
|
| 110 |
+
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
| 111 |
+
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
| 112 |
+
const contentStyle = elements.floating.style;
|
| 113 |
+
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
| 114 |
+
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
| 115 |
+
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
| 116 |
+
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
| 117 |
+
}
|
| 118 |
+
}),
|
| 119 |
+
arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),
|
| 120 |
+
transformOrigin({ arrowWidth, arrowHeight }),
|
| 121 |
+
hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
|
| 122 |
+
]
|
| 123 |
+
});
|
| 124 |
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
| 125 |
+
const handlePlaced = useCallbackRef(onPlaced);
|
| 126 |
+
useLayoutEffect(() => {
|
| 127 |
+
if (isPositioned) {
|
| 128 |
+
handlePlaced?.();
|
| 129 |
+
}
|
| 130 |
+
}, [isPositioned, handlePlaced]);
|
| 131 |
+
const arrowX = middlewareData.arrow?.x;
|
| 132 |
+
const arrowY = middlewareData.arrow?.y;
|
| 133 |
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
| 134 |
+
const [contentZIndex, setContentZIndex] = React.useState();
|
| 135 |
+
useLayoutEffect(() => {
|
| 136 |
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
| 137 |
+
}, [content]);
|
| 138 |
+
return /* @__PURE__ */ jsx(
|
| 139 |
+
"div",
|
| 140 |
+
{
|
| 141 |
+
ref: refs.setFloating,
|
| 142 |
+
"data-radix-popper-content-wrapper": "",
|
| 143 |
+
style: {
|
| 144 |
+
...floatingStyles,
|
| 145 |
+
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
| 146 |
+
// keep off the page when measuring
|
| 147 |
+
minWidth: "max-content",
|
| 148 |
+
zIndex: contentZIndex,
|
| 149 |
+
["--radix-popper-transform-origin"]: [
|
| 150 |
+
middlewareData.transformOrigin?.x,
|
| 151 |
+
middlewareData.transformOrigin?.y
|
| 152 |
+
].join(" "),
|
| 153 |
+
// hide the content if using the hide middleware and should be hidden
|
| 154 |
+
// set visibility to hidden and disable pointer events so the UI behaves
|
| 155 |
+
// as if the PopperContent isn't there at all
|
| 156 |
+
...middlewareData.hide?.referenceHidden && {
|
| 157 |
+
visibility: "hidden",
|
| 158 |
+
pointerEvents: "none"
|
| 159 |
+
}
|
| 160 |
+
},
|
| 161 |
+
dir: props.dir,
|
| 162 |
+
children: /* @__PURE__ */ jsx(
|
| 163 |
+
PopperContentProvider,
|
| 164 |
+
{
|
| 165 |
+
scope: __scopePopper,
|
| 166 |
+
placedSide,
|
| 167 |
+
onArrowChange: setArrow,
|
| 168 |
+
arrowX,
|
| 169 |
+
arrowY,
|
| 170 |
+
shouldHideArrow: cannotCenterArrow,
|
| 171 |
+
children: /* @__PURE__ */ jsx(
|
| 172 |
+
Primitive.div,
|
| 173 |
+
{
|
| 174 |
+
"data-side": placedSide,
|
| 175 |
+
"data-align": placedAlign,
|
| 176 |
+
...contentProps,
|
| 177 |
+
ref: composedRefs,
|
| 178 |
+
style: {
|
| 179 |
+
...contentProps.style,
|
| 180 |
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
| 181 |
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
| 182 |
+
animation: !isPositioned ? "none" : void 0
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
)
|
| 186 |
+
}
|
| 187 |
+
)
|
| 188 |
+
}
|
| 189 |
+
);
|
| 190 |
+
}
|
| 191 |
+
);
|
| 192 |
+
PopperContent.displayName = CONTENT_NAME;
|
| 193 |
+
var ARROW_NAME = "PopperArrow";
|
| 194 |
+
var OPPOSITE_SIDE = {
|
| 195 |
+
top: "bottom",
|
| 196 |
+
right: "left",
|
| 197 |
+
bottom: "top",
|
| 198 |
+
left: "right"
|
| 199 |
+
};
|
| 200 |
+
var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
| 201 |
+
const { __scopePopper, ...arrowProps } = props;
|
| 202 |
+
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
| 203 |
+
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
| 204 |
+
return (
|
| 205 |
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
| 206 |
+
// doesn't report size as we'd expect on SVG elements.
|
| 207 |
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
| 208 |
+
/* @__PURE__ */ jsx(
|
| 209 |
+
"span",
|
| 210 |
+
{
|
| 211 |
+
ref: contentContext.onArrowChange,
|
| 212 |
+
style: {
|
| 213 |
+
position: "absolute",
|
| 214 |
+
left: contentContext.arrowX,
|
| 215 |
+
top: contentContext.arrowY,
|
| 216 |
+
[baseSide]: 0,
|
| 217 |
+
transformOrigin: {
|
| 218 |
+
top: "",
|
| 219 |
+
right: "0 0",
|
| 220 |
+
bottom: "center 0",
|
| 221 |
+
left: "100% 0"
|
| 222 |
+
}[contentContext.placedSide],
|
| 223 |
+
transform: {
|
| 224 |
+
top: "translateY(100%)",
|
| 225 |
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
| 226 |
+
bottom: `rotate(180deg)`,
|
| 227 |
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
| 228 |
+
}[contentContext.placedSide],
|
| 229 |
+
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
| 230 |
+
},
|
| 231 |
+
children: /* @__PURE__ */ jsx(
|
| 232 |
+
ArrowPrimitive.Root,
|
| 233 |
+
{
|
| 234 |
+
...arrowProps,
|
| 235 |
+
ref: forwardedRef,
|
| 236 |
+
style: {
|
| 237 |
+
...arrowProps.style,
|
| 238 |
+
// ensures the element can be measured correctly (mostly for if SVG)
|
| 239 |
+
display: "block"
|
| 240 |
+
}
|
| 241 |
+
}
|
| 242 |
+
)
|
| 243 |
+
}
|
| 244 |
+
)
|
| 245 |
+
);
|
| 246 |
+
});
|
| 247 |
+
PopperArrow.displayName = ARROW_NAME;
|
| 248 |
+
function isNotNull(value) {
|
| 249 |
+
return value !== null;
|
| 250 |
+
}
|
| 251 |
+
var transformOrigin = (options) => ({
|
| 252 |
+
name: "transformOrigin",
|
| 253 |
+
options,
|
| 254 |
+
fn(data) {
|
| 255 |
+
const { placement, rects, middlewareData } = data;
|
| 256 |
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
| 257 |
+
const isArrowHidden = cannotCenterArrow;
|
| 258 |
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
| 259 |
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
| 260 |
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
| 261 |
+
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
| 262 |
+
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
| 263 |
+
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
| 264 |
+
let x = "";
|
| 265 |
+
let y = "";
|
| 266 |
+
if (placedSide === "bottom") {
|
| 267 |
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
| 268 |
+
y = `${-arrowHeight}px`;
|
| 269 |
+
} else if (placedSide === "top") {
|
| 270 |
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
| 271 |
+
y = `${rects.floating.height + arrowHeight}px`;
|
| 272 |
+
} else if (placedSide === "right") {
|
| 273 |
+
x = `${-arrowHeight}px`;
|
| 274 |
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
| 275 |
+
} else if (placedSide === "left") {
|
| 276 |
+
x = `${rects.floating.width + arrowHeight}px`;
|
| 277 |
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
| 278 |
+
}
|
| 279 |
+
return { data: { x, y } };
|
| 280 |
+
}
|
| 281 |
+
});
|
| 282 |
+
function getSideAndAlignFromPlacement(placement) {
|
| 283 |
+
const [side, align = "center"] = placement.split("-");
|
| 284 |
+
return [side, align];
|
| 285 |
+
}
|
| 286 |
+
var Root2 = Popper;
|
| 287 |
+
var Anchor = PopperAnchor;
|
| 288 |
+
var Content = PopperContent;
|
| 289 |
+
var Arrow = PopperArrow;
|
| 290 |
+
export {
|
| 291 |
+
ALIGN_OPTIONS,
|
| 292 |
+
Anchor,
|
| 293 |
+
Arrow,
|
| 294 |
+
Content,
|
| 295 |
+
Popper,
|
| 296 |
+
PopperAnchor,
|
| 297 |
+
PopperArrow,
|
| 298 |
+
PopperContent,
|
| 299 |
+
Root2 as Root,
|
| 300 |
+
SIDE_OPTIONS,
|
| 301 |
+
createPopperScope
|
| 302 |
+
};
|
| 303 |
+
//# sourceMappingURL=index.mjs.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-popper/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/popper.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size,\n} from '@floating-ui/react-dom';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useSize } from '@radix-ui/react-use-size';\n\nimport type { Placement, Middleware } from '@floating-ui/react-dom';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Measurable } from '@radix-ui/rect';\n\nconst SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const;\nconst ALIGN_OPTIONS = ['start', 'center', 'end'] as const;\n\ntype Side = (typeof SIDE_OPTIONS)[number];\ntype Align = (typeof ALIGN_OPTIONS)[number];\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n placedSide: Side;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n arrowX?: number;\n arrowY?: number;\n shouldHideArrow: boolean;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype Boundary = Element | null;\n\ntype PopperContentElement = React.ComponentRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n arrowPadding?: number;\n avoidCollisions?: boolean;\n collisionBoundary?: Boundary | Boundary[];\n collisionPadding?: number | Partial<Record<Side, number>>;\n sticky?: 'partial' | 'always';\n hideWhenDetached?: boolean;\n updatePositionStrategy?: 'optimized' | 'always';\n onPlaced?: () => void;\n}\n\nconst PopperContent = React.forwardRef<PopperContentElement, PopperContentProps>(\n (props: ScopedProps<PopperContentProps>, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset = 0,\n align = 'center',\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = 'partial',\n hideWhenDetached = false,\n updatePositionStrategy = 'optimized',\n onPlaced,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const [arrow, setArrow] = React.useState<HTMLSpanElement | null>(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n\n const desiredPlacement = (side + (align !== 'center' ? '-' + align : '')) as Placement;\n\n const collisionPadding =\n typeof collisionPaddingProp === 'number'\n ? collisionPaddingProp\n : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries,\n };\n\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: 'fixed',\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === 'always',\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor,\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === 'partial' ? limitShift() : undefined,\n ...detectOverflowOptions,\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);\n contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);\n contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);\n contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);\n },\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: 'referenceHidden', ...detectOverflowOptions }),\n ],\n });\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n\n const [contentZIndex, setContentZIndex] = React.useState<string>();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n return (\n <div\n ref={refs.setFloating}\n data-radix-popper-content-wrapper=\"\"\n style={{\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)', // keep off the page when measuring\n minWidth: 'max-content',\n zIndex: contentZIndex,\n ['--radix-popper-transform-origin' as any]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y,\n ].join(' '),\n\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...(middlewareData.hide?.referenceHidden && {\n visibility: 'hidden',\n pointerEvents: 'none',\n }),\n }}\n // Floating UI interally calculates logical alignment based the `dir` attribute on\n // the reference/floating node, we must add this attribute here to ensure\n // this is calculated when portalled as well as inline.\n dir={props.dir}\n >\n <PopperContentProvider\n scope={__scopePopper}\n placedSide={placedSide}\n onArrowChange={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n shouldHideArrow={cannotCenterArrow}\n >\n <Primitive.div\n data-side={placedSide}\n data-align={placedAlign}\n {...contentProps}\n ref={composedRefs}\n style={{\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? 'none' : undefined,\n }}\n />\n </PopperContentProvider>\n </div>\n );\n }\n);\n\nPopperContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopperArrow';\n\nconst OPPOSITE_SIDE: Record<Side, Side> = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n};\n\ntype PopperArrowElement = React.ComponentRef<typeof ArrowPrimitive.Root>;\ntype ArrowProps = React.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;\ninterface PopperArrowProps extends ArrowProps {}\n\nconst PopperArrow = React.forwardRef<PopperArrowElement, PopperArrowProps>(function PopperArrow(\n props: ScopedProps<PopperArrowProps>,\n forwardedRef\n) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n <span\n ref={contentContext.onArrowChange}\n style={{\n position: 'absolute',\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: '',\n right: '0 0',\n bottom: 'center 0',\n left: '100% 0',\n }[contentContext.placedSide],\n transform: {\n top: 'translateY(100%)',\n right: 'translateY(50%) rotate(90deg) translateX(-50%)',\n bottom: `rotate(180deg)`,\n left: 'translateY(50%) rotate(-90deg) translateX(50%)',\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? 'hidden' : undefined,\n }}\n >\n <ArrowPrimitive.Root\n {...arrowProps}\n ref={forwardedRef}\n style={{\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: 'block',\n }}\n />\n </span>\n );\n});\n\nPopperArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isNotNull<T>(value: T | null): value is T {\n return value !== null;\n}\n\nconst transformOrigin = (options: { arrowWidth: number; arrowHeight: number }): Middleware => ({\n name: 'transformOrigin',\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: '0%', center: '50%', end: '100%' }[placedAlign];\n\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n\n let x = '';\n let y = '';\n\n if (placedSide === 'bottom') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === 'top') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === 'right') {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === 'left') {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n },\n});\n\nfunction getSideAndAlignFromPlacement(placement: Placement) {\n const [side, align = 'center'] = placement.split('-');\n return [side as Side, align as Align] as const;\n}\n\nconst Root = Popper;\nconst Anchor = PopperAnchor;\nconst Content = PopperContent;\nconst Arrow = PopperArrow;\n\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n //\n SIDE_OPTIONS,\n ALIGN_OPTIONS,\n};\nexport type { PopperProps, PopperAnchorProps, PopperContentProps, PopperArrowProps };\n"],
|
| 5 |
+
"mappings": ";;;AAAA,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,OACK;AACP,YAAY,oBAAoB;AAChC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAkCpB;AA5BJ,IAAM,eAAe,CAAC,OAAO,SAAS,UAAU,MAAM;AACtD,IAAM,gBAAgB,CAAC,SAAS,UAAU,KAAK;AAS/C,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,iBAAiB,IAAI,mBAAmB,WAAW;AAM/E,IAAM,CAAC,gBAAgB,gBAAgB,IAAI,oBAAwC,WAAW;AAK9F,IAAM,SAAgC,CAAC,UAAoC;AACzE,QAAM,EAAE,eAAe,SAAS,IAAI;AACpC,QAAM,CAAC,QAAQ,SAAS,IAAU,eAA4B,IAAI;AAClE,SACE,oBAAC,kBAAe,OAAO,eAAe,QAAgB,gBAAgB,WACnE,UACH;AAEJ;AAEA,OAAO,cAAc;AAMrB,IAAM,cAAc;AAQpB,IAAM,eAAqB;AAAA,EACzB,CAAC,OAAuC,iBAAiB;AACvD,UAAM,EAAE,eAAe,YAAY,GAAG,YAA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|
| 6 |
+
"names": ["PopperArrow", "Root"]
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.d.mts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 3 |
+
|
| 4 |
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
| 5 |
+
interface PortalProps extends PrimitiveDivProps {
|
| 6 |
+
/**
|
| 7 |
+
* An optional container where the portaled content should be appended.
|
| 8 |
+
*/
|
| 9 |
+
container?: Element | DocumentFragment | null;
|
| 10 |
+
}
|
| 11 |
+
declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
|
| 12 |
+
declare const Root: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
|
| 13 |
+
|
| 14 |
+
export { Portal, type PortalProps, Root };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 3 |
+
|
| 4 |
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
| 5 |
+
interface PortalProps extends PrimitiveDivProps {
|
| 6 |
+
/**
|
| 7 |
+
* An optional container where the portaled content should be appended.
|
| 8 |
+
*/
|
| 9 |
+
container?: Element | DocumentFragment | null;
|
| 10 |
+
}
|
| 11 |
+
declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
|
| 12 |
+
declare const Root: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
|
| 13 |
+
|
| 14 |
+
export { Portal, type PortalProps, Root };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
"use client";
|
| 3 |
+
var __create = Object.create;
|
| 4 |
+
var __defProp = Object.defineProperty;
|
| 5 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 6 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 7 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 8 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 9 |
+
var __export = (target, all) => {
|
| 10 |
+
for (var name in all)
|
| 11 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 12 |
+
};
|
| 13 |
+
var __copyProps = (to, from, except, desc) => {
|
| 14 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 15 |
+
for (let key of __getOwnPropNames(from))
|
| 16 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 17 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 18 |
+
}
|
| 19 |
+
return to;
|
| 20 |
+
};
|
| 21 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 22 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 23 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 24 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 25 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 26 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 27 |
+
mod
|
| 28 |
+
));
|
| 29 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 30 |
+
|
| 31 |
+
// src/index.ts
|
| 32 |
+
var index_exports = {};
|
| 33 |
+
__export(index_exports, {
|
| 34 |
+
Portal: () => Portal,
|
| 35 |
+
Root: () => Root
|
| 36 |
+
});
|
| 37 |
+
module.exports = __toCommonJS(index_exports);
|
| 38 |
+
|
| 39 |
+
// src/portal.tsx
|
| 40 |
+
var React = __toESM(require("react"));
|
| 41 |
+
var import_react_dom = __toESM(require("react-dom"));
|
| 42 |
+
var import_react_primitive = require("@radix-ui/react-primitive");
|
| 43 |
+
var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect");
|
| 44 |
+
var import_jsx_runtime = require("react/jsx-runtime");
|
| 45 |
+
var PORTAL_NAME = "Portal";
|
| 46 |
+
var Portal = React.forwardRef((props, forwardedRef) => {
|
| 47 |
+
const { container: containerProp, ...portalProps } = props;
|
| 48 |
+
const [mounted, setMounted] = React.useState(false);
|
| 49 |
+
(0, import_react_use_layout_effect.useLayoutEffect)(() => setMounted(true), []);
|
| 50 |
+
const container = containerProp || mounted && globalThis?.document?.body;
|
| 51 |
+
return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
| 52 |
+
});
|
| 53 |
+
Portal.displayName = PORTAL_NAME;
|
| 54 |
+
var Root = Portal;
|
| 55 |
+
//# sourceMappingURL=index.js.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/portal.tsx"],
|
| 4 |
+
"sourcesContent": ["'use client';\nexport {\n Portal,\n //\n Root,\n} from './portal';\nexport type { PortalProps } from './portal';\n", "import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'Portal';\n\ntype PortalElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PortalProps extends PrimitiveDivProps {\n /**\n * An optional container where the portaled content should be appended.\n */\n container?: Element | DocumentFragment | null;\n}\n\nconst Portal = React.forwardRef<PortalElement, PortalProps>((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n return container\n ? ReactDOM.createPortal(<Primitive.div {...portalProps} ref={forwardedRef} />, container)\n : null;\n});\n\nPortal.displayName = PORTAL_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Portal;\n\nexport {\n Portal,\n //\n Root,\n};\nexport type { PortalProps };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqB;AACrB,6BAA0B;AAC1B,qCAAgC;AAuBJ;AAjB5B,IAAM,cAAc;AAWpB,IAAM,SAAe,iBAAuC,CAAC,OAAO,iBAAiB;AACnF,QAAM,EAAE,WAAW,eAAe,GAAG,YAAY,IAAI;AACrD,QAAM,CAAC,SAAS,UAAU,IAAU,eAAS,KAAK;AAClD,sDAAgB,MAAM,WAAW,IAAI,GAAG,CAAC,CAAC;AAC1C,QAAM,YAAY,iBAAkB,WAAW,YAAY,UAAU;AACrE,SAAO,YACH,iBAAAA,QAAS,aAAa,4CAAC,iCAAU,KAAV,EAAe,GAAG,aAAa,KAAK,cAAc,GAAI,SAAS,IACtF;AACN,CAAC;AAED,OAAO,cAAc;AAIrB,IAAM,OAAO;",
|
| 6 |
+
"names": ["ReactDOM"]
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
// src/portal.tsx
|
| 4 |
+
import * as React from "react";
|
| 5 |
+
import ReactDOM from "react-dom";
|
| 6 |
+
import { Primitive } from "@radix-ui/react-primitive";
|
| 7 |
+
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
| 8 |
+
import { jsx } from "react/jsx-runtime";
|
| 9 |
+
var PORTAL_NAME = "Portal";
|
| 10 |
+
var Portal = React.forwardRef((props, forwardedRef) => {
|
| 11 |
+
const { container: containerProp, ...portalProps } = props;
|
| 12 |
+
const [mounted, setMounted] = React.useState(false);
|
| 13 |
+
useLayoutEffect(() => setMounted(true), []);
|
| 14 |
+
const container = containerProp || mounted && globalThis?.document?.body;
|
| 15 |
+
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
| 16 |
+
});
|
| 17 |
+
Portal.displayName = PORTAL_NAME;
|
| 18 |
+
var Root = Portal;
|
| 19 |
+
export {
|
| 20 |
+
Portal,
|
| 21 |
+
Root
|
| 22 |
+
};
|
| 23 |
+
//# sourceMappingURL=index.mjs.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-portal/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/portal.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'Portal';\n\ntype PortalElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PortalProps extends PrimitiveDivProps {\n /**\n * An optional container where the portaled content should be appended.\n */\n container?: Element | DocumentFragment | null;\n}\n\nconst Portal = React.forwardRef<PortalElement, PortalProps>((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n return container\n ? ReactDOM.createPortal(<Primitive.div {...portalProps} ref={forwardedRef} />, container)\n : null;\n});\n\nPortal.displayName = PORTAL_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Portal;\n\nexport {\n Portal,\n //\n Root,\n};\nexport type { PortalProps };\n"],
|
| 5 |
+
"mappings": ";;;AAAA,YAAY,WAAW;AACvB,OAAO,cAAc;AACrB,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAuBJ;AAjB5B,IAAM,cAAc;AAWpB,IAAM,SAAe,iBAAuC,CAAC,OAAO,iBAAiB;AACnF,QAAM,EAAE,WAAW,eAAe,GAAG,YAAY,IAAI;AACrD,QAAM,CAAC,SAAS,UAAU,IAAU,eAAS,KAAK;AAClD,kBAAgB,MAAM,WAAW,IAAI,GAAG,CAAC,CAAC;AAC1C,QAAM,YAAY,iBAAkB,WAAW,YAAY,UAAU;AACrE,SAAO,YACH,SAAS,aAAa,oBAAC,UAAU,KAAV,EAAe,GAAG,aAAa,KAAK,cAAc,GAAI,SAAS,IACtF;AACN,CAAC;AAED,OAAO,cAAc;AAIrB,IAAM,OAAO;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
interface PresenceProps {
|
| 4 |
+
children: React.ReactElement | ((props: {
|
| 5 |
+
present: boolean;
|
| 6 |
+
}) => React.ReactElement);
|
| 7 |
+
present: boolean;
|
| 8 |
+
}
|
| 9 |
+
declare const Presence: React.FC<PresenceProps>;
|
| 10 |
+
declare const Root: React.FC<PresenceProps>;
|
| 11 |
+
|
| 12 |
+
export { Presence, type PresenceProps, Root };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
interface PresenceProps {
|
| 4 |
+
children: React.ReactElement | ((props: {
|
| 5 |
+
present: boolean;
|
| 6 |
+
}) => React.ReactElement);
|
| 7 |
+
present: boolean;
|
| 8 |
+
}
|
| 9 |
+
declare const Presence: React.FC<PresenceProps>;
|
| 10 |
+
declare const Root: React.FC<PresenceProps>;
|
| 11 |
+
|
| 12 |
+
export { Presence, type PresenceProps, Root };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
"use client";
|
| 3 |
+
var __create = Object.create;
|
| 4 |
+
var __defProp = Object.defineProperty;
|
| 5 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 6 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 7 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 8 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 9 |
+
var __export = (target, all) => {
|
| 10 |
+
for (var name in all)
|
| 11 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 12 |
+
};
|
| 13 |
+
var __copyProps = (to, from, except, desc) => {
|
| 14 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 15 |
+
for (let key of __getOwnPropNames(from))
|
| 16 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 17 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 18 |
+
}
|
| 19 |
+
return to;
|
| 20 |
+
};
|
| 21 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 22 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 23 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 24 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 25 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 26 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 27 |
+
mod
|
| 28 |
+
));
|
| 29 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 30 |
+
|
| 31 |
+
// src/index.ts
|
| 32 |
+
var index_exports = {};
|
| 33 |
+
__export(index_exports, {
|
| 34 |
+
Presence: () => Presence,
|
| 35 |
+
Root: () => Root
|
| 36 |
+
});
|
| 37 |
+
module.exports = __toCommonJS(index_exports);
|
| 38 |
+
|
| 39 |
+
// src/presence.tsx
|
| 40 |
+
var React2 = __toESM(require("react"));
|
| 41 |
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
| 42 |
+
var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect");
|
| 43 |
+
|
| 44 |
+
// src/use-state-machine.tsx
|
| 45 |
+
var React = __toESM(require("react"));
|
| 46 |
+
function useStateMachine(initialState, machine) {
|
| 47 |
+
return React.useReducer((state, event) => {
|
| 48 |
+
const nextState = machine[state][event];
|
| 49 |
+
return nextState ?? state;
|
| 50 |
+
}, initialState);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
// src/presence.tsx
|
| 54 |
+
var Presence = (props) => {
|
| 55 |
+
const { present, children } = props;
|
| 56 |
+
const presence = usePresence(present);
|
| 57 |
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children);
|
| 58 |
+
const ref = (0, import_react_compose_refs.useComposedRefs)(presence.ref, getElementRef(child));
|
| 59 |
+
const forceMount = typeof children === "function";
|
| 60 |
+
return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;
|
| 61 |
+
};
|
| 62 |
+
Presence.displayName = "Presence";
|
| 63 |
+
function usePresence(present) {
|
| 64 |
+
const [node, setNode] = React2.useState();
|
| 65 |
+
const stylesRef = React2.useRef(null);
|
| 66 |
+
const prevPresentRef = React2.useRef(present);
|
| 67 |
+
const prevAnimationNameRef = React2.useRef("none");
|
| 68 |
+
const initialState = present ? "mounted" : "unmounted";
|
| 69 |
+
const [state, send] = useStateMachine(initialState, {
|
| 70 |
+
mounted: {
|
| 71 |
+
UNMOUNT: "unmounted",
|
| 72 |
+
ANIMATION_OUT: "unmountSuspended"
|
| 73 |
+
},
|
| 74 |
+
unmountSuspended: {
|
| 75 |
+
MOUNT: "mounted",
|
| 76 |
+
ANIMATION_END: "unmounted"
|
| 77 |
+
},
|
| 78 |
+
unmounted: {
|
| 79 |
+
MOUNT: "mounted"
|
| 80 |
+
}
|
| 81 |
+
});
|
| 82 |
+
React2.useEffect(() => {
|
| 83 |
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
| 84 |
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
| 85 |
+
}, [state]);
|
| 86 |
+
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
|
| 87 |
+
const styles = stylesRef.current;
|
| 88 |
+
const wasPresent = prevPresentRef.current;
|
| 89 |
+
const hasPresentChanged = wasPresent !== present;
|
| 90 |
+
if (hasPresentChanged) {
|
| 91 |
+
const prevAnimationName = prevAnimationNameRef.current;
|
| 92 |
+
const currentAnimationName = getAnimationName(styles);
|
| 93 |
+
if (present) {
|
| 94 |
+
send("MOUNT");
|
| 95 |
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
| 96 |
+
send("UNMOUNT");
|
| 97 |
+
} else {
|
| 98 |
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
| 99 |
+
if (wasPresent && isAnimating) {
|
| 100 |
+
send("ANIMATION_OUT");
|
| 101 |
+
} else {
|
| 102 |
+
send("UNMOUNT");
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
prevPresentRef.current = present;
|
| 106 |
+
}
|
| 107 |
+
}, [present, send]);
|
| 108 |
+
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
|
| 109 |
+
if (node) {
|
| 110 |
+
let timeoutId;
|
| 111 |
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
| 112 |
+
const handleAnimationEnd = (event) => {
|
| 113 |
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
| 114 |
+
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
| 115 |
+
if (event.target === node && isCurrentAnimation) {
|
| 116 |
+
send("ANIMATION_END");
|
| 117 |
+
if (!prevPresentRef.current) {
|
| 118 |
+
const currentFillMode = node.style.animationFillMode;
|
| 119 |
+
node.style.animationFillMode = "forwards";
|
| 120 |
+
timeoutId = ownerWindow.setTimeout(() => {
|
| 121 |
+
if (node.style.animationFillMode === "forwards") {
|
| 122 |
+
node.style.animationFillMode = currentFillMode;
|
| 123 |
+
}
|
| 124 |
+
});
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
};
|
| 128 |
+
const handleAnimationStart = (event) => {
|
| 129 |
+
if (event.target === node) {
|
| 130 |
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
| 131 |
+
}
|
| 132 |
+
};
|
| 133 |
+
node.addEventListener("animationstart", handleAnimationStart);
|
| 134 |
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
| 135 |
+
node.addEventListener("animationend", handleAnimationEnd);
|
| 136 |
+
return () => {
|
| 137 |
+
ownerWindow.clearTimeout(timeoutId);
|
| 138 |
+
node.removeEventListener("animationstart", handleAnimationStart);
|
| 139 |
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
| 140 |
+
node.removeEventListener("animationend", handleAnimationEnd);
|
| 141 |
+
};
|
| 142 |
+
} else {
|
| 143 |
+
send("ANIMATION_END");
|
| 144 |
+
}
|
| 145 |
+
}, [node, send]);
|
| 146 |
+
return {
|
| 147 |
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
| 148 |
+
ref: React2.useCallback((node2) => {
|
| 149 |
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
| 150 |
+
setNode(node2);
|
| 151 |
+
}, [])
|
| 152 |
+
};
|
| 153 |
+
}
|
| 154 |
+
function getAnimationName(styles) {
|
| 155 |
+
return styles?.animationName || "none";
|
| 156 |
+
}
|
| 157 |
+
function getElementRef(element) {
|
| 158 |
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
| 159 |
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 160 |
+
if (mayWarn) {
|
| 161 |
+
return element.ref;
|
| 162 |
+
}
|
| 163 |
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
| 164 |
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 165 |
+
if (mayWarn) {
|
| 166 |
+
return element.props.ref;
|
| 167 |
+
}
|
| 168 |
+
return element.props.ref || element.ref;
|
| 169 |
+
}
|
| 170 |
+
var Root = Presence;
|
| 171 |
+
//# sourceMappingURL=index.js.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/presence.tsx", "../src/use-state-machine.tsx"],
|
| 4 |
+
"sourcesContent": ["'use client';\nexport { Presence, Root } from './presence';\nexport type { PresenceProps } from './presence';\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n stylesRef.current = node ? getComputedStyle(node) : null;\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles: CSSStyleDeclaration | null) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref<unknown> }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nconst Root = Presence;\n\nexport {\n Presence,\n //\n Root,\n};\nexport type { PresenceProps };\n", "import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;AACvB,gCAAgC;AAChC,qCAAgC;;;ACFhC,YAAuB;AAWhB,SAAS,gBACd,cACA,SACA;AACA,SAAa,iBAAW,CAAC,OAAwB,UAA4C;AAC3F,UAAM,YAAa,QAAQ,KAAK,EAAU,KAAK;AAC/C,WAAO,aAAa;AAAA,EACtB,GAAG,YAAY;AACjB;;;ADTA,IAAM,WAAoC,CAAC,UAAU;AACnD,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,QAAM,WAAW,YAAY,OAAO;AAEpC,QAAM,QACJ,OAAO,aAAa,aAChB,SAAS,EAAE,SAAS,SAAS,UAAU,CAAC,IAClC,gBAAS,KAAK,QAAQ;AAGlC,QAAM,UAAM,2CAAgB,SAAS,KAAK,cAAc,KAAK,CAAC;AAC9D,QAAM,aAAa,OAAO,aAAa;AACvC,SAAO,cAAc,SAAS,YAAkB,oBAAa,OAAO,EAAE,IAAI,CAAC,IAAI;AACjF;AAEA,SAAS,cAAc;AAMvB,SAAS,YAAY,SAAkB;AACrC,QAAM,CAAC,MAAM,OAAO,IAAU,gBAAsB;AACpD,QAAM,YAAkB,cAAmC,IAAI;AAC/D,QAAM,iBAAuB,cAAO,OAAO;AAC3C,QAAM,uBAA6B,cAAe,MAAM;AACxD,QAAM,eAAe,UAAU,YAAY;AAC3C,QAAM,CAAC,OAAO,IAAI,IAAI,gBAAgB,cAAc;AAAA,IAClD,SAAS;AAAA,MACP,SAAS;AAAA,MACT,eAAe;AAAA,IACjB;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAO;AAAA,MACP,eAAe;AAAA,IACjB;AAAA,IACA,WAAW;AAAA,MACT,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,EAAM,iBAAU,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AAqB,UAAU,iBAAiB,UAAU,OAAO;AAAA,QACnE;AAAA,MACF;AACA,WAAK,iBAAiB,kBAAkB,oBAAoB;AAC5D,WAAK,iBAAiB,mBAAmB,kBAAkB;AAC3D,WAAK,iBAAiB,gBAAgB,kBAAkB;AACxD,aAAO,MAAM;AACX,oBAAY,aAAa,SAAS;AAClC,aAAK,oBAAoB,kBAAkB,oBAAoB;AAC/D,aAAK,oBAAoB,mBAAmB,kBAAkB;AAC9D,aAAK,oBAAoB,gBAAgB,kBAAkB;AAAA,MAC7D;AAAA,IACF,OAAO;AAGL,WAAK,eAAe;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf,SAAO;AAAA,IACL,WAAW,CAAC,WAAW,kBAAkB,EAAE,SAAS,KAAK;AAAA,IACzD,KAAW,mBAAY,CAACC,UAAsB;AAC5C,gBAAU,UAAUA,QAAO,iBAAiBA,KAAI,IAAI;AACpD,cAAQA,KAAI;AAAA,IACd,GAAG,CAAC,CAAC;AAAA,EACP;AACF;AAIA,SAAS,iBAAiB,QAAoC;AAC5D,SAAO,QAAQ,iBAAiB;AAClC;AAOA,SAAS,cAAc,SAA2D;AAEhF,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAO,QAAQ,MAAM;AAAA,EACvB;AAGA,SAAO,QAAQ,MAAM,OAAQ,QAAgB;AAC/C;AAEA,IAAM,OAAO;",
|
| 6 |
+
"names": ["React", "node"]
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.mjs
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
// src/presence.tsx
|
| 4 |
+
import * as React2 from "react";
|
| 5 |
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
| 6 |
+
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
| 7 |
+
|
| 8 |
+
// src/use-state-machine.tsx
|
| 9 |
+
import * as React from "react";
|
| 10 |
+
function useStateMachine(initialState, machine) {
|
| 11 |
+
return React.useReducer((state, event) => {
|
| 12 |
+
const nextState = machine[state][event];
|
| 13 |
+
return nextState ?? state;
|
| 14 |
+
}, initialState);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
// src/presence.tsx
|
| 18 |
+
var Presence = (props) => {
|
| 19 |
+
const { present, children } = props;
|
| 20 |
+
const presence = usePresence(present);
|
| 21 |
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children);
|
| 22 |
+
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
| 23 |
+
const forceMount = typeof children === "function";
|
| 24 |
+
return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;
|
| 25 |
+
};
|
| 26 |
+
Presence.displayName = "Presence";
|
| 27 |
+
function usePresence(present) {
|
| 28 |
+
const [node, setNode] = React2.useState();
|
| 29 |
+
const stylesRef = React2.useRef(null);
|
| 30 |
+
const prevPresentRef = React2.useRef(present);
|
| 31 |
+
const prevAnimationNameRef = React2.useRef("none");
|
| 32 |
+
const initialState = present ? "mounted" : "unmounted";
|
| 33 |
+
const [state, send] = useStateMachine(initialState, {
|
| 34 |
+
mounted: {
|
| 35 |
+
UNMOUNT: "unmounted",
|
| 36 |
+
ANIMATION_OUT: "unmountSuspended"
|
| 37 |
+
},
|
| 38 |
+
unmountSuspended: {
|
| 39 |
+
MOUNT: "mounted",
|
| 40 |
+
ANIMATION_END: "unmounted"
|
| 41 |
+
},
|
| 42 |
+
unmounted: {
|
| 43 |
+
MOUNT: "mounted"
|
| 44 |
+
}
|
| 45 |
+
});
|
| 46 |
+
React2.useEffect(() => {
|
| 47 |
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
| 48 |
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
| 49 |
+
}, [state]);
|
| 50 |
+
useLayoutEffect(() => {
|
| 51 |
+
const styles = stylesRef.current;
|
| 52 |
+
const wasPresent = prevPresentRef.current;
|
| 53 |
+
const hasPresentChanged = wasPresent !== present;
|
| 54 |
+
if (hasPresentChanged) {
|
| 55 |
+
const prevAnimationName = prevAnimationNameRef.current;
|
| 56 |
+
const currentAnimationName = getAnimationName(styles);
|
| 57 |
+
if (present) {
|
| 58 |
+
send("MOUNT");
|
| 59 |
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
| 60 |
+
send("UNMOUNT");
|
| 61 |
+
} else {
|
| 62 |
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
| 63 |
+
if (wasPresent && isAnimating) {
|
| 64 |
+
send("ANIMATION_OUT");
|
| 65 |
+
} else {
|
| 66 |
+
send("UNMOUNT");
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
prevPresentRef.current = present;
|
| 70 |
+
}
|
| 71 |
+
}, [present, send]);
|
| 72 |
+
useLayoutEffect(() => {
|
| 73 |
+
if (node) {
|
| 74 |
+
let timeoutId;
|
| 75 |
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
| 76 |
+
const handleAnimationEnd = (event) => {
|
| 77 |
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
| 78 |
+
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
| 79 |
+
if (event.target === node && isCurrentAnimation) {
|
| 80 |
+
send("ANIMATION_END");
|
| 81 |
+
if (!prevPresentRef.current) {
|
| 82 |
+
const currentFillMode = node.style.animationFillMode;
|
| 83 |
+
node.style.animationFillMode = "forwards";
|
| 84 |
+
timeoutId = ownerWindow.setTimeout(() => {
|
| 85 |
+
if (node.style.animationFillMode === "forwards") {
|
| 86 |
+
node.style.animationFillMode = currentFillMode;
|
| 87 |
+
}
|
| 88 |
+
});
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
};
|
| 92 |
+
const handleAnimationStart = (event) => {
|
| 93 |
+
if (event.target === node) {
|
| 94 |
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
| 95 |
+
}
|
| 96 |
+
};
|
| 97 |
+
node.addEventListener("animationstart", handleAnimationStart);
|
| 98 |
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
| 99 |
+
node.addEventListener("animationend", handleAnimationEnd);
|
| 100 |
+
return () => {
|
| 101 |
+
ownerWindow.clearTimeout(timeoutId);
|
| 102 |
+
node.removeEventListener("animationstart", handleAnimationStart);
|
| 103 |
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
| 104 |
+
node.removeEventListener("animationend", handleAnimationEnd);
|
| 105 |
+
};
|
| 106 |
+
} else {
|
| 107 |
+
send("ANIMATION_END");
|
| 108 |
+
}
|
| 109 |
+
}, [node, send]);
|
| 110 |
+
return {
|
| 111 |
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
| 112 |
+
ref: React2.useCallback((node2) => {
|
| 113 |
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
| 114 |
+
setNode(node2);
|
| 115 |
+
}, [])
|
| 116 |
+
};
|
| 117 |
+
}
|
| 118 |
+
function getAnimationName(styles) {
|
| 119 |
+
return styles?.animationName || "none";
|
| 120 |
+
}
|
| 121 |
+
function getElementRef(element) {
|
| 122 |
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
| 123 |
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 124 |
+
if (mayWarn) {
|
| 125 |
+
return element.ref;
|
| 126 |
+
}
|
| 127 |
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
| 128 |
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 129 |
+
if (mayWarn) {
|
| 130 |
+
return element.props.ref;
|
| 131 |
+
}
|
| 132 |
+
return element.props.ref || element.ref;
|
| 133 |
+
}
|
| 134 |
+
var Root = Presence;
|
| 135 |
+
export {
|
| 136 |
+
Presence,
|
| 137 |
+
Root
|
| 138 |
+
};
|
| 139 |
+
//# sourceMappingURL=index.mjs.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-presence/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/presence.tsx", "../src/use-state-machine.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n stylesRef.current = node ? getComputedStyle(node) : null;\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles: CSSStyleDeclaration | null) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref<unknown> }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nconst Root = Presence;\n\nexport {\n Presence,\n //\n Root,\n};\nexport type { PresenceProps };\n", "import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n"],
|
| 5 |
+
"mappings": ";;;AAAA,YAAYA,YAAW;AACvB,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;;;ACFhC,YAAY,WAAW;AAWhB,SAAS,gBACd,cACA,SACA;AACA,SAAa,iBAAW,CAAC,OAAwB,UAA4C;AAC3F,UAAM,YAAa,QAAQ,KAAK,EAAU,KAAK;AAC/C,WAAO,aAAa;AAAA,EACtB,GAAG,YAAY;AACjB;;;ADTA,IAAM,WAAoC,CAAC,UAAU;AACnD,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,QAAM,WAAW,YAAY,OAAO;AAEpC,QAAM,QACJ,OAAO,aAAa,aAChB,SAAS,EAAE,SAAS,SAAS,UAAU,CAAC,IAClC,gBAAS,KAAK,QAAQ;AAGlC,QAAM,MAAM,gBAAgB,SAAS,KAAK,cAAc,KAAK,CAAC;AAC9D,QAAM,aAAa,OAAO,aAAa;AACvC,SAAO,cAAc,SAAS,YAAkB,oBAAa,OAAO,EAAE,IAAI,CAAC,IAAI;AACjF;AAEA,SAAS,cAAc;AAMvB,SAAS,YAAY,SAAkB;AACrC,QAAM,CAAC,MAAM,OAAO,IAAU,gBAAsB;AACpD,QAAM,YAAkB,cA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AQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAO,QAAQ,MAAM;AAAA,EACvB;AAGA,SAAO,QAAQ,MAAM,OAAQ,QAAgB;AAC/C;AAEA,IAAM,OAAO;",
|
| 6 |
+
"names": ["React", "node"]
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.d.mts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
declare const NODES: readonly ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul"];
|
| 4 |
+
type Primitives = {
|
| 5 |
+
[E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E>;
|
| 6 |
+
};
|
| 7 |
+
type PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {
|
| 8 |
+
asChild?: boolean;
|
| 9 |
+
};
|
| 10 |
+
interface PrimitiveForwardRefComponent<E extends React.ElementType> extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {
|
| 11 |
+
}
|
| 12 |
+
declare const Primitive: Primitives;
|
| 13 |
+
/**
|
| 14 |
+
* Flush custom event dispatch
|
| 15 |
+
* https://github.com/radix-ui/primitives/pull/1378
|
| 16 |
+
*
|
| 17 |
+
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
|
| 18 |
+
*
|
| 19 |
+
* Internally, React prioritises events in the following order:
|
| 20 |
+
* - discrete
|
| 21 |
+
* - continuous
|
| 22 |
+
* - default
|
| 23 |
+
*
|
| 24 |
+
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
|
| 25 |
+
*
|
| 26 |
+
* `discrete` is an important distinction as updates within these events are applied immediately.
|
| 27 |
+
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
|
| 28 |
+
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
|
| 29 |
+
* dispatched by another `discrete` event.
|
| 30 |
+
*
|
| 31 |
+
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
|
| 32 |
+
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
|
| 33 |
+
* is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
|
| 34 |
+
* For example:
|
| 35 |
+
*
|
| 36 |
+
* dispatching a known click 👎
|
| 37 |
+
* target.dispatchEvent(new Event(‘click’))
|
| 38 |
+
*
|
| 39 |
+
* dispatching a custom type within a non-discrete event 👎
|
| 40 |
+
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
|
| 41 |
+
*
|
| 42 |
+
* dispatching a custom type within a `discrete` event 👍
|
| 43 |
+
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
|
| 44 |
+
*
|
| 45 |
+
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
| 46 |
+
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
| 47 |
+
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
| 48 |
+
*/
|
| 49 |
+
declare function dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E): void;
|
| 50 |
+
declare const Root: Primitives;
|
| 51 |
+
|
| 52 |
+
export { Primitive, type PrimitivePropsWithRef, Root, dispatchDiscreteCustomEvent };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
declare const NODES: readonly ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul"];
|
| 4 |
+
type Primitives = {
|
| 5 |
+
[E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E>;
|
| 6 |
+
};
|
| 7 |
+
type PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {
|
| 8 |
+
asChild?: boolean;
|
| 9 |
+
};
|
| 10 |
+
interface PrimitiveForwardRefComponent<E extends React.ElementType> extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {
|
| 11 |
+
}
|
| 12 |
+
declare const Primitive: Primitives;
|
| 13 |
+
/**
|
| 14 |
+
* Flush custom event dispatch
|
| 15 |
+
* https://github.com/radix-ui/primitives/pull/1378
|
| 16 |
+
*
|
| 17 |
+
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
|
| 18 |
+
*
|
| 19 |
+
* Internally, React prioritises events in the following order:
|
| 20 |
+
* - discrete
|
| 21 |
+
* - continuous
|
| 22 |
+
* - default
|
| 23 |
+
*
|
| 24 |
+
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
|
| 25 |
+
*
|
| 26 |
+
* `discrete` is an important distinction as updates within these events are applied immediately.
|
| 27 |
+
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
|
| 28 |
+
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
|
| 29 |
+
* dispatched by another `discrete` event.
|
| 30 |
+
*
|
| 31 |
+
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
|
| 32 |
+
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
|
| 33 |
+
* is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
|
| 34 |
+
* For example:
|
| 35 |
+
*
|
| 36 |
+
* dispatching a known click 👎
|
| 37 |
+
* target.dispatchEvent(new Event(‘click’))
|
| 38 |
+
*
|
| 39 |
+
* dispatching a custom type within a non-discrete event 👎
|
| 40 |
+
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
|
| 41 |
+
*
|
| 42 |
+
* dispatching a custom type within a `discrete` event 👍
|
| 43 |
+
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
|
| 44 |
+
*
|
| 45 |
+
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
| 46 |
+
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
| 47 |
+
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
| 48 |
+
*/
|
| 49 |
+
declare function dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E): void;
|
| 50 |
+
declare const Root: Primitives;
|
| 51 |
+
|
| 52 |
+
export { Primitive, type PrimitivePropsWithRef, Root, dispatchDiscreteCustomEvent };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __export = (target, all) => {
|
| 9 |
+
for (var name in all)
|
| 10 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 11 |
+
};
|
| 12 |
+
var __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 16 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 17 |
+
}
|
| 18 |
+
return to;
|
| 19 |
+
};
|
| 20 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 21 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 22 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 23 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 24 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 25 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 26 |
+
mod
|
| 27 |
+
));
|
| 28 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 29 |
+
|
| 30 |
+
// src/index.ts
|
| 31 |
+
var index_exports = {};
|
| 32 |
+
__export(index_exports, {
|
| 33 |
+
Primitive: () => Primitive,
|
| 34 |
+
Root: () => Root,
|
| 35 |
+
dispatchDiscreteCustomEvent: () => dispatchDiscreteCustomEvent
|
| 36 |
+
});
|
| 37 |
+
module.exports = __toCommonJS(index_exports);
|
| 38 |
+
|
| 39 |
+
// src/primitive.tsx
|
| 40 |
+
var React = __toESM(require("react"));
|
| 41 |
+
var ReactDOM = __toESM(require("react-dom"));
|
| 42 |
+
var import_react_slot = require("@radix-ui/react-slot");
|
| 43 |
+
var import_jsx_runtime = require("react/jsx-runtime");
|
| 44 |
+
var NODES = [
|
| 45 |
+
"a",
|
| 46 |
+
"button",
|
| 47 |
+
"div",
|
| 48 |
+
"form",
|
| 49 |
+
"h2",
|
| 50 |
+
"h3",
|
| 51 |
+
"img",
|
| 52 |
+
"input",
|
| 53 |
+
"label",
|
| 54 |
+
"li",
|
| 55 |
+
"nav",
|
| 56 |
+
"ol",
|
| 57 |
+
"p",
|
| 58 |
+
"select",
|
| 59 |
+
"span",
|
| 60 |
+
"svg",
|
| 61 |
+
"ul"
|
| 62 |
+
];
|
| 63 |
+
var Primitive = NODES.reduce((primitive, node) => {
|
| 64 |
+
const Slot = (0, import_react_slot.createSlot)(`Primitive.${node}`);
|
| 65 |
+
const Node = React.forwardRef((props, forwardedRef) => {
|
| 66 |
+
const { asChild, ...primitiveProps } = props;
|
| 67 |
+
const Comp = asChild ? Slot : node;
|
| 68 |
+
if (typeof window !== "undefined") {
|
| 69 |
+
window[Symbol.for("radix-ui")] = true;
|
| 70 |
+
}
|
| 71 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
|
| 72 |
+
});
|
| 73 |
+
Node.displayName = `Primitive.${node}`;
|
| 74 |
+
return { ...primitive, [node]: Node };
|
| 75 |
+
}, {});
|
| 76 |
+
function dispatchDiscreteCustomEvent(target, event) {
|
| 77 |
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
| 78 |
+
}
|
| 79 |
+
var Root = Primitive;
|
| 80 |
+
//# sourceMappingURL=index.js.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/primitive.tsx"],
|
| 4 |
+
"sourcesContent": ["export {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n} from './primitive';\nexport type { PrimitivePropsWithRef } from './primitive';\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSlot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'select',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click \uD83D\uDC4E\n * target.dispatchEvent(new Event(\u2018click\u2019))\n *\n * dispatching a custom type within a non-discrete event \uD83D\uDC4E\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(\u2018customType\u2019))}\n *\n * dispatching a custom type within a `discrete` event \uD83D\uDC4D\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(\u2018customType\u2019))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,eAA0B;AAC1B,wBAA2B;AA4ChB;AA1CX,IAAM,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAcA,IAAM,YAAY,MAAM,OAAO,CAAC,WAAW,SAAS;AAClD,QAAM,WAAO,8BAAW,aAAa,IAAI,EAAE;AAC3C,QAAM,OAAa,iBAAW,CAAC,OAA2C,iBAAsB;AAC9F,UAAM,EAAE,SAAS,GAAG,eAAe,IAAI;AACvC,UAAM,OAAY,UAAU,OAAO;AAEnC,QAAI,OAAO,WAAW,aAAa;AACjC,MAAC,OAAe,OAAO,IAAI,UAAU,CAAC,IAAI;AAAA,IAC5C;AAEA,WAAO,4CAAC,QAAM,GAAG,gBAAgB,KAAK,cAAc;AAAA,EACtD,CAAC;AAED,OAAK,cAAc,aAAa,IAAI;AAEpC,SAAO,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,KAAK;AACtC,GAAG,CAAC,CAAe;AA2CnB,SAAS,4BAAmD,QAAqB,OAAU;AACzF,MAAI,OAAQ,CAAS,mBAAU,MAAM,OAAO,cAAc,KAAK,CAAC;AAClE;AAIA,IAAM,OAAO;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// src/primitive.tsx
|
| 2 |
+
import * as React from "react";
|
| 3 |
+
import * as ReactDOM from "react-dom";
|
| 4 |
+
import { createSlot } from "@radix-ui/react-slot";
|
| 5 |
+
import { jsx } from "react/jsx-runtime";
|
| 6 |
+
var NODES = [
|
| 7 |
+
"a",
|
| 8 |
+
"button",
|
| 9 |
+
"div",
|
| 10 |
+
"form",
|
| 11 |
+
"h2",
|
| 12 |
+
"h3",
|
| 13 |
+
"img",
|
| 14 |
+
"input",
|
| 15 |
+
"label",
|
| 16 |
+
"li",
|
| 17 |
+
"nav",
|
| 18 |
+
"ol",
|
| 19 |
+
"p",
|
| 20 |
+
"select",
|
| 21 |
+
"span",
|
| 22 |
+
"svg",
|
| 23 |
+
"ul"
|
| 24 |
+
];
|
| 25 |
+
var Primitive = NODES.reduce((primitive, node) => {
|
| 26 |
+
const Slot = createSlot(`Primitive.${node}`);
|
| 27 |
+
const Node = React.forwardRef((props, forwardedRef) => {
|
| 28 |
+
const { asChild, ...primitiveProps } = props;
|
| 29 |
+
const Comp = asChild ? Slot : node;
|
| 30 |
+
if (typeof window !== "undefined") {
|
| 31 |
+
window[Symbol.for("radix-ui")] = true;
|
| 32 |
+
}
|
| 33 |
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
| 34 |
+
});
|
| 35 |
+
Node.displayName = `Primitive.${node}`;
|
| 36 |
+
return { ...primitive, [node]: Node };
|
| 37 |
+
}, {});
|
| 38 |
+
function dispatchDiscreteCustomEvent(target, event) {
|
| 39 |
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
| 40 |
+
}
|
| 41 |
+
var Root = Primitive;
|
| 42 |
+
export {
|
| 43 |
+
Primitive,
|
| 44 |
+
Root,
|
| 45 |
+
dispatchDiscreteCustomEvent
|
| 46 |
+
};
|
| 47 |
+
//# sourceMappingURL=index.mjs.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-primitive/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/primitive.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSlot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'select',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click \uD83D\uDC4E\n * target.dispatchEvent(new Event(\u2018click\u2019))\n *\n * dispatching a custom type within a non-discrete event \uD83D\uDC4E\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(\u2018customType\u2019))}\n *\n * dispatching a custom type within a `discrete` event \uD83D\uDC4D\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(\u2018customType\u2019))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n"],
|
| 5 |
+
"mappings": ";AAAA,YAAY,WAAW;AACvB,YAAY,cAAc;AAC1B,SAAS,kBAAkB;AA4ChB;AA1CX,IAAM,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAcA,IAAM,YAAY,MAAM,OAAO,CAAC,WAAW,SAAS;AAClD,QAAM,OAAO,WAAW,aAAa,IAAI,EAAE;AAC3C,QAAM,OAAa,iBAAW,CAAC,OAA2C,iBAAsB;AAC9F,UAAM,EAAE,SAAS,GAAG,eAAe,IAAI;AACvC,UAAM,OAAY,UAAU,OAAO;AAEnC,QAAI,OAAO,WAAW,aAAa;AACjC,MAAC,OAAe,OAAO,IAAI,UAAU,CAAC,IAAI;AAAA,IAC5C;AAEA,WAAO,oBAAC,QAAM,GAAG,gBAAgB,KAAK,cAAc;AAAA,EACtD,CAAC;AAED,OAAK,cAAc,aAAa,IAAI;AAEpC,SAAO,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,KAAK;AACtC,GAAG,CAAC,CAAe;AA2CnB,SAAS,4BAAmD,QAAqB,OAAU;AACzF,MAAI,OAAQ,CAAS,mBAAU,MAAM,OAAO,cAAc,KAAK,CAAC;AAClE;AAIA,IAAM,OAAO;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
| 4 |
+
children?: React.ReactNode;
|
| 5 |
+
}
|
| 6 |
+
declare function createSlot(ownerName: string): React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
| 7 |
+
declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
| 8 |
+
interface SlottableProps {
|
| 9 |
+
children: React.ReactNode;
|
| 10 |
+
}
|
| 11 |
+
interface SlottableComponent extends React.FC<SlottableProps> {
|
| 12 |
+
__radixId: symbol;
|
| 13 |
+
}
|
| 14 |
+
declare function createSlottable(ownerName: string): SlottableComponent;
|
| 15 |
+
declare const Slottable: SlottableComponent;
|
| 16 |
+
|
| 17 |
+
export { Slot as Root, Slot, type SlotProps, Slottable, createSlot, createSlottable };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
| 4 |
+
children?: React.ReactNode;
|
| 5 |
+
}
|
| 6 |
+
declare function createSlot(ownerName: string): React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
| 7 |
+
declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
| 8 |
+
interface SlottableProps {
|
| 9 |
+
children: React.ReactNode;
|
| 10 |
+
}
|
| 11 |
+
interface SlottableComponent extends React.FC<SlottableProps> {
|
| 12 |
+
__radixId: symbol;
|
| 13 |
+
}
|
| 14 |
+
declare function createSlottable(ownerName: string): SlottableComponent;
|
| 15 |
+
declare const Slottable: SlottableComponent;
|
| 16 |
+
|
| 17 |
+
export { Slot as Root, Slot, type SlotProps, Slottable, createSlot, createSlottable };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __export = (target, all) => {
|
| 9 |
+
for (var name in all)
|
| 10 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 11 |
+
};
|
| 12 |
+
var __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 16 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 17 |
+
}
|
| 18 |
+
return to;
|
| 19 |
+
};
|
| 20 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 21 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 22 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 23 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 24 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 25 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 26 |
+
mod
|
| 27 |
+
));
|
| 28 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 29 |
+
|
| 30 |
+
// src/index.ts
|
| 31 |
+
var index_exports = {};
|
| 32 |
+
__export(index_exports, {
|
| 33 |
+
Root: () => Slot,
|
| 34 |
+
Slot: () => Slot,
|
| 35 |
+
Slottable: () => Slottable,
|
| 36 |
+
createSlot: () => createSlot,
|
| 37 |
+
createSlottable: () => createSlottable
|
| 38 |
+
});
|
| 39 |
+
module.exports = __toCommonJS(index_exports);
|
| 40 |
+
|
| 41 |
+
// src/slot.tsx
|
| 42 |
+
var React = __toESM(require("react"));
|
| 43 |
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
| 44 |
+
var import_jsx_runtime = require("react/jsx-runtime");
|
| 45 |
+
// @__NO_SIDE_EFFECTS__
|
| 46 |
+
function createSlot(ownerName) {
|
| 47 |
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
| 48 |
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
| 49 |
+
const { children, ...slotProps } = props;
|
| 50 |
+
const childrenArray = React.Children.toArray(children);
|
| 51 |
+
const slottable = childrenArray.find(isSlottable);
|
| 52 |
+
if (slottable) {
|
| 53 |
+
const newElement = slottable.props.children;
|
| 54 |
+
const newChildren = childrenArray.map((child) => {
|
| 55 |
+
if (child === slottable) {
|
| 56 |
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
| 57 |
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
| 58 |
+
} else {
|
| 59 |
+
return child;
|
| 60 |
+
}
|
| 61 |
+
});
|
| 62 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
| 63 |
+
}
|
| 64 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
| 65 |
+
});
|
| 66 |
+
Slot2.displayName = `${ownerName}.Slot`;
|
| 67 |
+
return Slot2;
|
| 68 |
+
}
|
| 69 |
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
| 70 |
+
// @__NO_SIDE_EFFECTS__
|
| 71 |
+
function createSlotClone(ownerName) {
|
| 72 |
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
| 73 |
+
const { children, ...slotProps } = props;
|
| 74 |
+
if (React.isValidElement(children)) {
|
| 75 |
+
const childrenRef = getElementRef(children);
|
| 76 |
+
const props2 = mergeProps(slotProps, children.props);
|
| 77 |
+
if (children.type !== React.Fragment) {
|
| 78 |
+
props2.ref = forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : childrenRef;
|
| 79 |
+
}
|
| 80 |
+
return React.cloneElement(children, props2);
|
| 81 |
+
}
|
| 82 |
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
| 83 |
+
});
|
| 84 |
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
| 85 |
+
return SlotClone;
|
| 86 |
+
}
|
| 87 |
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
| 88 |
+
// @__NO_SIDE_EFFECTS__
|
| 89 |
+
function createSlottable(ownerName) {
|
| 90 |
+
const Slottable2 = ({ children }) => {
|
| 91 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
| 92 |
+
};
|
| 93 |
+
Slottable2.displayName = `${ownerName}.Slottable`;
|
| 94 |
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
| 95 |
+
return Slottable2;
|
| 96 |
+
}
|
| 97 |
+
var Slottable = /* @__PURE__ */ createSlottable("Slottable");
|
| 98 |
+
function isSlottable(child) {
|
| 99 |
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
| 100 |
+
}
|
| 101 |
+
function mergeProps(slotProps, childProps) {
|
| 102 |
+
const overrideProps = { ...childProps };
|
| 103 |
+
for (const propName in childProps) {
|
| 104 |
+
const slotPropValue = slotProps[propName];
|
| 105 |
+
const childPropValue = childProps[propName];
|
| 106 |
+
const isHandler = /^on[A-Z]/.test(propName);
|
| 107 |
+
if (isHandler) {
|
| 108 |
+
if (slotPropValue && childPropValue) {
|
| 109 |
+
overrideProps[propName] = (...args) => {
|
| 110 |
+
const result = childPropValue(...args);
|
| 111 |
+
slotPropValue(...args);
|
| 112 |
+
return result;
|
| 113 |
+
};
|
| 114 |
+
} else if (slotPropValue) {
|
| 115 |
+
overrideProps[propName] = slotPropValue;
|
| 116 |
+
}
|
| 117 |
+
} else if (propName === "style") {
|
| 118 |
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
| 119 |
+
} else if (propName === "className") {
|
| 120 |
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
return { ...slotProps, ...overrideProps };
|
| 124 |
+
}
|
| 125 |
+
function getElementRef(element) {
|
| 126 |
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
| 127 |
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 128 |
+
if (mayWarn) {
|
| 129 |
+
return element.ref;
|
| 130 |
+
}
|
| 131 |
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
| 132 |
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 133 |
+
if (mayWarn) {
|
| 134 |
+
return element.props.ref;
|
| 135 |
+
}
|
| 136 |
+
return element.props.ref || element.ref;
|
| 137 |
+
}
|
| 138 |
+
//# sourceMappingURL=index.js.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/slot.tsx"],
|
| 4 |
+
"sourcesContent": ["export {\n Slot,\n Slottable,\n //\n Root,\n createSlot,\n createSlottable,\n} from './slot';\nexport type { SlotProps } from './slot';\n", "import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,gCAA4B;AAmCpB;AAAA;AAzB0B,SAAS,WAAW,WAAmB;AACvE,QAAM,YAAY,gCAAgB,SAAS;AAC3C,QAA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,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAQ,QAAQ,MAAuC;AAAA,EACzD;AAGA,SAAQ,QAAQ,MAAuC,OAAQ,QAAgB;AACjF;",
|
| 6 |
+
"names": ["Slot", "props", "Slottable"]
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.mjs
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// src/slot.tsx
|
| 2 |
+
import * as React from "react";
|
| 3 |
+
import { composeRefs } from "@radix-ui/react-compose-refs";
|
| 4 |
+
import { Fragment as Fragment2, jsx } from "react/jsx-runtime";
|
| 5 |
+
// @__NO_SIDE_EFFECTS__
|
| 6 |
+
function createSlot(ownerName) {
|
| 7 |
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
| 8 |
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
| 9 |
+
const { children, ...slotProps } = props;
|
| 10 |
+
const childrenArray = React.Children.toArray(children);
|
| 11 |
+
const slottable = childrenArray.find(isSlottable);
|
| 12 |
+
if (slottable) {
|
| 13 |
+
const newElement = slottable.props.children;
|
| 14 |
+
const newChildren = childrenArray.map((child) => {
|
| 15 |
+
if (child === slottable) {
|
| 16 |
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
| 17 |
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
| 18 |
+
} else {
|
| 19 |
+
return child;
|
| 20 |
+
}
|
| 21 |
+
});
|
| 22 |
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
| 23 |
+
}
|
| 24 |
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
| 25 |
+
});
|
| 26 |
+
Slot2.displayName = `${ownerName}.Slot`;
|
| 27 |
+
return Slot2;
|
| 28 |
+
}
|
| 29 |
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
| 30 |
+
// @__NO_SIDE_EFFECTS__
|
| 31 |
+
function createSlotClone(ownerName) {
|
| 32 |
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
| 33 |
+
const { children, ...slotProps } = props;
|
| 34 |
+
if (React.isValidElement(children)) {
|
| 35 |
+
const childrenRef = getElementRef(children);
|
| 36 |
+
const props2 = mergeProps(slotProps, children.props);
|
| 37 |
+
if (children.type !== React.Fragment) {
|
| 38 |
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
| 39 |
+
}
|
| 40 |
+
return React.cloneElement(children, props2);
|
| 41 |
+
}
|
| 42 |
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
| 43 |
+
});
|
| 44 |
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
| 45 |
+
return SlotClone;
|
| 46 |
+
}
|
| 47 |
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
| 48 |
+
// @__NO_SIDE_EFFECTS__
|
| 49 |
+
function createSlottable(ownerName) {
|
| 50 |
+
const Slottable2 = ({ children }) => {
|
| 51 |
+
return /* @__PURE__ */ jsx(Fragment2, { children });
|
| 52 |
+
};
|
| 53 |
+
Slottable2.displayName = `${ownerName}.Slottable`;
|
| 54 |
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
| 55 |
+
return Slottable2;
|
| 56 |
+
}
|
| 57 |
+
var Slottable = /* @__PURE__ */ createSlottable("Slottable");
|
| 58 |
+
function isSlottable(child) {
|
| 59 |
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
| 60 |
+
}
|
| 61 |
+
function mergeProps(slotProps, childProps) {
|
| 62 |
+
const overrideProps = { ...childProps };
|
| 63 |
+
for (const propName in childProps) {
|
| 64 |
+
const slotPropValue = slotProps[propName];
|
| 65 |
+
const childPropValue = childProps[propName];
|
| 66 |
+
const isHandler = /^on[A-Z]/.test(propName);
|
| 67 |
+
if (isHandler) {
|
| 68 |
+
if (slotPropValue && childPropValue) {
|
| 69 |
+
overrideProps[propName] = (...args) => {
|
| 70 |
+
const result = childPropValue(...args);
|
| 71 |
+
slotPropValue(...args);
|
| 72 |
+
return result;
|
| 73 |
+
};
|
| 74 |
+
} else if (slotPropValue) {
|
| 75 |
+
overrideProps[propName] = slotPropValue;
|
| 76 |
+
}
|
| 77 |
+
} else if (propName === "style") {
|
| 78 |
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
| 79 |
+
} else if (propName === "className") {
|
| 80 |
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
return { ...slotProps, ...overrideProps };
|
| 84 |
+
}
|
| 85 |
+
function getElementRef(element) {
|
| 86 |
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
| 87 |
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 88 |
+
if (mayWarn) {
|
| 89 |
+
return element.ref;
|
| 90 |
+
}
|
| 91 |
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
| 92 |
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 93 |
+
if (mayWarn) {
|
| 94 |
+
return element.props.ref;
|
| 95 |
+
}
|
| 96 |
+
return element.props.ref || element.ref;
|
| 97 |
+
}
|
| 98 |
+
export {
|
| 99 |
+
Slot as Root,
|
| 100 |
+
Slot,
|
| 101 |
+
Slottable,
|
| 102 |
+
createSlot,
|
| 103 |
+
createSlottable
|
| 104 |
+
};
|
| 105 |
+
//# sourceMappingURL=index.mjs.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-slot/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/slot.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n"],
|
| 5 |
+
"mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,mBAAmB;AAmCpB,SAkEG,YAAAA,WAlEH;AAAA;AAzB0B,SAAS,WAAW,WAAmB;AACvE,QAAM,YAAY,gCAAgB,SAAS;AAC3C,QAAMC,QAAa,iBAAmC,CAAC,OAAO,iBAAiB;AAC7E,UAAM,EAAE,UAAU,GAAG,UAAU,IAAI;AACnC,UAAM,gBAAsB,eAAS,QAAQ,QAAQ;AACrD,UAAM,YAAY,cAAc,KAAK,WAAW;AAEhD,QAAI,WAAW;AAEb,YAAM,aAAa,UAAU,MAAM;AAEnC,YAAM,cAAc,cAAc,IAAI,CAAC,UAAU;AAC/C,YAAI,UAAU,WAAW;AAGvB,cAAU,eAAS,MAAM,UAAU,IAAI,EAAG,QAAa,eAAS,KAAK,IAAI;AACzE,iBAAa,qBAAe,UAAU,IACjC,WAAW,MAAwC,WACpD;AAAA,QACN,OAAO;AACL,iBAAO;AAAA,QACT;AAAA,MACF,CAAC;AAED,aACE,oBAAC,aAAW,GAAG,WAAW,KAAK,cAC5B,UAAM,qBAAe,UAAU,IACtB,mBAAa,YAAY,QAAW,WAAW,IACrD,MACN;AAAA,IAEJ;AAEA,WACE,oBAAC,aAAW,GAAG,WAAW,KAAK,cAC5B,UACH;AAAA,EAEJ,CAAC;AAED,EAAAA,MAAK,cAAc,GAAG,SAAS;AAC/B,SAAOA;AACT;AAEA,IAAM,OAAO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AAM,SAAS,eAAe,GAAG,IAAI;AACrC,wBAAc,GAAG,IAAI;AACrB,iBAAO;AAAA,QACT;AAAA,MACF,WAES,eAAe;AACtB,sBAAc,QAAQ,IAAI;AAAA,MAC5B;AAAA,IACF,WAES,aAAa,SAAS;AAC7B,oBAAc,QAAQ,IAAI,EAAE,GAAG,eAAe,GAAG,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,QAAQ,IAAI,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,EAAE,GAAG,WAAW,GAAG,cAAc;AAC1C;AAOA,SAAS,cAAc,SAA6B;AAElD,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAQ,QAAQ,MAAuC;AAAA,EACzD;AAGA,SAAQ,QAAQ,MAAuC,OAAQ,QAAgB;AACjF;",
|
| 6 |
+
"names": ["Fragment", "Slot", "props", "Slottable"]
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.d.mts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 4 |
+
|
| 5 |
+
declare const createSwitchScope: _radix_ui_react_context.CreateScope;
|
| 6 |
+
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
| 7 |
+
interface SwitchProps extends PrimitiveButtonProps {
|
| 8 |
+
checked?: boolean;
|
| 9 |
+
defaultChecked?: boolean;
|
| 10 |
+
required?: boolean;
|
| 11 |
+
onCheckedChange?(checked: boolean): void;
|
| 12 |
+
}
|
| 13 |
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
| 14 |
+
type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
|
| 15 |
+
interface SwitchThumbProps extends PrimitiveSpanProps {
|
| 16 |
+
}
|
| 17 |
+
declare const SwitchThumb: React.ForwardRefExoticComponent<SwitchThumbProps & React.RefAttributes<HTMLSpanElement>>;
|
| 18 |
+
declare const Root: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
| 19 |
+
declare const Thumb: React.ForwardRefExoticComponent<SwitchThumbProps & React.RefAttributes<HTMLSpanElement>>;
|
| 20 |
+
|
| 21 |
+
export { Root, Switch, type SwitchProps, SwitchThumb, type SwitchThumbProps, Thumb, createSwitchScope };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 4 |
+
|
| 5 |
+
declare const createSwitchScope: _radix_ui_react_context.CreateScope;
|
| 6 |
+
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
| 7 |
+
interface SwitchProps extends PrimitiveButtonProps {
|
| 8 |
+
checked?: boolean;
|
| 9 |
+
defaultChecked?: boolean;
|
| 10 |
+
required?: boolean;
|
| 11 |
+
onCheckedChange?(checked: boolean): void;
|
| 12 |
+
}
|
| 13 |
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
| 14 |
+
type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
|
| 15 |
+
interface SwitchThumbProps extends PrimitiveSpanProps {
|
| 16 |
+
}
|
| 17 |
+
declare const SwitchThumb: React.ForwardRefExoticComponent<SwitchThumbProps & React.RefAttributes<HTMLSpanElement>>;
|
| 18 |
+
declare const Root: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
| 19 |
+
declare const Thumb: React.ForwardRefExoticComponent<SwitchThumbProps & React.RefAttributes<HTMLSpanElement>>;
|
| 20 |
+
|
| 21 |
+
export { Root, Switch, type SwitchProps, SwitchThumb, type SwitchThumbProps, Thumb, createSwitchScope };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
"use client";
|
| 3 |
+
var __create = Object.create;
|
| 4 |
+
var __defProp = Object.defineProperty;
|
| 5 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 6 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 7 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 8 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 9 |
+
var __export = (target, all) => {
|
| 10 |
+
for (var name in all)
|
| 11 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 12 |
+
};
|
| 13 |
+
var __copyProps = (to, from, except, desc) => {
|
| 14 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 15 |
+
for (let key of __getOwnPropNames(from))
|
| 16 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 17 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 18 |
+
}
|
| 19 |
+
return to;
|
| 20 |
+
};
|
| 21 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 22 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 23 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 24 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 25 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 26 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 27 |
+
mod
|
| 28 |
+
));
|
| 29 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 30 |
+
|
| 31 |
+
// src/index.ts
|
| 32 |
+
var index_exports = {};
|
| 33 |
+
__export(index_exports, {
|
| 34 |
+
Root: () => Root,
|
| 35 |
+
Switch: () => Switch,
|
| 36 |
+
SwitchThumb: () => SwitchThumb,
|
| 37 |
+
Thumb: () => Thumb,
|
| 38 |
+
createSwitchScope: () => createSwitchScope
|
| 39 |
+
});
|
| 40 |
+
module.exports = __toCommonJS(index_exports);
|
| 41 |
+
|
| 42 |
+
// src/switch.tsx
|
| 43 |
+
var React = __toESM(require("react"));
|
| 44 |
+
var import_primitive = require("@radix-ui/primitive");
|
| 45 |
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
| 46 |
+
var import_react_context = require("@radix-ui/react-context");
|
| 47 |
+
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
|
| 48 |
+
var import_react_use_previous = require("@radix-ui/react-use-previous");
|
| 49 |
+
var import_react_use_size = require("@radix-ui/react-use-size");
|
| 50 |
+
var import_react_primitive = require("@radix-ui/react-primitive");
|
| 51 |
+
var import_jsx_runtime = require("react/jsx-runtime");
|
| 52 |
+
var SWITCH_NAME = "Switch";
|
| 53 |
+
var [createSwitchContext, createSwitchScope] = (0, import_react_context.createContextScope)(SWITCH_NAME);
|
| 54 |
+
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
| 55 |
+
var Switch = React.forwardRef(
|
| 56 |
+
(props, forwardedRef) => {
|
| 57 |
+
const {
|
| 58 |
+
__scopeSwitch,
|
| 59 |
+
name,
|
| 60 |
+
checked: checkedProp,
|
| 61 |
+
defaultChecked,
|
| 62 |
+
required,
|
| 63 |
+
disabled,
|
| 64 |
+
value = "on",
|
| 65 |
+
onCheckedChange,
|
| 66 |
+
form,
|
| 67 |
+
...switchProps
|
| 68 |
+
} = props;
|
| 69 |
+
const [button, setButton] = React.useState(null);
|
| 70 |
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setButton(node));
|
| 71 |
+
const hasConsumerStoppedPropagationRef = React.useRef(false);
|
| 72 |
+
const isFormControl = button ? form || !!button.closest("form") : true;
|
| 73 |
+
const [checked, setChecked] = (0, import_react_use_controllable_state.useControllableState)({
|
| 74 |
+
prop: checkedProp,
|
| 75 |
+
defaultProp: defaultChecked ?? false,
|
| 76 |
+
onChange: onCheckedChange,
|
| 77 |
+
caller: SWITCH_NAME
|
| 78 |
+
});
|
| 79 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
|
| 80 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 81 |
+
import_react_primitive.Primitive.button,
|
| 82 |
+
{
|
| 83 |
+
type: "button",
|
| 84 |
+
role: "switch",
|
| 85 |
+
"aria-checked": checked,
|
| 86 |
+
"aria-required": required,
|
| 87 |
+
"data-state": getState(checked),
|
| 88 |
+
"data-disabled": disabled ? "" : void 0,
|
| 89 |
+
disabled,
|
| 90 |
+
value,
|
| 91 |
+
...switchProps,
|
| 92 |
+
ref: composedRefs,
|
| 93 |
+
onClick: (0, import_primitive.composeEventHandlers)(props.onClick, (event) => {
|
| 94 |
+
setChecked((prevChecked) => !prevChecked);
|
| 95 |
+
if (isFormControl) {
|
| 96 |
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
| 97 |
+
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
| 98 |
+
}
|
| 99 |
+
})
|
| 100 |
+
}
|
| 101 |
+
),
|
| 102 |
+
isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 103 |
+
SwitchBubbleInput,
|
| 104 |
+
{
|
| 105 |
+
control: button,
|
| 106 |
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
| 107 |
+
name,
|
| 108 |
+
value,
|
| 109 |
+
checked,
|
| 110 |
+
required,
|
| 111 |
+
disabled,
|
| 112 |
+
form,
|
| 113 |
+
style: { transform: "translateX(-100%)" }
|
| 114 |
+
}
|
| 115 |
+
)
|
| 116 |
+
] });
|
| 117 |
+
}
|
| 118 |
+
);
|
| 119 |
+
Switch.displayName = SWITCH_NAME;
|
| 120 |
+
var THUMB_NAME = "SwitchThumb";
|
| 121 |
+
var SwitchThumb = React.forwardRef(
|
| 122 |
+
(props, forwardedRef) => {
|
| 123 |
+
const { __scopeSwitch, ...thumbProps } = props;
|
| 124 |
+
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
| 125 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 126 |
+
import_react_primitive.Primitive.span,
|
| 127 |
+
{
|
| 128 |
+
"data-state": getState(context.checked),
|
| 129 |
+
"data-disabled": context.disabled ? "" : void 0,
|
| 130 |
+
...thumbProps,
|
| 131 |
+
ref: forwardedRef
|
| 132 |
+
}
|
| 133 |
+
);
|
| 134 |
+
}
|
| 135 |
+
);
|
| 136 |
+
SwitchThumb.displayName = THUMB_NAME;
|
| 137 |
+
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
| 138 |
+
var SwitchBubbleInput = React.forwardRef(
|
| 139 |
+
({
|
| 140 |
+
__scopeSwitch,
|
| 141 |
+
control,
|
| 142 |
+
checked,
|
| 143 |
+
bubbles = true,
|
| 144 |
+
...props
|
| 145 |
+
}, forwardedRef) => {
|
| 146 |
+
const ref = React.useRef(null);
|
| 147 |
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(ref, forwardedRef);
|
| 148 |
+
const prevChecked = (0, import_react_use_previous.usePrevious)(checked);
|
| 149 |
+
const controlSize = (0, import_react_use_size.useSize)(control);
|
| 150 |
+
React.useEffect(() => {
|
| 151 |
+
const input = ref.current;
|
| 152 |
+
if (!input) return;
|
| 153 |
+
const inputProto = window.HTMLInputElement.prototype;
|
| 154 |
+
const descriptor = Object.getOwnPropertyDescriptor(
|
| 155 |
+
inputProto,
|
| 156 |
+
"checked"
|
| 157 |
+
);
|
| 158 |
+
const setChecked = descriptor.set;
|
| 159 |
+
if (prevChecked !== checked && setChecked) {
|
| 160 |
+
const event = new Event("click", { bubbles });
|
| 161 |
+
setChecked.call(input, checked);
|
| 162 |
+
input.dispatchEvent(event);
|
| 163 |
+
}
|
| 164 |
+
}, [prevChecked, checked, bubbles]);
|
| 165 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 166 |
+
"input",
|
| 167 |
+
{
|
| 168 |
+
type: "checkbox",
|
| 169 |
+
"aria-hidden": true,
|
| 170 |
+
defaultChecked: checked,
|
| 171 |
+
...props,
|
| 172 |
+
tabIndex: -1,
|
| 173 |
+
ref: composedRefs,
|
| 174 |
+
style: {
|
| 175 |
+
...props.style,
|
| 176 |
+
...controlSize,
|
| 177 |
+
position: "absolute",
|
| 178 |
+
pointerEvents: "none",
|
| 179 |
+
opacity: 0,
|
| 180 |
+
margin: 0
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
);
|
| 184 |
+
}
|
| 185 |
+
);
|
| 186 |
+
SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
| 187 |
+
function getState(checked) {
|
| 188 |
+
return checked ? "checked" : "unchecked";
|
| 189 |
+
}
|
| 190 |
+
var Root = Switch;
|
| 191 |
+
var Thumb = SwitchThumb;
|
| 192 |
+
//# sourceMappingURL=index.js.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/switch.tsx"],
|
| 4 |
+
"sourcesContent": ["'use client';\nexport {\n createSwitchScope,\n //\n Switch,\n SwitchThumb,\n //\n Root,\n Thumb,\n} from './switch';\nexport type { SwitchProps, SwitchThumbProps } from './switch';\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 { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Switch\n * -----------------------------------------------------------------------------------------------*/\n\nconst SWITCH_NAME = 'Switch';\n\ntype ScopedProps<P> = P & { __scopeSwitch?: Scope };\nconst [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);\n\ntype SwitchContextValue = { checked: boolean; disabled?: boolean };\nconst [SwitchProvider, useSwitchContext] = createSwitchContext<SwitchContextValue>(SWITCH_NAME);\n\ntype SwitchElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface SwitchProps extends PrimitiveButtonProps {\n checked?: boolean;\n defaultChecked?: boolean;\n required?: boolean;\n onCheckedChange?(checked: boolean): void;\n}\n\nconst Switch = React.forwardRef<SwitchElement, SwitchProps>(\n (props: ScopedProps<SwitchProps>, forwardedRef) => {\n const {\n __scopeSwitch,\n name,\n checked: checkedProp,\n defaultChecked,\n required,\n disabled,\n value = 'on',\n onCheckedChange,\n form,\n ...switchProps\n } = props;\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = button ? form || !!button.closest('form') : true;\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: SWITCH_NAME,\n });\n\n return (\n <SwitchProvider scope={__scopeSwitch} checked={checked} disabled={disabled}>\n <Primitive.button\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-required={required}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...switchProps}\n ref={composedRefs}\n onClick={composeEventHandlers(props.onClick, (event) => {\n setChecked((prevChecked) => !prevChecked);\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if switch is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect switch updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n {isFormControl && (\n <SwitchBubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n form={form}\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n style={{ transform: 'translateX(-100%)' }}\n />\n )}\n </SwitchProvider>\n );\n }\n);\n\nSwitch.displayName = SWITCH_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SwitchThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'SwitchThumb';\n\ntype SwitchThumbElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface SwitchThumbProps extends PrimitiveSpanProps {}\n\nconst SwitchThumb = React.forwardRef<SwitchThumbElement, SwitchThumbProps>(\n (props: ScopedProps<SwitchThumbProps>, forwardedRef) => {\n const { __scopeSwitch, ...thumbProps } = props;\n const context = useSwitchContext(THUMB_NAME, __scopeSwitch);\n return (\n <Primitive.span\n data-state={getState(context.checked)}\n data-disabled={context.disabled ? '' : undefined}\n {...thumbProps}\n ref={forwardedRef}\n />\n );\n }\n);\n\nSwitchThumb.displayName = THUMB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SwitchBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'SwitchBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\ninterface SwitchBubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: boolean;\n control: HTMLElement | null;\n bubbles: boolean;\n}\n\nconst SwitchBubbleInput = React.forwardRef<HTMLInputElement, SwitchBubbleInputProps>(\n (\n {\n __scopeSwitch,\n control,\n checked,\n bubbles = true,\n ...props\n }: ScopedProps<SwitchBubbleInputProps>,\n forwardedRef\n ) => {\n const ref = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked'\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [prevChecked, checked, bubbles]);\n\n return (\n <input\n type=\"checkbox\"\n aria-hidden\n defaultChecked={checked}\n {...props}\n tabIndex={-1}\n ref={composedRefs}\n style={{\n ...props.style,\n ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }}\n />\n );\n }\n);\n\nSwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked';\n}\n\nconst Root = Switch;\nconst Thumb = SwitchThumb;\n\nexport {\n createSwitchScope,\n //\n Switch,\n SwitchThumb,\n //\n Root,\n Thumb,\n};\nexport type { SwitchProps, SwitchThumbProps };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,gCAAgC;AAChC,2BAAmC;AACnC,0CAAqC;AACrC,gCAA4B;AAC5B,4BAAwB;AACxB,6BAA0B;AAoDpB;AA5CN,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,iBAAiB,QAAI,yCAAmB,WAAW;AAG/E,IAAM,CAAC,gBAAgB,gBAAgB,IAAI,oBAAwC,WAAW;AAW9F,IAAM,SAAe;AAAA,EACnB,CAAC,OAAiC,iBAAiB;AACjD,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA,GAAG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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
// src/switch.tsx
|
| 4 |
+
import * as React from "react";
|
| 5 |
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
| 6 |
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
| 7 |
+
import { createContextScope } from "@radix-ui/react-context";
|
| 8 |
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
| 9 |
+
import { usePrevious } from "@radix-ui/react-use-previous";
|
| 10 |
+
import { useSize } from "@radix-ui/react-use-size";
|
| 11 |
+
import { Primitive } from "@radix-ui/react-primitive";
|
| 12 |
+
import { jsx, jsxs } from "react/jsx-runtime";
|
| 13 |
+
var SWITCH_NAME = "Switch";
|
| 14 |
+
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
| 15 |
+
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
| 16 |
+
var Switch = React.forwardRef(
|
| 17 |
+
(props, forwardedRef) => {
|
| 18 |
+
const {
|
| 19 |
+
__scopeSwitch,
|
| 20 |
+
name,
|
| 21 |
+
checked: checkedProp,
|
| 22 |
+
defaultChecked,
|
| 23 |
+
required,
|
| 24 |
+
disabled,
|
| 25 |
+
value = "on",
|
| 26 |
+
onCheckedChange,
|
| 27 |
+
form,
|
| 28 |
+
...switchProps
|
| 29 |
+
} = props;
|
| 30 |
+
const [button, setButton] = React.useState(null);
|
| 31 |
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
| 32 |
+
const hasConsumerStoppedPropagationRef = React.useRef(false);
|
| 33 |
+
const isFormControl = button ? form || !!button.closest("form") : true;
|
| 34 |
+
const [checked, setChecked] = useControllableState({
|
| 35 |
+
prop: checkedProp,
|
| 36 |
+
defaultProp: defaultChecked ?? false,
|
| 37 |
+
onChange: onCheckedChange,
|
| 38 |
+
caller: SWITCH_NAME
|
| 39 |
+
});
|
| 40 |
+
return /* @__PURE__ */ jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
|
| 41 |
+
/* @__PURE__ */ jsx(
|
| 42 |
+
Primitive.button,
|
| 43 |
+
{
|
| 44 |
+
type: "button",
|
| 45 |
+
role: "switch",
|
| 46 |
+
"aria-checked": checked,
|
| 47 |
+
"aria-required": required,
|
| 48 |
+
"data-state": getState(checked),
|
| 49 |
+
"data-disabled": disabled ? "" : void 0,
|
| 50 |
+
disabled,
|
| 51 |
+
value,
|
| 52 |
+
...switchProps,
|
| 53 |
+
ref: composedRefs,
|
| 54 |
+
onClick: composeEventHandlers(props.onClick, (event) => {
|
| 55 |
+
setChecked((prevChecked) => !prevChecked);
|
| 56 |
+
if (isFormControl) {
|
| 57 |
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
| 58 |
+
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
| 59 |
+
}
|
| 60 |
+
})
|
| 61 |
+
}
|
| 62 |
+
),
|
| 63 |
+
isFormControl && /* @__PURE__ */ jsx(
|
| 64 |
+
SwitchBubbleInput,
|
| 65 |
+
{
|
| 66 |
+
control: button,
|
| 67 |
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
| 68 |
+
name,
|
| 69 |
+
value,
|
| 70 |
+
checked,
|
| 71 |
+
required,
|
| 72 |
+
disabled,
|
| 73 |
+
form,
|
| 74 |
+
style: { transform: "translateX(-100%)" }
|
| 75 |
+
}
|
| 76 |
+
)
|
| 77 |
+
] });
|
| 78 |
+
}
|
| 79 |
+
);
|
| 80 |
+
Switch.displayName = SWITCH_NAME;
|
| 81 |
+
var THUMB_NAME = "SwitchThumb";
|
| 82 |
+
var SwitchThumb = React.forwardRef(
|
| 83 |
+
(props, forwardedRef) => {
|
| 84 |
+
const { __scopeSwitch, ...thumbProps } = props;
|
| 85 |
+
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
| 86 |
+
return /* @__PURE__ */ jsx(
|
| 87 |
+
Primitive.span,
|
| 88 |
+
{
|
| 89 |
+
"data-state": getState(context.checked),
|
| 90 |
+
"data-disabled": context.disabled ? "" : void 0,
|
| 91 |
+
...thumbProps,
|
| 92 |
+
ref: forwardedRef
|
| 93 |
+
}
|
| 94 |
+
);
|
| 95 |
+
}
|
| 96 |
+
);
|
| 97 |
+
SwitchThumb.displayName = THUMB_NAME;
|
| 98 |
+
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
| 99 |
+
var SwitchBubbleInput = React.forwardRef(
|
| 100 |
+
({
|
| 101 |
+
__scopeSwitch,
|
| 102 |
+
control,
|
| 103 |
+
checked,
|
| 104 |
+
bubbles = true,
|
| 105 |
+
...props
|
| 106 |
+
}, forwardedRef) => {
|
| 107 |
+
const ref = React.useRef(null);
|
| 108 |
+
const composedRefs = useComposedRefs(ref, forwardedRef);
|
| 109 |
+
const prevChecked = usePrevious(checked);
|
| 110 |
+
const controlSize = useSize(control);
|
| 111 |
+
React.useEffect(() => {
|
| 112 |
+
const input = ref.current;
|
| 113 |
+
if (!input) return;
|
| 114 |
+
const inputProto = window.HTMLInputElement.prototype;
|
| 115 |
+
const descriptor = Object.getOwnPropertyDescriptor(
|
| 116 |
+
inputProto,
|
| 117 |
+
"checked"
|
| 118 |
+
);
|
| 119 |
+
const setChecked = descriptor.set;
|
| 120 |
+
if (prevChecked !== checked && setChecked) {
|
| 121 |
+
const event = new Event("click", { bubbles });
|
| 122 |
+
setChecked.call(input, checked);
|
| 123 |
+
input.dispatchEvent(event);
|
| 124 |
+
}
|
| 125 |
+
}, [prevChecked, checked, bubbles]);
|
| 126 |
+
return /* @__PURE__ */ jsx(
|
| 127 |
+
"input",
|
| 128 |
+
{
|
| 129 |
+
type: "checkbox",
|
| 130 |
+
"aria-hidden": true,
|
| 131 |
+
defaultChecked: checked,
|
| 132 |
+
...props,
|
| 133 |
+
tabIndex: -1,
|
| 134 |
+
ref: composedRefs,
|
| 135 |
+
style: {
|
| 136 |
+
...props.style,
|
| 137 |
+
...controlSize,
|
| 138 |
+
position: "absolute",
|
| 139 |
+
pointerEvents: "none",
|
| 140 |
+
opacity: 0,
|
| 141 |
+
margin: 0
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
);
|
| 145 |
+
}
|
| 146 |
+
);
|
| 147 |
+
SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
| 148 |
+
function getState(checked) {
|
| 149 |
+
return checked ? "checked" : "unchecked";
|
| 150 |
+
}
|
| 151 |
+
var Root = Switch;
|
| 152 |
+
var Thumb = SwitchThumb;
|
| 153 |
+
export {
|
| 154 |
+
Root,
|
| 155 |
+
Switch,
|
| 156 |
+
SwitchThumb,
|
| 157 |
+
Thumb,
|
| 158 |
+
createSwitchScope
|
| 159 |
+
};
|
| 160 |
+
//# sourceMappingURL=index.mjs.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-switch/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/switch.tsx"],
|
| 4 |
+
"sourcesContent": ["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 { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Switch\n * -----------------------------------------------------------------------------------------------*/\n\nconst SWITCH_NAME = 'Switch';\n\ntype ScopedProps<P> = P & { __scopeSwitch?: Scope };\nconst [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);\n\ntype SwitchContextValue = { checked: boolean; disabled?: boolean };\nconst [SwitchProvider, useSwitchContext] = createSwitchContext<SwitchContextValue>(SWITCH_NAME);\n\ntype SwitchElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface SwitchProps extends PrimitiveButtonProps {\n checked?: boolean;\n defaultChecked?: boolean;\n required?: boolean;\n onCheckedChange?(checked: boolean): void;\n}\n\nconst Switch = React.forwardRef<SwitchElement, SwitchProps>(\n (props: ScopedProps<SwitchProps>, forwardedRef) => {\n const {\n __scopeSwitch,\n name,\n checked: checkedProp,\n defaultChecked,\n required,\n disabled,\n value = 'on',\n onCheckedChange,\n form,\n ...switchProps\n } = props;\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = button ? form || !!button.closest('form') : true;\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: SWITCH_NAME,\n });\n\n return (\n <SwitchProvider scope={__scopeSwitch} checked={checked} disabled={disabled}>\n <Primitive.button\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-required={required}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...switchProps}\n ref={composedRefs}\n onClick={composeEventHandlers(props.onClick, (event) => {\n setChecked((prevChecked) => !prevChecked);\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if switch is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect switch updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n {isFormControl && (\n <SwitchBubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n form={form}\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n style={{ transform: 'translateX(-100%)' }}\n />\n )}\n </SwitchProvider>\n );\n }\n);\n\nSwitch.displayName = SWITCH_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SwitchThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'SwitchThumb';\n\ntype SwitchThumbElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface SwitchThumbProps extends PrimitiveSpanProps {}\n\nconst SwitchThumb = React.forwardRef<SwitchThumbElement, SwitchThumbProps>(\n (props: ScopedProps<SwitchThumbProps>, forwardedRef) => {\n const { __scopeSwitch, ...thumbProps } = props;\n const context = useSwitchContext(THUMB_NAME, __scopeSwitch);\n return (\n <Primitive.span\n data-state={getState(context.checked)}\n data-disabled={context.disabled ? '' : undefined}\n {...thumbProps}\n ref={forwardedRef}\n />\n );\n }\n);\n\nSwitchThumb.displayName = THUMB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SwitchBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'SwitchBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\ninterface SwitchBubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: boolean;\n control: HTMLElement | null;\n bubbles: boolean;\n}\n\nconst SwitchBubbleInput = React.forwardRef<HTMLInputElement, SwitchBubbleInputProps>(\n (\n {\n __scopeSwitch,\n control,\n checked,\n bubbles = true,\n ...props\n }: ScopedProps<SwitchBubbleInputProps>,\n forwardedRef\n ) => {\n const ref = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked'\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [prevChecked, checked, bubbles]);\n\n return (\n <input\n type=\"checkbox\"\n aria-hidden\n defaultChecked={checked}\n {...props}\n tabIndex={-1}\n ref={composedRefs}\n style={{\n ...props.style,\n ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }}\n />\n );\n }\n);\n\nSwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked';\n}\n\nconst Root = Switch;\nconst Thumb = SwitchThumb;\n\nexport {\n createSwitchScope,\n //\n Switch,\n SwitchThumb,\n //\n Root,\n Thumb,\n};\nexport type { SwitchProps, SwitchThumbProps };\n"],
|
| 5 |
+
"mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAoDpB,SACE,KADF;AA5CN,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,iBAAiB,IAAI,mBAAmB,WAAW;AAG/E,IAAM,CAAC,gBAAgB,gBAAgB,IAAI,oBAAwC,WAAW;AAW9F,IAAM,SAAe;AAAA,EACnB,CAAC,OAA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ACV,KAAK;AAAA,QACL,OAAO;AAAA,UACL,GAAG,MAAM;AAAA,UACT,GAAG;AAAA,UACH,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAIhC,SAAS,SAAS,SAAkB;AAClC,SAAO,UAAU,YAAY;AAC/B;AAEA,IAAM,OAAO;AACb,IAAM,QAAQ;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.d.mts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
| 4 |
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
| 5 |
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
| 6 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 7 |
+
|
| 8 |
+
declare const createTooltipScope: _radix_ui_react_context.CreateScope;
|
| 9 |
+
interface TooltipProviderProps {
|
| 10 |
+
children: React.ReactNode;
|
| 11 |
+
/**
|
| 12 |
+
* The duration from when the pointer enters the trigger until the tooltip gets opened.
|
| 13 |
+
* @defaultValue 700
|
| 14 |
+
*/
|
| 15 |
+
delayDuration?: number;
|
| 16 |
+
/**
|
| 17 |
+
* How much time a user has to enter another trigger without incurring a delay again.
|
| 18 |
+
* @defaultValue 300
|
| 19 |
+
*/
|
| 20 |
+
skipDelayDuration?: number;
|
| 21 |
+
/**
|
| 22 |
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
| 23 |
+
* @defaultValue false
|
| 24 |
+
*/
|
| 25 |
+
disableHoverableContent?: boolean;
|
| 26 |
+
}
|
| 27 |
+
declare const TooltipProvider: React.FC<TooltipProviderProps>;
|
| 28 |
+
interface TooltipProps {
|
| 29 |
+
children?: React.ReactNode;
|
| 30 |
+
open?: boolean;
|
| 31 |
+
defaultOpen?: boolean;
|
| 32 |
+
onOpenChange?: (open: boolean) => void;
|
| 33 |
+
/**
|
| 34 |
+
* The duration from when the pointer enters the trigger until the tooltip gets opened. This will
|
| 35 |
+
* override the prop with the same name passed to Provider.
|
| 36 |
+
* @defaultValue 700
|
| 37 |
+
*/
|
| 38 |
+
delayDuration?: number;
|
| 39 |
+
/**
|
| 40 |
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
| 41 |
+
* @defaultValue false
|
| 42 |
+
*/
|
| 43 |
+
disableHoverableContent?: boolean;
|
| 44 |
+
}
|
| 45 |
+
declare const Tooltip: React.FC<TooltipProps>;
|
| 46 |
+
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
| 47 |
+
interface TooltipTriggerProps extends PrimitiveButtonProps {
|
| 48 |
+
}
|
| 49 |
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
| 50 |
+
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
| 51 |
+
interface TooltipPortalProps {
|
| 52 |
+
children?: React.ReactNode;
|
| 53 |
+
/**
|
| 54 |
+
* Specify a container element to portal the content into.
|
| 55 |
+
*/
|
| 56 |
+
container?: PortalProps['container'];
|
| 57 |
+
/**
|
| 58 |
+
* Used to force mounting when more control is needed. Useful when
|
| 59 |
+
* controlling animation with React animation libraries.
|
| 60 |
+
*/
|
| 61 |
+
forceMount?: true;
|
| 62 |
+
}
|
| 63 |
+
declare const TooltipPortal: React.FC<TooltipPortalProps>;
|
| 64 |
+
interface TooltipContentProps extends TooltipContentImplProps {
|
| 65 |
+
/**
|
| 66 |
+
* Used to force mounting when more control is needed. Useful when
|
| 67 |
+
* controlling animation with React animation libraries.
|
| 68 |
+
*/
|
| 69 |
+
forceMount?: true;
|
| 70 |
+
}
|
| 71 |
+
declare const TooltipContent: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 72 |
+
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
| 73 |
+
type PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
| 74 |
+
interface TooltipContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {
|
| 75 |
+
/**
|
| 76 |
+
* A more descriptive label for accessibility purpose
|
| 77 |
+
*/
|
| 78 |
+
'aria-label'?: string;
|
| 79 |
+
/**
|
| 80 |
+
* Event handler called when the escape key is down.
|
| 81 |
+
* Can be prevented.
|
| 82 |
+
*/
|
| 83 |
+
onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
|
| 84 |
+
/**
|
| 85 |
+
* Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.
|
| 86 |
+
* Can be prevented.
|
| 87 |
+
*/
|
| 88 |
+
onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
|
| 89 |
+
}
|
| 90 |
+
type PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
| 91 |
+
interface TooltipArrowProps extends PopperArrowProps {
|
| 92 |
+
}
|
| 93 |
+
declare const TooltipArrow: React.ForwardRefExoticComponent<TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 94 |
+
declare const Provider: React.FC<TooltipProviderProps>;
|
| 95 |
+
declare const Root: React.FC<TooltipProps>;
|
| 96 |
+
declare const Trigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
| 97 |
+
declare const Portal: React.FC<TooltipPortalProps>;
|
| 98 |
+
declare const Content: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 99 |
+
declare const Arrow: React.ForwardRefExoticComponent<TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 100 |
+
|
| 101 |
+
export { Arrow, Content, Portal, Provider, Root, Tooltip, TooltipArrow, type TooltipArrowProps, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipPortalProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, Trigger, createTooltipScope };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
| 4 |
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
| 5 |
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
| 6 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 7 |
+
|
| 8 |
+
declare const createTooltipScope: _radix_ui_react_context.CreateScope;
|
| 9 |
+
interface TooltipProviderProps {
|
| 10 |
+
children: React.ReactNode;
|
| 11 |
+
/**
|
| 12 |
+
* The duration from when the pointer enters the trigger until the tooltip gets opened.
|
| 13 |
+
* @defaultValue 700
|
| 14 |
+
*/
|
| 15 |
+
delayDuration?: number;
|
| 16 |
+
/**
|
| 17 |
+
* How much time a user has to enter another trigger without incurring a delay again.
|
| 18 |
+
* @defaultValue 300
|
| 19 |
+
*/
|
| 20 |
+
skipDelayDuration?: number;
|
| 21 |
+
/**
|
| 22 |
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
| 23 |
+
* @defaultValue false
|
| 24 |
+
*/
|
| 25 |
+
disableHoverableContent?: boolean;
|
| 26 |
+
}
|
| 27 |
+
declare const TooltipProvider: React.FC<TooltipProviderProps>;
|
| 28 |
+
interface TooltipProps {
|
| 29 |
+
children?: React.ReactNode;
|
| 30 |
+
open?: boolean;
|
| 31 |
+
defaultOpen?: boolean;
|
| 32 |
+
onOpenChange?: (open: boolean) => void;
|
| 33 |
+
/**
|
| 34 |
+
* The duration from when the pointer enters the trigger until the tooltip gets opened. This will
|
| 35 |
+
* override the prop with the same name passed to Provider.
|
| 36 |
+
* @defaultValue 700
|
| 37 |
+
*/
|
| 38 |
+
delayDuration?: number;
|
| 39 |
+
/**
|
| 40 |
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
| 41 |
+
* @defaultValue false
|
| 42 |
+
*/
|
| 43 |
+
disableHoverableContent?: boolean;
|
| 44 |
+
}
|
| 45 |
+
declare const Tooltip: React.FC<TooltipProps>;
|
| 46 |
+
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
| 47 |
+
interface TooltipTriggerProps extends PrimitiveButtonProps {
|
| 48 |
+
}
|
| 49 |
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
| 50 |
+
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
| 51 |
+
interface TooltipPortalProps {
|
| 52 |
+
children?: React.ReactNode;
|
| 53 |
+
/**
|
| 54 |
+
* Specify a container element to portal the content into.
|
| 55 |
+
*/
|
| 56 |
+
container?: PortalProps['container'];
|
| 57 |
+
/**
|
| 58 |
+
* Used to force mounting when more control is needed. Useful when
|
| 59 |
+
* controlling animation with React animation libraries.
|
| 60 |
+
*/
|
| 61 |
+
forceMount?: true;
|
| 62 |
+
}
|
| 63 |
+
declare const TooltipPortal: React.FC<TooltipPortalProps>;
|
| 64 |
+
interface TooltipContentProps extends TooltipContentImplProps {
|
| 65 |
+
/**
|
| 66 |
+
* Used to force mounting when more control is needed. Useful when
|
| 67 |
+
* controlling animation with React animation libraries.
|
| 68 |
+
*/
|
| 69 |
+
forceMount?: true;
|
| 70 |
+
}
|
| 71 |
+
declare const TooltipContent: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 72 |
+
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
| 73 |
+
type PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
| 74 |
+
interface TooltipContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {
|
| 75 |
+
/**
|
| 76 |
+
* A more descriptive label for accessibility purpose
|
| 77 |
+
*/
|
| 78 |
+
'aria-label'?: string;
|
| 79 |
+
/**
|
| 80 |
+
* Event handler called when the escape key is down.
|
| 81 |
+
* Can be prevented.
|
| 82 |
+
*/
|
| 83 |
+
onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
|
| 84 |
+
/**
|
| 85 |
+
* Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.
|
| 86 |
+
* Can be prevented.
|
| 87 |
+
*/
|
| 88 |
+
onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
|
| 89 |
+
}
|
| 90 |
+
type PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
| 91 |
+
interface TooltipArrowProps extends PopperArrowProps {
|
| 92 |
+
}
|
| 93 |
+
declare const TooltipArrow: React.ForwardRefExoticComponent<TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 94 |
+
declare const Provider: React.FC<TooltipProviderProps>;
|
| 95 |
+
declare const Root: React.FC<TooltipProps>;
|
| 96 |
+
declare const Trigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
| 97 |
+
declare const Portal: React.FC<TooltipPortalProps>;
|
| 98 |
+
declare const Content: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 99 |
+
declare const Arrow: React.ForwardRefExoticComponent<TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 100 |
+
|
| 101 |
+
export { Arrow, Content, Portal, Provider, Root, Tooltip, TooltipArrow, type TooltipArrowProps, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipPortalProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, Trigger, createTooltipScope };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.js
ADDED
|
@@ -0,0 +1,540 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
"use client";
|
| 3 |
+
var __create = Object.create;
|
| 4 |
+
var __defProp = Object.defineProperty;
|
| 5 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 6 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 7 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 8 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 9 |
+
var __export = (target, all) => {
|
| 10 |
+
for (var name in all)
|
| 11 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 12 |
+
};
|
| 13 |
+
var __copyProps = (to, from, except, desc) => {
|
| 14 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 15 |
+
for (let key of __getOwnPropNames(from))
|
| 16 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 17 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 18 |
+
}
|
| 19 |
+
return to;
|
| 20 |
+
};
|
| 21 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 22 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 23 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 24 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 25 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 26 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 27 |
+
mod
|
| 28 |
+
));
|
| 29 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 30 |
+
|
| 31 |
+
// src/index.ts
|
| 32 |
+
var index_exports = {};
|
| 33 |
+
__export(index_exports, {
|
| 34 |
+
Arrow: () => Arrow2,
|
| 35 |
+
Content: () => Content2,
|
| 36 |
+
Portal: () => Portal,
|
| 37 |
+
Provider: () => Provider,
|
| 38 |
+
Root: () => Root3,
|
| 39 |
+
Tooltip: () => Tooltip,
|
| 40 |
+
TooltipArrow: () => TooltipArrow,
|
| 41 |
+
TooltipContent: () => TooltipContent,
|
| 42 |
+
TooltipPortal: () => TooltipPortal,
|
| 43 |
+
TooltipProvider: () => TooltipProvider,
|
| 44 |
+
TooltipTrigger: () => TooltipTrigger,
|
| 45 |
+
Trigger: () => Trigger,
|
| 46 |
+
createTooltipScope: () => createTooltipScope
|
| 47 |
+
});
|
| 48 |
+
module.exports = __toCommonJS(index_exports);
|
| 49 |
+
|
| 50 |
+
// src/tooltip.tsx
|
| 51 |
+
var React = __toESM(require("react"));
|
| 52 |
+
var import_primitive = require("@radix-ui/primitive");
|
| 53 |
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
| 54 |
+
var import_react_context = require("@radix-ui/react-context");
|
| 55 |
+
var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer");
|
| 56 |
+
var import_react_id = require("@radix-ui/react-id");
|
| 57 |
+
var PopperPrimitive = __toESM(require("@radix-ui/react-popper"));
|
| 58 |
+
var import_react_popper = require("@radix-ui/react-popper");
|
| 59 |
+
var import_react_portal = require("@radix-ui/react-portal");
|
| 60 |
+
var import_react_presence = require("@radix-ui/react-presence");
|
| 61 |
+
var import_react_primitive = require("@radix-ui/react-primitive");
|
| 62 |
+
var import_react_slot = require("@radix-ui/react-slot");
|
| 63 |
+
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
|
| 64 |
+
var VisuallyHiddenPrimitive = __toESM(require("@radix-ui/react-visually-hidden"));
|
| 65 |
+
var import_jsx_runtime = require("react/jsx-runtime");
|
| 66 |
+
var [createTooltipContext, createTooltipScope] = (0, import_react_context.createContextScope)("Tooltip", [
|
| 67 |
+
import_react_popper.createPopperScope
|
| 68 |
+
]);
|
| 69 |
+
var usePopperScope = (0, import_react_popper.createPopperScope)();
|
| 70 |
+
var PROVIDER_NAME = "TooltipProvider";
|
| 71 |
+
var DEFAULT_DELAY_DURATION = 700;
|
| 72 |
+
var TOOLTIP_OPEN = "tooltip.open";
|
| 73 |
+
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
| 74 |
+
var TooltipProvider = (props) => {
|
| 75 |
+
const {
|
| 76 |
+
__scopeTooltip,
|
| 77 |
+
delayDuration = DEFAULT_DELAY_DURATION,
|
| 78 |
+
skipDelayDuration = 300,
|
| 79 |
+
disableHoverableContent = false,
|
| 80 |
+
children
|
| 81 |
+
} = props;
|
| 82 |
+
const isOpenDelayedRef = React.useRef(true);
|
| 83 |
+
const isPointerInTransitRef = React.useRef(false);
|
| 84 |
+
const skipDelayTimerRef = React.useRef(0);
|
| 85 |
+
React.useEffect(() => {
|
| 86 |
+
const skipDelayTimer = skipDelayTimerRef.current;
|
| 87 |
+
return () => window.clearTimeout(skipDelayTimer);
|
| 88 |
+
}, []);
|
| 89 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 90 |
+
TooltipProviderContextProvider,
|
| 91 |
+
{
|
| 92 |
+
scope: __scopeTooltip,
|
| 93 |
+
isOpenDelayedRef,
|
| 94 |
+
delayDuration,
|
| 95 |
+
onOpen: React.useCallback(() => {
|
| 96 |
+
window.clearTimeout(skipDelayTimerRef.current);
|
| 97 |
+
isOpenDelayedRef.current = false;
|
| 98 |
+
}, []),
|
| 99 |
+
onClose: React.useCallback(() => {
|
| 100 |
+
window.clearTimeout(skipDelayTimerRef.current);
|
| 101 |
+
skipDelayTimerRef.current = window.setTimeout(
|
| 102 |
+
() => isOpenDelayedRef.current = true,
|
| 103 |
+
skipDelayDuration
|
| 104 |
+
);
|
| 105 |
+
}, [skipDelayDuration]),
|
| 106 |
+
isPointerInTransitRef,
|
| 107 |
+
onPointerInTransitChange: React.useCallback((inTransit) => {
|
| 108 |
+
isPointerInTransitRef.current = inTransit;
|
| 109 |
+
}, []),
|
| 110 |
+
disableHoverableContent,
|
| 111 |
+
children
|
| 112 |
+
}
|
| 113 |
+
);
|
| 114 |
+
};
|
| 115 |
+
TooltipProvider.displayName = PROVIDER_NAME;
|
| 116 |
+
var TOOLTIP_NAME = "Tooltip";
|
| 117 |
+
var [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);
|
| 118 |
+
var Tooltip = (props) => {
|
| 119 |
+
const {
|
| 120 |
+
__scopeTooltip,
|
| 121 |
+
children,
|
| 122 |
+
open: openProp,
|
| 123 |
+
defaultOpen,
|
| 124 |
+
onOpenChange,
|
| 125 |
+
disableHoverableContent: disableHoverableContentProp,
|
| 126 |
+
delayDuration: delayDurationProp
|
| 127 |
+
} = props;
|
| 128 |
+
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
| 129 |
+
const popperScope = usePopperScope(__scopeTooltip);
|
| 130 |
+
const [trigger, setTrigger] = React.useState(null);
|
| 131 |
+
const contentId = (0, import_react_id.useId)();
|
| 132 |
+
const openTimerRef = React.useRef(0);
|
| 133 |
+
const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
|
| 134 |
+
const delayDuration = delayDurationProp ?? providerContext.delayDuration;
|
| 135 |
+
const wasOpenDelayedRef = React.useRef(false);
|
| 136 |
+
const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
|
| 137 |
+
prop: openProp,
|
| 138 |
+
defaultProp: defaultOpen ?? false,
|
| 139 |
+
onChange: (open2) => {
|
| 140 |
+
if (open2) {
|
| 141 |
+
providerContext.onOpen();
|
| 142 |
+
document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));
|
| 143 |
+
} else {
|
| 144 |
+
providerContext.onClose();
|
| 145 |
+
}
|
| 146 |
+
onOpenChange?.(open2);
|
| 147 |
+
},
|
| 148 |
+
caller: TOOLTIP_NAME
|
| 149 |
+
});
|
| 150 |
+
const stateAttribute = React.useMemo(() => {
|
| 151 |
+
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
| 152 |
+
}, [open]);
|
| 153 |
+
const handleOpen = React.useCallback(() => {
|
| 154 |
+
window.clearTimeout(openTimerRef.current);
|
| 155 |
+
openTimerRef.current = 0;
|
| 156 |
+
wasOpenDelayedRef.current = false;
|
| 157 |
+
setOpen(true);
|
| 158 |
+
}, [setOpen]);
|
| 159 |
+
const handleClose = React.useCallback(() => {
|
| 160 |
+
window.clearTimeout(openTimerRef.current);
|
| 161 |
+
openTimerRef.current = 0;
|
| 162 |
+
setOpen(false);
|
| 163 |
+
}, [setOpen]);
|
| 164 |
+
const handleDelayedOpen = React.useCallback(() => {
|
| 165 |
+
window.clearTimeout(openTimerRef.current);
|
| 166 |
+
openTimerRef.current = window.setTimeout(() => {
|
| 167 |
+
wasOpenDelayedRef.current = true;
|
| 168 |
+
setOpen(true);
|
| 169 |
+
openTimerRef.current = 0;
|
| 170 |
+
}, delayDuration);
|
| 171 |
+
}, [delayDuration, setOpen]);
|
| 172 |
+
React.useEffect(() => {
|
| 173 |
+
return () => {
|
| 174 |
+
if (openTimerRef.current) {
|
| 175 |
+
window.clearTimeout(openTimerRef.current);
|
| 176 |
+
openTimerRef.current = 0;
|
| 177 |
+
}
|
| 178 |
+
};
|
| 179 |
+
}, []);
|
| 180 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 181 |
+
TooltipContextProvider,
|
| 182 |
+
{
|
| 183 |
+
scope: __scopeTooltip,
|
| 184 |
+
contentId,
|
| 185 |
+
open,
|
| 186 |
+
stateAttribute,
|
| 187 |
+
trigger,
|
| 188 |
+
onTriggerChange: setTrigger,
|
| 189 |
+
onTriggerEnter: React.useCallback(() => {
|
| 190 |
+
if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
|
| 191 |
+
else handleOpen();
|
| 192 |
+
}, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
|
| 193 |
+
onTriggerLeave: React.useCallback(() => {
|
| 194 |
+
if (disableHoverableContent) {
|
| 195 |
+
handleClose();
|
| 196 |
+
} else {
|
| 197 |
+
window.clearTimeout(openTimerRef.current);
|
| 198 |
+
openTimerRef.current = 0;
|
| 199 |
+
}
|
| 200 |
+
}, [handleClose, disableHoverableContent]),
|
| 201 |
+
onOpen: handleOpen,
|
| 202 |
+
onClose: handleClose,
|
| 203 |
+
disableHoverableContent,
|
| 204 |
+
children
|
| 205 |
+
}
|
| 206 |
+
) });
|
| 207 |
+
};
|
| 208 |
+
Tooltip.displayName = TOOLTIP_NAME;
|
| 209 |
+
var TRIGGER_NAME = "TooltipTrigger";
|
| 210 |
+
var TooltipTrigger = React.forwardRef(
|
| 211 |
+
(props, forwardedRef) => {
|
| 212 |
+
const { __scopeTooltip, ...triggerProps } = props;
|
| 213 |
+
const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);
|
| 214 |
+
const providerContext = useTooltipProviderContext(TRIGGER_NAME, __scopeTooltip);
|
| 215 |
+
const popperScope = usePopperScope(__scopeTooltip);
|
| 216 |
+
const ref = React.useRef(null);
|
| 217 |
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref, context.onTriggerChange);
|
| 218 |
+
const isPointerDownRef = React.useRef(false);
|
| 219 |
+
const hasPointerMoveOpenedRef = React.useRef(false);
|
| 220 |
+
const handlePointerUp = React.useCallback(() => isPointerDownRef.current = false, []);
|
| 221 |
+
React.useEffect(() => {
|
| 222 |
+
return () => document.removeEventListener("pointerup", handlePointerUp);
|
| 223 |
+
}, [handlePointerUp]);
|
| 224 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 225 |
+
import_react_primitive.Primitive.button,
|
| 226 |
+
{
|
| 227 |
+
"aria-describedby": context.open ? context.contentId : void 0,
|
| 228 |
+
"data-state": context.stateAttribute,
|
| 229 |
+
...triggerProps,
|
| 230 |
+
ref: composedRefs,
|
| 231 |
+
onPointerMove: (0, import_primitive.composeEventHandlers)(props.onPointerMove, (event) => {
|
| 232 |
+
if (event.pointerType === "touch") return;
|
| 233 |
+
if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {
|
| 234 |
+
context.onTriggerEnter();
|
| 235 |
+
hasPointerMoveOpenedRef.current = true;
|
| 236 |
+
}
|
| 237 |
+
}),
|
| 238 |
+
onPointerLeave: (0, import_primitive.composeEventHandlers)(props.onPointerLeave, () => {
|
| 239 |
+
context.onTriggerLeave();
|
| 240 |
+
hasPointerMoveOpenedRef.current = false;
|
| 241 |
+
}),
|
| 242 |
+
onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, () => {
|
| 243 |
+
if (context.open) {
|
| 244 |
+
context.onClose();
|
| 245 |
+
}
|
| 246 |
+
isPointerDownRef.current = true;
|
| 247 |
+
document.addEventListener("pointerup", handlePointerUp, { once: true });
|
| 248 |
+
}),
|
| 249 |
+
onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, () => {
|
| 250 |
+
if (!isPointerDownRef.current) context.onOpen();
|
| 251 |
+
}),
|
| 252 |
+
onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, context.onClose),
|
| 253 |
+
onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onClose)
|
| 254 |
+
}
|
| 255 |
+
) });
|
| 256 |
+
}
|
| 257 |
+
);
|
| 258 |
+
TooltipTrigger.displayName = TRIGGER_NAME;
|
| 259 |
+
var PORTAL_NAME = "TooltipPortal";
|
| 260 |
+
var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
|
| 261 |
+
forceMount: void 0
|
| 262 |
+
});
|
| 263 |
+
var TooltipPortal = (props) => {
|
| 264 |
+
const { __scopeTooltip, forceMount, children, container } = props;
|
| 265 |
+
const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);
|
| 266 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children }) }) });
|
| 267 |
+
};
|
| 268 |
+
TooltipPortal.displayName = PORTAL_NAME;
|
| 269 |
+
var CONTENT_NAME = "TooltipContent";
|
| 270 |
+
var TooltipContent = React.forwardRef(
|
| 271 |
+
(props, forwardedRef) => {
|
| 272 |
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);
|
| 273 |
+
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
| 274 |
+
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
| 275 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
| 276 |
+
}
|
| 277 |
+
);
|
| 278 |
+
var TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {
|
| 279 |
+
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
| 280 |
+
const providerContext = useTooltipProviderContext(CONTENT_NAME, props.__scopeTooltip);
|
| 281 |
+
const ref = React.useRef(null);
|
| 282 |
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref);
|
| 283 |
+
const [pointerGraceArea, setPointerGraceArea] = React.useState(null);
|
| 284 |
+
const { trigger, onClose } = context;
|
| 285 |
+
const content = ref.current;
|
| 286 |
+
const { onPointerInTransitChange } = providerContext;
|
| 287 |
+
const handleRemoveGraceArea = React.useCallback(() => {
|
| 288 |
+
setPointerGraceArea(null);
|
| 289 |
+
onPointerInTransitChange(false);
|
| 290 |
+
}, [onPointerInTransitChange]);
|
| 291 |
+
const handleCreateGraceArea = React.useCallback(
|
| 292 |
+
(event, hoverTarget) => {
|
| 293 |
+
const currentTarget = event.currentTarget;
|
| 294 |
+
const exitPoint = { x: event.clientX, y: event.clientY };
|
| 295 |
+
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
| 296 |
+
const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
|
| 297 |
+
const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
|
| 298 |
+
const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);
|
| 299 |
+
setPointerGraceArea(graceArea);
|
| 300 |
+
onPointerInTransitChange(true);
|
| 301 |
+
},
|
| 302 |
+
[onPointerInTransitChange]
|
| 303 |
+
);
|
| 304 |
+
React.useEffect(() => {
|
| 305 |
+
return () => handleRemoveGraceArea();
|
| 306 |
+
}, [handleRemoveGraceArea]);
|
| 307 |
+
React.useEffect(() => {
|
| 308 |
+
if (trigger && content) {
|
| 309 |
+
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
| 310 |
+
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
| 311 |
+
trigger.addEventListener("pointerleave", handleTriggerLeave);
|
| 312 |
+
content.addEventListener("pointerleave", handleContentLeave);
|
| 313 |
+
return () => {
|
| 314 |
+
trigger.removeEventListener("pointerleave", handleTriggerLeave);
|
| 315 |
+
content.removeEventListener("pointerleave", handleContentLeave);
|
| 316 |
+
};
|
| 317 |
+
}
|
| 318 |
+
}, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);
|
| 319 |
+
React.useEffect(() => {
|
| 320 |
+
if (pointerGraceArea) {
|
| 321 |
+
const handleTrackPointerGrace = (event) => {
|
| 322 |
+
const target = event.target;
|
| 323 |
+
const pointerPosition = { x: event.clientX, y: event.clientY };
|
| 324 |
+
const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);
|
| 325 |
+
const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
|
| 326 |
+
if (hasEnteredTarget) {
|
| 327 |
+
handleRemoveGraceArea();
|
| 328 |
+
} else if (isPointerOutsideGraceArea) {
|
| 329 |
+
handleRemoveGraceArea();
|
| 330 |
+
onClose();
|
| 331 |
+
}
|
| 332 |
+
};
|
| 333 |
+
document.addEventListener("pointermove", handleTrackPointerGrace);
|
| 334 |
+
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
| 335 |
+
}
|
| 336 |
+
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
| 337 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContentImpl, { ...props, ref: composedRefs });
|
| 338 |
+
});
|
| 339 |
+
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
| 340 |
+
var Slottable = (0, import_react_slot.createSlottable)("TooltipContent");
|
| 341 |
+
var TooltipContentImpl = React.forwardRef(
|
| 342 |
+
(props, forwardedRef) => {
|
| 343 |
+
const {
|
| 344 |
+
__scopeTooltip,
|
| 345 |
+
children,
|
| 346 |
+
"aria-label": ariaLabel,
|
| 347 |
+
onEscapeKeyDown,
|
| 348 |
+
onPointerDownOutside,
|
| 349 |
+
...contentProps
|
| 350 |
+
} = props;
|
| 351 |
+
const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);
|
| 352 |
+
const popperScope = usePopperScope(__scopeTooltip);
|
| 353 |
+
const { onClose } = context;
|
| 354 |
+
React.useEffect(() => {
|
| 355 |
+
document.addEventListener(TOOLTIP_OPEN, onClose);
|
| 356 |
+
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
| 357 |
+
}, [onClose]);
|
| 358 |
+
React.useEffect(() => {
|
| 359 |
+
if (context.trigger) {
|
| 360 |
+
const handleScroll = (event) => {
|
| 361 |
+
const target = event.target;
|
| 362 |
+
if (target?.contains(context.trigger)) onClose();
|
| 363 |
+
};
|
| 364 |
+
window.addEventListener("scroll", handleScroll, { capture: true });
|
| 365 |
+
return () => window.removeEventListener("scroll", handleScroll, { capture: true });
|
| 366 |
+
}
|
| 367 |
+
}, [context.trigger, onClose]);
|
| 368 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 369 |
+
import_react_dismissable_layer.DismissableLayer,
|
| 370 |
+
{
|
| 371 |
+
asChild: true,
|
| 372 |
+
disableOutsidePointerEvents: false,
|
| 373 |
+
onEscapeKeyDown,
|
| 374 |
+
onPointerDownOutside,
|
| 375 |
+
onFocusOutside: (event) => event.preventDefault(),
|
| 376 |
+
onDismiss: onClose,
|
| 377 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
| 378 |
+
PopperPrimitive.Content,
|
| 379 |
+
{
|
| 380 |
+
"data-state": context.stateAttribute,
|
| 381 |
+
...popperScope,
|
| 382 |
+
...contentProps,
|
| 383 |
+
ref: forwardedRef,
|
| 384 |
+
style: {
|
| 385 |
+
...contentProps.style,
|
| 386 |
+
// re-namespace exposed content custom properties
|
| 387 |
+
...{
|
| 388 |
+
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
| 389 |
+
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
| 390 |
+
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
| 391 |
+
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
| 392 |
+
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
| 393 |
+
}
|
| 394 |
+
},
|
| 395 |
+
children: [
|
| 396 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slottable, { children }),
|
| 397 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenPrimitive.Root, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
| 398 |
+
]
|
| 399 |
+
}
|
| 400 |
+
)
|
| 401 |
+
}
|
| 402 |
+
);
|
| 403 |
+
}
|
| 404 |
+
);
|
| 405 |
+
TooltipContent.displayName = CONTENT_NAME;
|
| 406 |
+
var ARROW_NAME = "TooltipArrow";
|
| 407 |
+
var TooltipArrow = React.forwardRef(
|
| 408 |
+
(props, forwardedRef) => {
|
| 409 |
+
const { __scopeTooltip, ...arrowProps } = props;
|
| 410 |
+
const popperScope = usePopperScope(__scopeTooltip);
|
| 411 |
+
const visuallyHiddenContentContext = useVisuallyHiddenContentContext(
|
| 412 |
+
ARROW_NAME,
|
| 413 |
+
__scopeTooltip
|
| 414 |
+
);
|
| 415 |
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
| 416 |
+
}
|
| 417 |
+
);
|
| 418 |
+
TooltipArrow.displayName = ARROW_NAME;
|
| 419 |
+
function getExitSideFromRect(point, rect) {
|
| 420 |
+
const top = Math.abs(rect.top - point.y);
|
| 421 |
+
const bottom = Math.abs(rect.bottom - point.y);
|
| 422 |
+
const right = Math.abs(rect.right - point.x);
|
| 423 |
+
const left = Math.abs(rect.left - point.x);
|
| 424 |
+
switch (Math.min(top, bottom, right, left)) {
|
| 425 |
+
case left:
|
| 426 |
+
return "left";
|
| 427 |
+
case right:
|
| 428 |
+
return "right";
|
| 429 |
+
case top:
|
| 430 |
+
return "top";
|
| 431 |
+
case bottom:
|
| 432 |
+
return "bottom";
|
| 433 |
+
default:
|
| 434 |
+
throw new Error("unreachable");
|
| 435 |
+
}
|
| 436 |
+
}
|
| 437 |
+
function getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
|
| 438 |
+
const paddedExitPoints = [];
|
| 439 |
+
switch (exitSide) {
|
| 440 |
+
case "top":
|
| 441 |
+
paddedExitPoints.push(
|
| 442 |
+
{ x: exitPoint.x - padding, y: exitPoint.y + padding },
|
| 443 |
+
{ x: exitPoint.x + padding, y: exitPoint.y + padding }
|
| 444 |
+
);
|
| 445 |
+
break;
|
| 446 |
+
case "bottom":
|
| 447 |
+
paddedExitPoints.push(
|
| 448 |
+
{ x: exitPoint.x - padding, y: exitPoint.y - padding },
|
| 449 |
+
{ x: exitPoint.x + padding, y: exitPoint.y - padding }
|
| 450 |
+
);
|
| 451 |
+
break;
|
| 452 |
+
case "left":
|
| 453 |
+
paddedExitPoints.push(
|
| 454 |
+
{ x: exitPoint.x + padding, y: exitPoint.y - padding },
|
| 455 |
+
{ x: exitPoint.x + padding, y: exitPoint.y + padding }
|
| 456 |
+
);
|
| 457 |
+
break;
|
| 458 |
+
case "right":
|
| 459 |
+
paddedExitPoints.push(
|
| 460 |
+
{ x: exitPoint.x - padding, y: exitPoint.y - padding },
|
| 461 |
+
{ x: exitPoint.x - padding, y: exitPoint.y + padding }
|
| 462 |
+
);
|
| 463 |
+
break;
|
| 464 |
+
}
|
| 465 |
+
return paddedExitPoints;
|
| 466 |
+
}
|
| 467 |
+
function getPointsFromRect(rect) {
|
| 468 |
+
const { top, right, bottom, left } = rect;
|
| 469 |
+
return [
|
| 470 |
+
{ x: left, y: top },
|
| 471 |
+
{ x: right, y: top },
|
| 472 |
+
{ x: right, y: bottom },
|
| 473 |
+
{ x: left, y: bottom }
|
| 474 |
+
];
|
| 475 |
+
}
|
| 476 |
+
function isPointInPolygon(point, polygon) {
|
| 477 |
+
const { x, y } = point;
|
| 478 |
+
let inside = false;
|
| 479 |
+
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
| 480 |
+
const ii = polygon[i];
|
| 481 |
+
const jj = polygon[j];
|
| 482 |
+
const xi = ii.x;
|
| 483 |
+
const yi = ii.y;
|
| 484 |
+
const xj = jj.x;
|
| 485 |
+
const yj = jj.y;
|
| 486 |
+
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
| 487 |
+
if (intersect) inside = !inside;
|
| 488 |
+
}
|
| 489 |
+
return inside;
|
| 490 |
+
}
|
| 491 |
+
function getHull(points) {
|
| 492 |
+
const newPoints = points.slice();
|
| 493 |
+
newPoints.sort((a, b) => {
|
| 494 |
+
if (a.x < b.x) return -1;
|
| 495 |
+
else if (a.x > b.x) return 1;
|
| 496 |
+
else if (a.y < b.y) return -1;
|
| 497 |
+
else if (a.y > b.y) return 1;
|
| 498 |
+
else return 0;
|
| 499 |
+
});
|
| 500 |
+
return getHullPresorted(newPoints);
|
| 501 |
+
}
|
| 502 |
+
function getHullPresorted(points) {
|
| 503 |
+
if (points.length <= 1) return points.slice();
|
| 504 |
+
const upperHull = [];
|
| 505 |
+
for (let i = 0; i < points.length; i++) {
|
| 506 |
+
const p = points[i];
|
| 507 |
+
while (upperHull.length >= 2) {
|
| 508 |
+
const q = upperHull[upperHull.length - 1];
|
| 509 |
+
const r = upperHull[upperHull.length - 2];
|
| 510 |
+
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();
|
| 511 |
+
else break;
|
| 512 |
+
}
|
| 513 |
+
upperHull.push(p);
|
| 514 |
+
}
|
| 515 |
+
upperHull.pop();
|
| 516 |
+
const lowerHull = [];
|
| 517 |
+
for (let i = points.length - 1; i >= 0; i--) {
|
| 518 |
+
const p = points[i];
|
| 519 |
+
while (lowerHull.length >= 2) {
|
| 520 |
+
const q = lowerHull[lowerHull.length - 1];
|
| 521 |
+
const r = lowerHull[lowerHull.length - 2];
|
| 522 |
+
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();
|
| 523 |
+
else break;
|
| 524 |
+
}
|
| 525 |
+
lowerHull.push(p);
|
| 526 |
+
}
|
| 527 |
+
lowerHull.pop();
|
| 528 |
+
if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {
|
| 529 |
+
return upperHull;
|
| 530 |
+
} else {
|
| 531 |
+
return upperHull.concat(lowerHull);
|
| 532 |
+
}
|
| 533 |
+
}
|
| 534 |
+
var Provider = TooltipProvider;
|
| 535 |
+
var Root3 = Tooltip;
|
| 536 |
+
var Trigger = TooltipTrigger;
|
| 537 |
+
var Portal = TooltipPortal;
|
| 538 |
+
var Content2 = TooltipContent;
|
| 539 |
+
var Arrow2 = TooltipArrow;
|
| 540 |
+
//# sourceMappingURL=index.js.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/tooltip.tsx"],
|
| 4 |
+
"sourcesContent": ["'use client';\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} from './tooltip';\nexport type {\n TooltipProps,\n TooltipProviderProps,\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 { createSlottable } 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 { 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 isOpenDelayedRef: React.MutableRefObject<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 isOpenDelayedRef = React.useRef(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 isOpenDelayedRef={isOpenDelayedRef}\n delayDuration={delayDuration}\n onOpen={React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n isOpenDelayedRef.current = false;\n }, [])}\n onClose={React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => (isOpenDelayedRef.current = 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,\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, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\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 caller: TOOLTIP_NAME,\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 openTimerRef.current = 0;\n wasOpenDelayedRef.current = false;\n setOpen(true);\n }, [setOpen]);\n\n const handleClose = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\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 openTimerRef.current = 0;\n }, delayDuration);\n }, [delayDuration, setOpen]);\n\n React.useEffect(() => {\n return () => {\n if (openTimerRef.current) {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n }\n };\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.isOpenDelayedRef.current) handleDelayedOpen();\n else handleOpen();\n }, [providerContext.isOpenDelayedRef, 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 openTimerRef.current = 0;\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.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.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 if (context.open) {\n context.onClose();\n }\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 {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\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 const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n const graceArea = getHull([...paddedExitPoints, ...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.ComponentRef<typeof PopperPrimitive.Content>;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = React.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 Slottable = createSlottable('TooltipContent');\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.ComponentRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = React.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\ntype Side = NonNullable<TooltipContentProps['side']>;\n\nfunction getExitSideFromRect(point: Point, rect: DOMRect): Side {\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 throw new Error('unreachable');\n }\n}\n\nfunction getPaddedExitPoints(exitPoint: Point, exitSide: Side, padding = 5) {\n const paddedExitPoints: Point[] = [];\n switch (exitSide) {\n case 'top':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case 'bottom':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y - padding }\n );\n break;\n case 'left':\n paddedExitPoints.push(\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case 'right':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x - padding, y: exitPoint.y + padding }\n );\n break;\n }\n return paddedExitPoints;\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 ii = polygon[i]!;\n const jj = polygon[j]!;\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.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 TooltipProviderProps,\n TooltipProps,\n TooltipTriggerProps,\n TooltipPortalProps,\n TooltipContentProps,\n TooltipArrowProps,\n};\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA,eAAAC;AAAA,EAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,gCAAgC;AAChC,2BAAmC;AACnC,qCAAiC;AACjC,sBAAsB;AACtB,sBAAiC;A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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
// src/tooltip.tsx
|
| 4 |
+
import * as React from "react";
|
| 5 |
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
| 6 |
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
| 7 |
+
import { createContextScope } from "@radix-ui/react-context";
|
| 8 |
+
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
| 9 |
+
import { useId } from "@radix-ui/react-id";
|
| 10 |
+
import * as PopperPrimitive from "@radix-ui/react-popper";
|
| 11 |
+
import { createPopperScope } from "@radix-ui/react-popper";
|
| 12 |
+
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
| 13 |
+
import { Presence } from "@radix-ui/react-presence";
|
| 14 |
+
import { Primitive } from "@radix-ui/react-primitive";
|
| 15 |
+
import { createSlottable } from "@radix-ui/react-slot";
|
| 16 |
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
| 17 |
+
import * as VisuallyHiddenPrimitive from "@radix-ui/react-visually-hidden";
|
| 18 |
+
import { jsx, jsxs } from "react/jsx-runtime";
|
| 19 |
+
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
| 20 |
+
createPopperScope
|
| 21 |
+
]);
|
| 22 |
+
var usePopperScope = createPopperScope();
|
| 23 |
+
var PROVIDER_NAME = "TooltipProvider";
|
| 24 |
+
var DEFAULT_DELAY_DURATION = 700;
|
| 25 |
+
var TOOLTIP_OPEN = "tooltip.open";
|
| 26 |
+
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
| 27 |
+
var TooltipProvider = (props) => {
|
| 28 |
+
const {
|
| 29 |
+
__scopeTooltip,
|
| 30 |
+
delayDuration = DEFAULT_DELAY_DURATION,
|
| 31 |
+
skipDelayDuration = 300,
|
| 32 |
+
disableHoverableContent = false,
|
| 33 |
+
children
|
| 34 |
+
} = props;
|
| 35 |
+
const isOpenDelayedRef = React.useRef(true);
|
| 36 |
+
const isPointerInTransitRef = React.useRef(false);
|
| 37 |
+
const skipDelayTimerRef = React.useRef(0);
|
| 38 |
+
React.useEffect(() => {
|
| 39 |
+
const skipDelayTimer = skipDelayTimerRef.current;
|
| 40 |
+
return () => window.clearTimeout(skipDelayTimer);
|
| 41 |
+
}, []);
|
| 42 |
+
return /* @__PURE__ */ jsx(
|
| 43 |
+
TooltipProviderContextProvider,
|
| 44 |
+
{
|
| 45 |
+
scope: __scopeTooltip,
|
| 46 |
+
isOpenDelayedRef,
|
| 47 |
+
delayDuration,
|
| 48 |
+
onOpen: React.useCallback(() => {
|
| 49 |
+
window.clearTimeout(skipDelayTimerRef.current);
|
| 50 |
+
isOpenDelayedRef.current = false;
|
| 51 |
+
}, []),
|
| 52 |
+
onClose: React.useCallback(() => {
|
| 53 |
+
window.clearTimeout(skipDelayTimerRef.current);
|
| 54 |
+
skipDelayTimerRef.current = window.setTimeout(
|
| 55 |
+
() => isOpenDelayedRef.current = true,
|
| 56 |
+
skipDelayDuration
|
| 57 |
+
);
|
| 58 |
+
}, [skipDelayDuration]),
|
| 59 |
+
isPointerInTransitRef,
|
| 60 |
+
onPointerInTransitChange: React.useCallback((inTransit) => {
|
| 61 |
+
isPointerInTransitRef.current = inTransit;
|
| 62 |
+
}, []),
|
| 63 |
+
disableHoverableContent,
|
| 64 |
+
children
|
| 65 |
+
}
|
| 66 |
+
);
|
| 67 |
+
};
|
| 68 |
+
TooltipProvider.displayName = PROVIDER_NAME;
|
| 69 |
+
var TOOLTIP_NAME = "Tooltip";
|
| 70 |
+
var [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);
|
| 71 |
+
var Tooltip = (props) => {
|
| 72 |
+
const {
|
| 73 |
+
__scopeTooltip,
|
| 74 |
+
children,
|
| 75 |
+
open: openProp,
|
| 76 |
+
defaultOpen,
|
| 77 |
+
onOpenChange,
|
| 78 |
+
disableHoverableContent: disableHoverableContentProp,
|
| 79 |
+
delayDuration: delayDurationProp
|
| 80 |
+
} = props;
|
| 81 |
+
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
| 82 |
+
const popperScope = usePopperScope(__scopeTooltip);
|
| 83 |
+
const [trigger, setTrigger] = React.useState(null);
|
| 84 |
+
const contentId = useId();
|
| 85 |
+
const openTimerRef = React.useRef(0);
|
| 86 |
+
const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
|
| 87 |
+
const delayDuration = delayDurationProp ?? providerContext.delayDuration;
|
| 88 |
+
const wasOpenDelayedRef = React.useRef(false);
|
| 89 |
+
const [open, setOpen] = useControllableState({
|
| 90 |
+
prop: openProp,
|
| 91 |
+
defaultProp: defaultOpen ?? false,
|
| 92 |
+
onChange: (open2) => {
|
| 93 |
+
if (open2) {
|
| 94 |
+
providerContext.onOpen();
|
| 95 |
+
document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));
|
| 96 |
+
} else {
|
| 97 |
+
providerContext.onClose();
|
| 98 |
+
}
|
| 99 |
+
onOpenChange?.(open2);
|
| 100 |
+
},
|
| 101 |
+
caller: TOOLTIP_NAME
|
| 102 |
+
});
|
| 103 |
+
const stateAttribute = React.useMemo(() => {
|
| 104 |
+
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
| 105 |
+
}, [open]);
|
| 106 |
+
const handleOpen = React.useCallback(() => {
|
| 107 |
+
window.clearTimeout(openTimerRef.current);
|
| 108 |
+
openTimerRef.current = 0;
|
| 109 |
+
wasOpenDelayedRef.current = false;
|
| 110 |
+
setOpen(true);
|
| 111 |
+
}, [setOpen]);
|
| 112 |
+
const handleClose = React.useCallback(() => {
|
| 113 |
+
window.clearTimeout(openTimerRef.current);
|
| 114 |
+
openTimerRef.current = 0;
|
| 115 |
+
setOpen(false);
|
| 116 |
+
}, [setOpen]);
|
| 117 |
+
const handleDelayedOpen = React.useCallback(() => {
|
| 118 |
+
window.clearTimeout(openTimerRef.current);
|
| 119 |
+
openTimerRef.current = window.setTimeout(() => {
|
| 120 |
+
wasOpenDelayedRef.current = true;
|
| 121 |
+
setOpen(true);
|
| 122 |
+
openTimerRef.current = 0;
|
| 123 |
+
}, delayDuration);
|
| 124 |
+
}, [delayDuration, setOpen]);
|
| 125 |
+
React.useEffect(() => {
|
| 126 |
+
return () => {
|
| 127 |
+
if (openTimerRef.current) {
|
| 128 |
+
window.clearTimeout(openTimerRef.current);
|
| 129 |
+
openTimerRef.current = 0;
|
| 130 |
+
}
|
| 131 |
+
};
|
| 132 |
+
}, []);
|
| 133 |
+
return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(
|
| 134 |
+
TooltipContextProvider,
|
| 135 |
+
{
|
| 136 |
+
scope: __scopeTooltip,
|
| 137 |
+
contentId,
|
| 138 |
+
open,
|
| 139 |
+
stateAttribute,
|
| 140 |
+
trigger,
|
| 141 |
+
onTriggerChange: setTrigger,
|
| 142 |
+
onTriggerEnter: React.useCallback(() => {
|
| 143 |
+
if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
|
| 144 |
+
else handleOpen();
|
| 145 |
+
}, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
|
| 146 |
+
onTriggerLeave: React.useCallback(() => {
|
| 147 |
+
if (disableHoverableContent) {
|
| 148 |
+
handleClose();
|
| 149 |
+
} else {
|
| 150 |
+
window.clearTimeout(openTimerRef.current);
|
| 151 |
+
openTimerRef.current = 0;
|
| 152 |
+
}
|
| 153 |
+
}, [handleClose, disableHoverableContent]),
|
| 154 |
+
onOpen: handleOpen,
|
| 155 |
+
onClose: handleClose,
|
| 156 |
+
disableHoverableContent,
|
| 157 |
+
children
|
| 158 |
+
}
|
| 159 |
+
) });
|
| 160 |
+
};
|
| 161 |
+
Tooltip.displayName = TOOLTIP_NAME;
|
| 162 |
+
var TRIGGER_NAME = "TooltipTrigger";
|
| 163 |
+
var TooltipTrigger = React.forwardRef(
|
| 164 |
+
(props, forwardedRef) => {
|
| 165 |
+
const { __scopeTooltip, ...triggerProps } = props;
|
| 166 |
+
const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);
|
| 167 |
+
const providerContext = useTooltipProviderContext(TRIGGER_NAME, __scopeTooltip);
|
| 168 |
+
const popperScope = usePopperScope(__scopeTooltip);
|
| 169 |
+
const ref = React.useRef(null);
|
| 170 |
+
const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);
|
| 171 |
+
const isPointerDownRef = React.useRef(false);
|
| 172 |
+
const hasPointerMoveOpenedRef = React.useRef(false);
|
| 173 |
+
const handlePointerUp = React.useCallback(() => isPointerDownRef.current = false, []);
|
| 174 |
+
React.useEffect(() => {
|
| 175 |
+
return () => document.removeEventListener("pointerup", handlePointerUp);
|
| 176 |
+
}, [handlePointerUp]);
|
| 177 |
+
return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(
|
| 178 |
+
Primitive.button,
|
| 179 |
+
{
|
| 180 |
+
"aria-describedby": context.open ? context.contentId : void 0,
|
| 181 |
+
"data-state": context.stateAttribute,
|
| 182 |
+
...triggerProps,
|
| 183 |
+
ref: composedRefs,
|
| 184 |
+
onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {
|
| 185 |
+
if (event.pointerType === "touch") return;
|
| 186 |
+
if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {
|
| 187 |
+
context.onTriggerEnter();
|
| 188 |
+
hasPointerMoveOpenedRef.current = true;
|
| 189 |
+
}
|
| 190 |
+
}),
|
| 191 |
+
onPointerLeave: composeEventHandlers(props.onPointerLeave, () => {
|
| 192 |
+
context.onTriggerLeave();
|
| 193 |
+
hasPointerMoveOpenedRef.current = false;
|
| 194 |
+
}),
|
| 195 |
+
onPointerDown: composeEventHandlers(props.onPointerDown, () => {
|
| 196 |
+
if (context.open) {
|
| 197 |
+
context.onClose();
|
| 198 |
+
}
|
| 199 |
+
isPointerDownRef.current = true;
|
| 200 |
+
document.addEventListener("pointerup", handlePointerUp, { once: true });
|
| 201 |
+
}),
|
| 202 |
+
onFocus: composeEventHandlers(props.onFocus, () => {
|
| 203 |
+
if (!isPointerDownRef.current) context.onOpen();
|
| 204 |
+
}),
|
| 205 |
+
onBlur: composeEventHandlers(props.onBlur, context.onClose),
|
| 206 |
+
onClick: composeEventHandlers(props.onClick, context.onClose)
|
| 207 |
+
}
|
| 208 |
+
) });
|
| 209 |
+
}
|
| 210 |
+
);
|
| 211 |
+
TooltipTrigger.displayName = TRIGGER_NAME;
|
| 212 |
+
var PORTAL_NAME = "TooltipPortal";
|
| 213 |
+
var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
|
| 214 |
+
forceMount: void 0
|
| 215 |
+
});
|
| 216 |
+
var TooltipPortal = (props) => {
|
| 217 |
+
const { __scopeTooltip, forceMount, children, container } = props;
|
| 218 |
+
const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);
|
| 219 |
+
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });
|
| 220 |
+
};
|
| 221 |
+
TooltipPortal.displayName = PORTAL_NAME;
|
| 222 |
+
var CONTENT_NAME = "TooltipContent";
|
| 223 |
+
var TooltipContent = React.forwardRef(
|
| 224 |
+
(props, forwardedRef) => {
|
| 225 |
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);
|
| 226 |
+
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
| 227 |
+
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
| 228 |
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
| 229 |
+
}
|
| 230 |
+
);
|
| 231 |
+
var TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {
|
| 232 |
+
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
| 233 |
+
const providerContext = useTooltipProviderContext(CONTENT_NAME, props.__scopeTooltip);
|
| 234 |
+
const ref = React.useRef(null);
|
| 235 |
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
| 236 |
+
const [pointerGraceArea, setPointerGraceArea] = React.useState(null);
|
| 237 |
+
const { trigger, onClose } = context;
|
| 238 |
+
const content = ref.current;
|
| 239 |
+
const { onPointerInTransitChange } = providerContext;
|
| 240 |
+
const handleRemoveGraceArea = React.useCallback(() => {
|
| 241 |
+
setPointerGraceArea(null);
|
| 242 |
+
onPointerInTransitChange(false);
|
| 243 |
+
}, [onPointerInTransitChange]);
|
| 244 |
+
const handleCreateGraceArea = React.useCallback(
|
| 245 |
+
(event, hoverTarget) => {
|
| 246 |
+
const currentTarget = event.currentTarget;
|
| 247 |
+
const exitPoint = { x: event.clientX, y: event.clientY };
|
| 248 |
+
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
| 249 |
+
const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
|
| 250 |
+
const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
|
| 251 |
+
const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);
|
| 252 |
+
setPointerGraceArea(graceArea);
|
| 253 |
+
onPointerInTransitChange(true);
|
| 254 |
+
},
|
| 255 |
+
[onPointerInTransitChange]
|
| 256 |
+
);
|
| 257 |
+
React.useEffect(() => {
|
| 258 |
+
return () => handleRemoveGraceArea();
|
| 259 |
+
}, [handleRemoveGraceArea]);
|
| 260 |
+
React.useEffect(() => {
|
| 261 |
+
if (trigger && content) {
|
| 262 |
+
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
| 263 |
+
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
| 264 |
+
trigger.addEventListener("pointerleave", handleTriggerLeave);
|
| 265 |
+
content.addEventListener("pointerleave", handleContentLeave);
|
| 266 |
+
return () => {
|
| 267 |
+
trigger.removeEventListener("pointerleave", handleTriggerLeave);
|
| 268 |
+
content.removeEventListener("pointerleave", handleContentLeave);
|
| 269 |
+
};
|
| 270 |
+
}
|
| 271 |
+
}, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);
|
| 272 |
+
React.useEffect(() => {
|
| 273 |
+
if (pointerGraceArea) {
|
| 274 |
+
const handleTrackPointerGrace = (event) => {
|
| 275 |
+
const target = event.target;
|
| 276 |
+
const pointerPosition = { x: event.clientX, y: event.clientY };
|
| 277 |
+
const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);
|
| 278 |
+
const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
|
| 279 |
+
if (hasEnteredTarget) {
|
| 280 |
+
handleRemoveGraceArea();
|
| 281 |
+
} else if (isPointerOutsideGraceArea) {
|
| 282 |
+
handleRemoveGraceArea();
|
| 283 |
+
onClose();
|
| 284 |
+
}
|
| 285 |
+
};
|
| 286 |
+
document.addEventListener("pointermove", handleTrackPointerGrace);
|
| 287 |
+
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
| 288 |
+
}
|
| 289 |
+
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
| 290 |
+
return /* @__PURE__ */ jsx(TooltipContentImpl, { ...props, ref: composedRefs });
|
| 291 |
+
});
|
| 292 |
+
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
| 293 |
+
var Slottable = createSlottable("TooltipContent");
|
| 294 |
+
var TooltipContentImpl = React.forwardRef(
|
| 295 |
+
(props, forwardedRef) => {
|
| 296 |
+
const {
|
| 297 |
+
__scopeTooltip,
|
| 298 |
+
children,
|
| 299 |
+
"aria-label": ariaLabel,
|
| 300 |
+
onEscapeKeyDown,
|
| 301 |
+
onPointerDownOutside,
|
| 302 |
+
...contentProps
|
| 303 |
+
} = props;
|
| 304 |
+
const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);
|
| 305 |
+
const popperScope = usePopperScope(__scopeTooltip);
|
| 306 |
+
const { onClose } = context;
|
| 307 |
+
React.useEffect(() => {
|
| 308 |
+
document.addEventListener(TOOLTIP_OPEN, onClose);
|
| 309 |
+
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
| 310 |
+
}, [onClose]);
|
| 311 |
+
React.useEffect(() => {
|
| 312 |
+
if (context.trigger) {
|
| 313 |
+
const handleScroll = (event) => {
|
| 314 |
+
const target = event.target;
|
| 315 |
+
if (target?.contains(context.trigger)) onClose();
|
| 316 |
+
};
|
| 317 |
+
window.addEventListener("scroll", handleScroll, { capture: true });
|
| 318 |
+
return () => window.removeEventListener("scroll", handleScroll, { capture: true });
|
| 319 |
+
}
|
| 320 |
+
}, [context.trigger, onClose]);
|
| 321 |
+
return /* @__PURE__ */ jsx(
|
| 322 |
+
DismissableLayer,
|
| 323 |
+
{
|
| 324 |
+
asChild: true,
|
| 325 |
+
disableOutsidePointerEvents: false,
|
| 326 |
+
onEscapeKeyDown,
|
| 327 |
+
onPointerDownOutside,
|
| 328 |
+
onFocusOutside: (event) => event.preventDefault(),
|
| 329 |
+
onDismiss: onClose,
|
| 330 |
+
children: /* @__PURE__ */ jsxs(
|
| 331 |
+
PopperPrimitive.Content,
|
| 332 |
+
{
|
| 333 |
+
"data-state": context.stateAttribute,
|
| 334 |
+
...popperScope,
|
| 335 |
+
...contentProps,
|
| 336 |
+
ref: forwardedRef,
|
| 337 |
+
style: {
|
| 338 |
+
...contentProps.style,
|
| 339 |
+
// re-namespace exposed content custom properties
|
| 340 |
+
...{
|
| 341 |
+
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
| 342 |
+
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
| 343 |
+
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
| 344 |
+
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
| 345 |
+
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
| 346 |
+
}
|
| 347 |
+
},
|
| 348 |
+
children: [
|
| 349 |
+
/* @__PURE__ */ jsx(Slottable, { children }),
|
| 350 |
+
/* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(VisuallyHiddenPrimitive.Root, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
| 351 |
+
]
|
| 352 |
+
}
|
| 353 |
+
)
|
| 354 |
+
}
|
| 355 |
+
);
|
| 356 |
+
}
|
| 357 |
+
);
|
| 358 |
+
TooltipContent.displayName = CONTENT_NAME;
|
| 359 |
+
var ARROW_NAME = "TooltipArrow";
|
| 360 |
+
var TooltipArrow = React.forwardRef(
|
| 361 |
+
(props, forwardedRef) => {
|
| 362 |
+
const { __scopeTooltip, ...arrowProps } = props;
|
| 363 |
+
const popperScope = usePopperScope(__scopeTooltip);
|
| 364 |
+
const visuallyHiddenContentContext = useVisuallyHiddenContentContext(
|
| 365 |
+
ARROW_NAME,
|
| 366 |
+
__scopeTooltip
|
| 367 |
+
);
|
| 368 |
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
| 369 |
+
}
|
| 370 |
+
);
|
| 371 |
+
TooltipArrow.displayName = ARROW_NAME;
|
| 372 |
+
function getExitSideFromRect(point, rect) {
|
| 373 |
+
const top = Math.abs(rect.top - point.y);
|
| 374 |
+
const bottom = Math.abs(rect.bottom - point.y);
|
| 375 |
+
const right = Math.abs(rect.right - point.x);
|
| 376 |
+
const left = Math.abs(rect.left - point.x);
|
| 377 |
+
switch (Math.min(top, bottom, right, left)) {
|
| 378 |
+
case left:
|
| 379 |
+
return "left";
|
| 380 |
+
case right:
|
| 381 |
+
return "right";
|
| 382 |
+
case top:
|
| 383 |
+
return "top";
|
| 384 |
+
case bottom:
|
| 385 |
+
return "bottom";
|
| 386 |
+
default:
|
| 387 |
+
throw new Error("unreachable");
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
function getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
|
| 391 |
+
const paddedExitPoints = [];
|
| 392 |
+
switch (exitSide) {
|
| 393 |
+
case "top":
|
| 394 |
+
paddedExitPoints.push(
|
| 395 |
+
{ x: exitPoint.x - padding, y: exitPoint.y + padding },
|
| 396 |
+
{ x: exitPoint.x + padding, y: exitPoint.y + padding }
|
| 397 |
+
);
|
| 398 |
+
break;
|
| 399 |
+
case "bottom":
|
| 400 |
+
paddedExitPoints.push(
|
| 401 |
+
{ x: exitPoint.x - padding, y: exitPoint.y - padding },
|
| 402 |
+
{ x: exitPoint.x + padding, y: exitPoint.y - padding }
|
| 403 |
+
);
|
| 404 |
+
break;
|
| 405 |
+
case "left":
|
| 406 |
+
paddedExitPoints.push(
|
| 407 |
+
{ x: exitPoint.x + padding, y: exitPoint.y - padding },
|
| 408 |
+
{ x: exitPoint.x + padding, y: exitPoint.y + padding }
|
| 409 |
+
);
|
| 410 |
+
break;
|
| 411 |
+
case "right":
|
| 412 |
+
paddedExitPoints.push(
|
| 413 |
+
{ x: exitPoint.x - padding, y: exitPoint.y - padding },
|
| 414 |
+
{ x: exitPoint.x - padding, y: exitPoint.y + padding }
|
| 415 |
+
);
|
| 416 |
+
break;
|
| 417 |
+
}
|
| 418 |
+
return paddedExitPoints;
|
| 419 |
+
}
|
| 420 |
+
function getPointsFromRect(rect) {
|
| 421 |
+
const { top, right, bottom, left } = rect;
|
| 422 |
+
return [
|
| 423 |
+
{ x: left, y: top },
|
| 424 |
+
{ x: right, y: top },
|
| 425 |
+
{ x: right, y: bottom },
|
| 426 |
+
{ x: left, y: bottom }
|
| 427 |
+
];
|
| 428 |
+
}
|
| 429 |
+
function isPointInPolygon(point, polygon) {
|
| 430 |
+
const { x, y } = point;
|
| 431 |
+
let inside = false;
|
| 432 |
+
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
| 433 |
+
const ii = polygon[i];
|
| 434 |
+
const jj = polygon[j];
|
| 435 |
+
const xi = ii.x;
|
| 436 |
+
const yi = ii.y;
|
| 437 |
+
const xj = jj.x;
|
| 438 |
+
const yj = jj.y;
|
| 439 |
+
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
| 440 |
+
if (intersect) inside = !inside;
|
| 441 |
+
}
|
| 442 |
+
return inside;
|
| 443 |
+
}
|
| 444 |
+
function getHull(points) {
|
| 445 |
+
const newPoints = points.slice();
|
| 446 |
+
newPoints.sort((a, b) => {
|
| 447 |
+
if (a.x < b.x) return -1;
|
| 448 |
+
else if (a.x > b.x) return 1;
|
| 449 |
+
else if (a.y < b.y) return -1;
|
| 450 |
+
else if (a.y > b.y) return 1;
|
| 451 |
+
else return 0;
|
| 452 |
+
});
|
| 453 |
+
return getHullPresorted(newPoints);
|
| 454 |
+
}
|
| 455 |
+
function getHullPresorted(points) {
|
| 456 |
+
if (points.length <= 1) return points.slice();
|
| 457 |
+
const upperHull = [];
|
| 458 |
+
for (let i = 0; i < points.length; i++) {
|
| 459 |
+
const p = points[i];
|
| 460 |
+
while (upperHull.length >= 2) {
|
| 461 |
+
const q = upperHull[upperHull.length - 1];
|
| 462 |
+
const r = upperHull[upperHull.length - 2];
|
| 463 |
+
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();
|
| 464 |
+
else break;
|
| 465 |
+
}
|
| 466 |
+
upperHull.push(p);
|
| 467 |
+
}
|
| 468 |
+
upperHull.pop();
|
| 469 |
+
const lowerHull = [];
|
| 470 |
+
for (let i = points.length - 1; i >= 0; i--) {
|
| 471 |
+
const p = points[i];
|
| 472 |
+
while (lowerHull.length >= 2) {
|
| 473 |
+
const q = lowerHull[lowerHull.length - 1];
|
| 474 |
+
const r = lowerHull[lowerHull.length - 2];
|
| 475 |
+
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();
|
| 476 |
+
else break;
|
| 477 |
+
}
|
| 478 |
+
lowerHull.push(p);
|
| 479 |
+
}
|
| 480 |
+
lowerHull.pop();
|
| 481 |
+
if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {
|
| 482 |
+
return upperHull;
|
| 483 |
+
} else {
|
| 484 |
+
return upperHull.concat(lowerHull);
|
| 485 |
+
}
|
| 486 |
+
}
|
| 487 |
+
var Provider = TooltipProvider;
|
| 488 |
+
var Root3 = Tooltip;
|
| 489 |
+
var Trigger = TooltipTrigger;
|
| 490 |
+
var Portal = TooltipPortal;
|
| 491 |
+
var Content2 = TooltipContent;
|
| 492 |
+
var Arrow2 = TooltipArrow;
|
| 493 |
+
export {
|
| 494 |
+
Arrow2 as Arrow,
|
| 495 |
+
Content2 as Content,
|
| 496 |
+
Portal,
|
| 497 |
+
Provider,
|
| 498 |
+
Root3 as Root,
|
| 499 |
+
Tooltip,
|
| 500 |
+
TooltipArrow,
|
| 501 |
+
TooltipContent,
|
| 502 |
+
TooltipPortal,
|
| 503 |
+
TooltipProvider,
|
| 504 |
+
TooltipTrigger,
|
| 505 |
+
Trigger,
|
| 506 |
+
createTooltipScope
|
| 507 |
+
};
|
| 508 |
+
//# sourceMappingURL=index.mjs.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/tooltip.tsx"],
|
| 4 |
+
"sourcesContent": ["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 { createSlottable } 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 { 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 isOpenDelayedRef: React.MutableRefObject<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 isOpenDelayedRef = React.useRef(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 isOpenDelayedRef={isOpenDelayedRef}\n delayDuration={delayDuration}\n onOpen={React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n isOpenDelayedRef.current = false;\n }, [])}\n onClose={React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => (isOpenDelayedRef.current = 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,\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, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\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 caller: TOOLTIP_NAME,\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 openTimerRef.current = 0;\n wasOpenDelayedRef.current = false;\n setOpen(true);\n }, [setOpen]);\n\n const handleClose = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\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 openTimerRef.current = 0;\n }, delayDuration);\n }, [delayDuration, setOpen]);\n\n React.useEffect(() => {\n return () => {\n if (openTimerRef.current) {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n }\n };\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.isOpenDelayedRef.current) handleDelayedOpen();\n else handleOpen();\n }, [providerContext.isOpenDelayedRef, 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 openTimerRef.current = 0;\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.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.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 if (context.open) {\n context.onClose();\n }\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 {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\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 const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n const graceArea = getHull([...paddedExitPoints, ...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.ComponentRef<typeof PopperPrimitive.Content>;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = React.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 Slottable = createSlottable('TooltipContent');\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.ComponentRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = React.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\ntype Side = NonNullable<TooltipContentProps['side']>;\n\nfunction getExitSideFromRect(point: Point, rect: DOMRect): Side {\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 throw new Error('unreachable');\n }\n}\n\nfunction getPaddedExitPoints(exitPoint: Point, exitSide: Side, padding = 5) {\n const paddedExitPoints: Point[] = [];\n switch (exitSide) {\n case 'top':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case 'bottom':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y - padding }\n );\n break;\n case 'left':\n paddedExitPoints.push(\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case 'right':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x - padding, y: exitPoint.y + padding }\n );\n break;\n }\n return paddedExitPoints;\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 ii = polygon[i]!;\n const jj = polygon[j]!;\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.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 TooltipProviderProps,\n TooltipProps,\n TooltipTriggerProps,\n TooltipPortalProps,\n TooltipContentProps,\n TooltipArrowProps,\n};\n"],
|
| 5 |
+
"mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,aAAa;AACtB,YAAY,qBAAqB;AACjC,SAAS,yBAAyB;AAClC,SAAS,UAAU,uBAAuB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,YAAY,6BAA6B;AAsErC,cAgdI,YAhdJ;AAjEJ,IAAM,CAAC,sBAAsB,kBAAkB,IAAI,mBAAmB,WAAW;AAAA,EAC/E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C,YAAM,IAAI,UAAU,UAAU,SAAS,CAAC;AACxC,WAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAI,WAAU,IAAI;AAAA,UACrE;AAAA,IACP;AACA,cAAU,KAAK,CAAC;AAAA,EAClB;AACA,YAAU,IAAI;AAEd,QAAM,YAAsB,CAAC;AAC7B,WAAS,IAAI,OAAO,SAAS,GAAG,KAAK,GAAG,KAAK;AAC3C,UAAM,IAAI,OAAO,CAAC;AAClB,WAAO,UAAU,UAAU,GAAG;AAC5B,YAAM,IAAI,UAAU,UAAU,SAAS,CAAC;AACxC,YAAM,IAAI,UAAU,UAAU,SAAS,CAAC;AACxC,WAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAI,WAAU,IAAI;AAAA,UACrE;AAAA,IACP;AACA,cAAU,KAAK,CAAC;AAAA,EAClB;AACA,YAAU,IAAI;AAEd,MACE,UAAU,WAAW,KACrB,UAAU,WAAW,KACrB,UAAU,CAAC,EAAG,MAAM,UAAU,CAAC,EAAG,KAClC,UAAU,CAAC,EAAG,MAAM,UAAU,CAAC,EAAG,GAClC;AACA,WAAO;AAAA,EACT,OAAO;AACL,WAAO,UAAU,OAAO,SAAS;AAAA,EACnC;AACF;AAEA,IAAM,WAAW;AACjB,IAAMC,QAAO;AACb,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,SAAQ;",
|
| 6 |
+
"names": ["open", "Root", "Content", "Arrow"]
|
| 7 |
+
}
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2022 WorkOS
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# `primitive`
|
| 2 |
+
|
| 3 |
+
This is an internal utility, not intended for public usage.
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const canUseDOM: boolean;
|
| 2 |
+
declare function composeEventHandlers<E extends {
|
| 3 |
+
defaultPrevented: boolean;
|
| 4 |
+
}>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
| 5 |
+
checkForDefaultPrevented?: boolean | undefined;
|
| 6 |
+
}): (event: E) => void;
|
| 7 |
+
declare function getOwnerWindow(element: Node | null | undefined): Window & typeof globalThis;
|
| 8 |
+
declare function getOwnerDocument(element: Node | null | undefined): Document;
|
| 9 |
+
/**
|
| 10 |
+
* Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37
|
| 11 |
+
* MIT License, Copyright (c) AriaKit.
|
| 12 |
+
*/
|
| 13 |
+
declare function getActiveElement(node: Node | null | undefined, activeDescendant?: boolean): HTMLElement | null;
|
| 14 |
+
declare function isFrame(element: Element): element is HTMLIFrameElement;
|
| 15 |
+
|
| 16 |
+
type Timeout = ReturnType<typeof setTimeout>;
|
| 17 |
+
type Interval = ReturnType<typeof setInterval>;
|
| 18 |
+
type Immediate = ReturnType<typeof setImmediate>;
|
| 19 |
+
|
| 20 |
+
export { type Immediate, type Interval, type Timeout, canUseDOM, composeEventHandlers, getActiveElement, getOwnerDocument, getOwnerWindow, isFrame };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const canUseDOM: boolean;
|
| 2 |
+
declare function composeEventHandlers<E extends {
|
| 3 |
+
defaultPrevented: boolean;
|
| 4 |
+
}>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
| 5 |
+
checkForDefaultPrevented?: boolean | undefined;
|
| 6 |
+
}): (event: E) => void;
|
| 7 |
+
declare function getOwnerWindow(element: Node | null | undefined): Window & typeof globalThis;
|
| 8 |
+
declare function getOwnerDocument(element: Node | null | undefined): Document;
|
| 9 |
+
/**
|
| 10 |
+
* Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37
|
| 11 |
+
* MIT License, Copyright (c) AriaKit.
|
| 12 |
+
*/
|
| 13 |
+
declare function getActiveElement(node: Node | null | undefined, activeDescendant?: boolean): HTMLElement | null;
|
| 14 |
+
declare function isFrame(element: Element): element is HTMLIFrameElement;
|
| 15 |
+
|
| 16 |
+
type Timeout = ReturnType<typeof setTimeout>;
|
| 17 |
+
type Interval = ReturnType<typeof setInterval>;
|
| 18 |
+
type Immediate = ReturnType<typeof setImmediate>;
|
| 19 |
+
|
| 20 |
+
export { type Immediate, type Interval, type Timeout, canUseDOM, composeEventHandlers, getActiveElement, getOwnerDocument, getOwnerWindow, isFrame };
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __defProp = Object.defineProperty;
|
| 3 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 4 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 5 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 6 |
+
var __export = (target, all) => {
|
| 7 |
+
for (var name in all)
|
| 8 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 9 |
+
};
|
| 10 |
+
var __copyProps = (to, from, except, desc) => {
|
| 11 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 12 |
+
for (let key of __getOwnPropNames(from))
|
| 13 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 14 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 15 |
+
}
|
| 16 |
+
return to;
|
| 17 |
+
};
|
| 18 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 19 |
+
|
| 20 |
+
// src/index.ts
|
| 21 |
+
var index_exports = {};
|
| 22 |
+
__export(index_exports, {
|
| 23 |
+
canUseDOM: () => canUseDOM,
|
| 24 |
+
composeEventHandlers: () => composeEventHandlers,
|
| 25 |
+
getActiveElement: () => getActiveElement,
|
| 26 |
+
getOwnerDocument: () => getOwnerDocument,
|
| 27 |
+
getOwnerWindow: () => getOwnerWindow,
|
| 28 |
+
isFrame: () => isFrame
|
| 29 |
+
});
|
| 30 |
+
module.exports = __toCommonJS(index_exports);
|
| 31 |
+
|
| 32 |
+
// src/primitive.tsx
|
| 33 |
+
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
| 34 |
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
| 35 |
+
return function handleEvent(event) {
|
| 36 |
+
originalEventHandler?.(event);
|
| 37 |
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
| 38 |
+
return ourEventHandler?.(event);
|
| 39 |
+
}
|
| 40 |
+
};
|
| 41 |
+
}
|
| 42 |
+
function getOwnerWindow(element) {
|
| 43 |
+
if (!canUseDOM) {
|
| 44 |
+
throw new Error("Cannot access window outside of the DOM");
|
| 45 |
+
}
|
| 46 |
+
return element?.ownerDocument?.defaultView ?? window;
|
| 47 |
+
}
|
| 48 |
+
function getOwnerDocument(element) {
|
| 49 |
+
if (!canUseDOM) {
|
| 50 |
+
throw new Error("Cannot access document outside of the DOM");
|
| 51 |
+
}
|
| 52 |
+
return element?.ownerDocument ?? document;
|
| 53 |
+
}
|
| 54 |
+
function getActiveElement(node, activeDescendant = false) {
|
| 55 |
+
const { activeElement } = getOwnerDocument(node);
|
| 56 |
+
if (!activeElement?.nodeName) {
|
| 57 |
+
return null;
|
| 58 |
+
}
|
| 59 |
+
if (isFrame(activeElement) && activeElement.contentDocument) {
|
| 60 |
+
return getActiveElement(activeElement.contentDocument.body, activeDescendant);
|
| 61 |
+
}
|
| 62 |
+
if (activeDescendant) {
|
| 63 |
+
const id = activeElement.getAttribute("aria-activedescendant");
|
| 64 |
+
if (id) {
|
| 65 |
+
const element = getOwnerDocument(activeElement).getElementById(id);
|
| 66 |
+
if (element) {
|
| 67 |
+
return element;
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
return activeElement;
|
| 72 |
+
}
|
| 73 |
+
function isFrame(element) {
|
| 74 |
+
return element.tagName === "IFRAME";
|
| 75 |
+
}
|
| 76 |
+
//# sourceMappingURL=index.js.map
|
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/primitive.tsx"],
|
| 4 |
+
"sourcesContent": ["export * from './primitive';\nexport type * from './types';\n", "/* eslint-disable no-restricted-properties */\n\n/* eslint-disable no-restricted-globals */\nexport const canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n/* eslint-enable no-restricted-globals */\n\nexport function composeEventHandlers<E extends { defaultPrevented: boolean }>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport function getOwnerWindow(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access window outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument?.defaultView ?? window;\n}\n\nexport function getOwnerDocument(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access document outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument ?? document;\n}\n\n/**\n * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37\n * MIT License, Copyright (c) AriaKit.\n */\nexport function getActiveElement(\n node: Node | null | undefined,\n activeDescendant = false\n): HTMLElement | null {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n // `activeElement` might be an empty object if we're interacting with elements\n // inside of an iframe.\n return null;\n }\n\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n\n if (activeDescendant) {\n const id = activeElement.getAttribute('aria-activedescendant');\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n\n return activeElement as HTMLElement | null;\n}\n\nexport function isFrame(element: Element): element is HTMLIFrameElement {\n return element.tagName === 'IFRAME';\n}\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,YAAY,CAAC,EACxB,OAAO,WAAW,eAClB,OAAO,YACP,OAAO,SAAS;AAIX,SAAS,qBACd,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,2BAAuB,KAAK;AAE5B,QAAI,6BAA6B,SAAS,CAAC,MAAM,kBAAkB;AACjE,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;AAEO,SAAS,eAAe,SAAkC;AAC/D,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AAEA,SAAO,SAAS,eAAe,eAAe;AAChD;AAEO,SAAS,iBAAiB,SAAkC;AACjE,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,2CAA2C;AAAA,EAC7D;AAEA,SAAO,SAAS,iBAAiB;AACnC;AAMO,SAAS,iBACd,MACA,mBAAmB,OACC;AACpB,QAAM,EAAE,cAAc,IAAI,iBAAiB,IAAI;AAC/C,MAAI,CAAC,eAAe,UAAU;AAG5B,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,aAAa,KAAK,cAAc,iBAAiB;AAC3D,WAAO,iBAAiB,cAAc,gBAAgB,MAAM,gBAAgB;AAAA,EAC9E;AAE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