@photon-ai/pho-ui 4.19.0 → 4.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{basic-page-Cp7CccNN.js → basic-page-B78a6jpw.js} +10 -10
  3. package/dist/chunks/basic-page-B78a6jpw.js.map +1 -0
  4. package/dist/chunks/{card-zyRAihYE.js → card-Bg2V2B0x.js} +17 -17
  5. package/dist/chunks/card-Bg2V2B0x.js.map +1 -0
  6. package/dist/chunks/chat-Dfbkf7g8.js +674 -0
  7. package/dist/chunks/chat-Dfbkf7g8.js.map +1 -0
  8. package/dist/chunks/{code-block-Yxg2wZGJ.js → code-block-B7MibV6r.js} +2 -2
  9. package/dist/chunks/{code-block-Yxg2wZGJ.js.map → code-block-B7MibV6r.js.map} +1 -1
  10. package/dist/chunks/{dialog-DORIrfyJ.js → dialog-CDL6qY2a.js} +2 -2
  11. package/dist/chunks/{dialog-DORIrfyJ.js.map → dialog-CDL6qY2a.js.map} +1 -1
  12. package/dist/chunks/{scroll-area-Dhl5hqay.js → scroll-area-DjdSnx2p.js} +2 -2
  13. package/dist/chunks/scroll-area-DjdSnx2p.js.map +1 -0
  14. package/dist/chunks/{sidebar-CgaSEWVr.js → sidebar-DHYyBBUj.js} +2 -2
  15. package/dist/chunks/{sidebar-CgaSEWVr.js.map → sidebar-DHYyBBUj.js.map} +1 -1
  16. package/dist/chunks/{stat-BXBfMQ9Q.js → stat-VxA1SvS_.js} +8 -8
  17. package/dist/chunks/{stat-BXBfMQ9Q.js.map → stat-VxA1SvS_.js.map} +1 -1
  18. package/dist/chunks/{toast-B3oURNJC.js → toast-B1GAdxXP.js} +2 -2
  19. package/dist/chunks/{toast-B3oURNJC.js.map → toast-B1GAdxXP.js.map} +1 -1
  20. package/dist/components/card.js +1 -1
  21. package/dist/components/chat.js +1 -1
  22. package/dist/components/code-block.js +1 -1
  23. package/dist/components/command.js +1 -1
  24. package/dist/components/dialog.js +1 -1
  25. package/dist/components/scroll-area.js +1 -1
  26. package/dist/components/stat.js +1 -1
  27. package/dist/components/toast.js +1 -1
  28. package/dist/index.js +7 -7
  29. package/dist/sections/basic-page.js +1 -1
  30. package/dist/sections/sidebar.js +1 -1
  31. package/dist/src/components/chat/chat.d.ts +9 -4
  32. package/dist/src/components/scroll-area/scroll-area-edges.d.ts +1 -0
  33. package/package.json +1 -1
  34. package/src/styles/fonts.css +67 -9
  35. package/src/styles/theme.css +12 -5
  36. package/dist/chunks/basic-page-Cp7CccNN.js.map +0 -1
  37. package/dist/chunks/card-zyRAihYE.js.map +0 -1
  38. package/dist/chunks/chat-ZUzGmTWE.js +0 -621
  39. package/dist/chunks/chat-ZUzGmTWE.js.map +0 -1
  40. package/dist/chunks/scroll-area-Dhl5hqay.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-DORIrfyJ.js","names":["BaseDialog","Dialog","cn","Button","CloseButton","AnimatedHeight","ScrollArea","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","jsx","jsxs","Dialog","DialogPendingContext","useDialogPending","Root","onOpenChange","actionsRef","props","pending","setPending","pendingRef","internalActionsRef","handleOpenChange","open","eventDetails","contextValue","Trigger","Portal","Close","isThenable","value","Action","onClick","loading","disabled","pendingContext","busy","setBusy","mountedRef","handleClick","event","result","error","inert","Backdrop","className","Popup","Title","Description","DialogHeaderIcon","children","size","ACTION_ROW_SPLIT","Content","icon","title","description","consequences","warning","actions","caption","showClose","showCloseButton","hasHeader","hasConsequences","hasScrollBody","item","index","InsetPopup","InsetContent","FullscreenPopup","FullscreenContent","frameClassName","Dialog$1"],"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { CloseButton } from \"../button/close-button\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\n/* ========================== Async pending context ========================== */\n\n/** Imperative actions exposed by Base UI's `actionsRef`. */\ninterface RootActions {\n unmount: () => void;\n close: () => void;\n}\n\ninterface DialogPendingContextValue {\n /** True while a `Dialog.Action` promise is in flight. */\n pending: boolean;\n beginPending: () => void;\n endPending: () => void;\n /** Close the dialog imperatively (used by `Dialog.Action` on resolve). */\n close: () => void;\n}\n\nconst DialogPendingContext = createContext<DialogPendingContextValue | null>(\n null,\n);\n\n/**\n * Whether the surrounding dialog has a `Dialog.Action` promise in flight —\n * use it to disable secondary actions (Cancel etc.) while work is pending.\n * Returns `false` outside a `Dialog.Root`.\n */\nexport function useDialogPending(): boolean {\n return useContext(DialogPendingContext)?.pending ?? false;\n}\n\ntype RootProps = ComponentProps<typeof BaseDialog.Root>;\n\n/**\n * `Dialog.Root` with async awareness: while a `Dialog.Action` promise is\n * pending, every close request (outside press, Escape, `Dialog.Close`) is\n * cancelled so the dialog stays open until the work settles. Props pass\n * through to Base UI's `Dialog.Root` unchanged.\n */\nfunction Root({ onOpenChange, actionsRef, ...props }: RootProps) {\n const [pending, setPending] = useState(false);\n // Guard reads a ref so a resolve → close() in the same tick isn't blocked\n // by a not-yet-flushed state update.\n const pendingRef = useRef(false);\n const internalActionsRef = useRef<RootActions | null>(null);\n\n // Keep a caller-supplied actionsRef working alongside our internal one.\n useEffect(() => {\n if (!actionsRef) return;\n actionsRef.current = internalActionsRef.current;\n return () => {\n actionsRef.current = null;\n };\n }, [actionsRef]);\n\n const handleOpenChange = useCallback<NonNullable<RootProps[\"onOpenChange\"]>>(\n (open, eventDetails) => {\n if (!open && pendingRef.current) {\n eventDetails.cancel();\n return;\n }\n onOpenChange?.(open, eventDetails);\n },\n [onOpenChange],\n );\n\n const contextValue = useMemo<DialogPendingContextValue>(\n () => ({\n pending,\n beginPending: () => {\n pendingRef.current = true;\n setPending(true);\n },\n endPending: () => {\n pendingRef.current = false;\n setPending(false);\n },\n close: () => internalActionsRef.current?.close(),\n }),\n [pending],\n );\n\n return (\n <DialogPendingContext.Provider value={contextValue}>\n <BaseDialog.Root\n actionsRef={internalActionsRef}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </DialogPendingContext.Provider>\n );\n}\n\nconst Trigger = BaseDialog.Trigger;\nconst Portal = BaseDialog.Portal;\nconst Close = BaseDialog.Close;\n\n/* ============================== Dialog.Action ============================== */\n\nexport interface DialogActionProps extends Omit<ButtonProps, \"onClick\"> {\n /**\n * Confirm handler. Return a promise to keep the dialog open while it runs:\n * the button shows `loading`, all dismissal is locked, and the dialog\n * closes when the promise resolves. On rejection the dialog stays open —\n * surface errors inside the handler. A non-promise return closes\n * immediately, like `Dialog.Close`.\n */\n onClick?: (\n event: ReactMouseEvent<HTMLButtonElement>,\n ) => void | Promise<unknown>;\n}\n\nfunction isThenable(value: unknown): value is Promise<unknown> {\n return (\n value != null && typeof (value as { then?: unknown }).then === \"function\"\n );\n}\n\n/**\n * The confirm button of an action row, with native promise support — a\n * `Button` that runs its (possibly async) `onClick` and closes the dialog\n * when the work settles successfully.\n */\nfunction Action({ onClick, loading, disabled, ...props }: DialogActionProps) {\n const pendingContext = useContext(DialogPendingContext);\n const [busy, setBusy] = useState(false);\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n function handleClick(event: ReactMouseEvent<HTMLButtonElement>) {\n if (busy || loading) return;\n const result = onClick?.(event);\n if (!isThenable(result)) {\n pendingContext?.close();\n return;\n }\n setBusy(true);\n pendingContext?.beginPending();\n result.then(\n () => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n pendingContext?.close();\n },\n (error: unknown) => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n if (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.error(\"Dialog.Action: async onClick rejected —\", error);\n }\n },\n );\n }\n\n const inert = busy || loading;\n return (\n <Button\n {...props}\n disabled={disabled || inert}\n loading={inert}\n onClick={handleClick}\n />\n );\n}\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n // Floating layer: bg-pho-primary + border-pho-secondary hairline, elevation kept.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none\",\n // Global height cap — the inset panel's footprint (inset-4 /\n // sm:inset-8). A flex column so the body region can shrink and\n // scroll while header and actions stay pinned.\n \"flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]\",\n // Opacity + scale only — leave translate centering alone (no transition-all).\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Header icon chrome: secondary ink, a hair of extra air before the title.\n * Panel dialogs use 32px (`size-8`); fullscreen gates step up to 48px\n * (`size-12`) so the glyph reads at viewport scale.\n */\nfunction DialogHeaderIcon({\n children,\n size = \"md\",\n}: {\n children: ReactNode;\n size?: \"md\" | \"lg\";\n}) {\n return (\n <span\n aria-hidden\n className={cn(\n \"text-pho-secondary mb-1\",\n size === \"lg\" ? \"[&>svg]:size-12\" : \"[&>svg]:size-8\",\n )}\n >\n {children}\n </span>\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — typically a Tabler outline icon.\n * Rendered aria-hidden in secondary ink at 32px (`[&>svg]:size-8`). Pass a\n * styled node to override the ink; the size is owned by the slot.\n */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Consequence bullets rendered as a list at the top of the body — one item\n * per outcome (what is deleted, what survives, who loses access). Use on\n * destructive confirms where the one-line description undersells the\n * impact; keep each item to a single short sentence. Wrap the load-bearing\n * figure in `<strong>` (\"<strong>3 members</strong> lose access\") — the\n * list styles it (secondary ink, medium weight); no classes needed.\n */\n consequences?: ReactNode[];\n /**\n * Final cautionary line under `consequences` — error ink at description\n * size (e.g. \"It cannot be undone. Please be certain.\"). Reserve it for\n * irreversible actions; keep it short.\n */\n warning?: ReactNode;\n /**\n * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is\n * set, the header close button is never shown — dismiss via the actions.\n * Three actions split: the first (tertiary) at the row's start, the\n * secondary and the primary at its end.\n */\n actions?: ReactNode;\n /**\n * A quiet footnote at the panel's foot — the limit, cost or policy that\n * frames the decision without being it (\"You may change these up to five\n * times a week.\"). Description ink at `text-xs`, at the action row's\n * start with the actions at its end; when the row runs short of room it\n * takes a line of its own above them. One short sentence.\n */\n caption?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * The action row's split. One or two actions sit together at the row's end.\n * With three, the first (the tertiary, \"Not now\") sits alone at the row's\n * start and the other two stay at its end: pass them tertiary, secondary,\n * primary. A `caption` already holds the start, so beside one nothing moves.\n */\nconst ACTION_ROW_SPLIT = \"[&:has(>:nth-child(3))>:first-child]:me-auto\";\n\n/**\n * Convenience panel: renders the portal, backdrop, and styled popup with an\n * optional header (title/description + close) and optional action row. For\n * full control, compose the parts directly (`Dialog.Portal` /\n * `Dialog.Backdrop` / `Dialog.Popup`).\n */\nfunction Content({\n icon,\n title,\n description,\n consequences,\n warning,\n actions,\n caption,\n showClose = true,\n children,\n className,\n ...props\n}: ContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n const hasConsequences = consequences != null && consequences.length > 0;\n // The scrollable middle region — actions stay pinned below it.\n const hasScrollBody = hasConsequences || warning != null || children != null;\n\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n // Title row height = title only. Close is out of flow, centered\n // on the row, and may paint outside it (no clip, no stretch).\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {hasScrollBody && (\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"flex flex-col gap-5 px-6 py-5\">\n {hasConsequences && (\n <ul className=\"text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium\">\n {consequences.map((item, index) => (\n // Hand-drawn marker: a 4px dot on the first line's center —\n // quieter than the browser disc, ink tracks the text.\n <li\n key={index}\n className=\"relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current\"\n >\n {item}\n </li>\n ))}\n </ul>\n )}\n {warning != null && (\n <p className=\"text-pho-error text-display-xs font-medium\">\n {warning}\n </p>\n )}\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n )}\n {(actions != null || caption != null) && (\n <div\n className={cn(\n \"flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5\",\n // A caption is the row's first child and already fills it.\n caption == null && ACTION_ROW_SPLIT,\n !hasScrollBody && \"pt-5\",\n )}\n >\n {caption != null && (\n // Grows into the row's free width, never under 12rem: below\n // that it wraps to a line of its own above the actions.\n <p\n data-dialog-caption=\"\"\n className=\"text-pho-description min-w-48 flex-1 pr-2 text-xs\"\n >\n {caption}\n </p>\n )}\n {actions}\n </div>\n )}\n </Popup>\n </Portal>\n );\n}\n\n/* =========================== Dialog.InsetContent =========================== */\n\n/**\n * Near-fullscreen popup — the viewport minus a breathing ring, floating over\n * a backdrop (the page stays visible through the gap, so it dims like any\n * floating layer). Still a card: border, elevation, rounded corners; the\n * scale gesture stays but shrinks to 98% — at this size 95% reads like a jump.\n */\nfunction InsetPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8\",\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface InsetContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /** Decorative icon above the title — same treatment as `Content`. */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Bottom action row. Iron rule as `Content`: when `actions` is set, the\n * header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience near-fullscreen panel: header pinned on top, body filling and\n * scrolling on its own, optional action row pinned at the bottom. Sits\n * between `Content` (a focused card) and `FullscreenContent` (a page\n * takeover): use it for roomy working surfaces — pickers, editors, previews —\n * that still want the page peeking through an edge.\n */\nfunction InsetContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: InsetContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n\n return (\n <Portal>\n <Backdrop />\n <InsetPopup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"px-6 py-5\">\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n {actions != null && (\n <div\n className={cn(\n \"flex shrink-0 items-center justify-end gap-2 px-6 pb-5\",\n ACTION_ROW_SPLIT,\n )}\n >\n {actions}\n </div>\n )}\n </InsetPopup>\n </Portal>\n );\n}\n\n/* ========================= Dialog.FullscreenContent ======================== */\n\n/**\n * Full-viewport popup — a page-surface takeover instead of a floating card.\n * No backdrop: the popup itself is the layer. Fade only; scale is a floating-\n * card gesture and reads wrong at viewport size.\n */\nfunction FullscreenPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none\",\n \"transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface FullscreenContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — same chrome as `Content`, but 48px\n * (`size-12`) for viewport-scale gates.\n */\n icon?: ReactNode;\n /** Heading of the takeover. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Action row under the body. Iron rule as `Content`: when `actions` is set,\n * the corner close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Corner close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n /**\n * Classes on the viewport-centering frame (the `min-h-full` flex host).\n * Use to drop the default optical `pb-20` when the stack grows (e.g. a\n * captcha) so true center stays put: `frameClassName=\"pb-6\"`.\n */\n frameClassName?: string;\n children?: ReactNode;\n}\n\n/**\n * Convenience full-screen panel: the whole viewport becomes the dialog, with\n * a centered column at the standalone-flow width (28rem — the same measure as\n * onboarding / invite cards). Column height follows its content through\n * `AnimatedHeight` (same spring as the Card shell), so step swaps — phone →\n * OTP → captcha — glide instead of jumping. Use for gates the visitor must\n * deal with before the page behind makes sense (e.g. binding a phone number);\n * prefer `Content` for everything conversational.\n */\nfunction FullscreenContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n frameClassName,\n children,\n className,\n ...props\n}: FullscreenContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a corner X.\n const showCloseButton = actions == null && showClose;\n\n return (\n <Portal>\n <FullscreenPopup className={className} {...props}>\n {showCloseButton && (\n <Close\n render={<CloseButton className=\"fixed top-4 right-4 z-10\" />}\n />\n )}\n {/* Default `pb-20` optically lifts the column above true center. */}\n <div\n className={cn(\n \"flex min-h-full items-center justify-center px-6 pt-6 pb-20\",\n frameClassName,\n )}\n >\n {/* Width stays on the outer host; AnimatedHeight measures the\n header + body stack and springs its own height on content\n changes. The action row sits below it, outside the clip: while\n the body grows the container is shorter than its content for a\n few frames, and a row inside it would be cut off at the bottom\n (a pressed \"Send code\" turning grey right as a captcha mounts).\n Outside, the row rides the spring instead. */}\n <div className=\"w-full max-w-md\">\n <AnimatedHeight className=\"flex flex-col gap-5\">\n {(icon || title || description) && (\n <div className=\"flex flex-col gap-1\">\n {icon && (\n <DialogHeaderIcon size=\"lg\">{icon}</DialogHeaderIcon>\n )}\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {children}\n </AnimatedHeight>\n {actions != null && (\n <div\n className={cn(\n \"mt-5 flex items-center justify-end gap-2\",\n ACTION_ROW_SPLIT,\n )}\n >\n {actions}\n </div>\n )}\n </div>\n </div>\n </FullscreenPopup>\n </Portal>\n );\n}\n\n/**\n * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via\n * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`\n * adds native promise support: an async confirm keeps the dialog open and\n * undismissable until the work resolves.\n */\nexport const Dialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n InsetPopup,\n FullscreenPopup,\n Title,\n Description,\n Close,\n Action,\n Content,\n InsetContent,\n FullscreenContent,\n};\n"],"mappings":";;;;;;;;;AA6CA,IAAMiB,IAAuBV,EAC3B,IACF;AAOA,SAAgBW,KAA4B;AAC1C,SAAOT,EAAWQ,CAAoB,GAAG,WAAW;AACtD;AAUA,SAASE,EAAK,EAAE,cAAAC,GAAc,YAAAC,GAAY,GAAGC,EAAA,GAAoB;AAC/D,QAAM,CAACC,GAASC,CAAA,IAAcX,EAAS,EAAK,GAGtCY,IAAab,EAAO,EAAK,GACzBc,IAAqBd,EAA2B,IAAI;AAG1D,EAAAF,EAAA,MAAgB;AACd,QAAKW;AACL,aAAAA,EAAW,UAAUK,EAAmB,SACxC,MAAa;AACX,QAAAL,EAAW,UAAU;AAAA,MACvB;AAAA,EACF,GAAG,CAACA,CAAU,CAAC;AAEf,QAAMM,IAAmBnB,EAAA,CACtBoB,GAAMC,MAAiB;AACtB,QAAI,CAACD,KAAQH,EAAW,SAAS;AAC/B,MAAAI,EAAa,OAAO;AACpB;AAAA,IACF;AACA,IAAAT,IAAeQ,GAAMC,CAAY;AAAA,EACnC,GACA,CAACT,CAAY,CACf,GAEMU,IAAenB,EAAA,OACZ;AAAA,IACL,SAAAY;AAAA,IACA,cAAA,MAAoB;AAClB,MAAAE,EAAW,UAAU,IACrBD,EAAW,EAAI;AAAA,IACjB;AAAA,IACA,YAAA,MAAkB;AAChB,MAAAC,EAAW,UAAU,IACrBD,EAAW,EAAK;AAAA,IAClB;AAAA,IACA,OAAA,MAAaE,EAAmB,SAAS,MAAM;AAAA,EACjD,IACA,CAACH,CAAO,CACV;AAEA,SACE,gBAAAT,EAACG,EAAqB,UAAtB;AAAA,IAA+B,OAAOa;AAAA,IACpC,UAAA,gBAAAhB,EAACd,EAAW,MAAZ;AAAA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ACF,CAAA,CACU;AAAA,EACX,CAAA,EAAA,CAAA;AAEZ;AAQA,IAAa/D,KAAS;AAAA,EACpB,MAAAkB;AAAA,EACA,SAAAY;AAAA,EACA,QAAAC;AAAA,EACA,UAAAiB;AAAA,EACA,OAAAE;AAAA,EACA,YAAAsB;AAAA,EACA,iBAAAE;AAAA,EACA,OAAAvB;AAAA,EACA,aAAAC;AAAA,EACA,OAAApB;AAAA,EACA,QAAAG;AAAA,EACA,SAAAsB;AAAA,EACA,cAAAgB;AAAA,EACA,mBAAAE;AACF"}
