@pollinations/ui 0.1.0-alpha.4 → 0.1.0-alpha.40

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 (89) hide show
  1. package/README.md +16 -8
  2. package/dist/{Button-ByKwRtdw.d.cts → Button-Bt_eMnOx.d.ts} +4 -2
  3. package/dist/app-user-menu/sdk.d.ts +17 -5
  4. package/dist/app-user-menu/sdk.js +104 -774
  5. package/dist/app-user-menu/sdk.js.map +1 -1
  6. package/dist/app.css +21 -0
  7. package/dist/auth/index.d.ts +12 -5
  8. package/dist/auth/index.js +170 -1159
  9. package/dist/auth/index.js.map +1 -1
  10. package/dist/auth/sdk.d.ts +1 -1
  11. package/dist/auth/sdk.js +9 -205
  12. package/dist/auth/sdk.js.map +1 -1
  13. package/dist/brand/badge-made-with.svg +1 -0
  14. package/dist/brand/polli/polli-lockup-horizontal-black.png +0 -0
  15. package/dist/brand/polli/polli-lockup-horizontal-white.png +0 -0
  16. package/dist/brand/polli/polli.png +0 -0
  17. package/dist/chunk-B7T42IY2.js +255 -0
  18. package/dist/chunk-B7T42IY2.js.map +1 -0
  19. package/dist/chunk-DFYLQTCM.js +107 -0
  20. package/dist/chunk-DFYLQTCM.js.map +1 -0
  21. package/dist/chunk-EHOK3XKM.js +112 -0
  22. package/dist/chunk-EHOK3XKM.js.map +1 -0
  23. package/dist/chunk-FZXMS7HJ.js +93 -0
  24. package/dist/chunk-FZXMS7HJ.js.map +1 -0
  25. package/dist/chunk-KLAOGE6Y.js +125 -0
  26. package/dist/chunk-KLAOGE6Y.js.map +1 -0
  27. package/dist/chunk-KTGSOTNW.js +534 -0
  28. package/dist/chunk-KTGSOTNW.js.map +1 -0
  29. package/dist/chunk-LAZ5O2ZK.js +105 -0
  30. package/dist/chunk-LAZ5O2ZK.js.map +1 -0
  31. package/dist/chunk-MS2GGEMU.js +311 -0
  32. package/dist/chunk-MS2GGEMU.js.map +1 -0
  33. package/dist/chunk-MU7JQOTF.js +170 -0
  34. package/dist/chunk-MU7JQOTF.js.map +1 -0
  35. package/dist/chunk-OWQ2HDQB.js +50 -0
  36. package/dist/chunk-OWQ2HDQB.js.map +1 -0
  37. package/dist/chunk-QPNEXTZ5.js +88 -0
  38. package/dist/chunk-QPNEXTZ5.js.map +1 -0
  39. package/dist/{app-user-menu/sdk.cjs → chunk-R3RMENGN.js} +114 -773
  40. package/dist/chunk-R3RMENGN.js.map +1 -0
  41. package/dist/chunk-WV4XTYMU.js +58 -0
  42. package/dist/chunk-WV4XTYMU.js.map +1 -0
  43. package/dist/chunk-WVDV47XQ.js +651 -0
  44. package/dist/chunk-WVDV47XQ.js.map +1 -0
  45. package/dist/connect.js +100 -0
  46. package/dist/connect.js.map +1 -0
  47. package/dist/gen/index.d.ts +14 -7
  48. package/dist/gen/index.js +59 -474
  49. package/dist/gen/index.js.map +1 -1
  50. package/dist/index-BR4r9rhQ.d.ts +90 -0
  51. package/dist/index.browser.min.js +1 -1
  52. package/dist/index.browser.min.js.map +1 -1
  53. package/dist/index.d.ts +195 -103
  54. package/dist/index.js +1051 -2801
  55. package/dist/index.js.map +1 -1
  56. package/dist/licenses/Octicons-MIT.txt +21 -0
  57. package/dist/markdown.d.ts +3 -1
  58. package/dist/markdown.js +69 -598
  59. package/dist/markdown.js.map +1 -1
  60. package/dist/styles.css +1 -1
  61. package/dist/theme.css +12 -0
  62. package/dist/types-CCy9JNu9.d.ts +6 -0
  63. package/dist/wallet/index.d.ts +20 -1
  64. package/dist/wallet/index.js +19 -370
  65. package/dist/wallet/index.js.map +1 -1
  66. package/package.json +18 -22
  67. package/dist/Button-ByKwRtdw.d.ts +0 -29
  68. package/dist/Chip-v-ADv6cz.d.cts +0 -18
  69. package/dist/Dialog-D3Nqt8cE.d.cts +0 -66
  70. package/dist/app-user-menu/sdk.cjs.map +0 -1
  71. package/dist/app-user-menu/sdk.d.cts +0 -33
  72. package/dist/auth/index.cjs +0 -1512
  73. package/dist/auth/index.cjs.map +0 -1
  74. package/dist/auth/index.d.cts +0 -112
  75. package/dist/auth/sdk.cjs +0 -244
  76. package/dist/auth/sdk.cjs.map +0 -1
  77. package/dist/auth/sdk.d.cts +0 -40
  78. package/dist/gen/index.cjs +0 -687
  79. package/dist/gen/index.cjs.map +0 -1
  80. package/dist/gen/index.d.cts +0 -84
  81. package/dist/index.cjs +0 -5183
  82. package/dist/index.cjs.map +0 -1
  83. package/dist/index.d.cts +0 -933
  84. package/dist/markdown.cjs +0 -826
  85. package/dist/markdown.cjs.map +0 -1
  86. package/dist/markdown.d.cts +0 -16
  87. package/dist/wallet/index.cjs +0 -429
  88. package/dist/wallet/index.cjs.map +0 -1
  89. package/dist/wallet/index.d.cts +0 -53
