@photon-ai/pho-ui 4.22.0 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{basic-page-BYA1lkzf.js → basic-page-DnB4YSRj.js} +4 -4
- package/dist/chunks/basic-page-DnB4YSRj.js.map +1 -0
- package/dist/chunks/{chat-j7XEdKEo.js → chat-C5W6L_Jg.js} +4 -4
- package/dist/chunks/chat-C5W6L_Jg.js.map +1 -0
- package/dist/chunks/{dialog-CDL6qY2a.js → dialog-e4_mOYGp.js} +5 -5
- package/dist/chunks/dialog-e4_mOYGp.js.map +1 -0
- package/dist/chunks/{error-BZU9vgnj.js → error-BjSn7wLu.js} +2 -2
- package/dist/chunks/{error-BZU9vgnj.js.map → error-BjSn7wLu.js.map} +1 -1
- package/dist/chunks/{log-list-QbSYHZu3.js → log-list-BqaJv2oA.js} +2 -2
- package/dist/chunks/{log-list-QbSYHZu3.js.map → log-list-BqaJv2oA.js.map} +1 -1
- package/dist/chunks/{status-view-I_Y6eEyX.js → status-view-Buhh1UBJ.js} +2 -2
- package/dist/chunks/status-view-Buhh1UBJ.js.map +1 -0
- package/dist/components/chat.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +5 -5
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/error.js +1 -1
- package/dist/components/field.js +26 -24
- package/dist/components/field.js.map +1 -1
- package/dist/components/log-list.js +1 -1
- package/dist/components/notification.js +1 -1
- package/dist/components/notification.js.map +1 -1
- package/dist/components/scope.js +1 -1
- package/dist/components/scope.js.map +1 -1
- package/dist/components/status-view.js +1 -1
- package/dist/index.js +6 -6
- package/dist/sections/basic-page.js +1 -1
- package/dist/src/components/drawer/drawer.d.ts +1 -0
- package/dist/src/components/field/field.d.ts +10 -2
- package/dist/src/components/status-view/status-view.d.ts +4 -3
- package/package.json +1 -1
- package/dist/chunks/basic-page-BYA1lkzf.js.map +0 -1
- package/dist/chunks/chat-j7XEdKEo.js.map +0 -1
- package/dist/chunks/dialog-CDL6qY2a.js.map +0 -1
- package/dist/chunks/status-view-I_Y6eEyX.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-list-QbSYHZu3.js","names":["_Fragment","cn","useLinkComponent","useCopy","Spinner","Button","StatusView","Skeleton","Tooltip","Badge","useEffect","useId","useRef","Fragment$1","jsx","jsxs","useRender","LOG_LIST_SURFACE","ID_HEAD","ID_TAIL","truncateMiddle","value","head","tail","SUCCESS_WORDS","ERROR_WORDS","WARNING_WORDS","logStatusColor","status","word","logStatusLabel","Status","label","size","className","props","Method","IdCell","id","cellId","copied","copy","Row","method","code","description","duration","time","children","href","onClick","render","current","Link","base","interactive","cellIds","hasMeta","describedBy","primary","Empty","title","Loading","rows","_","index","LoadMore","onLoadMore","loading","hasMore","rootMargin","ref","latest","el","observer","entries","entry","Root","LogList"],"sources":["../../src/components/log-list/log-list.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useRef,\n type ComponentProps,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { Badge, type BadgeColor, type BadgeSize } from \"../badge\";\nimport { Button } from \"../button\";\nimport { Skeleton } from \"../skeleton\";\nimport { Spinner } from \"../spinner\";\nimport { StatusView } from \"../status-view\";\nimport { Tooltip } from \"../tooltip\";\nimport { cn } from \"../../utils/cn\";\nimport { useCopy } from \"../../utils/use-copy\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\n\n/**\n * Log List — rows of requests, deliveries, or messages, newest first,\n * each one line: a mono id you can copy, a status, the method, what\n * happened, and how long ago. Reach for it where a `DataTable` would be\n * columns of the same few fields: a log reads left to right as one line,\n * and the page filters it from a `FilterBar` pinned above.\n *\n * Design notes:\n * - The surface is `BasicPage.Card`'s: hairline border, `base` radius,\n * hairline rules between rows. It sits in a `Stack` as any card does.\n * - The row is one link (or one button). It stretches over the row from\n * the label, the way a `DataTable` row's does, so the whole row is one\n * pointer target and one tab stop; the copy control sits above it.\n * - The id truncates in the middle, keeping the prefix that says what it\n * is and the tail that tells it apart. The full id is a tooltip away,\n * and one click copies it.\n * - `LoadMore` is the sentinel at the end: it asks for the next page as\n * it scrolls into view, and offers a button for keyboards and for\n * browsers without an observer.\n */\n\n/** Same chrome as `BasicPage.Card`. */\nconst LOG_LIST_SURFACE =\n \"rounded-base border border-pho-secondary bg-pho-primary divide-y divide-pho-secondary\";\n\n/** Middle truncation: the prefix and this many after it, then the tail. */\nconst ID_HEAD = 12;\nconst ID_TAIL = 5;\n\n/**\n * Keep the start and the end of an id and fold the middle into an\n * ellipsis — `pho_req_01m04axjqrfzxv4xjet40a84gb` reads\n * `pho_req_01m0…a84gb`. Ids that fit are returned whole.\n */\nexport function truncateMiddle(\n value: string,\n head = ID_HEAD,\n tail = ID_TAIL,\n): string {\n if (value.length <= head + tail + 1) return value;\n return `${value.slice(0, head)}…${value.slice(-tail)}`;\n}\n\n/* -------------------------------- status -------------------------------- */\n\nconst SUCCESS_WORDS = new Set([\n \"success\",\n \"succeeded\",\n \"successful\",\n \"delivered\",\n \"ok\",\n \"sent\",\n \"received\",\n \"completed\",\n \"complete\",\n \"done\",\n \"active\",\n]);\nconst ERROR_WORDS = new Set([\n \"failed\",\n \"failure\",\n \"error\",\n \"errored\",\n \"rejected\",\n \"undelivered\",\n \"timeout\",\n \"timed_out\",\n \"timed out\",\n \"canceled\",\n \"cancelled\",\n]);\nconst WARNING_WORDS = new Set([\n \"pending\",\n \"queued\",\n \"retrying\",\n \"processing\",\n \"sending\",\n \"in_progress\",\n \"in progress\",\n \"scheduled\",\n \"waiting\",\n]);\n\n/**\n * The `Badge` color for a log status: an HTTP status code (2xx success,\n * 3xx gray, 4xx warning, 5xx error) or a word (`delivered` / `failed` /\n * `pending`). Anything else is gray.\n */\nexport function logStatusColor(status: number | string): BadgeColor {\n if (typeof status === \"number\") {\n if (status < 300) return \"success\";\n if (status < 400) return \"gray\";\n if (status < 500) return \"warning\";\n return \"error\";\n }\n const word = status.trim().toLowerCase();\n if (/^\\d{3}$/.test(word)) return logStatusColor(Number(word));\n if (SUCCESS_WORDS.has(word)) return \"success\";\n if (ERROR_WORDS.has(word)) return \"error\";\n if (WARNING_WORDS.has(word)) return \"warning\";\n return \"gray\";\n}\n\n/** A status word as a label: `timed_out` reads `Timed out`. */\nexport function logStatusLabel(status: number | string): string {\n if (typeof status === \"number\") return String(status);\n const word = status.trim().replace(/_/g, \" \");\n return word.charAt(0).toUpperCase() + word.slice(1);\n}\n\nexport interface LogStatusProps extends Omit<\n ComponentProps<\"span\">,\n \"children\" | \"color\"\n> {\n /** An HTTP status code or a status word. */\n value: number | string;\n /** Override the derived word. */\n label?: ReactNode;\n /** Badge size. @default \"sm\" */\n size?: BadgeSize;\n}\n\n/** The status slot — a low-contrast `Badge` colored by `logStatusColor`. */\nfunction Status({\n value,\n label,\n size = \"sm\",\n className,\n ...props\n}: LogStatusProps) {\n return (\n <Badge\n color={logStatusColor(value)}\n contrast=\"low\"\n size={size}\n className={cn(\"tabular-nums\", className)}\n {...props}\n >\n {label ?? logStatusLabel(value)}\n </Badge>\n );\n}\n\n/** The method slot — `POST`, `GET` as a quiet mono chip. */\nfunction Method({\n className,\n ...props\n}: ComponentProps<\"span\"> & { ref?: Ref<HTMLSpanElement> }) {\n return (\n <span\n className={cn(\n \"bg-pho-secondary text-pho-secondary inline-flex h-5 min-w-12 shrink-0 items-center justify-center rounded-sm px-1.5 font-mono text-xs font-medium whitespace-nowrap\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------- id ---------------------------------- */\n\n/**\n * The id cell: a mono button that copies the full id, with a tooltip\n * holding the whole of it. The cell is a fixed width in characters so\n * ids line up down the list.\n */\nfunction IdCell({ id, cellId }: { id: string; cellId: string }) {\n const { copied, copy } = useCopy();\n return (\n <Tooltip.Root>\n <Tooltip.Trigger\n id={cellId}\n aria-label={copied ? `${id} copied` : `Copy ${id}`}\n data-copied={copied || undefined}\n onClick={() => void copy(id)}\n className={cn(\n \"text-pho-secondary outline-pho-brand hover:text-pho-primary relative z-10 -mx-1 w-[calc(18ch+0.5rem)] shrink-0 cursor-pointer truncate rounded-sm px-1 py-0.5 text-left font-mono text-xs transition-colors duration-100 ease-linear focus-visible:outline-2\",\n \"data-[copied]:text-pho-success\",\n )}\n >\n {copied ? \"Copied\" : truncateMiddle(id)}\n </Tooltip.Trigger>\n <output className=\"sr-only\" aria-live=\"polite\">\n {copied ? \"Copied\" : \"\"}\n </output>\n <Tooltip.Portal>\n <Tooltip.Positioner>\n <Tooltip.Popup className=\"font-mono\">{id}</Tooltip.Popup>\n </Tooltip.Positioner>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n}\n\n/* ---------------------------------- row --------------------------------- */\n\nexport interface LogListRowProps extends Omit<\n ComponentProps<\"div\">,\n \"children\" | \"title\" | \"onClick\" | \"id\"\n> {\n /** The record's id — mono, middle-truncated, copied on click. */\n id?: string;\n /** The status slot — usually `LogList.Status`. */\n status?: ReactNode;\n /** The method — `POST`, `GET`; rendered in `LogList.Method`. */\n method?: string;\n /** What happened — the route, the event type, the message. */\n label: ReactNode;\n /** The label in mono — for a route or an event type. */\n code?: boolean;\n /**\n * The line under the label, with real content: who received what from\n * whom, the destination that answered. A sentence, with its period.\n */\n description?: ReactNode;\n /** Trailing: how long it took — \"59 ms\". */\n duration?: ReactNode;\n /** Trailing: when — \"2 min ago\". */\n time?: ReactNode;\n /** Trailing content before the duration and time. */\n children?: ReactNode;\n /** The row is a link to its page, through the host's `LinkProvider`. */\n href?: string;\n /** The row is a button. */\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n /**\n * Replace the row's link element — a router's `Link`, the way Base UI\n * components take `render`. The row's classes and handlers merge in.\n */\n render?: useRender.RenderProp;\n /** The row whose page is open beside the list — it keeps the wash. */\n current?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction Row({\n id,\n status,\n method,\n label,\n code,\n description,\n duration,\n time,\n children,\n href,\n onClick,\n render,\n current,\n className,\n ...props\n}: LogListRowProps) {\n const Link = useLinkComponent();\n const base = useId();\n const interactive = href != null || onClick != null || render != null;\n const cellIds = {\n id: `${base}-id`,\n status: `${base}-status`,\n method: `${base}-method`,\n meta: `${base}-meta`,\n };\n const hasMeta = children != null || duration != null || time != null;\n const describedBy = [\n id != null && cellIds.id,\n status != null && cellIds.status,\n method != null && cellIds.method,\n hasMeta && cellIds.meta,\n ]\n .filter(Boolean)\n .join(\" \");\n const primary = useRender({\n render: render ?? (href != null ? <Link href={href} /> : undefined),\n defaultTagName: href != null ? \"a\" : onClick != null ? \"button\" : \"span\",\n props: {\n className: cn(\n \"text-pho-primary block min-w-0 max-w-full truncate text-left text-base font-medium outline-none\",\n code && \"font-mono text-xs\",\n // The one link, stretched over the row; the ring is the row's.\n interactive &&\n \"cursor-pointer after:absolute after:inset-0 after:content-['']\",\n ),\n onClick,\n type:\n render == null && href == null && onClick != null\n ? \"button\"\n : undefined,\n \"aria-current\": current ? \"page\" : undefined,\n \"aria-describedby\": describedBy || undefined,\n \"data-log-primary\": \"\",\n children: label,\n },\n });\n return (\n <div\n data-log-row=\"\"\n data-current={current || undefined}\n className={cn(\n \"relative flex min-h-12 min-w-0 items-center gap-3 px-5 py-2.5\",\n interactive &&\n \"hover:bg-pho-primary-hover outline-pho-brand transition-colors has-[[data-log-primary]:focus-visible]:outline-2 has-[[data-log-primary]:focus-visible]:-outline-offset-2\",\n current && \"bg-pho-primary-hover\",\n // The wash follows the card's rounding (minus the 1px border).\n \"first:rounded-t-[calc(var(--radius-base)-1px)] last:rounded-b-[calc(var(--radius-base)-1px)]\",\n className,\n )}\n {...props}\n >\n {id != null ? <IdCell id={id} cellId={cellIds.id} /> : null}\n {status != null ? (\n <span id={cellIds.status} className=\"flex shrink-0 items-center\">\n {status}\n </span>\n ) : null}\n {method != null ? <Method id={cellIds.method}>{method}</Method> : null}\n <div data-log-primary-cell=\"\" className=\"min-w-0 flex-1\">\n {primary}\n {description != null ? (\n <p className=\"text-pho-description truncate text-xs\">{description}</p>\n ) : null}\n </div>\n {hasMeta ? (\n <div\n id={cellIds.meta}\n className=\"text-pho-description ml-auto flex shrink-0 items-center gap-3 text-xs whitespace-nowrap tabular-nums\"\n >\n {children}\n {duration != null ? <span>{duration}</span> : null}\n {time != null ? <span>{time}</span> : null}\n </div>\n ) : null}\n </div>\n );\n}\n\n/* -------------------------------- states -------------------------------- */\n\nexport interface LogListEmptyProps extends Omit<\n ComponentProps<\"div\">,\n \"title\" | \"children\"\n> {\n /** One short line naming the state. @default \"Nothing here yet.\" */\n title?: ReactNode;\n /** What fills it, or why it is empty. */\n description?: ReactNode;\n /** An action, when there is one. */\n children?: ReactNode;\n}\n\n/** The list with no rows — `StatusView` at card size. */\nfunction Empty({\n title = \"Nothing here yet.\",\n description,\n children,\n className,\n ...props\n}: LogListEmptyProps) {\n return (\n <div className={cn(\"flex justify-center\", className)} {...props}>\n <StatusView\n size=\"sm\"\n title={title}\n description={description}\n actions={children}\n />\n </div>\n );\n}\n\n/** Bones in the rows' place while the first page is on its way. */\nfunction Loading({ rows = 5 }: { rows?: number }) {\n return (\n <>\n {Array.from({ length: rows }, (_, index) => (\n <div\n key={index}\n aria-hidden\n className=\"flex min-h-12 items-center gap-3 px-5 py-2.5\"\n >\n <Skeleton className=\"h-3.5 w-32\" />\n <Skeleton className=\"h-5 w-12 rounded-full\" />\n <Skeleton className=\"h-3.5 w-48\" />\n <Skeleton className=\"ml-auto h-3.5 w-16\" />\n </div>\n ))}\n </>\n );\n}\n\nexport interface LogListLoadMoreProps extends Omit<\n ComponentProps<\"div\">,\n \"children\"\n> {\n /** Asked for as the sentinel scrolls into view, and on the button. */\n onLoadMore: () => void;\n /** The next page is on its way — the sentinel shows a spinner and waits. */\n loading?: boolean;\n /** Nothing left to load — renders nothing. @default true */\n hasMore?: boolean;\n /** How far ahead of the viewport to ask. @default \"200px\" */\n rootMargin?: string;\n /** The button's words. @default \"Load more\" */\n label?: ReactNode;\n}\n\n/**\n * The sentinel at the end of the list. An `IntersectionObserver` asks for\n * the next page as it comes into view (`rootMargin` ahead of it); while\n * `loading` it shows a spinner and asks for nothing. The button is the\n * same request for keyboards and for a browser without the observer.\n * SSR-safe: the observer is created in an effect.\n */\nfunction LoadMore({\n onLoadMore,\n loading,\n hasMore = true,\n rootMargin = \"200px\",\n label = \"Load more\",\n className,\n ...props\n}: LogListLoadMoreProps) {\n const ref = useRef<HTMLDivElement | null>(null);\n const latest = useRef(onLoadMore);\n latest.current = onLoadMore;\n useEffect(() => {\n const el = ref.current;\n if (!hasMore || loading || el == null) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) latest.current();\n },\n { rootMargin },\n );\n observer.observe(el);\n return () => observer.disconnect();\n }, [hasMore, loading, rootMargin]);\n if (!hasMore) return null;\n return (\n <div\n ref={ref}\n data-log-load-more=\"\"\n aria-busy={loading || undefined}\n className={cn(\n \"flex min-h-12 items-center justify-center px-5 py-2\",\n className,\n )}\n {...props}\n >\n {loading ? (\n <Spinner aria-label=\"Loading more\" className=\"text-pho-secondary\" />\n ) : (\n <Button variant=\"ghost\" size=\"sm\" onClick={() => onLoadMore()}>\n {label}\n </Button>\n )}\n </div>\n );\n}\n\n/* ---------------------------------- root -------------------------------- */\n\nexport interface LogListRootProps extends ComponentProps<\"div\"> {\n ref?: Ref<HTMLDivElement>;\n}\n\n/** The card the rows stack in. Mark it `aria-busy` while bones show. */\nfunction Root({ className, ...props }: LogListRootProps) {\n return (\n <div\n data-log-list=\"\"\n className={cn(LOG_LIST_SURFACE, \"min-w-0\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Log List — a card of one-line log rows.\n *\n * ```tsx\n * <LogList.Root>\n * <LogList.Row\n * id=\"pho_req_01m04axjqrfzxv4xjet40a84gb\"\n * status={<LogList.Status value={200} />}\n * method=\"POST\"\n * code\n * label=\"/v1/messages\"\n * description=\"+1 332 259 3374 received a message from +1 332 222 1111.\"\n * duration=\"59 ms\"\n * time=\"2 min ago\"\n * href=\"/requests/pho_req_01m04axjqrfzxv4xjet40a84gb\"\n * />\n * <LogList.LoadMore onLoadMore={fetchNextPage} loading={isFetching} hasMore={hasNextPage} />\n * </LogList.Root>\n * ```\n */\nexport const LogList = {\n Root,\n Row,\n Status,\n Method,\n Empty,\n Loading,\n LoadMore,\n};\n"],"mappings":";;;;;;;;;;;;;AA0CA,IAAMiB,IACJ,yFAGIC,IAAU,IACVC,IAAU;AAOhB,SAAgBC,EACdC,GACAC,IAAOJ,GACPK,IAAOJ,GACC;AACR,SAAIE,EAAM,UAAUC,IAAOC,IAAO,IAAUF,IACrC,GAAGA,EAAM,MAAM,GAAGC,CAAI,CAAA,IAAKD,EAAM,MAAM,CAACE,CAAI,CAAA;AACrD;AAIA,IAAMC,IAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GACKC,IAAc,oBAAI,IAAI;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GACKC,IAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAOD,SAAgBC,EAAeC,GAAqC;AAClE,MAAI,OAAOA,KAAW;AACpB,WAAIA,IAAS,MAAY,YACrBA,IAAS,MAAY,SACrBA,IAAS,MAAY,YAClB;AAET,QAAMC,IAAOD,EAAO,KAAK,EAAE,YAAY;AACvC,SAAI,UAAU,KAAKC,CAAI,IAAUF,EAAe,OAAOE,C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A,EACA,SAAAE;AAAA,EACA,UAAAI;AACF"}
|
|
1
|
+
{"version":3,"file":"log-list-BqaJv2oA.js","names":["_Fragment","cn","useLinkComponent","useCopy","Spinner","Button","StatusView","Skeleton","Tooltip","Badge","useEffect","useId","useRef","Fragment$1","jsx","jsxs","useRender","LOG_LIST_SURFACE","ID_HEAD","ID_TAIL","truncateMiddle","value","head","tail","SUCCESS_WORDS","ERROR_WORDS","WARNING_WORDS","logStatusColor","status","word","logStatusLabel","Status","label","size","className","props","Method","IdCell","id","cellId","copied","copy","Row","method","code","description","duration","time","children","href","onClick","render","current","Link","base","interactive","cellIds","hasMeta","describedBy","primary","Empty","title","Loading","rows","_","index","LoadMore","onLoadMore","loading","hasMore","rootMargin","ref","latest","el","observer","entries","entry","Root","LogList"],"sources":["../../src/components/log-list/log-list.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useRef,\n type ComponentProps,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { Badge, type BadgeColor, type BadgeSize } from \"../badge\";\nimport { Button } from \"../button\";\nimport { Skeleton } from \"../skeleton\";\nimport { Spinner } from \"../spinner\";\nimport { StatusView } from \"../status-view\";\nimport { Tooltip } from \"../tooltip\";\nimport { cn } from \"../../utils/cn\";\nimport { useCopy } from \"../../utils/use-copy\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\n\n/**\n * Log List — rows of requests, deliveries, or messages, newest first,\n * each one line: a mono id you can copy, a status, the method, what\n * happened, and how long ago. Reach for it where a `DataTable` would be\n * columns of the same few fields: a log reads left to right as one line,\n * and the page filters it from a `FilterBar` pinned above.\n *\n * Design notes:\n * - The surface is `BasicPage.Card`'s: hairline border, `base` radius,\n * hairline rules between rows. It sits in a `Stack` as any card does.\n * - The row is one link (or one button). It stretches over the row from\n * the label, the way a `DataTable` row's does, so the whole row is one\n * pointer target and one tab stop; the copy control sits above it.\n * - The id truncates in the middle, keeping the prefix that says what it\n * is and the tail that tells it apart. The full id is a tooltip away,\n * and one click copies it.\n * - `LoadMore` is the sentinel at the end: it asks for the next page as\n * it scrolls into view, and offers a button for keyboards and for\n * browsers without an observer.\n */\n\n/** Same chrome as `BasicPage.Card`. */\nconst LOG_LIST_SURFACE =\n \"rounded-base border border-pho-secondary bg-pho-primary divide-y divide-pho-secondary\";\n\n/** Middle truncation: the prefix and this many after it, then the tail. */\nconst ID_HEAD = 12;\nconst ID_TAIL = 5;\n\n/**\n * Keep the start and the end of an id and fold the middle into an\n * ellipsis — `pho_req_01m04axjqrfzxv4xjet40a84gb` reads\n * `pho_req_01m0…a84gb`. Ids that fit are returned whole.\n */\nexport function truncateMiddle(\n value: string,\n head = ID_HEAD,\n tail = ID_TAIL,\n): string {\n if (value.length <= head + tail + 1) return value;\n return `${value.slice(0, head)}…${value.slice(-tail)}`;\n}\n\n/* -------------------------------- status -------------------------------- */\n\nconst SUCCESS_WORDS = new Set([\n \"success\",\n \"succeeded\",\n \"successful\",\n \"delivered\",\n \"ok\",\n \"sent\",\n \"received\",\n \"completed\",\n \"complete\",\n \"done\",\n \"active\",\n]);\nconst ERROR_WORDS = new Set([\n \"failed\",\n \"failure\",\n \"error\",\n \"errored\",\n \"rejected\",\n \"undelivered\",\n \"timeout\",\n \"timed_out\",\n \"timed out\",\n \"canceled\",\n \"cancelled\",\n]);\nconst WARNING_WORDS = new Set([\n \"pending\",\n \"queued\",\n \"retrying\",\n \"processing\",\n \"sending\",\n \"in_progress\",\n \"in progress\",\n \"scheduled\",\n \"waiting\",\n]);\n\n/**\n * The `Badge` color for a log status: an HTTP status code (2xx success,\n * 3xx gray, 4xx warning, 5xx error) or a word (`delivered` / `failed` /\n * `pending`). Anything else is gray.\n */\nexport function logStatusColor(status: number | string): BadgeColor {\n if (typeof status === \"number\") {\n if (status < 300) return \"success\";\n if (status < 400) return \"gray\";\n if (status < 500) return \"warning\";\n return \"error\";\n }\n const word = status.trim().toLowerCase();\n if (/^\\d{3}$/.test(word)) return logStatusColor(Number(word));\n if (SUCCESS_WORDS.has(word)) return \"success\";\n if (ERROR_WORDS.has(word)) return \"error\";\n if (WARNING_WORDS.has(word)) return \"warning\";\n return \"gray\";\n}\n\n/** A status word as a label: `timed_out` reads `Timed out`. */\nexport function logStatusLabel(status: number | string): string {\n if (typeof status === \"number\") return String(status);\n const word = status.trim().replace(/_/g, \" \");\n return word.charAt(0).toUpperCase() + word.slice(1);\n}\n\nexport interface LogStatusProps extends Omit<\n ComponentProps<\"span\">,\n \"children\" | \"color\"\n> {\n /** An HTTP status code or a status word. */\n value: number | string;\n /** Override the derived word. */\n label?: ReactNode;\n /** Badge size. @default \"sm\" */\n size?: BadgeSize;\n}\n\n/** The status slot — a low-contrast `Badge` colored by `logStatusColor`. */\nfunction Status({\n value,\n label,\n size = \"sm\",\n className,\n ...props\n}: LogStatusProps) {\n return (\n <Badge\n color={logStatusColor(value)}\n contrast=\"low\"\n size={size}\n className={cn(\"tabular-nums\", className)}\n {...props}\n >\n {label ?? logStatusLabel(value)}\n </Badge>\n );\n}\n\n/** The method slot — `POST`, `GET` as a quiet mono chip. */\nfunction Method({\n className,\n ...props\n}: ComponentProps<\"span\"> & { ref?: Ref<HTMLSpanElement> }) {\n return (\n <span\n className={cn(\n \"bg-pho-secondary text-pho-secondary inline-flex h-5 min-w-12 shrink-0 items-center justify-center rounded-sm px-1.5 font-mono text-xs font-medium whitespace-nowrap\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------- id ---------------------------------- */\n\n/**\n * The id cell: a mono button that copies the full id, with a tooltip\n * holding the whole of it. The cell is a fixed width in characters so\n * ids line up down the list.\n */\nfunction IdCell({ id, cellId }: { id: string; cellId: string }) {\n const { copied, copy } = useCopy();\n return (\n <Tooltip.Root>\n <Tooltip.Trigger\n id={cellId}\n aria-label={copied ? `${id} copied` : `Copy ${id}`}\n data-copied={copied || undefined}\n onClick={() => void copy(id)}\n className={cn(\n \"text-pho-secondary outline-pho-brand hover:text-pho-primary relative z-10 -mx-1 w-[calc(18ch+0.5rem)] shrink-0 cursor-pointer truncate rounded-sm px-1 py-0.5 text-left font-mono text-xs transition-colors duration-100 ease-linear focus-visible:outline-2\",\n \"data-[copied]:text-pho-success\",\n )}\n >\n {copied ? \"Copied\" : truncateMiddle(id)}\n </Tooltip.Trigger>\n <output className=\"sr-only\" aria-live=\"polite\">\n {copied ? \"Copied\" : \"\"}\n </output>\n <Tooltip.Portal>\n <Tooltip.Positioner>\n <Tooltip.Popup className=\"font-mono\">{id}</Tooltip.Popup>\n </Tooltip.Positioner>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n}\n\n/* ---------------------------------- row --------------------------------- */\n\nexport interface LogListRowProps extends Omit<\n ComponentProps<\"div\">,\n \"children\" | \"title\" | \"onClick\" | \"id\"\n> {\n /** The record's id — mono, middle-truncated, copied on click. */\n id?: string;\n /** The status slot — usually `LogList.Status`. */\n status?: ReactNode;\n /** The method — `POST`, `GET`; rendered in `LogList.Method`. */\n method?: string;\n /** What happened — the route, the event type, the message. */\n label: ReactNode;\n /** The label in mono — for a route or an event type. */\n code?: boolean;\n /**\n * The line under the label, with real content: who received what from\n * whom, the destination that answered. A sentence, with its period.\n */\n description?: ReactNode;\n /** Trailing: how long it took — \"59 ms\". */\n duration?: ReactNode;\n /** Trailing: when — \"2 min ago\". */\n time?: ReactNode;\n /** Trailing content before the duration and time. */\n children?: ReactNode;\n /** The row is a link to its page, through the host's `LinkProvider`. */\n href?: string;\n /** The row is a button. */\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n /**\n * Replace the row's link element — a router's `Link`, the way Base UI\n * components take `render`. The row's classes and handlers merge in.\n */\n render?: useRender.RenderProp;\n /** The row whose page is open beside the list — it keeps the wash. */\n current?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction Row({\n id,\n status,\n method,\n label,\n code,\n description,\n duration,\n time,\n children,\n href,\n onClick,\n render,\n current,\n className,\n ...props\n}: LogListRowProps) {\n const Link = useLinkComponent();\n const base = useId();\n const interactive = href != null || onClick != null || render != null;\n const cellIds = {\n id: `${base}-id`,\n status: `${base}-status`,\n method: `${base}-method`,\n meta: `${base}-meta`,\n };\n const hasMeta = children != null || duration != null || time != null;\n const describedBy = [\n id != null && cellIds.id,\n status != null && cellIds.status,\n method != null && cellIds.method,\n hasMeta && cellIds.meta,\n ]\n .filter(Boolean)\n .join(\" \");\n const primary = useRender({\n render: render ?? (href != null ? <Link href={href} /> : undefined),\n defaultTagName: href != null ? \"a\" : onClick != null ? \"button\" : \"span\",\n props: {\n className: cn(\n \"text-pho-primary block min-w-0 max-w-full truncate text-left text-base font-medium outline-none\",\n code && \"font-mono text-xs\",\n // The one link, stretched over the row; the ring is the row's.\n interactive &&\n \"cursor-pointer after:absolute after:inset-0 after:content-['']\",\n ),\n onClick,\n type:\n render == null && href == null && onClick != null\n ? \"button\"\n : undefined,\n \"aria-current\": current ? \"page\" : undefined,\n \"aria-describedby\": describedBy || undefined,\n \"data-log-primary\": \"\",\n children: label,\n },\n });\n return (\n <div\n data-log-row=\"\"\n data-current={current || undefined}\n className={cn(\n \"relative flex min-h-12 min-w-0 items-center gap-3 px-5 py-2.5\",\n interactive &&\n \"hover:bg-pho-primary-hover outline-pho-brand transition-colors has-[[data-log-primary]:focus-visible]:outline-2 has-[[data-log-primary]:focus-visible]:-outline-offset-2\",\n current && \"bg-pho-primary-hover\",\n // The wash follows the card's rounding (minus the 1px border).\n \"first:rounded-t-[calc(var(--radius-base)-1px)] last:rounded-b-[calc(var(--radius-base)-1px)]\",\n className,\n )}\n {...props}\n >\n {id != null ? <IdCell id={id} cellId={cellIds.id} /> : null}\n {status != null ? (\n <span id={cellIds.status} className=\"flex shrink-0 items-center\">\n {status}\n </span>\n ) : null}\n {method != null ? <Method id={cellIds.method}>{method}</Method> : null}\n <div data-log-primary-cell=\"\" className=\"min-w-0 flex-1\">\n {primary}\n {description != null ? (\n <p className=\"text-pho-description truncate text-xs\">{description}</p>\n ) : null}\n </div>\n {hasMeta ? (\n <div\n id={cellIds.meta}\n className=\"text-pho-description ml-auto flex shrink-0 items-center gap-3 text-xs whitespace-nowrap tabular-nums\"\n >\n {children}\n {duration != null ? <span>{duration}</span> : null}\n {time != null ? <span>{time}</span> : null}\n </div>\n ) : null}\n </div>\n );\n}\n\n/* -------------------------------- states -------------------------------- */\n\nexport interface LogListEmptyProps extends Omit<\n ComponentProps<\"div\">,\n \"title\" | \"children\"\n> {\n /** One short line naming the state. @default \"Nothing here yet.\" */\n title?: ReactNode;\n /** What fills it, or why it is empty. */\n description?: ReactNode;\n /** An action, when there is one. */\n children?: ReactNode;\n}\n\n/** The list with no rows — `StatusView` at card size. */\nfunction Empty({\n title = \"Nothing here yet.\",\n description,\n children,\n className,\n ...props\n}: LogListEmptyProps) {\n return (\n <div className={cn(\"flex justify-center\", className)} {...props}>\n <StatusView\n size=\"sm\"\n title={title}\n description={description}\n actions={children}\n />\n </div>\n );\n}\n\n/** Bones in the rows' place while the first page is on its way. */\nfunction Loading({ rows = 5 }: { rows?: number }) {\n return (\n <>\n {Array.from({ length: rows }, (_, index) => (\n <div\n key={index}\n aria-hidden\n className=\"flex min-h-12 items-center gap-3 px-5 py-2.5\"\n >\n <Skeleton className=\"h-3.5 w-32\" />\n <Skeleton className=\"h-5 w-12 rounded-full\" />\n <Skeleton className=\"h-3.5 w-48\" />\n <Skeleton className=\"ml-auto h-3.5 w-16\" />\n </div>\n ))}\n </>\n );\n}\n\nexport interface LogListLoadMoreProps extends Omit<\n ComponentProps<\"div\">,\n \"children\"\n> {\n /** Asked for as the sentinel scrolls into view, and on the button. */\n onLoadMore: () => void;\n /** The next page is on its way — the sentinel shows a spinner and waits. */\n loading?: boolean;\n /** Nothing left to load — renders nothing. @default true */\n hasMore?: boolean;\n /** How far ahead of the viewport to ask. @default \"200px\" */\n rootMargin?: string;\n /** The button's words. @default \"Load more\" */\n label?: ReactNode;\n}\n\n/**\n * The sentinel at the end of the list. An `IntersectionObserver` asks for\n * the next page as it comes into view (`rootMargin` ahead of it); while\n * `loading` it shows a spinner and asks for nothing. The button is the\n * same request for keyboards and for a browser without the observer.\n * SSR-safe: the observer is created in an effect.\n */\nfunction LoadMore({\n onLoadMore,\n loading,\n hasMore = true,\n rootMargin = \"200px\",\n label = \"Load more\",\n className,\n ...props\n}: LogListLoadMoreProps) {\n const ref = useRef<HTMLDivElement | null>(null);\n const latest = useRef(onLoadMore);\n latest.current = onLoadMore;\n useEffect(() => {\n const el = ref.current;\n if (!hasMore || loading || el == null) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) latest.current();\n },\n { rootMargin },\n );\n observer.observe(el);\n return () => observer.disconnect();\n }, [hasMore, loading, rootMargin]);\n if (!hasMore) return null;\n return (\n <div\n ref={ref}\n data-log-load-more=\"\"\n aria-busy={loading || undefined}\n className={cn(\n \"flex min-h-12 items-center justify-center px-5 py-2\",\n className,\n )}\n {...props}\n >\n {loading ? (\n <Spinner aria-label=\"Loading more\" className=\"text-pho-secondary\" />\n ) : (\n <Button variant=\"ghost\" size=\"sm\" onClick={() => onLoadMore()}>\n {label}\n </Button>\n )}\n </div>\n );\n}\n\n/* ---------------------------------- root -------------------------------- */\n\nexport interface LogListRootProps extends ComponentProps<\"div\"> {\n ref?: Ref<HTMLDivElement>;\n}\n\n/** The card the rows stack in. Mark it `aria-busy` while bones show. */\nfunction Root({ className, ...props }: LogListRootProps) {\n return (\n <div\n data-log-list=\"\"\n className={cn(LOG_LIST_SURFACE, \"min-w-0\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Log List — a card of one-line log rows.\n *\n * ```tsx\n * <LogList.Root>\n * <LogList.Row\n * id=\"pho_req_01m04axjqrfzxv4xjet40a84gb\"\n * status={<LogList.Status value={200} />}\n * method=\"POST\"\n * code\n * label=\"/v1/messages\"\n * description=\"+1 332 259 3374 received a message from +1 332 222 1111.\"\n * duration=\"59 ms\"\n * time=\"2 min ago\"\n * href=\"/requests/pho_req_01m04axjqrfzxv4xjet40a84gb\"\n * />\n * <LogList.LoadMore onLoadMore={fetchNextPage} loading={isFetching} hasMore={hasNextPage} />\n * </LogList.Root>\n * ```\n */\nexport const LogList = {\n Root,\n Row,\n Status,\n Method,\n Empty,\n Loading,\n LoadMore,\n};\n"],"mappings":";;;;;;;;;;;;;AA0CA,IAAMiB,IACJ,yFAGIC,IAAU,IACVC,IAAU;AAOhB,SAAgBC,EACdC,GACAC,IAAOJ,GACPK,IAAOJ,GACC;AACR,SAAIE,EAAM,UAAUC,IAAOC,IAAO,IAAUF,IACrC,GAAGA,EAAM,MAAM,GAAGC,CAAI,CAAA,IAAKD,EAAM,MAAM,CAACE,CAAI,CAAA;AACrD;AAIA,IAAMC,IAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GACKC,IAAc,oBAAI,IAAI;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GACKC,IAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAOD,SAAgBC,EAAeC,GAAqC;AAClE,MAAI,OAAOA,KAAW;AACpB,WAAIA,IAAS,MAAY,YACrBA,IAAS,MAAY,SACrBA,IAAS,MAAY,YAClB;AAET,QAAMC,IAAOD,EAAO,KAAK,EAAE,YAAY;AACvC,SAAI,UAAU,KAAKC,CAAI,IAAUF,EAAe,OAAOE,CAAI,CAAC,IACxDL,EAAc,IAAIK,CAAI,IAAU,YAChCJ,EAAY,IAAII,CAAI,IAAU,UAC9BH,EAAc,IAAIG,C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-col items-start justify-center
|
|
|
19
19
|
classes: {
|
|
20
20
|
root: "px-5 py-12",
|
|
21
21
|
icon: "mb-4 *:size-10",
|
|
22
|
-
copy: "gap-
|
|
22
|
+
copy: "gap-0",
|
|
23
23
|
title: "text-display-sm",
|
|
24
24
|
description: "text-display-xs",
|
|
25
25
|
actions: "mt-5"
|
|
@@ -62,4 +62,4 @@ export {
|
|
|
62
62
|
p as t
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
//# sourceMappingURL=status-view-
|
|
65
|
+
//# sourceMappingURL=status-view-Buhh1UBJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-view-Buhh1UBJ.js","names":["jsx","jsxs","STATUS_VIEW","STATUS_VIEW_COPY","STATUS_VIEW_SIZES","StatusView","icon","title","description","actions","size","className","props","slot","cn"],"sources":["../../src/components/status-view/status-view.tsx"],"sourcesContent":["import { type ComponentProps, type ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * Hugs its content (`w-fit`) and centers itself in the host (`mx-auto`); text\n * stays start-aligned so the icon / title / description share one left edge.\n * `max-w-lg` only caps long prose at Dialog width before it wraps.\n */\nexport const STATUS_VIEW =\n \"mx-auto flex w-fit max-w-lg min-w-0 flex-col items-start justify-center text-left\";\n\n/** Title + description group — flex column, the description flush under the title. */\nexport const STATUS_VIEW_COPY = \"flex flex-col\";\n\n/**\n * Size axis — retunes every slot. Title + description share Dialog's\n * `font-display` ladder: `base` matches Dialog; `sm` steps one rung down\n * for cards and panels. At both sizes the description sits flush under the\n * title (`gap-0`), as a Dialog's does.\n */\nexport const STATUS_VIEW_SIZES = {\n sm: {\n description: \"Small — states inside cards and panels\",\n classes: {\n root: \"px-5 py-8\",\n icon: \"mb-1.5 *:size-6\",\n copy: \"gap-0\",\n title: \"text-base\",\n description: \"text-base\",\n actions: \"mt-5\",\n },\n },\n base: {\n description: \"Base — the default; full pages and large regions\",\n classes: {\n root: \"px-5 py-12\",\n icon: \"mb-4 *:size-10\",\n copy: \"gap-0\",\n title: \"text-display-sm\",\n description: \"text-display-xs\",\n actions: \"mt-5\",\n },\n },\n} satisfies Record<\n string,\n { description: string; classes: Record<string, string> }\n>;\n\nexport type StatusViewSize = keyof typeof STATUS_VIEW_SIZES;\n\ninterface StatusViewBaseProps {\n /** Decorative glyph above the title, usually a Tabler icon. Sized by the view (`*:size-*`), inked `text-pho-secondary`. */\n icon?: ReactNode;\n /** One short line naming the state (\"No API keys yet\", \"Page not found\"). */\n title: ReactNode;\n /** Supporting prose — what it means or what to do next. */\n description?: ReactNode;\n /** Optional action row (buttons / links). Empty states usually omit it. */\n actions?: ReactNode;\n /** Size variant. @default \"base\" */\n size?: StatusViewSize;\n}\n\nexport interface StatusViewProps\n extends\n StatusViewBaseProps,\n Omit<ComponentProps<\"div\">, keyof StatusViewBaseProps | \"children\"> {}\n\n/**\n * StatusView — the standing-in view for a region with nothing to show or\n * nothing that worked: icon over title over description, with an optional\n * action row. The block shrink-wraps and centers itself while its text stays\n * left-aligned; the host owns the footprint (a card body, or a `min-h-screen`\n * flex-centered page). Use `size=\"sm\"` inside cards, the default `base` for\n * whole pages.\n *\n * Empty and error states share this one component — they differ only in what\n * you pass:\n *\n * - **Empty** — usually no `icon` and no `actions`; the create affordance\n * lives elsewhere on the page.\n * - **Error** — pass a warning `icon`, `role=\"alert\"` so it announces, and\n * `actions` offering a way out (retry, reload, a route back).\n */\nexport function StatusView({\n icon,\n title,\n description,\n actions,\n size = \"base\",\n className,\n ...props\n}: StatusViewProps) {\n const slot = STATUS_VIEW_SIZES[size].classes;\n return (\n <div className={cn(STATUS_VIEW, slot.root, className)} {...props}>\n {icon != null && (\n <div aria-hidden className={cn(\"text-pho-secondary\", slot.icon)}>\n {icon}\n </div>\n )}\n <div className={cn(STATUS_VIEW_COPY, slot.copy)}>\n <div\n className={cn(\n \"text-pho-secondary font-display font-medium text-balance\",\n slot.title,\n )}\n >\n {title}\n </div>\n {description != null && (\n <div\n className={cn(\"text-pho-description font-normal\", slot.description)}\n >\n {description}\n </div>\n )}\n </div>\n {actions != null && (\n <div\n className={cn(\n \"flex flex-wrap items-center justify-start gap-2\",\n slot.actions,\n )}\n >\n {actions}\n </div>\n )}\n </div>\n );\n}\n\nStatusView.displayName = \"StatusView\";\n"],"mappings":";;;;AAQA,IAAaE,IACX,qFAGWC,IAAmB,iBAQnBC,IAAoB;AAAA,EAC/B,IAAI;AAAA,IACF,aAAa;AAAA,IACb,SAAS;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SAAS;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAyCA,SAAgBC,EAAW,EACzB,MAAAC,GACA,OAAAC,GACA,aAAAC,GACA,SAAAC,GACA,MAAAC,IAAO,QACP,WAAAC,GACA,GAAGC,EAAA,GACe;AAClB,QAAMC,IAAOT,EAAkBM,CAAA,EAAM;AACrC,SACE,gBAAAT,EAAC,OAAD;AAAA,IAAK,WAAWa,EAAGZ,GAAaW,EAAK,MAAMF,CAAS;AAAA,IAAG,GAAIC;AAAA,IAA3D,UAAA;AAAA,MACGN,KAAQ,QACP,gBAAAN,EAAC,OAAD;AAAA,QAAK,eAAA;AAAA,QAAY,WAAWc,EAAG,sBAAsBD,EAAK,IAAI;AAAA,QAC3D,UAAAP;AAAA,MACE,CAAA;AAAA,MAEP,gBAAAL,EAAC,OAAD;AAAA,QAAK,WAAWa,EAAGX,GAAkBU,EAAK,IAAI;AAAA,QAA9C,UAAA,CACE,gBAAAb,EAAC,OAAD;AAAA,UACE,WAAWc,EACT,4DACAD,EAAK,KACP;AAAA,UAEC,UAAAN;AAAA,QACE,CAAA,GACJC,KAAe,QACd,gBAAAR,EAAC,OAAD;AAAA,UACE,WAAWc,EAAG,oCAAoCD,EAAK,WAAW;AAAA,UAEjE,UAAAL;AAAA,QACE,CAAA,CAEJ;AAAA,M;A,MACJC,KAAW,QACV,gBAAAT,EAAC,OAAD;AAAA,QACE,WAAWc,EACT,mDACAD,EAAK,OACP;AAAA,QAEC,UAAAJ;AAAA,MACE,CAAA;AAAA,IAEJ;AAAA,E;AAET;AAEAJ,EAAW,cAAc"}
|
package/dist/components/chat.js
CHANGED
|
@@ -5,7 +5,7 @@ import { SPRING_SETTLE as P } from "../motion.js";
|
|
|
5
5
|
import { t as j } from "../chunks/IconArrowUpRight-OK8Fp0KQ.js";
|
|
6
6
|
import { t as V } from "../chunks/IconChevronLeft-CptqhdxO.js";
|
|
7
7
|
import { t as Z } from "../chunks/animated-height-zr7BmFY1.js";
|
|
8
|
-
import { t as u } from "../chunks/dialog-
|
|
8
|
+
import { t as u } from "../chunks/dialog-e4_mOYGp.js";
|
|
9
9
|
import { useEffect as $, useId as z, useLayoutEffect as A, useRef as F } from "react";
|
|
10
10
|
import { Fragment as E, jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
11
11
|
import { LayoutGroup as H, motion as g, useReducedMotion as B } from "motion/react";
|
|
@@ -22,13 +22,13 @@ function u({ className: t, ...r }) {
|
|
|
22
22
|
...r
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function d({ className: t, ...r }) {
|
|
26
26
|
return /* @__PURE__ */ o(a.Content, {
|
|
27
27
|
className: e("flex h-full flex-col", t),
|
|
28
28
|
...r
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function m({ className: t, ...r }) {
|
|
32
32
|
return /* @__PURE__ */ o(a.Title, {
|
|
33
33
|
className: e("text-pho-primary font-display text-display-sm font-medium text-balance", t),
|
|
34
34
|
...r
|
|
@@ -36,7 +36,7 @@ function d({ className: t, ...r }) {
|
|
|
36
36
|
}
|
|
37
37
|
function f({ className: t, ...r }) {
|
|
38
38
|
return /* @__PURE__ */ o(a.Description, {
|
|
39
|
-
className: e("text-pho-description text-display-xs
|
|
39
|
+
className: e("text-pho-description text-display-xs font-normal", t),
|
|
40
40
|
...r
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -47,8 +47,8 @@ var v = {
|
|
|
47
47
|
Backdrop: p,
|
|
48
48
|
Viewport: c,
|
|
49
49
|
Popup: u,
|
|
50
|
-
Content:
|
|
51
|
-
Title:
|
|
50
|
+
Content: d,
|
|
51
|
+
Title: m,
|
|
52
52
|
Description: f,
|
|
53
53
|
Close: l
|
|
54
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","names":["BaseDrawer","cn","jsx","Drawer$1","Root","Trigger","Portal","Close","Backdrop","className","props","Viewport","Popup","Content","Title","Description","Drawer"],"sources":["../../src/components/drawer/drawer.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Root = BaseDrawer.Root;\nconst Trigger = BaseDrawer.Trigger;\nconst Portal = BaseDrawer.Portal;\nconst Close = BaseDrawer.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Backdrop>) {\n return (\n <BaseDrawer.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-300 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Viewport>) {\n return (\n <BaseDrawer.Viewport\n className={cn(\n \"fixed inset-0 z-50 flex items-stretch justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDrawer.Popup>) {\n return (\n <BaseDrawer.Popup\n className={cn(\n // Floating layer: keeps its elevation shadow; hairline edge is the\n // site card stroke (border-pho-secondary), not the interactive edge.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl h-full w-[22rem] max-w-[calc(100vw-3rem)] overflow-y-auto overscroll-contain border-l p-6 outline-none\",\n \"[transform:translateX(var(--drawer-swipe-movement-x,0px))] transition-transform duration-300 ease-out\",\n \"data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Content>) {\n return (\n <BaseDrawer.Content\n className={cn(\"flex h-full flex-col\", className)}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDrawer.Title>) {\n return (\n <BaseDrawer.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 BaseDrawer.Description>) {\n return (\n <BaseDrawer.Description\n className={cn(\n \"text-pho-description text-display-xs
|
|
1
|
+
{"version":3,"file":"drawer.js","names":["BaseDrawer","cn","jsx","Drawer$1","Root","Trigger","Portal","Close","Backdrop","className","props","Viewport","Popup","Content","Title","Description","Drawer"],"sources":["../../src/components/drawer/drawer.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Root = BaseDrawer.Root;\nconst Trigger = BaseDrawer.Trigger;\nconst Portal = BaseDrawer.Portal;\nconst Close = BaseDrawer.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Backdrop>) {\n return (\n <BaseDrawer.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-300 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Viewport>) {\n return (\n <BaseDrawer.Viewport\n className={cn(\n \"fixed inset-0 z-50 flex items-stretch justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDrawer.Popup>) {\n return (\n <BaseDrawer.Popup\n className={cn(\n // Floating layer: keeps its elevation shadow; hairline edge is the\n // site card stroke (border-pho-secondary), not the interactive edge.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl h-full w-[22rem] max-w-[calc(100vw-3rem)] overflow-y-auto overscroll-contain border-l p-6 outline-none\",\n \"[transform:translateX(var(--drawer-swipe-movement-x,0px))] transition-transform duration-300 ease-out\",\n \"data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Content>) {\n return (\n <BaseDrawer.Content\n className={cn(\"flex h-full flex-col\", className)}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDrawer.Title>) {\n return (\n <BaseDrawer.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\n/** Supporting copy flush under the title: no gap between the two. */\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Description>) {\n return (\n <BaseDrawer.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Drawer built on Base UI `Drawer` — a panel that slides in from the edge\n * (here, the right) with swipe-to-dismiss. Use it for secondary tasks and\n * navigation that should keep page context; for a decision or a centered modal\n * use `Dialog`. Compose `Drawer.Portal`\n * → `Backdrop` → `Viewport` → `Popup` → `Content`.\n */\nexport const Drawer = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Viewport,\n Popup,\n Content,\n Title,\n Description,\n Close,\n};\n"],"mappings":";;;;;AAYA,IAAMI,IAAOJ,EAAW,MAClBK,IAAUL,EAAW,SACrBM,IAASN,EAAW,QACpBO,IAAQP,EAAW;AAEzB,SAASQ,EAAS,EAChB,WAAAC,GACA,GAAGC,EAAA,GACuC;AAC1C,SACE,gBAAAR,EAACF,EAAW,UAAZ;AAAA,IACE,WAAWC,EACT,8EACA,2FACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASC,EAAS,EAChB,WAAAF,GACA,GAAGC,EAAA,GACuC;AAC1C,SACE,gBAAAR,EAACF,EAAW,UAAZ;AAAA,IACE,WAAWC,EACT,qDACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASE,EAAM,EAAE,WAAAH,GAAW,GAAGC,EAAA,GAA+C;AAC5E,SACE,gBAAAR,EAACF,EAAW,OAAZ;AAAA,IACE,WAAWC,EAGT,4JACA,yGACA,yGACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASG,EAAQ,EACf,WAAAJ,GACA,GAAGC,EAAA,GACsC;AACzC,SACE,gBAAAR,EAACF,EAAW,SAAZ;AAAA,IACE,WAAWC,EAAG,wBAAwBQ,CAAS;AAAA,IAC/C,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASI,EAAM,EAAE,WAAAL,GAAW,GAAGC,EAAA,GAA+C;AAC5E,SACE,gBAAAR,EAACF,EAAW,OAAZ;AAAA,IACE,WAAWC,EACT,0EACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAGA,SAASK,EAAY,EACnB,WAAAN,GACA,GAAGC,EAAA,GAC0C;AAC7C,SACE,gBAAAR,EAACF,EAAW,aAAZ;AAAA,IACE,WAAWC,EACT,oDACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AASA,IAAaM,IAAS;AAAA,EACpB,MAAAZ;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAE;AAAA,EACA,UAAAG;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAR;AACF"}
|
package/dist/components/error.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as r, c as s, i as t, l as e, n as i, o, r as E, s as n, t as p, u as l } from "../chunks/error-
|
|
2
|
+
import { a as r, c as s, i as t, l as e, n as i, o, r as E, s as n, t as p, u as l } from "../chunks/error-BjSn7wLu.js";
|
|
3
3
|
export {
|
|
4
4
|
p as Error,
|
|
5
5
|
i as ErrorView,
|
package/dist/components/field.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t } from "../chunks/cn-CPbhpG1q.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { Field as
|
|
6
|
-
function s({ className:
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
className: t("group/field flex flex-col gap-1.5",
|
|
4
|
+
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
import { Field as r } from "@base-ui/react/field";
|
|
6
|
+
function s({ className: i, ...e }) {
|
|
7
|
+
return /* @__PURE__ */ a(r.Root, {
|
|
8
|
+
className: t("group/field flex flex-col gap-1.5", "[&>[data-field-label]+[data-field-description]]:-mt-1.5", i),
|
|
9
9
|
...e
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
function d({ className:
|
|
13
|
-
return /* @__PURE__ */ l(
|
|
14
|
-
|
|
12
|
+
function d({ className: i, required: e, children: o, ...n }) {
|
|
13
|
+
return /* @__PURE__ */ l(r.Label, {
|
|
14
|
+
"data-field-label": "",
|
|
15
|
+
className: t("text-pho-secondary font-heading cursor-default text-base font-medium", e && "flex items-center gap-0.5", i),
|
|
15
16
|
...n,
|
|
16
|
-
children: [
|
|
17
|
+
children: [o, e ? /* @__PURE__ */ a("span", {
|
|
17
18
|
className: "text-pho-brand",
|
|
18
19
|
"aria-hidden": "true",
|
|
19
20
|
children: "*"
|
|
20
21
|
}) : null]
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
function c({ className:
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
className: t("bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder text-md rounded-base w-full px-3 py-2 ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset", "focus-visible:ring-pho-brand focus-visible:ring-2", "data-[invalid]:ring-pho-error-subtle data-[invalid]:focus-visible:ring-pho-error data-[invalid]:ring-[1.5px] data-[invalid]:focus-visible:ring-2", "disabled:cursor-not-allowed disabled:opacity-50",
|
|
24
|
+
function c({ className: i, ...e }) {
|
|
25
|
+
return /* @__PURE__ */ a(r.Control, {
|
|
26
|
+
className: t("bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder text-md rounded-base w-full px-3 py-2 ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset", "focus-visible:ring-pho-brand focus-visible:ring-2", "data-[invalid]:ring-pho-error-subtle data-[invalid]:focus-visible:ring-pho-error data-[invalid]:ring-[1.5px] data-[invalid]:focus-visible:ring-2", "disabled:cursor-not-allowed disabled:opacity-50", i),
|
|
26
27
|
...e
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
function p({ className:
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
className: t("flex min-w-0 flex-col gap-3",
|
|
30
|
+
function p({ className: i, ...e }) {
|
|
31
|
+
return /* @__PURE__ */ a("div", {
|
|
32
|
+
className: t("flex min-w-0 flex-col gap-3", i),
|
|
32
33
|
...e
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
function u({ className:
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
36
|
+
function u({ className: i, ...e }) {
|
|
37
|
+
return /* @__PURE__ */ a(r.Description, {
|
|
38
|
+
"data-field-description": "",
|
|
39
|
+
className: t("text-pho-description text-base", i),
|
|
38
40
|
...e
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
|
-
function
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
className: t("text-pho-error text-base",
|
|
43
|
+
function f({ className: i, ...e }) {
|
|
44
|
+
return /* @__PURE__ */ a(r.Error, {
|
|
45
|
+
className: t("text-pho-error text-base", i),
|
|
44
46
|
...e
|
|
45
47
|
});
|
|
46
48
|
}
|
|
@@ -50,9 +52,9 @@ var g = {
|
|
|
50
52
|
Control: c,
|
|
51
53
|
Controls: p,
|
|
52
54
|
Description: u,
|
|
53
|
-
Error:
|
|
54
|
-
Item:
|
|
55
|
-
Validity:
|
|
55
|
+
Error: f,
|
|
56
|
+
Item: r.Item,
|
|
57
|
+
Validity: r.Validity
|
|
56
58
|
};
|
|
57
59
|
export {
|
|
58
60
|
g as Field
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","names":["BaseField","jsx","jsxs","Field$1","Root","className","props","cn","Label","required","children","Control","Controls","Description","Error","Field"],"sources":["../../src/components/field/field.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { cn } from \"../../utils/cn\";\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\nfunction Root({ className, ...props }: StyledProps<typeof BaseField.Root>) {\n return (\n <BaseField.Root\n className={cn(\"group/field flex flex-col gap-1.5\"
|
|
1
|
+
{"version":3,"file":"field.js","names":["BaseField","jsx","jsxs","Field$1","Root","className","props","cn","Label","required","children","Control","Controls","Description","Error","Field"],"sources":["../../src/components/field/field.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { cn } from \"../../utils/cn\";\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/**\n * The field's column: label, control and description 6px apart. A\n * description right under the label (above the control) is the label's\n * own and sits flush under it: `-mt-1.5` takes back the column's gap for\n * that pair. A title of the host's own standing in for `Label` (a `div`\n * over a group of controls) joins the pair with `data-field-label`.\n */\nfunction Root({ className, ...props }: StyledProps<typeof BaseField.Root>) {\n return (\n <BaseField.Root\n className={cn(\n \"group/field flex flex-col gap-1.5\",\n \"[&>[data-field-label]+[data-field-description]]:-mt-1.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * The field's label. `required` marks it the way `Input required` marks\n * its own: a brand-coloured star after the words. A form marks every\n * required field or none, so a field built from parts (a `Select`, a\n * `PhoneInput`, a pair of inputs under one label) takes `required` here to\n * match the `Input`s beside it.\n */\nfunction Label({\n className,\n required,\n children,\n ...props\n}: StyledProps<typeof BaseField.Label> & {\n /** Mark the field required: a star after the label's words. */\n required?: boolean;\n}) {\n return (\n <BaseField.Label\n data-field-label=\"\"\n className={cn(\n \"text-pho-secondary font-heading cursor-default text-base font-medium\",\n required && \"flex items-center gap-0.5\",\n className,\n )}\n {...props}\n >\n {children}\n {/* The star is for the eye; the control carries the required state. */}\n {required ? (\n <span className=\"text-pho-brand\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </BaseField.Label>\n );\n}\n\nfunction Control({\n className,\n ...props\n}: StyledProps<typeof BaseField.Control>) {\n return (\n <BaseField.Control\n className={cn(\n // Flat field surface — hairline ring carries the edge (site has no\n // resting shadows outside floating layers).\n \"bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder text-md rounded-base w-full px-3 py-2 ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset\",\n \"focus-visible:ring-pho-brand focus-visible:ring-2\",\n // Invalid is mid-weight: thicker than the 1px rest hairline, thinner\n // than the 2px focus ring. Rest uses the subtle error ink; focus\n // steps up to the solid error.\n \"data-[invalid]:ring-pho-error-subtle data-[invalid]:focus-visible:ring-pho-error data-[invalid]:ring-[1.5px] data-[invalid]:focus-visible:ring-2\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Several controls under one label: the lines of an address, first and\n * last name, the parts of a date. Stacks them at the gap the system uses\n * between the parts of one thing (12px), so the field's own 6px stays\n * between the label, the controls and the description. Put an `Inline`\n * inside for a side-by-side row.\n */\nfunction Controls({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex min-w-0 flex-col gap-3\", className)} {...props} />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseField.Description>) {\n return (\n <BaseField.Description\n data-field-description=\"\"\n className={cn(\"text-pho-description text-base\", className)}\n {...props}\n />\n );\n}\n\nfunction Error({ className, ...props }: StyledProps<typeof BaseField.Error>) {\n return (\n <BaseField.Error\n className={cn(\"text-pho-error text-base\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Form field built on Base UI `Field`. Wires a label, description, and\n * validation error to a control for you — compose it around `Field.Control`\n * (or any control via `render`). `Field.Error` shows when the control is\n * invalid; `Field.Validity` exposes raw validity for custom messages.\n * `Field.Controls` stacks several controls under one label.\n */\nexport const Field = {\n Root,\n Label,\n Control,\n Controls,\n Description,\n Error,\n Item: BaseField.Item,\n Validity: BaseField.Validity,\n};\n"],"mappings":";;;;;AAmBA,SAASI,EAAK,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAA6C;AACzE,SACE,gBAAAL,EAACD,EAAU,MAAX;AAAA,I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AA,EACA,SAAAG;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAMd,EAAU;AAAA,EAChB,UAAUA,EAAU;AACtB"}
|
|
@@ -67,7 +67,7 @@ function _({ color: a = "brand", title: p, description: r, confirmLabel: i, onCo
|
|
|
67
67
|
/* @__PURE__ */ o("div", {
|
|
68
68
|
className: "flex flex-1 flex-col gap-3 pr-6",
|
|
69
69
|
children: [/* @__PURE__ */ o("div", {
|
|
70
|
-
className: "flex flex-col
|
|
70
|
+
className: "flex flex-col",
|
|
71
71
|
children: [/* @__PURE__ */ e("p", {
|
|
72
72
|
className: "text-pho-primary font-heading text-base font-medium",
|
|
73
73
|
children: p
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","names":["__iconNode","resolveVariant","createReactComponent","IconInfoCircle","IconX","jsx","jsxs","__iconNode$1","IconAlertCircle","__iconNode","IconCircleCheck","NOTIFICATION_COLORS","ICON_MAP","LINK_CLASS","Notification","color","title","description","confirmLabel","onConfirm","dismissLabel","onClose","icon","className","ref","props","Glyph","showActions","cn"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.mjs","../../src/components/notification/notification.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 8v4\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16h.01\", \"key\": \"svg-2\" }]];\nconst IconAlertCircle = createReactComponent(\"outline\", \"alert-circle\", \"AlertCircle\", __iconNode);\n\nexport { __iconNode, IconAlertCircle as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M9 12l2 2l4 -4\", \"key\": \"svg-1\" }]];\nconst IconCircleCheck = createReactComponent(\"outline\", \"circle-check\", \"CircleCheck\", __iconNode);\n\nexport { __iconNode, IconCircleCheck as default };\n","import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\nimport {\n IconCircleCheck,\n IconInfoCircle,\n IconAlertCircle,\n IconX,\n type Icon,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/**\n * Design notes (Geist-aligned):\n * - ONE closed, semantic axis: `color`. It selects a status glyph *and* its\n * tint together — you never pick an icon and a color separately. This is the\n * `IconNotification` flavor from the app; the unused avatar/image variants of\n * the source family are intentionally dropped.\n * - The action row is a single reduced pair: a brand `confirmLabel` link beside\n * a gray dismiss link. It appears only when there's something to confirm.\n * - `onClose` is the only thing that renders the top-right close button — no\n * separate boolean flag to keep in sync.\n */\n\n/** Status color → icon tint. A bare status-tinted glyph, no badge surface. */\nexport const NOTIFICATION_COLORS = {\n brand: {\n classes: \"text-pho-brand\",\n description: \"Informational / product update (default)\",\n },\n gray: {\n classes: \"text-pho-secondary\",\n description: \"Neutral, low-stakes note\",\n },\n success: {\n classes: \"text-pho-success\",\n description: \"An action completed\",\n },\n warning: {\n classes: \"text-pho-warning\",\n description: \"Needs attention, not yet failed\",\n },\n error: {\n classes: \"text-pho-error\",\n description: \"Something went wrong\",\n },\n} satisfies VariantMap;\n\nexport type NotificationColor = keyof typeof NOTIFICATION_COLORS;\n\n/** Status color → glyph. Mirrors the source's `iconMap` semantics. */\nconst ICON_MAP = {\n brand: IconInfoCircle,\n gray: IconInfoCircle,\n success: IconCircleCheck,\n warning: IconAlertCircle,\n error: IconAlertCircle,\n} satisfies Record<NotificationColor, Icon>;\n\nexport interface NotificationProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"title\" | \"color\"\n> {\n /** Status color — selects the glyph and its tint. @default \"brand\" */\n color?: NotificationColor;\n /** Bold heading line. */\n title: ReactNode;\n /** Supporting line under the title. */\n description?: ReactNode;\n /** Confirm action label — renders a brand link paired with a dismiss link. */\n confirmLabel?: string;\n /** Called when the confirm link is clicked. */\n onConfirm?: () => void;\n /** Dismiss link label, shown beside the confirm link. @default \"Dismiss\" */\n dismissLabel?: string;\n /** Called on dismiss. Its presence also renders the top-right close button. */\n onClose?: () => void;\n /** Override the status glyph while keeping the color's tint. */\n icon?: Icon;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst LINK_CLASS =\n \"cursor-pointer text-base font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\";\n\n/**\n * Notification — the standalone status card ported from the app's\n * `IconNotification`: a status glyph, a title/description, an optional\n * confirm+dismiss link pair, and an optional close button. It is a *card*, not a\n * lifecycle: it owns its surface but nothing about timing or stacking.\n *\n * For a transient, auto-stacking toast, drop it inside pho-ui's Base UI\n * {@link Toast} — render it as the child of a `Toast.Root` whose own surface you\n * neutralize (`className=\"bg-transparent p-0 shadow-none ring-0\"`) so the\n * manager owns motion and swipe while this card owns the look. For a choice the\n * user must make, use `Dialog` instead.\n */\nexport function Notification({\n color = \"brand\",\n title,\n description,\n confirmLabel,\n onConfirm,\n dismissLabel = \"Dismiss\",\n onClose,\n icon,\n className,\n ref,\n ...props\n}: NotificationProps) {\n const Glyph = icon ?? ICON_MAP[color];\n const showActions = Boolean(confirmLabel);\n\n return (\n <div\n ref={ref}\n {...props}\n className={cn(\n // Floating layer: keeps its shadow elevation, hairline card edge.\n \"ring-pho-secondary bg-pho-primary shadow-pho-lg rounded-base relative flex w-full max-w-sm gap-4 p-4 ring-1 ring-inset\",\n className,\n )}\n >\n <Glyph\n aria-hidden=\"true\"\n className={cn(\n \"mt-0.5 size-5 shrink-0\",\n resolveVariant(NOTIFICATION_COLORS, color),\n )}\n />\n\n <div className=\"flex flex-1 flex-col gap-3 pr-6\">\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-pho-primary font-heading text-base font-medium\">\n {title}\n </p>\n {description != null && description !== false && (\n <p className=\"text-pho-description text-base\">{description}</p>\n )}\n </div>\n\n {showActions && (\n <div className=\"flex gap-4\">\n <button\n type=\"button\"\n onClick={onConfirm}\n className={cn(\n LINK_CLASS,\n // brand text is monochrome now — underline carries the hover.\n \"text-pho-brand hover:underline\",\n )}\n >\n {confirmLabel}\n </button>\n <button\n type=\"button\"\n onClick={onClose}\n className={cn(\n LINK_CLASS,\n \"text-pho-secondary hover:text-pho-secondary-hover\",\n )}\n >\n {dismissLabel}\n </button>\n </div>\n )}\n </div>\n\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Dismiss\"\n className=\"text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4\"\n >\n <IconX aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n}\n\nNotification.displayName = \"Notification\";\n"],"ignoreList":[0,1],"mappings":";;;;;;;;AASA,IAAMA,IAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAwC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAW,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,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A,MAED,gBAAAT,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QAAf,UAAA,CACE,gBAAAA,EAAC,OAAD;AAAA,UAAK,WAAU;AAAA,UAAf,UAAA,CACE,gBAAAD,EAAC,KAAD;AAAA,YAAG,WAAU;AAAA,YACV,UAAAW;AAAA,UACA,CAAA,GACFC,KAAe,QAAQA,MAAgB,MACtC,gBAAAZ,EAAC,KAAD;AAAA,YAAG,WAAU;AAAA,YAAkC,UAAAY;AAAA,UAAe,CAAA,CAE7D;AAAA,QAEJ,CAAA,GAAAU,KACC,gBAAArB,EAAC,OAAD;AAAA,UAAK,WAAU;AAAA,UAAf,UAAA,CACE,gBAAAD,EAAC,UAAD;AAAA,YACE,MAAK;AAAA,YACL,SAASc;AAAA,YACT,WAAWS,EACTf,GAEA,gCACF;AAAA,YAEC,UAAAK;AAAA,UACK,CAAA,GACR,gBAAAb,EAAC,UAAD;AAAA,YACE,MAAK;AAAA,YACL,SAASgB;AAAA,YACT,WAAWO,EACTf,GACA,mDACF;AAAA,YAEC,UAAAO;AAAA,UACK,CAAA,CACL;AAAA,QAEJ,CAAA,CAAA;AAAA,M;A,MAEJC,KACC,gBAAAhB,EAAC,UAAD;AAAA,QACE,MAAK;AAAA,QACL,SAASgB;AAAA,QACT,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,UAAA,gBAAAhB,EAACD,GAAD,EAAO,eAAY,OAAQ,CAAA;AAAA,MACrB,CAAA;AAAA,IAEP;AAAA,E;AAET;AAEAU,EAAa,cAAc"}
|
|
1
|
+
{"version":3,"file":"notification.js","names":["__iconNode","resolveVariant","createReactComponent","IconInfoCircle","IconX","jsx","jsxs","__iconNode$1","IconAlertCircle","__iconNode","IconCircleCheck","NOTIFICATION_COLORS","ICON_MAP","LINK_CLASS","Notification","color","title","description","confirmLabel","onConfirm","dismissLabel","onClose","icon","className","ref","props","Glyph","showActions","cn"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.mjs","../../src/components/notification/notification.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 8v4\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16h.01\", \"key\": \"svg-2\" }]];\nconst IconAlertCircle = createReactComponent(\"outline\", \"alert-circle\", \"AlertCircle\", __iconNode);\n\nexport { __iconNode, IconAlertCircle as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M9 12l2 2l4 -4\", \"key\": \"svg-1\" }]];\nconst IconCircleCheck = createReactComponent(\"outline\", \"circle-check\", \"CircleCheck\", __iconNode);\n\nexport { __iconNode, IconCircleCheck as default };\n","import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\nimport {\n IconCircleCheck,\n IconInfoCircle,\n IconAlertCircle,\n IconX,\n type Icon,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/**\n * Design notes (Geist-aligned):\n * - ONE closed, semantic axis: `color`. It selects a status glyph *and* its\n * tint together — you never pick an icon and a color separately. This is the\n * `IconNotification` flavor from the app; the unused avatar/image variants of\n * the source family are intentionally dropped.\n * - The action row is a single reduced pair: a brand `confirmLabel` link beside\n * a gray dismiss link. It appears only when there's something to confirm.\n * - `onClose` is the only thing that renders the top-right close button — no\n * separate boolean flag to keep in sync.\n */\n\n/** Status color → icon tint. A bare status-tinted glyph, no badge surface. */\nexport const NOTIFICATION_COLORS = {\n brand: {\n classes: \"text-pho-brand\",\n description: \"Informational / product update (default)\",\n },\n gray: {\n classes: \"text-pho-secondary\",\n description: \"Neutral, low-stakes note\",\n },\n success: {\n classes: \"text-pho-success\",\n description: \"An action completed\",\n },\n warning: {\n classes: \"text-pho-warning\",\n description: \"Needs attention, not yet failed\",\n },\n error: {\n classes: \"text-pho-error\",\n description: \"Something went wrong\",\n },\n} satisfies VariantMap;\n\nexport type NotificationColor = keyof typeof NOTIFICATION_COLORS;\n\n/** Status color → glyph. Mirrors the source's `iconMap` semantics. */\nconst ICON_MAP = {\n brand: IconInfoCircle,\n gray: IconInfoCircle,\n success: IconCircleCheck,\n warning: IconAlertCircle,\n error: IconAlertCircle,\n} satisfies Record<NotificationColor, Icon>;\n\nexport interface NotificationProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"title\" | \"color\"\n> {\n /** Status color — selects the glyph and its tint. @default \"brand\" */\n color?: NotificationColor;\n /** Bold heading line. */\n title: ReactNode;\n /** Supporting line under the title. */\n description?: ReactNode;\n /** Confirm action label — renders a brand link paired with a dismiss link. */\n confirmLabel?: string;\n /** Called when the confirm link is clicked. */\n onConfirm?: () => void;\n /** Dismiss link label, shown beside the confirm link. @default \"Dismiss\" */\n dismissLabel?: string;\n /** Called on dismiss. Its presence also renders the top-right close button. */\n onClose?: () => void;\n /** Override the status glyph while keeping the color's tint. */\n icon?: Icon;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst LINK_CLASS =\n \"cursor-pointer text-base font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\";\n\n/**\n * Notification — the standalone status card ported from the app's\n * `IconNotification`: a status glyph, a title/description, an optional\n * confirm+dismiss link pair, and an optional close button. It is a *card*, not a\n * lifecycle: it owns its surface but nothing about timing or stacking.\n *\n * For a transient, auto-stacking toast, drop it inside pho-ui's Base UI\n * {@link Toast} — render it as the child of a `Toast.Root` whose own surface you\n * neutralize (`className=\"bg-transparent p-0 shadow-none ring-0\"`) so the\n * manager owns motion and swipe while this card owns the look. For a choice the\n * user must make, use `Dialog` instead.\n */\nexport function Notification({\n color = \"brand\",\n title,\n description,\n confirmLabel,\n onConfirm,\n dismissLabel = \"Dismiss\",\n onClose,\n icon,\n className,\n ref,\n ...props\n}: NotificationProps) {\n const Glyph = icon ?? ICON_MAP[color];\n const showActions = Boolean(confirmLabel);\n\n return (\n <div\n ref={ref}\n {...props}\n className={cn(\n // Floating layer: keeps its shadow elevation, hairline card edge.\n \"ring-pho-secondary bg-pho-primary shadow-pho-lg rounded-base relative flex w-full max-w-sm gap-4 p-4 ring-1 ring-inset\",\n className,\n )}\n >\n <Glyph\n aria-hidden=\"true\"\n className={cn(\n \"mt-0.5 size-5 shrink-0\",\n resolveVariant(NOTIFICATION_COLORS, color),\n )}\n />\n\n <div className=\"flex flex-1 flex-col gap-3 pr-6\">\n {/* The description flush under the title. */}\n <div className=\"flex flex-col\">\n <p className=\"text-pho-primary font-heading text-base font-medium\">\n {title}\n </p>\n {description != null && description !== false && (\n <p className=\"text-pho-description text-base\">{description}</p>\n )}\n </div>\n\n {showActions && (\n <div className=\"flex gap-4\">\n <button\n type=\"button\"\n onClick={onConfirm}\n className={cn(\n LINK_CLASS,\n // brand text is monochrome now — underline carries the hover.\n \"text-pho-brand hover:underline\",\n )}\n >\n {confirmLabel}\n </button>\n <button\n type=\"button\"\n onClick={onClose}\n className={cn(\n LINK_CLASS,\n \"text-pho-secondary hover:text-pho-secondary-hover\",\n )}\n >\n {dismissLabel}\n </button>\n </div>\n )}\n </div>\n\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Dismiss\"\n className=\"text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4\"\n >\n <IconX aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n}\n\nNotification.displayName = \"Notification\";\n"],"ignoreList":[0,1],"mappings":";;;;;;;;AASA,IAAMA,IAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAwC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAW,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAC,GACtLQ,IAAkBN,EAAqB,WAAW,gBAAgB,eAAeF,CAAU,GCD3FS,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAwC,KAAO;AAAQ,CAAC,GAAG,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAkB,KAAO;AAAQ,CAAC,CAAC,GAC5IC,IAAkBR,EAAqB,WAAW,gBAAgB,eAAeO,CAAU,GCcpFE,IAAsB;AAAA,EACjC,OAAO;AAAA,IACL,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AACF,GAKMC,IAAW;AAAA,EACf,OAAOT;AAAA,EACP,MAAMA;AAAA,EACN,SAASO;AAAA,EACT,SAASF;AAAA,EACT,OAAOA;AACT,GA0BMK,IACJ;AAcF,SAA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AAD;AAAA,QACE,MAAK;AAAA,QACL,SAASgB;AAAA,QACT,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,UAAA,gBAAAhB,EAACD,GAAD,EAAO,eAAY,OAAQ,CAAA;AAAA,MACrB,CAAA;AAAA,IAEP;AAAA,E;AAET;AAEAU,EAAa,cAAc"}
|
package/dist/components/scope.js
CHANGED
|
@@ -15,7 +15,7 @@ import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
|
15
15
|
import { AnimatePresence as H, motion as b, useReducedMotion as ht } from "motion/react";
|
|
16
16
|
import { Field as mt } from "@base-ui/react/field";
|
|
17
17
|
import { Tooltip as ft } from "@base-ui/react/tooltip";
|
|
18
|
-
var vt = "group/scope relative w-full min-w-0 overflow-clip rounded-base border border-pho-secondary bg-pho-primary [--scope-inset:var(--choice-card-inset,0.75rem)]", Se = "px-[var(--scope-inset)]", gt = "flex min-h-11 items-center gap-3 border-b border-pho-secondary px-[var(--scope-inset)]", bt = "text-pho-secondary hover:bg-pho-ghost-hover hover:text-pho-secondary-hover data-[popup-open]:bg-pho-ghost-hover outline-pho-brand shrink-0 gap-1.5 rounded-full py-1.5 pr-2 pl-3 font-medium focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid", de = "custom", Ce = "grid auto-rows-max grid-cols-1 group-data-[wide]/scope:grid-cols-[fit-content(45%)_minmax(0,1fr)] group-data-[wide]/scope:gap-x-4", Oe = "col-span-full grid auto-rows-max grid-cols-subgrid border-t border-pho-secondary first:border-t-0", Ee = "group col-span-full flex min-w-0 cursor-pointer flex-col
|
|
18
|
+
var vt = "group/scope relative w-full min-w-0 overflow-clip rounded-base border border-pho-secondary bg-pho-primary [--scope-inset:var(--choice-card-inset,0.75rem)]", Se = "px-[var(--scope-inset)]", gt = "flex min-h-11 items-center gap-3 border-b border-pho-secondary px-[var(--scope-inset)]", bt = "text-pho-secondary hover:bg-pho-ghost-hover hover:text-pho-secondary-hover data-[popup-open]:bg-pho-ghost-hover outline-pho-brand shrink-0 gap-1.5 rounded-full py-1.5 pr-2 pl-3 font-medium focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid", de = "custom", Ce = "grid auto-rows-max grid-cols-1 group-data-[wide]/scope:grid-cols-[fit-content(45%)_minmax(0,1fr)] group-data-[wide]/scope:gap-x-4", Oe = "col-span-full grid auto-rows-max grid-cols-subgrid border-t border-pho-secondary first:border-t-0", Ee = "group col-span-full flex min-w-0 cursor-pointer flex-col px-[var(--scope-inset)] py-2 transition-colors select-none hover:bg-pho-primary-hover group-data-[wide]/scope:grid group-data-[wide]/scope:grid-cols-subgrid group-data-[wide]/scope:items-center data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-transparent", wt = "col-span-full flex min-w-0 flex-col px-[var(--scope-inset)] py-2 group-data-[wide]/scope:grid group-data-[wide]/scope:grid-cols-subgrid group-data-[wide]/scope:items-center", ke = "group col-span-full flex h-8 min-w-0 cursor-pointer items-center gap-2 border-b border-pho-secondary bg-pho-page px-[var(--scope-inset)] text-xs font-medium text-pho-secondary select-none data-[disabled]:cursor-not-allowed", Ie = "line-clamp-2 min-w-0 pl-6 text-xs text-pho-description group-data-[wide]/scope:block group-data-[wide]/scope:truncate group-data-[wide]/scope:pl-0", Re = "flex w-full min-w-0 items-center gap-3 px-[var(--scope-inset)] py-2.5 text-left outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-2", xt = 34, yt = 18;
|
|
19
19
|
function Nt(r) {
|
|
20
20
|
const [s, m] = X({
|
|
21
21
|
wide: !0,
|