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

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