@pollinations/ui 0.1.0-alpha.3 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -10
- package/dist/{Button-CO3Dpbkj.d.cts → Button-ByKwRtdw.d.cts} +1 -1
- package/dist/{Button-CO3Dpbkj.d.ts → Button-ByKwRtdw.d.ts} +1 -1
- package/dist/{Dialog-yXzIFrDg.d.cts → Dialog-D3Nqt8cE.d.cts} +4 -1
- package/dist/{Dialog-yXzIFrDg.d.ts → Dialog-D3Nqt8cE.d.ts} +4 -1
- package/dist/app-user-menu/sdk.cjs +193 -133
- package/dist/app-user-menu/sdk.cjs.map +1 -1
- package/dist/app-user-menu/sdk.d.cts +17 -1
- package/dist/app-user-menu/sdk.d.ts +17 -1
- package/dist/app-user-menu/sdk.js +182 -122
- package/dist/app-user-menu/sdk.js.map +1 -1
- package/dist/app.css +6 -0
- package/dist/auth/index.cjs +233 -223
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +6 -3
- package/dist/auth/index.d.ts +6 -3
- package/dist/auth/index.js +226 -216
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/sdk.cjs +13 -8
- package/dist/auth/sdk.cjs.map +1 -1
- package/dist/auth/sdk.d.cts +1 -1
- package/dist/auth/sdk.d.ts +1 -1
- package/dist/auth/sdk.js +13 -8
- package/dist/auth/sdk.js.map +1 -1
- package/dist/brand/lockup-horizontal-black.png +0 -0
- package/dist/brand/lockup-horizontal-black.svg +3 -3
- package/dist/brand/lockup-horizontal-white.png +0 -0
- package/dist/brand/lockup-horizontal-white.svg +3 -3
- package/dist/brand/lockup-horizontal.svg +4 -1
- package/dist/brand/lockup-stacked-black.png +0 -0
- package/dist/brand/lockup-stacked-black.svg +1 -1
- package/dist/brand/lockup-stacked-white.png +0 -0
- package/dist/brand/lockup-stacked-white.svg +1 -1
- package/dist/brand/lockup-stacked.svg +1 -1
- package/dist/brand/mark-black.png +0 -0
- package/dist/brand/mark-black.svg +1 -3
- package/dist/brand/mark-white.png +0 -0
- package/dist/brand/mark-white.svg +1 -3
- package/dist/brand/mark.svg +1 -1
- package/dist/gen/index.cjs +47 -18
- package/dist/gen/index.cjs.map +1 -1
- package/dist/gen/index.d.cts +5 -1
- package/dist/gen/index.d.ts +5 -1
- package/dist/gen/index.js +57 -30
- package/dist/gen/index.js.map +1 -1
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +1044 -817
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -27
- package/dist/index.d.ts +73 -27
- package/dist/index.js +1065 -843
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +13 -8
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.js +13 -8
- package/dist/markdown.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +3 -8
- package/dist/wallet/index.cjs +45 -31
- package/dist/wallet/index.cjs.map +1 -1
- package/dist/wallet/index.d.cts +1 -0
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/index.js +45 -31
- package/dist/wallet/index.js.map +1 -1
- package/package.json +1 -1
package/dist/gen/index.js
CHANGED
|
@@ -65,6 +65,7 @@ function getModalityKey(category) {
|
|
|
65
65
|
}
|
|
66
66
|
var modalityColorVar = (key) => `var(--polli-color-modality-${key})`;
|
|
67
67
|
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))`;
|
|
68
69
|
|
|
69
70
|
// src/modules/gen/ModalityChip.tsx
|
|
70
71
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
@@ -85,7 +86,7 @@ function ModalityChip({
|
|
|
85
86
|
className,
|
|
86
87
|
style: {
|
|
87
88
|
backgroundColor: modalityBgVar(key),
|
|
88
|
-
color:
|
|
89
|
+
color: modalityTextColor(key)
|
|
89
90
|
},
|
|
90
91
|
children
|
|
91
92
|
}
|
|
@@ -114,7 +115,7 @@ function ModalityDot({
|
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
// src/primitives/TabButton.tsx
|
|
117
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
118
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
118
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";
|
|
119
120
|
var tabButtonSizeClass = {
|
|
120
121
|
xs: "polli:px-2.5 polli:py-1 polli:text-xs",
|
|
@@ -130,6 +131,7 @@ var variantClasses = {
|
|
|
130
131
|
soft: {
|
|
131
132
|
base: "",
|
|
132
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",
|
|
133
135
|
inactive: "polli:bg-theme-bg-subtle polli:text-theme-text-base polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover"
|
|
134
136
|
},
|
|
135
137
|
// Transparent until hovered or selected — for multi-select toggles and
|
|
@@ -137,9 +139,20 @@ var variantClasses = {
|
|
|
137
139
|
ghost: {
|
|
138
140
|
base: "polli:border polli:border-transparent",
|
|
139
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",
|
|
140
143
|
inactive: "polli:bg-transparent polli:text-theme-text-base polli:hover:bg-theme-bg-hover polli:hover:text-theme-text-hover"
|
|
141
144
|
}
|
|
142
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
|
+
};
|
|
143
156
|
function TabButton({
|
|
144
157
|
as,
|
|
145
158
|
active,
|
|
@@ -148,6 +161,7 @@ function TabButton({
|
|
|
148
161
|
size = "md",
|
|
149
162
|
variant = "soft",
|
|
150
163
|
intent,
|
|
164
|
+
detail,
|
|
151
165
|
ariaLabel,
|
|
152
166
|
disabled = false,
|
|
153
167
|
className,
|
|
@@ -155,12 +169,15 @@ function TabButton({
|
|
|
155
169
|
}) {
|
|
156
170
|
const Component = as || "button";
|
|
157
171
|
const isButton = Component === "button";
|
|
158
|
-
const colors =
|
|
172
|
+
const colors = intent === "neutral" ? variantClasses.soft : intent ? {
|
|
173
|
+
...intentClasses2[intent],
|
|
174
|
+
mixed: intentClasses2[intent].active
|
|
175
|
+
} : variantClasses[variant];
|
|
159
176
|
const handleClick = disabled ? (event) => {
|
|
160
177
|
event.preventDefault();
|
|
161
178
|
event.stopPropagation();
|
|
162
179
|
} : onClick;
|
|
163
|
-
return /* @__PURE__ */
|
|
180
|
+
return /* @__PURE__ */ jsxs(
|
|
164
181
|
Component,
|
|
165
182
|
{
|
|
166
183
|
...rest,
|
|
@@ -169,16 +186,19 @@ function TabButton({
|
|
|
169
186
|
...Component === "a" && disabled ? { href: void 0 } : {},
|
|
170
187
|
onClick: handleClick,
|
|
171
188
|
...ariaLabel !== void 0 ? { "aria-label": ariaLabel } : {},
|
|
172
|
-
...isButton ? { "aria-pressed": active } : { "aria-current": active ? "page" : void 0 },
|
|
189
|
+
...isButton ? { "aria-pressed": active } : { "aria-current": active === true ? "page" : void 0 },
|
|
173
190
|
className: cn(
|
|
174
191
|
tabButtonBaseClass,
|
|
175
192
|
variantClasses[variant].base,
|
|
176
|
-
active ? colors.active : colors.inactive,
|
|
193
|
+
active === "mixed" ? colors.mixed : active ? colors.active : colors.inactive,
|
|
177
194
|
disabled && "polli:pointer-events-none polli:cursor-not-allowed polli:opacity-50",
|
|
178
195
|
tabButtonSizeClass[size],
|
|
179
196
|
className
|
|
180
197
|
),
|
|
181
|
-
children
|
|
198
|
+
children: [
|
|
199
|
+
children,
|
|
200
|
+
detail != null && /* @__PURE__ */ jsx4("span", { className: "polli:ml-1 polli:font-normal polli:opacity-70", children: detail })
|
|
201
|
+
]
|
|
182
202
|
}
|
|
183
203
|
);
|
|
184
204
|
}
|
|
@@ -209,7 +229,7 @@ function ModalityTab({
|
|
|
209
229
|
}
|
|
210
230
|
|
|
211
231
|
// src/primitives/icons/index.tsx
|
|
212
|
-
import { jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
232
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
213
233
|
var strokeProps = {
|
|
214
234
|
fill: "none",
|
|
215
235
|
stroke: "currentColor",
|
|
@@ -218,13 +238,13 @@ var strokeProps = {
|
|
|
218
238
|
strokeLinejoin: "round"
|
|
219
239
|
};
|
|
220
240
|
function CardIcon(props) {
|
|
221
|
-
return /* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ jsxs2("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
222
242
|
/* @__PURE__ */ jsx6("rect", { x: "2", y: "5", width: "20", height: "14", rx: "2" }),
|
|
223
243
|
/* @__PURE__ */ jsx6("path", { d: "M2 10h20" })
|
|
224
244
|
] });
|
|
225
245
|
}
|
|
226
246
|
function SproutIcon(props) {
|
|
227
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ jsxs2("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
228
248
|
/* @__PURE__ */ jsx6("path", { d: "M7 20h10" }),
|
|
229
249
|
/* @__PURE__ */ jsx6("path", { d: "M10 20c5.5-2.5.8-6.4 3-10" }),
|
|
230
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" }),
|
|
@@ -253,13 +273,13 @@ function ModelAccessIcon({
|
|
|
253
273
|
}
|
|
254
274
|
|
|
255
275
|
// src/primitives/Button.tsx
|
|
256
|
-
import { jsx as jsx8, jsxs as
|
|
276
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
257
277
|
var pillSizes = {
|
|
258
278
|
icon: "polli:h-12 polli:w-12 polli:p-0",
|
|
259
279
|
xs: "polli:h-5 polli:px-1.5 polli:py-0 polli:text-[11px] polli:leading-none",
|
|
260
280
|
sm: "polli:min-h-7 polli:px-2 polli:pt-0.5 polli:pb-1",
|
|
261
281
|
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"
|
|
282
|
+
lg: "polli:min-h-12 polli:px-6 polli:py-3 polli:text-base"
|
|
263
283
|
};
|
|
264
284
|
var raisedSizes = {
|
|
265
285
|
icon: "polli:h-12 polli:w-12 polli:p-0",
|
|
@@ -273,11 +293,11 @@ var appearanceClasses = {
|
|
|
273
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"
|
|
274
294
|
};
|
|
275
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";
|
|
276
|
-
var outlined = "polli:border polli:border-theme-text-soft polli:bg-
|
|
277
|
-
var
|
|
278
|
-
brand: `${outlined} polli:hover:bg-theme-text-soft/10`,
|
|
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`,
|
|
279
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`,
|
|
280
|
-
danger: "polli:border polli:border-intent-danger-text polli:bg-
|
|
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",
|
|
281
301
|
info: "polli:bg-intent-info-bg-light polli:text-intent-info-text polli:hover:bg-intent-info-bg-hover polli:transition-colors",
|
|
282
302
|
// Secondary actions never take the accent: one step stronger grey on hover.
|
|
283
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"
|
|
@@ -287,13 +307,15 @@ var buttonClasses = ({
|
|
|
287
307
|
appearance = "pill",
|
|
288
308
|
size,
|
|
289
309
|
className,
|
|
290
|
-
disabled
|
|
310
|
+
disabled,
|
|
311
|
+
busy
|
|
291
312
|
}) => {
|
|
292
|
-
const colorClasses = intent ?
|
|
313
|
+
const colorClasses = intent ? intentClasses3[intent] : themeClasses;
|
|
293
314
|
const sizeClasses = appearance === "raised" ? raisedSizes : pillSizes;
|
|
294
315
|
return cn(
|
|
295
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",
|
|
296
|
-
|
|
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",
|
|
297
319
|
colorClasses,
|
|
298
320
|
appearanceClasses[appearance],
|
|
299
321
|
sizeClasses[size || "md"],
|
|
@@ -316,11 +338,13 @@ function Button({
|
|
|
316
338
|
const isAnchor = Component === "a";
|
|
317
339
|
const buttonType = buttonProps.type;
|
|
318
340
|
const onClick = buttonProps.onClick;
|
|
341
|
+
const ariaBusy = buttonProps["aria-busy"];
|
|
342
|
+
const busy = ariaBusy === true || ariaBusy === "true";
|
|
319
343
|
const handleClick = disabled ? (event) => {
|
|
320
344
|
event.preventDefault();
|
|
321
345
|
event.stopPropagation();
|
|
322
346
|
} : onClick;
|
|
323
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ jsxs3(
|
|
324
348
|
Component,
|
|
325
349
|
{
|
|
326
350
|
...buttonProps,
|
|
@@ -334,7 +358,8 @@ function Button({
|
|
|
334
358
|
appearance,
|
|
335
359
|
size,
|
|
336
360
|
className,
|
|
337
|
-
disabled
|
|
361
|
+
disabled,
|
|
362
|
+
busy
|
|
338
363
|
}),
|
|
339
364
|
children: [
|
|
340
365
|
icon && /* @__PURE__ */ jsx8(
|
|
@@ -342,7 +367,7 @@ function Button({
|
|
|
342
367
|
{
|
|
343
368
|
"aria-hidden": "true",
|
|
344
369
|
className: "polli:mr-2 polli:flex polli:size-4 polli:shrink-0 polli:[&>svg]:size-full",
|
|
345
|
-
children: icon
|
|
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
|
|
346
371
|
}
|
|
347
372
|
),
|
|
348
373
|
children
|
|
@@ -383,7 +408,7 @@ var ChevronIcon = ({ expanded, className }) => /* @__PURE__ */ jsx9(
|
|
|
383
408
|
import { Popover } from "@ark-ui/react/popover";
|
|
384
409
|
import { Portal } from "@ark-ui/react/portal";
|
|
385
410
|
import { useId, useState } from "react";
|
|
386
|
-
import { jsx as jsx10, jsxs as
|
|
411
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
387
412
|
var DEFAULT_PANEL = "polli:rounded-lg polli:bg-surface-menu polli:shadow-lg";
|
|
388
413
|
var Dropdown = ({
|
|
389
414
|
trigger,
|
|
@@ -404,7 +429,7 @@ var Dropdown = ({
|
|
|
404
429
|
if (!isControlled) setInternalOpen(next);
|
|
405
430
|
onOpenChange?.(next);
|
|
406
431
|
};
|
|
407
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ jsxs4(
|
|
408
433
|
Popover.Root,
|
|
409
434
|
{
|
|
410
435
|
ids: { trigger: triggerId },
|
|
@@ -533,7 +558,7 @@ var ScrollArea = forwardRef(
|
|
|
533
558
|
ScrollArea.displayName = "ScrollArea";
|
|
534
559
|
|
|
535
560
|
// src/modules/gen/ModelSelector.tsx
|
|
536
|
-
import { jsx as jsx12, jsxs as
|
|
561
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
537
562
|
var CATEGORY_LABELS = {
|
|
538
563
|
image: "Image",
|
|
539
564
|
video: "Video",
|
|
@@ -565,14 +590,14 @@ function ModelSelector({
|
|
|
565
590
|
{
|
|
566
591
|
align: "start",
|
|
567
592
|
className: "polli:w-[min(24rem,calc(100vw-2rem))] polli:p-2",
|
|
568
|
-
trigger: (open) => /* @__PURE__ */
|
|
593
|
+
trigger: (open) => /* @__PURE__ */ jsxs5(
|
|
569
594
|
Button,
|
|
570
595
|
{
|
|
571
596
|
type: "button",
|
|
572
597
|
"aria-label": accessibleLabel,
|
|
573
598
|
className: "polli:min-w-64 polli:max-w-full polli:self-start polli:justify-between polli:gap-2",
|
|
574
599
|
children: [
|
|
575
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ jsxs5("span", { className: "polli:flex polli:min-w-0 polli:items-center polli:gap-2", children: [
|
|
576
601
|
/* @__PURE__ */ jsx12("span", { className: "polli:truncate", children: modelLabel }),
|
|
577
602
|
currentModel && /* @__PURE__ */ jsx12(
|
|
578
603
|
ModelAccessIcon,
|
|
@@ -599,8 +624,8 @@ function ModelSelector({
|
|
|
599
624
|
onChange(id);
|
|
600
625
|
close();
|
|
601
626
|
},
|
|
602
|
-
children: /* @__PURE__ */
|
|
603
|
-
/* @__PURE__ */
|
|
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: [
|
|
604
629
|
/* @__PURE__ */ jsx12("span", { className: "polli:truncate", children: model.title ?? model.name }),
|
|
605
630
|
/* @__PURE__ */ jsx12(
|
|
606
631
|
ModelAccessIcon,
|
|
@@ -625,6 +650,8 @@ export {
|
|
|
625
650
|
ModelAccessIcon,
|
|
626
651
|
ModelSelector,
|
|
627
652
|
categoryLabel,
|
|
628
|
-
getModalityKey
|
|
653
|
+
getModalityKey,
|
|
654
|
+
modalityBgVar,
|
|
655
|
+
modalityTextColor
|
|
629
656
|
};
|
|
630
657
|
//# sourceMappingURL=index.js.map
|