1
+ {"version":3,"file":"dialog-CDL6qY2a.js","names":["BaseDialog","Dialog","cn","Button","CloseButton","AnimatedHeight","ScrollArea","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","jsx","jsxs","Dialog","DialogPendingContext","useDialogPending","Root","onOpenChange","actionsRef","props","pending","setPending","pendingRef","internalActionsRef","handleOpenChange","open","eventDetails","contextValue","Trigger","Portal","Close","isThenable","value","Action","onClick","loading","disabled","pendingContext","busy","setBusy","mountedRef","handleClick","event","result","error","inert","Backdrop","className","Popup","Title","Description","DialogHeaderIcon","children","size","ACTION_ROW_SPLIT","Content","icon","title","description","consequences","warning","actions","caption","showClose","showCloseButton","hasHeader","hasConsequences","hasScrollBody","item","index","InsetPopup","InsetContent","FullscreenPopup","FullscreenContent","frameClassName","Dialog$1"],"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { CloseButton } from \"../button/close-button\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\n/* ========================== Async pending context ========================== */\n\n/** Imperative actions exposed by Base UI's `actionsRef`. */\ninterface RootActions {\n unmount: () => void;\n close: () => void;\n}\n\ninterface DialogPendingContextValue {\n /** True while a `Dialog.Action` promise is in flight. */\n pending: boolean;\n beginPending: () => void;\n endPending: () => void;\n /** Close the dialog imperatively (used by `Dialog.Action` on resolve). */\n close: () => void;\n}\n\nconst DialogPendingContext = createContext<DialogPendingContextValue | null>(\n null,\n);\n\n/**\n * Whether the surrounding dialog has a `Dialog.Action` promise in flight —\n * use it to disable secondary actions (Cancel etc.) while work is pending.\n * Returns `false` outside a `Dialog.Root`.\n */\nexport function useDialogPending(): boolean {\n return useContext(DialogPendingContext)?.pending ?? false;\n}\n\ntype RootProps = ComponentProps<typeof BaseDialog.Root>;\n\n/**\n * `Dialog.Root` with async awareness: while a `Dialog.Action` promise is\n * pending, every close request (outside press, Escape, `Dialog.Close`) is\n * cancelled so the dialog stays open until the work settles. Props pass\n * through to Base UI's `Dialog.Root` unchanged.\n */\nfunction Root({ onOpenChange, actionsRef, ...props }: RootProps) {\n const [pending, setPending] = useState(false);\n // Guard reads a ref so a resolve → close() in the same tick isn't blocked\n // by a not-yet-flushed state update.\n const pendingRef = useRef(false);\n const internalActionsRef = useRef<RootActions | null>(null);\n\n // Keep a caller-supplied actionsRef working alongside our internal one.\n useEffect(() => {\n if (!actionsRef) return;\n actionsRef.current = internalActionsRef.current;\n return () => {\n actionsRef.current = null;\n };\n }, [actionsRef]);\n\n const handleOpenChange = useCallback<NonNullable<RootProps[\"onOpenChange\"]>>(\n (open, eventDetails) => {\n if (!open && pendingRef.current) {\n eventDetails.cancel();\n return;\n }\n onOpenChange?.(open, eventDetails);\n },\n [onOpenChange],\n );\n\n const contextValue = useMemo<DialogPendingContextValue>(\n () => ({\n pending,\n beginPending: () => {\n pendingRef.current = true;\n setPending(true);\n },\n endPending: () => {\n pendingRef.current = false;\n setPending(false);\n },\n close: () => internalActionsRef.current?.close(),\n }),\n [pending],\n );\n\n return (\n <DialogPendingContext.Provider value={contextValue}>\n <BaseDialog.Root\n actionsRef={internalActionsRef}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </DialogPendingContext.Provider>\n );\n}\n\nconst Trigger = BaseDialog.Trigger;\nconst Portal = BaseDialog.Portal;\nconst Close = BaseDialog.Close;\n\n/* ============================== Dialog.Action ============================== */\n\nexport interface DialogActionProps extends Omit<ButtonProps, \"onClick\"> {\n /**\n * Confirm handler. Return a promise to keep the dialog open while it runs:\n * the button shows `loading`, all dismissal is locked, and the dialog\n * closes when the promise resolves. On rejection the dialog stays open —\n * surface errors inside the handler. A non-promise return closes\n * immediately, like `Dialog.Close`.\n */\n onClick?: (\n event: ReactMouseEvent<HTMLButtonElement>,\n ) => void | Promise<unknown>;\n}\n\nfunction isThenable(value: unknown): value is Promise<unknown> {\n return (\n value != null && typeof (value as { then?: unknown }).then === \"function\"\n );\n}\n\n/**\n * The confirm button of an action row, with native promise support — a\n * `Button` that runs its (possibly async) `onClick` and closes the dialog\n * when the work settles successfully.\n */\nfunction Action({ onClick, loading, disabled, ...props }: DialogActionProps) {\n const pendingContext = useContext(DialogPendingContext);\n const [busy, setBusy] = useState(false);\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n function handleClick(event: ReactMouseEvent<HTMLButtonElement>) {\n if (busy || loading) return;\n const result = onClick?.(event);\n if (!isThenable(result)) {\n pendingContext?.close();\n return;\n }\n setBusy(true);\n pendingContext?.beginPending();\n result.then(\n () => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n pendingContext?.close();\n },\n (error: unknown) => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n if (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.error(\"Dialog.Action: async onClick rejected —\", error);\n }\n },\n );\n }\n\n const inert = busy || loading;\n return (\n <Button\n {...props}\n disabled={disabled || inert}\n loading={inert}\n onClick={handleClick}\n />\n );\n}\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n // Floating layer: bg-pho-primary + border-pho-secondary hairline, elevation kept.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none\",\n // Global height cap — the inset panel's footprint (inset-4 /\n // sm:inset-8). A flex column so the body region can shrink and\n // scroll while header and actions stay pinned.\n \"flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]\",\n // Opacity + scale only — leave translate centering alone (no transition-all).\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Header icon chrome: secondary ink, a hair of extra air before the title.\n * Panel dialogs use 32px (`size-8`); fullscreen gates step up to 48px\n * (`size-12`) so the glyph reads at viewport scale.\n */\nfunction DialogHeaderIcon({\n children,\n size = \"md\",\n}: {\n children: ReactNode;\n size?: \"md\" | \"lg\";\n}) {\n return (\n <span\n aria-hidden\n className={cn(\n \"text-pho-secondary mb-1\",\n size === \"lg\" ? \"[&>svg]:size-12\" : \"[&>svg]:size-8\",\n )}\n >\n {children}\n </span>\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — typically a Tabler outline icon.\n * Rendered aria-hidden in secondary ink at 32px (`[&>svg]:size-8`). Pass a\n * styled node to override the ink; the size is owned by the slot.\n */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Consequence bullets rendered as a list at the top of the body — one item\n * per outcome (what is deleted, what survives, who loses access). Use on\n * destructive confirms where the one-line description undersells the\n * impact; keep each item to a single short sentence. Wrap the load-bearing\n * figure in `<strong>` (\"<strong>3 members</strong> lose access\") — the\n * list styles it (secondary ink, medium weight); no classes needed.\n */\n consequences?: ReactNode[];\n /**\n * Final cautionary line under `consequences` — error ink at description\n * size (e.g. \"It cannot be undone. Please be certain.\"). Reserve it for\n * irreversible actions; keep it short.\n */\n warning?: ReactNode;\n /**\n * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is\n * set, the header close button is never shown — dismiss via the actions.\n * Three actions split: the first (tertiary) at the row's start, the\n * secondary and the primary at its end.\n */\n actions?: ReactNode;\n /**\n * A quiet footnote at the panel's foot — the limit, cost or policy that\n * frames the decision without being it (\"You may change these up to five\n * times a week.\"). Description ink at `text-xs`, at the action row's\n * start with the actions at its end; when the row runs short of room it\n * takes a line of its own above them. One short sentence.\n */\n caption?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * The action row's split. One or two actions sit together at the row's end.\n * With three, the first (the tertiary, \"Not now\") sits alone at the row's\n * start and the other two stay at its end: pass them tertiary, secondary,\n * primary. A `caption` already holds the start, so beside one nothing moves.\n */\nconst ACTION_ROW_SPLIT = \"[&:has(>:nth-child(3))>:first-child]:me-auto\";\n\n/**\n * Convenience panel: renders the portal, backdrop, and styled popup with an\n * optional header (title/description + close) and optional action row. For\n * full control, compose the parts directly (`Dialog.Portal` /\n * `Dialog.Backdrop` / `Dialog.Popup`).\n */\nfunction Content({\n icon,\n title,\n description,\n consequences,\n warning,\n actions,\n caption,\n showClose = true,\n children,\n className,\n ...props\n}: ContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n const hasConsequences = consequences != null && consequences.length > 0;\n // The scrollable middle region — actions stay pinned below it.\n const hasScrollBody = hasConsequences || warning != null || children != null;\n\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n // Title row height = title only. Close is out of flow, centered\n // on the row, and may paint outside it (no clip, no stretch).\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {hasScrollBody && (\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"flex flex-col gap-5 px-6 py-5\">\n {hasConsequences && (\n <ul className=\"text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium\">\n {consequences.map((item, index) => (\n // Hand-drawn marker: a 4px dot on the first line's center —\n // quieter than the browser disc, ink tracks the text.\n <li\n key={index}\n className=\"relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current\"\n >\n {item}\n </li>\n ))}\n </ul>\n )}\n {warning != null && (\n <p className=\"text-pho-error text-display-xs font-medium\">\n {warning}\n </p>\n )}\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n )}\n {(actions != null || caption != null) && (\n <div\n className={cn(\n \"flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5\",\n // A caption is the row's first child and already fills it.\n caption == null && ACTION_ROW_SPLIT,\n !hasScrollBody && \"pt-5\",\n )}\n >\n {caption != null && (\n // Grows into the row's free width, never under 12rem: below\n // that it wraps to a line of its own above the actions.\n <p\n data-dialog-caption=\"\"\n className=\"text-pho-description min-w-48 flex-1 pr-2 text-xs\"\n >\n {caption}\n </p>\n )}\n {actions}\n </div>\n )}\n </Popup>\n </Portal>\n );\n}\n\n/* =========================== Dialog.InsetContent =========================== */\n\n/**\n * Near-fullscreen popup — the viewport minus a breathing ring, floating over\n * a backdrop (the page stays visible through the gap, so it dims like any\n * floating layer). Still a card: border, elevation, rounded corners; the\n * scale gesture stays but shrinks to 98% — at this size 95% reads like a jump.\n */\nfunction InsetPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8\",\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface InsetContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /** Decorative icon above the title — same treatment as `Content`. */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Bottom action row. Iron rule as `Content`: when `actions` is set, the\n * header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience near-fullscreen panel: header pinned on top, body filling and\n * scrolling on its own, optional action row pinned at the bottom. Sits\n * between `Content` (a focused card) and `FullscreenContent` (a page\n * takeover): use it for roomy working surfaces — pickers, editors, previews —\n * that still want the page peeking through an edge.\n */\nfunction InsetContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: InsetContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n\n return (\n <Portal>\n <Backdrop />\n <InsetPopup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"px-6 py-5\">\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n {actions != null && (\n <div\n className={cn(\n \"flex shrink-0 items-center justify-end gap-2 px-6 pb-5\",\n ACTION_ROW_SPLIT,\n )}\n >\n {actions}\n </div>\n )}\n </InsetPopup>\n </Portal>\n );\n}\n\n/* ========================= Dialog.FullscreenContent ======================== */\n\n/**\n * Full-viewport popup — a page-surface takeover instead of a floating card.\n * No backdrop: the popup itself is the layer. Fade only; scale is a floating-\n * card gesture and reads wrong at viewport size.\n */\nfunction FullscreenPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none\",\n \"transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface FullscreenContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — same chrome as `Content`, but 48px\n * (`size-12`) for viewport-scale gates.\n */\n icon?: ReactNode;\n /** Heading of the takeover. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Action row under the body. Iron rule as `Content`: when `actions` is set,\n * the corner close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Corner close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n /**\n * Classes on the viewport-centering frame (the `min-h-full` flex host).\n * Use to drop the default optical `pb-20` when the stack grows (e.g. a\n * captcha) so true center stays put: `frameClassName=\"pb-6\"`.\n */\n frameClassName?: string;\n children?: ReactNode;\n}\n\n/**\n * Convenience full-screen panel: the whole viewport becomes the dialog, with\n * a centered column at the standalone-flow width (28rem — the same measure as\n * onboarding / invite cards). Column height follows its content through\n * `AnimatedHeight` (same spring as the Card shell), so step swaps — phone →\n * OTP → captcha — glide instead of jumping. Use for gates the visitor must\n * deal with before the page behind makes sense (e.g. binding a phone number);\n * prefer `Content` for everything conversational.\n */\nfunction FullscreenContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n frameClassName,\n children,\n className,\n ...props\n}: FullscreenContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a corner X.\n const showCloseButton = actions == null && showClose;\n\n return (\n <Portal>\n <FullscreenPopup className={className} {...props}>\n {showCloseButton && (\n <Close\n render={<CloseButton className=\"fixed top-4 right-4 z-10\" />}\n />\n )}\n {/* Default `pb-20` optically lifts the column above true center. */}\n <div\n className={cn(\n \"flex min-h-full items-center justify-center px-6 pt-6 pb-20\",\n frameClassName,\n )}\n >\n {/* Width stays on the outer host; AnimatedHeight measures the\n header + body stack and springs its own height on content\n changes. The action row sits below it, outside the clip: while\n the body grows the container is shorter than its content for a\n few frames, and a row inside it would be cut off at the bottom\n (a pressed \"Send code\" turning grey right as a captcha mounts).\n Outside, the row rides the spring instead. */}\n <div className=\"w-full max-w-md\">\n <AnimatedHeight className=\"flex flex-col gap-5\">\n {(icon || title || description) && (\n <div className=\"flex flex-col gap-1\">\n {icon && (\n <DialogHeaderIcon size=\"lg\">{icon}</DialogHeaderIcon>\n )}\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {children}\n </AnimatedHeight>\n {actions != null && (\n <div\n className={cn(\n \"mt-5 flex items-center justify-end gap-2\",\n ACTION_ROW_SPLIT,\n )}\n >\n {actions}\n </div>\n )}\n </div>\n </div>\n </FullscreenPopup>\n </Portal>\n );\n}\n\n/**\n * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via\n * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`\n * adds native promise support: an async confirm keeps the dialog open and\n * undismissable until the work resolves.\n */\nexport const Dialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n InsetPopup,\n FullscreenPopup,\n Title,\n Description,\n Close,\n Action,\n Content,\n InsetContent,\n FullscreenContent,\n};\n"],"mappings":";;;;;;;;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AAE;AAAA,EACA,OAAAvB;AAAA,EACA,aAAAC;AAAA,EACA,OAAApB;AAAA,EACA,QAAAG;AAAA,EACA,SAAAsB;AAAA,EACA,cAAAgB;AAAA,EACA,mBAAAE;AACF"}
@@ -25,7 +25,7 @@ function U(t, e) {
25
25
  }
