@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.
Files changed (36) hide show
  1. package/dist/chunks/{basic-page-BYA1lkzf.js → basic-page-DnB4YSRj.js} +4 -4
  2. package/dist/chunks/basic-page-DnB4YSRj.js.map +1 -0
  3. package/dist/chunks/{chat-j7XEdKEo.js → chat-C5W6L_Jg.js} +4 -4
  4. package/dist/chunks/chat-C5W6L_Jg.js.map +1 -0
  5. package/dist/chunks/{dialog-CDL6qY2a.js → dialog-e4_mOYGp.js} +5 -5
  6. package/dist/chunks/dialog-e4_mOYGp.js.map +1 -0
  7. package/dist/chunks/{error-BZU9vgnj.js → error-BjSn7wLu.js} +2 -2
  8. package/dist/chunks/{error-BZU9vgnj.js.map → error-BjSn7wLu.js.map} +1 -1
  9. package/dist/chunks/{log-list-QbSYHZu3.js → log-list-BqaJv2oA.js} +2 -2
  10. package/dist/chunks/{log-list-QbSYHZu3.js.map → log-list-BqaJv2oA.js.map} +1 -1
  11. package/dist/chunks/{status-view-I_Y6eEyX.js → status-view-Buhh1UBJ.js} +2 -2
  12. package/dist/chunks/status-view-Buhh1UBJ.js.map +1 -0
  13. package/dist/components/chat.js +1 -1
  14. package/dist/components/command.js +1 -1
  15. package/dist/components/dialog.js +1 -1
  16. package/dist/components/drawer.js +5 -5
  17. package/dist/components/drawer.js.map +1 -1
  18. package/dist/components/error.js +1 -1
  19. package/dist/components/field.js +26 -24
  20. package/dist/components/field.js.map +1 -1
  21. package/dist/components/log-list.js +1 -1
  22. package/dist/components/notification.js +1 -1
  23. package/dist/components/notification.js.map +1 -1
  24. package/dist/components/scope.js +1 -1
  25. package/dist/components/scope.js.map +1 -1
  26. package/dist/components/status-view.js +1 -1
  27. package/dist/index.js +6 -6
  28. package/dist/sections/basic-page.js +1 -1
  29. package/dist/src/components/drawer/drawer.d.ts +1 -0
  30. package/dist/src/components/field/field.d.ts +10 -2
  31. package/dist/src/components/status-view/status-view.d.ts +4 -3
  32. package/package.json +1 -1
  33. package/dist/chunks/basic-page-BYA1lkzf.js.map +0 -1
  34. package/dist/chunks/chat-j7XEdKEo.js.map +0 -1
  35. package/dist/chunks/dialog-CDL6qY2a.js.map +0 -1
  36. package/dist/chunks/status-view-I_Y6eEyX.js.map +0 -1
@@ -9,7 +9,7 @@ import { t as ve } from "./input-DWnb33UF.js";
9
9
  import { n as J } from "./avatar-PgBOfszL.js";
10
10
  import { t as xe } from "./IconSearch-DkcWWZ1H.js";
11
11
  import { t as k } from "./scroll-area-DjdSnx2p.js";
12
- import { i as ge } from "./status-view-I_Y6eEyX.js";
12
+ import { i as ge } from "./status-view-Buhh1UBJ.js";
13
13
  import { t as A } from "./skeleton-CqZlGphn.js";
14
14
  import { n as we } from "./box-search-CMl5bQ7Y.js";
15
15
  import { createContext as be, useCallback as O, useContext as ye, useEffect as re, useId as Ne, useLayoutEffect as Ce, useMemo as ne, useRef as S, useState as I } from "react";
@@ -337,7 +337,7 @@ function Qe({ title: t, time: e, preview: a, avatar: s, group: o, active: d, cla
337
337
  children: e
338
338
  })]
339
339
  }), a != null && /* @__PURE__ */ r("span", {
340
- className: "text-pho-description mt-0.5 block min-w-0 truncate text-xs font-normal",
340
+ className: "text-pho-description block min-w-0 truncate text-xs font-normal",
341
341
  children: a
342
342
  })]
343
343
  })] });
@@ -631,7 +631,7 @@ function lt({ rows: t = 5 }) {
631
631
  children: [/* @__PURE__ */ N("div", {
632
632
  className: "flex items-center justify-between gap-2",
633
633
  children: [/* @__PURE__ */ r(A, { className: "h-3.5 w-32" }), /* @__PURE__ */ r(A, { className: "h-2.5 w-8" })]
634
- }), /* @__PURE__ */ r(A, { className: "mt-2 h-2.5 w-44" })]
634
+ }), /* @__PURE__ */ r(A, { className: "mt-1.5 h-2.5 w-44" })]
635
635
  })]
636
636
  }, a))
637
637
  });
@@ -671,4 +671,4 @@ export {
671
671
  _t as t
672
672
  };
673
673
 
674
- //# sourceMappingURL=chat-j7XEdKEo.js.map
674
+ //# sourceMappingURL=chat-C5W6L_Jg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-C5W6L_Jg.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 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-1.5 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 ConversationList,\n Conversation,\n Thread,\n Header,\n Title,\n Description,\n Messages,\n Divider,\n Footer,\n Composer,\n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 @@ function b({ className: t, ...n }) {
101
101
  function B({ children: t, size: n = "md" }) {
102
102
  return /* @__PURE__ */ e("span", {
103
103
  "aria-hidden": !0,
104
- className: u("text-pho-secondary mb-1", n === "lg" ? "[&>svg]:size-12" : "[&>svg]:size-8"),
104
+ className: u("text-pho-secondary mb-2", n === "lg" ? "[&>svg]:size-12" : "[&>svg]:size-8"),
105
105
  children: t
106
106
  });
107
107
  }
