@pollinations/ui 0.1.0-alpha.1 → 0.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +137 -36
  2. package/dist/Button-CO3Dpbkj.d.cts +29 -0
  3. package/dist/Button-CO3Dpbkj.d.ts +29 -0
  4. package/dist/Chip-v-ADv6cz.d.cts +18 -0
  5. package/dist/Chip-v-ADv6cz.d.ts +18 -0
  6. package/dist/Dialog-yXzIFrDg.d.cts +63 -0
  7. package/dist/Dialog-yXzIFrDg.d.ts +63 -0
  8. package/dist/app-user-menu/sdk.cjs +631 -235
  9. package/dist/app-user-menu/sdk.cjs.map +1 -1
  10. package/dist/app-user-menu/sdk.d.cts +6 -7
  11. package/dist/app-user-menu/sdk.d.ts +6 -7
  12. package/dist/app-user-menu/sdk.js +639 -236
  13. package/dist/app-user-menu/sdk.js.map +1 -1
  14. package/dist/app.css +6 -122
  15. package/dist/auth/index.cjs +1346 -76
  16. package/dist/auth/index.cjs.map +1 -1
  17. package/dist/auth/index.d.cts +88 -6
  18. package/dist/auth/index.d.ts +88 -6
  19. package/dist/auth/index.js +1343 -75
  20. package/dist/auth/index.js.map +1 -1
  21. package/dist/auth/sdk.cjs +239 -0
  22. package/dist/auth/sdk.cjs.map +1 -0
  23. package/dist/auth/sdk.d.cts +40 -0
  24. package/dist/auth/sdk.d.ts +40 -0
  25. package/dist/auth/sdk.js +208 -0
  26. package/dist/auth/sdk.js.map +1 -0
  27. package/dist/brand/lockup-horizontal-black.png +0 -0
  28. package/dist/brand/lockup-horizontal-black.svg +4 -0
  29. package/dist/brand/lockup-horizontal-white.png +0 -0
  30. package/dist/brand/lockup-horizontal-white.svg +4 -0
  31. package/dist/brand/lockup-horizontal.svg +1 -0
  32. package/dist/brand/lockup-stacked-black.png +0 -0
  33. package/dist/brand/lockup-stacked-black.svg +4 -0
  34. package/dist/brand/lockup-stacked-white.png +0 -0
  35. package/dist/brand/lockup-stacked-white.svg +4 -0
  36. package/dist/brand/lockup-stacked.svg +4 -0
  37. package/dist/brand/mark-black.png +0 -0
  38. package/dist/brand/mark-black.svg +3 -0
  39. package/dist/brand/mark-white.png +0 -0
  40. package/dist/brand/mark-white.svg +3 -0
  41. package/dist/brand/mark.svg +1 -0
  42. package/dist/brand/polli/polli-lockup-horizontal-black.png +0 -0
  43. package/dist/brand/polli/polli-lockup-horizontal-white.png +0 -0
  44. package/dist/brand/polli/polli-lockup-stacked-black.png +0 -0
  45. package/dist/brand/polli/polli-lockup-stacked-white.png +0 -0
  46. package/dist/brand/polli/polli.png +0 -0
  47. package/dist/brand/wordmark-black.png +0 -0
  48. package/dist/brand/wordmark-black.svg +1 -0
  49. package/dist/brand/wordmark-white.png +0 -0
  50. package/dist/brand/wordmark-white.svg +1 -0
  51. package/dist/brand/wordmark.svg +1 -0
  52. package/dist/fonts/geist-pixel-square.woff2 +0 -0
  53. package/dist/gen/index.cjs +395 -214
  54. package/dist/gen/index.cjs.map +1 -1
  55. package/dist/gen/index.d.cts +64 -19
  56. package/dist/gen/index.d.ts +64 -19
  57. package/dist/gen/index.js +391 -212
  58. package/dist/gen/index.js.map +1 -1
  59. package/dist/index.browser.min.js +2 -0
  60. package/dist/index.browser.min.js.map +1 -0
  61. package/dist/index.cjs +3464 -1559
  62. package/dist/index.cjs.map +1 -1
  63. package/dist/index.d.cts +498 -174
  64. package/dist/index.d.ts +498 -174
  65. package/dist/index.js +3518 -1671
  66. package/dist/index.js.map +1 -1
  67. package/dist/licenses/Geist-OFL.txt +93 -0
  68. package/dist/markdown.cjs +821 -0
  69. package/dist/markdown.cjs.map +1 -0
  70. package/dist/markdown.d.cts +16 -0
  71. package/dist/markdown.d.ts +16 -0
  72. package/dist/markdown.js +792 -0
  73. package/dist/markdown.js.map +1 -0
  74. package/dist/styles.css +1 -1
  75. package/dist/theme.css +92 -0
  76. package/dist/wallet/index.cjs +255 -42
  77. package/dist/wallet/index.cjs.map +1 -1
  78. package/dist/wallet/index.d.cts +29 -7
  79. package/dist/wallet/index.d.ts +29 -7
  80. package/dist/wallet/index.js +254 -42
  81. package/dist/wallet/index.js.map +1 -1
  82. package/package.json +106 -89
  83. package/dist/Chip-CQCq34kS.d.cts +0 -20
  84. package/dist/Chip-Cj4xG7Te.d.ts +0 -20
  85. package/dist/assets/logo-wordmark.svg +0 -1
  86. package/dist/assets/logo.svg +0 -4
  87. package/dist/theme-jRPPBmld.d.cts +0 -20
  88. package/dist/theme-jRPPBmld.d.ts +0 -20
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/auth/index.ts","../../src/primitives/Dialog.tsx","../../src/lib/cn.ts","../../src/modules/auth/AuthModal.tsx"],"sourcesContent":["export {\n AuthInfoCard,\n type AuthInfoCardProps,\n AuthModal,\n AuthModalHeader,\n type AuthModalHeaderProps,\n AuthModalLoading,\n type AuthModalProps,\n ErrorBanner,\n} from \"./AuthModal.tsx\";\n","import { Dialog as ArkDialog } from \"@ark-ui/react/dialog\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport type { FC, ReactNode } from \"react\";\nimport { useRef } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\nimport type { ThemeName } from \"../theme.ts\";\n\nconst sizeClasses = {\n sm: \"polli:max-w-md\",\n md: \"polli:max-w-xl\",\n lg: \"polli:max-w-2xl\",\n} as const;\n\nexport type DialogProps = {\n open: boolean;\n onOpenChange?: (open: boolean) => void;\n trigger?: ReactNode;\n triggerAsChild?: boolean;\n triggerClassName?: string;\n title?: ReactNode;\n titleClassName?: string;\n ariaLabel?: string;\n labelledBy?: string;\n theme?: ThemeName;\n size?: keyof typeof sizeClasses;\n showBackdrop?: boolean;\n backdropClassName?: string;\n positionerClassName?: string;\n contentClassName?: string;\n children: ReactNode;\n};\n\nexport const Dialog: FC<DialogProps> = ({\n open,\n onOpenChange,\n trigger,\n triggerAsChild = false,\n triggerClassName,\n title,\n titleClassName,\n ariaLabel,\n labelledBy,\n theme = \"blue\",\n size = \"md\",\n showBackdrop = true,\n backdropClassName,\n positionerClassName,\n contentClassName,\n children,\n}) => {\n const contentRef = useRef<HTMLDivElement>(null);\n\n return (\n <ArkDialog.Root\n open={open}\n initialFocusEl={() => contentRef.current}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n >\n {trigger && (\n <ArkDialog.Trigger\n asChild={triggerAsChild}\n className={triggerClassName}\n >\n {trigger}\n </ArkDialog.Trigger>\n )}\n <Portal>\n {showBackdrop && (\n <ArkDialog.Backdrop\n className={cn(\n \"polli:fixed polli:inset-0 polli:z-[100] polli:bg-ink-950/50\",\n backdropClassName,\n )}\n />\n )}\n <ArkDialog.Positioner\n data-theme={theme}\n className={cn(\n \"polli:fixed polli:inset-0 polli:z-[110] polli:flex polli:h-dvh polli:items-start polli:justify-center polli:overflow-hidden polli:p-4\",\n positionerClassName,\n )}\n >\n <ArkDialog.Content\n ref={contentRef}\n data-theme={theme}\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n className={cn(\n \"polli:my-auto polli:w-full polli:overflow-hidden polli:rounded-lg polli:border-2 polli:border-theme-border polli:bg-surface-opaque polli:shadow-lg polli:outline-none polli:focus:outline-none polli:focus-visible:outline-none\",\n sizeClasses[size],\n contentClassName,\n )}\n >\n {title && (\n <DialogTitle\n className={cn(\n \"polli:px-6 polli:pt-6 polli:font-subheading polli:text-xl polli:text-theme-text-strong\",\n titleClassName,\n )}\n >\n {title}\n </DialogTitle>\n )}\n {children}\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n </Portal>\n </ArkDialog.Root>\n );\n};\n\nexport const DialogTitle = ArkDialog.Title;\n","import { clsx } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({ prefix: \"polli\" });\n\n/** Internal class merge for polli:-prefixed package primitive classes. */\nexport function cn(...inputs: (string | undefined | null | false)[]) {\n return twMerge(clsx(...inputs));\n}\n","import type { CSSProperties, ReactNode } from \"react\";\nimport logoUrl from \"../../assets/logo.svg\";\nimport { Dialog } from \"../../primitives/Dialog.tsx\";\n\nconst authLogoMaskUrl = `url('${logoUrl}')`;\n\nconst authLogoMask: CSSProperties = {\n WebkitMaskImage: authLogoMaskUrl,\n WebkitMaskPosition: \"center\",\n WebkitMaskRepeat: \"no-repeat\",\n WebkitMaskSize: \"contain\",\n maskImage: authLogoMaskUrl,\n maskPosition: \"center\",\n maskRepeat: \"no-repeat\",\n maskSize: \"contain\",\n};\n\nexport type AuthModalProps = {\n children: ReactNode;\n dialog?: {\n label?: string;\n labelledBy?: string;\n };\n tone?: \"default\" | \"error\";\n};\n\nexport function AuthModal({\n children,\n dialog,\n tone = \"default\",\n}: AuthModalProps) {\n const borderClass =\n tone === \"error\"\n ? \"polli:border-intent-danger-border\"\n : \"polli:border-theme-border\";\n return (\n <Dialog\n open\n theme=\"amber\"\n showBackdrop={false}\n ariaLabel={dialog?.label}\n labelledBy={dialog?.labelledBy}\n positionerClassName=\"polli:items-start polli:overflow-y-auto polli:bg-theme-bg-pale\"\n contentClassName={`polli:bg-surface-white polli:border-2 ${borderClass} polli:rounded-lg polli:shadow-lg polli:max-w-xl polli:w-full polli:my-auto`}\n >\n {children}\n </Dialog>\n );\n}\n\nexport type AuthModalHeaderProps = {\n children?: ReactNode;\n};\n\nexport function AuthModalHeader({ children }: AuthModalHeaderProps) {\n const logo = (\n <a\n href=\"https://pollinations.ai\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n tabIndex={-1}\n className=\"polli:block polli:shrink-0 polli:text-theme-text-strong polli:focus:outline-none\"\n aria-label=\"pollinations.ai\"\n >\n <span className=\"polli:sr-only\">pollinations.ai</span>\n <span\n aria-hidden=\"true\"\n className=\"polli:block polli:h-8 polli:w-8 polli:bg-current\"\n style={authLogoMask}\n />\n </a>\n );\n if (!children) {\n return (\n <div className=\"polli:flex polli:justify-start polli:px-6 polli:pt-6\">\n {logo}\n </div>\n );\n }\n return (\n <div className=\"polli:px-6 polli:pt-6 polli:pb-2\">\n <div className=\"polli:flex polli:items-center polli:justify-between polli:gap-3\">\n {logo}\n {children}\n </div>\n </div>\n );\n}\n\nexport function AuthModalLoading() {\n return (\n <AuthModal>\n <AuthModalHeader />\n <div className=\"polli:px-8 polli:pt-2 polli:pb-8 polli:text-center\">\n <p className=\"polli:text-theme-text-strong\">Loading...</p>\n </div>\n </AuthModal>\n );\n}\n\nexport function ErrorBanner({ children }: { children: ReactNode }) {\n return (\n <div className=\"polli:rounded-lg polli:border-2 polli:border-intent-danger-border polli:bg-intent-danger-bg-light polli:p-4\">\n <p className=\"polli:text-sm polli:text-intent-danger-text\">\n {children}\n </p>\n </div>\n );\n}\n\nexport type AuthInfoCardProps = {\n title?: string;\n children: ReactNode;\n};\n\nexport function AuthInfoCard({\n title = \"Authorize\",\n children,\n}: AuthInfoCardProps) {\n return (\n <div className=\"polli:rounded-lg polli:border-2 polli:border-theme-border polli:bg-theme-bg-pale polli:p-4\">\n <p className=\"polli:mb-2 polli:font-body polli:text-xs polli:font-semibold polli:tracking-wide polli:text-theme-text-soft\">\n {title}\n </p>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A;;;;;ACAA,oBAAoC;AACpC,oBAAuB;AAEvB,mBAAuB;;;ACHvB,kBAAqB;AACrB,4BAAoC;AAEpC,IAAM,cAAU,2CAAoB,EAAE,QAAQ,QAAQ,CAAC;AAGhD,SAAS,MAAM,QAA+C;AACjE,SAAO,YAAQ,kBAAK,GAAG,MAAM,CAAC;AAClC;;;ADmDgB;AApDhB,IAAM,cAAc;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACR;AAqBO,IAAM,SAA0B,CAAC;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AA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CACR,UACL,GACJ;AAER;AAOO,SAAS,aAAa;AAAA,EACzB,QAAQ;AAAA,EACR;AACJ,GAAsB;AAClB,SACI,8CAAC,SAAI,WAAU,8FACX;AAAA,iDAAC,OAAE,WAAU,+GACR,iBACL;AAAA,IACC;AAAA,KACL;AAER;","names":["ArkDialog","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/modules/auth/index.ts","../../src/modules/auth/AuthModal.tsx","../../src/lib/cn.ts","../../src/primitives/icons/index.tsx","../../src/primitives/Typography.tsx","../../src/compositions/Alert.tsx","../../src/primitives/Dialog.tsx","../../src/primitives/ScrollArea.tsx","../../src/lib/link.ts","../../src/primitives/InlineLink.tsx","../../src/primitives/Surface.tsx","../../src/modules/auth/DashboardAccountMenu.tsx","../../src/compositions/AccountIdentity.tsx","../../src/primitives/ChevronIcon.tsx","../../src/primitives/Dropdown.tsx","../../src/primitives/DropdownItem.tsx","../../src/primitives/Button.tsx","../../src/primitives/ColorModeToggle.tsx","../../src/modules/auth/ProviderSignInButton.tsx","../../src/modules/auth/PollinationsSignInButton.tsx","../../src/modules/auth/DashboardSignIn.tsx","../../src/modules/auth/GitHubSignInButton.tsx"],"sourcesContent":["export {\n AuthAccessItem,\n AuthFlowLayout,\n AuthInfoCard,\n type AuthInfoCardProps,\n AuthModal,\n AuthModalFootnote,\n AuthModalHeader,\n type AuthModalHeaderProps,\n AuthModalLoading,\n type AuthModalProps,\n ErrorBanner,\n} from \"./AuthModal.tsx\";\nexport { DashboardAccountMenu } from \"./DashboardAccountMenu.tsx\";\nexport { DashboardSignIn } from \"./DashboardSignIn.tsx\";\nexport { GitHubSignInButton } from \"./GitHubSignInButton.tsx\";\nexport {\n PollinationsSignInButton,\n type PollinationsSignInButtonProps,\n} from \"./PollinationsSignInButton.tsx\";\n","import type { CSSProperties, ReactNode } from \"react\";\nimport { useId } from \"react\";\nimport logoUrl from \"../../brand/mark.svg\";\nimport { Alert } from \"../../compositions/Alert.tsx\";\nimport { cn } from \"../../lib/cn.ts\";\nimport {\n Dialog,\n DialogBody,\n type DialogProps,\n} from \"../../primitives/Dialog.tsx\";\nimport { InlineLink } from \"../../primitives/InlineLink.tsx\";\nimport { CheckIcon } from \"../../primitives/icons/index.tsx\";\nimport { Surface } from \"../../primitives/Surface.tsx\";\nimport { Heading, Text } from \"../../primitives/Typography.tsx\";\n\nconst brandMask = (url: string): CSSProperties => ({\n WebkitMaskImage: `url('${url}')`,\n WebkitMaskPosition: \"left center\",\n WebkitMaskRepeat: \"no-repeat\",\n WebkitMaskSize: \"contain\",\n maskImage: `url('${url}')`,\n maskPosition: \"left center\",\n maskRepeat: \"no-repeat\",\n maskSize: \"contain\",\n});\n\nconst authMarkMask = brandMask(logoUrl);\n\nexport type AuthModalProps = {\n children: ReactNode;\n size?: DialogProps[\"size\"];\n onClose?: () => void;\n dialog?: {\n label?: string;\n labelledBy?: string;\n };\n};\n\nexport function AuthModal({ children, size, dialog, onClose }: AuthModalProps) {\n return (\n <Dialog\n open\n onOpenChange={(open) => !open && onClose?.()}\n showBackdrop={false}\n ariaLabel={dialog?.label}\n labelledBy={dialog?.labelledBy}\n positionerClassName=\"polli:bg-app-bg\"\n contentClassName=\"polli:overflow-hidden\"\n size={size}\n >\n {children}\n </Dialog>\n );\n}\n\nexport type AuthModalHeaderProps = {\n children?: ReactNode;\n};\n\nexport type AuthFlowLayoutProps = {\n children?: ReactNode;\n /** Screen title; rendered once with the shared recipe and labels the dialog. */\n title?: ReactNode;\n /** The subject of the sentence: the app, the device, the key. Sits between title and description. */\n subject?: ReactNode;\n /** One sentence under the title. */\n description?: ReactNode;\n /** What failed; rendered as the error line under the description. */\n error?: ReactNode;\n titleId?: string;\n headerAction?: ReactNode;\n actions?: ReactNode;\n /** One sentence under the actions; defaults to the legal notice. */\n footnote?: ReactNode;\n dialog?: AuthModalProps[\"dialog\"];\n size?: DialogProps[\"size\"];\n onClose?: () => void;\n};\n\nconst legalFootnote = (\n <>\n By continuing, you agree to the{\" \"}\n <InlineLink href=\"https://pollinations.ai/terms\">Terms</InlineLink> and\n acknowledge the{\" \"}\n <InlineLink href=\"https://pollinations.ai/privacy\">\n Privacy Policy\n </InlineLink>\n .\n </>\n);\n\n/** Shared sign-in chrome with stable scrolling content and actions. */\nexport function AuthFlowLayout({\n children,\n title,\n subject,\n description,\n error,\n titleId,\n headerAction,\n actions,\n footnote = legalFootnote,\n dialog,\n size,\n onClose,\n}: AuthFlowLayoutProps) {\n const generatedId = useId();\n const headingId = titleId ?? generatedId;\n return (\n <AuthModal\n dialog={dialog ?? (title ? { labelledBy: headingId } : undefined)}\n size={size}\n onClose={onClose}\n >\n <DialogBody\n actions={actions}\n footnote={<AuthModalFootnote>{footnote}</AuthModalFootnote>}\n bodyClassName=\"polli:space-y-0 polli:p-0\"\n >\n <AuthModalHeader>{headerAction}</AuthModalHeader>\n <div className=\"polli:space-y-4 polli:px-6 polli:py-4\">\n {title && (\n <div className=\"polli:space-y-3\">\n <Heading as=\"h1\" size=\"section\" id={headingId}>\n {title}\n </Heading>\n {subject}\n {description && (\n // The step instruction: body tone, so it reads as\n // the sentence's second half rather than a caption.\n <Text size=\"body\" tone=\"base\">\n {description}\n </Text>\n )}\n {error && <ErrorBanner>{error}</ErrorBanner>}\n </div>\n )}\n {children}\n </div>\n </DialogBody>\n </AuthModal>\n );\n}\n\n/** The one line under the actions: legal, dashboard, back or help. */\nexport function AuthModalFootnote({ children }: { children: ReactNode }) {\n return (\n <Text\n size=\"xs\"\n tone=\"muted\"\n className=\"polli:shrink-0 polli:px-6 polli:pb-5 polli:text-center polli:text-[13px]\"\n >\n {children}\n </Text>\n );\n}\n\nexport function AuthModalHeader({ children }: AuthModalHeaderProps) {\n const logo = (\n <a\n href=\"https://pollinations.ai\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"polli:block polli:shrink-0 polli:text-theme-text-muted polli:transition-colors polli:hover:text-theme-text-strong polli:focus-visible:outline-2 polli:focus-visible:outline-offset-4\"\n aria-label=\"pollinations.ai\"\n >\n <span className=\"polli:sr-only\">pollinations.ai</span>\n <span\n aria-hidden=\"true\"\n className=\"polli:block polli:h-8 polli:w-8 polli:bg-current\"\n style={authMarkMask}\n />\n </a>\n );\n return (\n <div className=\"polli:shrink-0 polli:p-6 polli:pb-4\">\n <div className=\"polli:flex polli:min-h-10 polli:items-start polli:justify-between polli:gap-3\">\n {logo}\n {children}\n </div>\n </div>\n );\n}\n\n/** Titled loading screen so the frame never shows an empty body. */\nexport function AuthModalLoading({\n title,\n subject,\n message = \"This only takes a moment.\",\n}: {\n title: string;\n subject?: ReactNode;\n message?: string;\n}) {\n return (\n <AuthFlowLayout title={title} subject={subject}>\n <output className=\"polli:flex polli:items-center polli:gap-2 polli:font-body polli:text-sm polli:text-theme-text-muted\">\n <span\n aria-hidden=\"true\"\n className=\"polli:h-4 polli:w-4 polli:shrink-0 polli:animate-spin polli:rounded-full polli:border-2 polli:border-current polli:border-r-transparent\"\n />\n {message}\n </output>\n </AuthFlowLayout>\n );\n}\n\nexport function ErrorBanner({ children }: { children: ReactNode }) {\n return <Alert intent=\"danger\">{children}</Alert>;\n}\n\nexport type AuthInfoCardProps = {\n title?: string | null;\n children: ReactNode;\n};\n\nexport function AuthInfoCard({ title, children }: AuthInfoCardProps) {\n return (\n <Surface className=\"polli:space-y-3 polli:font-body\">\n {title != null && (\n <p className=\"polli:font-body polli:text-sm polli:font-semibold polli:leading-5 polli:text-theme-text-strong\">\n {title}\n </p>\n )}\n {children}\n </Surface>\n );\n}\n\n/**\n * A consent row with expandable details. With `onChange` it carries a\n * checkbox; a required row passes an `icon` instead, which takes the\n * checkbox slot so the rows line up.\n */\nexport function AuthAccessItem({\n children,\n control,\n details,\n info,\n icon,\n checked = false,\n onChange,\n ariaLabel,\n disabled = false,\n}: {\n children: ReactNode;\n control?: ReactNode;\n details?: ReactNode;\n /** Help beside the row, outside its checkbox label. */\n info?: ReactNode;\n /** Rendered instead of the checkbox; the row is then always granted. */\n icon?: ReactNode;\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n ariaLabel?: string;\n disabled?: boolean;\n}) {\n // A required row has no input to label.\n const Row = icon != null ? \"div\" : \"label\";\n return (\n <li\n className={cn(\n info != null && \"polli:flex polli:flex-wrap polli:items-center\",\n )}\n >\n <Row\n className={cn(\n \"polli:flex polli:min-h-8 polli:items-center polli:gap-3 polli:font-body polli:text-sm polli:font-semibold polli:leading-5\",\n info != null && \"polli:min-w-0\",\n onChange &&\n (disabled\n ? \"polli:cursor-not-allowed\"\n : \"polli:cursor-pointer\"),\n )}\n >\n {icon != null ? (\n <span\n aria-hidden=\"true\"\n className=\"polli:flex polli:h-5 polli:w-5 polli:shrink-0 polli:items-center polli:justify-center polli:text-theme-text-strong polli:[&>svg]:h-4 polli:[&>svg]:w-4\"\n >\n {icon}\n </span>\n ) : (\n <span className=\"polli:relative polli:flex polli:h-5 polli:w-5 polli:shrink-0\">\n <input\n type=\"checkbox\"\n aria-label={ariaLabel}\n checked={checked}\n disabled={disabled || !onChange}\n onChange={(event) =>\n onChange?.(event.target.checked)\n }\n className=\"polli:peer polli:sr-only\"\n />\n <span\n aria-hidden=\"true\"\n className=\"polli:flex polli:h-5 polli:w-5 polli:items-center polli:justify-center polli:rounded polli:border polli:border-theme-text-muted/50 polli:bg-transparent polli:transition-colors polli:peer-checked:border-theme-bg-active polli:peer-checked:bg-theme-bg-active polli:peer-checked:text-theme-text-strong polli:peer-focus-visible:outline-2 polli:peer-focus-visible:outline-offset-2 polli:peer-focus-visible:outline-theme-text-soft polli:peer-disabled:opacity-50\"\n >\n {checked && (\n <CheckIcon className=\"polli:h-3.5 polli:w-3.5\" />\n )}\n </span>\n </span>\n )}\n <span\n className={cn(\n \"polli:min-w-0 polli:flex-1 polli:transition-opacity\",\n !!onChange && !checked && \"polli:opacity-60\",\n )}\n >\n {children}\n </span>\n {control != null && (\n <span className=\"polli:shrink-0\">{control}</span>\n )}\n </Row>\n {info}\n {details && (\n <div\n className={cn(\n \"polli:pl-8 polli:font-body polli:text-xs polli:font-normal polli:leading-normal polli:text-theme-text-muted\",\n info != null && \"polli:basis-full\",\n )}\n >\n {details}\n </div>\n )}\n </li>\n );\n}\n","import { clsx } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({ prefix: \"polli\" });\n\n/** Internal class merge for polli:-prefixed package primitive classes. */\nexport function cn(...inputs: (string | undefined | null | false)[]) {\n return twMerge(clsx(...inputs));\n}\n","import type { IconProps } from \"./types.ts\";\n\nconst strokeProps = {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n} as const;\n\nexport function AppIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M2 20h20\" />\n </svg>\n );\n}\n\nexport function AccountIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <circle cx=\"12\" cy=\"8\" r=\"4\" />\n <path d=\"M4 21a8 8 0 0 1 16 0\" />\n </svg>\n );\n}\n\nexport function ArrowRightIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M5 12h14M13 6l6 6-6 6\" />\n </svg>\n );\n}\n\nexport function BeakerIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M9 3h6\" />\n <path d=\"M10 3v6.5L4.5 18a2 2 0 0 0 1.7 3h11.6a2 2 0 0 0 1.7-3L14 9.5V3\" />\n <path d=\"M7 14h10\" />\n </svg>\n );\n}\n\nexport function BotIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M12 8V4H8\" />\n <rect x=\"4\" y=\"8\" width=\"16\" height=\"12\" rx=\"2\" />\n <path d=\"M2 14h2M20 14h2\" />\n <path d=\"M9 13v2M15 13v2\" />\n </svg>\n );\n}\n\nexport function BookIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M4 4h5a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H4z\" />\n <path d=\"M20 4h-5a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h6z\" />\n </svg>\n );\n}\n\nexport function BugIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"m8 2 1.9 1.9M14.1 3.9 16 2\" />\n <path d=\"M9 7V6a3 3 0 0 1 6 0v1\" />\n <path d=\"M12 20c-3.3 0-6-2.7-6-6v-3a6 6 0 0 1 12 0v3c0 3.3-2.7 6-6 6Z\" />\n <path d=\"M12 20v-9M6.5 9C4.6 8.8 3 7.1 3 5M6 13H2M3 21c0-2.1 1.7-3.9 3.8-4M17.5 9C19.4 8.8 21 7.1 21 5M18 13h4M21 21c0-2.1-1.7-3.9-3.8-4\" />\n </svg>\n );\n}\n\nexport function CheckIcon(props: IconProps) {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n {...strokeProps}\n strokeWidth={2.5}\n {...props}\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n );\n}\n\nexport function ClipboardIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" />\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n </svg>\n );\n}\n\nexport function ClockIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 7v5l3 2\" />\n </svg>\n );\n}\n\nexport function DiscordIcon(props: IconProps) {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M20.32 4.37A19.8 19.8 0 0 0 15.36 2.83a.07.07 0 0 0-.08.04c-.21.38-.45.88-.62 1.27a18.27 18.27 0 0 0-5.52 0 12.84 12.84 0 0 0-.63-1.27.08.08 0 0 0-.08-.04A19.74 19.74 0 0 0 3.47 4.37a.07.07 0 0 0-.03.03C.31 9.07-.55 13.61-.13 18.1a.08.08 0 0 0 .03.06 19.9 19.9 0 0 0 6.08 3.07.08.08 0 0 0 .09-.03c.47-.64.88-1.31 1.24-2.02a.08.08 0 0 0-.04-.1 13.08 13.08 0 0 1-1.9-.91.08.08 0 0 1-.01-.13c.13-.1.25-.2.37-.29a.07.07 0 0 1 .08-.01 14.24 14.24 0 0 0 12.38 0 .07.07 0 0 1 .08.01c.12.1.25.2.38.3a.08.08 0 0 1-.01.12 12.22 12.22 0 0 1-1.9.9.08.08 0 0 0-.04.11c.36.7.77 1.38 1.23 2.02a.08.08 0 0 0 .1.03 19.84 19.84 0 0 0 6.08-3.07.08.08 0 0 0 .03-.05c.5-5.2-.84-9.7-3.77-13.71a.06.06 0 0 0-.03-.03ZM8.02 15.37c-1.18 0-2.16-1.08-2.16-2.4 0-1.32.96-2.4 2.16-2.4 1.2 0 2.18 1.09 2.16 2.4 0 1.32-.96 2.4-2.16 2.4Zm7.96 0c-1.18 0-2.16-1.08-2.16-2.4 0-1.32.96-2.4 2.16-2.4 1.2 0 2.18 1.09 2.16 2.4 0 1.32-.95 2.4-2.16 2.4Z\"\n />\n </svg>\n );\n}\n\nexport function InstagramIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"5\" />\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <circle\n cx=\"17.5\"\n cy=\"6.5\"\n r=\"1\"\n fill=\"currentColor\"\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nexport function XSocialIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M18.24 2.25h3.31l-7.23 8.26 8.51 11.24h-6.66l-5.21-6.82-5.97 6.82H1.68l7.73-8.84L1.25 2.25h6.83l4.71 6.23 5.45-6.23Zm-1.16 17.52h1.83L7.08 4.13H5.12l11.96 15.64Z\"\n />\n </svg>\n );\n}\n\nexport function LinkedInIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M20.45 20.45h-3.56v-5.57c0-1.33-.03-3.04-1.85-3.04-1.86 0-2.14 1.45-2.14 2.94v5.67H9.34V9h3.42v1.56h.05c.47-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28ZM5.32 7.43a2.07 2.07 0 1 1 0-4.13 2.07 2.07 0 0 1 0 4.13ZM7.1 20.45H3.54V9H7.1v11.45Z\"\n />\n </svg>\n );\n}\n\nexport function DownloadIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <polyline points=\"7 10 12 15 17 10\" />\n <line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\" />\n </svg>\n );\n}\n\nexport function ExpandIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M8 3H3v5M16 3h5v5M21 16v5h-5M3 16v5h5\" />\n </svg>\n );\n}\n\nexport function PlayIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...props}>\n <path fill=\"currentColor\" d=\"M7 4.5v15l12-7.5z\" />\n </svg>\n );\n}\n\nexport function PauseIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...props}>\n <path fill=\"currentColor\" d=\"M6 4h4v16H6zM14 4h4v16h-4z\" />\n </svg>\n );\n}\n\nexport function CloudUploadIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M17.5 19H19a4 4 0 0 0 .4-8A7.5 7.5 0 0 0 5 9.5 5 5 0 0 0 6 19h1.5\" />\n <path d=\"m8.5 15.5 3.5-3.5 3.5 3.5M12 12v9\" />\n </svg>\n );\n}\n\nexport function ExternalLinkIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M7 17 17 7M9 7h8v8\" />\n </svg>\n );\n}\n\nexport function GenApiIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"m8 3 4 1.5L16 3v18l-4-1.5L8 21z\" />\n <path d=\"M8 3v18M16 3v18\" />\n </svg>\n );\n}\n\nexport function GitBranchIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <line x1=\"6\" y1=\"3\" x2=\"6\" y2=\"15\" />\n <circle cx=\"18\" cy=\"6\" r=\"3\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <path d=\"M18 9a9 9 0 0 1-9 9\" />\n </svg>\n );\n}\n\nexport function GitPullRequestIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <circle cx=\"18\" cy=\"18\" r=\"3\" />\n <path d=\"M6 9v12M13 6h3a2 2 0 0 1 2 2v7\" />\n </svg>\n );\n}\n\nexport function GraduationCapIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M21.42 10.92a1 1 0 0 0-.02-1.84L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.83l8.57 3.91a2 2 0 0 0 1.66 0z\" />\n <path d=\"M22 10v6\" />\n <path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\" />\n </svg>\n );\n}\n\nexport function SparklesIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M12 3l1.9 5.8a2 2 0 0 0 1.3 1.3L21 12l-5.8 1.9a2 2 0 0 0-1.3 1.3L12 21l-1.9-5.8a2 2 0 0 0-1.3-1.3L3 12l5.8-1.9a2 2 0 0 0 1.3-1.3z\" />\n </svg>\n );\n}\n\nexport function GitHubIcon(props: IconProps) {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M12 .5A11.5 11.5 0 0 0 8.36 22.9c.58.11.79-.25.79-.56v-2.16c-3.21.7-3.89-1.38-3.89-1.38-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.04 1.76 2.71 1.25 3.37.96.11-.75.4-1.25.74-1.54-2.56-.29-5.26-1.28-5.26-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.06 0 0 .97-.31 3.16 1.18a10.88 10.88 0 0 1 5.76 0c2.19-1.49 3.15-1.18 3.15-1.18.63 1.6.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.41.36.78 1.06.78 2.14v3.19c0 .31.21.68.8.56A11.5 11.5 0 0 0 12 .5Z\"\n />\n </svg>\n );\n}\n\nexport function ImageIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-5-5L5 21\" />\n </svg>\n );\n}\n\nexport function CubeIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"m21 16-9 5-9-5V8l9-5 9 5z\" />\n <path d=\"m3 8 9 5 9-5\" />\n <path d=\"M12 13v8\" />\n </svg>\n );\n}\n\nexport function AudioIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n </svg>\n );\n}\n\nexport function LockIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" />\n </svg>\n );\n}\n\nexport function LogInIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M10 17l5-5-5-5\" />\n <path d=\"M15 12H3\" />\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\" />\n </svg>\n );\n}\n\nexport function LogOutIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" />\n <path d=\"m16 17 5-5-5-5\" />\n <path d=\"M21 12H9\" />\n </svg>\n );\n}\n\nexport function MailIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"m3 7 9 7 9-7\" />\n </svg>\n );\n}\n\nexport function McpIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"2\" y=\"4\" width=\"8\" height=\"16\" rx=\"1.5\" />\n <rect x=\"14\" y=\"4\" width=\"8\" height=\"16\" rx=\"1.5\" />\n <path d=\"M10 12h4\" />\n </svg>\n );\n}\n\nexport function MenuIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n );\n}\n\nexport function NewspaperIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M5 4h12a1 1 0 0 1 1 1v14a1 1 0 0 0 1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1z\" />\n <path d=\"M18 8h2a1 1 0 0 1 1 1v9a2 2 0 0 1-2 2\" />\n <path d=\"M7 8h7M7 12h7M7 16h4\" />\n </svg>\n );\n}\n\nexport function PlusIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n );\n}\n\nexport function TerminalIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <polyline points=\"4 8 8 12 4 16\" />\n <line x1=\"12\" y1=\"20\" x2=\"20\" y2=\"20\" />\n </svg>\n );\n}\n\nexport function ToolIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M14.7 6.3a1 1 0 0 0 0 1.4l2.1 2.1a1 1 0 0 0 1.4 0l4-4a6 6 0 0 1-8 8l-8 8a2.8 2.8 0 0 1-4-4l8-8a6 6 0 0 1 8-8l-4 4Z\" />\n </svg>\n );\n}\n\nexport function TargetIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <circle cx=\"12\" cy=\"12\" r=\"5\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\nexport function TokensIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M4 9h16M4 15h16M10 3 8 21M16 3l-2 18\" />\n </svg>\n );\n}\n\nexport function UsageIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M4 18a8 8 0 1 1 16 0\" />\n <path d=\"M12 18l3.5-5\" />\n <path d=\"M7 18h10\" />\n <path d=\"M7.5 12.5 6 11\" />\n <path d=\"M16.5 12.5 18 11\" />\n </svg>\n );\n}\n\nexport function WarningIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M10.3 3.1 1.8 17a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.1a2 2 0 0 0-3.4 0Z\" />\n <path d=\"M12 9v4M12 17h.01\" />\n </svg>\n );\n}\n\nexport function TrendUpIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <polyline points=\"3 17 9 11 13 15 21 7\" />\n <polyline points=\"15 7 21 7 21 13\" />\n </svg>\n );\n}\n\nexport function EarningsIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <ellipse cx=\"10\" cy=\"6\" rx=\"6\" ry=\"3\" />\n <path d=\"M4 6v8c0 1.7 2.7 3 6 3 1.2 0 2.4-.2 3.3-.5\" />\n <path d=\"M16 6v4\" />\n <path d=\"M4 10c0 1.7 2.7 3 6 3 1.1 0 2.1-.1 3-.4\" />\n <path d=\"M18 14v6\" />\n <path d=\"M15 17h6\" />\n </svg>\n );\n}\n\nexport function WalletIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M3 7a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v2H5a2 2 0 0 0-2 2V7Z\" />\n <path d=\"M3 11a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z\" />\n <circle cx=\"17\" cy=\"14\" r=\"1.25\" fill=\"currentColor\" />\n </svg>\n );\n}\n\nexport function MoonIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z\" />\n </svg>\n );\n}\n\nexport function SunIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </svg>\n );\n}\n\nexport function XIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n );\n}\n\nexport function TrashIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4h8v2\" />\n <path d=\"m19 6-1 15H6L5 6\" />\n <path d=\"M10 11v6M14 11v6\" />\n </svg>\n );\n}\n\n// --- Model modality / capability / price glyphs (single-ink, replace emoji) ---\n\nexport function ChatIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />\n </svg>\n );\n}\n\nexport function RobotIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"3\" y=\"6\" width=\"18\" height=\"15\" rx=\"3\" />\n <path d=\"M12 2v4M3 11H1v5h2M21 11h2v5h-2M8 17h8\" />\n <circle cx=\"9\" cy=\"12\" r=\"1\" />\n <circle cx=\"15\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\nexport function EyeIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nexport function EyeOffIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n <path d=\"M3 3l18 18\" />\n </svg>\n );\n}\n\nexport function VideoIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"m22 8-6 4 6 4V8z\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\nexport function MicIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\nexport function SpeakerIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M11 5 6 9H2v6h4l5 4z\" />\n <path d=\"M15.54 8.46a5 5 0 0 1 0 7.07\" />\n <path d=\"M19.07 4.93a10 10 0 0 1 0 14.14\" />\n </svg>\n );\n}\n\nexport function MegaphoneIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"m3 11 18-5v12L3 14v-3z\" />\n <path d=\"m7 15 1.5 6H14l-2-7\" />\n </svg>\n );\n}\n\nexport function ReasoningIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M9 18h6M10 22h4M15.1 14c.2-1 .6-1.7 1.4-2.5A4.6 4.6 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.8.8 1.2 1.5 1.4 2.5\" />\n </svg>\n );\n}\n\nexport function RocketIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z\" />\n <path d=\"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0\" />\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n </svg>\n );\n}\n\nexport function SearchIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\nexport function SignOutIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" />\n <path d=\"m16 17 5-5-5-5\" />\n <path d=\"M21 12H9\" />\n </svg>\n );\n}\n\nexport function PowerIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M12 2v10\" />\n <path d=\"M18.4 6.6a9 9 0 1 1-12.77.04\" />\n </svg>\n );\n}\n\nexport function SparkleIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M9.94 15.5A2 2 0 0 0 8.5 14.06l-6.14-1.58a.5.5 0 0 1 0-.96L8.5 9.94A2 2 0 0 0 9.94 8.5l1.58-6.14a.5.5 0 0 1 .96 0L14.06 8.5A2 2 0 0 0 15.5 9.94l6.14 1.58a.5.5 0 0 1 0 .96L15.5 14.06a2 2 0 0 0-1.44 1.44l-1.58 6.14a.5.5 0 0 1-.96 0z\" />\n <path d=\"M20 3v4\" />\n <path d=\"M22 5h-4\" />\n <path d=\"M4 17v2\" />\n <path d=\"M5 18H3\" />\n </svg>\n );\n}\n\nexport function StarIcon({\n filled = false,\n ...props\n}: IconProps & { filled?: boolean }) {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n {...strokeProps}\n fill={filled ? \"currentColor\" : \"none\"}\n {...props}\n >\n <polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\" />\n </svg>\n );\n}\n\nexport function CodeIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"m16 18 6-6-6-6M8 6l-6 6 6 6\" />\n </svg>\n );\n}\n\nexport function DatabaseIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5v14a9 3 0 0 0 18 0V5\" />\n <path d=\"M3 12a9 3 0 0 0 18 0\" />\n </svg>\n );\n}\n\nexport function CardIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <rect x=\"2\" y=\"5\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M2 10h20\" />\n </svg>\n );\n}\n\nexport function SproutIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M7 20h10\" />\n <path d=\"M10 20c5.5-2.5.8-6.4 3-10\" />\n <path d=\"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z\" />\n <path d=\"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z\" />\n </svg>\n );\n}\n\nexport function PencilIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M12 20h9\" />\n <path d=\"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z\" />\n </svg>\n );\n}\n\nexport function KeyIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <circle cx=\"7.5\" cy=\"15.5\" r=\"5.5\" />\n <path d=\"m21 2-9.6 9.6\" />\n <path d=\"m15.5 7.5 3 3L22 7l-3-3\" />\n </svg>\n );\n}\n\nexport function GlobeIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\nexport function ArrowLeftIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M19 12H5\" />\n <path d=\"m12 19-7-7 7-7\" />\n </svg>\n );\n}\n\nexport function RefreshIcon(props: IconProps) {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" {...strokeProps} {...props}>\n <path d=\"M21 12a9 9 0 1 1-2.64-6.36\" />\n <path d=\"M21 3v6h-6\" />\n </svg>\n );\n}\n\nexport type { IconProps } from \"./types.ts\";\n","import type {\n ComponentPropsWithoutRef,\n ElementType,\n PropsWithChildren,\n} from \"react\";\nimport { cn } from \"../lib/cn.ts\";\n\ntype HeadingSize = \"display\" | \"title\" | \"section\" | \"subsection\" | \"card\";\n\ntype TextSize = \"body\" | \"sm\" | \"xs\" | \"micro\";\ntype TextTone = \"base\" | \"strong\" | \"soft\" | \"muted\";\ntype TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\n\nconst headingSizeClasses: Record<HeadingSize, string> = {\n display: \"polli:font-heading polli:text-5xl polli:leading-none\",\n title: \"polli:font-heading polli:text-4xl polli:leading-none\",\n section: \"polli:font-subheading polli:text-2xl polli:leading-tight\",\n subsection: \"polli:font-subheading polli:text-xl polli:leading-tight\",\n card: \"polli:font-subheading polli:text-lg polli:leading-tight\",\n};\n\nconst textSizeClasses: Record<TextSize, string> = {\n body: \"polli:text-base polli:leading-relaxed\",\n sm: \"polli:text-sm polli:leading-6\",\n xs: \"polli:text-xs polli:leading-normal\",\n micro: \"polli:text-micro polli:leading-normal\",\n};\n\nconst textToneClasses: Record<TextTone, string> = {\n base: \"polli:text-theme-text-base\",\n strong: \"polli:text-theme-text-strong\",\n soft: \"polli:text-theme-text-soft\",\n muted: \"polli:text-theme-text-muted\",\n};\n\nconst textWeightClasses: Record<TextWeight, string> = {\n normal: \"polli:font-normal\",\n medium: \"polli:font-medium\",\n semibold: \"polli:font-semibold\",\n bold: \"polli:font-bold\",\n};\n\nexport function headingClassName(size: HeadingSize, className?: string) {\n return cn(\n \"polli:break-words polli:text-theme-text-strong\",\n headingSizeClasses[size],\n className,\n );\n}\n\nfunction textClassName({\n size,\n tone,\n weight,\n className,\n}: {\n size: TextSize;\n tone: TextTone;\n weight: TextWeight;\n className?: string;\n}) {\n return cn(\n \"polli:break-words polli:font-body\",\n textSizeClasses[size],\n textToneClasses[tone],\n textWeightClasses[weight],\n className,\n );\n}\n\ntype HeadingOwnProps<T extends ElementType> = PropsWithChildren<{\n as?: T;\n size?: HeadingSize;\n className?: string;\n}>;\n\nexport type HeadingProps<T extends ElementType = \"h2\"> = HeadingOwnProps<T> &\n Omit<ComponentPropsWithoutRef<T>, keyof HeadingOwnProps<T>>;\n\nexport function Heading<T extends ElementType = \"h2\">({\n as,\n size = \"section\",\n className,\n children,\n ...rest\n}: HeadingProps<T>) {\n const Component = as || \"h2\";\n return (\n <Component {...rest} className={headingClassName(size, className)}>\n {children}\n </Component>\n );\n}\n\ntype TextOwnProps<T extends ElementType> = PropsWithChildren<{\n as?: T;\n size?: TextSize;\n tone?: TextTone;\n weight?: TextWeight;\n className?: string;\n}>;\n\nexport type TextProps<T extends ElementType = \"p\"> = TextOwnProps<T> &\n Omit<ComponentPropsWithoutRef<T>, keyof TextOwnProps<T>>;\n\nexport function Text<T extends ElementType = \"p\">({\n as,\n size = \"body\",\n tone = \"base\",\n weight = \"normal\",\n className,\n children,\n ...rest\n}: TextProps<T>) {\n const Component = as || \"p\";\n return (\n <Component\n {...rest}\n className={textClassName({ size, tone, weight, className })}\n >\n {children}\n </Component>\n );\n}\n","import type { ComponentPropsWithoutRef, FC, ReactNode } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\nimport { WarningIcon } from \"../primitives/icons/index.tsx\";\nimport { Text } from \"../primitives/Typography.tsx\";\n\ntype AlertIntent = \"info\" | \"advisory\" | \"warning\" | \"danger\";\n\nconst intentClasses: Record<AlertIntent, string> = {\n info: \"polli:bg-theme-bg-pale polli:text-theme-text-strong\",\n advisory: \"polli:bg-intent-warning-bg-light/45 polli:text-theme-text-base\",\n warning: \"polli:bg-intent-warning-bg-light polli:text-intent-warning-text\",\n danger: \"polli:bg-intent-danger-bg-light polli:text-intent-danger-text\",\n};\n\nexport type AlertProps = Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> & {\n intent?: AlertIntent;\n title?: ReactNode;\n};\n\nexport const Alert: FC<AlertProps> = ({\n intent = \"info\",\n title,\n className,\n children,\n ...rest\n}) => (\n <div\n {...rest}\n role={intent === \"danger\" ? \"alert\" : \"status\"}\n className={cn(\n \"polli:rounded-xl polli:px-3 polli:py-2 polli:text-sm\",\n intent === \"advisory\" && \"polli:flex polli:items-start polli:gap-2\",\n intentClasses[intent],\n className,\n )}\n >\n {intent === \"advisory\" && (\n <WarningIcon className=\"polli:mt-0.5 polli:h-4 polli:w-4 polli:shrink-0 polli:text-intent-warning-text\" />\n )}\n <div className=\"polli:min-w-0\">\n {title &&\n (intent === \"advisory\" ? (\n <>\n <strong className=\"polli:font-semibold polli:text-theme-text-strong\">\n {title}\n </strong>{\" \"}\n —{\" \"}\n </>\n ) : (\n <Text\n as=\"div\"\n size=\"xs\"\n tone=\"strong\"\n weight=\"bold\"\n className=\"polli:mb-1 polli:uppercase polli:tracking-wide\"\n >\n {title}\n </Text>\n ))}\n {children}\n </div>\n </div>\n);\n","import { Dialog as ArkDialog } from \"@ark-ui/react/dialog\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport type { ComponentPropsWithoutRef, FC, ReactNode } from \"react\";\nimport { useRef } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\nimport { ScrollArea, type ScrollAreaProps } from \"./ScrollArea.tsx\";\nimport { headingClassName } from \"./Typography.tsx\";\n\nconst sizeClasses = {\n sm: \"polli:max-w-md\",\n md: \"polli:max-w-xl\",\n lg: \"polli:max-w-[800px]\",\n xl: \"polli:max-w-6xl\",\n} as const;\n\nexport type DialogProps = {\n open: boolean;\n onOpenChange?: (open: boolean) => void;\n trigger?: ReactNode;\n triggerAsChild?: boolean;\n triggerClassName?: string;\n title?: ReactNode;\n ariaLabel?: string;\n labelledBy?: string;\n size?: keyof typeof sizeClasses;\n showBackdrop?: boolean;\n backdropBlur?: boolean;\n positionerClassName?: string;\n contentClassName?: string;\n children: ReactNode;\n};\n\nexport const Dialog: FC<DialogProps> = ({\n open,\n onOpenChange,\n trigger,\n triggerAsChild = false,\n triggerClassName,\n title,\n ariaLabel,\n labelledBy,\n size = \"md\",\n showBackdrop = true,\n backdropBlur = true,\n positionerClassName,\n contentClassName,\n children,\n}) => {\n const contentRef = useRef<HTMLDivElement>(null);\n\n return (\n <ArkDialog.Root\n open={open}\n initialFocusEl={() => contentRef.current}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n >\n {trigger && (\n <ArkDialog.Trigger\n asChild={triggerAsChild}\n className={triggerClassName}\n >\n {trigger}\n </ArkDialog.Trigger>\n )}\n <Portal>\n {showBackdrop && (\n <ArkDialog.Backdrop\n // Scrim must DARKEN in both modes — ink-950 inverts\n // (near-white in dark) and would brighten the page.\n // Fixed black + a soft blur dims and de-focuses.\n className={cn(\n \"polli:fixed polli:inset-0 polli:z-[100] polli:bg-[#000]/50\",\n backdropBlur && \"polli:backdrop-blur-sm\",\n )}\n />\n )}\n <ArkDialog.Positioner\n className={cn(\n \"polli:fixed polli:inset-0 polli:z-[110] polli:flex polli:h-dvh polli:items-start polli:justify-center polli:overflow-hidden polli:p-0 polli:sm:p-4\",\n positionerClassName,\n )}\n >\n <ArkDialog.Content\n ref={contentRef}\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n className={cn(\n \"polli:flex polli:h-dvh polli:max-h-dvh polli:w-full polli:max-sm:max-w-none polli:flex-col polli:overflow-y-auto polli:bg-theme-bg-pale polli:outline-none polli:focus:outline-none polli:focus-visible:outline-none polli:sm:my-auto polli:sm:h-auto polli:sm:max-h-[calc(100dvh-2rem)] polli:sm:rounded-2xl polli:sm:shadow-container\",\n sizeClasses[size],\n contentClassName,\n )}\n >\n {title && <DialogHeader title={title} />}\n {children}\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n </Portal>\n </ArkDialog.Root>\n );\n};\n\nexport const DialogTitle = ArkDialog.Title;\nexport const DialogDescription = ArkDialog.Description;\n\nexport type DialogHeaderProps = Omit<\n ComponentPropsWithoutRef<\"div\">,\n \"title\"\n> & {\n title?: ReactNode;\n description?: ReactNode;\n inBody?: boolean;\n titleClassName?: string;\n descriptionClassName?: string;\n};\n\nexport const DialogHeader: FC<DialogHeaderProps> = ({\n title,\n description,\n children,\n inBody = false,\n className,\n titleClassName,\n descriptionClassName,\n ...props\n}) => {\n return (\n <div\n className={cn(\n inBody\n ? \"polli:shrink-0 polli:pt-2 polli:pb-4\"\n : \"polli:shrink-0 polli:p-6 polli:pb-4\",\n className,\n )}\n {...props}\n >\n {title && (\n <DialogTitle\n className={cn(headingClassName(\"section\"), titleClassName)}\n >\n {title}\n </DialogTitle>\n )}\n {description && (\n <DialogDescription\n className={cn(\n \"polli:mt-1 polli:font-body polli:text-sm polli:font-normal polli:leading-5 polli:text-theme-text-base\",\n descriptionClassName,\n )}\n >\n {description}\n </DialogDescription>\n )}\n {children}\n </div>\n );\n};\n\nexport type DialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport type DialogBodyProps = ScrollAreaProps & {\n actions?: ReactNode;\n footnote?: ReactNode;\n bodyClassName?: string;\n};\n\n/** Full-height scroll area with floating actions and an optional bottom link. */\nexport function DialogBody({\n children,\n actions,\n footnote,\n bodyClassName,\n className,\n ...props\n}: DialogBodyProps) {\n return (\n <ScrollArea\n {...props}\n className={cn(\n \"polli:flex polli:min-h-0 polli:flex-1 polli:flex-col polli:overscroll-contain\",\n className,\n )}\n >\n <div\n className={cn(\n \"polli:grow polli:space-y-4 polli:px-6 polli:py-4\",\n bodyClassName,\n )}\n >\n {children}\n </div>\n {(actions || footnote) && (\n <div className=\"polli-dialog-floating-controls polli:pointer-events-none polli:sticky polli:bottom-0 polli:z-10\">\n {actions && (\n <DialogFooter className=\"polli:pointer-events-auto\">\n {actions}\n </DialogFooter>\n )}\n {footnote && (\n <div className=\"polli:pointer-events-auto\">\n {footnote}\n </div>\n )}\n </div>\n )}\n </ScrollArea>\n );\n}\n\nexport const DialogFooter: FC<DialogFooterProps> = ({\n children,\n className,\n ...props\n}) => {\n return (\n <div\n className={cn(\n \"polli:flex polli:shrink-0 polli:flex-wrap polli:items-center polli:justify-end polli:gap-3 polli:bg-transparent polli:p-6 polli:pt-4\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n};\n","import {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MutableRefObject,\n type PropsWithChildren,\n type Ref,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\nimport { cn } from \"../lib/cn.ts\";\n\ntype ScrollAxis = \"y\" | \"x\" | \"both\";\n\nconst axisClasses: Record<ScrollAxis, string> = {\n y: \"polli:overflow-y-auto polli:overflow-x-hidden\",\n x: \"polli:overflow-x-auto polli:overflow-y-hidden\",\n both: \"polli:overflow-auto\",\n};\n\ntype ScrollAreaOwnProps = {\n /** Scroll direction. Default `y`. */\n axis?: ScrollAxis;\n /** Use the system scrollbar instead of the custom auto-hiding track. */\n scrollbar?: \"subtle\" | \"native\";\n className?: string;\n};\n\nexport type ScrollAreaProps = PropsWithChildren<\n ScrollAreaOwnProps &\n Omit<ComponentPropsWithoutRef<\"div\">, keyof ScrollAreaOwnProps>\n>;\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref) (ref as MutableRefObject<T | null>).current = value;\n}\n\n/** Scroll container with an optional themed, auto-hiding scrollbar. */\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(\n (\n { axis = \"y\", scrollbar = \"subtle\", className, children, ...rest },\n externalRef,\n ) => {\n const innerRef = useRef<HTMLDivElement | null>(null);\n\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n innerRef.current = node;\n assignRef(externalRef, node);\n },\n [externalRef],\n );\n\n useEffect(() => {\n if (scrollbar === \"native\") return;\n const element = innerRef.current;\n if (!element) return;\n\n let hideTimer: number | null = null;\n\n const clearHideTimer = () => {\n if (hideTimer !== null) {\n window.clearTimeout(hideTimer);\n hideTimer = null;\n }\n };\n\n const show = () => {\n element.dataset.scrollbarActive = \"true\";\n clearHideTimer();\n };\n\n const hide = () => {\n element.dataset.scrollbarActive = \"false\";\n clearHideTimer();\n };\n\n const scheduleHide = () => {\n clearHideTimer();\n hideTimer = window.setTimeout(hide, 2000);\n };\n\n const handleInteraction = () => {\n show();\n scheduleHide();\n };\n\n hide();\n\n element.addEventListener(\"scroll\", handleInteraction, {\n passive: true,\n });\n element.addEventListener(\"wheel\", handleInteraction, {\n passive: true,\n });\n element.addEventListener(\"touchstart\", handleInteraction, {\n passive: true,\n });\n element.addEventListener(\"pointerdown\", handleInteraction);\n element.addEventListener(\"keydown\", handleInteraction);\n element.addEventListener(\"focusin\", handleInteraction);\n element.addEventListener(\"focusout\", scheduleHide);\n\n return () => {\n clearHideTimer();\n element.removeEventListener(\"scroll\", handleInteraction);\n element.removeEventListener(\"wheel\", handleInteraction);\n element.removeEventListener(\"touchstart\", handleInteraction);\n element.removeEventListener(\"pointerdown\", handleInteraction);\n element.removeEventListener(\"keydown\", handleInteraction);\n element.removeEventListener(\"focusin\", handleInteraction);\n element.removeEventListener(\"focusout\", scheduleHide);\n };\n }, [scrollbar]);\n\n return (\n <div\n {...rest}\n ref={setRef}\n className={cn(\n scrollbar === \"subtle\" && \"polli-scrollbar-subtle\",\n \"polli:min-w-0 polli:max-w-full\",\n axisClasses[axis],\n className,\n )}\n >\n {children}\n </div>\n );\n },\n);\n\nScrollArea.displayName = \"ScrollArea\";\n","/** Relative URLs and same-origin absolute URLs stay in the current app. */\nexport function isExternalHref(\n href: unknown,\n origin = globalThis.location?.origin,\n): boolean {\n if (typeof href !== \"string\" || !/^(https?:)?\\/\\//i.test(href))\n return false;\n if (!origin) return true;\n try {\n return new URL(href, origin).origin !== origin;\n } catch {\n return false;\n }\n}\n","import type { PropsWithChildren } from \"react\";\nimport { isExternalHref } from \"../lib/link.ts\";\nimport { ExternalLinkIcon } from \"./icons/index.tsx\";\n\ntype BaseInlineLinkProps = {\n /** Set explicitly for non-http external links, or false for custom routing components. */\n external?: boolean;\n showIcon?: boolean;\n /** Inline text inherits its size; footers use 13px and standalone links 14px. */\n size?: \"inherit\" | \"footer\" | \"sm\";\n /** Accent for prominent links; quiet for secondary navigation. */\n tone?: \"accent\" | \"quiet\";\n className?: string;\n};\n\nexport type InlineLinkProps<T extends React.ElementType = \"a\"> =\n PropsWithChildren<BaseInlineLinkProps> & {\n as?: T;\n } & Omit<\n React.ComponentPropsWithoutRef<T>,\n keyof BaseInlineLinkProps | \"as\"\n >;\n\n/** Shared text-link rule: surrounding font, selectable ink, persistent underline,\n * visible keyboard focus, and an external arrow only when leaving the app.\n * Navigation and button-shaped actions use their own primitives.\n */\nexport function InlineLink<T extends React.ElementType = \"a\">({\n as,\n external,\n showIcon = true,\n size = \"inherit\",\n tone = \"accent\",\n className,\n children,\n ...linkProps\n}: InlineLinkProps<T>) {\n const Component: React.ElementType = as || \"a\";\n const isExternal =\n external ?? isExternalHref((linkProps as { href?: unknown }).href);\n\n return (\n <Component\n target={isExternal && as !== \"button\" ? \"_blank\" : undefined}\n rel={\n isExternal && as !== \"button\"\n ? \"noopener noreferrer\"\n : undefined\n }\n className={[\"polli-link\", className].filter(Boolean).join(\" \")}\n data-size={size}\n data-tone={tone}\n {...linkProps}\n >\n {children}\n {showIcon && isExternal && (\n <ExternalLinkIcon\n aria-hidden=\"true\"\n className=\"polli-link-external-icon\"\n />\n )}\n </Component>\n );\n}\n","import type { ComponentPropsWithoutRef, ElementType } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\n\ntype SurfaceVariant = \"panel\" | \"card\" | \"card-themed\";\n\nconst variantClasses: Record<SurfaceVariant, string> = {\n panel: \"polli:rounded-2xl polli:bg-theme-bg-pale polli:p-6 polli:shadow-container\",\n card: \"polli:rounded-xl polli:bg-surface-opaque polli:p-4 polli:shadow-well\",\n \"card-themed\":\n \"polli:rounded-xl polli:bg-theme-bg-pale polli:p-4 polli:shadow-well\",\n};\n\ntype SurfaceOwnProps = {\n /**\n * Depth role (all opaque, elevation via shadow not borders):\n * - `panel` — Level 1 container: themed bg, container shadow\n * - `card` — Level 2 well: neutral surface, well shadow (default)\n * - `card-themed` — themed well: theme-tinted, well shadow\n */\n variant?: SurfaceVariant;\n className?: string;\n};\n\n/**\n * Polymorphic like Button, TabButton and LinkCard, so a card that is itself a\n * link renders one element instead of an anchor wrapping a div. Defaults to\n * <div>, so existing call sites are unchanged.\n */\nexport type SurfaceProps<T extends ElementType = \"div\"> = SurfaceOwnProps & {\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof SurfaceOwnProps | \"as\" | \"color\">;\n\nexport function Surface<T extends ElementType = \"div\">({\n as,\n variant = \"card\",\n className,\n children,\n ...rest\n}: SurfaceProps<T>) {\n const Component: ElementType = as || \"div\";\n\n return (\n <Component\n {...rest}\n className={cn(\"polli:min-w-0\", variantClasses[variant], className)}\n >\n {children}\n </Component>\n );\n}\n","import { useState } from \"react\";\nimport { AccountMenu } from \"../../compositions/AccountMenu.tsx\";\nimport { Alert } from \"../../compositions/Alert.tsx\";\nimport { DropdownItem } from \"../../primitives/DropdownItem.tsx\";\nimport { SignOutIcon } from \"../../primitives/icons/index.tsx\";\n\nexport function DashboardAccountMenu({\n user,\n onSignOut,\n className,\n side,\n}: {\n user: {\n email: string;\n name?: string;\n preferred_username?: string;\n picture?: string | null;\n };\n onSignOut: () => void | Promise<void>;\n className?: string;\n side?: \"top\" | \"bottom\";\n}) {\n const [error, setError] = useState<string | null>(null);\n return (\n <>\n {error && <Alert>{error}</Alert>}\n <AccountMenu\n name={user.name || user.preferred_username || user.email}\n avatarUrl={user.picture}\n className={className}\n side={side}\n >\n <DropdownItem\n onClick={() => {\n setError(null);\n Promise.resolve()\n .then(onSignOut)\n .catch(() =>\n setError(\n \"Could not sign out. Please try again.\",\n ),\n );\n }}\n >\n <SignOutIcon\n aria-hidden=\"true\"\n className=\"polli:h-4 polli:w-4 polli:shrink-0\"\n />\n Sign out\n </DropdownItem>\n </AccountMenu>\n </>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { useId } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\nimport { ChevronIcon } from \"../primitives/ChevronIcon.tsx\";\nimport { Dropdown, type DropdownProps } from \"../primitives/Dropdown.tsx\";\n\nfunction initials(name: string) {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"?\";\n if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();\n return `${parts[0][0] ?? \"\"}${parts.at(-1)?.[0] ?? \"\"}`.toUpperCase();\n}\n\nfunction AccountAvatar({\n name,\n avatarUrl,\n secondaryContent,\n dashboardHref,\n}: {\n name: string;\n avatarUrl?: string | null;\n secondaryContent?: ReactNode;\n dashboardHref?: string;\n}) {\n const large = secondaryContent != null;\n const className = large ? \"polli:h-11 polli:w-11\" : \"polli:h-8 polli:w-8\";\n const avatar = avatarUrl ? (\n <img\n src={avatarUrl}\n alt=\"\"\n className={cn(\n className,\n \"polli:shrink-0 polli:rounded-full polli:object-cover\",\n )}\n />\n ) : (\n <span\n role=\"img\"\n aria-label={`${name} avatar`}\n className={cn(\n className,\n \"polli:flex polli:shrink-0 polli:items-center polli:justify-center polli:rounded-full polli:bg-theme-bg-pale polli:text-xs polli:font-semibold polli:text-theme-text-strong\",\n )}\n >\n {initials(name)}\n </span>\n );\n return dashboardHref ? (\n <a\n href={dashboardHref}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Open dashboard\"\n title=\"Open dashboard\"\n className=\"polli:shrink-0 polli:rounded-full polli:cursor-pointer polli:transition-transform polli:hover:scale-105 polli:hover:brightness-110 polli:focus-visible:outline-2 polli:focus-visible:outline-offset-2 polli:focus-visible:outline-current polli:motion-reduce:transition-none polli:motion-reduce:hover:scale-100\"\n >\n {avatar}\n </a>\n ) : (\n avatar\n );\n}\n\nexport type AccountIdentityProps = {\n name: string;\n avatarUrl?: string | null;\n secondaryContent?: ReactNode;\n /** Optional dashboard destination, owned by the caller. Opens in a new tab. */\n dashboardHref?: string;\n className?: string;\n};\n\nexport function AccountIdentity({\n name,\n avatarUrl,\n secondaryContent,\n dashboardHref,\n className,\n}: AccountIdentityProps) {\n return (\n <span\n className={cn(\n \"polli:flex polli:min-w-0 polli:items-center polli:gap-2 polli:rounded-full polli:bg-surface-opaque polli:p-1 polli:pr-3\",\n className,\n )}\n >\n <AccountAvatar\n name={name}\n avatarUrl={avatarUrl}\n dashboardHref={dashboardHref}\n secondaryContent={secondaryContent}\n />\n <AccountDetails name={name} secondaryContent={secondaryContent} />\n </span>\n );\n}\n\nfunction AccountDetails({\n name,\n secondaryContent,\n secondaryId,\n}: {\n name: string;\n secondaryContent?: ReactNode;\n secondaryId?: string;\n}) {\n return (\n <span className=\"polli:flex polli:min-w-0 polli:flex-col polli:items-start polli:text-left\">\n <span\n title={name}\n className=\"polli:max-w-full polli:truncate polli:text-sm polli:font-medium polli:leading-5 polli:text-theme-text-strong\"\n >\n {name}\n </span>\n {secondaryContent != null && (\n <span\n id={secondaryId}\n className=\"polli:inline-flex polli:min-h-5 polli:items-center polli:whitespace-nowrap polli:text-xs polli:leading-4 polli:text-theme-text-base\"\n >\n {secondaryContent}\n </span>\n )}\n </span>\n );\n}\n\nexport type AccountMenuProps = AccountIdentityProps & {\n /** The caller owns navigation, permissions and sign-out behavior. */\n children: DropdownProps[\"children\"];\n menuClassName?: string;\n side?: \"top\" | \"bottom\";\n menuLabel?: string;\n};\n\n/**\n * With `dashboardHref` the avatar is a link and the name/chevron open the\n * menu; without one the whole pill is the trigger.\n */\nexport function AccountMenu({\n name,\n avatarUrl,\n dashboardHref,\n secondaryContent,\n children,\n className,\n menuClassName,\n side = \"bottom\",\n menuLabel = `Account menu for ${name}`,\n}: AccountMenuProps) {\n const statusId = useId();\n const avatar = (\n <AccountAvatar\n name={name}\n avatarUrl={avatarUrl}\n dashboardHref={dashboardHref}\n secondaryContent={secondaryContent}\n />\n );\n\n return (\n <div\n data-theme=\"accent\"\n className={cn(\n \"polli:flex polli:min-w-0 polli:items-center polli:gap-2 polli:rounded-full polli:bg-theme-bg-active polli:p-1 polli:pr-3 polli:text-theme-text-strong polli:transition-colors polli:hover:bg-theme-bg-hover\",\n className,\n )}\n >\n {dashboardHref && avatar}\n <Dropdown\n align=\"end\"\n side={side}\n className={cn(\n \"polli:w-max polli:min-w-[var(--reference-width)] polli:p-1\",\n menuClassName,\n )}\n trigger={(open) => (\n <button\n type=\"button\"\n aria-label={menuLabel}\n aria-describedby={\n secondaryContent != null ? statusId : undefined\n }\n className=\"polli-control polli:flex polli:min-w-0 polli:flex-1 polli:items-center polli:gap-2 polli:self-stretch polli:rounded-full polli:text-theme-text-strong\"\n >\n {!dashboardHref && avatar}\n <AccountDetails\n name={name}\n secondaryContent={secondaryContent}\n secondaryId={statusId}\n />\n <ChevronIcon\n expanded={open}\n className=\"polli:ml-auto polli:h-4 polli:w-4 polli:text-theme-text-strong\"\n />\n </button>\n )}\n >\n {children}\n </Dropdown>\n </div>\n );\n}\n","import type { FC } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\n\ntype ChevronIconProps = {\n /** Rotate 180° when expanded/open. */\n expanded?: boolean;\n className?: string;\n};\n\n/**\n * Canonical chevron used for collapsibles, dropdown triggers, and select pills\n * across the app. One icon everywhere.\n */\nexport const ChevronIcon: FC<ChevronIconProps> = ({ expanded, className }) => (\n <svg\n aria-hidden=\"true\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n className={cn(\n \"polli:shrink-0 polli:transition-transform polli:duration-200 polli:ease-out\",\n expanded && \"polli:rotate-180\",\n className,\n )}\n >\n <path\n d=\"M3 4.5 6 7.5l3-3\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.5\"\n />\n </svg>\n);\n","import { Popover } from \"@ark-ui/react/popover\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport type { CSSProperties, FC, ReactNode } from \"react\";\nimport { useId, useState } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\n\nconst DEFAULT_PANEL = \"polli:rounded-lg polli:bg-surface-menu polli:shadow-lg\";\n\nexport type DropdownProps = {\n /** Trigger element; receives the current open state (e.g. to rotate a chevron). */\n trigger: (open: boolean) => ReactNode;\n /** Panel content. As a function, receives `close` to dismiss after a selection. */\n children: ReactNode | ((close: () => void) => ReactNode);\n /** Panel placement relative to the trigger. */\n align?: \"start\" | \"end\";\n side?: \"top\" | \"bottom\";\n /** Controlled open state. Omit to let the Dropdown manage its own. */\n open?: boolean;\n /** Render inside the parent dialog so its focus and accessibility scope includes the menu. */\n portalled?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Appended after the surface (widths, padding, max-height…). */\n className?: string;\n /** Theme variables for portaled content that cannot inherit from its trigger. */\n panelStyle?: CSSProperties;\n};\n\nexport const Dropdown: FC<DropdownProps> = ({\n trigger,\n children,\n align = \"start\",\n side = \"bottom\",\n open: openProp,\n portalled = true,\n onOpenChange,\n className,\n panelStyle,\n}) => {\n const triggerId = useId();\n const [internalOpen, setInternalOpen] = useState(false);\n const isControlled = openProp !== undefined;\n const open = isControlled ? openProp : internalOpen;\n\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n return (\n <Popover.Root\n ids={{ trigger: triggerId }}\n open={open}\n portalled={portalled}\n onOpenChange={(details) => setOpen(details.open)}\n positioning={{\n placement: `${side}-${align}`,\n strategy: portalled ? \"absolute\" : \"fixed\",\n }}\n >\n <Popover.Trigger asChild>{trigger(open)}</Popover.Trigger>\n <Portal disabled={!portalled}>\n <Popover.Positioner>\n <Popover.Content\n aria-labelledby={triggerId}\n style={panelStyle}\n className={cn(\n \"polli:z-[120] polli:overflow-hidden polli:focus:outline-none\",\n DEFAULT_PANEL,\n className,\n )}\n >\n {typeof children === \"function\"\n ? children(() => setOpen(false))\n : children}\n </Popover.Content>\n </Popover.Positioner>\n </Portal>\n </Popover.Root>\n );\n};\n","import type { PropsWithChildren } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\n\ntype BaseDropdownItemProps = {\n className?: string;\n};\n\nexport type DropdownItemProps<T extends React.ElementType = \"button\"> =\n PropsWithChildren<BaseDropdownItemProps> & {\n as?: T;\n } & Omit<\n React.ComponentPropsWithoutRef<T>,\n keyof BaseDropdownItemProps | \"as\"\n >;\n\nexport function DropdownItem<T extends React.ElementType = \"button\">({\n as,\n className,\n children,\n ...rest\n}: DropdownItemProps<T>) {\n const Component: React.ElementType = as || \"button\";\n return (\n <Component\n {...(Component === \"button\" ? { type: \"button\" } : undefined)}\n {...rest}\n className={cn(\n \"polli-control polli:flex polli:w-full polli:cursor-pointer polli:items-center polli:gap-2 polli:rounded-lg polli:bg-transparent polli:px-3 polli:py-2 polli:text-left polli:text-sm polli:font-medium polli:text-theme-text-base polli:no-underline polli:transition-colors polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover polli:focus-visible:bg-theme-bg-hover\",\n className,\n )}\n >\n {children}\n </Component>\n );\n}\n","import type {\n PropsWithChildren,\n MouseEvent as ReactMouseEvent,\n ReactNode,\n} from \"react\";\nimport { cn } from \"../lib/cn.ts\";\n\n/** Semantic action roles. Label recipes live on Chip. */\ntype ButtonIntent = \"danger\" | \"info\" | \"neutral\" | \"brand\" | \"commit\";\nexport type ButtonAppearance = \"pill\" | \"raised\";\n\nconst pillSizes = {\n icon: \"polli:h-12 polli:w-12 polli:p-0\",\n xs: \"polli:h-5 polli:px-1.5 polli:py-0 polli:text-[11px] polli:leading-none\",\n sm: \"polli:min-h-7 polli:px-2 polli:pt-0.5 polli:pb-1\",\n md: \"polli:min-h-9 polli:px-4 polli:pt-1.5 polli:pb-2\",\n lg: \"polli:min-h-12 polli:px-6 polli:py-3\",\n} as const;\n\nconst raisedSizes = {\n icon: \"polli:h-12 polli:w-12 polli:p-0\",\n xs: \"polli:px-2 polli:py-1 polli:text-xs\",\n sm: \"polli:px-4 polli:py-2 polli:text-sm\",\n md: \"polli:px-7 polli:py-3.5 polli:text-base\",\n lg: \"polli:px-8 polli:py-4 polli:text-lg\",\n} as const;\n\nconst appearanceClasses: Record<ButtonAppearance, string> = {\n pill: \"polli:rounded-full\",\n raised:\n \"polli:rounded-xl polli:border-r-[3px] polli:border-b-[3px] polli:border-solid \" +\n \"polli:border-theme-text-strong/20 polli:hover:border-theme-text-strong/45\",\n};\n\n// Cascade-driven base — reads [data-theme] vars.\nconst themeClasses =\n \"polli:bg-theme-bg-active polli:text-theme-text-strong \" +\n \"polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover polli:transition-colors\";\n\n// Primary and destructive actions use outlines at rest.\n// Two accent families share one look: `brand` for\n// signing in (identity, calm pale hover) and `commit` for granting or saving\n// (fills with the accent only under the pointer or keyboard focus).\nconst outlined =\n \"polli:border polli:border-theme-text-soft polli:bg-surface-white polli:text-theme-text-strong \" +\n \"polli:transition-colors polli:[.dark_&]:bg-transparent\";\nconst intentClasses: Record<ButtonIntent, string> = {\n brand: `${outlined} polli:hover:bg-theme-text-soft/10`,\n commit:\n `${outlined} polli:hover:border-theme-bg-active polli:hover:bg-theme-bg-active ` +\n \"polli:focus-visible:border-theme-bg-active polli:focus-visible:bg-theme-bg-active \" +\n \"polli:[.dark_&]:hover:bg-theme-bg-active polli:[.dark_&]:focus-visible:bg-theme-bg-active\",\n danger:\n \"polli:border polli:border-intent-danger-text polli:bg-transparent polli:text-intent-danger-text \" +\n \"polli:hover:bg-intent-danger-bg-hover polli:focus-visible:bg-intent-danger-bg-hover polli:transition-colors\",\n info:\n \"polli:bg-intent-info-bg-light polli:text-intent-info-text \" +\n \"polli:hover:bg-intent-info-bg-hover polli:transition-colors\",\n // Secondary actions never take the accent: one step stronger grey on hover.\n neutral:\n \"polli:bg-theme-bg-subtle polli:text-theme-text-base \" +\n \"polli:hover:bg-theme-text-muted/25 polli:hover:text-theme-text-strong polli:transition-colors\",\n};\n\ntype BaseButtonProps = {\n icon?: ReactNode;\n /** Optional semantic recipe; omit for the ambient theme button. */\n intent?: ButtonIntent;\n /** `raised` is the stronger website CTA treatment. */\n appearance?: ButtonAppearance;\n size?: keyof typeof pillSizes;\n className?: string;\n disabled?: boolean;\n};\n\nconst buttonClasses = ({\n intent,\n appearance = \"pill\",\n size,\n className,\n disabled,\n}: BaseButtonProps & { disabled?: boolean }) => {\n const colorClasses = intent ? intentClasses[intent] : themeClasses;\n const sizeClasses = appearance === \"raised\" ? raisedSizes : pillSizes;\n return cn(\n \"polli-control polli:inline-flex polli:items-center polli:justify-center polli:self-center polli:font-body polli:text-sm polli:font-medium polli:leading-normal polli:box-border polli:border polli:border-transparent\",\n disabled\n ? \"polli:opacity-50 polli:cursor-not-allowed\"\n : \"polli:hover:filter polli:hover:brightness-105 polli:cursor-pointer\",\n colorClasses,\n appearanceClasses[appearance],\n sizeClasses[size || \"md\"],\n className,\n );\n};\n\nexport type ButtonProps<T extends React.ElementType = \"button\"> =\n PropsWithChildren<BaseButtonProps> & {\n as?: T;\n } & Omit<React.ComponentPropsWithoutRef<T>, keyof BaseButtonProps | \"as\">;\n\nexport function Button<T extends React.ElementType = \"button\">({\n as,\n children,\n icon,\n intent,\n appearance,\n size,\n className,\n disabled,\n ...buttonProps\n}: ButtonProps<T>) {\n const Component: React.ElementType = as || \"button\";\n const isButton = Component === \"button\";\n const isAnchor = Component === \"a\";\n const buttonType = (\n buttonProps as {\n type?: \"button\" | \"submit\" | \"reset\";\n }\n ).type;\n const onClick = (\n buttonProps as {\n onClick?: (event: ReactMouseEvent) => void;\n }\n ).onClick;\n const handleClick = disabled\n ? (event: ReactMouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n }\n : onClick;\n\n return (\n <Component\n {...buttonProps}\n data-intent={intent}\n {...(isButton ? { type: buttonType ?? \"button\", disabled } : {})}\n {...(!isButton && disabled\n ? { \"aria-disabled\": true, tabIndex: -1 }\n : {})}\n {...(isAnchor && disabled ? { href: undefined } : {})}\n onClick={handleClick}\n className={buttonClasses({\n intent,\n appearance,\n size,\n className,\n disabled,\n })}\n >\n {icon && (\n <span\n aria-hidden=\"true\"\n className=\"polli:mr-2 polli:flex polli:size-4 polli:shrink-0 polli:[&>svg]:size-full\"\n >\n {icon}\n </span>\n )}\n {children}\n </Component>\n );\n}\n","import { type FC, useSyncExternalStore } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\nimport { MoonIcon, SunIcon } from \"./icons/index.tsx\";\n\n/**\n * Light/dark colour mode. The chosen mode is reflected as `class=\"dark\"` on\n * <html>, which flips the design-system tokens (see styles/tokens.css: `.dark`\n * + `.dark [data-theme]`). One shared module-level store backs every\n * `useColorMode()` consumer, so duplicate toggles never desync and changes\n * propagate across tabs.\n *\n * The chosen mode is persisted to localStorage (per-origin), which also powers\n * the cross-tab `storage` sync below. Read priority: localStorage → system\n * preference.\n *\n * Host apps should set the initial class pre-paint (a tiny inline script in the\n * document head, reading the same key) to avoid a flash of light before React\n * mounts; this store is the source of truth after hydration.\n *\n * Side-effect-free on import: the <html> sync and the cross-tab listener are\n * attached lazily on first subscribe, so importing this module (e.g. via the\n * package barrel) never mutates the DOM on its own.\n */\ntype ColorMode = \"light\" | \"dark\";\n\nconst STORAGE_KEY = \"polli-color-mode\";\n\nfunction readStored(): ColorMode | null {\n try {\n const value = localStorage.getItem(STORAGE_KEY);\n return value === \"light\" || value === \"dark\" ? value : null;\n } catch {\n return null;\n }\n}\n\nfunction systemPrefersDark(): boolean {\n return (\n typeof window !== \"undefined\" &&\n window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches === true\n );\n}\n\nlet current: ColorMode =\n readStored() ?? (systemPrefersDark() ? \"dark\" : \"light\");\nconst listeners = new Set<() => void>();\n\nfunction apply(): void {\n if (typeof document === \"undefined\") return;\n document.documentElement.classList.toggle(\"dark\", current === \"dark\");\n syncThemeColor();\n}\n\n// Match the browser chrome (theme-color) to the resolved desk color by reading\n// the computed --polli-color-app-bg token — never a hardcoded value. Runs on\n// mount / mode change, after styles load, so the token resolves per mode.\nfunction syncThemeColor(): void {\n if (typeof document === \"undefined\") return;\n const appBg = getComputedStyle(document.documentElement)\n .getPropertyValue(\"--polli-color-app-bg\")\n .trim();\n if (!appBg) return;\n let meta = document.querySelector('meta[name=\"theme-color\"]');\n if (!meta) {\n meta = document.createElement(\"meta\");\n meta.setAttribute(\"name\", \"theme-color\");\n document.head.appendChild(meta);\n }\n meta.setAttribute(\"content\", appBg);\n}\n\nfunction emit(): void {\n for (const listener of listeners) listener();\n}\n\nfunction handleStorage(event: StorageEvent): void {\n if (event.key !== STORAGE_KEY) return;\n const next: ColorMode = event.newValue === \"dark\" ? \"dark\" : \"light\";\n if (next === current) return;\n current = next;\n apply();\n emit();\n}\n\nfunction subscribe(listener: () => void): () => void {\n if (listeners.size === 0 && typeof window !== \"undefined\") {\n apply(); // safety-net sync once a consumer mounts\n window.addEventListener(\"storage\", handleStorage);\n }\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0 && typeof window !== \"undefined\") {\n window.removeEventListener(\"storage\", handleStorage);\n }\n };\n}\n\nfunction getSnapshot(): ColorMode {\n return current;\n}\n\nfunction getServerSnapshot(): ColorMode {\n return \"light\";\n}\n\n/**\n * Set the color mode programmatically. Updates the shared store (so every\n * `useColorMode()` consumer re-renders), flips the `.dark` class, and persists\n * to localStorage.\n */\nexport function setColorMode(mode: ColorMode): void {\n if (mode === current) return;\n current = mode;\n apply();\n try {\n localStorage.setItem(STORAGE_KEY, mode);\n } catch {\n // ignore write failures (private mode / storage disabled)\n }\n emit();\n}\n\nexport function useColorMode(): {\n mode: ColorMode;\n isDark: boolean;\n toggle: () => void;\n} {\n const mode = useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot,\n );\n return {\n mode,\n isDark: mode === \"dark\",\n toggle: () => setColorMode(mode === \"dark\" ? \"light\" : \"dark\"),\n };\n}\n\n/**\n * Sliding sun/moon switch. Light/dark is a two-state choice, not an on/off\n * affordance, so this uses `Switch`'s shape but its own palette. The thumb\n * carries the active mode's icon tinted with the accent (`text-soft`); the\n * mode you'd switch to sits ghosted (faint neutral) on the\n * empty side. Self-contained — wires itself to `useColorMode`.\n */\nexport const ColorModeToggle: FC = () => {\n const { isDark, toggle } = useColorMode();\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isDark}\n aria-label=\"Toggle dark mode\"\n onClick={toggle}\n className=\"polli-control polli:relative polli:inline-block polli:h-7 polli:w-[52px] polli:shrink-0 polli:cursor-pointer polli:rounded-full polli:border polli:border-theme-text-strong/10 polli:bg-surface-opaque polli:transition-colors\"\n >\n {isDark ? (\n <SunIcon className=\"polli:absolute polli:top-1/2 polli:left-[7px] polli:h-3.5 polli:w-3.5 polli:-translate-y-1/2 polli:text-theme-text-strong/40\" />\n ) : (\n <MoonIcon className=\"polli:absolute polli:top-1/2 polli:right-[7px] polli:h-3.5 polli:w-3.5 polli:-translate-y-1/2 polli:text-theme-text-strong/40\" />\n )}\n <span\n className={cn(\n \"polli:absolute polli:top-1/2 polli:left-0.5 polli:flex polli:h-5 polli:w-5 polli:-translate-y-1/2 polli:items-center polli:justify-center polli:rounded-full polli:bg-app-bg polli:text-theme-text-soft polli:shadow-sm polli:transition-transform\",\n isDark ? \"polli:translate-x-[26px]\" : \"polli:translate-x-0\",\n )}\n >\n {isDark ? (\n <MoonIcon className=\"polli:h-3.5 polli:w-3.5\" />\n ) : (\n <SunIcon className=\"polli:h-3.5 polli:w-3.5\" />\n )}\n </span>\n </button>\n );\n};\n","import type { ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn.ts\";\nimport { Button, type ButtonProps } from \"../../primitives/Button.tsx\";\n\n/** Shared geometry for provider sign-in controls. */\nexport function ProviderSignInButton({\n icon,\n className,\n children,\n type = \"button\",\n ...props\n}: Omit<ButtonProps<\"button\">, \"as\"> & { icon: ReactNode }) {\n return (\n <Button\n {...props}\n type={type}\n intent=\"brand\"\n data-theme=\"accent\"\n className={cn(\"polli:gap-2 polli:whitespace-nowrap\", className)}\n >\n {icon}\n <span>{children}</span>\n </Button>\n );\n}\n","import logoUrl from \"../../brand/mark.svg\";\nimport type { ButtonProps } from \"../../primitives/Button.tsx\";\nimport { ProviderSignInButton } from \"./ProviderSignInButton.tsx\";\n\nexport type PollinationsSignInButtonProps = Omit<\n ButtonProps<\"button\">,\n \"as\"\n> & {\n isPending?: boolean;\n};\n\n/** Provider identity button; the app supplies its own sign-in action. */\nexport function PollinationsSignInButton({\n className,\n children,\n type = \"button\",\n isPending = false,\n disabled,\n ...props\n}: PollinationsSignInButtonProps) {\n return (\n <ProviderSignInButton\n type={type}\n {...props}\n disabled={disabled || isPending}\n aria-busy={isPending}\n className={className}\n icon={\n isPending ? (\n <span\n aria-hidden=\"true\"\n className=\"polli:h-5 polli:w-5 polli:shrink-0 polli:animate-spin polli:rounded-full polli:border-2 polli:border-current polli:border-r-transparent\"\n />\n ) : (\n <span\n aria-hidden=\"true\"\n className=\"polli:block polli:h-5 polli:w-5 polli:shrink-0 polli:bg-current\"\n style={{\n mask: `url('${logoUrl}') center / contain no-repeat`,\n WebkitMask: `url('${logoUrl}') center / contain no-repeat`,\n }}\n />\n )\n }\n >\n {children ?? \"Connect with Pollinations\"}\n </ProviderSignInButton>\n );\n}\n","import { Button } from \"../../primitives/Button.tsx\";\nimport { ColorModeToggle } from \"../../primitives/ColorModeToggle.tsx\";\nimport { RefreshIcon } from \"../../primitives/icons/index.tsx\";\nimport { Surface } from \"../../primitives/Surface.tsx\";\nimport { Text } from \"../../primitives/Typography.tsx\";\nimport { AuthFlowLayout, ErrorBanner } from \"./AuthModal.tsx\";\nimport { PollinationsSignInButton } from \"./PollinationsSignInButton.tsx\";\n\nconst signInErrors = {\n admin_required: {\n title: \"Admin access required\",\n message:\n \"Your Pollinations account does not have admin access. Switch accounts on Pollinations, then try again.\",\n },\n cancelled: {\n title: \"Sign-in cancelled\",\n message: \"Sign-in was cancelled. You can try again.\",\n },\n invalid_state: {\n title: \"Sign-in link expired\",\n message: \"Your Pollinations sign-in link expired. Please try again.\",\n },\n unavailable: {\n title: \"Couldn’t sign in\",\n message:\n \"Couldn’t complete your Pollinations sign-in. Please try again.\",\n },\n} as const;\n\nexport function DashboardSignIn({\n appName,\n onSignIn,\n isPending = false,\n sessionError,\n}: {\n appName: string;\n onSignIn: () => void;\n isPending?: boolean;\n sessionError?: string | null;\n}) {\n const code =\n typeof window === \"undefined\"\n ? null\n : new URLSearchParams(window.location.search).get(\"auth_error\");\n const error = sessionError\n ? { title: \"Couldn’t check your session\", message: sessionError }\n : code && Object.hasOwn(signInErrors, code)\n ? signInErrors[code as keyof typeof signInErrors]\n : null;\n return (\n <AuthFlowLayout\n headerAction={<ColorModeToggle />}\n title={!isPending && error ? error.title : \"Sign in\"}\n actions={\n isPending ? (\n <output>Checking sign-in…</output>\n ) : sessionError ? (\n <Button\n icon={<RefreshIcon />}\n onClick={() => window.location.reload()}\n className=\"polli:w-full\"\n >\n Reload\n </Button>\n ) : (\n <PollinationsSignInButton onClick={onSignIn}>\n {error ? \"Try again\" : \"Sign in with Pollinations\"}\n </PollinationsSignInButton>\n )\n }\n >\n {!isPending && error && <ErrorBanner>{error.message}</ErrorBanner>}\n <Surface>\n <Text size=\"sm\" weight=\"semibold\" tone=\"strong\">\n {appName}\n </Text>\n </Surface>\n {!(!isPending && error) && (\n <Text size=\"sm\" tone=\"muted\">\n Sign in with your Pollinations admin account.\n </Text>\n )}\n </AuthFlowLayout>\n );\n}\n","import type { ButtonProps } from \"../../primitives/Button.tsx\";\nimport { GitHubIcon } from \"../../primitives/icons/index.tsx\";\nimport { ProviderSignInButton } from \"./ProviderSignInButton.tsx\";\n\n/** The GitHub action uses the same layout as Pollinations sign-in. */\nexport function GitHubSignInButton({\n isSigningIn = false,\n disabled,\n ...props\n}: Omit<ButtonProps<\"button\">, \"as\" | \"children\"> & {\n isSigningIn?: boolean;\n}) {\n return (\n <ProviderSignInButton\n {...props}\n disabled={disabled || isSigningIn}\n aria-busy={isSigningIn}\n icon={\n <GitHubIcon\n aria-hidden=\"true\"\n className=\"polli:h-5 polli:w-5 polli:shrink-0\"\n />\n }\n >\n {isSigningIn ? \"Signing in…\" : \"Sign in with GitHub\"}\n </ProviderSignInButton>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,gBAAsB;A;;;;;ACDtB,kBAAqB;AACrB,4BAAoC;AAEpC,IAAM,cAAU,2CAAoB,EAAE,QAAQ,QAAQ,CAAC;AAGhD,SAAS,MAAM,QAA+C;AACjE,SAAO,YAAQ,kBAAK,GAAG,MAAM,CAAC;AAClC;;;ACIQ;AAVR,IAAM,cAAc;AAAA,EAChB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,eAAe;AAAA,EACf,gBAAgB;AACpB;AAqEO,SAAS,UAAU,OAAkB;AACxC,SACI;AAAA,IAAC;AAAA;AAAA,MACG,eAAY;AAAA,MACZ,SAAQ;AAAA,MACP,GAAG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B,SAAS,aAAa,IAC9D,QAAQ,OAAO,OAAO,cAAc,IAAI,IACtC,aAAa,IAAiC,IAC9C;AACR,SACI;AAAA,IAAC;AAAA;AAAA,MACG,cAAc,8CAAC,mBAAgB;AAAA,MAC/B,OAAO,CAAC,aAAa,QAAQ,MAAM,QAAQ;AAAA,MAC3C,SACI,YACI,8CAAC,YAAO,oCAAiB,IACzB,eACA;AAAA,QAAC;AAAA;AAAA,UACG,MAAM,8CAAC,eAAY;AAAA,UACnB,SAAS,MAAM,OAAO,SAAS,OAAO;AAAA,UACtC,WAAU;AAAA,UACb;AAAA;AAAA,MAED,IAEA,8CAAC,4BAAyB,SAAS,UAC9B,kBAAQ,cAAc,6BAC3B;AAAA,MAIP;AAAA,SAAC,aAAa,SAAS,8CAAC,eAAa,gBAAM,SAAQ;AAAA,QACpD,8CAAC,WACG,wDAAC,QAAK,MAAK,MAAK,QAAO,YAAW,MAAK,UAClC,mBACL,GACJ;AAAA,QACC,EAAE,CAAC,aAAa,UACb,8CAAC,QAAK,MAAK,MAAK,MAAK,SAAQ,2DAE7B;AAAA;AAAA;AAAA,EAER;AAER;;;AClEgB,IAAAC,uBAAA;AAbT,SAAS,mBAAmB;AAAA,EAC/B,cAAc;AAAA,EACd;AAAA,EACA,GAAG;AACP,GAEG;AACC,SACI;AAAA,IAAC;AAAA;AAAA,MACI,GAAG;AAAA,MACJ,UAAU,YAAY;AAAA,MACtB,aAAW;AAAA,MACX,MACI;AAAA,QAAC;AAAA;AAAA,UACG,eAAY;AAAA,UACZ,WAAU;AAAA;AAAA,MACd;AAAA,MAGH,wBAAc,qBAAgB;AAAA;AAAA,EACnC;AAER;","names":["import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","ArkDialog","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_portal","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","intentClasses","sizeClasses","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
@@ -1,27 +1,109 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
+ import { D as DialogProps } from '../Dialog-yXzIFrDg.cjs';
4
+ import { B as ButtonProps } from '../Button-CO3Dpbkj.cjs';
5
+ import '@ark-ui/react/dialog';
3
6
 
4
7
  type AuthModalProps = {
5
8
  children: ReactNode;
9
+ size?: DialogProps["size"];
10
+ onClose?: () => void;
6
11
  dialog?: {
7
12
  label?: string;
8
13
  labelledBy?: string;
9
14
  };
10
- tone?: "default" | "error";
11
15
  };
12
- declare function AuthModal({ children, dialog, tone, }: AuthModalProps): react_jsx_runtime.JSX.Element;
16
+ declare function AuthModal({ children, size, dialog, onClose }: AuthModalProps): react_jsx_runtime.JSX.Element;
13
17
  type AuthModalHeaderProps = {
14
18
  children?: ReactNode;
15
19
  };
20
+ type AuthFlowLayoutProps = {
21
+ children?: ReactNode;
22
+ /** Screen title; rendered once with the shared recipe and labels the dialog. */
23
+ title?: ReactNode;
24
+ /** The subject of the sentence: the app, the device, the key. Sits between title and description. */
25
+ subject?: ReactNode;
26
+ /** One sentence under the title. */
27
+ description?: ReactNode;
28
+ /** What failed; rendered as the error line under the description. */
29
+ error?: ReactNode;
30
+ titleId?: string;
31
+ headerAction?: ReactNode;
32
+ actions?: ReactNode;
33
+ /** One sentence under the actions; defaults to the legal notice. */
34
+ footnote?: ReactNode;
35
+ dialog?: AuthModalProps["dialog"];
36
+ size?: DialogProps["size"];
37
+ onClose?: () => void;
38
+ };
39
+ /** Shared sign-in chrome with stable scrolling content and actions. */
40
+ declare function AuthFlowLayout({ children, title, subject, description, error, titleId, headerAction, actions, footnote, dialog, size, onClose, }: AuthFlowLayoutProps): react_jsx_runtime.JSX.Element;
41
+ /** The one line under the actions: legal, dashboard, back or help. */
42
+ declare function AuthModalFootnote({ children }: {
43
+ children: ReactNode;
44
+ }): react_jsx_runtime.JSX.Element;
16
45
  declare function AuthModalHeader({ children }: AuthModalHeaderProps): react_jsx_runtime.JSX.Element;
17
- declare function AuthModalLoading(): react_jsx_runtime.JSX.Element;
46
+ /** Titled loading screen so the frame never shows an empty body. */
47
+ declare function AuthModalLoading({ title, subject, message, }: {
48
+ title: string;
49
+ subject?: ReactNode;
50
+ message?: string;
51
+ }): react_jsx_runtime.JSX.Element;
18
52
  declare function ErrorBanner({ children }: {
19
53
  children: ReactNode;
20
54
  }): react_jsx_runtime.JSX.Element;
21
55
  type AuthInfoCardProps = {
22
- title?: string;
56
+ title?: string | null;
57
+ children: ReactNode;
58
+ };
59
+ declare function AuthInfoCard({ title, children }: AuthInfoCardProps): react_jsx_runtime.JSX.Element;
60
+ /**
61
+ * A consent row with expandable details. With `onChange` it carries a
62
+ * checkbox; a required row passes an `icon` instead, which takes the
63
+ * checkbox slot so the rows line up.
64
+ */
65
+ declare function AuthAccessItem({ children, control, details, info, icon, checked, onChange, ariaLabel, disabled, }: {
23
66
  children: ReactNode;
67
+ control?: ReactNode;
68
+ details?: ReactNode;
69
+ /** Help beside the row, outside its checkbox label. */
70
+ info?: ReactNode;
71
+ /** Rendered instead of the checkbox; the row is then always granted. */
72
+ icon?: ReactNode;
73
+ checked?: boolean;
74
+ onChange?: (checked: boolean) => void;
75
+ ariaLabel?: string;
76
+ disabled?: boolean;
77
+ }): react_jsx_runtime.JSX.Element;
78
+
79
+ declare function DashboardAccountMenu({ user, onSignOut, className, side, }: {
80
+ user: {
81
+ email: string;
82
+ name?: string;
83
+ preferred_username?: string;
84
+ picture?: string | null;
85
+ };
86
+ onSignOut: () => void | Promise<void>;
87
+ className?: string;
88
+ side?: "top" | "bottom";
89
+ }): react_jsx_runtime.JSX.Element;
90
+
91
+ declare function DashboardSignIn({ appName, onSignIn, isPending, sessionError, }: {
92
+ appName: string;
93
+ onSignIn: () => void;
94
+ isPending?: boolean;
95
+ sessionError?: string | null;
96
+ }): react_jsx_runtime.JSX.Element;
97
+
98
+ /** The GitHub action uses the same layout as Pollinations sign-in. */
99
+ declare function GitHubSignInButton({ isSigningIn, disabled, ...props }: Omit<ButtonProps<"button">, "as" | "children"> & {
100
+ isSigningIn?: boolean;
101
+ }): react_jsx_runtime.JSX.Element;
102
+
103
+ type PollinationsSignInButtonProps = Omit<ButtonProps<"button">, "as"> & {
104
+ isPending?: boolean;
24
105
  };
25
- declare function AuthInfoCard({ title, children, }: AuthInfoCardProps): react_jsx_runtime.JSX.Element;
106
+ /** Provider identity button; the app supplies its own sign-in action. */
107
+ declare function PollinationsSignInButton({ className, children, type, isPending, disabled, ...props }: PollinationsSignInButtonProps): react_jsx_runtime.JSX.Element;
26
108
 
27
- export { AuthInfoCard, type AuthInfoCardProps, AuthModal, AuthModalHeader, type AuthModalHeaderProps, AuthModalLoading, type AuthModalProps, ErrorBanner };
109
+ export { AuthAccessItem, AuthFlowLayout, AuthInfoCard, type AuthInfoCardProps, AuthModal, AuthModalFootnote, AuthModalHeader, type AuthModalHeaderProps, AuthModalLoading, type AuthModalProps, DashboardAccountMenu, DashboardSignIn, ErrorBanner, GitHubSignInButton, PollinationsSignInButton, type PollinationsSignInButtonProps };
@@ -1,27 +1,109 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
+ import { D as DialogProps } from '../Dialog-yXzIFrDg.js';
4
+ import { B as ButtonProps } from '../Button-CO3Dpbkj.js';
5
+ import '@ark-ui/react/dialog';
3
6
 
4
7
  type AuthModalProps = {
5
8
  children: ReactNode;
9
+ size?: DialogProps["size"];
10
+ onClose?: () => void;
6
11
  dialog?: {
7
12
  label?: string;
8
13
  labelledBy?: string;
9
14
  };
10
- tone?: "default" | "error";
11
15
  };
12
- declare function AuthModal({ children, dialog, tone, }: AuthModalProps): react_jsx_runtime.JSX.Element;
16
+ declare function AuthModal({ children, size, dialog, onClose }: AuthModalProps): react_jsx_runtime.JSX.Element;
13
17
  type AuthModalHeaderProps = {
14
18
  children?: ReactNode;
15
19
  };
20
+ type AuthFlowLayoutProps = {
21
+ children?: ReactNode;
22
+ /** Screen title; rendered once with the shared recipe and labels the dialog. */
23
+ title?: ReactNode;
24
+ /** The subject of the sentence: the app, the device, the key. Sits between title and description. */
25
+ subject?: ReactNode;
26
+ /** One sentence under the title. */
27
+ description?: ReactNode;
28
+ /** What failed; rendered as the error line under the description. */
29
+ error?: ReactNode;
30
+ titleId?: string;
31
+ headerAction?: ReactNode;
32
+ actions?: ReactNode;
33
+ /** One sentence under the actions; defaults to the legal notice. */
34
+ footnote?: ReactNode;
35
+ dialog?: AuthModalProps["dialog"];
36
+ size?: DialogProps["size"];
37
+ onClose?: () => void;
38
+ };
39
+ /** Shared sign-in chrome with stable scrolling content and actions. */
40
+ declare function AuthFlowLayout({ children, title, subject, description, error, titleId, headerAction, actions, footnote, dialog, size, onClose, }: AuthFlowLayoutProps): react_jsx_runtime.JSX.Element;
41
+ /** The one line under the actions: legal, dashboard, back or help. */
42
+ declare function AuthModalFootnote({ children }: {
43
+ children: ReactNode;
44
+ }): react_jsx_runtime.JSX.Element;
16
45
  declare function AuthModalHeader({ children }: AuthModalHeaderProps): react_jsx_runtime.JSX.Element;
17
- declare function AuthModalLoading(): react_jsx_runtime.JSX.Element;
46
+ /** Titled loading screen so the frame never shows an empty body. */
47
+ declare function AuthModalLoading({ title, subject, message, }: {
48
+ title: string;
49
+ subject?: ReactNode;
50
+ message?: string;
51
+ }): react_jsx_runtime.JSX.Element;
18
52
  declare function ErrorBanner({ children }: {
19
53
  children: ReactNode;
20
54
  }): react_jsx_runtime.JSX.Element;
21
55
  type AuthInfoCardProps = {
22
- title?: string;
56
+ title?: string | null;
57
+ children: ReactNode;
58
+ };
59
+ declare function AuthInfoCard({ title, children }: AuthInfoCardProps): react_jsx_runtime.JSX.Element;
60
+ /**
61
+ * A consent row with expandable details. With `onChange` it carries a
62
+ * checkbox; a required row passes an `icon` instead, which takes the
63
+ * checkbox slot so the rows line up.
64
+ */
65
+ declare function AuthAccessItem({ children, control, details, info, icon, checked, onChange, ariaLabel, disabled, }: {
23
66
  children: ReactNode;
67
+ control?: ReactNode;
68
+ details?: ReactNode;
69
+ /** Help beside the row, outside its checkbox label. */
70
+ info?: ReactNode;
71
+ /** Rendered instead of the checkbox; the row is then always granted. */
72
+ icon?: ReactNode;
73
+ checked?: boolean;
74
+ onChange?: (checked: boolean) => void;
75
+ ariaLabel?: string;
76
+ disabled?: boolean;
77
+ }): react_jsx_runtime.JSX.Element;
78
+
79
+ declare function DashboardAccountMenu({ user, onSignOut, className, side, }: {
80
+ user: {
81
+ email: string;
82
+ name?: string;
83
+ preferred_username?: string;
84
+ picture?: string | null;
85
+ };
86
+ onSignOut: () => void | Promise<void>;
87
+ className?: string;
88
+ side?: "top" | "bottom";
89
+ }): react_jsx_runtime.JSX.Element;
90
+
91
+ declare function DashboardSignIn({ appName, onSignIn, isPending, sessionError, }: {
92
+ appName: string;
93
+ onSignIn: () => void;
94
+ isPending?: boolean;
95
+ sessionError?: string | null;
96
+ }): react_jsx_runtime.JSX.Element;
97
+
98
+ /** The GitHub action uses the same layout as Pollinations sign-in. */
99
+ declare function GitHubSignInButton({ isSigningIn, disabled, ...props }: Omit<ButtonProps<"button">, "as" | "children"> & {
100
+ isSigningIn?: boolean;
101
+ }): react_jsx_runtime.JSX.Element;
102
+
103
+ type PollinationsSignInButtonProps = Omit<ButtonProps<"button">, "as"> & {
104
+ isPending?: boolean;
24
105
  };
25
- declare function AuthInfoCard({ title, children, }: AuthInfoCardProps): react_jsx_runtime.JSX.Element;
106
+ /** Provider identity button; the app supplies its own sign-in action. */
107
+ declare function PollinationsSignInButton({ className, children, type, isPending, disabled, ...props }: PollinationsSignInButtonProps): react_jsx_runtime.JSX.Element;
26
108
 
27
- export { AuthInfoCard, type AuthInfoCardProps, AuthModal, AuthModalHeader, type AuthModalHeaderProps, AuthModalLoading, type AuthModalProps, ErrorBanner };
109
+ export { AuthAccessItem, AuthFlowLayout, AuthInfoCard, type AuthInfoCardProps, AuthModal, AuthModalFootnote, AuthModalHeader, type AuthModalHeaderProps, AuthModalLoading, type AuthModalProps, DashboardAccountMenu, DashboardSignIn, ErrorBanner, GitHubSignInButton, PollinationsSignInButton, type PollinationsSignInButtonProps };