@photon-ai/pho-ui 4.22.0 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{basic-page-BYA1lkzf.js → basic-page-DnB4YSRj.js} +4 -4
- package/dist/chunks/basic-page-DnB4YSRj.js.map +1 -0
- package/dist/chunks/{chat-j7XEdKEo.js → chat-C5W6L_Jg.js} +4 -4
- package/dist/chunks/chat-C5W6L_Jg.js.map +1 -0
- package/dist/chunks/{dialog-CDL6qY2a.js → dialog-e4_mOYGp.js} +5 -5
- package/dist/chunks/dialog-e4_mOYGp.js.map +1 -0
- package/dist/chunks/{error-BZU9vgnj.js → error-BjSn7wLu.js} +2 -2
- package/dist/chunks/{error-BZU9vgnj.js.map → error-BjSn7wLu.js.map} +1 -1
- package/dist/chunks/{log-list-QbSYHZu3.js → log-list-BqaJv2oA.js} +2 -2
- package/dist/chunks/{log-list-QbSYHZu3.js.map → log-list-BqaJv2oA.js.map} +1 -1
- package/dist/chunks/{status-view-I_Y6eEyX.js → status-view-Buhh1UBJ.js} +2 -2
- package/dist/chunks/status-view-Buhh1UBJ.js.map +1 -0
- package/dist/components/chat.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +5 -5
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/error.js +1 -1
- package/dist/components/field.js +26 -24
- package/dist/components/field.js.map +1 -1
- package/dist/components/log-list.js +1 -1
- package/dist/components/notification.js +1 -1
- package/dist/components/notification.js.map +1 -1
- package/dist/components/scope.js +1 -1
- package/dist/components/scope.js.map +1 -1
- package/dist/components/status-view.js +1 -1
- package/dist/index.js +6 -6
- package/dist/sections/basic-page.js +1 -1
- package/dist/src/components/drawer/drawer.d.ts +1 -0
- package/dist/src/components/field/field.d.ts +10 -2
- package/dist/src/components/status-view/status-view.d.ts +4 -3
- package/package.json +1 -1
- package/dist/chunks/basic-page-BYA1lkzf.js.map +0 -1
- package/dist/chunks/chat-j7XEdKEo.js.map +0 -1
- package/dist/chunks/dialog-CDL6qY2a.js.map +0 -1
- package/dist/chunks/status-view-I_Y6eEyX.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-j7XEdKEo.js","names":["__iconNode","__iconNode","__iconNode","_Fragment","cn","useLinkComponent","FADE_SWAP","PRESS_SCALE_ROW","SPRING_PRESS","TRAVEL_LINEAR","Spinner","Button","createReactComponent","Input","Avatar","IconSearch","ScrollArea","StatusView","Skeleton","QUIET_SEARCH_FOCUS","createContext","useCallback","useContext","useEffect","useId","useLayoutEffect","useMemo","useRef","useState","Fragment$1","jsx","jsxs","AnimatePresence","motion","useReducedMotion","__iconNode$3","IconArrowLeft","__iconNode$2","IconArrowUp","__iconNode$1","IconUser","__iconNode","IconUsers","CHAT_SURFACE","AUTO_WIDE_PX","PANE_TRAVEL_PX","PANE_LEAVE_PX","TOP_BAR","LIST_WIDTH_PX","LIST_MIN_PX","THREAD_MIN_PX","SPLIT_STEP_PX","clampListWidth","width","rootWidth","next","ChatContext","useChat","part","ctx","useIsoLayoutEffect","paneDirectionFor","pane","isPaneSwap","layout","frameWidth","paneSwapMotion","direction","reduceMotion","paneSwapVariants","SwapPane","as","show","swapped","children","props","swap","motionProps","Root","paneProp","defaultPane","onPaneChange","className","style","ref","uncontrolledPane","setUncontrolledPane","listWidth","setListWidth","setFrameWidth","rootRef","controlled","setDirection","setSwapped","prevPaneRef","renderedDirection","renderedSwapped","setPane","resizeList","root","tighten","frame","current","observer","value","node","List","idProp","uid","listId","listClass","body","Splitter","rest","controlsId","drag","onPointerDown","event","onPointerMove","start","rtl","delta","onPointerUp","onKeyDown","shrink","grow","step","valueMax","Search","wrapperClassName","placeholder","Conversations","ConversationList","CONVERSATION_ROW","CONVERSATION_ROW_ACTIVE","CONVERSATION_ROW_INACTIVE","CONVERSATION_PRESS","Conversation","title","time","preview","avatar","group","active","href","onClick","Link","MotionLink","rowClass","open","Thread","threadClass","Header","actions","backLabel","Title","Description","PIN_SLACK_PX","EARLIER_AHEAD","offsetIn","viewport","row","placed","oldestMessage","content","Messages","hasEarlier","loadingEarlier","onLoadEarlier","earlierLabel","viewportRef","contentRef","sentinelRef","pinned","anchor","loading","stalled","askEarlier","settle","kept","onScroll","loadEarlier","sentinel","entries","entry","Divider","Footer","COMPOSER_MAX_HEIGHT_PX","Composer","onValueChange","onSend","sending","disabled","canSend","prefix","meta","sendLabel","textareaRef","innerRef","ready","element","submit","Empty","size","ConversationsLoading","rows","_","MessagesLoading","Chat"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowUp.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconUsers.mjs","../../src/components/chat/chat.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\": \"M5 12l14 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M5 12l6 6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M5 12l6 -6\", \"key\": \"svg-2\" }]];\nconst IconArrowLeft = createReactComponent(\"outline\", \"arrow-left\", \"ArrowLeft\", __iconNode);\n\nexport { __iconNode, IconArrowLeft 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\": \"M12 5l0 14\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M18 11l-6 -6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M6 11l6 -6\", \"key\": \"svg-2\" }]];\nconst IconArrowUp = createReactComponent(\"outline\", \"arrow-up\", \"ArrowUp\", __iconNode);\n\nexport { __iconNode, IconArrowUp 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\": \"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\", \"key\": \"svg-1\" }]];\nconst IconUser = createReactComponent(\"outline\", \"user\", \"User\", __iconNode);\n\nexport { __iconNode, IconUser 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\": \"M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M16 3.13a4 4 0 0 1 0 7.75\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M21 21v-2a4 4 0 0 0 -3 -3.85\", \"key\": \"svg-3\" }]];\nconst IconUsers = createReactComponent(\"outline\", \"users\", \"Users\", __iconNode);\n\nexport { __iconNode, IconUsers as default };\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ComponentProps,\n type ComponentType,\n type FormEvent,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n type Ref,\n type RefObject,\n} from \"react\";\nimport {\n IconArrowLeft,\n IconArrowUp,\n IconSearch,\n IconUser,\n IconUsers,\n} from \"@tabler/icons-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport {\n BLUR_PX,\n FADE_SWAP,\n PRESS_SCALE_ROW,\n SPRING_PRESS,\n TRAVEL_LINEAR,\n} from \"../../motion\";\nimport { Avatar } from \"../avatar\";\nimport { Button } from \"../button\";\nimport { Input, type InputProps } from \"../input\";\nimport { QUIET_SEARCH_FOCUS } from \"../input-group/box-search\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Skeleton } from \"../skeleton\";\nimport { Spinner } from \"../spinner\";\nimport { StatusView, type StatusViewProps } from \"../status-view\";\nimport { cn } from \"../../utils/cn\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\n\n/**\n * Chat — an inbox in one card: the conversations down the left, the open\n * thread on the right with its messages scrolling up from the composer.\n * It composes the smaller parts (`Message` rows of `Bubble`s in a\n * `ScrollArea`, an `Input` for search, `Button`s to send and go back) the\n * way `Sidebar` composes a rail: rows that press, one active, links\n * through the host's `LinkProvider`.\n *\n * Two layouts. `default` seats both panes side by side — the divider\n * between them drags so either pane can grow, each down to a min width.\n * `compact` shows one at a time — the list, then the thread with a way\n * back — for a narrow column or a phone. Opening a conversation pushes\n * the thread in from the right; back pops the list in from the left, a\n * short drift on `TRAVEL_LINEAR` with a `FADE_SWAP` fade. `auto` is\n * compact only while the frame is narrower than 42rem (a container\n * query, so it follows the card, not the viewport). Which pane is up is\n * `pane`, controlled or not; opening a conversation moves to the thread,\n * the header's back button returns.\n *\n * Presentational, like every Pho part: the page fetches, formats times,\n * and decides who is who. The thread stays pinned to its newest message\n * while the reader is at the bottom, and keeps its place when earlier\n * pages arrive above.\n */\n\nexport type ChatLayout = \"default\" | \"compact\" | \"auto\";\nexport type ChatPane = \"list\" | \"thread\";\n/** Push is 1 (thread from the right); pop is −1 (list from the left). */\nexport type ChatPaneDirection = 1 | -1;\n\n/** Same chrome as `BasicPage.Card` and `LogList` — one card surface. */\nconst CHAT_SURFACE = \"rounded-base border border-pho-secondary bg-pho-primary\";\n\n// Below this frame width `auto` is compact: the `@2xl` container variant\n// (42rem) in the class strings below. Those variants are spelled out in\n// full on purpose — Tailwind finds utilities by scanning source text, so\n// a variant built from a variable (`${AUTO_WIDE}` before the colon) never\n// reached a consumer's CSS and `auto` stayed single-pane at every width.\n// chat.test.tsx keeps it that way.\n/** `42rem` in px at the 16px root — `frameWidth` is measured in px. */\nconst AUTO_WIDE_PX = 672;\n/**\n * Compact pane travel — a short drift, the same scale as `BAR_RISE_PX`,\n * not a full-width slide.\n */\nconst PANE_TRAVEL_PX = 24;\n/** Outgoing pane drift — same distance as BasicPage `BACK_LABEL_LEAVE_X`. */\nconst PANE_LEAVE_PX = 8;\n\n/** Search (`p-3` + sm Input) is the pane top-bar height; Header matches it. */\nconst TOP_BAR = \"min-h-[61px]\";\n\n/**\n * Wide layouts start the list at 273 — the measured inbox column, not\n * `w-80`. It will not go below `min-w-64` (256); the thread will not go\n * below `min-w-80` (320).\n */\nconst LIST_WIDTH_PX = 273;\nconst LIST_MIN_PX = 256;\nconst THREAD_MIN_PX = 320;\nconst SPLIT_STEP_PX = 16;\n\nfunction clampListWidth(width: number, rootWidth: number) {\n const next = Math.max(LIST_MIN_PX, width);\n if (rootWidth <= 0) return Number.isFinite(next) ? next : LIST_MIN_PX;\n return Math.min(next, Math.max(LIST_MIN_PX, rootWidth - THREAD_MIN_PX));\n}\n\ninterface ChatContextValue {\n layout: ChatLayout;\n pane: ChatPane;\n setPane: (pane: ChatPane) => void;\n /** Latest list ↔ thread step: 1 push, −1 pop. */\n direction: ChatPaneDirection;\n /** One pane at a time — compact, or `auto` once the frame measures narrow. */\n swap: boolean;\n /** True after the first list ↔ thread step — later remounts still push. */\n swapped: boolean;\n listWidth: number;\n frameWidth: number;\n resizeList: (width: number) => void;\n rootRef: RefObject<HTMLDivElement | null>;\n}\n\nconst ChatContext = createContext<ChatContextValue | null>(null);\n\nfunction useChat(part: string): ChatContextValue {\n const ctx = useContext(ChatContext);\n if (ctx == null) {\n throw new Error(`Chat.${part} must be used inside Chat.Root`);\n }\n return ctx;\n}\n\n// React 18 warns that useLayoutEffect does nothing on the server; fall\n// back to useEffect there so SSR'd docs stay quiet.\nconst useIsoLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\nfunction paneDirectionFor(pane: ChatPane): ChatPaneDirection {\n return pane === \"thread\" ? 1 : -1;\n}\n\n/**\n * Compact (and `auto` once the frame measures narrower than 42rem) mounts\n * one pane at a time so `AnimatePresence` can push/pop. `frameWidth` 0 is\n * the unmeasured / SSR frame — treat it as wide so both panes render and\n * nothing flashes.\n */\nfunction isPaneSwap(layout: ChatLayout, frameWidth: number) {\n return (\n layout === \"compact\" ||\n (layout === \"auto\" && frameWidth > 0 && frameWidth < AUTO_WIDE_PX)\n );\n}\n\n/**\n * The compact pane swap — incoming travels `PANE_TRAVEL_PX` on\n * `TRAVEL_LINEAR`, fades and breathes `BLUR_PX` on `FADE_SWAP`; outgoing\n * drifts `PANE_LEAVE_PX` the other way. Under reduced motion: opacity\n * only, and instant.\n */\nexport function paneSwapMotion(\n direction: ChatPaneDirection,\n reduceMotion?: boolean | null,\n) {\n if (reduceMotion) {\n return {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0 },\n };\n }\n return {\n initial: {\n x: direction * PANE_TRAVEL_PX,\n opacity: 0,\n filter: `blur(${BLUR_PX}px)`,\n },\n animate: { x: 0, opacity: 1, filter: \"blur(0px)\" },\n exit: {\n x: -direction * PANE_LEAVE_PX,\n opacity: 0,\n filter: `blur(${BLUR_PX}px)`,\n },\n transition: { x: TRAVEL_LINEAR, opacity: FADE_SWAP, filter: FADE_SWAP },\n };\n}\n\nfunction paneSwapVariants(reduceMotion: boolean | null) {\n return {\n enter: (direction: ChatPaneDirection) =>\n paneSwapMotion(direction, reduceMotion).initial,\n rest: (direction: ChatPaneDirection) =>\n paneSwapMotion(direction, reduceMotion).animate,\n leave: (direction: ChatPaneDirection) =>\n paneSwapMotion(direction, reduceMotion).exit,\n };\n}\n\n/**\n * DOM handlers whose React signatures clash with Motion's gesture props.\n * Same omit list as `Button` — swap panes and conversation rows render\n * 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\ntype SwapPaneProps = {\n show: boolean;\n swapped: boolean;\n direction: ChatPaneDirection;\n reduceMotion: boolean | null;\n children?: ReactNode;\n} & (\n | ({ as: \"aside\" } & Omit<\n ComponentProps<\"aside\">,\n \"children\" | MotionHandlerConflicts\n >)\n | ({ as: \"section\" } & Omit<\n ComponentProps<\"section\">,\n \"children\" | MotionHandlerConflicts\n >)\n);\n\ntype SwapMotionProps = {\n custom: ChatPaneDirection;\n variants: ReturnType<typeof paneSwapVariants>;\n initial: \"enter\";\n animate: \"rest\";\n exit: \"leave\";\n transition: ReturnType<typeof paneSwapMotion>[\"transition\"];\n};\n\n/**\n * The compact face — Root's `AnimatePresence` keys list vs thread. `custom`\n * on that presence feeds this step's push/pop into the exiting face.\n */\nfunction SwapPane({\n as,\n show,\n swapped,\n direction,\n reduceMotion,\n children,\n ...props\n}: SwapPaneProps) {\n const swap = paneSwapMotion(direction, reduceMotion);\n const motionProps: SwapMotionProps = {\n custom: direction,\n variants: paneSwapVariants(reduceMotion),\n initial: \"enter\",\n animate: \"rest\",\n exit: \"leave\",\n transition: swap.transition,\n };\n // Skip the first paint only before any pane change — a Thread that\n // remounts (host `key`) on the way in still pushes.\n return (\n <AnimatePresence\n initial={!swapped && show ? false : undefined}\n mode=\"popLayout\"\n custom={direction}\n >\n {show ? (\n as === \"aside\" ? (\n <motion.aside key=\"list\" {...props} {...motionProps}>\n {children}\n </motion.aside>\n ) : (\n <motion.section key=\"thread\" {...props} {...motionProps}>\n {children}\n </motion.section>\n )\n ) : null}\n </AnimatePresence>\n );\n}\n\n/* --------------------------------- root --------------------------------- */\n\nexport interface ChatRootProps extends ComponentProps<\"div\"> {\n /**\n * `default` shows both panes; `compact` one at a time; `auto` is\n * compact while the frame is narrower than 42rem.\n * @default \"default\"\n */\n layout?: ChatLayout;\n /** The pane that is up in a compact layout. Pair with `onPaneChange`. */\n pane?: ChatPane;\n /** Initial pane when uncontrolled. @default \"list\" */\n defaultPane?: ChatPane;\n /** Called with the next pane — a row opened a thread, back was pressed. */\n onPaneChange?: (pane: ChatPane) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The card. Give it a height (`h-[32rem]`, or `min-h-0 flex-1` in a\n * column that fills the page); the panes scroll inside it.\n */\nfunction Root({\n layout = \"default\",\n pane: paneProp,\n defaultPane = \"list\",\n onPaneChange,\n className,\n style,\n ref,\n ...props\n}: ChatRootProps) {\n const [uncontrolledPane, setUncontrolledPane] = useState(defaultPane);\n const [listWidth, setListWidth] = useState(LIST_WIDTH_PX);\n const [frameWidth, setFrameWidth] = useState(0);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const controlled = paneProp !== undefined;\n const pane = controlled ? paneProp : uncontrolledPane;\n const [direction, setDirection] = useState<ChatPaneDirection>(() =>\n paneDirectionFor(pane),\n );\n const [swapped, setSwapped] = useState(false);\n const prevPaneRef = useRef(pane);\n // Keep this render's direction aligned with `pane` so a controlled\n // update and a `setPane` call both push/pop on the same frame.\n let renderedDirection = direction;\n let renderedSwapped = swapped;\n if (prevPaneRef.current !== pane) {\n renderedDirection = paneDirectionFor(pane);\n renderedSwapped = true;\n prevPaneRef.current = pane;\n if (renderedDirection !== direction) setDirection(renderedDirection);\n if (!swapped) setSwapped(true);\n }\n const setPane = useCallback(\n (next: ChatPane) => {\n setDirection(paneDirectionFor(next));\n if (!controlled) setUncontrolledPane(next);\n onPaneChange?.(next);\n },\n [controlled, onPaneChange],\n );\n const resizeList = useCallback((width: number) => {\n setListWidth(clampListWidth(width, rootRef.current?.clientWidth ?? 0));\n }, []);\n const swap = isPaneSwap(layout, frameWidth);\n useIsoLayoutEffect(() => {\n const root = rootRef.current;\n if (!root || typeof ResizeObserver === \"undefined\") return;\n const tighten = () => {\n const frame = root.clientWidth;\n setFrameWidth(frame);\n setListWidth((current) => clampListWidth(current, frame));\n };\n tighten();\n const observer = new ResizeObserver(tighten);\n observer.observe(root);\n return () => observer.disconnect();\n }, []);\n const value = useMemo(\n () => ({\n layout,\n pane,\n setPane,\n direction: renderedDirection,\n swap,\n swapped: renderedSwapped,\n listWidth,\n frameWidth,\n resizeList,\n rootRef,\n }),\n [\n layout,\n pane,\n setPane,\n renderedDirection,\n swap,\n renderedSwapped,\n listWidth,\n frameWidth,\n resizeList,\n ],\n );\n return (\n <ChatContext.Provider value={value}>\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) {\n (ref as { current: HTMLDivElement | null }).current = node;\n }\n }}\n data-chat=\"\"\n data-basic-page-card=\"\"\n data-layout={layout}\n data-pane={pane}\n style={\n {\n ...style,\n \"--chat-list-width\": `${listWidth}px`,\n } as CSSProperties\n }\n className={cn(\n CHAT_SURFACE,\n \"@container relative flex min-h-0 min-w-0 overflow-hidden\",\n className,\n )}\n {...props}\n />\n </ChatContext.Provider>\n );\n}\n\n/* --------------------------------- list --------------------------------- */\n\n/** The left pane — search above, conversations below, on the page wash. */\nfunction List({\n className,\n children,\n id: idProp,\n ...props\n}: ComponentProps<\"aside\">) {\n const { layout, pane, direction, swap, swapped } = useChat(\"List\");\n const reduceMotion = useReducedMotion();\n const uid = useId();\n const listId = idProp ?? uid;\n const listClass = cn(\n \"border-pho-secondary bg-pho-page relative z-10 flex min-h-0 shrink-0 flex-col\",\n layout === \"default\" && \"min-w-64 w-[var(--chat-list-width)] border-r\",\n layout === \"compact\" && \"w-full\",\n layout === \"auto\" &&\n cn(\n \"w-full @2xl:min-w-64 @2xl:w-[var(--chat-list-width)] @2xl:border-r\",\n !swap && pane === \"thread\" && \"@max-2xl:hidden\",\n ),\n className,\n );\n const body = (\n <>\n {children}\n {layout !== \"compact\" && <Splitter controlsId={listId} />}\n </>\n );\n const rest = {\n id: listId,\n \"aria-label\": \"Conversations\",\n \"data-chat-list\": \"\",\n className: listClass,\n ...props,\n };\n if (!swap) {\n return <aside {...rest}>{body}</aside>;\n }\n return (\n <SwapPane\n as=\"aside\"\n show={pane === \"list\"}\n swapped={swapped}\n direction={direction}\n reduceMotion={reduceMotion}\n {...rest}\n >\n {body}\n </SwapPane>\n );\n}\n\n/**\n * The drag between the panes — a focusable separator. Hidden in\n * `compact`, and in `auto` while the frame is narrow.\n */\nfunction Splitter({ controlsId }: { controlsId: string }) {\n const { layout, listWidth, frameWidth, resizeList, rootRef } =\n useChat(\"Splitter\");\n const drag = useRef<{ x: number; width: number } | null>(null);\n\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return;\n event.currentTarget.setPointerCapture?.(event.pointerId);\n drag.current = { x: event.clientX, width: listWidth };\n };\n\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const start = drag.current;\n if (start == null) return;\n const root = rootRef.current;\n const rtl = root != null && getComputedStyle(root).direction === \"rtl\";\n const delta = (event.clientX - start.x) * (rtl ? -1 : 1);\n resizeList(start.width + delta);\n };\n\n const onPointerUp = () => {\n drag.current = null;\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const root = rootRef.current;\n const rtl = root != null && getComputedStyle(root).direction === \"rtl\";\n const shrink = rtl ? \"ArrowRight\" : \"ArrowLeft\";\n const grow = rtl ? \"ArrowLeft\" : \"ArrowRight\";\n const step = event.shiftKey ? SPLIT_STEP_PX * 2 : SPLIT_STEP_PX;\n if (event.key === shrink) {\n event.preventDefault();\n resizeList(listWidth - step);\n } else if (event.key === grow) {\n event.preventDefault();\n resizeList(listWidth + step);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n resizeList(LIST_MIN_PX);\n } else if (event.key === \"End\") {\n event.preventDefault();\n const frame = root?.clientWidth ?? 0;\n if (frame > 0) resizeList(frame - THREAD_MIN_PX);\n }\n };\n\n const valueMax =\n frameWidth > 0\n ? Math.max(LIST_MIN_PX, frameWidth - THREAD_MIN_PX)\n : listWidth;\n\n return (\n <div\n // WAI-ARIA window splitter: a focusable separator with a value. An\n // `hr` can neither take focus nor carry the value attributes.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize conversation list\"\n aria-controls={controlsId}\n aria-valuenow={listWidth}\n aria-valuemin={LIST_MIN_PX}\n aria-valuemax={valueMax}\n aria-valuetext={`${listWidth} pixels`}\n tabIndex={0}\n data-chat-splitter=\"\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n onKeyDown={onKeyDown}\n className={cn(\n \"absolute inset-y-0 -right-3 z-10 w-6 cursor-col-resize touch-none select-none\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-2\",\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-transparent\",\n \"[@media(hover:hover)]:hover:after:bg-pho-brand focus-visible:after:bg-pho-brand\",\n layout === \"auto\" && \"@max-2xl:hidden\",\n )}\n />\n );\n}\n\nexport interface ChatSearchProps extends Omit<\n InputProps,\n \"size\" | \"icon\" | \"label\" | \"hint\" | \"labelTrailing\"\n> {}\n\n/**\n * The search row pinned over the conversations — an `sm` `Input` with a\n * search's quiet focus: no ring, the magnifier takes the ink.\n */\nfunction Search({\n className,\n wrapperClassName,\n placeholder = \"Search\",\n ...props\n}: ChatSearchProps) {\n return (\n <div data-chat-search=\"\" className={cn(\"p-3\", TOP_BAR, className)}>\n <Input\n size=\"sm\"\n icon={IconSearch}\n placeholder={placeholder}\n aria-label=\"Search conversations\"\n autoComplete=\"off\"\n spellCheck={false}\n wrapperClassName={cn(\n QUIET_SEARCH_FOCUS,\n \"[&:focus-within>svg]:text-pho-primary [&>svg]:transition-colors [&>svg]:duration-100\",\n wrapperClassName,\n )}\n {...props}\n />\n </div>\n );\n}\n\n/**\n * The scrolling part of the list. Put a `ConversationList` in it — or a\n * `ConversationsLoading`, an `Empty` — and anything that belongs after\n * the rows (a load-older button).\n */\nfunction Conversations({\n className,\n children,\n ...props\n}: ComponentProps<\"div\">) {\n return (\n <div\n data-chat-conversations=\"\"\n className={cn(\"flex min-h-0 flex-1 flex-col\", className)}\n {...props}\n >\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content\n // Base UI sets `minWidth: fit-content` on Content; a long\n // title must truncate, not widen the pane.\n style={{ minWidth: 0 }}\n // Same horizontal rail as Sidebar sm (`px-3`): the selected\n // chip sits in the page wash instead of kissing the aside.\n className=\"flex min-h-full flex-col px-3 py-1\"\n >\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </div>\n );\n}\n\n/** The rows. */\nfunction ConversationList({ className, ...props }: ComponentProps<\"ul\">) {\n return (\n <ul\n data-chat-conversation-list=\"\"\n // list-none/m-0/p-0 shield the rows from host prose styles.\n className={cn(\"m-0 flex list-none flex-col gap-0.5 *:m-0\", className)}\n {...props}\n />\n );\n}\n\n/* ------------------------------ conversation ---------------------------- */\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 */\ninterface ConversationBaseProps {\n /** Who — a number, a name, the members of a group. */\n title: ReactNode;\n /** When — the page's relative time (`2d ago`), trailing. */\n time?: ReactNode;\n /** The latest message, one truncated line. */\n preview?: ReactNode;\n /** Replace the default avatar (a person, or people for a `group`). */\n avatar?: ReactNode;\n /** A group conversation — the default avatar shows people. */\n group?: boolean;\n /** The open conversation. */\n active?: boolean;\n className?: string;\n}\n\nexport interface ChatConversationLinkProps\n extends\n ConversationBaseProps,\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof ConversationBaseProps | MotionHandlerConflicts\n > {\n /** Destination — rendered through the host's `LinkProvider`. */\n href: string;\n}\n\nexport interface ChatConversationButtonProps\n extends\n ConversationBaseProps,\n Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof ConversationBaseProps | MotionHandlerConflicts\n > {\n href?: undefined;\n}\n\nexport type ChatConversationProps =\n ChatConversationLinkProps | ChatConversationButtonProps;\n\n/** The row at rest, on hover, and while open — one pointer target. */\nconst CONVERSATION_ROW =\n \"outline-pho-brand rounded-base flex w-full cursor-pointer items-center gap-3 px-2 py-2.5 text-left transition-colors focus-visible:outline-2 focus-visible:-outline-offset-1\";\n/**\n * Open row — same chip as `Sidebar.Item` current (`aria-current=page`).\n * Weight lives on the title span, not here: time and preview stay Regular.\n */\nconst CONVERSATION_ROW_ACTIVE =\n \"bg-pho-primary text-pho-primary ring-pho-secondary ring-1 ring-inset *:data-icon:text-pho-primary\";\nconst CONVERSATION_ROW_INACTIVE = \"hover:bg-pho-ghost-hover\";\n\nconst CONVERSATION_PRESS = {\n initial: false as const,\n whileTap: { scale: PRESS_SCALE_ROW },\n transition: SPRING_PRESS,\n};\n\n/**\n * One conversation — a link when `href` is given (through the host's\n * `LinkProvider`), otherwise a button. Opening it in a compact layout\n * brings the thread up.\n */\nfunction Conversation({\n title,\n time,\n preview,\n avatar,\n group,\n active,\n className,\n href,\n onClick,\n ...rest\n}: ChatConversationProps) {\n const { layout, setPane } = useChat(\"Conversation\");\n const Link = useLinkComponent();\n // Same bridge as `Sidebar.Item` — host `LinkProvider` + Motion press.\n const MotionLink = useMemo(\n () =>\n motion.create(Link as unknown as ComponentType<Record<string, unknown>>),\n [Link],\n );\n const rowClass = cn(\n CONVERSATION_ROW,\n active ? CONVERSATION_ROW_ACTIVE : CONVERSATION_ROW_INACTIVE,\n className,\n );\n const open = () => {\n if (layout !== \"default\") setPane(\"thread\");\n };\n const body = (\n <>\n {avatar ?? (\n <Avatar.Root size=\"sm\">\n <Avatar.Fallback>\n {group ? (\n <IconUsers className=\"size-4\" aria-hidden />\n ) : (\n <IconUser className=\"size-4\" aria-hidden />\n )}\n </Avatar.Fallback>\n </Avatar.Root>\n )}\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex items-baseline justify-between gap-2\">\n <span className=\"text-pho-primary font-heading min-w-0 truncate text-base font-medium\">\n {title}\n </span>\n {time != null && (\n <span className=\"text-pho-description shrink-0 text-xs font-normal whitespace-nowrap tabular-nums\">\n {time}\n </span>\n )}\n </span>\n {preview != null && (\n <span className=\"text-pho-description mt-0.5 block min-w-0 truncate text-xs font-normal\">\n {preview}\n </span>\n )}\n </span>\n </>\n );\n\n if (href !== undefined) {\n return (\n <li>\n <MotionLink\n href={href}\n aria-current={active ? \"page\" : undefined}\n {...(rest as AnchorHTMLAttributes<HTMLAnchorElement>)}\n onClick={(event: React.MouseEvent<HTMLAnchorElement>) => {\n (onClick as AnchorHTMLAttributes<HTMLAnchorElement>[\"onClick\"])?.(\n event,\n );\n if (!event.defaultPrevented) open();\n }}\n className={rowClass}\n {...CONVERSATION_PRESS}\n >\n {body}\n </MotionLink>\n </li>\n );\n }\n\n return (\n <li>\n <motion.button\n type=\"button\"\n aria-current={active ? \"true\" : undefined}\n {...(rest as Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n MotionHandlerConflicts\n >)}\n onClick={(event) => {\n (onClick as ButtonHTMLAttributes<HTMLButtonElement>[\"onClick\"])?.(\n event,\n );\n if (!event.defaultPrevented) open();\n }}\n className={rowClass}\n {...CONVERSATION_PRESS}\n >\n {body}\n </motion.button>\n </li>\n );\n}\n\n/* -------------------------------- thread -------------------------------- */\n\n/** The right pane — header, messages, and the docked footer, on the card. */\nfunction Thread({ className, children, ...props }: ComponentProps<\"section\">) {\n const { layout, pane, direction, swap, swapped } = useChat(\"Thread\");\n const reduceMotion = useReducedMotion();\n const threadClass = cn(\n \"bg-pho-primary flex min-h-0 flex-1 flex-col\",\n layout === \"default\" && \"min-w-80\",\n layout === \"compact\" && \"min-w-0\",\n layout === \"auto\" && \"min-w-0 @2xl:min-w-80\",\n !swap && layout === \"auto\" && pane === \"list\" && \"@max-2xl:hidden\",\n className,\n );\n if (!swap) {\n return (\n <section\n aria-label=\"Conversation\"\n data-chat-thread=\"\"\n className={threadClass}\n {...props}\n >\n {children}\n </section>\n );\n }\n return (\n <SwapPane\n as=\"section\"\n show={pane === \"thread\"}\n swapped={swapped}\n direction={direction}\n reduceMotion={reduceMotion}\n aria-label=\"Conversation\"\n data-chat-thread=\"\"\n className={threadClass}\n {...props}\n >\n {children}\n </SwapPane>\n );\n}\n\nexport interface ChatHeaderProps extends ComponentProps<\"header\"> {\n /** The other side's avatar — an `Avatar.Root`. */\n avatar?: ReactNode;\n /** Controls at the trailing edge — a details button, a menu. */\n actions?: ReactNode;\n /** The back button's accessible name. @default \"Back to conversations\" */\n backLabel?: string;\n}\n\n/**\n * Who the thread is with. Children are a `Title` and a `Description`.\n * In a compact layout a back button leads the row; `auto` shows it only\n * while the frame is narrow.\n */\nfunction Header({\n avatar,\n actions,\n backLabel = \"Back to conversations\",\n className,\n children,\n ...props\n}: ChatHeaderProps) {\n const { layout, setPane } = useChat(\"Header\");\n return (\n <header\n data-chat-header=\"\"\n className={cn(\n \"flex shrink-0 items-center gap-3 px-4 py-1.5\",\n TOP_BAR,\n className,\n )}\n {...props}\n >\n {layout !== \"default\" && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n shape=\"circle\"\n svgOnly\n aria-label={backLabel}\n data-chat-back=\"\"\n className={cn(\"-ml-1 shrink-0\", layout === \"auto\" && \"@2xl:hidden\")}\n onClick={() => setPane(\"list\")}\n >\n <IconArrowLeft />\n </Button>\n )}\n {avatar}\n <div className=\"flex min-w-0 flex-1 flex-col\">{children}</div>\n {actions != null && (\n <div className=\"flex shrink-0 items-center gap-1\">{actions}</div>\n )}\n </header>\n );\n}\n\n/** The other side's name. Inline extras (a copy button, a badge) sit after it. */\nfunction Title({ className, children, ...props }: ComponentProps<\"h2\">) {\n return (\n <h2\n data-chat-title=\"\"\n className={cn(\n \"text-pho-primary font-heading m-0 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 overflow-visible text-base font-medium\",\n className,\n )}\n {...props}\n >\n {children}\n </h2>\n );\n}\n\n/** One line under the title — from whom, a status. */\nfunction Description({ className, ...props }: ComponentProps<\"p\">) {\n return (\n <p\n data-chat-description=\"\"\n className={cn(\n \"text-pho-description m-0 min-w-0 truncate text-xs\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ------------------------------- messages ------------------------------- */\n\n/** Within this many px of the bottom the pane counts as pinned. */\nconst PIN_SLACK_PX = 40;\n\n/** How far above the top the earlier page is asked for, ahead of the reader. */\nconst EARLIER_AHEAD = \"200px 0px 0px 0px\";\n\nexport interface ChatMessagesProps extends ComponentProps<\"div\"> {\n /** Earlier pages exist — the top of the pane asks for them. */\n hasEarlier?: boolean;\n /** The earlier page is on its way — a spinner shows and nothing is asked. */\n loadingEarlier?: boolean;\n /** Ask for the page before the first message shown. */\n onLoadEarlier?: () => void;\n /** The button's label. @default \"Load earlier messages\" */\n earlierLabel?: ReactNode;\n}\n\n/** A row's distance from the top of the pane, in px. */\nfunction offsetIn(viewport: HTMLElement, row: Element) {\n return row.getBoundingClientRect().top - viewport.getBoundingClientRect().top;\n}\n\n/** Still in the thread and laid out (a `display: contents` wrapper isn't). */\nfunction placed(row: Element | null): row is Element {\n return row != null && row.isConnected && row.getClientRects().length > 0;\n}\n\n/** The oldest message shown: an earlier page goes in above it. */\nfunction oldestMessage(content: Element | null) {\n const row = content?.querySelector(\"[data-message]\") ?? null;\n return placed(row) ? row : null;\n}\n\n/**\n * The messages, oldest to newest, on the thread surface. The pane starts at\n * the bottom and stays there as messages arrive unless the reader has\n * scrolled up. With `hasEarlier`, the earlier page is asked for as the top\n * comes into view (an `IntersectionObserver`, 200px ahead) — the same\n * request as the button there, which stays for keyboards and for a browser\n * without the observer. While `loadingEarlier` a spinner takes its place,\n * and when the page arrives above, what they were reading stays put.\n * Children are `Message` rows and `Divider`s. Its state belongs to one\n * conversation: key the `Thread` by it.\n */\nfunction Messages({\n hasEarlier = false,\n loadingEarlier = false,\n onLoadEarlier,\n earlierLabel = \"Load earlier messages\",\n className,\n children,\n ...props\n}: ChatMessagesProps) {\n const viewportRef = useRef<HTMLDivElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const sentinelRef = useRef<HTMLDivElement | null>(null);\n const pinned = useRef(true);\n // Where the reader was when the earlier page was asked for: a row and how\n // far it sat from the pane's top, kept current as they go on scrolling,\n // until the page is in. The height and scroll position stand in when\n // there is no row to hold on to.\n const anchor = useRef<{\n row: Element | null;\n offset: number;\n height: number;\n top: number;\n } | null>(null);\n const loading = useRef(loadingEarlier);\n // The last request brought no messages (it failed, or the page was\n // empty). The top would ask again at once and go on asking, so it waits\n // for the button, or for another thread.\n const stalled = useRef(false);\n const askEarlier = useRef(onLoadEarlier);\n useIsoLayoutEffect(() => {\n askEarlier.current = onLoadEarlier;\n });\n\n // Holds the reader's place while an earlier page is on its way and once\n // it lands; otherwise keeps a pinned pane at the bottom.\n const settle = useCallback(() => {\n const viewport = viewportRef.current;\n if (!viewport) return;\n const kept = anchor.current;\n if (kept) {\n if (placed(kept.row)) {\n viewport.scrollTop += offsetIn(viewport, kept.row) - kept.offset;\n } else {\n viewport.scrollTop = viewport.scrollHeight - kept.height + kept.top;\n }\n if (loading.current) return;\n anchor.current = null;\n pinned.current =\n viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight <\n PIN_SLACK_PX;\n return;\n }\n if (pinned.current) viewport.scrollTop = viewport.scrollHeight;\n }, []);\n\n useIsoLayoutEffect(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n if (!viewport || !content) return;\n settle();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(settle);\n observer.observe(content);\n observer.observe(viewport);\n return () => observer.disconnect();\n }, [settle]);\n\n // The page is in (or the request is over): let go of the reader's place\n // before paint, even when nothing changed size.\n useIsoLayoutEffect(() => {\n loading.current = loadingEarlier;\n if (loadingEarlier) return;\n const kept = anchor.current;\n if (kept) stalled.current = oldestMessage(contentRef.current) === kept.row;\n settle();\n }, [loadingEarlier, settle]);\n\n const onScroll = () => {\n const viewport = viewportRef.current;\n if (!viewport) return;\n const kept = anchor.current;\n if (kept) {\n kept.height = viewport.scrollHeight;\n kept.top = viewport.scrollTop;\n if (placed(kept.row)) kept.offset = offsetIn(viewport, kept.row);\n }\n pinned.current =\n viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight <\n PIN_SLACK_PX;\n };\n\n const loadEarlier = useCallback(() => {\n const viewport = viewportRef.current;\n if (viewport) {\n // New messages go in below the oldest one and the page above it, and\n // unlike a day's divider it stays when the page arrives.\n const row = oldestMessage(contentRef.current);\n anchor.current = {\n row,\n offset: row ? offsetIn(viewport, row) : 0,\n height: viewport.scrollHeight,\n top: viewport.scrollTop,\n };\n }\n pinned.current = false;\n askEarlier.current?.();\n }, []);\n\n useEffect(() => {\n const viewport = viewportRef.current;\n const sentinel = sentinelRef.current;\n if (!hasEarlier) {\n stalled.current = false;\n return;\n }\n if (loadingEarlier || stalled.current || !viewport || !sentinel) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) loadEarlier();\n },\n { root: viewport, rootMargin: EARLIER_AHEAD },\n );\n observer.observe(sentinel);\n return () => observer.disconnect();\n }, [hasEarlier, loadingEarlier, loadEarlier]);\n\n return (\n <div\n data-chat-messages=\"\"\n className={cn(\n // Bubbles' focus and selected rings offset against the thread.\n \"flex min-h-0 flex-1 flex-col [--pho-bubble-backdrop:var(--background-color-pho-primary)]\",\n className,\n )}\n {...props}\n >\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport ref={viewportRef} onScroll={onScroll}>\n <ScrollArea.Content\n ref={contentRef}\n style={{ minWidth: 0 }}\n className=\"flex min-h-full flex-col gap-1 p-4\"\n >\n {hasEarlier && (\n <div\n ref={sentinelRef}\n data-chat-earlier=\"\"\n aria-busy={loadingEarlier || undefined}\n className=\"flex min-h-8 items-center justify-center\"\n >\n {loadingEarlier ? (\n <Spinner\n aria-label=\"Loading earlier messages\"\n className=\"text-pho-secondary\"\n />\n ) : (\n <Button\n variant=\"outlined\"\n size=\"sm\"\n onClick={(event) => {\n // The spinner takes the button's place: keyboard focus\n // stays in the pane.\n if (event.currentTarget === document.activeElement) {\n viewportRef.current?.focus({ preventScroll: true });\n }\n stalled.current = false;\n loadEarlier();\n }}\n >\n {earlierLabel}\n </Button>\n )}\n </div>\n )}\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </div>\n );\n}\n\n/** A centered caption in the thread — the day, \"Unread\". */\nfunction Divider({ className, children, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-chat-divider=\"\"\n className={cn(\"text-pho-description py-1 text-center text-xs\", className)}\n {...props}\n >\n {children}\n </div>\n );\n}\n\n/* -------------------------------- footer -------------------------------- */\n\n/** The docked bar under the messages — usually a `Composer`. */\nfunction Footer({ className, ...props }: ComponentProps<\"footer\">) {\n return (\n <footer\n data-chat-footer=\"\"\n className={cn(\"shrink-0 px-4 py-3\", className)}\n {...props}\n />\n );\n}\n\n/** The draft box grows with the text up to this, then scrolls. */\nconst COMPOSER_MAX_HEIGHT_PX = 200;\n\nexport interface ChatComposerProps extends Omit<\n ComponentProps<\"form\">,\n \"onSubmit\" | \"prefix\" | \"children\"\n> {\n /** The draft. */\n value: string;\n onValueChange: (value: string) => void;\n /** Enter, or the send button. Not called while `sending` or with nothing to send. */\n onSend: () => void;\n placeholder?: string;\n /** The send is in flight — the button spins, the box waits. */\n sending?: boolean;\n disabled?: boolean;\n /**\n * There is something to send besides text (an attachment). By default\n * the send button wakes when the draft has a non-blank character.\n */\n canSend?: boolean;\n /** Controls at the start of the bottom row — an add-attachment button. */\n prefix?: ReactNode;\n /** A quiet line between `prefix` and the send button — a count, a size. */\n meta?: ReactNode;\n /** The send button's accessible name. @default \"Send\" */\n sendLabel?: string;\n /** Above the text — attachment thumbnails. */\n children?: ReactNode;\n /** The `<textarea>`. */\n textareaRef?: Ref<HTMLTextAreaElement>;\n}\n\n/**\n * The message box: text that grows with the draft, Enter to send and\n * Shift+Enter for a new line, one round send button. Attachments are the\n * page's: put their thumbnails in `children`, the button that adds them\n * in `prefix`, and flip `canSend` when they alone should send.\n */\nfunction Composer({\n value,\n onValueChange,\n onSend,\n placeholder = \"Message\",\n sending = false,\n disabled = false,\n canSend,\n prefix,\n meta,\n sendLabel = \"Send\",\n children,\n textareaRef,\n className,\n ...props\n}: ChatComposerProps) {\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n const ready = !sending && !disabled && (canSend ?? value.trim().length > 0);\n\n useIsoLayoutEffect(() => {\n const element = innerRef.current;\n if (!element) return;\n element.style.height = \"0px\";\n element.style.height = `${Math.min(element.scrollHeight, COMPOSER_MAX_HEIGHT_PX)}px`;\n }, [value]);\n\n const submit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (ready) onSend();\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (\n event.key === \"Enter\" &&\n !event.shiftKey &&\n !event.nativeEvent.isComposing\n ) {\n event.preventDefault();\n if (ready) onSend();\n }\n };\n\n return (\n <form\n aria-label=\"Message composer\"\n data-chat-composer=\"\"\n onSubmit={submit}\n className={cn(\n // The field surface, as `Input`: hairline at rest, brand ring while\n // anything inside has focus.\n \"rounded-base bg-pho-primary ring-pho-primary focus-within:ring-pho-brand ring-1 transition-shadow duration-100 ease-linear ring-inset focus-within:ring-2\",\n disabled && \"opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n <textarea\n ref={(node) => {\n innerRef.current = node;\n if (typeof textareaRef === \"function\") textareaRef(node);\n else if (textareaRef) {\n (textareaRef as { current: HTMLTextAreaElement | null }).current =\n node;\n }\n }}\n value={value}\n onChange={(event) => onValueChange(event.target.value)}\n onKeyDown={onKeyDown}\n rows={1}\n placeholder={placeholder}\n aria-label=\"Message\"\n disabled={disabled}\n // In flight the box holds its text but stays focusable — `disabled`\n // would drop focus mid-send; `ready` already blocks a second send.\n readOnly={sending}\n className=\"text-pho-primary placeholder:text-pho-placeholder m-0 block w-full resize-none bg-transparent px-4 pt-3 pb-1 text-base outline-none disabled:cursor-not-allowed\"\n />\n <div className=\"flex items-center gap-2 px-2 pb-2\">\n {prefix}\n <p className=\"text-pho-description m-0 min-w-0 flex-1 truncate text-xs\">\n {meta}\n </p>\n <Button\n type=\"submit\"\n size=\"sm\"\n shape=\"circle\"\n svgOnly\n aria-label={sendLabel}\n disabled={!ready}\n loading={sending}\n >\n <IconArrowUp />\n </Button>\n </div>\n </form>\n );\n}\n\n/* --------------------------------- states ------------------------------- */\n\nexport interface ChatEmptyProps extends StatusViewProps {}\n\n/**\n * The standing-in view for either pane — no conversations, no thread\n * chosen, nothing said yet. `StatusView` at card size, centered in\n * whatever room the pane has.\n */\nfunction Empty({ className, size = \"sm\", ...props }: ChatEmptyProps) {\n return (\n <div\n data-chat-empty=\"\"\n className={cn(\n \"flex flex-1 flex-col items-center justify-center px-6 py-8\",\n className,\n )}\n >\n <StatusView size={size} {...props} />\n </div>\n );\n}\n\n/** Bones in the shape of conversation rows — avatar, who, when, preview. */\nfunction ConversationsLoading({ rows = 5 }: { rows?: number }) {\n return (\n <div\n aria-hidden\n data-chat-conversations-loading=\"\"\n className=\"flex flex-col gap-0.5\"\n >\n {Array.from({ length: rows }, (_, row) => (\n <div key={row} className=\"flex items-center gap-3 px-2 py-2.5\">\n <Skeleton className=\"size-8 shrink-0 rounded-full\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center justify-between gap-2\">\n <Skeleton className=\"h-3.5 w-32\" />\n <Skeleton className=\"h-2.5 w-8\" />\n </div>\n <Skeleton className=\"mt-2 h-2.5 w-44\" />\n </div>\n </div>\n ))}\n </div>\n );\n}\n\n/** Bones in a thread's shape — theirs left, ours right. */\nfunction MessagesLoading() {\n return (\n <div\n aria-hidden\n data-chat-messages-loading=\"\"\n className=\"flex flex-col gap-3\"\n >\n <Skeleton className=\"rounded-base h-10 w-1/2 self-start\" />\n <Skeleton className=\"rounded-base h-10 w-2/5 self-end\" />\n <Skeleton className=\"rounded-base h-16 w-3/5 self-start\" />\n </div>\n );\n}\n\n/**\n * The composed inbox. Assemble the two panes and fill them:\n *\n * ```tsx\n * <Chat.Root layout=\"auto\" className=\"h-[32rem]\">\n * <Chat.List>\n * <Chat.Search value={query} onChange={…} />\n * <Chat.Conversations>\n * <Chat.ConversationList>\n * <Chat.Conversation title=\"+1 (315) 997-8332\" time=\"2d ago\" preview=\"…\" active />\n * </Chat.ConversationList>\n * </Chat.Conversations>\n * </Chat.List>\n * <Chat.Thread>\n * <Chat.Header avatar={<Avatar.Root size=\"md\">…</Avatar.Root>}>\n * <Chat.Title>+1 (315) 997-8332</Chat.Title>\n * <Chat.Description>From …</Chat.Description>\n * </Chat.Header>\n * <Chat.Messages>\n * <Chat.Divider>September 12</Chat.Divider>\n * <Message.Root>…</Message.Root>\n * </Chat.Messages>\n * <Chat.Footer>\n * <Chat.Composer value={draft} onValueChange={setDraft} onSend={send} />\n * </Chat.Footer>\n * </Chat.Thread>\n * </Chat.Root>\n * ```\n */\nexport const Chat = {\n Root,\n List,\n Search,\n Conversations,\n Convers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,OAAAc;AAAA,EACA,sBAAAE;AAAA,EACA,iBAAAG;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
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":";;;;;;;;;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,G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US_VIEW_SIZES","StatusView","icon","title","description","actions","size","className","props","slot","cn"],"sources":["../../src/components/status-view/status-view.tsx"],"sourcesContent":["import { type ComponentProps, type ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * Hugs its content (`w-fit`) and centers itself in the host (`mx-auto`); text\n * stays start-aligned so the icon / title / description share one left edge.\n * `max-w-lg` only caps long prose at Dialog width before it wraps.\n */\nexport const STATUS_VIEW =\n \"mx-auto flex w-fit max-w-lg min-w-0 flex-col items-start justify-center text-left\";\n\n/** Title + description group — flex column; gap comes from the size axis. */\nexport const STATUS_VIEW_COPY = \"flex flex-col\";\n\n/**\n * Size axis — retunes every slot. Title + description share Dialog's\n * `font-display` ladder: `base` matches Dialog (`gap-1`); `sm` steps one rung\n * down (`gap-0`) for cards and panels.\n */\nexport const STATUS_VIEW_SIZES = {\n sm: {\n description: \"Small — states inside cards and panels\",\n classes: {\n root: \"px-5 py-8\",\n icon: \"mb-1.5 *:size-6\",\n copy: \"gap-0\",\n title: \"text-base\",\n description: \"text-base\",\n actions: \"mt-5\",\n },\n },\n base: {\n description: \"Base — the default; full pages and large regions\",\n classes: {\n root: \"px-5 py-12\",\n icon: \"mb-4 *:size-10\",\n copy: \"gap-1\",\n title: \"text-display-sm\",\n description: \"text-display-xs\",\n actions: \"mt-5\",\n },\n },\n} satisfies Record<\n string,\n { description: string; classes: Record<string, string> }\n>;\n\nexport type StatusViewSize = keyof typeof STATUS_VIEW_SIZES;\n\ninterface StatusViewBaseProps {\n /** Decorative glyph above the title, usually a Tabler icon. Sized by the view (`*:size-*`), inked `text-pho-secondary`. */\n icon?: ReactNode;\n /** One short line naming the state (\"No API keys yet\", \"Page not found\"). */\n title: ReactNode;\n /** Supporting prose — what it means or what to do next. */\n description?: ReactNode;\n /** Optional action row (buttons / links). Empty states usually omit it. */\n actions?: ReactNode;\n /** Size variant. @default \"base\" */\n size?: StatusViewSize;\n}\n\nexport interface StatusViewProps\n extends\n StatusViewBaseProps,\n Omit<ComponentProps<\"div\">, keyof StatusViewBaseProps | \"children\"> {}\n\n/**\n * StatusView — the standing-in view for a region with nothing to show or\n * nothing that worked: icon over title over description, with an optional\n * action row. The block shrink-wraps and centers itself while its text stays\n * left-aligned; the host owns the footprint (a card body, or a `min-h-screen`\n * flex-centered page). Use `size=\"sm\"` inside cards, the default `base` for\n * whole pages.\n *\n * Empty and error states share this one component — they differ only in what\n * you pass:\n *\n * - **Empty** — usually no `icon` and no `actions`; the create affordance\n * lives elsewhere on the page.\n * - **Error** — pass a warning `icon`, `role=\"alert\"` so it announces, and\n * `actions` offering a way out (retry, reload, a route back).\n */\nexport function StatusView({\n icon,\n title,\n description,\n actions,\n size = \"base\",\n className,\n ...props\n}: StatusViewProps) {\n const slot = STATUS_VIEW_SIZES[size].classes;\n return (\n <div className={cn(STATUS_VIEW, slot.root, className)} {...props}>\n {icon != null && (\n <div aria-hidden className={cn(\"text-pho-secondary\", slot.icon)}>\n {icon}\n </div>\n )}\n <div className={cn(STATUS_VIEW_COPY, slot.copy)}>\n <div\n className={cn(\n \"text-pho-secondary font-display font-medium text-balance\",\n slot.title,\n )}\n >\n {title}\n </div>\n {description != null && (\n <div\n className={cn(\"text-pho-description font-normal\", slot.description)}\n >\n {description}\n </div>\n )}\n </div>\n {actions != null && (\n <div\n className={cn(\n \"flex flex-wrap items-center justify-start gap-2\",\n slot.actions,\n )}\n >\n {actions}\n </div>\n )}\n </div>\n );\n}\n\nStatusView.displayName = \"StatusView\";\n"],"mappings":";;;;AAQA,IAAaE,IACX,qFAGWC,IAAmB,iBAOnBC,IAAoB;AAAA,EAC/B,IAAI;AAAA,IACF,aAAa;AAAA,IACb,SAAS;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SAAS;AAAA,MACP,MAAM;AAA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