26
26
  var z = "var(--pho-surface, var(--background-color-pho-primary))";
27
27
  function B(t, e) {
28
- return `linear-gradient(${t === "top" ? "to top" : "to bottom"}, color-mix(in oklab, ${e} 20%, transparent) 0%, ${e} 100%)`;
28
+ return `linear-gradient(${t === "top" ? "to top" : "to bottom"}, color-mix(in oklab, ${e} 0%, transparent) 0%, ${e} 100%)`;
29
29
  }
30
30
  function y(t, e) {
31
31
  if (t)
@@ -165,4 +165,4 @@ export {
165
165
  Z as t
166
166
  };
167
167
 
168
- //# sourceMappingURL=scroll-area-Dhl5hqay.js.map
168
+ //# sourceMappingURL=scroll-area-DjdSnx2p.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-area-DjdSnx2p.js","names":["BaseScrollArea","_Fragment","ScrollArea","cn","createContext","useContext","useLayoutEffect","useRef","Fragment$1","jsx","jsxs","motion","ScrollArea","EDGE_CLASS","BLUR_LAYER_COUNT","BLUR_MAX_PX","buildBlurLayers","count","maxPx","segment","_","i","layer","BLUR_LAYERS","edgeMask","edge","window","toEdge","a","b","c","d","DEFAULT_SURFACE","washGradient","surface","paintEdge","node","progress","child","el","blur","Edge","edgeRef","className","blurPx","index","mask","ScrollAreaContext","useScrollAreaContext","ctx","clamp01","n","assignRef","ref","Content","inset","insetTop","insetBottom","style","props","Corner","Root","children","fade","topEl","bottomEl","Viewport","viewportRef","viewport","paint","reveal","maxScroll","top","bottom","frame","onScroll","observer","Scrollbar","Thumb","ScrollArea$1"],"sources":["../../src/components/scroll-area/scroll-area-edges.tsx","../../src/components/scroll-area/scroll-area.tsx"],"sourcesContent":["import { type Ref } from \"react\";\nimport { BLUR_PX } from \"../../motion\";\nimport { cn } from \"../../utils/cn\";\n\n/** Overlay strip height — a short ramp, not a banner. `h-8` = 32px. */\nexport const EDGE_CLASS = \"pointer-events-none absolute inset-x-0 z-10 h-8\";\nexport const EDGE_REVEAL_PX = 32;\n\nconst BLUR_LAYER_COUNT = 8;\n\n/**\n * The system's one blur strength. The edge fade peaks here, and a motion\n * that softens (a scope swap, a bar title) borrows the same value, so\n * every soft focus in the product is the same soft focus.\n */\nexport const BLUR_MAX_PX = BLUR_PX;\n\nfunction buildBlurLayers(count: number, maxPx: number) {\n const segment = 100 / (count + 1);\n return Array.from({ length: count }, (_, i) => ({\n blurPx: (i / (count - 1)) * maxPx,\n window: [\n i * segment,\n (i + 1) * segment,\n (i + 2) * segment,\n (i + 3) * segment,\n ] as const,\n })).filter((layer) => layer.blurPx > 0);\n}\n\nconst BLUR_LAYERS = buildBlurLayers(BLUR_LAYER_COUNT, BLUR_MAX_PX);\n\nfunction edgeMask(edge: \"top\" | \"bottom\", window: readonly number[]) {\n const toEdge = edge === \"top\" ? \"to top\" : \"to bottom\";\n const [a, b, c, d] = window;\n return `linear-gradient(${toEdge}, transparent ${a}%, black ${b}%, black ${c}%, transparent ${d}%)`;\n}\n\n// The wash fades into the block it sits on: every `bg-pho-*` surface\n// registers itself as `--pho-surface` (see the stylesheet), so the nearest\n// surface ancestor's background carries down here — live across themes.\n// The primary surface is the fallback for hosts outside any pho surface.\nconst DEFAULT_SURFACE =\n \"var(--pho-surface, var(--background-color-pho-primary))\";\n\n// From none of the surface at the strip's inner edge: a wash that opens\n// partway in draws a line across whatever rides over that edge (an avatar,\n// a row's text), where the content above it is untouched and below it is\n// already lighter.\nexport function washGradient(edge: \"top\" | \"bottom\", surface: string) {\n const to = edge === \"top\" ? \"to top\" : \"to bottom\";\n return `linear-gradient(${to}, color-mix(in oklab, ${surface} 0%, transparent) 0%, ${surface} 100%)`;\n}\n\nexport function paintEdge(node: HTMLDivElement | null, progress: number) {\n if (!node) return;\n for (const child of node.children) {\n const el = child as HTMLElement;\n if (el.dataset.scrollFade === \"wash\") {\n el.style.opacity = String(progress);\n continue;\n }\n const blur = `blur(${Number(el.dataset.blurPx) * progress}px)`;\n el.style.backdropFilter = blur;\n el.style.setProperty(\"-webkit-backdrop-filter\", blur);\n }\n}\n\nexport function Edge({\n edge,\n edgeRef,\n surface = DEFAULT_SURFACE,\n className,\n}: {\n edge: \"top\" | \"bottom\";\n edgeRef: Ref<HTMLDivElement>;\n /** The surface the wash fades into — the card by default, or a page. */\n surface?: string;\n /** Position override — the strip sits at the named edge unless placed. */\n className?: string;\n}) {\n return (\n <div\n ref={edgeRef}\n aria-hidden\n data-edge={edge}\n className={cn(\n EDGE_CLASS,\n className ?? (edge === \"top\" ? \"top-0\" : \"bottom-0\"),\n )}\n >\n {BLUR_LAYERS.map(({ blurPx, window }, index) => {\n const mask = edgeMask(edge, window);\n return (\n <div\n key={index}\n data-blur-px={blurPx}\n className=\"absolute inset-0\"\n style={{\n maskImage: mask,\n WebkitMaskImage: mask,\n }}\n />\n );\n })}\n <div\n data-scroll-fade=\"wash\"\n className=\"absolute inset-0 opacity-0\"\n style={{ background: washGradient(edge, surface) }}\n />\n </div>\n );\n}\n","import {\n createContext,\n useContext,\n useLayoutEffect,\n useRef,\n type ComponentProps,\n type ElementType,\n type Ref,\n type RefObject,\n} from \"react\";\nimport { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../../utils/cn\";\nimport { Edge, EDGE_REVEAL_PX, paintEdge } from \"./scroll-area-edges\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst ScrollAreaContext = createContext<{\n topEl: RefObject<HTMLDivElement | null>;\n bottomEl: RefObject<HTMLDivElement | null>;\n fade: boolean;\n} | null>(null);\n\nfunction useScrollAreaContext() {\n const ctx = useContext(ScrollAreaContext);\n if (ctx == null) {\n throw new Error(\"ScrollArea parts must be used inside ScrollArea.Root\");\n }\n return ctx;\n}\n\nfunction clamp01(n: number) {\n if (n <= 0) return 0;\n if (n >= 1) return 1;\n return n;\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, node: T | null) {\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n // React 18 types `RefObject.current` as readonly; the write is legal.\n (ref as { current: T | null }).current = node;\n }\n}\n\n/**\n * The scrolled content. `inset` is a resting inset in the scroll axis —\n * like a scroll view's safe-area padding: the content stands clear of the\n * edges at rest but scrolls past them to the true edge, and the scrollbar\n * and edge fade stay on `Root`'s edges. `insetTop` / `insetBottom` set the\n * ends separately (they win over `inset`).\n */\nfunction Content({\n inset,\n insetTop,\n insetBottom,\n style,\n ref,\n ...props\n}: ComponentProps<typeof BaseScrollArea.Content> & {\n inset?: number | string;\n insetTop?: number | string;\n insetBottom?: number | string;\n ref?: Ref<HTMLDivElement>;\n}) {\n return (\n <BaseScrollArea.Content\n ref={ref}\n style={{\n paddingTop: insetTop ?? inset,\n paddingBottom: insetBottom ?? inset,\n ...style,\n }}\n {...props}\n />\n );\n}\n\nconst Corner = BaseScrollArea.Corner;\n\nfunction Root({\n className,\n children,\n fade = true,\n ...props\n}: StyledProps<typeof BaseScrollArea.Root> & {\n /**\n * Progressive edge fade (blur + wash). Leave on except for code\n * surfaces — CodeBlock is the only caller that turns it off, so\n * glyphs hard-clip at the border.\n * @default true\n */\n fade?: boolean;\n}) {\n const topEl = useRef<HTMLDivElement | null>(null);\n const bottomEl = useRef<HTMLDivElement | null>(null);\n\n return (\n <BaseScrollArea.Root\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaContext.Provider value={{ topEl, bottomEl, fade }}>\n {children}\n {fade ? (\n <>\n <Edge edge=\"top\" edgeRef={topEl} />\n <Edge edge=\"bottom\" edgeRef={bottomEl} />\n </>\n ) : null}\n </ScrollAreaContext.Provider>\n </BaseScrollArea.Root>\n );\n}\n\nfunction Viewport({\n className,\n ref,\n ...props\n}: StyledProps<typeof BaseScrollArea.Viewport>) {\n const { topEl, bottomEl, fade } = useScrollAreaContext();\n const viewportRef = useRef<HTMLElement | null>(null);\n\n useLayoutEffect(() => {\n const viewport = viewportRef.current;\n if (!viewport || !fade) return;\n\n const paint = () => {\n const reveal =\n topEl.current?.offsetHeight ||\n bottomEl.current?.offsetHeight ||\n EDGE_REVEAL_PX;\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n const top = maxScroll <= 0 ? 0 : clamp01(viewport.scrollTop / reveal);\n const bottom =\n maxScroll <= 0 ? 0 : clamp01((maxScroll - viewport.scrollTop) / reveal);\n paintEdge(topEl.current, top);\n paintEdge(bottomEl.current, bottom);\n };\n\n let frame = 0;\n const onScroll = () => {\n if (frame) return;\n frame = requestAnimationFrame(() => {\n frame = 0;\n paint();\n });\n };\n\n paint();\n viewport.addEventListener(\"scroll\", onScroll, { passive: true });\n let observer: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n observer = new ResizeObserver(paint);\n observer.observe(viewport);\n if (viewport.firstElementChild) {\n observer.observe(viewport.firstElementChild);\n }\n }\n return () => {\n viewport.removeEventListener(\"scroll\", onScroll);\n if (frame) cancelAnimationFrame(frame);\n observer?.disconnect();\n };\n }, [topEl, bottomEl, fade]);\n\n return (\n <BaseScrollArea.Viewport\n // A motion element with layoutScroll: any layout-animated content\n // inside (a shared-element morph, a FLIP row) projects against the\n // viewport's scroll offset instead of reading a scroll as a layout\n // change.\n render={<motion.div layoutScroll />}\n // No `overscroll-contain`: a scroll that reaches the viewport's end\n // (or one that has nothing to scroll) chains to the parent, as a\n // native scroll view does. A popup list that must trap the scroll\n // adds it on its own Viewport.\n className={cn(\n \"outline-pho-brand h-full min-h-0 w-full rounded-[inherit] focus-visible:outline-2 focus-visible:-outline-offset-1\",\n className,\n )}\n {...props}\n ref={(node) => {\n viewportRef.current = node;\n assignRef(ref, node);\n }}\n />\n );\n}\n\nfunction Scrollbar({\n className,\n ...props\n}: StyledProps<typeof BaseScrollArea.Scrollbar>) {\n return (\n <BaseScrollArea.Scrollbar\n className={cn(\n \"relative z-20 flex touch-none p-0.5 opacity-0 transition-opacity delay-300 select-none\",\n \"data-[hovering]:opacity-100 data-[hovering]:delay-0 data-[scrolling]:opacity-100 data-[scrolling]:delay-0 data-[scrolling]:duration-0\",\n \"data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:w-2.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Thumb({\n className,\n ...props\n}: StyledProps<typeof BaseScrollArea.Thumb>) {\n return (\n <BaseScrollArea.Thumb\n className={cn(\n \"flex-1 rounded-full bg-[var(--border-color-pho-primary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Scroll area built on Base UI `ScrollArea` — a capped region with overlay\n * scrollbars and progressive edge fade. Approaching rows blur (0 → 1px) and\n * wash into the surface; strength tracks scroll distance over one strip\n * height. Give `Root` a fixed size; put content in `Viewport` → `Content`\n * and add a `Scrollbar` → `Thumb` per axis.\n */\nexport const ScrollArea = {\n Root,\n Viewport,\n Content,\n Scrollbar,\n Thumb,\n Corner,\n};\n"],"mappings":";;;;;;;AAKA,IAAaa,IAAa,mDAGpBC,IAAmB,GAOZC,IAAA;AAEb,SAASC,EAAgBC,GAAeC,GAAe;AACrD,QAAMC,IAAU,OAAOF,IAAQ;AAC/B,SAAO,MAAM,KAAK,EAAE,QAAQA,EAAM,GAAA,CAAIG,GAAGC,OAAO;AAAA,IAC9C,QAASA,KAAKJ,IAAQ,KAAMC;AAAA,IAC5B,QAAQ;AAAA,MACNG,IAAIF;AAAA,OACHE,IAAI,KAAKF;AAAA,OACTE,IAAI,KAAKF;AAAA,OACTE,IAAI,KAAKF;AAAA,IACZ;AAAA,EACF,EAAE,EAAE,OAAA,CAAQG,MAAUA,EAAM,SAAS,CAAC;AACxC;AAEA,IAAMC,IAAcP,EAAgBF,GAAkBC,CAAW;AAEjE,SAASS,EAASC,GAAw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,CAAK,GACnCO,EAAS,QAAQR,CAAQ,GACrBA,EAAS,qBACXQ,EAAS,QAAQR,EAAS,iBAAiB,IAG/C,MAAa;AACX,MAAAA,EAAS,oBAAoB,UAAUO,CAAQ,GAC3CD,KAAO,qBAAqBA,CAAK,GACrCE,GAAU,WAAW;AAAA,IACvB;AAAA,EACF,GAAG;AAAA,IAACZ;AAAA,IAAOC;AAAA,IAAUF;AAAA,EAAI,CAAC,GAGxB,gBAAAtD,EAACT,EAAe,UAAhB;AAAA,IAKE,QAAQ,gBAAAS,EAACE,EAAO,KAAR,EAAY,cAAA,GAAc,CAAA;AAAA,IAKlC,WAAWR,EACT,qHACAwC,CACF;AAAA,IACA,GAAIgB;AAAA,IACJ,KAAA,CAAMvB,MAAS;AACb,MAAA+B,EAAY,UAAU/B,GACtBgB,EAAUC,GAAKjB,CAAI;AAAA,IACrB;AAAA,EACD,CAAA;AAEL;AAEA,SAASyC,EAAU,EACjB,WAAAlC,GACA,GAAGgB,EAAA,GAC4C;AAC/C,SACE,gBAAAlD,EAACT,EAAe,WAAhB;AAAA,IACE,WAAWG,EACT,0FACA,yIACA,gHACAwC,CACF;AAAA,IACA,GAAIgB;AAAA,EACL,CAAA;AAEL;AAEA,SAASmB,EAAM,EACb,WAAAnC,GACA,GAAGgB,EAAA,GACwC;AAC3C,SACE,gBAAAlD,EAACT,EAAe,OAAhB;AAAA,IACE,WAAWG,EACT,4DACAwC,CACF;AAAA,IACA,GAAIgB;AAAA,EACL,CAAA;AAEL;AASA,IAAazD,IAAa;AAAA,EACxB,MAAA2D;AAAA,EACA,UAAAK;AAAA,EACA,SAAAZ;AAAA,EACA,WAAAuB;AAAA,EACA,OAAAC;AAAA,EACA,QAAAlB;AACF"}
@@ -9,7 +9,7 @@ import { t as se } from "./IconArrowUpRight-OK8Fp0KQ.js";
9
9
  import { t as ie } from "./IconChevronRight-BNkXCTk6.js";
10
10
  import { n as _ } from "./avatar-PgBOfszL.js";
11
11
  import { t as le } from "./IconSearch-DkcWWZ1H.js";
12
- import { t as x } from "./scroll-area-Dhl5hqay.js";
12
+ import { t as x } from "./scroll-area-DjdSnx2p.js";
13
13
  import { t as L } from "./collapsible-C2tn_b1Q.js";
14
14
  import { t as ce } from "./kbd-DWDs_6U1.js";
15
15
  import { createContext as P, isValidElement as pe, useCallback as z, useContext as G, useEffect as T, useId as ue, useLayoutEffect as me, useMemo as K, useRef as w, useState as C } from "react";
@@ -303,4 +303,4 @@ export {
303
303
  We as u
304
304
  };
305
305
 
306
- //# sourceMappingURL=sidebar-CgaSEWVr.js.map
306
+ //# sourceMappingURL=sidebar-DHYyBBUj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-CgaSEWVr.js","names":["SIDEBAR_PRESS_SPRING","Icon","_Fragment","Collapsible","BaseCollapsible","cn","isReactComponent","useLinkComponent","SPRING_PRESS","Button","buttonVariants","createReactComponent","IconArrowUpRight","IconChevronRight","Avatar","IconSearch","ScrollArea","Collapsible$1","Kbd","createContext","isValidElement","useCallback","useContext","useEffect","useId","useLayoutEffect","useMemo","useRef","useState","Fragment$1","jsx","jsxs","motion","Collapsible","__iconNode","IconDots","SIDEBAR_PRESS_MOTION","SIDEBAR_ROOT","SIDEBAR_ROOT_INSET","SIDEBAR_ROOT_BASE","SIDEBAR_HEADER_INSET","SIDEBAR_ITEM","SIDEBAR_ITEM_ACTIVE","SIDEBAR_ITEM_INACTIVE","SIDEBAR_SUBMENU_TRIGGER_CHILD_ACTIVE","SIDEBAR_SUBMENU_CHEVRON","SIDEBAR_SUBMENU_LIST_INDENT","SidebarInsetContext","SidebarSubmenuContext","useIsoLayoutEffect","Root","className","inset","props","Header","Search","label","kbd","Nav","scroll","insetTop","insetBottom","style","children","Group","GroupLabel","List","columns","Footer","renderIcon","icon","content","Item","active","wrap","href","external","rest","Link","MotionLink","submenu","rowId","rowClass","Submenu","openProp","defaultOpen","onOpenChange","openWhenChildActive","activeProp","uncontrolledOpen","setUncontrolledOpen","isControlled","open","setOpen","next","activeRowIds","setActiveRowIds","reportActive","isActive","previous","submenuContext","childActive","hasPaintedRef","frame","instantOpen","setInstantOpen","latestOpenRef","latestSetOpenRef","ACCOUNT_ROW","initialsFrom","name","words","AccountRow","avatarSrc","initials","Sidebar"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs","../../src/sections/sidebar/sidebar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-2\" }]];\nconst IconDots = createReactComponent(\"outline\", \"dots\", \"Dots\", __iconNode);\n\nexport { __iconNode, IconDots as default };\n","import {\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type ComponentProps,\n type ComponentType,\n type FC,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n IconArrowUpRight,\n IconChevronRight,\n IconDots,\n} from \"@tabler/icons-react\";\nimport { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport { SPRING_PRESS } from \"../../motion\";\nimport { motion } from \"motion/react\";\nimport { IconSearch } from \"@tabler/icons-react\";\nimport { Button } from \"../../components/button\";\nimport { Collapsible } from \"../../components/collapsible\";\nimport { Kbd } from \"../../components/kbd\";\nimport { ScrollArea } from \"../../components/scroll-area\";\nimport { cn } from \"../../utils/cn\";\nimport { isReactComponent } from \"../../utils/is-react-component\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\nimport { Avatar } from \"../../components/avatar\";\nimport { buttonVariants } from \"../../components/button\";\n\n/** Same press compression as `Button` — transform-only, every interactive row. */\nconst SIDEBAR_PRESS_SCALE = 0.97;\n/** Framer source transition shared with `Button`: `spring-physics 200 30 0.1`. */\nconst SIDEBAR_PRESS_SPRING = SPRING_PRESS;\nconst SIDEBAR_PRESS_MOTION = {\n initial: false as const,\n whileTap: { scale: SIDEBAR_PRESS_SCALE },\n transition: SIDEBAR_PRESS_SPRING,\n};\n\n/**\n * Sidebar — Pho's first SECTION: a composed app rail, not a micro component.\n * It encodes the navigation rail used across Photon surfaces (the Pho docs\n * site, the dashboard): a sticky full-height column with a brand header, a\n * scrollable stack of titled nav groups, and a pinned footer that usually\n * carries the account row.\n *\n * Sections stay presentational — no router, no data fetching, no theme\n * plumbing. Links render through the host's `LinkProvider` (same contract as\n * `ButtonLink`), state arrives via props (`active`), and interactive footers\n * compose with other Pho parts (e.g. wrap `Sidebar.AccountRow` in a\n * `Menu.Trigger render={...}` to open an account menu).\n *\n * `Root` takes `inset` (`base` | `sm`, default `base`) for the rail's outer\n * padding and header spacing — prefer that over host-app class overrides.\n */\n\n/* ------------------------------- class map ------------------------------- */\n\n/** The rail itself — sticky, full-height, hairline right edge (no inset). */\nexport const SIDEBAR_ROOT =\n \"border-pho-secondary bg-pho-page sticky top-0 flex h-dvh w-64 shrink-0 flex-col border-r\";\n\n/** Outer inset on `Root` — `base` is the docs/default rail; `sm` is tighter. */\nexport const SIDEBAR_ROOT_INSET = {\n base: \"px-4 pt-5 pb-4\",\n sm: \"px-3 pt-4 pb-3\",\n} as const;\n\n/** `SIDEBAR_ROOT` with the default `base` inset — one string for docs chrome. */\nexport const SIDEBAR_ROOT_BASE = cn(SIDEBAR_ROOT, SIDEBAR_ROOT_INSET.base);\n\n/** Header spacing paired with `Root`'s `inset`. */\nexport const SIDEBAR_HEADER_INSET = {\n base: \"mb-6 px-2\",\n sm: \"mb-3 px-0\",\n} as const;\n\nexport type SidebarInset = keyof typeof SIDEBAR_ROOT_INSET;\n\n/** A nav row at rest and on hover. Active/inactive inks split below. */\nexport const SIDEBAR_ITEM =\n \"outline-pho-brand flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left text-base transition-colors focus-visible:outline-2 focus-visible:-outline-offset-1\";\n\n/**\n * Selected row — lifted onto the primary surface with the site hairline.\n * The icon carries the same ink as the label so the pair reads as one unit.\n */\nexport const SIDEBAR_ITEM_ACTIVE =\n \"bg-pho-primary text-pho-primary ring-pho-secondary font-medium ring-1 ring-inset *:data-icon:text-pho-primary\";\n\n/**\n * Resting row — secondary ink (75%). Hover lifts onto the primary surface\n * (same plane as the active chip, without the ring) so the wash stays quiet\n * on `pho-page`. Icon tracks the label's ink at every state.\n */\nexport const SIDEBAR_ITEM_INACTIVE = cn(\n \"text-pho-secondary *:data-icon:text-pho-secondary\",\n \"hover:bg-pho-primary hover:text-pho-primary hover:*:data-icon:text-pho-primary\",\n);\n\n/**\n * A submenu's parent row while one of its children is the current page —\n * primary ink on label and icon, but no surface or ring: the child row\n * carries the full active chip, the parent only points at it.\n */\nexport const SIDEBAR_SUBMENU_TRIGGER_CHILD_ACTIVE =\n \"text-pho-primary *:data-icon:text-pho-primary\";\n\n/**\n * The trailing chevron on a submenu row — points right at rest, rotates to\n * point down while the panel is open. Base UI sets `data-panel-open` on the\n * trigger; the global reduced-motion guard collapses the rotation.\n */\nexport const SIDEBAR_SUBMENU_CHEVRON =\n \"ml-auto size-4 shrink-0 transition-transform duration-150 ease-out\";\n\n/**\n * Indent for a submenu's rows so their labels line up with the parent's\n * label: parent padding (8px) + icon (16px) + gap (8px) = 32px, minus the\n * child row's own 8px padding. Without a parent icon the label sits at 8px,\n * so children step in by one row padding only.\n */\nexport const SIDEBAR_SUBMENU_LIST_INDENT = {\n withIcon: \"pl-6\",\n withoutIcon: \"pl-4\",\n} as const;\n\nconst SidebarInsetContext = createContext<SidebarInset>(\"base\");\n\n/**\n * Rows inside a `Sidebar.Submenu` report their `active` flag here so the\n * parent can light up and auto-open. `null` outside a submenu.\n */\ninterface SidebarSubmenuContextValue {\n reportActive: (rowId: string, active: boolean) => void;\n}\n\nconst SidebarSubmenuContext = createContext<SidebarSubmenuContextValue | null>(\n null,\n);\n\n// React 18 warns that useLayoutEffect does nothing on the server (19 dropped\n// the warning); fall back to useEffect there so SSR'd docs stay quiet.\nconst useIsoLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\n/* --------------------------------- frame --------------------------------- */\n\ninterface RootProps extends ComponentProps<\"aside\"> {\n /** Outer padding + header spacing. Defaults to `base`. */\n inset?: SidebarInset;\n ref?: Ref<HTMLElement>;\n}\n\n/** The rail — a sticky, full-height `<aside>` with the hairline right edge. */\nfunction Root({ className, inset = \"base\", ...props }: RootProps) {\n return (\n <SidebarInsetContext.Provider value={inset}>\n <aside\n className={cn(SIDEBAR_ROOT, SIDEBAR_ROOT_INSET[inset], className)}\n {...props}\n data-inset={inset}\n />\n </SidebarInsetContext.Provider>\n );\n}\n\n/** Brand slot at the top of the rail — logo, wordmark, workspace switcher. */\nfunction Header({ className, ...props }: ComponentProps<\"div\">) {\n const inset = useContext(SidebarInsetContext);\n return (\n <div\n className={cn(\n \"flex items-center gap-2.5 [&:has(+nav)]:mb-0\",\n SIDEBAR_HEADER_INSET[inset],\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * The rail's search row — an outlined button dressed to `Item` metrics so\n * its label lines up with the rows below, the shortcut at the trailing\n * edge. The press is the Button's own; wire `onClick` (and a global ⌘K)\n * to a `Command.Dialog`.\n */\nfunction Search({\n label = \"Search\",\n kbd = \"⌘K\",\n className,\n ...props\n}: Omit<ComponentProps<typeof Button>, \"children\" | \"variant\" | \"size\"> & {\n label?: ReactNode;\n kbd?: string;\n}) {\n return (\n <Button\n variant=\"outlined\"\n shape=\"square\"\n size=\"md\"\n aria-keyshortcuts={kbd === \"⌘K\" ? \"Meta+K Control+K\" : undefined}\n prefix={<IconSearch aria-hidden />}\n suffix={<Kbd keys={kbd} className=\"pointer-events-none\" />}\n className={cn(\n \"hover:ring-pho-secondary min-h-9 w-full justify-start gap-2 rounded-sm px-2 py-1.5 has-[[data-icon=prefix]]:pl-2 has-[[data-icon=suffix]]:pr-2 [&>[data-text]]:min-w-0 [&>[data-text]]:flex-1 [&>[data-text]]:truncate [&>[data-text]]:text-left\",\n className,\n )}\n {...props}\n >\n {label}\n </Button>\n );\n}\n\n/**\n * The scrollable middle — a stack of `Sidebar.Group`s in a `ScrollArea`\n * (overlay scrollbar, edge fade). Pass `scroll={false}` where a parent\n * scrolls the whole rail as one column (a narrow-viewport drawer) — the\n * nav is then a plain stack at its natural height.\n *\n * The nav owns its breathing room toward its neighbors as a resting inset\n * (a scroll view's safe-area padding): 24px above, 16px below by default —\n * rows stand clear of the ends at rest and scroll through the gap, under\n * the edge fade, instead of clipping at a dead margin. `inset` /\n * `insetTop` / `insetBottom` override it; the same values become plain\n * padding when `scroll={false}`, so both modes keep one geometry. A\n * `Header` right before the nav and a `Footer` after it drop their own\n * margins — the gap lives here, not on the neighbors.\n */\nfunction Nav({\n scroll = true,\n inset,\n insetTop = inset ?? 24,\n insetBottom = inset ?? 16,\n className,\n style,\n children,\n ...props\n}: ComponentProps<\"nav\"> & {\n scroll?: boolean;\n inset?: number | string;\n insetTop?: number | string;\n insetBottom?: number | string;\n}) {\n if (!scroll) {\n return (\n <nav\n className={cn(\"flex flex-col gap-6\", className)}\n style={{\n paddingTop: insetTop ?? inset,\n paddingBottom: insetBottom ?? inset,\n ...style,\n }}\n {...props}\n >\n {children}\n </nav>\n );\n }\n return (\n <nav\n className={cn(\"flex min-h-0 flex-1 flex-col\", className)}\n style={style}\n {...props}\n >\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content\n inset={inset}\n insetTop={insetTop}\n insetBottom={insetBottom}\n className=\"flex flex-col gap-6\"\n >\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </nav>\n );\n}\n\nfunction Group({ className, ...props }: ComponentProps<\"div\">) {\n return <div className={className} {...props} />;\n}\n\n/** The cluster's caption — description ink, regular weight. */\nfunction GroupLabel({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"text-pho-description mb-2 px-2 text-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface ListProps extends ComponentProps<\"ul\"> {\n /** Lay the rows out in two columns — for long, flat registries. */\n columns?: boolean;\n}\n\n/** The rows of a group. `columns` switches to a two-column grid. */\nfunction List({ className, columns, ...props }: ListProps) {\n return (\n <ul\n className={cn(\n // list-none/m-0/p-0 shield the rail from host prose styles.\n \"m-0 list-none p-0 *:m-0\",\n columns\n ? \"grid grid-cols-2 gap-x-2 gap-y-0.5\"\n : \"flex flex-col gap-0.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Pinned bottom cluster — docs link, account row, theme toggle. */\nfunction Footer({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"mt-4 flex flex-col gap-0.5 [nav~&]:mt-0\", className)}\n {...props}\n />\n );\n}\n\n/* --------------------------------- item ---------------------------------- */\n\n/** An icon slot — a component (`IconBook`) or element (`<IconBook />`). */\ntype Slottable = ReactNode | FC<{ className?: string }>;\n\nfunction renderIcon(icon: Slottable): ReactNode {\n if (icon == null || icon === false) return null;\n let content: ReactNode = null;\n if (isReactComponent(icon)) {\n const Icon = icon;\n content = <Icon />;\n } else if (isValidElement(icon)) {\n content = icon;\n }\n if (content == null) return null;\n return (\n <span\n data-icon\n className=\"pointer-events-none inline-flex shrink-0 items-center [&>svg]:size-4 [&>svg]:shrink-0\"\n >\n {content}\n </span>\n );\n}\n\ninterface ItemBaseProps {\n /** Slot before the label — a component (`IconBook`) or element. */\n icon?: Slottable;\n /** Marks the row as the current destination (adds `aria-current=\"page\"`). */\n active?: boolean;\n /**\n * Let the label break onto two lines instead of truncating. Default\n * rows stay a single truncated line so the rail keeps even height.\n * The row still uses `min-h-9`; wrap only grows it when the text\n * actually breaks. Caps at two lines.\n */\n wrap?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * DOM handlers whose React signatures clash with Motion's gesture props.\n * Same omit list as `Button` — rows render through `motion.*`.\n */\ntype MotionHandlerConflicts =\n | \"onAnimationStart\"\n | \"onAnimationEnd\"\n | \"onAnimationIteration\"\n | \"onDrag\"\n | \"onDragStart\"\n | \"onDragEnd\"\n | \"onDragEnter\"\n | \"onDragExit\"\n | \"onDragLeave\"\n | \"onDragOver\"\n | \"onDrop\";\n\nexport interface SidebarItemLinkProps\n extends\n ItemBaseProps,\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof ItemBaseProps | MotionHandlerConflicts\n > {\n /** Destination — rendered through the host's `LinkProvider`. */\n href: string;\n /** Leaves the app: opens in a new tab and renders a ↗ cue. */\n external?: boolean;\n}\n\nexport interface SidebarItemButtonProps\n extends\n ItemBaseProps,\n Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof ItemBaseProps | MotionHandlerConflicts\n > {\n href?: undefined;\n external?: undefined;\n}\n\nexport type SidebarItemProps = SidebarItemLinkProps | SidebarItemButtonProps;\n\n/**\n * A nav row — a link when `href` is given (rendered through the host's\n * `LinkProvider`), otherwise a button. `active` lifts the row onto the\n * primary surface; `external` opens a new tab and appends a ↗ cue.\n * `wrap` drops the single-line truncate so a long product name can sit\n * on two lines; other rows stay one line.\n */\nfunction Item({\n icon,\n active,\n wrap = false,\n className,\n children,\n href,\n external,\n ...rest\n}: SidebarItemProps) {\n const Link = useLinkComponent();\n // Same bridge as `ButtonLink` — host `LinkProvider` + Motion press scale.\n const MotionLink = useMemo(\n () =>\n motion.create(Link as unknown as ComponentType<Record<string, unknown>>),\n [Link],\n );\n // Inside a `Submenu`, tell the parent row when this one is current so it\n // can light up and auto-open. Layout effect: the parent reads the result\n // before first paint, so a route-selected group opens without a flash.\n const submenu = useContext(SidebarSubmenuContext);\n const rowId = useId();\n useIsoLayoutEffect(() => {\n if (!submenu) return;\n submenu.reportActive(rowId, Boolean(active));\n return () => submenu.reportActive(rowId, false);\n }, [submenu, rowId, active]);\n const rowClass = cn(\n SIDEBAR_ITEM,\n active ? SIDEBAR_ITEM_ACTIVE : SIDEBAR_ITEM_INACTIVE,\n className,\n );\n const label = (\n <span\n className={\n wrap\n ? \"line-clamp-2 min-w-0 flex-1 text-balance hyphens-none\"\n : \"min-w-0 flex-1 truncate\"\n }\n >\n {children}\n </span>\n );\n\n if (href !== undefined) {\n return (\n <li>\n <MotionLink\n href={href}\n aria-current={active ? \"page\" : undefined}\n {...(external && { target: \"_blank\", rel: \"noopener noreferrer\" })}\n {...(rest as AnchorHTMLAttributes<HTMLAnchorElement>)}\n className={rowClass}\n {...SIDEBAR_PRESS_MOTION}\n >\n {renderIcon(icon)}\n {label}\n {external && (\n <>\n {renderIcon(<IconArrowUpRight aria-hidden />)}\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </MotionLink>\n </li>\n );\n }\n\n return (\n <li>\n <motion.button\n type=\"button\"\n aria-current={active ? \"page\" : undefined}\n {...(rest as Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n MotionHandlerConflicts\n >)}\n className={rowClass}\n {...SIDEBAR_PRESS_MOTION}\n >\n {renderIcon(icon)}\n {label}\n </motion.button>\n </li>\n );\n}\n\n/* -------------------------------- submenu -------------------------------- */\n\nexport interface SidebarSubmenuProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"children\" | MotionHandlerConflicts\n> {\n /** The parent row's label. */\n label: ReactNode;\n /** Slot before the label — a component (`IconBook`) or element. */\n icon?: Slottable;\n /** Controlled open state. Pair with `onOpenChange`. */\n open?: boolean;\n /** Initial open state when uncontrolled. Defaults to `false`. */\n defaultOpen?: boolean;\n /** Called with the next open state on every toggle (user or auto-open). */\n onOpenChange?: (open: boolean) => void;\n /**\n * Open the panel whenever a child row becomes `active`, so a route-based\n * rail expands the right group on load and on navigation. Defaults to\n * `true`. The user can still collapse the group afterwards.\n */\n openWhenChildActive?: boolean;\n /**\n * Force the parent's child-active ink. Normally derived from the\n * children's `active` flags — set this when the current destination lives\n * under the group but has no row of its own.\n */\n active?: boolean;\n /** The nested rows — `Sidebar.Item`s, no icon needed. */\n children: ReactNode;\n ref?: Ref<HTMLButtonElement>;\n}\n\n/**\n * A nav row that folds open to reveal child rows — `<Item>` metrics on the\n * trigger, a trailing chevron that turns as the panel opens, and the nested\n * list indented to the parent's label. Built on `Collapsible`, so the\n * height animation (and its reduced-motion collapse) is the library's own.\n *\n * Children are ordinary `Sidebar.Item`s: they report `active` upward, so the\n * parent takes primary ink while a child is current and, with\n * `openWhenChildActive` (default), opens on load without a flash.\n *\n * ```tsx\n * <Sidebar.Submenu label=\"Platforms\" icon={IconMessage}>\n * <Sidebar.Item href=\"/platforms/sms\" active>SMS</Sidebar.Item>\n * <Sidebar.Item href=\"/platforms/imessage\">iMessage</Sidebar.Item>\n * </Sidebar.Submenu>\n * ```\n */\nfunction Submenu({\n label,\n icon,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n openWhenChildActive = true,\n active: activeProp,\n className,\n children,\n ...rest\n}: SidebarSubmenuProps) {\n /* ---- open state: controlled when `open` is given, else internal ---- */\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = openProp !== undefined;\n const open = isControlled ? openProp : uncontrolledOpen;\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setUncontrolledOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n /* ---- which child rows are current (reported by `Item`) ---- */\n const [activeRowIds, setActiveRowIds] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n const reportActive = useCallback((rowId: string, isActive: boolean) => {\n setActiveRowIds((previous) => {\n if (previous.has(rowId) === isActive) return previous;\n const next = new Set(previous);\n if (isActive) next.add(rowId);\n else next.delete(rowId);\n return next;\n });\n }, []);\n const submenuContext = useMemo(() => ({ reportActive }), [reportActive]);\n const childActive = activeProp ?? activeRowIds.size > 0;\n\n /* ---- auto-open on an active child ---- */\n // `true` once the browser has painted the first frame. An auto-open that\n // happens before that (the route already sits under this group on load)\n // must not animate — the rail should simply appear expanded.\n const hasPaintedRef = useRef(false);\n useEffect(() => {\n const frame = requestAnimationFrame(() => {\n hasPaintedRef.current = true;\n });\n return () => cancelAnimationFrame(frame);\n }, []);\n // While `true`, the panel's height transition runs at 0s so the pre-paint\n // auto-open lands instantly. Cleared a frame later so the next toggle\n // animates normally.\n const [instantOpen, setInstantOpen] = useState(false);\n // Read through refs so the effect fires only when the active children\n // change — a user collapsing the group must not be undone by a re-render.\n const latestOpenRef = useRef(open);\n latestOpenRef.current = open;\n const latestSetOpenRef = useRef(setOpen);\n latestSetOpenRef.current = setOpen;\n useIsoLayoutEffect(() => {\n if (!openWhenChildActive || !childActive || latestOpenRef.current) return;\n if (!hasPaintedRef.current) setInstantOpen(true);\n latestSetOpenRef.current(true);\n }, [activeRowIds, childActive, openWhenChildActive]);\n useEffect(() => {\n if (!instantOpen) return;\n const frame = requestAnimationFrame(() => setInstantOpen(false));\n return () => cancelAnimationFrame(frame);\n }, [instantOpen]);\n\n return (\n <Collapsible.Root\n open={open}\n onOpenChange={(next) => setOpen(next)}\n render={<li />}\n >\n <BaseCollapsible.Trigger\n // Same press compression as `Item`; Base UI wires aria-expanded,\n // aria-controls, and Enter / Space onto the native button.\n render={<motion.button {...SIDEBAR_PRESS_MOTION} />}\n className={cn(\n SIDEBAR_ITEM,\n SIDEBAR_ITEM_INACTIVE,\n childActive && SIDEBAR_SUBMENU_TRIGGER_CHILD_ACTIVE,\n // The chevron turns to point down while the panel is open.\n \"data-[panel-open]:*:data-chevron:rotate-90\",\n className,\n )}\n data-child-active={childActive || undefined}\n {...rest}\n >\n {renderIcon(icon)}\n <span className=\"min-w-0 flex-1 truncate\">{label}</span>\n <IconChevronRight\n aria-hidden\n data-chevron\n className={SIDEBAR_SUBMENU_CHEVRON}\n />\n </BaseCollapsible.Trigger>\n {/* keepMounted: closed children stay mounted (hidden) so an active\n child keeps reporting and the parent keeps its ink. */}\n <Collapsible.Panel\n keepMounted\n style={instantOpen ? { transitionDuration: \"0s\" } : undefined}\n >\n <SidebarSubmenuContext.Provider value={submenuContext}>\n {/* Indent and top gap live on a wrapper inside the panel: the\n measured height includes them, so a closed group adds no height\n and siblings never shift. (`List` resets its own padding.) */}\n <div\n data-submenu-list\n className={cn(\n \"pt-0.5\",\n icon\n ? SIDEBAR_SUBMENU_LIST_INDENT.withIcon\n : SIDEBAR_SUBMENU_LIST_INDENT.withoutIcon,\n )}\n >\n <List>{children}</List>\n </div>\n </SidebarSubmenuContext.Provider>\n </Collapsible.Panel>\n </Collapsible.Root>\n );\n}\n\n/* ------------------------------ account row ------------------------------ */\n\n/**\n * Whole-row account trigger. The row itself stays visually quiet — it only\n * carries the `group` state (hover/press/popup-open) and the focus ring;\n * all visual feedback renders on the ⋯ circle via `group-*` classes.\n */\nconst ACCOUNT_ROW =\n \"group outline-pho-brand flex w-full cursor-pointer items-center gap-2 rounded-base p-2 text-left focus-visible:outline-2 focus-visible:outline-offset-2\";\n\n/** Avatar initials: first + last word initial, else the first character. */\nfunction initialsFrom(name: string): string {\n const words = name.split(/\\s+/).filter(Boolean);\n const first = words[0]?.[0] ?? name[0] ?? \"?\";\n const last = words.length >= 2 ? (words[words.length - 1]?.[0] ?? \"\") : \"\";\n return (first + last).toUpperCase();\n}\n\nexport interface SidebarAccountRowProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"children\" | MotionHandlerConflicts\n> {\n /** Display name — also the source for fallback initials. */\n name: string;\n /** Avatar image URL; falls back to initials while loading or on error. */\n avatarSrc?: string;\n /** Override the derived initials. */\n initials?: string;\n ref?: Ref<HTMLButtonElement>;\n}\n\n/**\n * The account chip pinned to the rail's footer — an xs avatar, the name, and\n * a decorative ⋯ circle. The WHOLE row is one button, but the row is only the\n * control — the circle is the indicator: hover, press, and menu-open feedback\n * all render on the ⋯ (a span wearing the stock secondary-circle button\n * classes), driven by the row's `group` state, so it reads as a button\n * without nesting one.\n *\n * It renders a plain `<button>` and forwards every prop, so it slots straight\n * into a menu: `<Menu.Trigger render={<Sidebar.AccountRow name=\"…\" />} />` —\n * Base UI's `data-popup-open` / `data-pressed` states light up the circle.\n */\nfunction AccountRow({\n name,\n avatarSrc,\n initials,\n className,\n ...props\n}: SidebarAccountRowProps) {\n return (\n <motion.button\n type=\"button\"\n className={cn(ACCOUNT_ROW, className)}\n {...props}\n {...SIDEBAR_PRESS_MOTION}\n >\n <Avatar.Root size=\"xs\">\n {avatarSrc && <Avatar.Image src={avatarSrc} alt=\"\" />}\n <Avatar.Fallback>{initials ?? initialsFrom(name)}</Avatar.Fallback>\n </Avatar.Root>\n <span className=\"text-pho-primary min-w-0 flex-1 truncate text-base\">\n {name}\n </span>\n <span\n aria-hidden\n className={buttonVariants({\n variant: \"outlined\",\n size: \"sm\",\n shape: \"circle\",\n // Hover / open washes stay on the ⋯; press scale lives on the row\n // (same as Button / Sidebar.Item) so the circle does not double-scale.\n className:\n \"group-hover:bg-pho-primary-hover group-hover:text-pho-secondary-hover group-data-[popup-open]:bg-pho-primary-hover group-data-[popup-open]:text-pho-secondary-hover p-1\",\n })}\n >\n <IconDots className=\"size-4\" />\n </span>\n </motion.button>\n );\n}\n\n/* -------------------------------- assembly ------------------------------- */\n\n/**\n * The composed sidebar rail. Assemble the frame parts and fill them with\n * rows; wire interactivity by composing other Pho parts around them:\n *\n * ```tsx\n * <Sidebar.Root>\n * <Sidebar.Header>…brand…</Sidebar.Header>\n * <Sidebar.Nav>\n * <Sidebar.Group>\n * <Sidebar.GroupLabel>Pages</Sidebar.GroupLabel>\n * <Sidebar.List>\n * <Sidebar.Item href=\"/\" icon={IconHome} active>\n * Overview\n * </Sidebar.Item>\n * <Sidebar.Submenu label=\"Platforms\" icon={IconMessage}>\n * <Sidebar.Item href=\"/platforms/sms\">SMS</Sidebar.Item>\n * <Sidebar.Item href=\"/platforms/email\">Email</Sidebar.Item>\n * </Sidebar.Submenu>\n * </Sidebar.List>\n * </Sidebar.Group>\n * </Sidebar.Nav>\n * <Sidebar.Footer>\n * <Menu.Root>\n * <Menu.Trigger render={<Sidebar.AccountRow name=\"Ada Lovelace\" />} />\n * …\n * </Menu.Root>\n * </Sidebar.Footer>\n * </Sidebar.Root>\n * ```\n */\nexport const Sidebar = {\n Root,\n Header,\n Search,\n Nav,\n Group,\n GroupLabel,\n List,\n Item,\n Submenu,\n Footer,\n AccountRow,\n};\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AASA,IAAMkC,KAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAsC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAuC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAuC,KAAO;AAAA,EAAQ,CAAC;AAAC,GACzOC,KAAWxB,GAAqB,WAAW,QAAQ,QAAQuB,EAAU,GCgCrEE,IAAuB;AAAA,EAC3B,SAAS;AAAA,EACT,UAAU,EAAE,OAAO,KAAoB;AAAA,EACvC,YAAYpC;AACd,GAsBaqC,IACX,4FAGWC,IAAqB;AAAA,EAChC,MAAM;AAAA,EACN,IAAI;AACN,GAGaC,KAAoBlC,EAAGgC,GAAcC,EAAmB,IAAI,GAG5DE,KAAuB;AAAA,EAClC,MAAM;AAAA,EACN,IAAI;AACN,GAKaC,IACX,gMAMWC,KACX,iHAOWC,IAAwBtC,EACnC,qDACA,gFACF,GAOauC,KACX,iDAOWC,KACX,sEAQWC,IAA8B;AAAA,EAC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ACA,OAAAM;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAM;AAAA,EACA,SAAAW;AAAA,EACA,QAAAf;AAAA,EACA,YAAA4C;AACF"}
1
+ {"version":3,"file":"sidebar-DHYyBBUj.js","names":["SIDEBAR_PRESS_SPRING","Icon","_Fragment","Collapsible","BaseCollapsible","cn","isReactComponent","useLinkComponent","SPRING_PRESS","Button","buttonVariants","createReactComponent","IconArrowUpRight","IconChevronRight","Avatar","IconSearch","ScrollArea","Collapsible$1","Kbd","createContext","isValidElement","useCallback","useContext","useEffect","useId","useLayoutEffect","useMemo","useRef","useState","Fragment$1","jsx","jsxs","motion","Collapsible","__iconNode","IconDots","SIDEBAR_PRESS_MOTION","SIDEBAR_ROOT","SIDEBAR_ROOT_INSET","SIDEBAR_ROOT_BASE","SIDEBAR_HEADER_INSET","SIDEBAR_ITEM","SIDEBAR_ITEM_ACTIVE","SIDEBAR_ITEM_INACTIVE","SIDEBAR_SUBMENU_TRIGGER_CHILD_ACTIVE","SIDEBAR_SUBMENU_CHEVRON","SIDEBAR_SUBMENU_LIST_INDENT","SidebarInsetContext","SidebarSubmenuContext","useIsoLayoutEffect","Root","className","inset","props","Header","Search","label","kbd","Nav","scroll","insetTop","insetBottom","style","children","Group","GroupLabel","List","columns","Footer","renderIcon","icon","content","Item","active","wrap","href","external","rest","Link","MotionLink","submenu","rowId","rowClass","Submenu","openProp","defaultOpen","onOpenChange","openWhenChildActive","activeProp","uncontrolledOpen","setUncontrolledOpen","isControlled","open","setOpen","next","activeRowIds","setActiveRowIds","reportActive","isActive","previous","submenuContext","childActive","hasPaintedRef","frame","instantOpen","setInstantOpen","latestOpenRef","latestSetOpenRef","ACCOUNT_ROW","initialsFrom","name","words","AccountRow","avatarSrc","initials","Sidebar"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs","../../src/sections/sidebar/sidebar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-2\" }]];\nconst IconDots = createReactComponent(\"outline\", \"dots\", \"Dots\", __iconNode);\n\nexport { __iconNode, IconDots as default };\n","import {\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type ComponentProps,\n type ComponentType,\n type FC,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n IconArrowUpRight,\n IconChevronRight,\n IconDots,\n} from \"@tabler/icons-react\";\nimport { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport { SPRING_PRESS } from \"../../motion\";\nimport { motion } from \"motion/react\";\nimport { IconSearch } from \"@tabler/icons-react\";\nimport { Button } from \"../../components/button\";\nimport { Collapsible } from \"../../components/collapsible\";\nimport { Kbd } from \"../../components/kbd\";\nimport { ScrollArea } from \"../../components/scroll-area\";\nimport { cn } from \"../../utils/cn\";\nimport { isReactComponent } from \"../../utils/is-react-component\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\nimport { Avatar } from \"../../components/avatar\";\nimport { buttonVariants } from \"../../components/button\";\n\n/** Same press compression as `Button` — transform-only, every interactive row. */\nconst SIDEBAR_PRESS_SCALE = 0.97;\n/** Framer source transition shared with `Button`: `spring-physics 200 30 0.1`. */\nconst SIDEBAR_PRESS_SPRING = SPRING_PRESS;\nconst SIDEBAR_PRESS_MOTION = {\n initial: false as const,\n whileTap: { scale: SIDEBAR_PRESS_SCALE },\n transition: SIDEBAR_PRESS_SPRING,\n};\n\n/**\n * Sidebar — Pho's first SECTION: a composed app rail, not a micro component.\n * It encodes the navigation rail used across Photon surfaces (the Pho docs\n * site, the dashboard): a sticky full-height column with a brand header, a\n * scrollable stack of titled nav groups, and a pinned footer that usually\n * carries the account row.\n *\n * Sections stay presentational — no router, no data fetching, no theme\n * plumbing. Links render through the host's `LinkProvider` (same contract as\n * `ButtonLink`), state arrives via props (`active`), and interactive footers\n * compose with other Pho parts (e.g. wrap `Sidebar.AccountRow` in a\n * `Menu.Trigger render={...}` to open an account menu).\n *\n * `Root` takes `inset` (`base` | `sm`, default `base`) for the rail's outer\n * padding and header spacing — prefer that over host-app class overrides.\n */\n\n/* ------------------------------- class map ------------------------------- */\n\n/** The rail itself — sticky, full-height, hairline right edge (no inset). */\nexport const SIDEBAR_ROOT =\n \"border-pho-secondary bg-pho-page sticky top-0 flex h-dvh w-64 shrink-0 flex-col border-r\";\n\n/** Outer inset on `Root` — `base` is the docs/default rail; `sm` is tighter. */\nexport const SIDEBAR_ROOT_INSET = {\n base: \"px-4 pt-5 pb-4\",\n sm: \"px-3 pt-4 pb-3\",\n} as const;\n\n/** `SIDEBAR_ROOT` with the default `base` inset — one string for docs chrome. */\nexport const SIDEBAR_ROOT_BASE = cn(SIDEBAR_ROOT, SIDEBAR_ROOT_INSET.base);\n\n/** Header spacing paired with `Root`'s `inset`. */\nexport const SIDEBAR_HEADER_INSET = {\n base: \"mb-6 px-2\",\n sm: \"mb-3 px-0\",\n} as const;\n\nexport type SidebarInset = keyof typeof SIDEBAR_ROOT_INSET;\n\n/** A nav row at rest and on hover. Active/inactive inks split below. */\nexport const SIDEBAR_ITEM =\n \"outline-pho-brand flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left text-base transition-colors focus-visible:outline-2 focus-visible:-outline-offset-1\";\n\n/**\n * Selected row — lifted onto the primary surface with the site hairline.\n * The icon carries the same ink as the label so the pair reads as one unit.\n */\nexport const SIDEBAR_ITEM_ACTIVE =\n \"bg-pho-primary text-pho-primary ring-pho-secondary font-medium ring-1 ring-inset *:data-icon:text-pho-primary\";\n\n/**\n * Resting row — secondary ink (75%). Hover lifts onto the primary surface\n * (same plane as the active chip, without the ring) so the wash stays quiet\n * on `pho-page`. Icon tracks the label's ink at every state.\n */\nexport const SIDEBAR_ITEM_INACTIVE = cn(\n \"text-pho-secondary *:data-icon:text-pho-secondary\",\n \"hover:bg-pho-primary hover:text-pho-primary hover:*:data-icon:text-pho-primary\",\n);\n\n/**\n * A submenu's parent row while one of its children is the current page —\n * primary ink on label and icon, but no surface or ring: the child row\n * carries the full active chip, the parent only points at it.\n */\nexport const SIDEBAR_SUBMENU_TRIGGER_CHILD_ACTIVE =\n \"text-pho-primary *:data-icon:text-pho-primary\";\n\n/**\n * The trailing chevron on a submenu row — points right at rest, rotates to\n * point down while the panel is open. Base UI sets `data-panel-open` on the\n * trigger; the global reduced-motion guard collapses the rotation.\n */\nexport const SIDEBAR_SUBMENU_CHEVRON =\n \"ml-auto size-4 shrink-0 transition-transform duration-150 ease-out\";\n\n/**\n * Indent for a submenu's rows so their labels line up with the parent's\n * label: parent padding (8px) + icon (16px) + gap (8px) = 32px, minus the\n * child row's own 8px padding. Without a parent icon the label sits at 8px,\n * so children step in by one row padding only.\n */\nexport const SIDEBAR_SUBMENU_LIST_INDENT = {\n withIcon: \"pl-6\",\n withoutIcon: \"pl-4\",\n} as const;\n\nconst SidebarInsetContext = createContext<SidebarInset>(\"base\");\n\n/**\n * Rows inside a `Sidebar.Submenu` report their `active` flag here so the\n * parent can light up and auto-open. `null` outside a submenu.\n */\ninterface SidebarSubmenuContextValue {\n reportActive: (rowId: string, active: boolean) => void;\n}\n\nconst SidebarSubmenuContext = createContext<SidebarSubmenuContextValue | null>(\n null,\n);\n\n// React 18 warns that useLayoutEffect does nothing on the server (19 dropped\n// the warning); fall back to useEffect there so SSR'd docs stay quiet.\nconst useIsoLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\n/* --------------------------------- frame --------------------------------- */\n\ninterface RootProps extends ComponentProps<\"aside\"> {\n /** Outer padding + header spacing. Defaults to `base`. */\n inset?: SidebarInset;\n ref?: Ref<HTMLElement>;\n}\n\n/** The rail — a sticky, full-height `<aside>` with the hairline right edge. */\nfunction Root({ className, inset = \"base\", ...props }: RootProps) {\n return (\n <SidebarInsetContext.Provider value={inset}>\n <aside\n className={cn(SIDEBAR_ROOT, SIDEBAR_ROOT_INSET[inset], className)}\n {...props}\n data-inset={inset}\n />\n </SidebarInsetContext.Provider>\n );\n}\n\n/** Brand slot at the top of the rail — logo, wordmark, workspace switcher. */\nfunction Header({ className, ...props }: ComponentProps<\"div\">) {\n const inset = useContext(SidebarInsetContext);\n return (\n <div\n className={cn(\n \"flex items-center gap-2.5 [&:has(+nav)]:mb-0\",\n SIDEBAR_HEADER_INSET[inset],\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * The rail's search row — an outlined button dressed to `Item` metrics so\n * its label lines up with the rows below, the shortcut at the trailing\n * edge. The press is the Button's own; wire `onClick` (and a global ⌘K)\n * to a `Command.Dialog`.\n */\nfunction Search({\n label = \"Search\",\n kbd = \"⌘K\",\n className,\n ...props\n}: Omit<ComponentProps<typeof Button>, \"children\" | \"variant\" | \"size\"> & {\n label?: ReactNode;\n kbd?: string;\n}) {\n return (\n <Button\n variant=\"outlined\"\n shape=\"square\"\n size=\"md\"\n aria-keyshortcuts={kbd === \"⌘K\" ? \"Meta+K Control+K\" : undefined}\n prefix={<IconSearch aria-hidden />}\n suffix={<Kbd keys={kbd} className=\"pointer-events-none\" />}\n className={cn(\n \"hover:ring-pho-secondary min-h-9 w-full justify-start gap-2 rounded-sm px-2 py-1.5 has-[[data-icon=prefix]]:pl-2 has-[[data-icon=suffix]]:pr-2 [&>[data-text]]:min-w-0 [&>[data-text]]:flex-1 [&>[data-text]]:truncate [&>[data-text]]:text-left\",\n className,\n )}\n {...props}\n >\n {label}\n </Button>\n );\n}\n\n/**\n * The scrollable middle — a stack of `Sidebar.Group`s in a `ScrollArea`\n * (overlay scrollbar, edge fade). Pass `scroll={false}` where a parent\n * scrolls the whole rail as one column (a narrow-viewport drawer) — the\n * nav is then a plain stack at its natural height.\n *\n * The nav owns its breathing room toward its neighbors as a resting inset\n * (a scroll view's safe-area padding): 24px above, 16px below by default —\n * rows stand clear of the ends at rest and scroll through the gap, under\n * the edge fade, instead of clipping at a dead margin. `inset` /\n * `insetTop` / `insetBottom` override it; the same values become plain\n * padding when `scroll={false}`, so both modes keep one geometry. A\n * `Header` right before the nav and a `Footer` after it drop their own\n * margins — the gap lives here, not on the neighbors.\n */\nfunction Nav({\n scroll = true,\n inset,\n insetTop = inset ?? 24,\n insetBottom = inset ?? 16,\n className,\n style,\n children,\n ...props\n}: ComponentProps<\"nav\"> & {\n scroll?: boolean;\n inset?: number | string;\n insetTop?: number | string;\n insetBottom?: number | string;\n}) {\n if (!scroll) {\n return (\n <nav\n className={cn(\"flex flex-col gap-6\", className)}\n style={{\n paddingTop: insetTop ?? inset,\n paddingBottom: insetBottom ?? inset,\n ...style,\n }}\n {...props}\n >\n {children}\n </nav>\n );\n }\n return (\n <nav\n className={cn(\"flex min-h-0 flex-1 flex-col\", className)}\n style={style}\n {...props}\n >\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content\n inset={inset}\n insetTop={insetTop}\n insetBottom={insetBottom}\n className=\"flex flex-col gap-6\"\n >\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </nav>\n );\n}\n\nfunction Group({ className, ...props }: ComponentProps<\"div\">) {\n return <div className={className} {...props} />;\n}\n\n/** The cluster's caption — description ink, regular weight. */\nfunction GroupLabel({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"text-pho-description mb-2 px-2 text-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface ListProps extends ComponentProps<\"ul\"> {\n /** Lay the rows out in two columns — for long, flat registries. */\n columns?: boolean;\n}\n\n/** The rows of a group. `columns` switches to a two-column grid. */\nfunction List({ className, columns, ...props }: ListProps) {\n return (\n <ul\n className={cn(\n // list-none/m-0/p-0 shield the rail from host prose styles.\n \"m-0 list-none p-0 *:m-0\",\n columns\n ? \"grid grid-cols-2 gap-x-2 gap-y-0.5\"\n : \"flex flex-col gap-0.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Pinned bottom cluster — docs link, account row, theme toggle. */\nfunction Footer({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"mt-4 flex flex-col gap-0.5 [nav~&]:mt-0\", className)}\n {...props}\n />\n );\n}\n\n/* --------------------------------- item ---------------------------------- */\n\n/** An icon slot — a component (`IconBook`) or element (`<IconBook />`). */\ntype Slottable = ReactNode | FC<{ className?: string }>;\n\nfunction renderIcon(icon: Slottable): ReactNode {\n if (icon == null || icon === false) return null;\n let content: ReactNode = null;\n if (isReactComponent(icon)) {\n const Icon = icon;\n content = <Icon />;\n } else if (isValidElement(icon)) {\n content = icon;\n }\n if (content == null) return null;\n return (\n <span\n data-icon\n className=\"pointer-events-none inline-flex shrink-0 items-center [&>svg]:size-4 [&>svg]:shrink-0\"\n >\n {content}\n </span>\n );\n}\n\ninterface ItemBaseProps {\n /** Slot before the label — a component (`IconBook`) or element. */\n icon?: Slottable;\n /** Marks the row as the current destination (adds `aria-current=\"page\"`). */\n active?: boolean;\n /**\n * Let the label break onto two lines instead of truncating. Default\n * rows stay a single truncated line so the rail keeps even height.\n * The row still uses `min-h-9`; wrap only grows it when the text\n * actually breaks. Caps at two lines.\n */\n wrap?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * DOM handlers whose React signatures clash with Motion's gesture props.\n * Same omit list as `Button` — rows render through `motion.*`.\n */\ntype MotionHandlerConflicts =\n | \"onAnimationStart\"\n | \"onAnimationEnd\"\n | \"onAnimationIteration\"\n | \"onDrag\"\n | \"onDragStart\"\n | \"onDragEnd\"\n | \"onDragEnter\"\n | \"onDragExit\"\n | \"onDragLeave\"\n | \"onDragOver\"\n | \"onDrop\";\n\nexport interface SidebarItemLinkProps\n extends\n ItemBaseProps,\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof ItemBaseProps | MotionHandlerConflicts\n > {\n /** Destination — rendered through the host's `LinkProvider`. */\n href: string;\n /** Leaves the app: opens in a new tab and renders a ↗ cue. */\n external?: boolean;\n}\n\nexport interface SidebarItemButtonProps\n extends\n ItemBaseProps,\n Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof ItemBaseProps | MotionHandlerConflicts\n > {\n href?: undefined;\n external?: undefined;\n}\n\nexport type SidebarItemProps = SidebarItemLinkProps | SidebarItemButtonProps;\n\n/**\n * A nav row — a link when `href` is given (rendered through the host's\n * `LinkProvider`), otherwise a button. `active` lifts the row onto the\n * primary surface; `external` opens a new tab and appends a ↗ cue.\n * `wrap` drops the single-line truncate so a long product name can sit\n * on two lines; other rows stay one line.\n */\nfunction Item({\n icon,\n active,\n wrap = false,\n className,\n children,\n href,\n external,\n ...rest\n}: SidebarItemProps) {\n const Link = useLinkComponent();\n // Same bridge as `ButtonLink` — host `LinkProvider` + Motion press scale.\n const MotionLink = useMemo(\n () =>\n motion.create(Link as unknown as ComponentType<Record<string, unknown>>),\n [Link],\n );\n // Inside a `Submenu`, tell the parent row when this one is current so it\n // can light up and auto-open. Layout effect: the parent reads the result\n // before first paint, so a route-selected group opens without a flash.\n const submenu = useContext(SidebarSubmenuContext);\n const rowId = useId();\n useIsoLayoutEffect(() => {\n if (!submenu) return;\n submenu.reportActive(rowId, Boolean(active));\n return () => submenu.reportActive(rowId, false);\n }, [submenu, rowId, active]);\n const rowClass = cn(\n SIDEBAR_ITEM,\n active ? SIDEBAR_ITEM_ACTIVE : SIDEBAR_ITEM_INACTIVE,\n className,\n );\n const label = (\n <span\n className={\n wrap\n ? \"line-clamp-2 min-w-0 flex-1 text-balance hyphens-none\"\n : \"min-w-0 flex-1 truncate\"\n }\n >\n {children}\n </span>\n );\n\n if (href !== undefined) {\n return (\n <li>\n <MotionLink\n href={href}\n aria-current={active ? \"page\" : undefined}\n {...(external && { target: \"_blank\", rel: \"noopener noreferrer\" })}\n {...(rest as AnchorHTMLAttributes<HTMLAnchorElement>)}\n className={rowClass}\n {...SIDEBAR_PRESS_MOTION}\n >\n {renderIcon(icon)}\n {label}\n {external && (\n <>\n {renderIcon(<IconArrowUpRight aria-hidden />)}\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </MotionLink>\n </li>\n );\n }\n\n return (\n <li>\n <motion.button\n type=\"button\"\n aria-current={active ? \"page\" : undefined}\n {...(rest as Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n MotionHandlerConflicts\n >)}\n className={rowClass}\n {...SIDEBAR_PRESS_MOTION}\n >\n {renderIcon(icon)}\n {label}\n </motion.button>\n </li>\n );\n}\n\n/* -------------------------------- submenu -------------------------------- */\n\nexport interface SidebarSubmenuProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"children\" | MotionHandlerConflicts\n> {\n /** The parent row's label. */\n label: ReactNode;\n /** Slot before the label — a component (`IconBook`) or element. */\n icon?: Slottable;\n /** Controlled open state. Pair with `onOpenChange`. */\n open?: boolean;\n /** Initial open state when uncontrolled. Defaults to `false`. */\n defaultOpen?: boolean;\n /** Called with the next open state on every toggle (user or auto-open). */\n onOpenChange?: (open: boolean) => void;\n /**\n * Open the panel whenever a child row becomes `active`, so a route-based\n * rail expands the right group on load and on navigation. Defaults to\n * `true`. The user can still collapse the group afterwards.\n */\n openWhenChildActive?: boolean;\n /**\n * Force the parent's child-active ink. Normally derived from the\n * children's `active` flags — set this when the current destination lives\n * under the group but has no row of its own.\n */\n active?: boolean;\n /** The nested rows — `Sidebar.Item`s, no icon needed. */\n children: ReactNode;\n ref?: Ref<HTMLButtonElement>;\n}\n\n/**\n * A nav row that folds open to reveal child rows — `<Item>` metrics on the\n * trigger, a trailing chevron that turns as the panel opens, and the nested\n * list indented to the parent's label. Built on `Collapsible`, so the\n * height animation (and its reduced-motion collapse) is the library's own.\n *\n * Children are ordinary `Sidebar.Item`s: they report `active` upward, so the\n * parent takes primary ink while a child is current and, with\n * `openWhenChildActive` (default), opens on load without a flash.\n *\n * ```tsx\n * <Sidebar.Submenu label=\"Platforms\" icon={IconMessage}>\n * <Sidebar.Item href=\"/platforms/sms\" active>SMS</Sidebar.Item>\n * <Sidebar.Item href=\"/platforms/imessage\">iMessage</Sidebar.Item>\n * </Sidebar.Submenu>\n * ```\n */\nfunction Submenu({\n label,\n icon,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n openWhenChildActive = true,\n active: activeProp,\n className,\n children,\n ...rest\n}: SidebarSubmenuProps) {\n /* ---- open state: controlled when `open` is given, else internal ---- */\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = openProp !== undefined;\n const open = isControlled ? openProp : uncontrolledOpen;\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setUncontrolledOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n /* ---- which child rows are current (reported by `Item`) ---- */\n const [activeRowIds, setActiveRowIds] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n const reportActive = useCallback((rowId: string, isActive: boolean) => {\n setActiveRowIds((previous) => {\n if (previous.has(rowId) === isActive) return previous;\n const next = new Set(previous);\n if (isActive) next.add(rowId);\n else next.delete(rowId);\n return next;\n });\n }, []);\n const submenuContext = useMemo(() => ({ reportActive }), [reportActive]);\n const childActive = activeProp ?? activeRowIds.size > 0;\n\n /* ---- auto-open on an active child ---- */\n // `true` once the browser has painted the first frame. An auto-open that\n // happens before that (the route already sits under this group on load)\n // must not animate — the rail should simply appear expanded.\n const hasPaintedRef = useRef(false);\n useEffect(() => {\n const frame = requestAnimationFrame(() => {\n hasPaintedRef.current = true;\n });\n return () => cancelAnimationFrame(frame);\n }, []);\n // While `true`, the panel's height transition runs at 0s so the pre-paint\n // auto-open lands instantly. Cleared a frame later so the next toggle\n // animates normally.\n const [instantOpen, setInstantOpen] = useState(false);\n // Read through refs so the effect fires only when the active children\n // change — a user collapsing the group must not be undone by a re-render.\n const latestOpenRef = useRef(open);\n latestOpenRef.current = open;\n const latestSetOpenRef = useRef(setOpen);\n latestSetOpenRef.current = setOpen;\n useIsoLayoutEffect(() => {\n if (!openWhenChildActive || !childActive || latestOpenRef.current) return;\n if (!hasPaintedRef.current) setInstantOpen(true);\n latestSetOpenRef.current(true);\n }, [activeRowIds, childActive, openWhenChildActive]);\n useEffect(() => {\n if (!instantOpen) return;\n const frame = requestAnimationFrame(() => setInstantOpen(false));\n return () => cancelAnimationFrame(frame);\n }, [instantOpen]);\n\n return (\n <Collapsible.Root\n open={open}\n onOpenChange={(next) => setOpen(next)}\n render={<li />}\n >\n <BaseCollapsible.Trigger\n // Same press compression as `Item`; Base UI wires aria-expanded,\n // aria-controls, and Enter / Space onto the native button.\n render={<motion.button {...SIDEBAR_PRESS_MOTION} />}\n className={cn(\n SIDEBAR_ITEM,\n SIDEBAR_ITEM_INACTIVE,\n childActive && SIDEBAR_SUBMENU_TRIGGER_CHILD_ACTIVE,\n // The chevron turns to point down while the panel is open.\n \"data-[panel-open]:*:data-chevron:rotate-90\",\n className,\n )}\n data-child-active={childActive || undefined}\n {...rest}\n >\n {renderIcon(icon)}\n <span className=\"min-w-0 flex-1 truncate\">{label}</span>\n <IconChevronRight\n aria-hidden\n data-chevron\n className={SIDEBAR_SUBMENU_CHEVRON}\n />\n </BaseCollapsible.Trigger>\n {/* keepMounted: closed children stay mounted (hidden) so an active\n child keeps reporting and the parent keeps its ink. */}\n <Collapsible.Panel\n keepMounted\n style={instantOpen ? { transitionDuration: \"0s\" } : undefined}\n >\n <SidebarSubmenuContext.Provider value={submenuContext}>\n {/* Indent and top gap live on a wrapper inside the panel: the\n measured height includes them, so a closed group adds no height\n and siblings never shift. (`List` resets its own padding.) */}\n <div\n data-submenu-list\n className={cn(\n \"pt-0.5\",\n icon\n ? SIDEBAR_SUBMENU_LIST_INDENT.withIcon\n : SIDEBAR_SUBMENU_LIST_INDENT.withoutIcon,\n )}\n >\n <List>{children}</List>\n </div>\n </SidebarSubmenuContext.Provider>\n </Collapsible.Panel>\n </Collapsible.Root>\n );\n}\n\n/* ------------------------------ account row ------------------------------ */\n\n/**\n * Whole-row account trigger. The row itself stays visually quiet — it only\n * carries the `group` state (hover/press/popup-open) and the focus ring;\n * all visual feedback renders on the ⋯ circle via `group-*` classes.\n */\nconst ACCOUNT_ROW =\n \"group outline-pho-brand flex w-full cursor-pointer items-center gap-2 rounded-base p-2 text-left focus-visible:outline-2 focus-visible:outline-offset-2\";\n\n/** Avatar initials: first + last word initial, else the first character. */\nfunction initialsFrom(name: string): string {\n const words = name.split(/\\s+/).filter(Boolean);\n const first = words[0]?.[0] ?? name[0] ?? \"?\";\n const last = words.length >= 2 ? (words[words.length - 1]?.[0] ?? \"\") : \"\";\n return (first + last).toUpperCase();\n}\n\nexport interface SidebarAccountRowProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"children\" | MotionHandlerConflicts\n> {\n /** Display name — also the source for fallback initials. */\n name: string;\n /** Avatar image URL; falls back to initials while loading or on error. */\n avatarSrc?: string;\n /** Override the derived initials. */\n initials?: string;\n ref?: Ref<HTMLButtonElement>;\n}\n\n/**\n * The account chip pinned to the rail's footer — an xs avatar, the name, and\n * a decorative ⋯ circle. The WHOLE row is one button, but the row is only the\n * control — the circle is the indicator: hover, press, and menu-open feedback\n * all render on the ⋯ (a span wearing the stock secondary-circle button\n * classes), driven by the row's `group` state, so it reads as a button\n * without nesting one.\n *\n * It renders a plain `<button>` and forwards every prop, so it slots straight\n * into a menu: `<Menu.Trigger render={<Sidebar.AccountRow name=\"…\" />} />` —\n * Base UI's `data-popup-open` / `data-pressed` states light up the circle.\n */\nfunction AccountRow({\n name,\n avatarSrc,\n initials,\n className,\n ...props\n}: SidebarAccountRowProps) {\n return (\n <motion.button\n type=\"button\"\n className={cn(ACCOUNT_ROW, className)}\n {...props}\n {...SIDEBAR_PRESS_MOTION}\n >\n <Avatar.Root size=\"xs\">\n {avatarSrc && <Avatar.Image src={avatarSrc} alt=\"\" />}\n <Avatar.Fallback>{initials ?? initialsFrom(name)}</Avatar.Fallback>\n </Avatar.Root>\n <span className=\"text-pho-primary min-w-0 flex-1 truncate text-base\">\n {name}\n </span>\n <span\n aria-hidden\n className={buttonVariants({\n variant: \"outlined\",\n size: \"sm\",\n shape: \"circle\",\n // Hover / open washes stay on the ⋯; press scale lives on the row\n // (same as Button / Sidebar.Item) so the circle does not double-scale.\n className:\n \"group-hover:bg-pho-primary-hover group-hover:text-pho-secondary-hover group-data-[popup-open]:bg-pho-primary-hover group-data-[popup-open]:text-pho-secondary-hover p-1\",\n })}\n >\n <IconDots className=\"size-4\" />\n </span>\n </motion.button>\n );\n}\n\n/* -------------------------------- assembly ------------------------------- */\n\n/**\n * The composed sidebar rail. Assemble the frame parts and fill them with\n * rows; wire interactivity by composing other Pho parts around them:\n *\n * ```tsx\n * <Sidebar.Root>\n * <Sidebar.Header>…brand…</Sidebar.Header>\n * <Sidebar.Nav>\n * <Sidebar.Group>\n * <Sidebar.GroupLabel>Pages</Sidebar.GroupLabel>\n * <Sidebar.List>\n * <Sidebar.Item href=\"/\" icon={IconHome} active>\n * Overview\n * </Sidebar.Item>\n * <Sidebar.Submenu label=\"Platforms\" icon={IconMessage}>\n * <Sidebar.Item href=\"/platforms/sms\">SMS</Sidebar.Item>\n * <Sidebar.Item href=\"/platforms/email\">Email</Sidebar.Item>\n * </Sidebar.Submenu>\n * </Sidebar.List>\n * </Sidebar.Group>\n * </Sidebar.Nav>\n * <Sidebar.Footer>\n * <Menu.Root>\n * <Menu.Trigger render={<Sidebar.AccountRow name=\"Ada Lovelace\" />} />\n * …\n * </Menu.Root>\n * </Sidebar.Footer>\n * </Sidebar.Root>\n * ```\n */\nexport const Sidebar = {\n Root,\n Header,\n Search,\n Nav,\n Group,\n GroupLabel,\n List,\n Item,\n Submenu,\n Footer,\n AccountRow,\n};\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AASA,IAAMkC,KAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAsC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAuC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAuC,KAAO;AAAA,EAAQ,CAAC;AAAC,GACzOC,KAAWxB,GAAqB,WAAW,QAAQ,QAAQuB,EAAU,GCgCrEE,IAAuB;AAAA,EAC3B,SAAS;AAAA,EACT,UAAU,EAAE,OAAO,KAAoB;AAAA,EACvC,YAAYpC;AACd,GAsBaqC,IACX,4FAGWC,IAAqB;AAAA,EAChC,MAAM;AAAA,EACN,IAAI;AACN,GAGaC,KAAoBlC,EAAGgC,GAAcC,EAAmB,IAAI,GAG5DE,KAAuB;AAAA,EAClC,MAAM;AAAA,EACN,IAAI;AACN,GAKaC,IACX,gMAMWC,KACX,iHAOWC,IAAwBtC,EACnC,qDACA,gFACF,GAOauC,KACX,iDAOWC,KACX,sEAQWC,IAA8B;AAAA,EACzC,UAAU;AAAA,EACV,aAAa;AACf,GAEMC,IAAsB5B,EAA4B,MAAM,GAUxD6B,IAAwB7B,EAC5B,IACF,GAIM8B,IACJ,OAAO,SAAW,MAAc1B,IAAYE;AAW9C,SAASyB,GAAK,EAAE,WAAAC,GAAW,OAAAC,IAAQ,QAAQ,GAAGC,EAAA,GAAoB;AAChE,SACE,gBAAAvB,EAACiB,EAAoB,UAArB;AAAA,IAA8B,OAAOK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AClB,MAAAF,GACA,WAAAG,GACA,UAAAC,GACA,WAAA/D,GACA,GAAGE,EAAA,GACsB;AACzB,SACE,gBAAAtB,EAACC,EAAO,QAAR;AAAA,IACE,MAAK;AAAA,IACL,WAAW3B,EAAGuG,IAAazD,CAAS;AAAA,IACpC,GAAIE;AAAA,IACJ,GAAIjB;AAAA,IAJN,UAAA;AAAA,MAME,gBAAAL,EAACjB,EAAO,MAAR;AAAA,QAAa,MAAK;AAAA,QAAlB,UAAA,CACGmG,KAAa,gBAAAnF,EAAChB,EAAO,OAAR;AAAA,UAAc,KAAKmG;AAAA,UAAW,KAAI;AAAA,QAAI,CAAA,GACpD,gBAAAnF,EAAChB,EAAO,UAAR,EAAA,UAAkBoG,KAAYL,GAAaC,CAAI,EAAmB,CAAA,CACvD;AAAA,M;A,MACb,gBAAAhF,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QACb,UAAAgF;AAAA,MACG,CAAA;AAAA,MACN,gBAAAhF,EAAC,QAAD;AAAA,QACE,eAAA;AAAA,QACA,WAAWpB,GAAe;AAAA,UACxB,SAAS;AAAA,UACT,MAAM;AAAA,UACN,OAAO;AAAA,UAGP,WACE;AAAA,QACJ,CAAC;AAAA,QAED,UAAA,gBAAAoB,EAACK,IAAD,EAAU,WAAU,SAAU,CAAA;AAAA,MAC1B,CAAA;AAAA,IACO;AAAA,E;AAEnB;AAkCA,IAAagF,KAAU;AAAA,EACrB,MAAAjE;AAAA,EACA,QAAAI;AAAA,EACA,QAAAC;AAAA,EACA,KAAAG;AAAA,EACA,OAAAM;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAM;AAAA,EACA,SAAAW;AAAA,EACA,QAAAf;AAAA,EACA,YAAA4C;AACF"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { t as c } from "./cn-CPbhpG1q.js";
3
3
  import { t as p } from "./createReactComponent-yKZn9MIX.js";
4
- import { r as h } from "./badge-CVViIYj_.js";
4
+ import { r as x } from "./badge-CVViIYj_.js";
5
5
  import "react";
6
6
  import { jsx as a, jsxs as i } from "react/jsx-runtime";
7
7
  var y = [["path", {
@@ -31,19 +31,19 @@ function _(t) {
31
31
  function k(t, e) {
32
32
  return t === "flat" || e === "none" ? "muted" : t === e ? "success" : "error";
33
33
  }
34
- function m({ label: t, value: e, delta: r, deltaDirection: o, deltaGood: d = "up", note: s, className: f, ...x }) {
35
- const n = r == null ? null : o ?? _(r), g = typeof r == "number" ? `${v.format(r).replace("-", "−")}%` : r, l = n === "up" ? b : n === "down" ? w : null;
34
+ function m({ label: t, value: e, delta: r, deltaDirection: o, deltaGood: d = "up", note: s, className: f, ...g }) {
35
+ const n = r == null ? null : o ?? _(r), h = typeof r == "number" ? `${v.format(r).replace("-", "−")}%` : r, l = n === "up" ? b : n === "down" ? w : null;
36
36
  return /* @__PURE__ */ i("div", {
37
37
  "data-stat": "",
38
38
  className: c("flex min-w-0 flex-col gap-1 px-5 py-4", f),
39
- ...x,
39
+ ...g,
40
40
  children: [
41
41
  /* @__PURE__ */ i("div", {
42
42
  className: "flex items-start justify-between gap-3",
43
43
  children: [/* @__PURE__ */ a("span", {
44
44
  className: "text-pho-secondary min-w-0 truncate text-base",
45
45
  children: t
46
- }), r != null && n != null && /* @__PURE__ */ i(h, {
46
+ }), r != null && n != null && /* @__PURE__ */ i(x, {
47
47
  size: "sm",
48
48
  contrast: "low",
49
49
  color: k(n, d),
@@ -52,11 +52,11 @@ function m({ label: t, value: e, delta: r, deltaDirection: o, deltaGood: d = "up
52
52
  children: [l && /* @__PURE__ */ a(l, {
53
53
  "aria-hidden": !0,
54
54
  className: "size-3"
55
- }), g]
55
+ }), h]
56
56
  })]
57
57
  }),
58
58
  /* @__PURE__ */ a("span", {
59
- className: "text-display-md text-pho-primary min-w-0 truncate font-medium",
59
+ className: "font-heading text-display-md text-pho-primary min-w-0 truncate font-medium",
60
60
  children: e
61
61
  }),
62
62
  s != null && /* @__PURE__ */ a("span", {
@@ -82,4 +82,4 @@ export {
82
82
  m as t
83
83
  };
84
84
 
85
- //# sourceMappingURL=stat-BXBfMQ9Q.js.map
85
+ //# sourceMappingURL=stat-VxA1SvS_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stat-BXBfMQ9Q.js","names":["__iconNode","cn","createReactComponent","Badge","jsx","jsxs","__iconNode$1","IconTrendingDown","__iconNode","IconTrendingUp","percent","directionOf","delta","trimmed","first","body","deltaColor","direction","good","Stat","label","value","deltaDirection","deltaGood","note","className","props","text","Arrow","StatGroup","variant"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingDown.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingUp.mjs","../../src/components/stat/stat.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 7l6 6l4 -4l8 8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 10l0 7l-7 0\", \"key\": \"svg-1\" }]];\nconst IconTrendingDown = createReactComponent(\"outline\", \"trending-down\", \"TrendingDown\", __iconNode);\n\nexport { __iconNode, IconTrendingDown as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 17l6 -6l4 4l8 -8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M14 7l7 0l0 7\", \"key\": \"svg-1\" }]];\nconst IconTrendingUp = createReactComponent(\"outline\", \"trending-up\", \"TrendingUp\", __iconNode);\n\nexport { __iconNode, IconTrendingUp as default };\n","import { type ComponentProps, type ReactNode } from \"react\";\nimport { IconTrendingDown, IconTrendingUp } from \"@tabler/icons-react\";\nimport { Badge, type BadgeColor } from \"../badge\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * Stat — a figure with its name: a label, a value, and, when it\n * matters, how the value moved and against what.\n *\n * Design notes:\n * - The value is the loud element: display size, medium weight, the\n * font's proportional figures (tabular digits make a big `121` look\n * loose). Label and note stay in the UI inks; nothing else competes.\n * - The delta is a low-contrast `Badge` beside the label, with an arrow so\n * the direction never rides on colour alone. Its ink says whether the\n * move is good news: `deltaGood` names the good direction, because a\n * drop in bounce rate is green and a drop in visitors is red.\n * - A tile has no chrome of its own. Alone, it sits in whatever card holds\n * it; in a `Stat.Group` the tiles share one frame and hairlines.\n */\n\nexport type StatDirection = \"up\" | \"down\" | \"flat\";\n\nexport interface StatProps extends Omit<ComponentProps<\"div\">, \"children\"> {\n /** What the figure counts — \"Visitors\", \"Active chats\". */\n label: ReactNode;\n /** The figure, already formatted — \"20.8K\", \"8m 32s\", \"1:1\". */\n value: ReactNode;\n /**\n * How the value moved: a number is a percentage change and renders\n * signed with one decimal (\"−42.0%\"); a string renders as written and\n * its sign sets the direction.\n */\n delta?: number | string;\n /** The delta's direction, when the string can't say. Derived otherwise. */\n deltaDirection?: StatDirection;\n /**\n * Which direction is good news: `up` (visitors, revenue), `down` (bounce\n * rate, latency), `none` when a move is just information. @default \"up\"\n */\n deltaGood?: \"up\" | \"down\" | \"none\";\n /** What the delta is against — \"vs. 36.2K prior\". */\n note?: ReactNode;\n}\n\nconst percent = new Intl.NumberFormat(\"en-US\", {\n minimumFractionDigits: 1,\n maximumFractionDigits: 1,\n signDisplay: \"exceptZero\",\n});\n\n/**\n * A leading sign — ASCII or the true minus — sets a string delta's direction.\n * A signed zero (\"+0%\", \"−0.0%\") is still flat: a caller's formatter may\n * sign every value, and zero has not moved.\n */\nfunction directionOf(delta: number | string): StatDirection {\n if (typeof delta === \"number\") {\n return delta > 0 ? \"up\" : delta < 0 ? \"down\" : \"flat\";\n }\n const trimmed = delta.trim();\n const first = trimmed.charAt(0);\n const signed = first === \"+\" || first === \"-\" || first === \"−\";\n if (!signed) return \"flat\";\n const body = trimmed.slice(1).trim();\n if (Number.parseFloat(body) === 0 && !/[1-9]/.test(body)) return \"flat\";\n return first === \"+\" ? \"up\" : \"down\";\n}\n\nfunction deltaColor(\n direction: StatDirection,\n good: NonNullable<StatProps[\"deltaGood\"]>,\n): BadgeColor {\n if (direction === \"flat\" || good === \"none\") return \"muted\";\n return direction === good ? \"success\" : \"error\";\n}\n\nexport function Stat({\n label,\n value,\n delta,\n deltaDirection,\n deltaGood = \"up\",\n note,\n className,\n ...props\n}: StatProps) {\n const direction =\n delta == null ? null : (deltaDirection ?? directionOf(delta));\n const text =\n typeof delta === \"number\"\n ? // The true minus, so the sign reads at badge size.\n `${percent.format(delta).replace(\"-\", \"−\")}%`\n : delta;\n const Arrow =\n direction === \"up\"\n ? IconTrendingUp\n : direction === \"down\"\n ? IconTrendingDown\n : null;\n return (\n <div\n data-stat=\"\"\n className={cn(\"flex min-w-0 flex-col gap-1 px-5 py-4\", className)}\n {...props}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <span className=\"text-pho-secondary min-w-0 truncate text-base\">\n {label}\n </span>\n {delta != null && direction != null && (\n <Badge\n size=\"sm\"\n contrast=\"low\"\n color={deltaColor(direction, deltaGood)}\n className=\"shrink-0 tabular-nums\"\n data-direction={direction}\n >\n {Arrow && <Arrow aria-hidden className=\"size-3\" />}\n {text}\n </Badge>\n )}\n </div>\n <span className=\"text-display-md text-pho-primary min-w-0 truncate font-medium\">\n {value}\n </span>\n {note != null && (\n <span className=\"text-pho-description truncate text-xs\">{note}</span>\n )}\n </div>\n );\n}\n\nStat.displayName = \"Stat\";\n\nexport interface StatGroupProps extends ComponentProps<\"div\"> {\n /**\n * `card` frames the row as a card of its own; `plain` keeps only the\n * hairlines between tiles, for a row inside a card or under a chart.\n * @default \"card\"\n */\n variant?: \"card\" | \"plain\";\n}\n\n/**\n * A row of tiles that reads as one card: hairlines between tiles, and\n * between rows once the tiles wrap on a narrow width. Each tile takes an\n * equal share of its row, never narrower than 12rem; a tile that wraps\n * alone stretches across its line, so the frame never shows a hole.\n */\nexport function StatGroup({\n variant = \"card\",\n className,\n ...props\n}: StatGroupProps) {\n return (\n <div\n // A row of figures is a group, not a form's fieldset: the role, and\n // the caller's `aria-label`, name it for assistive tech.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n data-stat-group=\"\"\n className={cn(\n // The hairlines are the gap: the frame's secondary shows through\n // 1px between tiles, so wrapping rows get a rule too. Flex, not\n // grid: a grid's empty cells on the last row would show through.\n \"bg-pho-secondary [&>*]:bg-pho-primary flex flex-wrap gap-px [&>*]:min-w-0 [&>*]:flex-[1_1_12rem]\",\n variant === \"card\" &&\n \"border-pho-secondary rounded-base overflow-hidden border\",\n className,\n )}\n {...props}\n />\n );\n}\n\nStatGroup.displayName = \"Stat.Group\";\nStat.Group = StatGroup;\n"],"ignoreList":[0,1],"mappings":";;;;;;AASA,IAAMA,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAqB,KAAO;AAAQ,CAAC,GAAG,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAmB,KAAO;AAAQ,CAAC,CAAC,GAC1HO,IAAmBL,EAAqB,WAAW,iBAAiB,gBAAgBF,CAAU,GCD9FQ,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAuB,KAAO;AAAQ,CAAC,GAAG,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAiB,KAAO;AAAQ,CAAC,CAAC,GAC1HC,IAAiBP,EAAqB,WAAW,eAAe,cAAcM,CAAU,GCmCxFE,IAAU,IAAI,KAAK,aAAa,SAAS;AAAA,EAC7C,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,aAAa;AACf,CAAC;AAOD,SAASC,EAAYC,GAAuC;AAC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;AAAA,UACV,kBAAgBN;AAAA,UALlB,UAAA,CAOGW,KAAS,gBAAAxB,EAACwB,GAAD;AAAA,YAAO,eAAA;AAAA,YAAY,WAAU;AAAA,UAAU,CAAA,GAChDD,CACI;AAAA,QAEN,CAAA,CAAA;AAAA,M;A,MACL,gBAAAvB,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QACb,UAAAiB;AAAA,MACG,CAAA;AAAA,MACLG,KAAQ,QACP,gBAAApB,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QAAyC,UAAAoB;AAAA,MAAW,CAAA;AAAA,IAEnE;AAAA,E;AAET;AAEAL,EAAK,cAAc;AAiBnB,SAAgBU,EAAU,EACxB,SAAAC,IAAU,QACV,WAAAL,GACA,GAAGC,EAAA,GACc;AACjB,SACE,gBAAAtB,EAAC,OAAD;AAAA,IAIE,MAAK;AAAA,IACL,mBAAgB;AAAA,IAChB,WAAWH,EAIT,oGACA6B,MAAY,UACV,4DACFL,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAEAG,EAAU,cAAc;AACxBV,EAAK,QAAQU"}
1
+ {"version":3,"file":"stat-VxA1SvS_.js","names":["__iconNode","cn","createReactComponent","Badge","jsx","jsxs","__iconNode$1","IconTrendingDown","__iconNode","IconTrendingUp","percent","directionOf","delta","trimmed","first","body","deltaColor","direction","good","Stat","label","value","deltaDirection","deltaGood","note","className","props","text","Arrow","StatGroup","variant"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingDown.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingUp.mjs","../../src/components/stat/stat.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 7l6 6l4 -4l8 8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 10l0 7l-7 0\", \"key\": \"svg-1\" }]];\nconst IconTrendingDown = createReactComponent(\"outline\", \"trending-down\", \"TrendingDown\", __iconNode);\n\nexport { __iconNode, IconTrendingDown as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 17l6 -6l4 4l8 -8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M14 7l7 0l0 7\", \"key\": \"svg-1\" }]];\nconst IconTrendingUp = createReactComponent(\"outline\", \"trending-up\", \"TrendingUp\", __iconNode);\n\nexport { __iconNode, IconTrendingUp as default };\n","import { type ComponentProps, type ReactNode } from \"react\";\nimport { IconTrendingDown, IconTrendingUp } from \"@tabler/icons-react\";\nimport { Badge, type BadgeColor } from \"../badge\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * Stat — a figure with its name: a label, a value, and, when it\n * matters, how the value moved and against what.\n *\n * Design notes:\n * - The value is the loud element: display size, medium weight, the\n * font's proportional figures (tabular digits make a big `121` look\n * loose). Label and note stay in the UI inks; nothing else competes.\n * - The delta is a low-contrast `Badge` beside the label, with an arrow so\n * the direction never rides on colour alone. Its ink says whether the\n * move is good news: `deltaGood` names the good direction, because a\n * drop in bounce rate is green and a drop in visitors is red.\n * - A tile has no chrome of its own. Alone, it sits in whatever card holds\n * it; in a `Stat.Group` the tiles share one frame and hairlines.\n */\n\nexport type StatDirection = \"up\" | \"down\" | \"flat\";\n\nexport interface StatProps extends Omit<ComponentProps<\"div\">, \"children\"> {\n /** What the figure counts — \"Visitors\", \"Active chats\". */\n label: ReactNode;\n /** The figure, already formatted — \"20.8K\", \"8m 32s\", \"1:1\". */\n value: ReactNode;\n /**\n * How the value moved: a number is a percentage change and renders\n * signed with one decimal (\"−42.0%\"); a string renders as written and\n * its sign sets the direction.\n */\n delta?: number | string;\n /** The delta's direction, when the string can't say. Derived otherwise. */\n deltaDirection?: StatDirection;\n /**\n * Which direction is good news: `up` (visitors, revenue), `down` (bounce\n * rate, latency), `none` when a move is just information. @default \"up\"\n */\n deltaGood?: \"up\" | \"down\" | \"none\";\n /** What the delta is against — \"vs. 36.2K prior\". */\n note?: ReactNode;\n}\n\nconst percent = new Intl.NumberFormat(\"en-US\", {\n minimumFractionDigits: 1,\n maximumFractionDigits: 1,\n signDisplay: \"exceptZero\",\n});\n\n/**\n * A leading sign — ASCII or the true minus — sets a string delta's direction.\n * A signed zero (\"+0%\", \"−0.0%\") is still flat: a caller's formatter may\n * sign every value, and zero has not moved.\n */\nfunction directionOf(delta: number | string): StatDirection {\n if (typeof delta === \"number\") {\n return delta > 0 ? \"up\" : delta < 0 ? \"down\" : \"flat\";\n }\n const trimmed = delta.trim();\n const first = trimmed.charAt(0);\n const signed = first === \"+\" || first === \"-\" || first === \"−\";\n if (!signed) return \"flat\";\n const body = trimmed.slice(1).trim();\n if (Number.parseFloat(body) === 0 && !/[1-9]/.test(body)) return \"flat\";\n return first === \"+\" ? \"up\" : \"down\";\n}\n\nfunction deltaColor(\n direction: StatDirection,\n good: NonNullable<StatProps[\"deltaGood\"]>,\n): BadgeColor {\n if (direction === \"flat\" || good === \"none\") return \"muted\";\n return direction === good ? \"success\" : \"error\";\n}\n\nexport function Stat({\n label,\n value,\n delta,\n deltaDirection,\n deltaGood = \"up\",\n note,\n className,\n ...props\n}: StatProps) {\n const direction =\n delta == null ? null : (deltaDirection ?? directionOf(delta));\n const text =\n typeof delta === \"number\"\n ? // The true minus, so the sign reads at badge size.\n `${percent.format(delta).replace(\"-\", \"−\")}%`\n : delta;\n const Arrow =\n direction === \"up\"\n ? IconTrendingUp\n : direction === \"down\"\n ? IconTrendingDown\n : null;\n return (\n <div\n data-stat=\"\"\n className={cn(\"flex min-w-0 flex-col gap-1 px-5 py-4\", className)}\n {...props}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <span className=\"text-pho-secondary min-w-0 truncate text-base\">\n {label}\n </span>\n {delta != null && direction != null && (\n <Badge\n size=\"sm\"\n contrast=\"low\"\n color={deltaColor(direction, deltaGood)}\n className=\"shrink-0 tabular-nums\"\n data-direction={direction}\n >\n {Arrow && <Arrow aria-hidden className=\"size-3\" />}\n {text}\n </Badge>\n )}\n </div>\n <span className=\"font-heading text-display-md text-pho-primary min-w-0 truncate font-medium\">\n {value}\n </span>\n {note != null && (\n <span className=\"text-pho-description truncate text-xs\">{note}</span>\n )}\n </div>\n );\n}\n\nStat.displayName = \"Stat\";\n\nexport interface StatGroupProps extends ComponentProps<\"div\"> {\n /**\n * `card` frames the row as a card of its own; `plain` keeps only the\n * hairlines between tiles, for a row inside a card or under a chart.\n * @default \"card\"\n */\n variant?: \"card\" | \"plain\";\n}\n\n/**\n * A row of tiles that reads as one card: hairlines between tiles, and\n * between rows once the tiles wrap on a narrow width. Each tile takes an\n * equal share of its row, never narrower than 12rem; a tile that wraps\n * alone stretches across its line, so the frame never shows a hole.\n */\nexport function StatGroup({\n variant = \"card\",\n className,\n ...props\n}: StatGroupProps) {\n return (\n <div\n // A row of figures is a group, not a form's fieldset: the role, and\n // the caller's `aria-label`, name it for assistive tech.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n data-stat-group=\"\"\n className={cn(\n // The hairlines are the gap: the frame's secondary shows through\n // 1px between tiles, so wrapping rows get a rule too. Flex, not\n // grid: a grid's empty cells on the last row would show through.\n \"bg-pho-secondary [&>*]:bg-pho-primary flex flex-wrap gap-px [&>*]:min-w-0 [&>*]:flex-[1_1_12rem]\",\n variant === \"card\" &&\n \"border-pho-secondary rounded-base overflow-hidden border\",\n className,\n )}\n {...props}\n />\n );\n}\n\nStatGroup.displayName = \"Stat.Group\";\nStat.Group = StatGroup;\n"],"ignoreList":[0,1],"mappings":";;;;;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,cAAc;AACxBV,EAAK,QAAQU"}
@@ -6,7 +6,7 @@ import { a as b } from "./button-CLfWdqm-.js";
6
6
  import { t as s } from "./createReactComponent-yKZn9MIX.js";
7
7
  import { t as w } from "./IconX-DnPlFC68.js";
8
8
  import { t as k } from "./IconAlertTriangleFilled-QV-gsVQW.js";
9
- import { n as T } from "./scroll-area-Dhl5hqay.js";
9
+ import { n as T } from "./scroll-area-DjdSnx2p.js";
10
10
  import "react";
11
11
  import { jsx as t, jsxs as i } from "react/jsx-runtime";
12
12
  import { AnimatePresence as z, motion as N, useReducedMotion as A } from "motion/react";
@@ -160,4 +160,4 @@ export {
160
160
  tt as t
161
161
  };
162
162
 
163
- //# sourceMappingURL=toast-B3oURNJC.js.map
163
+ //# sourceMappingURL=toast-B1GAdxXP.js.map