@photon-ai/pho-ui 4.26.0 → 4.27.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/README.md +2 -2
- package/dist/chunks/{avatar-PgBOfszL.js → avatar-BJvgi8ON.js} +24 -30
- package/dist/chunks/avatar-BJvgi8ON.js.map +1 -0
- package/dist/chunks/{basic-page-aep8pM4s.js → basic-page-DSPzDKrZ.js} +79 -82
- package/dist/chunks/basic-page-DSPzDKrZ.js.map +1 -0
- package/dist/chunks/{box-search-CMl5bQ7Y.js → box-search-DD2EPtDy.js} +18 -19
- package/dist/chunks/box-search-DD2EPtDy.js.map +1 -0
- package/dist/chunks/{calendar-DDWITGo4.js → calendar-s-QRks1Z.js} +66 -69
- package/dist/chunks/calendar-s-QRks1Z.js.map +1 -0
- package/dist/chunks/{chat-D98GCjbe.js → chat-D6SGRahp.js} +226 -276
- package/dist/chunks/chat-D6SGRahp.js.map +1 -0
- package/dist/chunks/{checkbox-D8smFViR.js → checkbox-B3fVczYP.js} +2 -2
- package/dist/chunks/checkbox-B3fVczYP.js.map +1 -0
- package/dist/chunks/{close-button-Ck4rY1Fp.js → close-button-Bwv_OoCZ.js} +2 -2
- package/dist/chunks/close-button-Bwv_OoCZ.js.map +1 -0
- package/dist/chunks/{code-block-CthLWfxd.js → code-block-CiZWZBO2.js} +169 -238
- package/dist/chunks/code-block-CiZWZBO2.js.map +1 -0
- package/dist/chunks/copy-button-DNNZu6r4.js +69 -0
- package/dist/chunks/copy-button-DNNZu6r4.js.map +1 -0
- package/dist/chunks/{data-table-C1tLUdw0.js → data-table-CshUlqIu.js} +11 -12
- package/dist/chunks/data-table-CshUlqIu.js.map +1 -0
- package/dist/chunks/{date-picker-D-sWo3i8.js → date-picker-BaAkim2u.js} +126 -151
- package/dist/chunks/date-picker-BaAkim2u.js.map +1 -0
- package/dist/chunks/{description-list-DcTvBHzI.js → description-list-VTNz1MmJ.js} +2 -2
- package/dist/chunks/{description-list-DcTvBHzI.js.map → description-list-VTNz1MmJ.js.map} +1 -1
- package/dist/chunks/{dialog-H72fZGtf.js → dialog-C116Qr0w.js} +2 -2
- package/dist/chunks/{dialog-H72fZGtf.js.map → dialog-C116Qr0w.js.map} +1 -1
- package/dist/chunks/{filter-bar-D_sBAT5Y.js → filter-bar-DI5JO1Cd.js} +63 -72
- package/dist/chunks/filter-bar-DI5JO1Cd.js.map +1 -0
- package/dist/chunks/{ghost-search-CMUI2UH0.js → ghost-search-DhADxaWi.js} +11 -12
- package/dist/chunks/ghost-search-DhADxaWi.js.map +1 -0
- package/dist/chunks/icons-eq5FZ3Yc.js +1254 -0
- package/dist/chunks/icons-eq5FZ3Yc.js.map +1 -0
- package/dist/chunks/{input-DWnb33UF.js → input-hrrPhzXp.js} +37 -56
- package/dist/chunks/input-hrrPhzXp.js.map +1 -0
- package/dist/chunks/{select-Dux2SBVc.js → select-DlyDd7AB.js} +10 -10
- package/dist/chunks/select-DlyDd7AB.js.map +1 -0
- package/dist/chunks/{sidebar-ttBkgGRh.js → sidebar-DTRcoxrB.js} +95 -111
- package/dist/chunks/sidebar-DTRcoxrB.js.map +1 -0
- package/dist/chunks/{toast-Cbnn8lcA.js → toast-Btwu5Kjk.js} +7 -7
- package/dist/chunks/toast-Btwu5Kjk.js.map +1 -0
- package/dist/chunks/{trace-ClMpG82z.js → trace-CKYAff2U.js} +498 -607
- package/dist/chunks/trace-CKYAff2U.js.map +1 -0
- package/dist/components/avatar.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/chat.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/command.js +36 -37
- package/dist/components/command.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/error.js +252 -11
- package/dist/components/error.js.map +1 -0
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/notification.js +27 -34
- package/dist/components/notification.js.map +1 -1
- package/dist/components/phone-input.js +3 -4
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/scope.js +52 -53
- package/dist/components/scope.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/theme-toggle.js +69 -95
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/icons.js +235 -78
- package/dist/icons.js.map +1 -1
- package/dist/index.js +158 -158
- package/dist/sections/basic-page.js +2 -2
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/avatar/avatar.d.ts +1 -1
- package/dist/src/components/notification/notification.d.ts +2 -2
- package/dist/src/components/trace/decorations.d.ts +3 -3
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/photon/icons.d.ts +315 -0
- package/dist/src/icons/photon/index.d.ts +2 -0
- package/dist/src/icons/photon/photon-icon.d.ts +51 -0
- package/package.json +5 -3
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js +0 -14
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js.map +0 -1
- package/dist/chunks/IconCheck-DwSMn1wK.js +0 -11
- package/dist/chunks/IconCheck-DwSMn1wK.js.map +0 -1
- package/dist/chunks/IconChevronDown-Cd68NnX2.js +0 -11
- package/dist/chunks/IconChevronDown-Cd68NnX2.js.map +0 -1
- package/dist/chunks/IconChevronLeft-CptqhdxO.js +0 -11
- package/dist/chunks/IconChevronLeft-CptqhdxO.js.map +0 -1
- package/dist/chunks/IconChevronRight-BNkXCTk6.js +0 -11
- package/dist/chunks/IconChevronRight-BNkXCTk6.js.map +0 -1
- package/dist/chunks/IconChevronUp-Bxllwz8J.js +0 -11
- package/dist/chunks/IconChevronUp-Bxllwz8J.js.map +0 -1
- package/dist/chunks/IconInfoCircle-CTAynhe8.js +0 -21
- package/dist/chunks/IconInfoCircle-CTAynhe8.js.map +0 -1
- package/dist/chunks/IconSearch-DkcWWZ1H.js +0 -14
- package/dist/chunks/IconSearch-DkcWWZ1H.js.map +0 -1
- package/dist/chunks/IconX-DnPlFC68.js +0 -14
- package/dist/chunks/IconX-DnPlFC68.js.map +0 -1
- package/dist/chunks/avatar-PgBOfszL.js.map +0 -1
- package/dist/chunks/basic-page-aep8pM4s.js.map +0 -1
- package/dist/chunks/box-search-CMl5bQ7Y.js.map +0 -1
- package/dist/chunks/calendar-DDWITGo4.js.map +0 -1
- package/dist/chunks/chat-D98GCjbe.js.map +0 -1
- package/dist/chunks/checkbox-D8smFViR.js.map +0 -1
- package/dist/chunks/close-button-Ck4rY1Fp.js.map +0 -1
- package/dist/chunks/code-block-CthLWfxd.js.map +0 -1
- package/dist/chunks/copy-button-BLvirhXk.js +0 -76
- package/dist/chunks/copy-button-BLvirhXk.js.map +0 -1
- package/dist/chunks/data-table-C1tLUdw0.js.map +0 -1
- package/dist/chunks/date-picker-D-sWo3i8.js.map +0 -1
- package/dist/chunks/error-BT71wcUd.js +0 -270
- package/dist/chunks/error-BT71wcUd.js.map +0 -1
- package/dist/chunks/filter-bar-D_sBAT5Y.js.map +0 -1
- package/dist/chunks/ghost-search-CMUI2UH0.js.map +0 -1
- package/dist/chunks/input-DWnb33UF.js.map +0 -1
- package/dist/chunks/select-Dux2SBVc.js.map +0 -1
- package/dist/chunks/sidebar-ttBkgGRh.js.map +0 -1
- package/dist/chunks/toast-Cbnn8lcA.js.map +0 -1
- package/dist/chunks/trace-ClMpG82z.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","names":["_Fragment","cn","Button","ButtonLink","WarningIcon","InfoIcon","IconAlertCircleFilled","IconAlertTriangleFilled","Popover","StatusView","useEffect","useRef","useState","Fragment$1","jsx","jsxs","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":["../../src/components/error/problem.ts","../../src/components/error/error.tsx"],"sourcesContent":["/**\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 IconAlertTriangleFilled,\n} from \"@tabler/icons-react\";\nimport { InfoIcon, WarningIcon } from \"../../icons/photon\";\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 <InfoIcon 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 ?? <WarningIcon />}\n title={displayCopy(title ?? copy.title)}\n description={body}\n actions={resolvedActions}\n {...props}\n />\n );\n}\n\nErrorView.displayName = \"ErrorView\";\n"],"mappings":";;;;;;;;;;AAqCA,SAAgBgB,EAAU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K;AAAA,IACC,MAAAsD;AAAA,IACN,MAAMH,KAAQ,gBAAA9C,EAACV,GAAD,CAAc,CAAA;AAAA,IAC5B,OAAOoC,EAAYmB,KAASZ,EAAK,KAAK;AAAA,IACtC,aAAakB;AAAA,IACb,SAASC;AAAA,IACT,GAAIpB;AAAA,EACL,CAAA;AAEL;AAEAY,EAAU,cAAc"}
|
package/dist/components/input.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t } from "../chunks/cn-CPbhpG1q.js";
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as N } from "../chunks/IconX-DnPlFC68.js";
|
|
3
|
+
import { t as b } from "../chunks/resolve-variant-CcD8iG5l.js";
|
|
4
|
+
import { A as y, L as N, _t as i } from "../chunks/icons-eq5FZ3Yc.js";
|
|
5
|
+
import { t as C } from "../chunks/createReactComponent-yKZn9MIX.js";
|
|
7
6
|
import "react";
|
|
8
7
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
8
|
+
var I = [
|
|
10
9
|
["path", {
|
|
11
10
|
d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",
|
|
12
11
|
key: "svg-0"
|
|
@@ -19,13 +18,7 @@ var k = [
|
|
|
19
18
|
d: "M12 16h.01",
|
|
20
19
|
key: "svg-2"
|
|
21
20
|
}]
|
|
22
|
-
], c =
|
|
23
|
-
d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
24
|
-
key: "svg-0"
|
|
25
|
-
}], ["path", {
|
|
26
|
-
d: "M9 12l2 2l4 -4",
|
|
27
|
-
key: "svg-1"
|
|
28
|
-
}]], I = d("outline", "circle-check", "CircleCheck", C), w = {
|
|
21
|
+
], c = C("outline", "alert-circle", "AlertCircle", I), w = {
|
|
29
22
|
brand: {
|
|
30
23
|
classes: "text-pho-brand",
|
|
31
24
|
description: "Informational / product update (default)"
|
|
@@ -46,23 +39,23 @@ var k = [
|
|
|
46
39
|
classes: "text-pho-error",
|
|
47
40
|
description: "Something went wrong"
|
|
48
41
|
}
|
|
49
|
-
},
|
|
50
|
-
brand:
|
|
51
|
-
gray:
|
|
52
|
-
success:
|
|
42
|
+
}, k = {
|
|
43
|
+
brand: i,
|
|
44
|
+
gray: i,
|
|
45
|
+
success: y,
|
|
53
46
|
warning: c,
|
|
54
47
|
error: c
|
|
55
48
|
}, l = "cursor-pointer font-heading text-base font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
56
|
-
function
|
|
57
|
-
const
|
|
49
|
+
function A({ color: a = "brand", title: d, description: s, confirmLabel: n, onConfirm: p, dismissLabel: h = "Dismiss", onClose: r, icon: u, className: m, ref: f, ...x }) {
|
|
50
|
+
const v = u ?? k[a], g = !!n;
|
|
58
51
|
return /* @__PURE__ */ o("div", {
|
|
59
|
-
ref:
|
|
52
|
+
ref: f,
|
|
60
53
|
...x,
|
|
61
|
-
className: t("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",
|
|
54
|
+
className: t("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", m),
|
|
62
55
|
children: [
|
|
63
|
-
/* @__PURE__ */ e(
|
|
56
|
+
/* @__PURE__ */ e(v, {
|
|
64
57
|
"aria-hidden": "true",
|
|
65
|
-
className: t("mt-0.5 size-5 shrink-0",
|
|
58
|
+
className: t("mt-0.5 size-5 shrink-0", b(w, a))
|
|
66
59
|
}),
|
|
67
60
|
/* @__PURE__ */ o("div", {
|
|
68
61
|
className: "flex flex-1 flex-col gap-3 pr-6",
|
|
@@ -70,29 +63,29 @@ function _({ color: a = "brand", title: p, description: r, confirmLabel: i, onCo
|
|
|
70
63
|
className: "flex flex-col",
|
|
71
64
|
children: [/* @__PURE__ */ e("p", {
|
|
72
65
|
className: "text-pho-primary font-heading text-base font-medium",
|
|
73
|
-
children:
|
|
74
|
-
}),
|
|
66
|
+
children: d
|
|
67
|
+
}), s != null && s !== !1 && /* @__PURE__ */ e("p", {
|
|
75
68
|
className: "text-pho-description text-base",
|
|
76
|
-
children:
|
|
69
|
+
children: s
|
|
77
70
|
})]
|
|
78
|
-
}),
|
|
71
|
+
}), g && /* @__PURE__ */ o("div", {
|
|
79
72
|
className: "flex gap-4",
|
|
80
73
|
children: [/* @__PURE__ */ e("button", {
|
|
81
74
|
type: "button",
|
|
82
|
-
onClick:
|
|
75
|
+
onClick: p,
|
|
83
76
|
className: t(l, "text-pho-brand hover:underline"),
|
|
84
|
-
children:
|
|
77
|
+
children: n
|
|
85
78
|
}), /* @__PURE__ */ e("button", {
|
|
86
79
|
type: "button",
|
|
87
|
-
onClick:
|
|
80
|
+
onClick: r,
|
|
88
81
|
className: t(l, "text-pho-secondary hover:text-pho-secondary-hover"),
|
|
89
|
-
children:
|
|
82
|
+
children: h
|
|
90
83
|
})]
|
|
91
84
|
})]
|
|
92
85
|
}),
|
|
93
|
-
|
|
86
|
+
r && /* @__PURE__ */ e("button", {
|
|
94
87
|
type: "button",
|
|
95
|
-
onClick:
|
|
88
|
+
onClick: r,
|
|
96
89
|
"aria-label": "Dismiss",
|
|
97
90
|
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",
|
|
98
91
|
children: /* @__PURE__ */ e(N, { "aria-hidden": "true" })
|
|
@@ -100,10 +93,10 @@ function _({ color: a = "brand", title: p, description: r, confirmLabel: i, onCo
|
|
|
100
93
|
]
|
|
101
94
|
});
|
|
102
95
|
}
|
|
103
|
-
|
|
96
|
+
A.displayName = "Notification";
|
|
104
97
|
export {
|
|
105
98
|
w as NOTIFICATION_COLORS,
|
|
106
|
-
|
|
99
|
+
A as Notification
|
|
107
100
|
};
|
|
108
101
|
|
|
109
102
|
//# sourceMappingURL=notification.js.map
|
|
@@ -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 font-heading 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,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,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":["resolveVariant","CheckCircleIcon","CloseIcon","InfoIcon","createReactComponent","jsx","jsxs","__iconNode","IconAlertCircle","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","../../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","import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\nimport { IconAlertCircle } from \"@tabler/icons-react\";\nimport {\n CheckCircleIcon,\n CloseIcon,\n InfoIcon,\n type IconComponent,\n} from \"../../icons/photon\";\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: InfoIcon,\n gray: InfoIcon,\n success: CheckCircleIcon,\n warning: IconAlertCircle,\n error: IconAlertCircle,\n} satisfies Record<NotificationColor, IconComponent>;\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?: IconComponent;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst LINK_CLASS =\n \"cursor-pointer font-heading 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 <CloseIcon aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n}\n\nNotification.displayName = \"Notification\";\n"],"ignoreList":[0],"mappings":";;;;;;;AASA,IAAMO,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,GACtLC,IAAkBJ,EAAqB,WAAW,gBAAgB,eAAeG,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;AAA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;AAAA,UACK,CAAA,GACR,gBAAAX,EAAC,UAAD;AAAA,YACE,MAAK;AAAA,YACL,SAASc;AAAA,YACT,WAAWO,EACTf,GACA,mDACF;AAAA,YAEC,UAAAO;AAAA,UACK,CAAA,CACL;AAAA,QAEJ,CAAA,CAAA;AAAA,M;A,MAEJC,KACC,gBAAAd,EAAC,UAAD;AAAA,QACE,MAAK;AAAA,QACL,SAASc;AAAA,QACT,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,UAAA,gBAAAd,EAACH,GAAD,EAAW,eAAY,OAAQ,CAAA;AAAA,MACzB,CAAA;AAAA,IAEP;AAAA,E;AAET;AAEAU,EAAa,cAAc"}
|
|
@@ -3,8 +3,7 @@ import { t as f4 } from "../chunks/rolldown-runtime-wKSmTnsc.js";
|
|
|
3
3
|
import { t as S1 } from "../chunks/cn-CPbhpG1q.js";
|
|
4
4
|
import { SPRING_PRESS_INLINE as $4 } from "../motion.js";
|
|
5
5
|
import { r as E4 } from "../chunks/use-press-pulse-IbNstUT0.js";
|
|
6
|
-
import {
|
|
7
|
-
import { t as g4 } from "../chunks/IconChevronDown-Cd68NnX2.js";
|
|
6
|
+
import { M as p4, j as g4 } from "../chunks/icons-eq5FZ3Yc.js";
|
|
8
7
|
import { t as U } from "../chunks/input-group-C3upo2OU.js";
|
|
9
8
|
import { t as b } from "../chunks/combobox-C_yfFCFL.js";
|
|
10
9
|
import e, { useEffect as z4, useId as w4, useLayoutEffect as M4, useMemo as le, useRef as H1, useState as re } from "react";
|
|
@@ -16921,7 +16920,7 @@ function ei({ value: r, defaultValue: t, onValueChange: l, defaultCountry: n = "
|
|
|
16921
16920
|
className: "tabular-nums",
|
|
16922
16921
|
children: ["+", W(w)]
|
|
16923
16922
|
})]
|
|
16924
|
-
}), /* @__PURE__ */ p(
|
|
16923
|
+
}), /* @__PURE__ */ p(p4, {})]
|
|
16925
16924
|
}), /* @__PURE__ */ p(b.Portal, { children: /* @__PURE__ */ p(b.Positioner, {
|
|
16926
16925
|
align: "start",
|
|
16927
16926
|
sideOffset: 8,
|
|
@@ -16940,7 +16939,7 @@ function ei({ value: r, defaultValue: t, onValueChange: l, defaultCountry: n = "
|
|
|
16940
16939
|
/* @__PURE__ */ p(b.Empty, { children: "No countries found." }),
|
|
16941
16940
|
/* @__PURE__ */ p(b.List, { children: (s) => /* @__PURE__ */ M(b.Item, {
|
|
16942
16941
|
value: s,
|
|
16943
|
-
children: [/* @__PURE__ */ p(b.ItemIndicator, { children: /* @__PURE__ */ p(
|
|
16942
|
+
children: [/* @__PURE__ */ p(b.ItemIndicator, { children: /* @__PURE__ */ p(g4, {}) }), /* @__PURE__ */ M("span", {
|
|
16944
16943
|
className: "col-start-2 flex min-w-0 items-center justify-between gap-3",
|
|
16945
16944
|
children: [/* @__PURE__ */ M("span", {
|
|
16946
16945
|
className: "flex min-w-0 items-center gap-2",
|