package/dist/gen/index.js CHANGED
@@ -1,52 +1,24 @@
1
- // src/lib/cn.ts
2
- import { clsx } from "clsx";
3
- import { extendTailwindMerge } from "tailwind-merge";
4
- var twMerge = extendTailwindMerge({ prefix: "polli" });
5
- function cn(...inputs) {
6
- return twMerge(clsx(...inputs));
7
- }
8
-
9
- // src/primitives/Chip.tsx
10
- import { jsx } from "react/jsx-runtime";
11
- var chipSizes = {
12
- icon: "polli:h-5 polli:w-5 polli:p-0 polli:text-xs",
13
- sm: "polli:h-5 polli:px-2 polli:text-xs",
14
- md: "polli:h-6 polli:px-2.5 polli:text-sm",
15
- lg: "polli:h-7 polli:px-3 polli:text-sm"
16
- };
17
- var intentClasses = {
18
- news: "polli:bg-intent-news-bg-light polli:text-intent-news-text",
19
- new: "polli:bg-intent-new-bg-light polli:text-intent-new-text",
20
- free: "polli:bg-intent-free-bg-light polli:text-intent-free-text",
21
- alpha: "polli:bg-intent-alpha-bg-light polli:text-intent-alpha-text",
22
- neutral: "polli:bg-ink-100/80 polli:text-ink-900",
23
- success: "polli:bg-intent-success-bg-bright/15 polli:text-intent-success-text",
24
- warning: "polli:bg-intent-warning-bg-light polli:text-intent-warning-text",
25
- info: "polli:bg-intent-info-bg-light polli:text-intent-info-text",
26
- danger: "polli:bg-intent-danger-bg-light polli:text-intent-danger-text"
27
- };
28
- var Chip = ({
29
- intent,
30
- size = "md",
31
- className,
32
- children,
33
- ...rest
34
- }) => {
35
- const intentClass = intent ? intentClasses[intent] : "polli:bg-theme-bg-active polli:text-theme-text-strong";
36
- return /* @__PURE__ */ jsx(
37
- "span",
38
- {
39
- ...rest,
40
- className: cn(
41
- "polli:inline-flex polli:shrink-0 polli:items-center polli:justify-center polli:gap-1 polli:rounded-lg polli:font-medium polli:leading-none",
42
- chipSizes[size],
43
- intentClass,
44
- className
45
- ),
46
- children
47
- }
48
- );
49
- };
1
+ import {
2
+ TabButton
3
+ } from "../chunk-EHOK3XKM.js";
4
+ import {
5
+ ScrollArea
6
+ } from "../chunk-LAZ5O2ZK.js";
7
+ import {
8
+ ChevronIcon,
9
+ Dropdown
10
+ } from "../chunk-FZXMS7HJ.js";
11
+ import {
12
+ Chip
13
+ } from "../chunk-OWQ2HDQB.js";
14
+ import {
15
+ Button
16
+ } from "../chunk-KLAOGE6Y.js";
17
+ import {
18
+ CardIcon,
19
+ SproutIcon,
20
+ cn
21
+ } from "../chunk-WVDV47XQ.js";
50
22
 
51
23
  // src/modules/gen/themes.ts