@@ -113,7 +113,7 @@ function K({ icon: t, title: n, description: o, consequences: r, warning: l, act
113
113
  ...g,
114
114
  children: [
115
115
  v && /* @__PURE__ */ s("div", {
116
- className: "flex shrink-0 flex-col gap-1 px-6 pt-6",
116
+ className: "flex shrink-0 flex-col px-6 pt-6",
117
117
  children: [
118
118
  t && /* @__PURE__ */ e(B, { children: t }),
119
119
  (n || m) && /* @__PURE__ */ s("div", {
@@ -173,7 +173,7 @@ function Q({ icon: t, title: n, description: o, actions: r, showClose: l = !0, c
173
173
  ...d,
174
174
  children: [
175
175
  !!(t || n || o || c) && /* @__PURE__ */ s("div", {
176
- className: "flex shrink-0 flex-col gap-1 px-6 pt-6",
176
+ className: "flex shrink-0 flex-col px-6 pt-6",
177
177
  children: [
178
178
  t && /* @__PURE__ */ e(B, { children: t }),
179
179
  (n || c) && /* @__PURE__ */ s("div", {
@@ -221,7 +221,7 @@ function U({ icon: t, title: n, description: o, actions: r, showClose: l = !0, f
221
221
  children: [/* @__PURE__ */ s(E, {
222
222
  className: "flex flex-col gap-5",
223
223
  children: [(t || n || o) && /* @__PURE__ */ s("div", {
224
- className: "flex flex-col gap-1",
224
+ className: "flex flex-col",
225
225
  children: [
226
226
  t && /* @__PURE__ */ e(B, {
227
227
  size: "lg",
@@ -260,4 +260,4 @@ export {
260
260
  ae as t
261
261
  };
262
262
 
263
- //# sourceMappingURL=dialog-CDL6qY2a.js.map
263
+ //# sourceMappingURL=dialog-e4_mOYGp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-e4_mOYGp.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, 8px of air before the title. The\n * header stacks without a gap (the title and its description sit flush),\n * so the icon carries its own space. Panel dialogs use 32px (`size-8`);\n * fullscreen gates step up to 48px (`size-12`) so the glyph reads at\n * 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-2\",\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 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 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\">\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,SACx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EACT,+DACA2E,CACF;AAAA,MASA,UAAA,gBAAA9D,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QAAf,UAAA,CACE,gBAAAA,EAACV,GAAD;AAAA,UAAgB,WAAU;AAAA,UAA1B,UAAA,EACIsD,KAAQC,KAASC,MACjB,gBAAA9C,EAAC,OAAD;AAAA,YAAK,WAAU;AAAA,YAAf,UAAA;AAAA,cACG4C,KACC,gBAAA7C,EAACwC,GAAD;AAAA,gBAAkB,MAAK;AAAA,gBAAM,UAAAK;AAAA,cAAuB,CAAA;AAAA,cAErDC,KAAS,gBAAA9C,EAACsC,GAAD,EAAA,UAAQQ,EAAa,CAAA;AAAA,cAC9BC,KAAe,gBAAA/C,EAACuC,GAAD,EAAA,UAAcQ,EAAyB,CAAA;AAAA,YACpD;AAAA,UAEN,CAAA,GAAAN,CACa;AAAA,QACf,CAAA,GAAAS,KAAW,QACV,gBAAAlD,EAAC,OAAD;AAAA,UACE,WAAWZ,EACT,4CACAuD,CACF;AAAA,UAEC,UAAAO;AAAA,QACE,CAAA,CAEJ;AAAA,M;A,IACF,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"}
@@ -6,7 +6,7 @@ import { t as S } from "./IconInfoCircle-CTAynhe8.js";
6
6
  import { t as g } from "./IconAlertCircleFilled-D6mUlVaE.js";
7
7
  import { t as A } from "./IconAlertTriangleFilled-QV-gsVQW.js";
8
8
  import { t as l } from "./popover-Dtp9C6Qg.js";
9
- import { i as _ } from "./status-view-I_Y6eEyX.js";
9
+ import { i as _ } from "./status-view-Buhh1UBJ.js";
10
10
  import { useEffect as P, useRef as L, useState as k } from "react";
11
11
  import { Fragment as c, jsx as r, jsxs as s } from "react/jsx-runtime";
12
12
  var z = [
@@ -267,4 +267,4 @@ export {
267
267
  F as u
268
268
  };
269
269
 
270
- //# sourceMappingURL=error-BZU9vgnj.js.map
270
+ //# sourceMappingURL=error-BjSn7wLu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-BZU9vgnj.js","names":["_Fragment","cn","Button","ButtonLink","createReactComponent","IconInfoCircle","IconAlertCircleFilled","IconAlertTriangleFilled","Popover","StatusView","useEffect","useRef","useState","Fragment$1","jsx","jsxs","__iconNode","IconAlertTriangle","isProblem","value","v","parseProblem","error","current","depth","carried","GENERIC_ERROR_TITLE","HTTP_REASON_PHRASE","HTTP_STATUS_EXPLANATION","hasContractCode","problem","httpReasonPhrase","status","fallbackTitle","httpStatusExplanation","capitalizeFirst","text","first","upper","describeError","description","part","displayCopy","DOC_LINK_LABEL","RETRY_LABEL","Error","children","className","props","copy","ErrorDetails","Warning","shown","requestId","statusLine","reason","RequestId","copied","setCopied","copiedTimer","ErrorView","title","icon","onRetry","actions","size","resolvedDescription","body","resolvedActions"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.mjs","../../src/components/error/problem.ts","../../src/components/error/error.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\": \"M12 9v4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16h.01\", \"key\": \"svg-2\" }]];\nconst IconAlertTriangle = createReactComponent(\"outline\", \"alert-triangle\", \"AlertTriangle\", __iconNode);\n\nexport { __iconNode, IconAlertTriangle as default };\n","/**\n * Client-side mirror of the `@photon-hq/error` response contract — the\n * RFC 9457 Problem Details body every Photon service returns for 4xx / 5xx.\n * Machine logic branches on `code`; `title` / `detail` / `remediation` are\n * the human-readable copy, already reviewed server-side and safe to render.\n *\n * Fetch layers may also hand us a thin status-only shape when the response\n * was not ok but the body was not a contract problem — `title` + `status`\n * still count so the UI can disclose the HTTP code we already know.\n */\n\nexport interface ProblemRemediation {\n /** What the user can do about it — a full sentence. */\n action?: string;\n /** Docs URL explaining the problem. */\n documentation?: string;\n}\n\nexport interface Problem {\n /** Stable machine-readable key (`RATE_LIMITED`) — the field to branch on. */\n code?: string;\n /** Human summary of the problem type (\"Too Many Requests\"). */\n title: string;\n /** HTTP status (4xx / 5xx). */\n status: number;\n /** Problem type URI (`urn:photon:problem:*` or an https URL). */\n type?: string;\n /** Occurrence-specific human sentence. */\n detail?: string;\n /** Correlation id for support (`X-Request-ID`). */\n requestId?: string;\n remediation?: ProblemRemediation;\n /** RFC 9457 extensions (`issues`, `actualVersion`, …). */\n [extension: string]: unknown;\n}\n\n/** Structural check: `title` + a 4xx/5xx status. `code` is optional. */\nexport function isProblem(value: unknown): value is Problem {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return (\n typeof v.title === \"string\" &&\n typeof v.status === \"number\" &&\n Number.isInteger(v.status) &&\n v.status >= 400 &&\n v.status <= 599 &&\n (v.code === undefined || typeof v.code === \"string\")\n );\n}\n\n/**\n * Find the problem a caught value carries — the value itself, one typed onto\n * an error as a `problem` field (dashboard's `ApiError` shape), or one\n * wrapped in an `Error` `cause` chain (how fetch layers usually rethrow a\n * parsed body). Returns `null` when there is none.\n */\nexport function parseProblem(error: unknown): Problem | null {\n let current: unknown = error;\n for (\n let depth = 0;\n depth < 8 && typeof current === \"object\" && current !== null;\n depth++\n ) {\n if (isProblem(current)) return current;\n const carried = (current as { problem?: unknown }).problem;\n if (isProblem(carried)) return carried;\n current = (current as { cause?: unknown }).cause;\n }\n return null;\n}\n\nexport interface ErrorDescription {\n /** Short name of the failure — the problem `title`, or a generic fallback. */\n title: string;\n /** Sentence(s) to show — `detail` and `remediation.action` joined. */\n description?: string;\n /** Docs URL from `remediation.documentation`. */\n documentation?: string;\n /** Correlation id for support. */\n requestId?: string;\n /** The matched problem, when the input carried one. */\n problem?: Problem;\n}\n\n/**\n * Anything that isn't a problem renders as this — raw `Error` messages are\n * not contract copy and never shown (the same fail-closed stance as the\n * server side of `@photon-hq/error`). Always a full sentence (trailing\n * period).\n */\nexport const GENERIC_ERROR_TITLE = \"Something went wrong.\";\n\n/** Standard reason phrases for statuses we commonly surface without a body. */\nconst HTTP_REASON_PHRASE: Record<number, string> = {\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 413: \"Payload Too Large\",\n 415: \"Unsupported Media Type\",\n 422: \"Unprocessable Entity\",\n 429: \"Too Many Requests\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n};\n\n/** One-sentence explanations when the server gave a status but no problem copy. */\nconst HTTP_STATUS_EXPLANATION: Record<number, string> = {\n 400: \"The request was malformed or incomplete.\",\n 401: \"You need to sign in again.\",\n 403: \"You don't have permission to do that.\",\n 404: \"The requested resource was not found.\",\n 408: \"The request timed out before the server responded.\",\n 409: \"The request conflicts with the current state.\",\n 410: \"That resource is no longer available.\",\n 413: \"The request was too large for the server to accept.\",\n 415: \"That media type isn't supported.\",\n 422: \"The request was understood but couldn't be processed.\",\n 429: \"Request rate limit exceeded. Wait a moment before trying again.\",\n 500: \"The server hit an unexpected error.\",\n 501: \"The server doesn't support that operation.\",\n 502: \"The gateway got an invalid response from an upstream server.\",\n 503: \"The service is temporarily unavailable.\",\n 504: \"The gateway timed out waiting for an upstream server.\",\n};\n\nfunction hasContractCode(problem: Problem): boolean {\n return typeof problem.code === \"string\" && problem.code !== \"\";\n}\n\n/** Reason phrase for a status — map first, then a non-generic `problem.title`. */\nexport function httpReasonPhrase(\n status: number,\n fallbackTitle?: string,\n): string | undefined {\n if (HTTP_REASON_PHRASE[status]) return HTTP_REASON_PHRASE[status];\n if (\n fallbackTitle &&\n fallbackTitle !== GENERIC_ERROR_TITLE &&\n fallbackTitle !== \"Request failed\"\n ) {\n return fallbackTitle.replace(/\\.$/, \"\");\n }\n return undefined;\n}\n\n/** Human sentence for a bare HTTP status, when the body carried no copy. */\nexport function httpStatusExplanation(status: number): string {\n return (\n HTTP_STATUS_EXPLANATION[status] ??\n \"The request failed with an unexpected status.\"\n );\n}\n\n/**\n * Sentence-case the first character. Server `detail` / `title` sometimes\n * arrive fully lowercase; UI copy always leads with a capital.\n */\nexport function capitalizeFirst(text: string): string {\n if (!text) return text;\n const first = text.charAt(0);\n const upper = first.toUpperCase();\n if (first === upper) return text;\n return upper + text.slice(1);\n}\n\n/**\n * Turn a caught value into displayable copy. `Error` and `ErrorView` call\n * this internally; use it directly for other surfaces (a toast, a banner).\n *\n * Status-only failures (HTTP not ok, but no contract `code` / copy) still\n * keep `problem` so the details panel can show the status. Title becomes the\n * reason phrase (e.g. \"Bad Gateway\"); description is a short explanation —\n * not just the numeric code.\n */\nexport function describeError(error: unknown): ErrorDescription {\n const problem = parseProblem(error);\n if (problem == null) return { title: GENERIC_ERROR_TITLE };\n\n const description =\n [problem.detail, problem.remediation?.action]\n .filter((part): part is string => typeof part === \"string\" && part !== \"\")\n .join(\" \") || undefined;\n\n if (!hasContractCode(problem) && description == null) {\n const reason = httpReasonPhrase(problem.status, problem.title);\n return {\n title: capitalizeFirst(reason ?? GENERIC_ERROR_TITLE),\n description: httpStatusExplanation(problem.status),\n requestId: problem.requestId,\n problem,\n };\n }\n\n return {\n title: capitalizeFirst(problem.title || GENERIC_ERROR_TITLE),\n description: description ? capitalizeFirst(description) : undefined,\n documentation: problem.remediation?.documentation,\n requestId: problem.requestId,\n problem,\n };\n}\n","import {\n useEffect,\n useRef,\n useState,\n type ComponentProps,\n type ReactNode,\n} from \"react\";\nimport {\n IconAlertCircleFilled,\n IconAlertTriangle,\n IconAlertTriangleFilled,\n IconInfoCircle,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button, ButtonLink } from \"../button/button\";\nimport { Popover } from \"../popover/popover\";\nimport { StatusView, type StatusViewSize } from \"../status-view/status-view\";\nimport {\n capitalizeFirst,\n describeError,\n httpReasonPhrase,\n type ErrorDescription,\n} from \"./problem\";\n\n/** Capitalize string copy; leave custom ReactNode overrides alone. */\nfunction displayCopy(value: ReactNode): ReactNode {\n return typeof value === \"string\" ? capitalizeFirst(value) : value;\n}\n\n/**\n * Design notes:\n * - ONE input: `error` is the caught value, whatever it is — a Problem\n * Details body from `@photon-hq/error`, an `Error` carrying one as\n * `cause`, or something unknown. The component derives its copy via\n * `describeError`; unknowns fall back to a generic line rather than\n * leaking raw messages.\n * - TWO presentations, one per altitude: `Error` is the inline line for\n * forms, cards, and action rows; `ErrorView` is the region / page state\n * built on StatusView (same `sm` / `base` size axis).\n * - Both render `null` when there is nothing to show, so they can sit\n * unconditionally in JSX (`<Error error={mutation.error} />`).\n * - `Warning` is the inline line's second state: the same row in warning\n * ink, for something the user may go ahead with but should look at\n * twice. It never blocks, so it takes its copy and nothing else.\n * - Client-side *validation* is not this component's job — that belongs to\n * `Field.Error`, wired to control validity.\n */\n\nconst DOC_LINK_LABEL = \"Learn more\";\nconst RETRY_LABEL = \"Try again\";\n\ninterface ErrorBaseProps {\n /** The caught value — a problem body, an `Error` wrapping one, or unknown. */\n error?: unknown;\n /** Override the derived message. */\n children?: ReactNode;\n}\n\nexport interface ErrorProps\n extends ErrorBaseProps, Omit<ComponentProps<\"div\">, keyof ErrorBaseProps> {}\n\n/**\n * Error — one line of red ink naming a server failure (4xx / 5xx), placed\n * inline: under a form, in a card, beside the action that failed. Give it the\n * caught value and it renders the problem's `detail` (falling back to `title`,\n * then to a generic line), plus a docs link when the problem carries one.\n * Renders nothing while `error` is nullish, so it can stay mounted.\n *\n * For a region or page that failed to load, use {@link ErrorView}.\n */\nexport function Error({ error, children, className, ...props }: ErrorProps) {\n if (error == null && children == null) return null;\n const copy = describeError(error);\n return (\n <div\n role=\"alert\"\n className={cn(\n \"text-pho-error flex min-w-0 items-start gap-1.5 text-base\",\n className,\n )}\n {...props}\n >\n <span aria-hidden className=\"flex h-[1lh] shrink-0 items-center\">\n <IconAlertCircleFilled className=\"size-4\" />\n </span>\n <span className=\"min-w-0\">\n {displayCopy(children ?? copy.description ?? copy.title)}\n {copy.documentation != null && (\n <>\n {\" \"}\n <a\n href={copy.documentation}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"font-medium underline underline-offset-2\"\n >\n {DOC_LINK_LABEL}\n </a>\n </>\n )}\n {/* Trailing whitespace collapses when the details render null. */}{\" \"}\n <ErrorDetails copy={copy} />\n </span>\n </div>\n );\n}\n\nError.displayName = \"Error\";\n\nexport interface WarningProps extends Omit<\n ComponentProps<\"output\">,\n \"children\"\n> {\n /** What to look at twice. Shows nothing while nullish. */\n children?: ReactNode;\n}\n\n/**\n * Warning — the inline `Error` line in warning ink, a triangle in place of\n * the circle: something the user can go ahead with but may not mean (an\n * address outside the team, a value that differs from the usual one). Same\n * row, glyph seat and type as `Error`, so the two can take turns in one\n * place. It doesn't stop anything, so it announces politely (an `output`,\n * role `status`) and carries no details disclosure.\n *\n * A polite region is announced when its content changes, not when it is\n * inserted, so the `output` stays mounted while the copy is nullish:\n * empty and `sr-only`, the way pho-ui's other live regions sit, it keeps\n * its role and, out of flow, adds no gap to a stack.\n */\nexport function Warning({ children, className, ...props }: WarningProps) {\n // `{cond && copy}` leaves false behind: no copy either.\n const shown = children != null && children !== false && children !== \"\";\n return (\n <output\n className={\n shown\n ? cn(\n \"text-pho-warning flex min-w-0 items-start gap-1.5 text-base\",\n className,\n )\n : \"sr-only\"\n }\n {...props}\n >\n {shown && (\n <>\n <span aria-hidden className=\"flex h-[1lh] shrink-0 items-center\">\n <IconAlertTriangleFilled className=\"size-4\" />\n </span>\n <span className=\"min-w-0\">{displayCopy(children)}</span>\n </>\n )}\n </output>\n );\n}\n\nWarning.displayName = \"Warning\";\n\n/**\n * Hover / focus disclosure on the inline line — the request's fuller story:\n * problem `title` (with the same alert icon + `text-pho-error` ink as the\n * inline line), the untruncated description, then `status` + `code` and the\n * copyable request id grouped below for a support handoff. Renders only when\n * the caught value actually carried a problem (or at least a request id); a\n * generic unknown has nothing more to disclose. Built on `Popover` rather\n * than `Tooltip` because the panel holds an interactive control (the copy\n * button) — `openOnHover` keeps the tooltip-like gesture.\n */\nfunction ErrorDetails({ copy }: { copy: ErrorDescription }) {\n const { problem, requestId } = copy;\n if (problem == null && requestId == null) return null;\n\n // Contract problems show `status CODE`; status-only shows `status Reason`.\n let statusLine: string | null = null;\n if (problem != null) {\n if (problem.code) {\n statusLine = `${problem.status} ${problem.code}`;\n } else {\n const reason = httpReasonPhrase(problem.status, problem.title);\n statusLine = reason\n ? `${problem.status} ${reason}`\n : String(problem.status);\n }\n }\n\n return (\n <Popover.Root>\n <Popover.Trigger\n openOnHover\n delay={150}\n aria-label=\"Error details\"\n className=\"outline-pho-brand inline-flex size-4 shrink-0 translate-y-[3px] cursor-help items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-2\"\n >\n <IconInfoCircle className=\"size-3.5\" />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner align=\"start\">\n <Popover.Popup className=\"text-pho-error\">\n <Popover.Title className=\"text-pho-error flex items-start gap-1.5\">\n <span aria-hidden className=\"flex h-[1lh] shrink-0 items-center\">\n <IconAlertCircleFilled className=\"size-4\" />\n </span>\n {copy.title}\n </Popover.Title>\n {copy.description != null && (\n <Popover.Description className=\"text-pho-error\">\n {copy.description}\n </Popover.Description>\n )}\n {(statusLine != null || requestId != null) && (\n <div className=\"text-pho-error mt-1 font-mono text-[10px] leading-snug\">\n {statusLine != null && <p>{statusLine}</p>}\n {requestId != null && (\n <RequestId requestId={requestId} className=\"mt-0\" />\n )}\n </div>\n )}\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n\n/** Request-id footnote — click copies the id for support handoff. */\nfunction RequestId({\n requestId,\n className,\n}: {\n requestId: string;\n className?: string;\n}) {\n const [copied, setCopied] = useState(false);\n const copiedTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (copiedTimer.current) clearTimeout(copiedTimer.current);\n },\n [],\n );\n\n return (\n <span\n className={cn(\"mt-1 block font-mono text-[10px] leading-snug\", className)}\n >\n Request ID:{\" \"}\n <button\n type=\"button\"\n className=\"outline-pho-brand inline cursor-pointer underline-offset-2 select-all hover:underline focus-visible:underline focus-visible:outline-2 focus-visible:-outline-offset-1\"\n aria-label={\n copied ? \"Request ID copied\" : `Copy request ID ${requestId}`\n }\n onClick={async () => {\n try {\n await navigator.clipboard.writeText(requestId);\n } catch {\n return;\n }\n setCopied(true);\n if (copiedTimer.current) clearTimeout(copiedTimer.current);\n copiedTimer.current = setTimeout(() => setCopied(false), 1500);\n }}\n >\n {requestId}\n </button>\n <output className=\"sr-only\" aria-live=\"polite\">\n {copied ? \"Copied\" : \"\"}\n </output>\n </span>\n );\n}\n\ninterface ErrorViewBaseProps {\n /** The caught value — a problem body, an `Error` wrapping one, or unknown. */\n error?: unknown;\n /** Override the derived title. */\n title?: ReactNode;\n /** Override the derived description. */\n description?: ReactNode;\n /** Override the warning glyph. */\n icon?: ReactNode;\n /** Offer a retry — renders a \"Try again\" button. */\n onRetry?: () => void;\n /** Replace the built-in action row entirely. */\n actions?: ReactNode;\n /** Size variant — StatusView's axis. @default \"base\" */\n size?: StatusViewSize;\n}\n\nexport interface ErrorViewProps\n extends\n ErrorViewBaseProps,\n Omit<ComponentProps<\"div\">, keyof ErrorViewBaseProps | \"children\"> {}\n\n/**\n * ErrorView — the failed state of a region or page, built on StatusView:\n * warning icon over the problem's `title`, its `detail` and remediation\n * below, an action row (`onRetry` and the problem's docs link), and the\n * request id as a footnote for support. Announces via `role=\"alert\"`.\n *\n * Use `size=\"sm\"` inside cards and panels, the default `base` for whole\n * pages. Renders nothing while `error` is nullish (unless given a static\n * `title`), so it can sit unconditionally next to a query.\n */\nexport function ErrorView({\n error,\n title,\n description,\n icon,\n onRetry,\n actions,\n size = \"base\",\n ...props\n}: ErrorViewProps) {\n if (error == null && title == null) return null;\n const copy = describeError(error);\n\n const resolvedDescription = displayCopy(description ?? copy.description);\n const body =\n resolvedDescription != null || copy.requestId != null ? (\n <>\n {resolvedDescription}\n {copy.requestId != null && <RequestId requestId={copy.requestId} />}\n </>\n ) : undefined;\n\n const resolvedActions =\n actions ??\n (onRetry != null || copy.documentation != null ? (\n <>\n {onRetry != null && (\n <Button size=\"sm\" onClick={onRetry}>\n {RETRY_LABEL}\n </Button>\n )}\n {copy.documentation != null && (\n <ButtonLink\n size=\"sm\"\n variant=\"outlined\"\n href={copy.documentation}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n {DOC_LINK_LABEL}\n </ButtonLink>\n )}\n </>\n ) : undefined);\n\n return (\n <StatusView\n role=\"alert\"\n size={size}\n icon={icon ?? <IconAlertTriangle />}\n title={displayCopy(title ?? copy.title)}\n description={body}\n actions={resolvedActions}\n {...props}\n />\n );\n}\n\nErrorView.displayName = \"ErrorView\";\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;AASA,IAAMgB,IAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAW,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAA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,GAAD;AAAA,IACE,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,MAAM8C,EAAK;AAAA,IACX,QAAO;AAAA,IACP,KAAI;AAAA,IAEH,UAAAN;AAAA,EACS,CAAA,CAEd,EAAA,CAAA,IACA;AAEN,SACE,gBAAA7B,EAACL,GAAD;AAAA,IACE,MAAK;AAAA,IACC,MAAAwD;AAAA,IACN,MAAMH,KAAQ,gBAAAhD,EAACG,GAAD,CAAoB,CAAA;AAAA,IAClC,OAAOyB,EAAYmB,KAASZ,EAAK,KAAK;AAAA,IACtC,aAAakB;AAAA,IACb,SAASC;AAAA,IACT,GAAIpB;AAAA,EACL,CAAA;AAEL;AAEAY,EAAU,cAAc"}
1
+ {"version":3,"file":"error-BjSn7wLu.js","names":["_Fragment","cn","Button","ButtonLink","createReactComponent","IconInfoCircle","IconAlertCircleFilled","IconAlertTriangleFilled","Popover","StatusView","useEffect","useRef","useState","Fragment$1","jsx","jsxs","__iconNode","IconAlertTriangle","isProblem","value","v","parseProblem","error","current","depth","carried","GENERIC_ERROR_TITLE","HTTP_REASON_PHRASE","HTTP_STATUS_EXPLANATION","hasContractCode","problem","httpReasonPhrase","status","fallbackTitle","httpStatusExplanation","capitalizeFirst","text","first","upper","describeError","description","part","displayCopy","DOC_LINK_LABEL","RETRY_LABEL","Error","children","className","props","copy","ErrorDetails","Warning","shown","requestId","statusLine","reason","RequestId","copied","setCopied","copiedTimer","ErrorView","title","icon","onRetry","actions","size","resolvedDescription","body","resolvedActions"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.mjs","../../src/components/error/problem.ts","../../src/components/error/error.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\": \"M12 9v4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16h.01\", \"key\": \"svg-2\" }]];\nconst IconAlertTriangle = createReactComponent(\"outline\", \"alert-triangle\", \"AlertTriangle\", __iconNode);\n\nexport { __iconNode, IconAlertTriangle as default };\n","/**\n * Client-side mirror of the `@photon-hq/error` response contract — the\n * RFC 9457 Problem Details body every Photon service returns for 4xx / 5xx.\n * Machine logic branches on `code`; `title` / `detail` / `remediation` are\n * the human-readable copy, already reviewed server-side and safe to render.\n *\n * Fetch layers may also hand us a thin status-only shape when the response\n * was not ok but the body was not a contract problem — `title` + `status`\n * still count so the UI can disclose the HTTP code we already know.\n */\n\nexport interface ProblemRemediation {\n /** What the user can do about it — a full sentence. */\n action?: string;\n /** Docs URL explaining the problem. */\n documentation?: string;\n}\n\nexport interface Problem {\n /** Stable machine-readable key (`RATE_LIMITED`) — the field to branch on. */\n code?: string;\n /** Human summary of the problem type (\"Too Many Requests\"). */\n title: string;\n /** HTTP status (4xx / 5xx). */\n status: number;\n /** Problem type URI (`urn:photon:problem:*` or an https URL). */\n type?: string;\n /** Occurrence-specific human sentence. */\n detail?: string;\n /** Correlation id for support (`X-Request-ID`). */\n requestId?: string;\n remediation?: ProblemRemediation;\n /** RFC 9457 extensions (`issues`, `actualVersion`, …). */\n [extension: string]: unknown;\n}\n\n/** Structural check: `title` + a 4xx/5xx status. `code` is optional. */\nexport function isProblem(value: unknown): value is Problem {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return (\n typeof v.title === \"string\" &&\n typeof v.status === \"number\" &&\n Number.isInteger(v.status) &&\n v.status >= 400 &&\n v.status <= 599 &&\n (v.code === undefined || typeof v.code === \"string\")\n );\n}\n\n/**\n * Find the problem a caught value carries — the value itself, one typed onto\n * an error as a `problem` field (dashboard's `ApiError` shape), or one\n * wrapped in an `Error` `cause` chain (how fetch layers usually rethrow a\n * parsed body). Returns `null` when there is none.\n */\nexport function parseProblem(error: unknown): Problem | null {\n let current: unknown = error;\n for (\n let depth = 0;\n depth < 8 && typeof current === \"object\" && current !== null;\n depth++\n ) {\n if (isProblem(current)) return current;\n const carried = (current as { problem?: unknown }).problem;\n if (isProblem(carried)) return carried;\n current = (current as { cause?: unknown }).cause;\n }\n return null;\n}\n\nexport interface ErrorDescription {\n /** Short name of the failure — the problem `title`, or a generic fallback. */\n title: string;\n /** Sentence(s) to show — `detail` and `remediation.action` joined. */\n description?: string;\n /** Docs URL from `remediation.documentation`. */\n documentation?: string;\n /** Correlation id for support. */\n requestId?: string;\n /** The matched problem, when the input carried one. */\n problem?: Problem;\n}\n\n/**\n * Anything that isn't a problem renders as this — raw `Error` messages are\n * not contract copy and never shown (the same fail-closed stance as the\n * server side of `@photon-hq/error`). Always a full sentence (trailing\n * period).\n */\nexport const GENERIC_ERROR_TITLE = \"Something went wrong.\";\n\n/** Standard reason phrases for statuses we commonly surface without a body. */\nconst HTTP_REASON_PHRASE: Record<number, string> = {\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 413: \"Payload Too Large\",\n 415: \"Unsupported Media Type\",\n 422: \"Unprocessable Entity\",\n 429: \"Too Many Requests\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n};\n\n/** One-sentence explanations when the server gave a status but no problem copy. */\nconst HTTP_STATUS_EXPLANATION: Record<number, string> = {\n 400: \"The request was malformed or incomplete.\",\n 401: \"You need to sign in again.\",\n 403: \"You don't have permission to do that.\",\n 404: \"The requested resource was not found.\",\n 408: \"The request timed out before the server responded.\",\n 409: \"The request conflicts with the current state.\",\n 410: \"That resource is no longer available.\",\n 413: \"The request was too large for the server to accept.\",\n 415: \"That media type isn't supported.\",\n 422: \"The request was understood but couldn't be processed.\",\n 429: \"Request rate limit exceeded. Wait a moment before trying again.\",\n 500: \"The server hit an unexpected error.\",\n 501: \"The server doesn't support that operation.\",\n 502: \"The gateway got an invalid response from an upstream server.\",\n 503: \"The service is temporarily unavailable.\",\n 504: \"The gateway timed out waiting for an upstream server.\",\n};\n\nfunction hasContractCode(problem: Problem): boolean {\n return typeof problem.code === \"string\" && problem.code !== \"\";\n}\n\n/** Reason phrase for a status — map first, then a non-generic `problem.title`. */\nexport function httpReasonPhrase(\n status: number,\n fallbackTitle?: string,\n): string | undefined {\n if (HTTP_REASON_PHRASE[status]) return HTTP_REASON_PHRASE[status];\n if (\n fallbackTitle &&\n fallbackTitle !== GENERIC_ERROR_TITLE &&\n fallbackTitle !== \"Request failed\"\n ) {\n return fallbackTitle.replace(/\\.$/, \"\");\n }\n return undefined;\n}\n\n/** Human sentence for a bare HTTP status, when the body carried no copy. */\nexport function httpStatusExplanation(status: number): string {\n return (\n HTTP_STATUS_EXPLANATION[status] ??\n \"The request failed with an unexpected status.\"\n );\n}\n\n/**\n * Sentence-case the first character. Server `detail` / `title` sometimes\n * arrive fully lowercase; UI copy always leads with a capital.\n */\nexport function capitalizeFirst(text: string): string {\n if (!text) return text;\n const first = text.charAt(0);\n const upper = first.toUpperCase();\n if (first === upper) return text;\n return upper + text.slice(1);\n}\n\n/**\n * Turn a caught value into displayable copy. `Error` and `ErrorView` call\n * this internally; use it directly for other surfaces (a toast, a banner).\n *\n * Status-only failures (HTTP not ok, but no contract `code` / copy) still\n * keep `problem` so the details panel can show the status. Title becomes the\n * reason phrase (e.g. \"Bad Gateway\"); description is a short explanation —\n * not just the numeric code.\n */\nexport function describeError(error: unknown): ErrorDescription {\n const problem = parseProblem(error);\n if (problem == null) return { title: GENERIC_ERROR_TITLE };\n\n const description =\n [problem.detail, problem.remediation?.action]\n .filter((part): part is string => typeof part === \"string\" && part !== \"\")\n .join(\" \") || undefined;\n\n if (!hasContractCode(problem) && description == null) {\n const reason = httpReasonPhrase(problem.status, problem.title);\n return {\n title: capitalizeFirst(reason ?? GENERIC_ERROR_TITLE),\n description: httpStatusExplanation(problem.status),\n requestId: problem.requestId,\n problem,\n };\n }\n\n return {\n title: capitalizeFirst(problem.title || GENERIC_ERROR_TITLE),\n description: description ? capitalizeFirst(description) : undefined,\n documentation: problem.remediation?.documentation,\n requestId: problem.requestId,\n problem,\n };\n}\n","import {\n useEffect,\n useRef,\n useState,\n type ComponentProps,\n type ReactNode,\n} from \"react\";\nimport {\n IconAlertCircleFilled,\n IconAlertTriangle,\n IconAlertTriangleFilled,\n IconInfoCircle,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button, ButtonLink } from \"../button/button\";\nimport { Popover } from \"../popover/popover\";\nimport { StatusView, type StatusViewSize } from \"../status-view/status-view\";\nimport {\n capitalizeFirst,\n describeError,\n httpReasonPhrase,\n type ErrorDescription,\n} from \"./problem\";\n\n/** Capitalize string copy; leave custom ReactNode overrides alone. */\nfunction displayCopy(value: ReactNode): ReactNode {\n return typeof value === \"string\" ? capitalizeFirst(value) : value;\n}\n\n/**\n * Design notes:\n * - ONE input: `error` is the caught value, whatever it is — a Problem\n * Details body from `@photon-hq/error`, an `Error` carrying one as\n * `cause`, or something unknown. The component derives its copy via\n * `describeError`; unknowns fall back to a generic line rather than\n * leaking raw messages.\n * - TWO presentations, one per altitude: `Error` is the inline line for\n * forms, cards, and action rows; `ErrorView` is the region / page state\n * built on StatusView (same `sm` / `base` size axis).\n * - Both render `null` when there is nothing to show, so they can sit\n * unconditionally in JSX (`<Error error={mutation.error} />`).\n * - `Warning` is the inline line's second state: the same row in warning\n * ink, for something the user may go ahead with but should look at\n * twice. It never blocks, so it takes its copy and nothing else.\n * - Client-side *validation* is not this component's job — that belongs to\n * `Field.Error`, wired to control validity.\n */\n\nconst DOC_LINK_LABEL = \"Learn more\";\nconst RETRY_LABEL = \"Try again\";\n\ninterface ErrorBaseProps {\n /** The caught value — a problem body, an `Error` wrapping one, or unknown. */\n error?: unknown;\n /** Override the derived message. */\n children?: ReactNode;\n}\n\nexport interface ErrorProps\n extends ErrorBaseProps, Omit<ComponentProps<\"div\">, keyof ErrorBaseProps> {}\n\n/**\n * Error — one line of red ink naming a server failure (4xx / 5xx), placed\n * inline: under a form, in a card, beside the action that failed. Give it the\n * caught value and it renders the problem's `detail` (falling back to `title`,\n * then to a generic line), plus a docs link when the problem carries one.\n * Renders nothing while `error` is nullish, so it can stay mounted.\n *\n * For a region or page that failed to load, use {@link ErrorView}.\n */\nexport function Error({ error, children, className, ...props }: ErrorProps) {\n if (error == null && children == null) return null;\n const copy = describeError(error);\n return (\n <div\n role=\"alert\"\n className={cn(\n \"text-pho-error flex min-w-0 items-start gap-1.5 text-base\",\n className,\n )}\n {...props}\n >\n <span aria-hidden className=\"flex h-[1lh] shrink-0 items-center\">\n <IconAlertCircleFilled className=\"size-4\" />\n </span>\n <span className=\"min-w-0\">\n {displayCopy(children ?? copy.description ?? copy.title)}\n {copy.documentation != null && (\n <>\n {\" \"}\n <a\n href={copy.documentation}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"font-medium underline underline-offset-2\"\n >\n {DOC_LINK_LABEL}\n </a>\n </>\n )}\n {/* Trailing whitespace collapses when the details render null. */}{\" \"}\n <ErrorDetails copy={copy} />\n </span>\n </div>\n );\n}\n\nError.displayName = \"Error\";\n\nexport interface WarningProps extends Omit<\n ComponentProps<\"output\">,\n \"children\"\n> {\n /** What to look at twice. Shows nothing while nullish. */\n children?: ReactNode;\n}\n\n/**\n * Warning — the inline `Error` line in warning ink, a triangle in place of\n * the circle: something the user can go ahead with but may not mean (an\n * address outside the team, a value that differs from the usual one). Same\n * row, glyph seat and type as `Error`, so the two can take turns in one\n * place. It doesn't stop anything, so it announces politely (an `output`,\n * role `status`) and carries no details disclosure.\n *\n * A polite region is announced when its content changes, not when it is\n * inserted, so the `output` stays mounted while the copy is nullish:\n * empty and `sr-only`, the way pho-ui's other live regions sit, it keeps\n * its role and, out of flow, adds no gap to a stack.\n */\nexport function Warning({ children, className, ...props }: WarningProps) {\n // `{cond && copy}` leaves false behind: no copy either.\n const shown = children != null && children !== false && children !== \"\";\n return (\n <output\n className={\n shown\n ? cn(\n \"text-pho-warning flex min-w-0 items-start gap-1.5 text-base\",\n className,\n )\n : \"sr-only\"\n }\n {...props}\n >\n {shown && (\n <>\n <span aria-hidden className=\"flex h-[1lh] shrink-0 items-center\">\n <IconAlertTriangleFilled className=\"size-4\" />\n </span>\n <span className=\"min-w-0\">{displayCopy(children)}</span>\n </>\n )}\n </output>\n );\n}\n\nWarning.displayName = \"Warning\";\n\n/**\n * Hover / focus disclosure on the inline line — the request's fuller story:\n * problem `title` (with the same alert icon + `text-pho-error` ink as the\n * inline line), the untruncated description, then `status` + `code` and the\n * copyable request id grouped below for a support handoff. Renders only when\n * the caught value actually carried a problem (or at least a request id); a\n * generic unknown has nothing more to disclose. Built on `Popover` rather\n * than `Tooltip` because the panel holds an interactive control (the copy\n * button) — `openOnHover` keeps the tooltip-like gesture.\n */\nfunction ErrorDetails({ copy }: { copy: ErrorDescription }) {\n const { problem, requestId } = copy;\n if (problem == null && requestId == null) return null;\n\n // Contract problems show `status CODE`; status-only shows `status Reason`.\n let statusLine: string | null = null;\n if (problem != null) {\n if (problem.code) {\n statusLine = `${problem.status} ${problem.code}`;\n } else {\n const reason = httpReasonPhrase(problem.status, problem.title);\n statusLine = reason\n ? `${problem.status} ${reason}`\n : String(problem.status);\n }\n }\n\n return (\n <Popover.Root>\n <Popover.Trigger\n openOnHover\n delay={150}\n aria-label=\"Error details\"\n className=\"outline-pho-brand inline-flex size-4 shrink-0 translate-y-[3px] cursor-help items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-2\"\n >\n <IconInfoCircle className=\"size-3.5\" />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner align=\"start\">\n <Popover.Popup className=\"text-pho-error\">\n <Popover.Title className=\"text-pho-error flex items-start gap-1.5\">\n <span aria-hidden className=\"flex h-[1lh] shrink-0 items-center\">\n <IconAlertCircleFilled className=\"size-4\" />\n </span>\n {copy.title}\n </Popover.Title>\n {copy.description != null && (\n <Popover.Description className=\"text-pho-error\">\n {copy.description}\n </Popover.Description>\n )}\n {(statusLine != null || requestId != null) && (\n <div className=\"text-pho-error mt-1 font-mono text-[10px] leading-snug\">\n {statusLine != null && <p>{statusLine}</p>}\n {requestId != null && (\n <RequestId requestId={requestId} className=\"mt-0\" />\n )}\n </div>\n )}\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n\n/** Request-id footnote — click copies the id for support handoff. */\nfunction RequestId({\n requestId,\n className,\n}: {\n requestId: string;\n className?: string;\n}) {\n const [copied, setCopied] = useState(false);\n const copiedTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (copiedTimer.current) clearTimeout(copiedTimer.current);\n },\n [],\n );\n\n return (\n <span\n className={cn(\"mt-1 block font-mono text-[10px] leading-snug\", className)}\n >\n Request ID:{\" \"}\n <button\n type=\"button\"\n className=\"outline-pho-brand inline cursor-pointer underline-offset-2 select-all hover:underline focus-visible:underline focus-visible:outline-2 focus-visible:-outline-offset-1\"\n aria-label={\n copied ? \"Request ID copied\" : `Copy request ID ${requestId}`\n }\n onClick={async () => {\n try {\n await navigator.clipboard.writeText(requestId);\n } catch {\n return;\n }\n setCopied(true);\n if (copiedTimer.current) clearTimeout(copiedTimer.current);\n copiedTimer.current = setTimeout(() => setCopied(false), 1500);\n }}\n >\n {requestId}\n </button>\n <output className=\"sr-only\" aria-live=\"polite\">\n {copied ? \"Copied\" : \"\"}\n </output>\n </span>\n );\n}\n\ninterface ErrorViewBaseProps {\n /** The caught value — a problem body, an `Error` wrapping one, or unknown. */\n error?: unknown;\n /** Override the derived title. */\n title?: ReactNode;\n /** Override the derived description. */\n description?: ReactNode;\n /** Override the warning glyph. */\n icon?: ReactNode;\n /** Offer a retry — renders a \"Try again\" button. */\n onRetry?: () => void;\n /** Replace the built-in action row entirely. */\n actions?: ReactNode;\n /** Size variant — StatusView's axis. @default \"base\" */\n size?: StatusViewSize;\n}\n\nexport interface ErrorViewProps\n extends\n ErrorViewBaseProps,\n Omit<ComponentProps<\"div\">, keyof ErrorViewBaseProps | \"children\"> {}\n\n/**\n * ErrorView — the failed state of a region or page, built on StatusView:\n * warning icon over the problem's `title`, its `detail` and remediation\n * below, an action row (`onRetry` and the problem's docs link), and the\n * request id as a footnote for support. Announces via `role=\"alert\"`.\n *\n * Use `size=\"sm\"` inside cards and panels, the default `base` for whole\n * pages. Renders nothing while `error` is nullish (unless given a static\n * `title`), so it can sit unconditionally next to a query.\n */\nexport function ErrorView({\n error,\n title,\n description,\n icon,\n onRetry,\n actions,\n size = \"base\",\n ...props\n}: ErrorViewProps) {\n if (error == null && title == null) return null;\n const copy = describeError(error);\n\n const resolvedDescription = displayCopy(description ?? copy.description);\n const body =\n resolvedDescription != null || copy.requestId != null ? (\n <>\n {resolvedDescription}\n {copy.requestId != null && <RequestId requestId={copy.requestId} />}\n </>\n ) : undefined;\n\n const resolvedActions =\n actions ??\n (onRetry != null || copy.documentation != null ? (\n <>\n {onRetry != null && (\n <Button size=\"sm\" onClick={onRetry}>\n {RETRY_LABEL}\n </Button>\n )}\n {copy.documentation != null && (\n <ButtonLink\n size=\"sm\"\n variant=\"outlined\"\n href={copy.documentation}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n {DOC_LINK_LABEL}\n </ButtonLink>\n )}\n </>\n ) : undefined);\n\n return (\n <StatusView\n role=\"alert\"\n size={size}\n icon={icon ?? <IconAlertTriangle />}\n title={displayCopy(title ?? copy.title)}\n description={body}\n actions={resolvedActions}\n {...props}\n />\n );\n}\n\nErrorView.displayName = \"ErrorView\";\n"],"igno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A,UAAA,CACG+D,KAAW,QACV,gBAAAjD,EAACZ,GAAD;AAAA,IAAQ,MAAK;AAAA,IAAK,SAAS6D;AAAA,IACxB,UAAAnB;AAAA,EACK,CAAA,GAETK,EAAK,iBAAiB,QACrB,gBAAAnC,EAACX,GAAD;AAAA,IACE,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,MAAM8C,EAAK;AAAA,IACX,QAAO;AAAA,IACP,KAAI;AAAA,IAEH,UAAAN;AAAA,EACS,CAAA,CAEd,EAAA,CAAA,IACA;AAEN,SACE,gBAAA7B,EAACL,GAAD;AAAA,IACE,MAAK;AAAA,IACC,MAAAwD;AAAA,IACN,MAAMH,KAAQ,gBAAAhD,EAACG,GAAD,CAAoB,CAAA;AAAA,IAClC,OAAOyB,EAAYmB,KAASZ,EAAK,KAAK;AAAA,IACtC,aAAakB;AAAA,IACb,SAASC;AAAA,IACT,GAAIpB;AAAA,EACL,CAAA;AAEL;AAEAY,EAAU,cAAc"}
@@ -4,7 +4,7 @@ import { n as k } from "./link-provider-DXzDQ08N.js";
4
4
  import { n as j } from "./use-copy-D6JwKUll.js";
5
5
  import { n as O } from "./spinner-BSutFL4l.js";
6
6
  import { a as A } from "./button-CLfWdqm-.js";
7
- import { i as D } from "./status-view-I_Y6eEyX.js";
7
+ import { i as D } from "./status-view-Buhh1UBJ.js";
8
8
  import { t as g } from "./skeleton-CqZlGphn.js";
9
9
  import { t as h } from "./tooltip-4J1PUJmB.js";
10
10
  import { r as E } from "./badge-CVViIYj_.js";
@@ -241,4 +241,4 @@ export {
241
241
  pe as t
242
242
  };
243
243
 
244
- //# sourceMappingURL=log-list-QbSYHZu3.js.map
244
+ //# sourceMappingURL=log-list-BqaJv2oA.js.map