@pollinations/ui 0.0.1 → 0.1.0-alpha.0
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 +25 -16
- package/dist/{Button-DMJ2K6Gr.d.ts → Button-BvLF_Km2.d.cts} +4 -4
- package/dist/{Button-CNzpisJf.d.cts → Button-DQAZzvyQ.d.ts} +4 -4
- package/dist/{Chip-BS8ronOu.d.ts → Chip-C5impfYd.d.ts} +2 -2
- package/dist/{Chip-DyqWrq0r.d.cts → Chip-SM52sUbZ.d.cts} +2 -2
- package/dist/app.css +1 -1
- package/dist/auth/index.cjs +78 -71
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +1 -2
- package/dist/auth/index.d.ts +1 -2
- package/dist/auth/index.js +78 -71
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/sdk.cjs +7 -6
- package/dist/auth/sdk.cjs.map +1 -1
- package/dist/auth/sdk.d.cts +2 -2
- package/dist/auth/sdk.d.ts +2 -2
- package/dist/auth/sdk.js +7 -6
- package/dist/auth/sdk.js.map +1 -1
- package/dist/compositions/app-user.cjs +497 -0
- package/dist/compositions/app-user.cjs.map +1 -0
- package/dist/compositions/app-user.d.cts +18 -0
- package/dist/compositions/app-user.d.ts +18 -0
- package/dist/compositions/app-user.js +469 -0
- package/dist/compositions/app-user.js.map +1 -0
- package/dist/index.cjs +1151 -312
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +146 -13
- package/dist/index.d.ts +146 -13
- package/dist/index.js +1109 -295
- package/dist/index.js.map +1 -1
- package/dist/modality/index.cjs +27 -56
- package/dist/modality/index.cjs.map +1 -1
- package/dist/modality/index.d.cts +13 -32
- package/dist/modality/index.d.ts +13 -32
- package/dist/modality/index.js +27 -55
- package/dist/modality/index.js.map +1 -1
- package/dist/models/index.cjs +508 -0
- package/dist/models/index.cjs.map +1 -0
- package/dist/models/index.d.cts +22 -0
- package/dist/models/index.d.ts +22 -0
- package/dist/models/index.js +486 -0
- package/dist/models/index.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme-VMRlhqST.d.cts +9 -0
- package/dist/theme-VMRlhqST.d.ts +9 -0
- package/dist/wallet/index.cjs +17 -5
- package/dist/wallet/index.cjs.map +1 -1
- package/dist/wallet/index.d.cts +2 -2
- package/dist/wallet/index.d.ts +2 -2
- package/dist/wallet/index.js +17 -5
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/sdk.cjs +6 -3
- package/dist/wallet/sdk.cjs.map +1 -1
- package/dist/wallet/sdk.js +6 -3
- package/dist/wallet/sdk.js.map +1 -1
- package/package.json +17 -10
- package/dist/showcase/index.cjs +0 -2851
- package/dist/showcase/index.cjs.map +0 -1
- package/dist/showcase/index.d.cts +0 -19
- package/dist/showcase/index.d.ts +0 -19
- package/dist/showcase/index.js +0 -2839
- package/dist/showcase/index.js.map +0 -1
- package/dist/theme-DfHMjWB7.d.cts +0 -16
- package/dist/theme-DfHMjWB7.d.ts +0 -16
- package/dist/wallet.css +0 -73
package/dist/index.js
CHANGED
|
@@ -167,16 +167,47 @@ function cn2(...inputs) {
|
|
|
167
167
|
return twMerge2(clsx2(...inputs));
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
// src/primitives/Alert.tsx
|
|
171
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
172
|
+
var intentClasses = {
|
|
173
|
+
info: "polli:border-theme-border polli:bg-theme-bg-pale polli:text-theme-text-strong",
|
|
174
|
+
success: "polli:border-intent-success-border polli:bg-intent-success-bg-light polli:text-intent-success-text",
|
|
175
|
+
warning: "polli:border-intent-warning-border polli:bg-intent-warning-bg-light polli:text-intent-warning-text",
|
|
176
|
+
danger: "polli:border-intent-danger-border polli:bg-intent-danger-bg-light polli:text-intent-danger-text"
|
|
177
|
+
};
|
|
178
|
+
var Alert = ({
|
|
179
|
+
intent = "info",
|
|
180
|
+
title,
|
|
181
|
+
className,
|
|
182
|
+
children,
|
|
183
|
+
...rest
|
|
184
|
+
}) => /* @__PURE__ */ jsxs(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
...rest,
|
|
188
|
+
role: intent === "danger" ? "alert" : "status",
|
|
189
|
+
className: cn2(
|
|
190
|
+
"polli:rounded-xl polli:border polli:px-3 polli:py-2 polli:text-sm",
|
|
191
|
+
intentClasses[intent],
|
|
192
|
+
className
|
|
193
|
+
),
|
|
194
|
+
children: [
|
|
195
|
+
title && /* @__PURE__ */ jsx("div", { className: "polli:mb-1 polli:text-xs polli:font-bold polli:uppercase polli:tracking-wide", children: title }),
|
|
196
|
+
/* @__PURE__ */ jsx("div", { children })
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
|
|
170
201
|
// src/primitives/Button.tsx
|
|
171
|
-
import { jsx } from "react/jsx-runtime";
|
|
202
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
172
203
|
var sizes = {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
204
|
+
sm: "polli:px-2 polli:pt-0.5 polli:pb-1",
|
|
205
|
+
md: "polli:px-4 polli:pt-1.5 polli:pb-2",
|
|
206
|
+
lg: "polli:px-6 polli:py-3"
|
|
176
207
|
};
|
|
177
208
|
var themeClasses = "polli:bg-theme-bg-active polli:text-theme-text-base polli:hover:bg-theme-bg-hover polli:transition-colors";
|
|
178
|
-
var
|
|
179
|
-
danger: "polli:bg-intent-danger-bg-light polli:text-intent-danger-text polli:hover:bg-
|
|
209
|
+
var intentClasses2 = {
|
|
210
|
+
danger: "polli:bg-intent-danger-bg-light polli:text-intent-danger-text polli:hover:bg-intent-danger-bg-hover polli:transition-colors"
|
|
180
211
|
};
|
|
181
212
|
var buttonClasses = ({
|
|
182
213
|
theme: _theme,
|
|
@@ -185,12 +216,12 @@ var buttonClasses = ({
|
|
|
185
216
|
className,
|
|
186
217
|
disabled
|
|
187
218
|
}) => {
|
|
188
|
-
const colorClasses = intent ?
|
|
219
|
+
const colorClasses = intent ? intentClasses2[intent] : themeClasses;
|
|
189
220
|
return cn2(
|
|
190
|
-
"polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:self-center polli:
|
|
221
|
+
"polli-control polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:self-center polli:font-medium polli:leading-normal polli:box-border",
|
|
191
222
|
disabled ? "polli:opacity-50 polli:cursor-not-allowed" : "polli:hover:filter polli:hover:brightness-105 polli:cursor-pointer",
|
|
192
223
|
colorClasses,
|
|
193
|
-
sizes[size || "
|
|
224
|
+
sizes[size || "md"],
|
|
194
225
|
className
|
|
195
226
|
);
|
|
196
227
|
};
|
|
@@ -205,10 +236,11 @@ function Button({
|
|
|
205
236
|
...buttonProps
|
|
206
237
|
}) {
|
|
207
238
|
const Component = as || "button";
|
|
208
|
-
return /* @__PURE__ */
|
|
239
|
+
return /* @__PURE__ */ jsx2(
|
|
209
240
|
Component,
|
|
210
241
|
{
|
|
211
242
|
"data-theme": intent ? void 0 : theme,
|
|
243
|
+
"data-intent": intent,
|
|
212
244
|
className: buttonClasses({
|
|
213
245
|
theme,
|
|
214
246
|
intent,
|
|
@@ -223,9 +255,31 @@ function Button({
|
|
|
223
255
|
);
|
|
224
256
|
}
|
|
225
257
|
|
|
258
|
+
// src/primitives/ButtonGroup.tsx
|
|
259
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
260
|
+
var ButtonGroup = ({
|
|
261
|
+
wrap = true,
|
|
262
|
+
className,
|
|
263
|
+
children,
|
|
264
|
+
role = "group",
|
|
265
|
+
...rest
|
|
266
|
+
}) => /* @__PURE__ */ jsx3(
|
|
267
|
+
"div",
|
|
268
|
+
{
|
|
269
|
+
...rest,
|
|
270
|
+
role,
|
|
271
|
+
className: cn2(
|
|
272
|
+
"polli:flex polli:min-w-0 polli:items-center polli:gap-1.5",
|
|
273
|
+
wrap ? "polli:flex-wrap" : "polli:flex-nowrap",
|
|
274
|
+
className
|
|
275
|
+
),
|
|
276
|
+
children
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
|
|
226
280
|
// src/primitives/ChevronIcon.tsx
|
|
227
|
-
import { jsx as
|
|
228
|
-
var ChevronIcon = ({ expanded, className }) => /* @__PURE__ */
|
|
281
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
282
|
+
var ChevronIcon = ({ expanded, className }) => /* @__PURE__ */ jsx4(
|
|
229
283
|
"svg",
|
|
230
284
|
{
|
|
231
285
|
"aria-hidden": "true",
|
|
@@ -237,7 +291,7 @@ var ChevronIcon = ({ expanded, className }) => /* @__PURE__ */ jsx2(
|
|
|
237
291
|
expanded && "polli:rotate-180",
|
|
238
292
|
className
|
|
239
293
|
),
|
|
240
|
-
children: /* @__PURE__ */
|
|
294
|
+
children: /* @__PURE__ */ jsx4(
|
|
241
295
|
"path",
|
|
242
296
|
{
|
|
243
297
|
d: "M3 4.5 6 7.5l3-3",
|
|
@@ -252,16 +306,19 @@ var ChevronIcon = ({ expanded, className }) => /* @__PURE__ */ jsx2(
|
|
|
252
306
|
);
|
|
253
307
|
|
|
254
308
|
// src/primitives/Chip.tsx
|
|
255
|
-
import { jsx as
|
|
309
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
256
310
|
var chipSizes = {
|
|
257
311
|
sm: "polli:px-2 polli:py-0.5 polli:text-xs",
|
|
258
312
|
md: "polli:px-2.5 polli:py-0.5 polli:text-sm",
|
|
259
313
|
lg: "polli:px-3 polli:py-1 polli:text-sm"
|
|
260
314
|
};
|
|
261
|
-
var
|
|
262
|
-
news: "polli:bg-
|
|
263
|
-
alpha: "polli:bg-
|
|
264
|
-
neutral: "polli:border polli:border-gray-400/70 polli:bg-gray-100/80 polli:text-gray-900"
|
|
315
|
+
var intentClasses3 = {
|
|
316
|
+
news: "polli:bg-intent-news-bg-light polli:text-intent-news-text",
|
|
317
|
+
alpha: "polli:bg-intent-alpha-bg-light polli:text-intent-alpha-text",
|
|
318
|
+
neutral: "polli:border polli:border-gray-400/70 polli:bg-gray-100/80 polli:text-gray-900",
|
|
319
|
+
success: "polli:border polli:border-intent-success-border polli:bg-intent-success-bg-light polli:text-intent-success-text",
|
|
320
|
+
warning: "polli:border polli:border-intent-warning-border polli:bg-intent-warning-bg-light polli:text-intent-warning-text",
|
|
321
|
+
danger: "polli:border polli:border-intent-danger-border polli:bg-intent-danger-bg-light polli:text-intent-danger-text"
|
|
265
322
|
};
|
|
266
323
|
var Chip = ({
|
|
267
324
|
theme,
|
|
@@ -271,8 +328,8 @@ var Chip = ({
|
|
|
271
328
|
children,
|
|
272
329
|
...rest
|
|
273
330
|
}) => {
|
|
274
|
-
const intentClass = intent ?
|
|
275
|
-
return /* @__PURE__ */
|
|
331
|
+
const intentClass = intent ? intentClasses3[intent] : "polli:bg-theme-bg-active polli:text-theme-text-strong";
|
|
332
|
+
return /* @__PURE__ */ jsx5(
|
|
276
333
|
"span",
|
|
277
334
|
{
|
|
278
335
|
...rest,
|
|
@@ -289,7 +346,7 @@ var Chip = ({
|
|
|
289
346
|
};
|
|
290
347
|
|
|
291
348
|
// src/primitives/Collapsible.tsx
|
|
292
|
-
import { jsx as
|
|
349
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
293
350
|
var Collapsible = ({
|
|
294
351
|
label,
|
|
295
352
|
expanded,
|
|
@@ -301,7 +358,7 @@ var Collapsible = ({
|
|
|
301
358
|
focusClassName,
|
|
302
359
|
panelClassName = "polli:border-t polli:border-theme-border polli:px-3 polli:pt-3 polli:pb-3",
|
|
303
360
|
ariaLabel
|
|
304
|
-
}) => /* @__PURE__ */
|
|
361
|
+
}) => /* @__PURE__ */ jsxs2(
|
|
305
362
|
"div",
|
|
306
363
|
{
|
|
307
364
|
className: cn2(
|
|
@@ -310,7 +367,7 @@ var Collapsible = ({
|
|
|
310
367
|
disabled && "polli:opacity-50"
|
|
311
368
|
),
|
|
312
369
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ jsxs2(
|
|
314
371
|
"button",
|
|
315
372
|
{
|
|
316
373
|
type: "button",
|
|
@@ -319,15 +376,15 @@ var Collapsible = ({
|
|
|
319
376
|
disabled,
|
|
320
377
|
onClick: onToggle,
|
|
321
378
|
className: cn2(
|
|
322
|
-
"polli:w-full polli:flex polli:items-center polli:gap-3 polli:px-3 polli:py-2 polli:text-left polli:transition-colors",
|
|
379
|
+
"polli-control polli:w-full polli:flex polli:items-center polli:gap-3 polli:px-3 polli:py-2 polli:text-left polli:transition-colors",
|
|
323
380
|
expanded ? "polli:rounded-t-lg" : "polli:rounded-lg",
|
|
324
381
|
!disabled && hoverClassName,
|
|
325
382
|
focusClassName,
|
|
326
383
|
disabled ? "polli:cursor-not-allowed" : "polli:cursor-pointer"
|
|
327
384
|
),
|
|
328
385
|
children: [
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ jsx6("div", { className: "polli:flex-1 polli:min-w-0", children: label }),
|
|
387
|
+
/* @__PURE__ */ jsx6(
|
|
331
388
|
ChevronIcon,
|
|
332
389
|
{
|
|
333
390
|
expanded,
|
|
@@ -337,7 +394,7 @@ var Collapsible = ({
|
|
|
337
394
|
]
|
|
338
395
|
}
|
|
339
396
|
),
|
|
340
|
-
expanded && /* @__PURE__ */
|
|
397
|
+
expanded && /* @__PURE__ */ jsx6("div", { className: panelClassName, children })
|
|
341
398
|
]
|
|
342
399
|
}
|
|
343
400
|
);
|
|
@@ -354,7 +411,7 @@ import {
|
|
|
354
411
|
useRef,
|
|
355
412
|
useState
|
|
356
413
|
} from "react";
|
|
357
|
-
import { Fragment, jsx as
|
|
414
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
358
415
|
var TOOLTIP_MAX_WIDTH = 288;
|
|
359
416
|
var TOOLTIP_VIEWPORT_MARGIN = 12;
|
|
360
417
|
var Tooltip = ({
|
|
@@ -396,14 +453,14 @@ var Tooltip = ({
|
|
|
396
453
|
}
|
|
397
454
|
};
|
|
398
455
|
const triggerClassName = cn2(
|
|
399
|
-
"polli:relative polli:cursor-help polli:text-left polli:inline-flex polli:items-center",
|
|
456
|
+
"polli-control polli:relative polli:cursor-help polli:text-left polli:inline-flex polli:items-center",
|
|
400
457
|
className
|
|
401
458
|
);
|
|
402
459
|
const cursorClass = displayContents ? "polli:contents" : "polli:cursor-help";
|
|
403
460
|
const popupClasses = "polli:fixed polli:w-max polli:px-2 polli:py-1 polli:bg-theme-bg-pale polli:text-theme-text-strong polli:border polli:border-theme-border polli:text-xs polli:rounded-md polli:shadow-sm polli:z-50 polli:pointer-events-none polli:transition-opacity polli:whitespace-pre-line polli:break-words";
|
|
404
|
-
const contentNode = /* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
461
|
+
const contentNode = /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
462
|
+
/* @__PURE__ */ jsx7("span", { className: cursorClass, children }),
|
|
463
|
+
/* @__PURE__ */ jsx7(
|
|
407
464
|
"span",
|
|
408
465
|
{
|
|
409
466
|
style: {
|
|
@@ -438,7 +495,7 @@ var Tooltip = ({
|
|
|
438
495
|
style
|
|
439
496
|
};
|
|
440
497
|
if (triggerAs === "span") {
|
|
441
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ jsx7(
|
|
442
499
|
"span",
|
|
443
500
|
{
|
|
444
501
|
ref: (node) => {
|
|
@@ -449,7 +506,7 @@ var Tooltip = ({
|
|
|
449
506
|
}
|
|
450
507
|
);
|
|
451
508
|
}
|
|
452
|
-
return /* @__PURE__ */
|
|
509
|
+
return /* @__PURE__ */ jsx7(
|
|
453
510
|
"button",
|
|
454
511
|
{
|
|
455
512
|
ref: (node) => {
|
|
@@ -468,7 +525,7 @@ var Tooltip = ({
|
|
|
468
525
|
};
|
|
469
526
|
|
|
470
527
|
// src/primitives/CopyButton.tsx
|
|
471
|
-
import { jsx as
|
|
528
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
472
529
|
function CopyButton({
|
|
473
530
|
value,
|
|
474
531
|
children,
|
|
@@ -505,19 +562,20 @@ function CopyButton({
|
|
|
505
562
|
onCopyError?.(error);
|
|
506
563
|
}
|
|
507
564
|
}
|
|
508
|
-
const button = /* @__PURE__ */
|
|
565
|
+
const button = /* @__PURE__ */ jsx8(
|
|
509
566
|
"button",
|
|
510
567
|
{
|
|
511
568
|
...buttonProps,
|
|
512
569
|
type: "button",
|
|
513
570
|
onClick: handleCopy,
|
|
514
571
|
className: cn2(
|
|
572
|
+
"polli-control",
|
|
515
573
|
typeof className === "function" ? className(copied) : className
|
|
516
574
|
),
|
|
517
575
|
children: typeof children === "function" ? children(copied) : children
|
|
518
576
|
}
|
|
519
577
|
);
|
|
520
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ jsx8(
|
|
521
579
|
Tooltip,
|
|
522
580
|
{
|
|
523
581
|
triggerAs: "span",
|
|
@@ -531,7 +589,8 @@ function CopyButton({
|
|
|
531
589
|
// src/primitives/Dialog.tsx
|
|
532
590
|
import { Dialog as ArkDialog } from "@ark-ui/react/dialog";
|
|
533
591
|
import { Portal } from "@ark-ui/react/portal";
|
|
534
|
-
import {
|
|
592
|
+
import { useRef as useRef3 } from "react";
|
|
593
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
535
594
|
var sizeClasses = {
|
|
536
595
|
sm: "polli:max-w-md",
|
|
537
596
|
md: "polli:max-w-xl",
|
|
@@ -554,77 +613,83 @@ var Dialog = ({
|
|
|
554
613
|
positionerClassName,
|
|
555
614
|
contentClassName,
|
|
556
615
|
children
|
|
557
|
-
}) =>
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
children: trigger
|
|
569
|
-
}
|
|
570
|
-
),
|
|
571
|
-
/* @__PURE__ */ jsxs3(Portal, { children: [
|
|
572
|
-
showBackdrop && /* @__PURE__ */ jsx7(
|
|
573
|
-
ArkDialog.Backdrop,
|
|
616
|
+
}) => {
|
|
617
|
+
const contentRef = useRef3(null);
|
|
618
|
+
return /* @__PURE__ */ jsxs4(
|
|
619
|
+
ArkDialog.Root,
|
|
620
|
+
{
|
|
621
|
+
open,
|
|
622
|
+
initialFocusEl: () => contentRef.current,
|
|
623
|
+
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
624
|
+
children: [
|
|
625
|
+
trigger && /* @__PURE__ */ jsx9(
|
|
626
|
+
ArkDialog.Trigger,
|
|
574
627
|
{
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
)
|
|
628
|
+
asChild: triggerAsChild,
|
|
629
|
+
className: triggerClassName,
|
|
630
|
+
children: trigger
|
|
579
631
|
}
|
|
580
632
|
),
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
633
|
+
/* @__PURE__ */ jsxs4(Portal, { children: [
|
|
634
|
+
showBackdrop && /* @__PURE__ */ jsx9(
|
|
635
|
+
ArkDialog.Backdrop,
|
|
636
|
+
{
|
|
637
|
+
className: cn2(
|
|
638
|
+
"polli:fixed polli:inset-0 polli:z-[100] polli:bg-gray-950/50",
|
|
639
|
+
backdropClassName
|
|
640
|
+
)
|
|
641
|
+
}
|
|
642
|
+
),
|
|
643
|
+
/* @__PURE__ */ jsx9(
|
|
644
|
+
ArkDialog.Positioner,
|
|
645
|
+
{
|
|
646
|
+
"data-theme": theme,
|
|
647
|
+
className: cn2(
|
|
648
|
+
"polli:fixed polli:inset-0 polli:z-[110] polli:flex polli:h-dvh polli:items-start polli:justify-center polli:overflow-hidden polli:p-4",
|
|
649
|
+
positionerClassName
|
|
650
|
+
),
|
|
651
|
+
children: /* @__PURE__ */ jsxs4(
|
|
652
|
+
ArkDialog.Content,
|
|
653
|
+
{
|
|
654
|
+
ref: contentRef,
|
|
655
|
+
"data-theme": theme,
|
|
656
|
+
"aria-label": ariaLabel,
|
|
657
|
+
"aria-labelledby": labelledBy,
|
|
658
|
+
className: cn2(
|
|
659
|
+
"polli:my-auto polli:w-full polli:overflow-hidden polli:rounded-lg polli:border-2 polli:border-theme-border polli:bg-white polli:shadow-lg polli:outline-none polli:focus:outline-none polli:focus-visible:outline-none",
|
|
660
|
+
sizeClasses[size],
|
|
661
|
+
contentClassName
|
|
609
662
|
),
|
|
610
|
-
children
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
663
|
+
children: [
|
|
664
|
+
title && /* @__PURE__ */ jsx9(
|
|
665
|
+
DialogTitle,
|
|
666
|
+
{
|
|
667
|
+
className: cn2(
|
|
668
|
+
"polli:px-6 polli:pt-6 polli:font-subheading polli:text-xl polli:text-theme-text-strong",
|
|
669
|
+
titleClassName
|
|
670
|
+
),
|
|
671
|
+
children: title
|
|
672
|
+
}
|
|
673
|
+
),
|
|
674
|
+
children
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
)
|
|
678
|
+
}
|
|
679
|
+
)
|
|
680
|
+
] })
|
|
681
|
+
]
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
};
|
|
620
685
|
var DialogTitle = ArkDialog.Title;
|
|
621
686
|
|
|
622
687
|
// src/primitives/Dropdown.tsx
|
|
623
688
|
import { Popover } from "@ark-ui/react/popover";
|
|
624
689
|
import { Portal as Portal2 } from "@ark-ui/react/portal";
|
|
625
690
|
import { useState as useState3 } from "react";
|
|
626
|
-
import { jsx as
|
|
627
|
-
var DEFAULT_PANEL = "polli:rounded-lg polli:border polli:border-theme-border polli:bg-
|
|
691
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
692
|
+
var DEFAULT_PANEL = "polli:rounded-lg polli:border polli:border-theme-border polli:bg-theme-bg-pale polli:shadow-lg";
|
|
628
693
|
var Dropdown = ({
|
|
629
694
|
theme,
|
|
630
695
|
trigger,
|
|
@@ -632,7 +697,6 @@ var Dropdown = ({
|
|
|
632
697
|
align = "start",
|
|
633
698
|
open: openProp,
|
|
634
699
|
onOpenChange,
|
|
635
|
-
panelClassName,
|
|
636
700
|
className
|
|
637
701
|
}) => {
|
|
638
702
|
const [internalOpen, setInternalOpen] = useState3(false);
|
|
@@ -642,7 +706,7 @@ var Dropdown = ({
|
|
|
642
706
|
if (!isControlled) setInternalOpen(next);
|
|
643
707
|
onOpenChange?.(next);
|
|
644
708
|
};
|
|
645
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsxs5(
|
|
646
710
|
Popover.Root,
|
|
647
711
|
{
|
|
648
712
|
open,
|
|
@@ -651,14 +715,14 @@ var Dropdown = ({
|
|
|
651
715
|
placement: align === "end" ? "bottom-end" : "bottom-start"
|
|
652
716
|
},
|
|
653
717
|
children: [
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ jsx10(Popover.Trigger, { asChild: true, children: trigger(open) }),
|
|
719
|
+
/* @__PURE__ */ jsx10(Portal2, { children: /* @__PURE__ */ jsx10(Popover.Positioner, { children: /* @__PURE__ */ jsx10(
|
|
656
720
|
Popover.Content,
|
|
657
721
|
{
|
|
658
722
|
"data-theme": theme,
|
|
659
723
|
className: cn2(
|
|
660
724
|
"polli:z-50 polli:overflow-hidden polli:focus:outline-none",
|
|
661
|
-
|
|
725
|
+
DEFAULT_PANEL,
|
|
662
726
|
className
|
|
663
727
|
),
|
|
664
728
|
children: typeof children === "function" ? children(() => setOpen(false)) : children
|
|
@@ -669,8 +733,31 @@ var Dropdown = ({
|
|
|
669
733
|
);
|
|
670
734
|
};
|
|
671
735
|
|
|
736
|
+
// src/primitives/DropdownItem.tsx
|
|
737
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
738
|
+
function DropdownItem({
|
|
739
|
+
as,
|
|
740
|
+
className,
|
|
741
|
+
children,
|
|
742
|
+
...rest
|
|
743
|
+
}) {
|
|
744
|
+
const Component = as || "button";
|
|
745
|
+
return /* @__PURE__ */ jsx11(
|
|
746
|
+
Component,
|
|
747
|
+
{
|
|
748
|
+
...Component === "button" ? { type: "button" } : void 0,
|
|
749
|
+
...rest,
|
|
750
|
+
className: cn2(
|
|
751
|
+
"polli-control polli:flex polli:w-full polli:cursor-pointer polli:items-center polli:gap-2 polli:rounded-lg polli:bg-transparent polli:px-3 polli:py-2 polli:text-left polli:text-sm polli:font-medium polli:text-theme-text-base polli:no-underline polli:transition-colors polli:hover:bg-theme-bg-hover polli:focus-visible:bg-theme-bg-hover",
|
|
752
|
+
className
|
|
753
|
+
),
|
|
754
|
+
children
|
|
755
|
+
}
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
|
|
672
759
|
// src/primitives/icons/index.tsx
|
|
673
|
-
import { jsx as
|
|
760
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
674
761
|
var strokeProps = {
|
|
675
762
|
fill: "none",
|
|
676
763
|
stroke: "currentColor",
|
|
@@ -679,26 +766,26 @@ var strokeProps = {
|
|
|
679
766
|
strokeLinejoin: "round"
|
|
680
767
|
};
|
|
681
768
|
function AppIcon(props) {
|
|
682
|
-
return /* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
769
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
770
|
+
/* @__PURE__ */ jsx12("rect", { x: "2", y: "4", width: "20", height: "14", rx: "2" }),
|
|
771
|
+
/* @__PURE__ */ jsx12("path", { d: "M2 20h20" })
|
|
685
772
|
] });
|
|
686
773
|
}
|
|
687
774
|
function BeakerIcon(props) {
|
|
688
|
-
return /* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
776
|
+
/* @__PURE__ */ jsx12("path", { d: "M9 3h6" }),
|
|
777
|
+
/* @__PURE__ */ jsx12("path", { d: "M10 3v6.5L4.5 18a2 2 0 0 0 1.7 3h11.6a2 2 0 0 0 1.7-3L14 9.5V3" }),
|
|
778
|
+
/* @__PURE__ */ jsx12("path", { d: "M7 14h10" })
|
|
692
779
|
] });
|
|
693
780
|
}
|
|
694
781
|
function BookIcon(props) {
|
|
695
|
-
return /* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
/* @__PURE__ */
|
|
782
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
783
|
+
/* @__PURE__ */ jsx12("path", { d: "M4 4h5a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H4z" }),
|
|
784
|
+
/* @__PURE__ */ jsx12("path", { d: "M20 4h-5a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h6z" })
|
|
698
785
|
] });
|
|
699
786
|
}
|
|
700
787
|
function CheckIcon(props) {
|
|
701
|
-
return /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ jsx12(
|
|
702
789
|
"svg",
|
|
703
790
|
{
|
|
704
791
|
"aria-hidden": "true",
|
|
@@ -706,24 +793,24 @@ function CheckIcon(props) {
|
|
|
706
793
|
...strokeProps,
|
|
707
794
|
strokeWidth: 2.5,
|
|
708
795
|
...props,
|
|
709
|
-
children: /* @__PURE__ */
|
|
796
|
+
children: /* @__PURE__ */ jsx12("polyline", { points: "20 6 9 17 4 12" })
|
|
710
797
|
}
|
|
711
798
|
);
|
|
712
799
|
}
|
|
713
800
|
function ClipboardIcon(props) {
|
|
714
|
-
return /* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
716
|
-
/* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
802
|
+
/* @__PURE__ */ jsx12("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
803
|
+
/* @__PURE__ */ jsx12("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
717
804
|
] });
|
|
718
805
|
}
|
|
719
806
|
function ClockIcon(props) {
|
|
720
|
-
return /* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
807
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
808
|
+
/* @__PURE__ */ jsx12("circle", { cx: "12", cy: "12", r: "9" }),
|
|
809
|
+
/* @__PURE__ */ jsx12("path", { d: "M12 7v5l3 2" })
|
|
723
810
|
] });
|
|
724
811
|
}
|
|
725
812
|
function DiscordIcon(props) {
|
|
726
|
-
return /* @__PURE__ */
|
|
813
|
+
return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx12(
|
|
727
814
|
"path",
|
|
728
815
|
{
|
|
729
816
|
fill: "currentColor",
|
|
@@ -732,23 +819,23 @@ function DiscordIcon(props) {
|
|
|
732
819
|
) });
|
|
733
820
|
}
|
|
734
821
|
function DownloadIcon(props) {
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
822
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
823
|
+
/* @__PURE__ */ jsx12("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
824
|
+
/* @__PURE__ */ jsx12("polyline", { points: "7 10 12 15 17 10" }),
|
|
825
|
+
/* @__PURE__ */ jsx12("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
739
826
|
] });
|
|
740
827
|
}
|
|
741
828
|
function ExternalLinkIcon(props) {
|
|
742
|
-
return /* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ jsx12("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ jsx12("path", { d: "M7 17 17 7M9 7h8v8" }) });
|
|
743
830
|
}
|
|
744
831
|
function GenApiIcon(props) {
|
|
745
|
-
return /* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
/* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
833
|
+
/* @__PURE__ */ jsx12("path", { d: "m8 3 4 1.5L16 3v18l-4-1.5L8 21z" }),
|
|
834
|
+
/* @__PURE__ */ jsx12("path", { d: "M8 3v18M16 3v18" })
|
|
748
835
|
] });
|
|
749
836
|
}
|
|
750
837
|
function GitHubIcon(props) {
|
|
751
|
-
return /* @__PURE__ */
|
|
838
|
+
return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx12(
|
|
752
839
|
"path",
|
|
753
840
|
{
|
|
754
841
|
fill: "currentColor",
|
|
@@ -757,69 +844,69 @@ function GitHubIcon(props) {
|
|
|
757
844
|
) });
|
|
758
845
|
}
|
|
759
846
|
function ImageIcon(props) {
|
|
760
|
-
return /* @__PURE__ */
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
847
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
848
|
+
/* @__PURE__ */ jsx12("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
849
|
+
/* @__PURE__ */ jsx12("circle", { cx: "9", cy: "9", r: "2" }),
|
|
850
|
+
/* @__PURE__ */ jsx12("path", { d: "m21 15-5-5L5 21" })
|
|
764
851
|
] });
|
|
765
852
|
}
|
|
766
853
|
function LockIcon(props) {
|
|
767
|
-
return /* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
854
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
855
|
+
/* @__PURE__ */ jsx12("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
|
|
856
|
+
/* @__PURE__ */ jsx12("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
770
857
|
] });
|
|
771
858
|
}
|
|
772
859
|
function MailIcon(props) {
|
|
773
|
-
return /* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
860
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
861
|
+
/* @__PURE__ */ jsx12("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
862
|
+
/* @__PURE__ */ jsx12("path", { d: "m3 7 9 7 9-7" })
|
|
776
863
|
] });
|
|
777
864
|
}
|
|
778
865
|
function McpIcon(props) {
|
|
779
|
-
return /* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
-
/* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
867
|
+
/* @__PURE__ */ jsx12("rect", { x: "2", y: "7", width: "8", height: "10", rx: "1.5" }),
|
|
868
|
+
/* @__PURE__ */ jsx12("rect", { x: "14", y: "7", width: "8", height: "10", rx: "1.5" }),
|
|
869
|
+
/* @__PURE__ */ jsx12("path", { d: "M10 12h4" })
|
|
783
870
|
] });
|
|
784
871
|
}
|
|
785
872
|
function MenuIcon(props) {
|
|
786
|
-
return /* @__PURE__ */
|
|
873
|
+
return /* @__PURE__ */ jsx12("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ jsx12("path", { d: "M4 7h16M4 12h16M4 17h16" }) });
|
|
787
874
|
}
|
|
788
875
|
function TerminalIcon(props) {
|
|
789
|
-
return /* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
/* @__PURE__ */
|
|
876
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
877
|
+
/* @__PURE__ */ jsx12("polyline", { points: "4 8 8 12 4 16" }),
|
|
878
|
+
/* @__PURE__ */ jsx12("line", { x1: "12", y1: "20", x2: "20", y2: "20" })
|
|
792
879
|
] });
|
|
793
880
|
}
|
|
794
881
|
function TokensIcon(props) {
|
|
795
|
-
return /* @__PURE__ */
|
|
882
|
+
return /* @__PURE__ */ jsx12("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ jsx12("path", { d: "M4 9h16M4 15h16M10 3 8 21M16 3l-2 18" }) });
|
|
796
883
|
}
|
|
797
884
|
function TrendUpIcon(props) {
|
|
798
|
-
return /* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
885
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
886
|
+
/* @__PURE__ */ jsx12("polyline", { points: "3 17 9 11 13 15 21 7" }),
|
|
887
|
+
/* @__PURE__ */ jsx12("polyline", { points: "15 7 21 7 21 13" })
|
|
801
888
|
] });
|
|
802
889
|
}
|
|
803
890
|
function WalletIcon(props) {
|
|
804
|
-
return /* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
892
|
+
/* @__PURE__ */ jsx12("path", { d: "M3 7a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v2H5a2 2 0 0 0-2 2V7Z" }),
|
|
893
|
+
/* @__PURE__ */ jsx12("path", { d: "M3 11a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" }),
|
|
894
|
+
/* @__PURE__ */ jsx12("circle", { cx: "17", cy: "14", r: "1.25", fill: "currentColor" })
|
|
808
895
|
] });
|
|
809
896
|
}
|
|
810
897
|
function XIcon(props) {
|
|
811
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ jsx12("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ jsx12("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
812
899
|
}
|
|
813
900
|
|
|
814
901
|
// src/primitives/ExternalLinkButton.tsx
|
|
815
|
-
import { jsx as
|
|
902
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
816
903
|
var ExternalLinkButton = ({
|
|
817
904
|
theme,
|
|
818
905
|
href,
|
|
819
|
-
size = "
|
|
906
|
+
size = "md",
|
|
820
907
|
className,
|
|
821
908
|
children
|
|
822
|
-
}) => /* @__PURE__ */
|
|
909
|
+
}) => /* @__PURE__ */ jsxs7(
|
|
823
910
|
Button,
|
|
824
911
|
{
|
|
825
912
|
as: "a",
|
|
@@ -830,8 +917,8 @@ var ExternalLinkButton = ({
|
|
|
830
917
|
size,
|
|
831
918
|
className: cn2("polli:gap-2", className),
|
|
832
919
|
children: [
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ jsx13("span", { children }),
|
|
921
|
+
/* @__PURE__ */ jsx13(
|
|
835
922
|
ExternalLinkIcon,
|
|
836
923
|
{
|
|
837
924
|
className: "polli:h-4 polli:w-4 polli:shrink-0 polli:opacity-60",
|
|
@@ -845,10 +932,48 @@ var ExternalLinkButton = ({
|
|
|
845
932
|
// src/primitives/Field.tsx
|
|
846
933
|
import { Field } from "@ark-ui/react/field";
|
|
847
934
|
|
|
935
|
+
// src/primitives/FileUpload.tsx
|
|
936
|
+
import { useEffect as useEffect3, useRef as useRef4, useState as useState4 } from "react";
|
|
937
|
+
|
|
938
|
+
// src/lib/partition-files.ts
|
|
939
|
+
function matchesAccept(file, accept) {
|
|
940
|
+
if (!accept) return true;
|
|
941
|
+
const tokens = accept.split(",").map((t) => t.trim()).filter(Boolean);
|
|
942
|
+
if (tokens.length === 0) return true;
|
|
943
|
+
return tokens.some((token) => {
|
|
944
|
+
if (token.startsWith(".")) {
|
|
945
|
+
return file.name.toLowerCase().endsWith(token.toLowerCase());
|
|
946
|
+
}
|
|
947
|
+
if (token.endsWith("/*")) {
|
|
948
|
+
const prefix = token.slice(0, token.length - 1);
|
|
949
|
+
return file.type.startsWith(prefix);
|
|
950
|
+
}
|
|
951
|
+
return file.type === token;
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
function partitionFiles(incoming, current, { maxFiles, maxSizeBytes, accept }) {
|
|
955
|
+
const accepted = [];
|
|
956
|
+
const rejected = [];
|
|
957
|
+
let slots = Math.max(0, maxFiles - current.length);
|
|
958
|
+
for (const file of incoming) {
|
|
959
|
+
if (!matchesAccept(file, accept)) {
|
|
960
|
+
rejected.push({ file, reason: "type" });
|
|
961
|
+
} else if (file.size > maxSizeBytes) {
|
|
962
|
+
rejected.push({ file, reason: "size" });
|
|
963
|
+
} else if (slots <= 0) {
|
|
964
|
+
rejected.push({ file, reason: "count" });
|
|
965
|
+
} else {
|
|
966
|
+
accepted.push(file);
|
|
967
|
+
slots -= 1;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
return { accepted, rejected };
|
|
971
|
+
}
|
|
972
|
+
|
|
848
973
|
// src/primitives/IconButton.tsx
|
|
849
|
-
import { jsx as
|
|
850
|
-
var
|
|
851
|
-
danger: "polli:bg-intent-danger-bg-light polli:hover:bg-
|
|
974
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
975
|
+
var intentClasses4 = {
|
|
976
|
+
danger: "polli:bg-intent-danger-bg-light polli:hover:bg-intent-danger-bg-hover polli:text-intent-danger-text"
|
|
852
977
|
};
|
|
853
978
|
var defaultClasses = "polli:bg-theme-bg-active polli:hover:bg-theme-bg-hover polli:text-theme-text-soft polli:hover:text-theme-text-strong";
|
|
854
979
|
var IconButton = ({
|
|
@@ -857,42 +982,269 @@ var IconButton = ({
|
|
|
857
982
|
onClick,
|
|
858
983
|
children,
|
|
859
984
|
className
|
|
860
|
-
}) => /* @__PURE__ */
|
|
985
|
+
}) => /* @__PURE__ */ jsx14(
|
|
861
986
|
"button",
|
|
862
987
|
{
|
|
863
988
|
type: "button",
|
|
864
989
|
onClick,
|
|
865
990
|
title,
|
|
866
991
|
"aria-label": title,
|
|
992
|
+
"data-intent": intent,
|
|
867
993
|
className: cn2(
|
|
868
|
-
"polli:inline-flex polli:h-6 polli:w-6 polli:cursor-pointer polli:items-center polli:justify-center polli:rounded polli:transition-colors",
|
|
869
|
-
intent ?
|
|
994
|
+
"polli-control polli:inline-flex polli:h-6 polli:w-6 polli:cursor-pointer polli:items-center polli:justify-center polli:rounded polli:transition-colors",
|
|
995
|
+
intent ? intentClasses4[intent] : defaultClasses,
|
|
870
996
|
className
|
|
871
997
|
),
|
|
872
998
|
children
|
|
873
999
|
}
|
|
874
1000
|
);
|
|
875
1001
|
|
|
1002
|
+
// src/primitives/FileUpload.tsx
|
|
1003
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1004
|
+
var PREVIEWABLE_IMAGE_TYPES = /* @__PURE__ */ new Set([
|
|
1005
|
+
"image/gif",
|
|
1006
|
+
"image/jpeg",
|
|
1007
|
+
"image/png",
|
|
1008
|
+
"image/webp"
|
|
1009
|
+
]);
|
|
1010
|
+
var PREVIEW_SIZE = 64;
|
|
1011
|
+
function isPreviewableImage(file) {
|
|
1012
|
+
return PREVIEWABLE_IMAGE_TYPES.has(file.type);
|
|
1013
|
+
}
|
|
1014
|
+
function PreviewPlaceholder() {
|
|
1015
|
+
return /* @__PURE__ */ jsx15("div", { className: "polli:flex polli:h-16 polli:w-16 polli:items-center polli:justify-center polli:rounded-lg polli:bg-theme-bg-active polli:text-theme-text-soft", children: /* @__PURE__ */ jsx15(ImageIcon, { className: "polli:h-5 polli:w-5" }) });
|
|
1016
|
+
}
|
|
1017
|
+
function FilePreview({ file }) {
|
|
1018
|
+
const canvasRef = useRef4(null);
|
|
1019
|
+
const [canPreview, setCanPreview] = useState4(
|
|
1020
|
+
() => isPreviewableImage(file)
|
|
1021
|
+
);
|
|
1022
|
+
useEffect3(() => {
|
|
1023
|
+
if (!isPreviewableImage(file)) {
|
|
1024
|
+
setCanPreview(false);
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
let cancelled = false;
|
|
1028
|
+
setCanPreview(true);
|
|
1029
|
+
async function drawPreview() {
|
|
1030
|
+
try {
|
|
1031
|
+
const bitmap = await createImageBitmap(file);
|
|
1032
|
+
if (cancelled) {
|
|
1033
|
+
bitmap.close();
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
const canvas = canvasRef.current;
|
|
1037
|
+
const context = canvas?.getContext("2d");
|
|
1038
|
+
if (!canvas || !context) {
|
|
1039
|
+
bitmap.close();
|
|
1040
|
+
setCanPreview(false);
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
canvas.width = PREVIEW_SIZE;
|
|
1044
|
+
canvas.height = PREVIEW_SIZE;
|
|
1045
|
+
const scale = Math.max(
|
|
1046
|
+
PREVIEW_SIZE / bitmap.width,
|
|
1047
|
+
PREVIEW_SIZE / bitmap.height
|
|
1048
|
+
);
|
|
1049
|
+
const width = bitmap.width * scale;
|
|
1050
|
+
const height = bitmap.height * scale;
|
|
1051
|
+
const x = (PREVIEW_SIZE - width) / 2;
|
|
1052
|
+
const y = (PREVIEW_SIZE - height) / 2;
|
|
1053
|
+
context.clearRect(0, 0, PREVIEW_SIZE, PREVIEW_SIZE);
|
|
1054
|
+
context.drawImage(bitmap, x, y, width, height);
|
|
1055
|
+
bitmap.close();
|
|
1056
|
+
} catch {
|
|
1057
|
+
if (!cancelled) setCanPreview(false);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
void drawPreview();
|
|
1061
|
+
return () => {
|
|
1062
|
+
cancelled = true;
|
|
1063
|
+
};
|
|
1064
|
+
}, [file]);
|
|
1065
|
+
if (!canPreview) return /* @__PURE__ */ jsx15(PreviewPlaceholder, {});
|
|
1066
|
+
return /* @__PURE__ */ jsx15(
|
|
1067
|
+
"canvas",
|
|
1068
|
+
{
|
|
1069
|
+
ref: canvasRef,
|
|
1070
|
+
role: "img",
|
|
1071
|
+
"aria-label": file.name,
|
|
1072
|
+
className: "polli:h-16 polli:w-16 polli:rounded-lg",
|
|
1073
|
+
width: PREVIEW_SIZE,
|
|
1074
|
+
height: PREVIEW_SIZE
|
|
1075
|
+
}
|
|
1076
|
+
);
|
|
1077
|
+
}
|
|
1078
|
+
function FileUpload({
|
|
1079
|
+
value,
|
|
1080
|
+
onChange,
|
|
1081
|
+
onReject,
|
|
1082
|
+
maxFiles = 4,
|
|
1083
|
+
maxSizeBytes = 10 * 1024 * 1024,
|
|
1084
|
+
accept = "image/*",
|
|
1085
|
+
disabled = false,
|
|
1086
|
+
theme,
|
|
1087
|
+
className
|
|
1088
|
+
}) {
|
|
1089
|
+
useEffect3(() => {
|
|
1090
|
+
const prevent = (event) => event.preventDefault();
|
|
1091
|
+
document.addEventListener("dragover", prevent);
|
|
1092
|
+
document.addEventListener("drop", prevent);
|
|
1093
|
+
return () => {
|
|
1094
|
+
document.removeEventListener("dragover", prevent);
|
|
1095
|
+
document.removeEventListener("drop", prevent);
|
|
1096
|
+
};
|
|
1097
|
+
}, []);
|
|
1098
|
+
function addFiles(incoming) {
|
|
1099
|
+
if (disabled || incoming.length === 0) return;
|
|
1100
|
+
const { accepted, rejected } = partitionFiles(incoming, value, {
|
|
1101
|
+
maxFiles,
|
|
1102
|
+
maxSizeBytes,
|
|
1103
|
+
accept
|
|
1104
|
+
});
|
|
1105
|
+
if (accepted.length > 0) onChange([...value, ...accepted]);
|
|
1106
|
+
if (rejected.length > 0) onReject?.(rejected);
|
|
1107
|
+
}
|
|
1108
|
+
return /* @__PURE__ */ jsxs8(
|
|
1109
|
+
"div",
|
|
1110
|
+
{
|
|
1111
|
+
"data-theme": theme,
|
|
1112
|
+
className: cn2("polli:flex polli:flex-col polli:gap-3", className),
|
|
1113
|
+
children: [
|
|
1114
|
+
/* @__PURE__ */ jsxs8(
|
|
1115
|
+
"label",
|
|
1116
|
+
{
|
|
1117
|
+
className: cn2(
|
|
1118
|
+
"polli-control polli:flex polli:flex-col polli:items-center polli:justify-center polli:gap-2",
|
|
1119
|
+
"polli:rounded-xl polli:border polli:border-dashed polli:border-theme-border",
|
|
1120
|
+
"polli:bg-theme-bg-pale polli:px-4 polli:py-6 polli:text-center polli:text-sm",
|
|
1121
|
+
"polli:text-theme-text-soft polli:transition-colors",
|
|
1122
|
+
disabled ? "polli:cursor-not-allowed polli:opacity-50" : "polli:cursor-pointer polli:hover:bg-theme-bg-hover"
|
|
1123
|
+
),
|
|
1124
|
+
onDragOver: (e) => e.preventDefault(),
|
|
1125
|
+
onDrop: (e) => {
|
|
1126
|
+
e.preventDefault();
|
|
1127
|
+
if (disabled) return;
|
|
1128
|
+
addFiles(Array.from(e.dataTransfer.files));
|
|
1129
|
+
},
|
|
1130
|
+
children: [
|
|
1131
|
+
/* @__PURE__ */ jsx15(ImageIcon, { className: "polli:h-6 polli:w-6" }),
|
|
1132
|
+
/* @__PURE__ */ jsxs8("span", { children: [
|
|
1133
|
+
"Drag images here or",
|
|
1134
|
+
" ",
|
|
1135
|
+
/* @__PURE__ */ jsx15("span", { className: "polli:underline", children: "browse" })
|
|
1136
|
+
] }),
|
|
1137
|
+
/* @__PURE__ */ jsx15(
|
|
1138
|
+
"input",
|
|
1139
|
+
{
|
|
1140
|
+
type: "file",
|
|
1141
|
+
accept,
|
|
1142
|
+
multiple: maxFiles > 1,
|
|
1143
|
+
disabled,
|
|
1144
|
+
className: "polli:sr-only",
|
|
1145
|
+
onChange: (e) => {
|
|
1146
|
+
addFiles(Array.from(e.target.files ?? []));
|
|
1147
|
+
e.target.value = "";
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
)
|
|
1151
|
+
]
|
|
1152
|
+
}
|
|
1153
|
+
),
|
|
1154
|
+
value.length > 0 && /* @__PURE__ */ jsx15("ul", { className: "polli:m-0 polli:flex polli:flex-wrap polli:gap-3 polli:p-0", children: value.map((file, index) => /* @__PURE__ */ jsxs8(
|
|
1155
|
+
"li",
|
|
1156
|
+
{
|
|
1157
|
+
className: "polli:relative polli:flex polli:list-none polli:flex-col polli:gap-1",
|
|
1158
|
+
children: [
|
|
1159
|
+
/* @__PURE__ */ jsx15(FilePreview, { file }),
|
|
1160
|
+
/* @__PURE__ */ jsx15("span", { className: "polli:max-w-16 polli:truncate polli:text-xs polli:text-theme-text-muted", children: file.name }),
|
|
1161
|
+
!disabled && /* @__PURE__ */ jsx15("div", { className: "polli:absolute polli:-top-2 polli:-right-2", children: /* @__PURE__ */ jsx15(
|
|
1162
|
+
IconButton,
|
|
1163
|
+
{
|
|
1164
|
+
intent: "danger",
|
|
1165
|
+
title: `Remove ${file.name}`,
|
|
1166
|
+
onClick: () => onChange(
|
|
1167
|
+
value.filter(
|
|
1168
|
+
(_, i) => i !== index
|
|
1169
|
+
)
|
|
1170
|
+
),
|
|
1171
|
+
children: /* @__PURE__ */ jsx15(XIcon, { className: "polli:h-3 polli:w-3" })
|
|
1172
|
+
}
|
|
1173
|
+
) })
|
|
1174
|
+
]
|
|
1175
|
+
},
|
|
1176
|
+
`${file.name}-${index}`
|
|
1177
|
+
)) })
|
|
1178
|
+
]
|
|
1179
|
+
}
|
|
1180
|
+
);
|
|
1181
|
+
}
|
|
1182
|
+
|
|
876
1183
|
// src/primitives/InfoTip.tsx
|
|
877
|
-
import { jsx as
|
|
1184
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
878
1185
|
var InfoTip = ({
|
|
879
1186
|
text,
|
|
880
1187
|
content,
|
|
881
1188
|
label = "More info"
|
|
882
|
-
}) => /* @__PURE__ */
|
|
1189
|
+
}) => /* @__PURE__ */ jsx16(Tooltip, { content: content ?? text, ariaLabel: label, className: "polli:ml-1", children: /* @__PURE__ */ jsx16("span", { className: "polli:inline-flex polli:h-3.5 polli:w-3.5 polli:items-center polli:justify-center polli:rounded-full polli:border polli:border-theme-border polli:bg-theme-bg-active polli:font-bold polli:text-micro polli:text-theme-text-strong polli:transition-colors", children: "i" }) });
|
|
1190
|
+
|
|
1191
|
+
// src/primitives/InlineLink.tsx
|
|
1192
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1193
|
+
function isExternalHref(href) {
|
|
1194
|
+
return typeof href === "string" && /^https?:\/\//.test(href);
|
|
1195
|
+
}
|
|
1196
|
+
function InlineLink({
|
|
1197
|
+
as,
|
|
1198
|
+
theme,
|
|
1199
|
+
external,
|
|
1200
|
+
showIcon = true,
|
|
1201
|
+
className,
|
|
1202
|
+
children,
|
|
1203
|
+
...linkProps
|
|
1204
|
+
}) {
|
|
1205
|
+
const Component = as || "a";
|
|
1206
|
+
const isExternal = external ?? isExternalHref(linkProps.href);
|
|
1207
|
+
return /* @__PURE__ */ jsxs9(
|
|
1208
|
+
Component,
|
|
1209
|
+
{
|
|
1210
|
+
"data-theme": theme,
|
|
1211
|
+
target: isExternal ? "_blank" : void 0,
|
|
1212
|
+
rel: isExternal ? "noopener noreferrer" : void 0,
|
|
1213
|
+
className: cn2(
|
|
1214
|
+
"polli-control polli:inline-flex polli:items-center polli:gap-1 polli:rounded-sm polli:font-semibold polli:text-theme-text-strong",
|
|
1215
|
+
"polli:underline polli:decoration-theme-border polli:decoration-2 polli:underline-offset-3",
|
|
1216
|
+
"polli:transition-colors polli:hover:text-theme-text-soft polli:hover:decoration-theme-text-soft",
|
|
1217
|
+
className
|
|
1218
|
+
),
|
|
1219
|
+
...linkProps,
|
|
1220
|
+
children: [
|
|
1221
|
+
children,
|
|
1222
|
+
showIcon && isExternal && /* @__PURE__ */ jsx17(
|
|
1223
|
+
ExternalLinkIcon,
|
|
1224
|
+
{
|
|
1225
|
+
"aria-hidden": "true",
|
|
1226
|
+
className: "polli:h-3.5 polli:w-3.5 polli:shrink-0 polli:opacity-65"
|
|
1227
|
+
}
|
|
1228
|
+
)
|
|
1229
|
+
]
|
|
1230
|
+
}
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
883
1233
|
|
|
884
1234
|
// src/primitives/Input.tsx
|
|
885
1235
|
import { forwardRef } from "react";
|
|
886
|
-
import { jsx as
|
|
1236
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
887
1237
|
var Input = forwardRef(
|
|
888
|
-
({ className, error, hideNumberSteppers, ...props }, ref) => /* @__PURE__ */
|
|
1238
|
+
({ className, error, hideNumberSteppers, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
889
1239
|
"input",
|
|
890
1240
|
{
|
|
891
1241
|
ref,
|
|
1242
|
+
"data-error": error ? "true" : void 0,
|
|
892
1243
|
className: cn2(
|
|
893
|
-
"polli:px-3 polli:py-2 polli:border polli:rounded-lg",
|
|
1244
|
+
"polli-input polli:px-3 polli:py-2 polli:border polli:rounded-lg",
|
|
1245
|
+
"polli:text-gray-950",
|
|
1246
|
+
"polli:transition-colors",
|
|
894
1247
|
"polli:disabled:opacity-50 polli:disabled:cursor-not-allowed",
|
|
895
|
-
error ? "polli:border-red-400" : "polli:border-gray-300",
|
|
896
1248
|
hideNumberSteppers && "polli-input-number-clean",
|
|
897
1249
|
className
|
|
898
1250
|
),
|
|
@@ -901,26 +1253,161 @@ var Input = forwardRef(
|
|
|
901
1253
|
)
|
|
902
1254
|
);
|
|
903
1255
|
|
|
1256
|
+
// src/primitives/Surface.tsx
|
|
1257
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1258
|
+
var variantClasses = {
|
|
1259
|
+
panel: "polli:rounded-2xl polli:border polli:border-theme-border polli:bg-theme-bg-subtle polli:p-6",
|
|
1260
|
+
card: "polli:rounded-xl polli:bg-surface-white polli:p-4",
|
|
1261
|
+
"card-themed": "polli:rounded-xl polli:bg-theme-bg-pale polli:p-4"
|
|
1262
|
+
};
|
|
1263
|
+
var Surface = ({
|
|
1264
|
+
theme,
|
|
1265
|
+
variant = "card",
|
|
1266
|
+
className,
|
|
1267
|
+
children,
|
|
1268
|
+
...rest
|
|
1269
|
+
}) => /* @__PURE__ */ jsx19(
|
|
1270
|
+
"div",
|
|
1271
|
+
{
|
|
1272
|
+
...rest,
|
|
1273
|
+
"data-theme": theme,
|
|
1274
|
+
className: cn2("polli:min-w-0", variantClasses[variant], className),
|
|
1275
|
+
children
|
|
1276
|
+
}
|
|
1277
|
+
);
|
|
1278
|
+
|
|
1279
|
+
// src/primitives/LinkCard.tsx
|
|
1280
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1281
|
+
function isExternalHref2(href) {
|
|
1282
|
+
return typeof href === "string" && /^https?:\/\//.test(href);
|
|
1283
|
+
}
|
|
1284
|
+
function LinkCard({
|
|
1285
|
+
as,
|
|
1286
|
+
theme,
|
|
1287
|
+
external,
|
|
1288
|
+
showIcon = true,
|
|
1289
|
+
className,
|
|
1290
|
+
surfaceClassName,
|
|
1291
|
+
children,
|
|
1292
|
+
...linkProps
|
|
1293
|
+
}) {
|
|
1294
|
+
const Component = as || "a";
|
|
1295
|
+
const isExternal = external ?? isExternalHref2(linkProps.href);
|
|
1296
|
+
return /* @__PURE__ */ jsx20(
|
|
1297
|
+
Component,
|
|
1298
|
+
{
|
|
1299
|
+
"data-theme": theme,
|
|
1300
|
+
target: isExternal ? "_blank" : void 0,
|
|
1301
|
+
rel: isExternal ? "noopener noreferrer" : void 0,
|
|
1302
|
+
className: cn2(
|
|
1303
|
+
"polli:group polli:block polli:h-full polli:rounded-xl polli:outline-none",
|
|
1304
|
+
className
|
|
1305
|
+
),
|
|
1306
|
+
...linkProps,
|
|
1307
|
+
children: /* @__PURE__ */ jsxs10(
|
|
1308
|
+
Surface,
|
|
1309
|
+
{
|
|
1310
|
+
theme,
|
|
1311
|
+
variant: "card",
|
|
1312
|
+
className: cn2(
|
|
1313
|
+
"polli:relative polli:flex polli:h-full polli:flex-col polli:gap-2 polli:bg-white/80 polli:p-5",
|
|
1314
|
+
showIcon && isExternal && "polli:pr-10",
|
|
1315
|
+
"polli:transition polli:group-hover:-translate-y-0.5 polli:group-hover:bg-white/95",
|
|
1316
|
+
"polli:group-focus-visible:ring-2 polli:group-focus-visible:ring-theme-border",
|
|
1317
|
+
surfaceClassName
|
|
1318
|
+
),
|
|
1319
|
+
children: [
|
|
1320
|
+
showIcon && isExternal && /* @__PURE__ */ jsx20(
|
|
1321
|
+
ExternalLinkIcon,
|
|
1322
|
+
{
|
|
1323
|
+
"aria-hidden": "true",
|
|
1324
|
+
className: "polli:absolute polli:top-4 polli:right-4 polli:h-3.5 polli:w-3.5 polli:text-theme-text-soft"
|
|
1325
|
+
}
|
|
1326
|
+
),
|
|
1327
|
+
children
|
|
1328
|
+
]
|
|
1329
|
+
}
|
|
1330
|
+
)
|
|
1331
|
+
}
|
|
1332
|
+
);
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
// src/primitives/Markdown.tsx
|
|
1336
|
+
import ReactMarkdown from "react-markdown";
|
|
1337
|
+
import remarkGfm from "remark-gfm";
|
|
1338
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1339
|
+
var components = {
|
|
1340
|
+
ul: ({ node, ...props }) => /* @__PURE__ */ jsx21(
|
|
1341
|
+
"ul",
|
|
1342
|
+
{
|
|
1343
|
+
className: "polli:flex polli:min-w-0 polli:list-disc polli:flex-col polli:gap-1 polli:pl-5 polli:marker:text-theme-text-muted",
|
|
1344
|
+
...props
|
|
1345
|
+
}
|
|
1346
|
+
),
|
|
1347
|
+
ol: ({ node, ...props }) => /* @__PURE__ */ jsx21(
|
|
1348
|
+
"ol",
|
|
1349
|
+
{
|
|
1350
|
+
className: "polli:flex polli:min-w-0 polli:list-decimal polli:flex-col polli:gap-1 polli:pl-5 polli:marker:text-theme-text-muted",
|
|
1351
|
+
...props
|
|
1352
|
+
}
|
|
1353
|
+
),
|
|
1354
|
+
p: ({ node, ...props }) => /* @__PURE__ */ jsx21("p", { className: "polli:mb-2 polli:last:mb-0", ...props }),
|
|
1355
|
+
strong: ({ node, ...props }) => /* @__PURE__ */ jsx21(
|
|
1356
|
+
"strong",
|
|
1357
|
+
{
|
|
1358
|
+
className: "polli:font-semibold polli:text-theme-text-strong",
|
|
1359
|
+
...props
|
|
1360
|
+
}
|
|
1361
|
+
),
|
|
1362
|
+
code: ({ node, ...props }) => /* @__PURE__ */ jsx21(
|
|
1363
|
+
"code",
|
|
1364
|
+
{
|
|
1365
|
+
className: "polli:break-words polli:rounded polli:bg-theme-bg-subtle polli:px-1 polli:py-0.5 polli:font-mono polli:text-xs",
|
|
1366
|
+
...props
|
|
1367
|
+
}
|
|
1368
|
+
),
|
|
1369
|
+
a: ({ node, ...props }) => /* @__PURE__ */ jsx21(
|
|
1370
|
+
"a",
|
|
1371
|
+
{
|
|
1372
|
+
target: "_blank",
|
|
1373
|
+
rel: "noopener noreferrer",
|
|
1374
|
+
className: "polli-control polli:rounded-sm polli:font-semibold polli:text-theme-text-strong polli:underline polli:underline-offset-2",
|
|
1375
|
+
...props
|
|
1376
|
+
}
|
|
1377
|
+
)
|
|
1378
|
+
};
|
|
1379
|
+
function Markdown({ children, className }) {
|
|
1380
|
+
return /* @__PURE__ */ jsx21(
|
|
1381
|
+
"div",
|
|
1382
|
+
{
|
|
1383
|
+
className: cn2(
|
|
1384
|
+
"polli:min-w-0 polli:font-body polli:leading-relaxed",
|
|
1385
|
+
className
|
|
1386
|
+
),
|
|
1387
|
+
children: /* @__PURE__ */ jsx21(ReactMarkdown, { remarkPlugins: [remarkGfm], components, children })
|
|
1388
|
+
}
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
904
1392
|
// src/primitives/ScrollArea.tsx
|
|
905
1393
|
import {
|
|
906
1394
|
forwardRef as forwardRef2,
|
|
907
1395
|
useCallback,
|
|
908
|
-
useEffect as
|
|
909
|
-
useRef as
|
|
1396
|
+
useEffect as useEffect4,
|
|
1397
|
+
useRef as useRef5
|
|
910
1398
|
} from "react";
|
|
911
|
-
import { jsx as
|
|
1399
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
912
1400
|
var axisClasses = {
|
|
913
1401
|
y: "polli:overflow-y-auto polli:overflow-x-hidden",
|
|
914
|
-
x: "polli:overflow-x-auto polli:overflow-y-hidden"
|
|
915
|
-
both: "polli:overflow-auto"
|
|
1402
|
+
x: "polli:overflow-x-auto polli:overflow-y-hidden"
|
|
916
1403
|
};
|
|
917
1404
|
function assignRef(ref, value) {
|
|
918
1405
|
if (typeof ref === "function") ref(value);
|
|
919
1406
|
else if (ref) ref.current = value;
|
|
920
1407
|
}
|
|
921
1408
|
var ScrollArea = forwardRef2(
|
|
922
|
-
({ theme, axis = "y",
|
|
923
|
-
const innerRef =
|
|
1409
|
+
({ theme, axis = "y", className, children, ...rest }, externalRef) => {
|
|
1410
|
+
const innerRef = useRef5(null);
|
|
924
1411
|
const setRef = useCallback(
|
|
925
1412
|
(node) => {
|
|
926
1413
|
innerRef.current = node;
|
|
@@ -928,7 +1415,7 @@ var ScrollArea = forwardRef2(
|
|
|
928
1415
|
},
|
|
929
1416
|
[externalRef]
|
|
930
1417
|
);
|
|
931
|
-
|
|
1418
|
+
useEffect4(() => {
|
|
932
1419
|
const element = innerRef.current;
|
|
933
1420
|
if (!element) return;
|
|
934
1421
|
let hideTimer = null;
|
|
@@ -948,7 +1435,7 @@ var ScrollArea = forwardRef2(
|
|
|
948
1435
|
};
|
|
949
1436
|
const scheduleHide = () => {
|
|
950
1437
|
clearHideTimer();
|
|
951
|
-
hideTimer = window.setTimeout(hide,
|
|
1438
|
+
hideTimer = window.setTimeout(hide, 2e3);
|
|
952
1439
|
};
|
|
953
1440
|
const handleInteraction = () => {
|
|
954
1441
|
show();
|
|
@@ -978,15 +1465,15 @@ var ScrollArea = forwardRef2(
|
|
|
978
1465
|
element.removeEventListener("focusin", handleInteraction);
|
|
979
1466
|
element.removeEventListener("focusout", scheduleHide);
|
|
980
1467
|
};
|
|
981
|
-
}, [
|
|
982
|
-
return /* @__PURE__ */
|
|
1468
|
+
}, []);
|
|
1469
|
+
return /* @__PURE__ */ jsx22(
|
|
983
1470
|
"div",
|
|
984
1471
|
{
|
|
985
1472
|
...rest,
|
|
986
1473
|
ref: setRef,
|
|
987
1474
|
"data-theme": theme,
|
|
988
1475
|
className: cn2(
|
|
989
|
-
"polli-scrollbar-subtle",
|
|
1476
|
+
"polli-scrollbar-subtle polli:min-w-0 polli:max-w-full",
|
|
990
1477
|
axisClasses[axis],
|
|
991
1478
|
className
|
|
992
1479
|
),
|
|
@@ -998,9 +1485,9 @@ var ScrollArea = forwardRef2(
|
|
|
998
1485
|
ScrollArea.displayName = "ScrollArea";
|
|
999
1486
|
|
|
1000
1487
|
// src/primitives/MultiSelect.tsx
|
|
1001
|
-
import { jsx as
|
|
1002
|
-
var TRIGGER_BASE = "polli:inline-flex polli:min-h-8 polli:min-w-[140px] polli:items-center polli:gap-2 polli:rounded-full polli:border polli:px-3 polli:py-1.5 polli:text-xs polli:font-medium polli:transition-all polli:duration-200";
|
|
1003
|
-
var ROW_BASE = "polli:flex polli:w-full polli:items-center polli:gap-3 polli:px-3 polli:py-2 polli:text-left polli:text-xs polli:transition-colors";
|
|
1488
|
+
import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1489
|
+
var TRIGGER_BASE = "polli-control polli:inline-flex polli:min-h-8 polli:min-w-[140px] polli:items-center polli:gap-2 polli:rounded-full polli:border polli:px-3 polli:py-1.5 polli:text-xs polli:font-medium polli:transition-all polli:duration-200";
|
|
1490
|
+
var ROW_BASE = "polli-control polli:flex polli:w-full polli:items-center polli:gap-3 polli:px-3 polli:py-2 polli:text-left polli:text-xs polli:transition-colors";
|
|
1004
1491
|
var CHECK_BASE = "polli:flex polli:h-4 polli:w-4 polli:flex-shrink-0 polli:items-center polli:justify-center polli:rounded polli:border polli:border-theme-border polli:text-xs";
|
|
1005
1492
|
var MultiSelect = ({
|
|
1006
1493
|
options,
|
|
@@ -1023,16 +1510,16 @@ var MultiSelect = ({
|
|
|
1023
1510
|
};
|
|
1024
1511
|
const selectAll = () => onChange([]);
|
|
1025
1512
|
const displayText = disabled ? disabledText : isAllSelected ? "All" : `${selected.length} selected`;
|
|
1026
|
-
const labelNode = label ? /* @__PURE__ */
|
|
1513
|
+
const labelNode = label ? /* @__PURE__ */ jsx23("span", { className: "polli:text-xs polli:font-medium polli:text-theme-text-soft", children: label }) : null;
|
|
1027
1514
|
if (disabled) {
|
|
1028
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ jsxs11(
|
|
1029
1516
|
"div",
|
|
1030
1517
|
{
|
|
1031
1518
|
"data-theme": theme,
|
|
1032
1519
|
className: "polli:group polli:relative polli:flex polli:items-center polli:gap-2",
|
|
1033
1520
|
children: [
|
|
1034
1521
|
labelNode,
|
|
1035
|
-
/* @__PURE__ */
|
|
1522
|
+
/* @__PURE__ */ jsxs11(
|
|
1036
1523
|
"button",
|
|
1037
1524
|
{
|
|
1038
1525
|
type: "button",
|
|
@@ -1042,8 +1529,8 @@ var MultiSelect = ({
|
|
|
1042
1529
|
"polli:cursor-not-allowed polli:border-theme-border polli:bg-theme-bg-subtle polli:opacity-60"
|
|
1043
1530
|
),
|
|
1044
1531
|
children: [
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ jsx23("span", { className: "polli:flex-1 polli:truncate polli:text-left polli:text-theme-text-soft/60", children: displayText }),
|
|
1533
|
+
/* @__PURE__ */ jsx23(
|
|
1047
1534
|
ChevronIcon,
|
|
1048
1535
|
{
|
|
1049
1536
|
expanded: false,
|
|
@@ -1053,25 +1540,25 @@ var MultiSelect = ({
|
|
|
1053
1540
|
]
|
|
1054
1541
|
}
|
|
1055
1542
|
),
|
|
1056
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ jsx23("span", { className: "polli:pointer-events-none polli:absolute polli:-top-8 polli:left-1/2 polli:z-[100] polli:-translate-x-1/2 polli:whitespace-nowrap polli:rounded-md polli:border polli:border-theme-border polli:bg-theme-bg-pale polli:px-2 polli:py-1 polli:text-xs polli:text-theme-text-strong polli:opacity-0 polli:shadow-sm polli:transition-opacity polli:group-hover:opacity-100", children: "No items available" })
|
|
1057
1544
|
]
|
|
1058
1545
|
}
|
|
1059
1546
|
);
|
|
1060
1547
|
}
|
|
1061
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ jsxs11(
|
|
1062
1549
|
"div",
|
|
1063
1550
|
{
|
|
1064
1551
|
"data-theme": theme,
|
|
1065
1552
|
className: "polli:flex polli:items-center polli:gap-2",
|
|
1066
1553
|
children: [
|
|
1067
1554
|
labelNode,
|
|
1068
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ jsx23(
|
|
1069
1556
|
Dropdown,
|
|
1070
1557
|
{
|
|
1071
1558
|
theme,
|
|
1072
1559
|
align,
|
|
1073
1560
|
className: "polli:min-w-[320px]",
|
|
1074
|
-
trigger: (open) => /* @__PURE__ */
|
|
1561
|
+
trigger: (open) => /* @__PURE__ */ jsxs11(
|
|
1075
1562
|
"button",
|
|
1076
1563
|
{
|
|
1077
1564
|
type: "button",
|
|
@@ -1080,7 +1567,7 @@ var MultiSelect = ({
|
|
|
1080
1567
|
open ? "polli:border-theme-border polli:bg-theme-bg-active" : "polli:border-theme-border polli:bg-theme-bg-subtle polli:hover:bg-theme-bg-pale"
|
|
1081
1568
|
),
|
|
1082
1569
|
children: [
|
|
1083
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx23(
|
|
1084
1571
|
"span",
|
|
1085
1572
|
{
|
|
1086
1573
|
className: cn2(
|
|
@@ -1090,7 +1577,7 @@ var MultiSelect = ({
|
|
|
1090
1577
|
children: displayText
|
|
1091
1578
|
}
|
|
1092
1579
|
),
|
|
1093
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ jsx23(
|
|
1094
1581
|
ChevronIcon,
|
|
1095
1582
|
{
|
|
1096
1583
|
expanded: open,
|
|
@@ -1103,8 +1590,8 @@ var MultiSelect = ({
|
|
|
1103
1590
|
]
|
|
1104
1591
|
}
|
|
1105
1592
|
),
|
|
1106
|
-
children: /* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1593
|
+
children: /* @__PURE__ */ jsxs11(ScrollArea, { theme, className: "polli:max-h-64", children: [
|
|
1594
|
+
/* @__PURE__ */ jsxs11(
|
|
1108
1595
|
"button",
|
|
1109
1596
|
{
|
|
1110
1597
|
type: "button",
|
|
@@ -1114,7 +1601,7 @@ var MultiSelect = ({
|
|
|
1114
1601
|
isAllSelected ? "polli:bg-theme-bg-active polli:font-medium polli:text-theme-text-strong" : "polli:text-theme-text-base polli:hover:bg-theme-bg-subtle"
|
|
1115
1602
|
),
|
|
1116
1603
|
children: [
|
|
1117
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ jsx23(
|
|
1118
1605
|
"span",
|
|
1119
1606
|
{
|
|
1120
1607
|
className: cn2(
|
|
@@ -1130,7 +1617,7 @@ var MultiSelect = ({
|
|
|
1130
1617
|
),
|
|
1131
1618
|
options.map((opt) => {
|
|
1132
1619
|
const isChecked = selected.includes(opt.value);
|
|
1133
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsxs11(
|
|
1134
1621
|
"button",
|
|
1135
1622
|
{
|
|
1136
1623
|
type: "button",
|
|
@@ -1140,7 +1627,7 @@ var MultiSelect = ({
|
|
|
1140
1627
|
isChecked ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-theme-text-base polli:hover:bg-theme-bg-subtle"
|
|
1141
1628
|
),
|
|
1142
1629
|
children: [
|
|
1143
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ jsx23(
|
|
1144
1631
|
"span",
|
|
1145
1632
|
{
|
|
1146
1633
|
className: cn2(
|
|
@@ -1150,7 +1637,7 @@ var MultiSelect = ({
|
|
|
1150
1637
|
children: isChecked && "\u2713"
|
|
1151
1638
|
}
|
|
1152
1639
|
),
|
|
1153
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ jsx23("span", { className: "polli:whitespace-nowrap", children: opt.label })
|
|
1154
1641
|
]
|
|
1155
1642
|
},
|
|
1156
1643
|
opt.value
|
|
@@ -1164,26 +1651,74 @@ var MultiSelect = ({
|
|
|
1164
1651
|
);
|
|
1165
1652
|
};
|
|
1166
1653
|
|
|
1654
|
+
// src/primitives/NavItem.tsx
|
|
1655
|
+
import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1656
|
+
var base = "polli-control polli:flex polli:items-center polli:gap-2 polli:rounded-full polli:px-3 polli:py-2 polli:text-left polli:text-sm polli:font-medium polli:whitespace-nowrap polli:transition-colors";
|
|
1657
|
+
var activeClasses = "polli:bg-theme-bg-active polli:text-theme-text-strong";
|
|
1658
|
+
var inactiveClasses = "polli:text-gray-800 polli:hover:bg-white/60 polli:hover:text-gray-950";
|
|
1659
|
+
var dotClasses = "polli:h-2.5 polli:w-2.5 polli:shrink-0 polli:rounded-full polli:bg-theme-bg-hover polli:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)]";
|
|
1660
|
+
function NavItem({
|
|
1661
|
+
as,
|
|
1662
|
+
theme,
|
|
1663
|
+
active = false,
|
|
1664
|
+
className,
|
|
1665
|
+
children,
|
|
1666
|
+
...rest
|
|
1667
|
+
}) {
|
|
1668
|
+
const Component = as || "button";
|
|
1669
|
+
return /* @__PURE__ */ jsxs12(
|
|
1670
|
+
Component,
|
|
1671
|
+
{
|
|
1672
|
+
"data-theme": theme,
|
|
1673
|
+
"aria-current": active ? "page" : void 0,
|
|
1674
|
+
className: cn2(
|
|
1675
|
+
base,
|
|
1676
|
+
active ? activeClasses : inactiveClasses,
|
|
1677
|
+
className
|
|
1678
|
+
),
|
|
1679
|
+
...rest,
|
|
1680
|
+
children: [
|
|
1681
|
+
/* @__PURE__ */ jsx24("span", { "aria-hidden": "true", className: dotClasses }),
|
|
1682
|
+
children
|
|
1683
|
+
]
|
|
1684
|
+
}
|
|
1685
|
+
);
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1167
1688
|
// src/primitives/PeriodPicker.tsx
|
|
1168
|
-
import { useEffect as
|
|
1689
|
+
import { useEffect as useEffect5, useMemo, useState as useState5 } from "react";
|
|
1169
1690
|
|
|
1170
1691
|
// src/primitives/TabButton.tsx
|
|
1171
|
-
import { jsx as
|
|
1692
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1172
1693
|
var sizeClasses2 = {
|
|
1173
|
-
|
|
1174
|
-
|
|
1694
|
+
md: "polli:px-4 polli:py-1.5 polli:text-base",
|
|
1695
|
+
sm: "polli:px-3 polli:py-1.5 polli:text-sm"
|
|
1696
|
+
};
|
|
1697
|
+
var variantClasses2 = {
|
|
1698
|
+
default: {
|
|
1699
|
+
base: "polli:border",
|
|
1700
|
+
active: "polli:bg-theme-bg-active polli:text-theme-text-strong polli:border-theme-border",
|
|
1701
|
+
inactive: "polli:bg-theme-bg-subtle polli:text-theme-text-base polli:border-theme-border polli:hover:bg-theme-bg-active"
|
|
1702
|
+
},
|
|
1703
|
+
ghost: {
|
|
1704
|
+
base: "polli:border polli:border-transparent",
|
|
1705
|
+
active: "polli:bg-theme-bg-active polli:text-theme-text-strong",
|
|
1706
|
+
inactive: "polli:bg-transparent polli:text-theme-text-base polli:hover:bg-theme-bg-subtle polli:hover:text-theme-text-strong"
|
|
1707
|
+
}
|
|
1175
1708
|
};
|
|
1176
1709
|
var TabButton = ({
|
|
1177
1710
|
theme,
|
|
1178
1711
|
active,
|
|
1179
1712
|
onClick,
|
|
1180
1713
|
children,
|
|
1181
|
-
size = "
|
|
1714
|
+
size = "md",
|
|
1715
|
+
variant = "default",
|
|
1182
1716
|
ariaLabel,
|
|
1183
1717
|
disabled = false,
|
|
1184
1718
|
className
|
|
1185
1719
|
}) => {
|
|
1186
|
-
|
|
1720
|
+
const classes = variantClasses2[variant];
|
|
1721
|
+
return /* @__PURE__ */ jsx25(
|
|
1187
1722
|
"button",
|
|
1188
1723
|
{
|
|
1189
1724
|
type: "button",
|
|
@@ -1193,8 +1728,9 @@ var TabButton = ({
|
|
|
1193
1728
|
"aria-pressed": active,
|
|
1194
1729
|
disabled,
|
|
1195
1730
|
className: cn2(
|
|
1196
|
-
"polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:
|
|
1197
|
-
|
|
1731
|
+
"polli-control polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:font-medium polli:leading-normal polli:transition-all polli:duration-200",
|
|
1732
|
+
classes.base,
|
|
1733
|
+
active ? classes.active : classes.inactive,
|
|
1198
1734
|
disabled && "polli:cursor-not-allowed polli:opacity-50",
|
|
1199
1735
|
sizeClasses2[size],
|
|
1200
1736
|
className
|
|
@@ -1205,7 +1741,7 @@ var TabButton = ({
|
|
|
1205
1741
|
};
|
|
1206
1742
|
|
|
1207
1743
|
// src/primitives/PeriodPicker.tsx
|
|
1208
|
-
import { Fragment as Fragment2, jsx as
|
|
1744
|
+
import { Fragment as Fragment2, jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1209
1745
|
var WEEKDAY_LABELS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
1210
1746
|
var MONTH_LABELS = [
|
|
1211
1747
|
"Jan",
|
|
@@ -1221,7 +1757,7 @@ var MONTH_LABELS = [
|
|
|
1221
1757
|
"Nov",
|
|
1222
1758
|
"Dec"
|
|
1223
1759
|
];
|
|
1224
|
-
var NAV_BUTTON = "polli:rounded-full polli:px-2 polli:py-1 polli:text-xs polli:font-semibold polli:text-theme-text-base polli:transition-colors polli:hover:bg-theme-bg-subtle";
|
|
1760
|
+
var NAV_BUTTON = "polli-control polli:rounded-full polli:px-2 polli:py-1 polli:text-xs polli:font-semibold polli:text-theme-text-base polli:transition-colors polli:hover:bg-theme-bg-subtle";
|
|
1225
1761
|
function addUtcMonths2(date, months) {
|
|
1226
1762
|
return new Date(
|
|
1227
1763
|
Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + months, 1)
|
|
@@ -1258,10 +1794,10 @@ var PeriodPicker = ({
|
|
|
1258
1794
|
minDate = /* @__PURE__ */ new Date(0),
|
|
1259
1795
|
maxDate
|
|
1260
1796
|
}) => {
|
|
1261
|
-
const [open, setOpen] =
|
|
1262
|
-
const [viewDate, setViewDate] =
|
|
1797
|
+
const [open, setOpen] = useState5(false);
|
|
1798
|
+
const [viewDate, setViewDate] = useState5(() => periodDate(value));
|
|
1263
1799
|
const { granularity, period } = value;
|
|
1264
|
-
|
|
1800
|
+
useEffect5(() => {
|
|
1265
1801
|
setViewDate(periodDate({ granularity, period }));
|
|
1266
1802
|
}, [granularity, period]);
|
|
1267
1803
|
const dates = useMemo(() => monthGridDates(viewDate), [viewDate]);
|
|
@@ -1285,14 +1821,14 @@ var PeriodPicker = ({
|
|
|
1285
1821
|
month: "long",
|
|
1286
1822
|
year: "numeric"
|
|
1287
1823
|
});
|
|
1288
|
-
return /* @__PURE__ */
|
|
1824
|
+
return /* @__PURE__ */ jsxs13(
|
|
1289
1825
|
"div",
|
|
1290
1826
|
{
|
|
1291
1827
|
"data-theme": theme,
|
|
1292
1828
|
className: "polli:flex polli:flex-wrap polli:items-center polli:gap-2",
|
|
1293
1829
|
children: [
|
|
1294
|
-
/* @__PURE__ */
|
|
1295
|
-
(granularity2) => /* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ jsx26("div", { className: "polli:flex polli:flex-wrap polli:gap-1.5", children: ["day", "week", "month"].map(
|
|
1831
|
+
(granularity2) => /* @__PURE__ */ jsx26(
|
|
1296
1832
|
TabButton,
|
|
1297
1833
|
{
|
|
1298
1834
|
active: value.granularity === granularity2,
|
|
@@ -1302,33 +1838,33 @@ var PeriodPicker = ({
|
|
|
1302
1838
|
granularity2
|
|
1303
1839
|
)
|
|
1304
1840
|
) }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1841
|
+
/* @__PURE__ */ jsxs13(
|
|
1306
1842
|
Dropdown,
|
|
1307
1843
|
{
|
|
1308
1844
|
theme,
|
|
1309
1845
|
open,
|
|
1310
1846
|
onOpenChange: setOpen,
|
|
1311
1847
|
className: "polli:w-[304px] polli:rounded-xl polli:p-3",
|
|
1312
|
-
trigger: (isOpen) => /* @__PURE__ */
|
|
1848
|
+
trigger: (isOpen) => /* @__PURE__ */ jsxs13(
|
|
1313
1849
|
"button",
|
|
1314
1850
|
{
|
|
1315
1851
|
type: "button",
|
|
1316
1852
|
"aria-label": `Select period, current ${formatPeriodLabel(value)}`,
|
|
1317
1853
|
className: cn2(
|
|
1318
|
-
"polli:inline-flex polli:min-w-[150px] polli:items-center polli:justify-between polli:gap-2 polli:rounded-full polli:border polli:px-4 polli:pt-1.5 polli:pb-2 polli:text-left polli:text-base polli:font-medium polli:leading-normal",
|
|
1854
|
+
"polli-control polli:inline-flex polli:min-w-[150px] polli:items-center polli:justify-between polli:gap-2 polli:rounded-full polli:border polli:px-4 polli:pt-1.5 polli:pb-2 polli:text-left polli:text-base polli:font-medium polli:leading-normal",
|
|
1319
1855
|
"polli:border-theme-border polli:bg-theme-bg-subtle polli:text-theme-text-base",
|
|
1320
1856
|
"polli:transition-all polli:duration-200 polli:ease-out polli:hover:bg-theme-bg-pale",
|
|
1321
1857
|
isOpen && "polli:bg-theme-bg-active polli:text-theme-text-strong polli:shadow-sm"
|
|
1322
1858
|
),
|
|
1323
1859
|
children: [
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ jsx26("span", { children: formatPeriodLabel(value) }),
|
|
1861
|
+
/* @__PURE__ */ jsx26(ChevronIcon, { expanded: isOpen })
|
|
1326
1862
|
]
|
|
1327
1863
|
}
|
|
1328
1864
|
),
|
|
1329
1865
|
children: [
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ jsxs13("div", { className: "polli:mb-3 polli:flex polli:items-center polli:justify-between", children: [
|
|
1867
|
+
/* @__PURE__ */ jsx26(
|
|
1332
1868
|
"button",
|
|
1333
1869
|
{
|
|
1334
1870
|
type: "button",
|
|
@@ -1342,8 +1878,8 @@ var PeriodPicker = ({
|
|
|
1342
1878
|
children: "<"
|
|
1343
1879
|
}
|
|
1344
1880
|
),
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1881
|
+
/* @__PURE__ */ jsx26("div", { className: "polli:text-sm polli:font-bold polli:text-theme-text-base", children: viewLabel }),
|
|
1882
|
+
/* @__PURE__ */ jsx26(
|
|
1347
1883
|
"button",
|
|
1348
1884
|
{
|
|
1349
1885
|
type: "button",
|
|
@@ -1358,7 +1894,7 @@ var PeriodPicker = ({
|
|
|
1358
1894
|
}
|
|
1359
1895
|
)
|
|
1360
1896
|
] }),
|
|
1361
|
-
value.granularity === "month" ? /* @__PURE__ */
|
|
1897
|
+
value.granularity === "month" ? /* @__PURE__ */ jsx26("div", { className: "polli:grid polli:grid-cols-3 polli:gap-1.5", children: MONTH_LABELS.map((label, monthIndex) => {
|
|
1362
1898
|
const date = new Date(
|
|
1363
1899
|
Date.UTC(
|
|
1364
1900
|
viewDate.getUTCFullYear(),
|
|
@@ -1377,7 +1913,7 @@ var PeriodPicker = ({
|
|
|
1377
1913
|
year: "numeric"
|
|
1378
1914
|
});
|
|
1379
1915
|
const selected = date.getUTCFullYear() === selectedWindow.start.getUTCFullYear() && date.getUTCMonth() === selectedWindow.start.getUTCMonth();
|
|
1380
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ jsx26(
|
|
1381
1917
|
"button",
|
|
1382
1918
|
{
|
|
1383
1919
|
type: "button",
|
|
@@ -1385,7 +1921,7 @@ var PeriodPicker = ({
|
|
|
1385
1921
|
disabled: !selectable,
|
|
1386
1922
|
onClick: () => selectDate(date),
|
|
1387
1923
|
className: cn2(
|
|
1388
|
-
"polli:rounded-lg polli:px-3 polli:py-2 polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
1924
|
+
"polli-control polli:rounded-lg polli:px-3 polli:py-2 polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
1389
1925
|
selected ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-gray-700 polli:hover:bg-theme-bg-subtle",
|
|
1390
1926
|
!selectable && "polli:cursor-not-allowed polli:text-gray-300 polli:hover:bg-transparent"
|
|
1391
1927
|
),
|
|
@@ -1393,9 +1929,9 @@ var PeriodPicker = ({
|
|
|
1393
1929
|
},
|
|
1394
1930
|
label
|
|
1395
1931
|
);
|
|
1396
|
-
}) }) : /* @__PURE__ */
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
/* @__PURE__ */
|
|
1932
|
+
}) }) : /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
1933
|
+
/* @__PURE__ */ jsx26("div", { className: "polli:mb-1 polli:grid polli:grid-cols-7 polli:gap-1 polli:text-center polli:text-micro polli:font-bold polli:uppercase polli:text-gray-400", children: WEEKDAY_LABELS.map((label) => /* @__PURE__ */ jsx26("div", { children: label }, label)) }),
|
|
1934
|
+
/* @__PURE__ */ jsx26("div", { className: "polli:grid polli:grid-cols-7 polli:gap-1", children: dates.map((date) => {
|
|
1399
1935
|
const inCurrentMonth = date.getUTCMonth() === viewDate.getUTCMonth();
|
|
1400
1936
|
const selectable = isPeriodSelectable(
|
|
1401
1937
|
periodFromDate(value.granularity, date),
|
|
@@ -1413,7 +1949,7 @@ var PeriodPicker = ({
|
|
|
1413
1949
|
}
|
|
1414
1950
|
)}`;
|
|
1415
1951
|
const selected = value.granularity === "day" ? sameUtcDay(date, selectedWindow.start) : date >= selectedWindow.start && date < selectedWindow.end;
|
|
1416
|
-
return /* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ jsx26(
|
|
1417
1953
|
"button",
|
|
1418
1954
|
{
|
|
1419
1955
|
type: "button",
|
|
@@ -1421,7 +1957,7 @@ var PeriodPicker = ({
|
|
|
1421
1957
|
disabled: !selectable,
|
|
1422
1958
|
onClick: () => selectDate(date),
|
|
1423
1959
|
className: cn2(
|
|
1424
|
-
"polli:aspect-square polli:rounded-lg polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
1960
|
+
"polli-control polli:aspect-square polli:rounded-lg polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
1425
1961
|
!inCurrentMonth && "polli:text-gray-300",
|
|
1426
1962
|
sameUtcDay(date, today) && "polli:ring-1 polli:ring-theme-border",
|
|
1427
1963
|
selected ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-gray-700 polli:hover:bg-theme-bg-subtle",
|
|
@@ -1441,58 +1977,189 @@ var PeriodPicker = ({
|
|
|
1441
1977
|
);
|
|
1442
1978
|
};
|
|
1443
1979
|
|
|
1444
|
-
// src/primitives/
|
|
1445
|
-
import
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1980
|
+
// src/primitives/Prose.tsx
|
|
1981
|
+
import Markdown2 from "react-markdown";
|
|
1982
|
+
import rehypeSlug from "rehype-slug";
|
|
1983
|
+
import remarkGfm2 from "remark-gfm";
|
|
1984
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1985
|
+
var components2 = {
|
|
1986
|
+
h1: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
1987
|
+
"h1",
|
|
1988
|
+
{
|
|
1989
|
+
className: "polli:mt-0 polli:mb-5 polli:break-words polli:font-heading polli:text-4xl polli:leading-none polli:text-theme-text-strong",
|
|
1990
|
+
...props
|
|
1991
|
+
}
|
|
1992
|
+
),
|
|
1993
|
+
h2: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
1994
|
+
"h2",
|
|
1995
|
+
{
|
|
1996
|
+
className: "polli:mt-8 polli:mb-3 polli:break-words polli:font-subheading polli:text-2xl polli:leading-tight polli:text-theme-text-strong",
|
|
1997
|
+
...props
|
|
1998
|
+
}
|
|
1999
|
+
),
|
|
2000
|
+
h3: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2001
|
+
"h3",
|
|
2002
|
+
{
|
|
2003
|
+
className: "polli:mt-6 polli:mb-2 polli:break-words polli:font-subheading polli:text-xl polli:leading-tight polli:text-theme-text-strong",
|
|
2004
|
+
...props
|
|
2005
|
+
}
|
|
2006
|
+
),
|
|
2007
|
+
p: ({ node, ...props }) => /* @__PURE__ */ jsx27("p", { className: "polli:my-4 polli:leading-relaxed", ...props }),
|
|
2008
|
+
a: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2009
|
+
"a",
|
|
2010
|
+
{
|
|
2011
|
+
className: "polli-control polli:rounded-sm polli:font-semibold polli:text-theme-text-strong polli:underline polli:decoration-theme-border polli:decoration-2 polli:underline-offset-3 polli:hover:decoration-theme-text-soft",
|
|
2012
|
+
...props
|
|
2013
|
+
}
|
|
2014
|
+
),
|
|
2015
|
+
ul: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2016
|
+
"ul",
|
|
2017
|
+
{
|
|
2018
|
+
className: "polli:my-4 polli:list-disc polli:pl-6 polli:leading-relaxed",
|
|
2019
|
+
...props
|
|
2020
|
+
}
|
|
2021
|
+
),
|
|
2022
|
+
ol: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2023
|
+
"ol",
|
|
2024
|
+
{
|
|
2025
|
+
className: "polli:my-4 polli:list-decimal polli:pl-6 polli:leading-relaxed",
|
|
2026
|
+
...props
|
|
2027
|
+
}
|
|
2028
|
+
),
|
|
2029
|
+
blockquote: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2030
|
+
"blockquote",
|
|
2031
|
+
{
|
|
2032
|
+
className: "polli:my-4 polli:border-l-4 polli:border-theme-border polli:pl-4 polli:text-theme-text-soft",
|
|
2033
|
+
...props
|
|
2034
|
+
}
|
|
2035
|
+
),
|
|
2036
|
+
code: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2037
|
+
"code",
|
|
2038
|
+
{
|
|
2039
|
+
className: "polli:rounded polli:bg-theme-bg-active polli:px-1 polli:py-0.5 polli:font-pixel polli:text-sm",
|
|
2040
|
+
...props
|
|
2041
|
+
}
|
|
2042
|
+
),
|
|
2043
|
+
pre: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2044
|
+
"pre",
|
|
2045
|
+
{
|
|
2046
|
+
className: "polli:my-4 polli:overflow-x-auto polli:rounded-lg polli:bg-theme-bg-active polli:p-4",
|
|
2047
|
+
...props
|
|
2048
|
+
}
|
|
2049
|
+
),
|
|
2050
|
+
table: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2051
|
+
"table",
|
|
2052
|
+
{
|
|
2053
|
+
className: "polli:my-4 polli:w-full polli:border-collapse polli:text-sm",
|
|
2054
|
+
...props
|
|
2055
|
+
}
|
|
2056
|
+
),
|
|
2057
|
+
th: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2058
|
+
"th",
|
|
2059
|
+
{
|
|
2060
|
+
className: "polli:border polli:border-theme-border polli:px-3 polli:py-2 polli:text-left polli:font-semibold",
|
|
2061
|
+
...props
|
|
2062
|
+
}
|
|
2063
|
+
),
|
|
2064
|
+
td: ({ node, ...props }) => /* @__PURE__ */ jsx27(
|
|
2065
|
+
"td",
|
|
2066
|
+
{
|
|
2067
|
+
className: "polli:border polli:border-theme-border polli:px-3 polli:py-2",
|
|
2068
|
+
...props
|
|
2069
|
+
}
|
|
2070
|
+
),
|
|
2071
|
+
hr: ({ node, ...props }) => /* @__PURE__ */ jsx27("hr", { className: "polli:my-6 polli:border-theme-border", ...props })
|
|
1450
2072
|
};
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
2073
|
+
function Prose({ children, className }) {
|
|
2074
|
+
return /* @__PURE__ */ jsx27(
|
|
2075
|
+
"div",
|
|
2076
|
+
{
|
|
2077
|
+
className: cn2(
|
|
2078
|
+
"polli:font-body polli:text-theme-text-base polli:leading-relaxed",
|
|
2079
|
+
className
|
|
2080
|
+
),
|
|
2081
|
+
children: /* @__PURE__ */ jsx27(
|
|
2082
|
+
Markdown2,
|
|
2083
|
+
{
|
|
2084
|
+
remarkPlugins: [remarkGfm2],
|
|
2085
|
+
rehypePlugins: [rehypeSlug],
|
|
2086
|
+
components: components2,
|
|
2087
|
+
children
|
|
2088
|
+
}
|
|
2089
|
+
)
|
|
2090
|
+
}
|
|
2091
|
+
);
|
|
2092
|
+
}
|
|
1466
2093
|
|
|
1467
2094
|
// src/primitives/Section.tsx
|
|
1468
|
-
import { jsx as
|
|
2095
|
+
import { Fragment as Fragment3, jsx as jsx28, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1469
2096
|
var Section = ({
|
|
1470
2097
|
title,
|
|
1471
2098
|
theme,
|
|
1472
2099
|
id,
|
|
1473
2100
|
framed = false,
|
|
2101
|
+
intro,
|
|
1474
2102
|
action,
|
|
1475
2103
|
actionClassName,
|
|
2104
|
+
panelClassName,
|
|
2105
|
+
titleClassName,
|
|
1476
2106
|
children,
|
|
1477
2107
|
className
|
|
1478
|
-
}) => /* @__PURE__ */
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
children: title
|
|
1486
|
-
}
|
|
2108
|
+
}) => /* @__PURE__ */ jsxs14(
|
|
2109
|
+
"section",
|
|
2110
|
+
{
|
|
2111
|
+
id,
|
|
2112
|
+
className: cn2(
|
|
2113
|
+
"polli:flex polli:scroll-mt-10 polli:flex-col polli:gap-4",
|
|
2114
|
+
className
|
|
1487
2115
|
),
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
2116
|
+
children: [
|
|
2117
|
+
/* @__PURE__ */ jsxs14("div", { className: "polli:flex polli:flex-wrap polli:items-center polli:justify-between polli:gap-3 polli:px-1", children: [
|
|
2118
|
+
/* @__PURE__ */ jsx28(
|
|
2119
|
+
"h2",
|
|
2120
|
+
{
|
|
2121
|
+
"data-theme": theme,
|
|
2122
|
+
className: cn2(
|
|
2123
|
+
"polli:text-left polli:font-subheading polli:text-2xl polli:leading-tight polli:text-theme-text-strong",
|
|
2124
|
+
titleClassName
|
|
2125
|
+
),
|
|
2126
|
+
children: title
|
|
2127
|
+
}
|
|
2128
|
+
),
|
|
2129
|
+
action && /* @__PURE__ */ jsx28("div", { className: cn2("polli:shrink-0", actionClassName), children: action })
|
|
2130
|
+
] }),
|
|
2131
|
+
framed ? /* @__PURE__ */ jsxs14(
|
|
2132
|
+
Surface,
|
|
2133
|
+
{
|
|
2134
|
+
variant: "panel",
|
|
2135
|
+
theme,
|
|
2136
|
+
className: cn2(
|
|
2137
|
+
"polli:flex polli:flex-col polli:gap-5",
|
|
2138
|
+
panelClassName
|
|
2139
|
+
),
|
|
2140
|
+
children: [
|
|
2141
|
+
intro && /* @__PURE__ */ jsx28("div", { className: "polli:max-w-2xl polli:text-theme-text-base", children: intro }),
|
|
2142
|
+
children
|
|
2143
|
+
]
|
|
2144
|
+
}
|
|
2145
|
+
) : /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
2146
|
+
intro && /* @__PURE__ */ jsx28(
|
|
2147
|
+
"div",
|
|
2148
|
+
{
|
|
2149
|
+
"data-theme": theme,
|
|
2150
|
+
className: "polli:max-w-2xl polli:text-theme-text-base",
|
|
2151
|
+
children: intro
|
|
2152
|
+
}
|
|
2153
|
+
),
|
|
2154
|
+
children
|
|
2155
|
+
] })
|
|
2156
|
+
]
|
|
2157
|
+
}
|
|
2158
|
+
);
|
|
1492
2159
|
|
|
1493
2160
|
// src/primitives/Slider.tsx
|
|
1494
2161
|
import { forwardRef as forwardRef3 } from "react";
|
|
1495
|
-
import { jsx as
|
|
2162
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1496
2163
|
var toNumber = (value) => {
|
|
1497
2164
|
if (typeof value === "number") return value;
|
|
1498
2165
|
if (typeof value !== "string" || value.trim() === "") return void 0;
|
|
@@ -1532,7 +2199,7 @@ var Slider = forwardRef3(
|
|
|
1532
2199
|
...style,
|
|
1533
2200
|
...progressPercent === void 0 ? null : { "--polli-slider-progress": `${progressPercent}%` }
|
|
1534
2201
|
};
|
|
1535
|
-
return /* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ jsx29(
|
|
1536
2203
|
"input",
|
|
1537
2204
|
{
|
|
1538
2205
|
ref,
|
|
@@ -1550,7 +2217,7 @@ var Slider = forwardRef3(
|
|
|
1550
2217
|
);
|
|
1551
2218
|
|
|
1552
2219
|
// src/primitives/StatCard.tsx
|
|
1553
|
-
import { jsx as
|
|
2220
|
+
import { jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1554
2221
|
var StatCard = ({
|
|
1555
2222
|
label,
|
|
1556
2223
|
value,
|
|
@@ -1560,8 +2227,8 @@ var StatCard = ({
|
|
|
1560
2227
|
labelClassName,
|
|
1561
2228
|
valueClassName,
|
|
1562
2229
|
detailClassName
|
|
1563
|
-
}) => /* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
2230
|
+
}) => /* @__PURE__ */ jsxs15("div", { "data-theme": theme, className: cn2("polli:text-sm", className), children: [
|
|
2231
|
+
/* @__PURE__ */ jsx30(
|
|
1565
2232
|
"div",
|
|
1566
2233
|
{
|
|
1567
2234
|
className: cn2(
|
|
@@ -1571,7 +2238,7 @@ var StatCard = ({
|
|
|
1571
2238
|
children: label
|
|
1572
2239
|
}
|
|
1573
2240
|
),
|
|
1574
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ jsx30(
|
|
1575
2242
|
"div",
|
|
1576
2243
|
{
|
|
1577
2244
|
className: cn2(
|
|
@@ -1581,7 +2248,7 @@ var StatCard = ({
|
|
|
1581
2248
|
children: value
|
|
1582
2249
|
}
|
|
1583
2250
|
),
|
|
1584
|
-
detail && /* @__PURE__ */
|
|
2251
|
+
detail && /* @__PURE__ */ jsx30(
|
|
1585
2252
|
"div",
|
|
1586
2253
|
{
|
|
1587
2254
|
className: cn2(
|
|
@@ -1594,11 +2261,11 @@ var StatCard = ({
|
|
|
1594
2261
|
] });
|
|
1595
2262
|
|
|
1596
2263
|
// src/primitives/Switch.tsx
|
|
1597
|
-
import { jsx as
|
|
2264
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1598
2265
|
var trackClasses = {
|
|
1599
2266
|
off: "polli:bg-gray-200",
|
|
1600
|
-
on: "polli:bg-
|
|
1601
|
-
invalid: "polli:bg-
|
|
2267
|
+
on: "polli:bg-intent-success-bg-light",
|
|
2268
|
+
invalid: "polli:bg-intent-danger-bg-light"
|
|
1602
2269
|
};
|
|
1603
2270
|
var Switch = ({
|
|
1604
2271
|
checked,
|
|
@@ -1610,7 +2277,7 @@ var Switch = ({
|
|
|
1610
2277
|
}) => {
|
|
1611
2278
|
const effectiveStatus = status ?? (checked ? "on" : "off");
|
|
1612
2279
|
const resolvedAriaLabel = ariaLabel ?? (checked ? "Turn off toggle" : "Turn on toggle");
|
|
1613
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ jsx31(
|
|
1614
2281
|
"button",
|
|
1615
2282
|
{
|
|
1616
2283
|
type: "button",
|
|
@@ -1620,11 +2287,11 @@ var Switch = ({
|
|
|
1620
2287
|
onClick: () => onChange(!checked),
|
|
1621
2288
|
disabled,
|
|
1622
2289
|
className: cn2(
|
|
1623
|
-
"polli:relative polli:inline-flex polli:h-7 polli:w-12 polli:shrink-0 polli:items-center polli:rounded-full polli:transition polli:disabled:cursor-not-allowed polli:disabled:opacity-60",
|
|
2290
|
+
"polli-control polli:relative polli:inline-flex polli:h-7 polli:w-12 polli:shrink-0 polli:items-center polli:rounded-full polli:transition polli:disabled:cursor-not-allowed polli:disabled:opacity-60",
|
|
1624
2291
|
trackClasses[effectiveStatus],
|
|
1625
2292
|
className
|
|
1626
2293
|
),
|
|
1627
|
-
children: /* @__PURE__ */
|
|
2294
|
+
children: /* @__PURE__ */ jsx31(
|
|
1628
2295
|
"span",
|
|
1629
2296
|
{
|
|
1630
2297
|
className: cn2(
|
|
@@ -1637,6 +2304,142 @@ var Switch = ({
|
|
|
1637
2304
|
);
|
|
1638
2305
|
};
|
|
1639
2306
|
|
|
2307
|
+
// src/primitives/Table.tsx
|
|
2308
|
+
import { Fragment as Fragment4, jsx as jsx32, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2309
|
+
var alignClasses = {
|
|
2310
|
+
left: "polli:text-left",
|
|
2311
|
+
center: "polli:text-center",
|
|
2312
|
+
right: "polli:text-right"
|
|
2313
|
+
};
|
|
2314
|
+
var rowIntentClasses = {
|
|
2315
|
+
default: "",
|
|
2316
|
+
success: "polli:bg-intent-success-bg-light/55",
|
|
2317
|
+
warning: "polli:bg-intent-warning-bg-light/65",
|
|
2318
|
+
danger: "polli:bg-intent-danger-bg-light/65"
|
|
2319
|
+
};
|
|
2320
|
+
var Table = ({ className, ...rest }) => /* @__PURE__ */ jsx32(
|
|
2321
|
+
"table",
|
|
2322
|
+
{
|
|
2323
|
+
...rest,
|
|
2324
|
+
className: cn2(
|
|
2325
|
+
"polli:w-full polli:border-collapse polli:text-sm",
|
|
2326
|
+
className
|
|
2327
|
+
)
|
|
2328
|
+
}
|
|
2329
|
+
);
|
|
2330
|
+
var TableHead = ({ className, ...rest }) => /* @__PURE__ */ jsx32(
|
|
2331
|
+
"thead",
|
|
2332
|
+
{
|
|
2333
|
+
...rest,
|
|
2334
|
+
className: cn2(
|
|
2335
|
+
"polli:bg-theme-bg-active polli:text-micro polli:text-theme-text-muted",
|
|
2336
|
+
className
|
|
2337
|
+
)
|
|
2338
|
+
}
|
|
2339
|
+
);
|
|
2340
|
+
var TableBody = ({ className, ...rest }) => /* @__PURE__ */ jsx32(
|
|
2341
|
+
"tbody",
|
|
2342
|
+
{
|
|
2343
|
+
...rest,
|
|
2344
|
+
className: cn2("polli:divide-y polli:divide-theme-border/65", className)
|
|
2345
|
+
}
|
|
2346
|
+
);
|
|
2347
|
+
var TableRow = ({
|
|
2348
|
+
intent = "default",
|
|
2349
|
+
className,
|
|
2350
|
+
...rest
|
|
2351
|
+
}) => /* @__PURE__ */ jsx32(
|
|
2352
|
+
"tr",
|
|
2353
|
+
{
|
|
2354
|
+
...rest,
|
|
2355
|
+
className: cn2(
|
|
2356
|
+
"polli:transition-colors polli:hover:bg-theme-bg-subtle",
|
|
2357
|
+
rowIntentClasses[intent],
|
|
2358
|
+
className
|
|
2359
|
+
)
|
|
2360
|
+
}
|
|
2361
|
+
);
|
|
2362
|
+
var TableHeaderCell = ({
|
|
2363
|
+
align = "left",
|
|
2364
|
+
active = false,
|
|
2365
|
+
sortDirection,
|
|
2366
|
+
onSort,
|
|
2367
|
+
className,
|
|
2368
|
+
children,
|
|
2369
|
+
...rest
|
|
2370
|
+
}) => {
|
|
2371
|
+
const content = /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
2372
|
+
/* @__PURE__ */ jsx32("span", { children }),
|
|
2373
|
+
active && sortDirection && /* @__PURE__ */ jsx32("span", { "aria-hidden": "true", children: sortDirection === "asc" ? "^" : "v" })
|
|
2374
|
+
] });
|
|
2375
|
+
const classes = cn2(
|
|
2376
|
+
"polli:px-3 polli:py-2 polli:font-bold polli:uppercase polli:tracking-wide",
|
|
2377
|
+
alignClasses[align],
|
|
2378
|
+
active && "polli:text-theme-text-strong",
|
|
2379
|
+
onSort && "polli:cursor-pointer polli:select-none polli:hover:text-theme-text-strong",
|
|
2380
|
+
className
|
|
2381
|
+
);
|
|
2382
|
+
if (!onSort) {
|
|
2383
|
+
return /* @__PURE__ */ jsx32("th", { ...rest, className: classes, children: content });
|
|
2384
|
+
}
|
|
2385
|
+
return /* @__PURE__ */ jsx32("th", { ...rest, className: classes, children: /* @__PURE__ */ jsx32(
|
|
2386
|
+
"button",
|
|
2387
|
+
{
|
|
2388
|
+
type: "button",
|
|
2389
|
+
onClick: onSort,
|
|
2390
|
+
className: cn2(
|
|
2391
|
+
"polli-control polli:inline-flex polli:w-full polli:items-center polli:gap-1 polli:bg-transparent polli:p-0 polli:font-bold polli:text-inherit",
|
|
2392
|
+
align === "right" && "polli:justify-end",
|
|
2393
|
+
align === "center" && "polli:justify-center"
|
|
2394
|
+
),
|
|
2395
|
+
children: content
|
|
2396
|
+
}
|
|
2397
|
+
) });
|
|
2398
|
+
};
|
|
2399
|
+
var TableCell = ({
|
|
2400
|
+
align = "left",
|
|
2401
|
+
numeric = false,
|
|
2402
|
+
muted = false,
|
|
2403
|
+
className,
|
|
2404
|
+
...rest
|
|
2405
|
+
}) => /* @__PURE__ */ jsx32(
|
|
2406
|
+
"td",
|
|
2407
|
+
{
|
|
2408
|
+
...rest,
|
|
2409
|
+
className: cn2(
|
|
2410
|
+
"polli:px-3 polli:py-2 polli:align-middle",
|
|
2411
|
+
alignClasses[align],
|
|
2412
|
+
numeric && "polli:tabular-nums",
|
|
2413
|
+
muted && "polli:text-theme-text-muted",
|
|
2414
|
+
className
|
|
2415
|
+
)
|
|
2416
|
+
}
|
|
2417
|
+
);
|
|
2418
|
+
|
|
2419
|
+
// src/primitives/Textarea.tsx
|
|
2420
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
2421
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2422
|
+
var Textarea = forwardRef4(
|
|
2423
|
+
({ className, error, rows = 4, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
2424
|
+
"textarea",
|
|
2425
|
+
{
|
|
2426
|
+
ref,
|
|
2427
|
+
rows,
|
|
2428
|
+
"data-error": error ? "true" : void 0,
|
|
2429
|
+
className: cn2(
|
|
2430
|
+
"polli-textarea polli:w-full polli:rounded-lg polli:border polli:px-3 polli:py-2",
|
|
2431
|
+
"polli:min-h-20 polli:resize-y polli:font-body polli:text-base",
|
|
2432
|
+
"polli:text-gray-950",
|
|
2433
|
+
"polli:transition-colors",
|
|
2434
|
+
"polli:disabled:opacity-50 polli:disabled:cursor-not-allowed",
|
|
2435
|
+
className
|
|
2436
|
+
),
|
|
2437
|
+
...props
|
|
2438
|
+
}
|
|
2439
|
+
)
|
|
2440
|
+
);
|
|
2441
|
+
Textarea.displayName = "Textarea";
|
|
2442
|
+
|
|
1640
2443
|
// src/theme.ts
|
|
1641
2444
|
var themes = [
|
|
1642
2445
|
"amber",
|
|
@@ -1646,15 +2449,13 @@ var themes = [
|
|
|
1646
2449
|
"violet",
|
|
1647
2450
|
"green"
|
|
1648
2451
|
];
|
|
1649
|
-
var themeColors = {
|
|
1650
|
-
amber: "#FEF3C7",
|
|
1651
|
-
blue: "#DBEAFE"
|
|
1652
|
-
};
|
|
1653
2452
|
export {
|
|
2453
|
+
Alert,
|
|
1654
2454
|
AppIcon,
|
|
1655
2455
|
BeakerIcon,
|
|
1656
2456
|
BookIcon,
|
|
1657
2457
|
Button,
|
|
2458
|
+
ButtonGroup,
|
|
1658
2459
|
CheckIcon,
|
|
1659
2460
|
ChevronIcon,
|
|
1660
2461
|
Chip,
|
|
@@ -1667,21 +2468,28 @@ export {
|
|
|
1667
2468
|
DiscordIcon,
|
|
1668
2469
|
DownloadIcon,
|
|
1669
2470
|
Dropdown,
|
|
2471
|
+
DropdownItem,
|
|
1670
2472
|
ExternalLinkButton,
|
|
1671
2473
|
ExternalLinkIcon,
|
|
1672
2474
|
Field,
|
|
2475
|
+
FileUpload,
|
|
1673
2476
|
GenApiIcon,
|
|
1674
2477
|
GitHubIcon,
|
|
1675
2478
|
IconButton,
|
|
1676
2479
|
ImageIcon,
|
|
1677
2480
|
InfoTip,
|
|
2481
|
+
InlineLink,
|
|
1678
2482
|
Input,
|
|
2483
|
+
LinkCard,
|
|
1679
2484
|
LockIcon,
|
|
1680
2485
|
MailIcon,
|
|
2486
|
+
Markdown,
|
|
1681
2487
|
McpIcon,
|
|
1682
2488
|
MenuIcon,
|
|
1683
2489
|
MultiSelect,
|
|
2490
|
+
NavItem,
|
|
1684
2491
|
PeriodPicker,
|
|
2492
|
+
Prose,
|
|
1685
2493
|
ScrollArea,
|
|
1686
2494
|
Section,
|
|
1687
2495
|
Slider,
|
|
@@ -1689,7 +2497,14 @@ export {
|
|
|
1689
2497
|
Surface,
|
|
1690
2498
|
Switch,
|
|
1691
2499
|
TabButton,
|
|
2500
|
+
Table,
|
|
2501
|
+
TableBody,
|
|
2502
|
+
TableCell,
|
|
2503
|
+
TableHead,
|
|
2504
|
+
TableHeaderCell,
|
|
2505
|
+
TableRow,
|
|
1692
2506
|
TerminalIcon,
|
|
2507
|
+
Textarea,
|
|
1693
2508
|
TokensIcon,
|
|
1694
2509
|
Tooltip,
|
|
1695
2510
|
TrendUpIcon,
|
|
@@ -1699,7 +2514,6 @@ export {
|
|
|
1699
2514
|
currentPeriod,
|
|
1700
2515
|
getPeriodBucketKeys,
|
|
1701
2516
|
periodBucketKeyToDate,
|
|
1702
|
-
themeColors,
|
|
1703
2517
|
themes,
|
|
1704
2518
|
useScrollLock
|
|
1705
2519
|
};
|