52
24
  var MODALITIES = [
@@ -65,10 +37,10 @@ function getModalityKey(category) {
65
37
  }
66
38
  var modalityColorVar = (key) => `var(--polli-color-modality-${key})`;
67
39
  var modalityBgVar = (key) => `var(--polli-color-modality-${key}-bg)`;
68
- var modalityTextColor = (key) => `color-mix(in oklab, ${modalityColorVar(key)} 72%, var(--polli-color-text-strong))`;
40
+ var modalityTextColor = (key) => `color-mix(in oklab, ${modalityColorVar(key)} 60%, var(--polli-color-text-strong))`;
69
41
 
70
42
  // src/modules/gen/ModalityChip.tsx
71
- import { jsx as jsx2 } from "react/jsx-runtime";
43
+ import { jsx } from "react/jsx-runtime";
72
44
  function ModalityChip({
73
45
  modality,
74
46
  size = "sm",
@@ -77,9 +49,9 @@ function ModalityChip({
77
49
  }) {
78
50
  const key = getModalityKey(modality);
79
51
  if (!key) {
80
- return /* @__PURE__ */ jsx2(Chip, { intent: "neutral", size, className, children });
52
+ return /* @__PURE__ */ jsx(Chip, { intent: "neutral", size, className, children });
81
53
  }
82
- return /* @__PURE__ */ jsx2(
54
+ return /* @__PURE__ */ jsx(
83
55
  Chip,
84
56
  {
85
57
  size,
@@ -94,14 +66,14 @@ function ModalityChip({
94
66
  }
95
67
 
96
68
  // src/modules/gen/ModalityDot.tsx
97
- import { jsx as jsx3 } from "react/jsx-runtime";
69
+ import { jsx as jsx2 } from "react/jsx-runtime";
98
70
  function ModalityDot({
99
71
  modality,
100
72
  className
101
73
  }) {
102
74
  const key = getModalityKey(modality);
103
75
  if (!key) return null;
104
- return /* @__PURE__ */ jsx3(
76
+ return /* @__PURE__ */ jsx2(
105
77
  "span",
106
78
  {
107
79
  "aria-hidden": "true",
@@ -114,97 +86,8 @@ function ModalityDot({
114
86
  );
115
87
  }
116
88
 
117
- // src/primitives/TabButton.tsx
118
- import { jsx as jsx4, jsxs } from "react/jsx-runtime";
119
- var tabButtonBaseClass = "polli-control polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:font-medium polli:leading-normal polli:transition-colors polli:duration-200";
120
- var tabButtonSizeClass = {
121
- xs: "polli:px-2.5 polli:py-1 polli:text-xs",
122
- lg: "polli:px-5 polli:py-2 polli:text-lg",
123
- md: "polli:px-4 polli:py-1.5 polli:text-base",
124
- sm: "polli:px-3 polli:py-1.5 polli:text-sm"
125
- };
126
- var variantClasses = {
127
- // The default tab look: borderless and monochrome. Selected uses `bg-active`
128
- // — the same light resting fill as the site's normal buttons. Both states
129
- // deepen to `bg-hover` and use the theme's hover label color. Non-selected
130
- // uses the quiet `bg-subtle` token until then.
131
- soft: {
132
- base: "",
133
- active: "polli:bg-theme-bg-active polli:text-theme-text-strong polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover",
134
- mixed: "polli:bg-theme-bg-active/45 polli:text-theme-text-strong polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover",
135
- inactive: "polli:bg-theme-bg-subtle polli:text-theme-text-base polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover"
136
- },
137
- // Transparent until hovered or selected — for multi-select toggles and
138
- // inline rows where a filled idle pill would read as a hard selection.
139
- ghost: {
140
- base: "polli:border polli:border-transparent",
141
- active: "polli:bg-theme-bg-active polli:text-theme-text-strong polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover",
142
- mixed: "polli:bg-theme-bg-active/45 polli:text-theme-text-strong polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover",
143
- inactive: "polli:bg-transparent polli:text-theme-text-base polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover"
144
- }
145
- };
146
- var intentClasses2 = {
147
- amber: {
148
- active: "polli:bg-paid-pale polli:text-paid-deep",
149
- inactive: "polli:bg-transparent polli:text-theme-text-base polli:hover:bg-paid-pale/60"
150
- },
151
- green: {
152
- active: "polli:bg-tier-pale polli:text-tier-deep",
153
- inactive: "polli:bg-transparent polli:text-tier-deep polli:hover:bg-tier-pale/60"
154
- }
155
- };
156
- function TabButton({
157
- as,
158
- active,
159
- onClick,
160
- children,
161
- size = "md",
162
- variant = "soft",
163
- intent,
164
- detail,
165
- ariaLabel,
166
- disabled = false,
167
- className,
168
- ...rest
169
- }) {
170
- const Component = as || "button";
171
- const isButton = Component === "button";
172
- const colors = intent === "neutral" ? variantClasses.soft : intent ? {
173
- ...intentClasses2[intent],
174
- mixed: intentClasses2[intent].active
175
- } : variantClasses[variant];
176
- const handleClick = disabled ? (event) => {
177
- event.preventDefault();
178
- event.stopPropagation();
179
- } : onClick;
180
- return /* @__PURE__ */ jsxs(
181
- Component,
182
- {
183
- ...rest,
184
- ...isButton ? { type: "button", disabled } : {},
185
- ...!isButton && disabled ? { "aria-disabled": true, tabIndex: -1 } : {},
186
- ...Component === "a" && disabled ? { href: void 0 } : {},
187
- onClick: handleClick,
188
- ...ariaLabel !== void 0 ? { "aria-label": ariaLabel } : {},
189
- ...isButton ? { "aria-pressed": active } : { "aria-current": active === true ? "page" : void 0 },
190
- className: cn(
191
- tabButtonBaseClass,
192
- variantClasses[variant].base,
193
- active === "mixed" ? colors.mixed : active ? colors.active : colors.inactive,
194
- disabled && "polli:pointer-events-none polli:cursor-not-allowed polli:opacity-50",
195
- tabButtonSizeClass[size],
196
- className
197
- ),
198
- children: [
199
- children,
200
- detail != null && /* @__PURE__ */ jsx4("span", { className: "polli:ml-1 polli:font-normal polli:opacity-70", children: detail })
201
- ]
202
- }
203
- );
204
- }
205
-
206
89
  // src/modules/gen/ModalityTab.tsx
207
- import { jsx as jsx5 } from "react/jsx-runtime";
90
+ import { jsx as jsx3 } from "react/jsx-runtime";
208
91
  function ModalityTab({
209
92
  active,
210
93
  onClick,
@@ -212,9 +95,12 @@ function ModalityTab({
212
95
  size = "md",
213
96
  disabled = false,
214
97
  className,
98
+ icon: Icon,
99
+ modality,
215
100
  ...rest
216
101
  }) {
217
- return /* @__PURE__ */ jsx5(
102
+ const tint = modality && !active ? modalityTextColor(modality) : void 0;
103
+ return /* @__PURE__ */ jsx3(
218
104
  TabButton,
219
105
  {
220
106
  ...rest,
@@ -222,347 +108,46 @@ function ModalityTab({
222
108
  onClick,
223
109
  size,
224
110
  disabled,
225
- className,
111
+ className: cn(tint && "polli:group", className),
112
+ icon: Icon && (tint ? /* @__PURE__ */ jsx3(
113
+ Icon,
114
+ {
115
+ className: "polli:text-(--polli-tab-icon) polli:group-hover:text-current",
116
+ style: { "--polli-tab-icon": tint }
117
+ }
118
+ ) : /* @__PURE__ */ jsx3(Icon, {})),
226
119
  children
227
120
  }
228
121
  );
229
122
  }
230
123
 
231
- // src/primitives/icons/index.tsx
232
- import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
233
- var strokeProps = {
234
- fill: "none",
235
- stroke: "currentColor",
236
- strokeWidth: 2,
237
- strokeLinecap: "round",
238
- strokeLinejoin: "round"
239
- };
240
- function CardIcon(props) {
241
- return /* @__PURE__ */ jsxs2("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
242
- /* @__PURE__ */ jsx6("rect", { x: "2", y: "5", width: "20", height: "14", rx: "2" }),
243
- /* @__PURE__ */ jsx6("path", { d: "M2 10h20" })
244
- ] });
245
- }
246
- function SproutIcon(props) {
247
- return /* @__PURE__ */ jsxs2("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
248
- /* @__PURE__ */ jsx6("path", { d: "M7 20h10" }),
249
- /* @__PURE__ */ jsx6("path", { d: "M10 20c5.5-2.5.8-6.4 3-10" }),
250
- /* @__PURE__ */ jsx6("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" }),
251
- /* @__PURE__ */ jsx6("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" })
252
- ] });
253
- }
254
-
255
124
  // src/modules/gen/ModelAccessIcon.tsx
256
- import { jsx as jsx7 } from "react/jsx-runtime";
125
+ import { jsx as jsx4 } from "react/jsx-runtime";
257
126
  function ModelAccessIcon({
258
127
  paidOnly = false,
259
128
  className = "polli:h-3.5 polli:w-3.5"
260
129
  }) {
261
- const label = paidOnly ? "Paid Pollen required" : "Works with any Pollen";
130
+ const label = paidOnly ? "Uses paid balance only" : "Works with any balance";
262
131
  const Icon = paidOnly ? CardIcon : SproutIcon;
263
- return /* @__PURE__ */ jsx7(
132
+ return /* @__PURE__ */ jsx4(
264
133
  "span",
265
134
  {
266
135
  role: "img",
267
136
  "aria-label": label,
268
137
  title: label,
269
138
  className: "polli:inline-flex polli:shrink-0",
270
- children: /* @__PURE__ */ jsx7(Icon, { className })
139
+ children: /* @__PURE__ */ jsx4(Icon, { className })
271
140
  }
272
141
  );
273
142
  }
274
143
 
275
- // src/primitives/Button.tsx
276
- import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
277
- var pillSizes = {
278
- icon: "polli:h-12 polli:w-12 polli:p-0",
279
- xs: "polli:h-5 polli:px-1.5 polli:py-0 polli:text-[11px] polli:leading-none",
280
- sm: "polli:min-h-7 polli:px-2 polli:pt-0.5 polli:pb-1",
281
- md: "polli:min-h-9 polli:px-4 polli:pt-1.5 polli:pb-2",
282
- lg: "polli:min-h-12 polli:px-6 polli:py-3 polli:text-base"
283
- };
284
- var raisedSizes = {
285
- icon: "polli:h-12 polli:w-12 polli:p-0",
286
- xs: "polli:px-2 polli:py-1 polli:text-xs",
287
- sm: "polli:px-4 polli:py-2 polli:text-sm",
288
- md: "polli:px-7 polli:py-3.5 polli:text-base",
289
- lg: "polli:px-8 polli:py-4 polli:text-lg"
290
- };
291
- var appearanceClasses = {
292
- pill: "polli:rounded-full",
293
- raised: "polli:rounded-xl polli:border-r-[3px] polli:border-b-[3px] polli:border-solid polli:border-theme-text-strong/20 polli:hover:border-theme-text-strong/45"
294
- };
295
- var themeClasses = "polli:bg-theme-bg-active polli:text-theme-text-strong polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover polli:transition-colors";
296
- var outlined = "polli:border polli:border-theme-text-soft polli:bg-theme-bg-active/30 polli:text-theme-text-strong polli:transition-colors polli:[.dark_&]:bg-transparent";
297
- var intentClasses3 = {
298
- brand: `${outlined} polli:hover:bg-theme-bg-active/50 polli:[.dark_&]:hover:bg-theme-text-soft/10`,
299
- commit: `${outlined} polli:hover:border-theme-bg-active polli:hover:bg-theme-bg-active polli:focus-visible:border-theme-bg-active polli:focus-visible:bg-theme-bg-active polli:[.dark_&]:hover:bg-theme-bg-active polli:[.dark_&]:focus-visible:bg-theme-bg-active`,
300
- danger: "polli:border polli:border-intent-danger-text polli:bg-intent-danger-bg-light polli:text-intent-danger-text polli:hover:bg-intent-danger-bg-hover polli:focus-visible:bg-intent-danger-bg-hover polli:transition-colors polli:[.dark_&]:bg-transparent polli:[.dark_&]:hover:bg-intent-danger-bg-hover polli:[.dark_&]:focus-visible:bg-intent-danger-bg-hover",
301
- info: "polli:bg-intent-info-bg-light polli:text-intent-info-text polli:hover:bg-intent-info-bg-hover polli:transition-colors",
302
- // Secondary actions never take the accent: one step stronger grey on hover.
303
- neutral: "polli:bg-theme-bg-subtle polli:text-theme-text-base polli:hover:bg-theme-text-muted/25 polli:hover:text-theme-text-strong polli:transition-colors"
304
- };
305
- var buttonClasses = ({
306
- intent,
307
- appearance = "pill",
308
- size,
309
- className,
310
- disabled,
311
- busy
312
- }) => {
313
- const colorClasses = intent ? intentClasses3[intent] : themeClasses;
314
- const sizeClasses = appearance === "raised" ? raisedSizes : pillSizes;
315
- return cn(
316
- "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",
317
- // A busy button is working, not unavailable: it keeps its strength.
318
- busy ? "polli:cursor-progress" : disabled ? "polli:opacity-50 polli:cursor-not-allowed" : "polli:hover:filter polli:hover:brightness-105 polli:cursor-pointer",
319
- colorClasses,
320
- appearanceClasses[appearance],
321
- sizeClasses[size || "md"],
322
- className
323
- );
324
- };
325
- function Button({
326
- as,
327
- children,
328
- icon,
329
- intent,
330
- appearance,
331
- size,
332
- className,
333
- disabled,
334
- ...buttonProps
335
- }) {
336
- const Component = as || "button";
337
- const isButton = Component === "button";
338
- const isAnchor = Component === "a";
339
- const buttonType = buttonProps.type;
340
- const onClick = buttonProps.onClick;
341
- const ariaBusy = buttonProps["aria-busy"];
342
- const busy = ariaBusy === true || ariaBusy === "true";
343
- const handleClick = disabled ? (event) => {
344
- event.preventDefault();
345
- event.stopPropagation();
346
- } : onClick;
347
- return /* @__PURE__ */ jsxs3(
348
- Component,
349
- {
350
- ...buttonProps,
351
- "data-intent": intent,
352
- ...isButton ? { type: buttonType ?? "button", disabled } : {},
353
- ...!isButton && disabled ? { "aria-disabled": true, tabIndex: -1 } : {},
354
- ...isAnchor && disabled ? { href: void 0 } : {},
355
- onClick: handleClick,
356
- className: buttonClasses({
357
- intent,
358
- appearance,
359
- size,
360
- className,
361
- disabled,
362
- busy
363
- }),
364
- children: [
365
- icon && /* @__PURE__ */ jsx8(
366
- "span",
367
- {
368
- "aria-hidden": "true",
369
- className: "polli:mr-2 polli:flex polli:size-4 polli:shrink-0 polli:[&>svg]:size-full",
370
- children: busy ? /* @__PURE__ */ jsx8("span", { className: "polli:block polli:size-full polli:animate-spin polli:rounded-full polli:border-2 polli:border-current polli:border-r-transparent polli:motion-reduce:animate-none" }) : icon
371
- }
372
- ),
373
- children
374
- ]
375
- }
376
- );
377
- }
378
-
379
- // src/primitives/ChevronIcon.tsx
380
- import { jsx as jsx9 } from "react/jsx-runtime";
381
- var ChevronIcon = ({ expanded, className }) => /* @__PURE__ */ jsx9(
382
- "svg",
383
- {
384
- "aria-hidden": "true",
385
- width: "12",
386
- height: "12",
387
- viewBox: "0 0 12 12",
388
- className: cn(
389
- "polli:shrink-0 polli:transition-transform polli:duration-200 polli:ease-out",
390
- expanded && "polli:rotate-180",
391
- className
392
- ),
393
- children: /* @__PURE__ */ jsx9(
394
- "path",
395
- {
396
- d: "M3 4.5 6 7.5l3-3",
397
- fill: "none",
398
- stroke: "currentColor",
399
- strokeLinecap: "round",
400
- strokeLinejoin: "round",
401
- strokeWidth: "1.5"
402
- }
403
- )
404
- }
405
- );
406
-
407
- // src/primitives/Dropdown.tsx
408
- import { Popover } from "@ark-ui/react/popover";
409
- import { Portal } from "@ark-ui/react/portal";
410
- import { useId, useState } from "react";
411
- import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
412
- var DEFAULT_PANEL = "polli:rounded-lg polli:bg-surface-menu polli:shadow-lg";
413
- var Dropdown = ({
414
- trigger,
415
- children,
416
- align = "start",
417
- side = "bottom",
418
- open: openProp,
419
- portalled = true,
420
- onOpenChange,
421
- className,
422
- panelStyle
423
- }) => {
424
- const triggerId = useId();
425
- const [internalOpen, setInternalOpen] = useState(false);
426
- const isControlled = openProp !== void 0;
427
- const open = isControlled ? openProp : internalOpen;
428
- const setOpen = (next) => {
429
- if (!isControlled) setInternalOpen(next);
430
- onOpenChange?.(next);
431
- };
432
- return /* @__PURE__ */ jsxs4(
433
- Popover.Root,
434
- {
435
- ids: { trigger: triggerId },
436
- open,
437
- portalled,
438
- onOpenChange: (details) => setOpen(details.open),
439
- positioning: {
440
- placement: `${side}-${align}`,
441
- strategy: portalled ? "absolute" : "fixed"
442
- },
443
- children: [
444
- /* @__PURE__ */ jsx10(Popover.Trigger, { asChild: true, children: trigger(open) }),
445
- /* @__PURE__ */ jsx10(Portal, { disabled: !portalled, children: /* @__PURE__ */ jsx10(Popover.Positioner, { children: /* @__PURE__ */ jsx10(
446
- Popover.Content,
447
- {
448
- "aria-labelledby": triggerId,
449
- style: panelStyle,
450
- className: cn(
451
- "polli:z-[120] polli:overflow-hidden polli:focus:outline-none",
452
- DEFAULT_PANEL,
453
- className
454
- ),
455
- children: typeof children === "function" ? children(() => setOpen(false)) : children
456
- }
457
- ) }) })
458
- ]
459
- }
460
- );
461
- };
462
-
463
- // src/primitives/ScrollArea.tsx
464
- import {
465
- forwardRef,
466
- useCallback,
467
- useEffect,
468
- useRef
469
- } from "react";
470
- import { jsx as jsx11 } from "react/jsx-runtime";
471
- var axisClasses = {
472
- y: "polli:overflow-y-auto polli:overflow-x-hidden",
473
- x: "polli:overflow-x-auto polli:overflow-y-hidden",
474
- both: "polli:overflow-auto"
475
- };
476
- function assignRef(ref, value) {
477
- if (typeof ref === "function") ref(value);
478
- else if (ref) ref.current = value;
479
- }
480
- var ScrollArea = forwardRef(
481
- ({ axis = "y", scrollbar = "subtle", className, children, ...rest }, externalRef) => {
482
- const innerRef = useRef(null);
483
- const setRef = useCallback(
484
- (node) => {
485
- innerRef.current = node;
486
- assignRef(externalRef, node);
487
- },
488
- [externalRef]
489
- );
490
- useEffect(() => {
491
- if (scrollbar === "native") return;
492
- const element = innerRef.current;
493
- if (!element) return;
494
- let hideTimer = null;
495
- const clearHideTimer = () => {
496
- if (hideTimer !== null) {
497
- window.clearTimeout(hideTimer);
498
- hideTimer = null;
499
- }
500
- };
501
- const show = () => {
502
- element.dataset.scrollbarActive = "true";
503
- clearHideTimer();
504
- };
505
- const hide = () => {
506
- element.dataset.scrollbarActive = "false";
507
- clearHideTimer();
508
- };
509
- const scheduleHide = () => {
510
- clearHideTimer();
511
- hideTimer = window.setTimeout(hide, 2e3);
512
- };
513
- const handleInteraction = () => {
514
- show();
515
- scheduleHide();
516
- };
517
- hide();
518
- element.addEventListener("scroll", handleInteraction, {
519
- passive: true
520
- });
521
- element.addEventListener("wheel", handleInteraction, {
522
- passive: true
523
- });
524
- element.addEventListener("touchstart", handleInteraction, {
525
- passive: true
526
- });
527
- element.addEventListener("pointerdown", handleInteraction);
528
- element.addEventListener("keydown", handleInteraction);
529
- element.addEventListener("focusin", handleInteraction);
530
- element.addEventListener("focusout", scheduleHide);
531
- return () => {
532
- clearHideTimer();
533
- element.removeEventListener("scroll", handleInteraction);
534
- element.removeEventListener("wheel", handleInteraction);
535
- element.removeEventListener("touchstart", handleInteraction);
536
- element.removeEventListener("pointerdown", handleInteraction);
537
- element.removeEventListener("keydown", handleInteraction);
538
- element.removeEventListener("focusin", handleInteraction);
539
- element.removeEventListener("focusout", scheduleHide);
540
- };
541
- }, [scrollbar]);
542
- return /* @__PURE__ */ jsx11(
543
- "div",
544
- {
545
- ...rest,
546
- ref: setRef,
547
- className: cn(
548
- scrollbar === "subtle" && "polli-scrollbar-subtle",
549
- "polli:min-w-0 polli:max-w-full",
550
- axisClasses[axis],
551
- className
552
- ),
553
- children
554
- }
555
- );
556
- }
557
- );
558
- ScrollArea.displayName = "ScrollArea";
559
-
560
144
  // src/modules/gen/ModelSelector.tsx
561
- import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
145
+ import { jsx as jsx5, jsxs } from "react/jsx-runtime";
562
146
  var CATEGORY_LABELS = {
563
147
  image: "Image",
564
148
  video: "Video",
565
149
  text: "Text",
150
+ decision: "Decision",
566
151
  audio: "Audio",
567
152
  "3d": "3D",
568
153
  embedding: "Embeddings",
@@ -585,35 +170,35 @@ function ModelSelector({
585
170
  const currentModel = models.find((model) => modelId(model) === value);
586
171
  const modelLabel = currentModel ? currentModel.title ?? currentModel.name : "Select";
587
172
  const accessibleLabel = currentModel ? `${CATEGORY_LABELS[category]} model: ${modelLabel}` : `Select ${CATEGORY_LABELS[category].toLowerCase()} model`;
588
- return /* @__PURE__ */ jsx12(
173
+ return /* @__PURE__ */ jsx5(
589
174
  Dropdown,
590
175
  {
591
176
  align: "start",
592
177
  className: "polli:w-[min(24rem,calc(100vw-2rem))] polli:p-2",
593
- trigger: (open) => /* @__PURE__ */ jsxs5(
178
+ trigger: (open) => /* @__PURE__ */ jsxs(
594
179
  Button,
595
180
  {
596
181
  type: "button",
597
182
  "aria-label": accessibleLabel,
598
183
  className: "polli:min-w-64 polli:max-w-full polli:self-start polli:justify-between polli:gap-2",
599
184
  children: [
600
- /* @__PURE__ */ jsxs5("span", { className: "polli:flex polli:min-w-0 polli:items-center polli:gap-2", children: [
601
- /* @__PURE__ */ jsx12("span", { className: "polli:truncate", children: modelLabel }),
602
- currentModel && /* @__PURE__ */ jsx12(
185
+ /* @__PURE__ */ jsxs("span", { className: "polli:flex polli:min-w-0 polli:items-center polli:gap-2", children: [
186
+ /* @__PURE__ */ jsx5("span", { className: "polli:truncate", children: modelLabel }),
187
+ currentModel && /* @__PURE__ */ jsx5(
603
188
  ModelAccessIcon,
604
189
  {
605
190
  paidOnly: currentModel.paid_only
606
191
  }
607
192
  )
608
193
  ] }),
609
- /* @__PURE__ */ jsx12(ChevronIcon, { expanded: open })
194
+ /* @__PURE__ */ jsx5(ChevronIcon, { expanded: open })
610
195
  ]
611
196
  }
612
197
  ),
613
- children: (close) => isLoading ? /* @__PURE__ */ jsx12("p", { className: "polli:m-0 polli:px-2 polli:py-2 polli:text-sm polli:text-theme-text-soft", children: "Loading models..." }) : /* @__PURE__ */ jsx12(ScrollArea, { className: "polli:max-h-80 polli:pr-2", children: /* @__PURE__ */ jsx12("div", { className: "polli:flex polli:flex-col polli:gap-1", children: filteredModels.map((model) => {
198
+ children: (close) => isLoading ? /* @__PURE__ */ jsx5("p", { className: "polli:m-0 polli:px-2 polli:py-2 polli:text-sm polli:text-theme-text-soft", children: "Loading models..." }) : /* @__PURE__ */ jsx5(ScrollArea, { className: "polli:max-h-80 polli:pr-2", children: /* @__PURE__ */ jsx5("div", { className: "polli:flex polli:flex-col polli:gap-1", children: filteredModels.map((model) => {
614
199
  const id = modelId(model);
615
200
  const isActive = value === id;
616
- return /* @__PURE__ */ jsx12(
201
+ return /* @__PURE__ */ jsx5(
617
202
  TabButton,
618
203
  {
619
204
  active: isActive,
@@ -624,17 +209,17 @@ function ModelSelector({
624
209
  onChange(id);
625
210
  close();
626
211
  },
627
- children: /* @__PURE__ */ jsxs5("span", { className: "polli:flex polli:min-w-0 polli:flex-col polli:gap-0.5", children: [
628
- /* @__PURE__ */ jsxs5("span", { className: "polli:flex polli:min-w-0 polli:items-center polli:gap-2", children: [
629
- /* @__PURE__ */ jsx12("span", { className: "polli:truncate", children: model.title ?? model.name }),
630
- /* @__PURE__ */ jsx12(
212
+ children: /* @__PURE__ */ jsxs("span", { className: "polli:flex polli:min-w-0 polli:flex-col polli:gap-0.5", children: [
213
+ /* @__PURE__ */ jsxs("span", { className: "polli:flex polli:min-w-0 polli:items-center polli:gap-2", children: [
214
+ /* @__PURE__ */ jsx5("span", { className: "polli:truncate", children: model.title ?? model.name }),
215
+ /* @__PURE__ */ jsx5(
631
216
  ModelAccessIcon,
632
217
  {
633
218
  paidOnly: model.paid_only
634
219
  }
635
220
  )
636
221
  ] }),
637
- model.description && /* @__PURE__ */ jsx12("span", { className: "polli:truncate polli:text-xs polli:font-normal polli:text-theme-text-muted", children: model.description })
222
+ model.description && /* @__PURE__ */ jsx5("span", { className: "polli:truncate polli:text-xs polli:font-normal polli:text-theme-text-muted", children: model.description })
638
223
  ] })
639
224
  },
640
225
  id