@pollinations/ui 0.1.0-alpha.22 → 0.1.0-alpha.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-user-menu/sdk.d.ts +1 -1
- package/dist/app-user-menu/sdk.js +4 -4
- package/dist/auth/index.js +4 -4
- package/dist/{chunk-SJK5B7LK.js → chunk-2IIX44MN.js} +2 -2
- package/dist/{chunk-6JHDHH4B.js → chunk-7NTX3FPZ.js} +13 -2
- package/dist/{chunk-6JHDHH4B.js.map → chunk-7NTX3FPZ.js.map} +1 -1
- package/dist/{chunk-MLSAAT6D.js → chunk-FRHLA7LM.js} +2 -2
- package/dist/{chunk-E4CIH2Z7.js → chunk-KXWBNF64.js} +3 -3
- package/dist/{chunk-5SPNBGNW.js → chunk-LKOYOXBG.js} +2 -2
- package/dist/{chunk-COG4IB62.js → chunk-LRXUPEQM.js} +2 -2
- package/dist/connect.js.map +1 -1
- package/dist/gen/index.js +2 -1
- package/dist/gen/index.js.map +1 -1
- package/dist/{index-cN1wvU_m.d.ts → index-efnABLqH.d.ts} +3 -1
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.d.ts +24 -6
- package/dist/index.js +66 -31
- package/dist/index.js.map +1 -1
- package/dist/markdown.js +3 -3
- package/dist/styles.css +1 -1
- package/dist/wallet/index.js +3 -3
- package/package.json +5 -5
- /package/dist/{chunk-SJK5B7LK.js.map → chunk-2IIX44MN.js.map} +0 -0
- /package/dist/{chunk-MLSAAT6D.js.map → chunk-FRHLA7LM.js.map} +0 -0
- /package/dist/{chunk-E4CIH2Z7.js.map → chunk-KXWBNF64.js.map} +0 -0
- /package/dist/{chunk-5SPNBGNW.js.map → chunk-LKOYOXBG.js.map} +0 -0
- /package/dist/{chunk-COG4IB62.js.map → chunk-LRXUPEQM.js.map} +0 -0
package/dist/gen/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
CardIcon,
|
|
19
19
|
SproutIcon
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-7NTX3FPZ.js";
|
|
21
21
|
import {
|
|
22
22
|
cn
|
|
23
23
|
} from "../chunk-LKUZU37X.js";
|
|
@@ -149,6 +149,7 @@ var CATEGORY_LABELS = {
|
|
|
149
149
|
image: "Image",
|
|
150
150
|
video: "Video",
|
|
151
151
|
text: "Text",
|
|
152
|
+
decision: "Decision",
|
|
152
153
|
audio: "Audio",
|
|
153
154
|
"3d": "3D",
|
|
154
155
|
embedding: "Embeddings",
|
package/dist/gen/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/modules/gen/themes.ts","../../src/modules/gen/ModalityChip.tsx","../../src/modules/gen/ModalityDot.tsx","../../src/modules/gen/ModalityTab.tsx","../../src/modules/gen/ModelAccessIcon.tsx","../../src/modules/gen/ModelSelector.tsx"],"sourcesContent":["/** Pollinations model-modality colors. Single-accent model: modality is NOT a\n * page theme — each modality is a fixed color from the `--polli-color-modality-*`\n * tokens, applied as a dot/badge via inline style (the key is dynamic, so a CSS\n * var beats a Tailwind class). The token VALUES live in styles/tokens.css. */\nimport type { ModelCategory } from \"@pollinations/sdk\";\n\n/** The canonical modality keys (match the `--polli-color-modality-*` tokens). */\ntype ModalityKey = ModelCategory;\n\nconst MODALITIES: readonly ModelCategory[] = [\n \"text\",\n \"image\",\n \"video\",\n \"audio\",\n \"realtime\",\n \"embedding\",\n];\n\n/** Map an untrusted category string to its modality key; null if unknown. */\nexport function getModalityKey(category: string): ModalityKey | null {\n const lower = category.toLowerCase();\n if (lower === \"images\") return \"image\";\n if (lower === \"embeddings\") return \"embedding\";\n return MODALITIES.includes(lower as ModelCategory)\n ? (lower as ModelCategory)\n : null;\n}\n\n/** CSS var for a modality's solid color (dot / border / icon). */\nexport const modalityColorVar = (key: ModalityKey): string =>\n `var(--polli-color-modality-${key})`;\n\n/** CSS var for a modality's faint chip background. */\nexport const modalityBgVar = (key: ModalityKey): string =>\n `var(--polli-color-modality-${key}-bg)`;\n\n/** A modality's text color, mixed toward the strong text so it stays readable on its background. */\nexport const modalityTextColor = (key: ModalityKey): string =>\n `color-mix(in oklab, ${modalityColorVar(key)} 60%, var(--polli-color-text-strong))`;\n","import type { ReactNode } from \"react\";\nimport { Chip } from \"../../primitives/Chip.tsx\";\nimport { getModalityKey, modalityBgVar, modalityTextColor } from \"./themes.ts\";\n\n/**\n * A `Chip` colored as a model modality: faint modality background + a readable\n * modality-tinted label. The single-accent way to say \"this is the <text/image/…>\n * modality\" without theming the surrounding chrome.\n *\n * Colors come only from the `--polli-color-modality-*` tokens (via the helpers);\n * the label is blended toward `text-strong` so it stays readable on the faint\n * background in both light and dark. Unknown category → a plain neutral chip.\n */\nexport function ModalityChip({\n modality,\n size = \"sm\",\n className,\n children,\n}: {\n modality: string;\n size?: \"sm\" | \"md\" | \"lg\";\n className?: string;\n children: ReactNode;\n}) {\n const key = getModalityKey(modality);\n if (!key) {\n return (\n <Chip intent=\"neutral\" size={size} className={className}>\n {children}\n </Chip>\n );\n }\n return (\n <Chip\n size={size}\n className={className}\n style={{\n backgroundColor: modalityBgVar(key),\n color: modalityTextColor(key),\n }}\n >\n {children}\n </Chip>\n );\n}\n","import { cn } from \"../../lib/cn.ts\";\nimport { getModalityKey, modalityColorVar } from \"./themes.ts\";\n\n/**\n * A small solid dot in a modality's fixed color. The single-accent way to mark\n * a model's modality (text/image/video/audio/realtime/embedding) without\n * theming the whole control. Renders nothing for an unknown category.\n */\nexport function ModalityDot({\n modality,\n className,\n}: {\n modality: string;\n className?: string;\n}) {\n const key = getModalityKey(modality);\n if (!key) return null;\n return (\n <span\n aria-hidden=\"true\"\n className={cn(\n \"polli:inline-block polli:size-2 polli:shrink-0 polli:rounded-full\",\n className,\n )}\n style={{ backgroundColor: modalityColorVar(key) }}\n />\n );\n}\n","import type { ModelCategory } from \"@pollinations/sdk\";\nimport type {\n ComponentPropsWithoutRef,\n ComponentType,\n CSSProperties,\n ReactNode,\n} from \"react\";\nimport { cn } from \"../../lib/cn.ts\";\nimport type { IconProps } from \"../../primitives/icons/types.ts\";\nimport { TabButton } from \"../../primitives/TabButton.tsx\";\nimport { modalityTextColor } from \"./themes.ts\";\n\ntype ModalityTabOwnProps = {\n active: boolean;\n onClick: () => void;\n children: ReactNode;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n className?: string;\n /** Leading icon, drawn before the label. */\n icon?: ComponentType<IconProps>;\n /** Tints the icon of an idle, unhovered tab in this modality's colour. */\n modality?: ModelCategory;\n};\n\n/**\n * A model-filter tab. Borderless — it renders the app's `soft` TabButton, so\n * it uses exactly the same tokens as the dashboard tabs: selected is\n * `bg-active` (the resting button fill, no hover), idle is the quiet\n * `bg-subtle`, and hover darkens to `bg-hover` like any button. With\n * `modality`, only an idle tab's icon carries the modality colour; selection\n * and hover stay monochrome, so amber remains the only selection signal.\n *\n * Rest props (including a runtime-injected ref) pass through to the button —\n * required when the tab is a popover trigger, where the positioner's anchor\n * ref arrives via asChild and a closed prop set would silently drop it.\n */\nexport function ModalityTab({\n active,\n onClick,\n children,\n size = \"md\",\n disabled = false,\n className,\n icon: Icon,\n modality,\n ...rest\n}: ModalityTabOwnProps &\n Omit<ComponentPropsWithoutRef<\"button\">, keyof ModalityTabOwnProps>) {\n const tint = modality && !active ? modalityTextColor(modality) : undefined;\n\n return (\n <TabButton\n {...rest}\n active={active}\n onClick={onClick}\n size={size}\n disabled={disabled}\n className={cn(tint && \"polli:group\", className)}\n icon={\n Icon &&\n (tint ? (\n <Icon\n className=\"polli:text-(--polli-tab-icon) polli:group-hover:text-current\"\n style={{ \"--polli-tab-icon\": tint } as CSSProperties}\n />\n ) : (\n <Icon />\n ))\n }\n >\n {children}\n </TabButton>\n );\n}\n","import { CardIcon, SproutIcon } from \"../../primitives/icons/index.tsx\";\n\nexport type ModelAccessIconProps = {\n paidOnly?: boolean;\n className?: string;\n};\n\n/** Compact model-access marker shared by every model picker. */\nexport function ModelAccessIcon({\n paidOnly = false,\n className = \"polli:h-3.5 polli:w-3.5\",\n}: ModelAccessIconProps) {\n const label = paidOnly ? \"Paid Pollen required\" : \"Works with any Pollen\";\n const Icon = paidOnly ? CardIcon : SproutIcon;\n\n return (\n <span\n role=\"img\"\n aria-label={label}\n title={label}\n className=\"polli:inline-flex polli:shrink-0\"\n >\n <Icon className={className} />\n </span>\n );\n}\n","import type { ModelCategory, ModelInfo } from \"@pollinations/sdk\";\nimport { Button } from \"../../primitives/Button.tsx\";\nimport { ChevronIcon } from \"../../primitives/ChevronIcon.tsx\";\nimport { Dropdown } from \"../../primitives/Dropdown.tsx\";\nimport { ScrollArea } from \"../../primitives/ScrollArea.tsx\";\nimport { TabButton } from \"../../primitives/TabButton.tsx\";\nimport { ModelAccessIcon } from \"./ModelAccessIcon.tsx\";\n\nexport type ModelSelectorCategory = ModelCategory;\n\ntype ModelSelectorProps = {\n models: readonly ModelInfo[];\n category: ModelSelectorCategory;\n value: string;\n isLoading?: boolean;\n onChange: (modelId: string) => void;\n};\n\nconst CATEGORY_LABELS: Record<ModelSelectorCategory, string> = {\n image: \"Image\",\n video: \"Video\",\n text: \"Text\",\n audio: \"Audio\",\n \"3d\": \"3D\",\n embedding: \"Embeddings\",\n realtime: \"Realtime\",\n};\n\n/** Human-readable label for a model category, e.g. \"embedding\" -> \"Embeddings\". */\nexport function categoryLabel(category: ModelSelectorCategory): string {\n return CATEGORY_LABELS[category];\n}\n\nfunction modelId(model: ModelInfo): string {\n return model.id ?? model.name;\n}\n\nexport function ModelSelector({\n models,\n category,\n value,\n isLoading = false,\n onChange,\n}: ModelSelectorProps) {\n const filteredModels = models\n .filter((model) => model.category === category)\n .sort((a, b) => modelId(a).localeCompare(modelId(b)));\n const currentModel = models.find((model) => modelId(model) === value);\n const modelLabel = currentModel\n ? (currentModel.title ?? currentModel.name)\n : \"Select\";\n const accessibleLabel = currentModel\n ? `${CATEGORY_LABELS[category]} model: ${modelLabel}`\n : `Select ${CATEGORY_LABELS[category].toLowerCase()} model`;\n\n return (\n <Dropdown\n align=\"start\"\n className=\"polli:w-[min(24rem,calc(100vw-2rem))] polli:p-2\"\n trigger={(open) => (\n <Button\n type=\"button\"\n aria-label={accessibleLabel}\n className=\"polli:min-w-64 polli:max-w-full polli:self-start polli:justify-between polli:gap-2\"\n >\n <span className=\"polli:flex polli:min-w-0 polli:items-center polli:gap-2\">\n <span className=\"polli:truncate\">{modelLabel}</span>\n {currentModel && (\n <ModelAccessIcon\n paidOnly={currentModel.paid_only}\n />\n )}\n </span>\n <ChevronIcon expanded={open} />\n </Button>\n )}\n >\n {(close) =>\n isLoading ? (\n <p className=\"polli:m-0 polli:px-2 polli:py-2 polli:text-sm polli:text-theme-text-soft\">\n Loading models...\n </p>\n ) : (\n <ScrollArea className=\"polli:max-h-80 polli:pr-2\">\n <div className=\"polli:flex polli:flex-col polli:gap-1\">\n {filteredModels.map((model) => {\n const id = modelId(model);\n const isActive = value === id;\n return (\n <TabButton\n key={id}\n active={isActive}\n size=\"sm\"\n variant=\"ghost\"\n className=\"polli:w-full polli:justify-start polli:text-left\"\n onClick={() => {\n onChange(id);\n close();\n }}\n >\n <span className=\"polli:flex polli:min-w-0 polli:flex-col polli:gap-0.5\">\n <span className=\"polli:flex polli:min-w-0 polli:items-center polli:gap-2\">\n <span className=\"polli:truncate\">\n {model.title ?? model.name}\n </span>\n <ModelAccessIcon\n paidOnly={model.paid_only}\n />\n </span>\n {model.description && (\n <span className=\"polli:truncate polli:text-xs polli:font-normal polli:text-theme-text-muted\">\n {model.description}\n </span>\n )}\n </span>\n </TabButton>\n );\n })}\n </div>\n </ScrollArea>\n )\n }\n </Dropdown>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAM,aAAuC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAGO,SAAS,eAAe,UAAsC;AACjE,QAA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pB;AAAA,iBACJ;AAAA,cACC,MAAM,eACH,gBAAAA,KAAC,UAAK,WAAU,8EACX,gBAAM,aACX;AAAA,eAER;AAAA;AAAA,UAxBK;AAAA,QAyBT;AAAA,MAER,CAAC,GACL,GACJ;AAAA;AAAA,EAGZ;AAER;","names":["jsx","jsx","jsx","jsx"]}
|
|
1
|
+
{"version":3,"sources":["../../src/modules/gen/themes.ts","../../src/modules/gen/ModalityChip.tsx","../../src/modules/gen/ModalityDot.tsx","../../src/modules/gen/ModalityTab.tsx","../../src/modules/gen/ModelAccessIcon.tsx","../../src/modules/gen/ModelSelector.tsx"],"sourcesContent":["/** Pollinations model-modality colors. Single-accent model: modality is NOT a\n * page theme — each modality is a fixed color from the `--polli-color-modality-*`\n * tokens, applied as a dot/badge via inline style (the key is dynamic, so a CSS\n * var beats a Tailwind class). The token VALUES live in styles/tokens.css. */\nimport type { ModelCategory } from \"@pollinations/sdk\";\n\n/** The canonical modality keys (match the `--polli-color-modality-*` tokens). */\ntype ModalityKey = ModelCategory;\n\nconst MODALITIES: readonly ModelCategory[] = [\n \"text\",\n \"image\",\n \"video\",\n \"audio\",\n \"realtime\",\n \"embedding\",\n];\n\n/** Map an untrusted category string to its modality key; null if unknown. */\nexport function getModalityKey(category: string): ModalityKey | null {\n const lower = category.toLowerCase();\n if (lower === \"images\") return \"image\";\n if (lower === \"embeddings\") return \"embedding\";\n return MODALITIES.includes(lower as ModelCategory)\n ? (lower as ModelCategory)\n : null;\n}\n\n/** CSS var for a modality's solid color (dot / border / icon). */\nexport const modalityColorVar = (key: ModalityKey): string =>\n `var(--polli-color-modality-${key})`;\n\n/** CSS var for a modality's faint chip background. */\nexport const modalityBgVar = (key: ModalityKey): string =>\n `var(--polli-color-modality-${key}-bg)`;\n\n/** A modality's text color, mixed toward the strong text so it stays readable on its background. */\nexport const modalityTextColor = (key: ModalityKey): string =>\n `color-mix(in oklab, ${modalityColorVar(key)} 60%, var(--polli-color-text-strong))`;\n","import type { ReactNode } from \"react\";\nimport { Chip } from \"../../primitives/Chip.tsx\";\nimport { getModalityKey, modalityBgVar, modalityTextColor } from \"./themes.ts\";\n\n/**\n * A `Chip` colored as a model modality: faint modality background + a readable\n * modality-tinted label. The single-accent way to say \"this is the <text/image/…>\n * modality\" without theming the surrounding chrome.\n *\n * Colors come only from the `--polli-color-modality-*` tokens (via the helpers);\n * the label is blended toward `text-strong` so it stays readable on the faint\n * background in both light and dark. Unknown category → a plain neutral chip.\n */\nexport function ModalityChip({\n modality,\n size = \"sm\",\n className,\n children,\n}: {\n modality: string;\n size?: \"sm\" | \"md\" | \"lg\";\n className?: string;\n children: ReactNode;\n}) {\n const key = getModalityKey(modality);\n if (!key) {\n return (\n <Chip intent=\"neutral\" size={size} className={className}>\n {children}\n </Chip>\n );\n }\n return (\n <Chip\n size={size}\n className={className}\n style={{\n backgroundColor: modalityBgVar(key),\n color: modalityTextColor(key),\n }}\n >\n {children}\n </Chip>\n );\n}\n","import { cn } from \"../../lib/cn.ts\";\nimport { getModalityKey, modalityColorVar } from \"./themes.ts\";\n\n/**\n * A small solid dot in a modality's fixed color. The single-accent way to mark\n * a model's modality (text/image/video/audio/realtime/embedding) without\n * theming the whole control. Renders nothing for an unknown category.\n */\nexport function ModalityDot({\n modality,\n className,\n}: {\n modality: string;\n className?: string;\n}) {\n const key = getModalityKey(modality);\n if (!key) return null;\n return (\n <span\n aria-hidden=\"true\"\n className={cn(\n \"polli:inline-block polli:size-2 polli:shrink-0 polli:rounded-full\",\n className,\n )}\n style={{ backgroundColor: modalityColorVar(key) }}\n />\n );\n}\n","import type { ModelCategory } from \"@pollinations/sdk\";\nimport type {\n ComponentPropsWithoutRef,\n ComponentType,\n CSSProperties,\n ReactNode,\n} from \"react\";\nimport { cn } from \"../../lib/cn.ts\";\nimport type { IconProps } from \"../../primitives/icons/types.ts\";\nimport { TabButton } from \"../../primitives/TabButton.tsx\";\nimport { modalityTextColor } from \"./themes.ts\";\n\ntype ModalityTabOwnProps = {\n active: boolean;\n onClick: () => void;\n children: ReactNode;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n className?: string;\n /** Leading icon, drawn before the label. */\n icon?: ComponentType<IconProps>;\n /** Tints the icon of an idle, unhovered tab in this modality's colour. */\n modality?: ModelCategory;\n};\n\n/**\n * A model-filter tab. Borderless — it renders the app's `soft` TabButton, so\n * it uses exactly the same tokens as the dashboard tabs: selected is\n * `bg-active` (the resting button fill, no hover), idle is the quiet\n * `bg-subtle`, and hover darkens to `bg-hover` like any button. With\n * `modality`, only an idle tab's icon carries the modality colour; selection\n * and hover stay monochrome, so amber remains the only selection signal.\n *\n * Rest props (including a runtime-injected ref) pass through to the button —\n * required when the tab is a popover trigger, where the positioner's anchor\n * ref arrives via asChild and a closed prop set would silently drop it.\n */\nexport function ModalityTab({\n active,\n onClick,\n children,\n size = \"md\",\n disabled = false,\n className,\n icon: Icon,\n modality,\n ...rest\n}: ModalityTabOwnProps &\n Omit<ComponentPropsWithoutRef<\"button\">, keyof ModalityTabOwnProps>) {\n const tint = modality && !active ? modalityTextColor(modality) : undefined;\n\n return (\n <TabButton\n {...rest}\n active={active}\n onClick={onClick}\n size={size}\n disabled={disabled}\n className={cn(tint && \"polli:group\", className)}\n icon={\n Icon &&\n (tint ? (\n <Icon\n className=\"polli:text-(--polli-tab-icon) polli:group-hover:text-current\"\n style={{ \"--polli-tab-icon\": tint } as CSSProperties}\n />\n ) : (\n <Icon />\n ))\n }\n >\n {children}\n </TabButton>\n );\n}\n","import { CardIcon, SproutIcon } from \"../../primitives/icons/index.tsx\";\n\nexport type ModelAccessIconProps = {\n paidOnly?: boolean;\n className?: string;\n};\n\n/** Compact model-access marker shared by every model picker. */\nexport function ModelAccessIcon({\n paidOnly = false,\n className = \"polli:h-3.5 polli:w-3.5\",\n}: ModelAccessIconProps) {\n const label = paidOnly ? \"Paid Pollen required\" : \"Works with any Pollen\";\n const Icon = paidOnly ? CardIcon : SproutIcon;\n\n return (\n <span\n role=\"img\"\n aria-label={label}\n title={label}\n className=\"polli:inline-flex polli:shrink-0\"\n >\n <Icon className={className} />\n </span>\n );\n}\n","import type { ModelCategory, ModelInfo } from \"@pollinations/sdk\";\nimport { Button } from \"../../primitives/Button.tsx\";\nimport { ChevronIcon } from \"../../primitives/ChevronIcon.tsx\";\nimport { Dropdown } from \"../../primitives/Dropdown.tsx\";\nimport { ScrollArea } from \"../../primitives/ScrollArea.tsx\";\nimport { TabButton } from \"../../primitives/TabButton.tsx\";\nimport { ModelAccessIcon } from \"./ModelAccessIcon.tsx\";\n\nexport type ModelSelectorCategory = ModelCategory;\n\ntype ModelSelectorProps = {\n models: readonly ModelInfo[];\n category: ModelSelectorCategory;\n value: string;\n isLoading?: boolean;\n onChange: (modelId: string) => void;\n};\n\nconst CATEGORY_LABELS: Record<ModelSelectorCategory, string> = {\n image: \"Image\",\n video: \"Video\",\n text: \"Text\",\n decision: \"Decision\",\n audio: \"Audio\",\n \"3d\": \"3D\",\n embedding: \"Embeddings\",\n realtime: \"Realtime\",\n};\n\n/** Human-readable label for a model category, e.g. \"embedding\" -> \"Embeddings\". */\nexport function categoryLabel(category: ModelSelectorCategory): string {\n return CATEGORY_LABELS[category];\n}\n\nfunction modelId(model: ModelInfo): string {\n return model.id ?? model.name;\n}\n\nexport function ModelSelector({\n models,\n category,\n value,\n isLoading = false,\n onChange,\n}: ModelSelectorProps) {\n const filteredModels = models\n .filter((model) => model.category === category)\n .sort((a, b) => modelId(a).localeCompare(modelId(b)));\n const currentModel = models.find((model) => modelId(model) === value);\n const modelLabel = currentModel\n ? (currentModel.title ?? currentModel.name)\n : \"Select\";\n const accessibleLabel = currentModel\n ? `${CATEGORY_LABELS[category]} model: ${modelLabel}`\n : `Select ${CATEGORY_LABELS[category].toLowerCase()} model`;\n\n return (\n <Dropdown\n align=\"start\"\n className=\"polli:w-[min(24rem,calc(100vw-2rem))] polli:p-2\"\n trigger={(open) => (\n <Button\n type=\"button\"\n aria-label={accessibleLabel}\n className=\"polli:min-w-64 polli:max-w-full polli:self-start polli:justify-between polli:gap-2\"\n >\n <span className=\"polli:flex polli:min-w-0 polli:items-center polli:gap-2\">\n <span className=\"polli:truncate\">{modelLabel}</span>\n {currentModel && (\n <ModelAccessIcon\n paidOnly={currentModel.paid_only}\n />\n )}\n </span>\n <ChevronIcon expanded={open} />\n </Button>\n )}\n >\n {(close) =>\n isLoading ? (\n <p className=\"polli:m-0 polli:px-2 polli:py-2 polli:text-sm polli:text-theme-text-soft\">\n Loading models...\n </p>\n ) : (\n <ScrollArea className=\"polli:max-h-80 polli:pr-2\">\n <div className=\"polli:flex polli:flex-col polli:gap-1\">\n {filteredModels.map((model) => {\n const id = modelId(model);\n const isActive = value === id;\n return (\n <TabButton\n key={id}\n active={isActive}\n size=\"sm\"\n variant=\"ghost\"\n className=\"polli:w-full polli:justify-start polli:text-left\"\n onClick={() => {\n onChange(id);\n close();\n }}\n >\n <span className=\"polli:flex polli:min-w-0 polli:flex-col polli:gap-0.5\">\n <span className=\"polli:flex polli:min-w-0 polli:items-center polli:gap-2\">\n <span className=\"polli:truncate\">\n {model.title ?? model.name}\n </span>\n <ModelAccessIcon\n paidOnly={model.paid_only}\n />\n </span>\n {model.description && (\n <span className=\"polli:truncate polli:text-xs polli:font-normal polli:text-theme-text-muted\">\n {model.description}\n </span>\n )}\n </span>\n </TabButton>\n );\n })}\n </div>\n </ScrollArea>\n )\n }\n </Dropdown>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAM,aAAuC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAGO,SAAS,eAAe,UAAsC;AACjE,QAAM,QAAQ,SAAS,YAAY;AACnC,MAAI,UAAU,SAAU,QAAO;AAC/B,MAAI,UAAU,aAAc,QAAO;AACnC,SAAO,WAAW,SAAS,KAAsB,IAC1C,QACD;AACV;AAGO,IAAM,mBAAmB,CAAC,QAC7B,8BAA8B,GAAG;AAG9B,IAAM,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ER;","names":["jsx","jsx","jsx","jsx"]}
|
|
@@ -81,5 +81,7 @@ declare function KeyIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
|
81
81
|
declare function GlobeIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
82
82
|
declare function ArrowLeftIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
83
83
|
declare function RefreshIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
declare function PulseIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
85
|
+
declare function ShieldCheckIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
84
86
|
|
|
85
|
-
export {
|
|
87
|
+
export { ReceiptIcon as $, AccountIcon as A, BeakerIcon as B, CardIcon as C, DiscordIcon as D, EarningsIcon as E, InstagramIcon as F, GitHubIcon as G, LockIcon as H, ImageIcon as I, LogInIcon as J, KeyIcon as K, LinkedInIcon as L, LogOutIcon as M, MailIcon as N, McpIcon as O, MegaphoneIcon as P, MenuIcon as Q, MicIcon as R, MoonIcon as S, NewspaperIcon as T, PauseIcon as U, PencilIcon as V, PlayIcon as W, PlusIcon as X, PowerIcon as Y, PulseIcon as Z, ReasoningIcon as _, AppIcon as a, RefreshIcon as a0, RobotIcon as a1, RocketIcon as a2, SearchIcon as a3, ShieldCheckIcon as a4, SignOutIcon as a5, SparkleIcon as a6, SparklesIcon as a7, SpeakerIcon as a8, SproutIcon as a9, StarIcon as aa, SunIcon as ab, TargetIcon as ac, TerminalIcon as ad, TokensIcon as ae, ToolIcon as af, TrashIcon as ag, TrendUpIcon as ah, UsageIcon as ai, VideoIcon as aj, WalletIcon as ak, WarningIcon as al, XIcon as am, XSocialIcon as an, ArrowLeftIcon as b, ArrowRightIcon as c, AudioIcon as d, BookIcon as e, BotIcon as f, BugIcon as g, ChatIcon as h, CheckIcon as i, ClipboardIcon as j, ClockIcon as k, CloudUploadIcon as l, CodeIcon as m, CubeIcon as n, DatabaseIcon as o, DownloadIcon as p, ExpandIcon as q, ExternalLinkIcon as r, EyeIcon as s, EyeOffIcon as t, GenApiIcon as u, GitBranchIcon as v, GitPullRequestIcon as w, GlobeIcon as x, GoogleIcon as y, GraduationCapIcon as z };
|