@pollinations/ui 0.0.2 → 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 +10 -6
- package/dist/{Button-CWUBCiIc.d.cts → Button-BvLF_Km2.d.cts} +3 -3
- package/dist/{Button-Bn8pGg6N.d.ts → Button-DQAZzvyQ.d.ts} +3 -3
- package/dist/auth/index.cjs +77 -62
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.js +77 -62
- 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 +1 -1
- package/dist/auth/sdk.d.ts +1 -1
- 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 +932 -270
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -6
- package/dist/index.d.ts +101 -6
- package/dist/index.js +891 -247
- package/dist/index.js.map +1 -1
- package/dist/modality/index.cjs +21 -18
- package/dist/modality/index.cjs.map +1 -1
- package/dist/modality/index.d.cts +6 -5
- package/dist/modality/index.d.ts +6 -5
- package/dist/modality/index.js +21 -18
- 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/wallet/index.cjs +13 -4
- package/dist/wallet/index.cjs.map +1 -1
- package/dist/wallet/index.js +13 -4
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/sdk.cjs +2 -2
- package/dist/wallet/sdk.cjs.map +1 -1
- package/dist/wallet/sdk.js +2 -2
- package/dist/wallet/sdk.js.map +1 -1
- package/package.json +17 -5
- package/dist/wallet.css +0 -73
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
@@ -38,21 +48,28 @@ __export(src_exports, {
|
|
|
38
48
|
DiscordIcon: () => DiscordIcon,
|
|
39
49
|
DownloadIcon: () => DownloadIcon,
|
|
40
50
|
Dropdown: () => Dropdown,
|
|
51
|
+
DropdownItem: () => DropdownItem,
|
|
41
52
|
ExternalLinkButton: () => ExternalLinkButton,
|
|
42
53
|
ExternalLinkIcon: () => ExternalLinkIcon,
|
|
43
54
|
Field: () => import_field.Field,
|
|
55
|
+
FileUpload: () => FileUpload,
|
|
44
56
|
GenApiIcon: () => GenApiIcon,
|
|
45
57
|
GitHubIcon: () => GitHubIcon,
|
|
46
58
|
IconButton: () => IconButton,
|
|
47
59
|
ImageIcon: () => ImageIcon,
|
|
48
60
|
InfoTip: () => InfoTip,
|
|
61
|
+
InlineLink: () => InlineLink,
|
|
49
62
|
Input: () => Input,
|
|
63
|
+
LinkCard: () => LinkCard,
|
|
50
64
|
LockIcon: () => LockIcon,
|
|
51
65
|
MailIcon: () => MailIcon,
|
|
66
|
+
Markdown: () => Markdown,
|
|
52
67
|
McpIcon: () => McpIcon,
|
|
53
68
|
MenuIcon: () => MenuIcon,
|
|
54
69
|
MultiSelect: () => MultiSelect,
|
|
70
|
+
NavItem: () => NavItem,
|
|
55
71
|
PeriodPicker: () => PeriodPicker,
|
|
72
|
+
Prose: () => Prose,
|
|
56
73
|
ScrollArea: () => ScrollArea,
|
|
57
74
|
Section: () => Section,
|
|
58
75
|
Slider: () => Slider,
|
|
@@ -67,6 +84,7 @@ __export(src_exports, {
|
|
|
67
84
|
TableHeaderCell: () => TableHeaderCell,
|
|
68
85
|
TableRow: () => TableRow,
|
|
69
86
|
TerminalIcon: () => TerminalIcon,
|
|
87
|
+
Textarea: () => Textarea,
|
|
70
88
|
TokensIcon: () => TokensIcon,
|
|
71
89
|
Tooltip: () => Tooltip,
|
|
72
90
|
TrendUpIcon: () => TrendUpIcon,
|
|
@@ -284,13 +302,13 @@ var Alert = ({
|
|
|
284
302
|
// src/primitives/Button.tsx
|
|
285
303
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
286
304
|
var sizes = {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
305
|
+
sm: "polli:px-2 polli:pt-0.5 polli:pb-1",
|
|
306
|
+
md: "polli:px-4 polli:pt-1.5 polli:pb-2",
|
|
307
|
+
lg: "polli:px-6 polli:py-3"
|
|
290
308
|
};
|
|
291
309
|
var themeClasses = "polli:bg-theme-bg-active polli:text-theme-text-base polli:hover:bg-theme-bg-hover polli:transition-colors";
|
|
292
310
|
var intentClasses2 = {
|
|
293
|
-
danger: "polli:bg-intent-danger-bg-light polli:text-intent-danger-text polli:hover:bg-
|
|
311
|
+
danger: "polli:bg-intent-danger-bg-light polli:text-intent-danger-text polli:hover:bg-intent-danger-bg-hover polli:transition-colors"
|
|
294
312
|
};
|
|
295
313
|
var buttonClasses = ({
|
|
296
314
|
theme: _theme,
|
|
@@ -301,10 +319,10 @@ var buttonClasses = ({
|
|
|
301
319
|
}) => {
|
|
302
320
|
const colorClasses = intent ? intentClasses2[intent] : themeClasses;
|
|
303
321
|
return cn2(
|
|
304
|
-
"polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:self-center polli:
|
|
322
|
+
"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",
|
|
305
323
|
disabled ? "polli:opacity-50 polli:cursor-not-allowed" : "polli:hover:filter polli:hover:brightness-105 polli:cursor-pointer",
|
|
306
324
|
colorClasses,
|
|
307
|
-
sizes[size || "
|
|
325
|
+
sizes[size || "md"],
|
|
308
326
|
className
|
|
309
327
|
);
|
|
310
328
|
};
|
|
@@ -323,6 +341,7 @@ function Button({
|
|
|
323
341
|
Component,
|
|
324
342
|
{
|
|
325
343
|
"data-theme": intent ? void 0 : theme,
|
|
344
|
+
"data-intent": intent,
|
|
326
345
|
className: buttonClasses({
|
|
327
346
|
theme,
|
|
328
347
|
intent,
|
|
@@ -395,8 +414,8 @@ var chipSizes = {
|
|
|
395
414
|
lg: "polli:px-3 polli:py-1 polli:text-sm"
|
|
396
415
|
};
|
|
397
416
|
var intentClasses3 = {
|
|
398
|
-
news: "polli:bg-
|
|
399
|
-
alpha: "polli:bg-
|
|
417
|
+
news: "polli:bg-intent-news-bg-light polli:text-intent-news-text",
|
|
418
|
+
alpha: "polli:bg-intent-alpha-bg-light polli:text-intent-alpha-text",
|
|
400
419
|
neutral: "polli:border polli:border-gray-400/70 polli:bg-gray-100/80 polli:text-gray-900",
|
|
401
420
|
success: "polli:border polli:border-intent-success-border polli:bg-intent-success-bg-light polli:text-intent-success-text",
|
|
402
421
|
warning: "polli:border polli:border-intent-warning-border polli:bg-intent-warning-bg-light polli:text-intent-warning-text",
|
|
@@ -458,7 +477,7 @@ var Collapsible = ({
|
|
|
458
477
|
disabled,
|
|
459
478
|
onClick: onToggle,
|
|
460
479
|
className: cn2(
|
|
461
|
-
"polli:w-full polli:flex polli:items-center polli:gap-3 polli:px-3 polli:py-2 polli:text-left polli:transition-colors",
|
|
480
|
+
"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",
|
|
462
481
|
expanded ? "polli:rounded-t-lg" : "polli:rounded-lg",
|
|
463
482
|
!disabled && hoverClassName,
|
|
464
483
|
focusClassName,
|
|
@@ -528,7 +547,7 @@ var Tooltip = ({
|
|
|
528
547
|
}
|
|
529
548
|
};
|
|
530
549
|
const triggerClassName = cn2(
|
|
531
|
-
"polli:relative polli:cursor-help polli:text-left polli:inline-flex polli:items-center",
|
|
550
|
+
"polli-control polli:relative polli:cursor-help polli:text-left polli:inline-flex polli:items-center",
|
|
532
551
|
className
|
|
533
552
|
);
|
|
534
553
|
const cursorClass = displayContents ? "polli:contents" : "polli:cursor-help";
|
|
@@ -644,6 +663,7 @@ function CopyButton({
|
|
|
644
663
|
type: "button",
|
|
645
664
|
onClick: handleCopy,
|
|
646
665
|
className: cn2(
|
|
666
|
+
"polli-control",
|
|
647
667
|
typeof className === "function" ? className(copied) : className
|
|
648
668
|
),
|
|
649
669
|
children: typeof children === "function" ? children(copied) : children
|
|
@@ -663,6 +683,7 @@ function CopyButton({
|
|
|
663
683
|
// src/primitives/Dialog.tsx
|
|
664
684
|
var import_dialog = require("@ark-ui/react/dialog");
|
|
665
685
|
var import_portal = require("@ark-ui/react/portal");
|
|
686
|
+
var import_react4 = require("react");
|
|
666
687
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
667
688
|
var sizeClasses = {
|
|
668
689
|
sm: "polli:max-w-md",
|
|
@@ -686,77 +707,83 @@ var Dialog = ({
|
|
|
686
707
|
positionerClassName,
|
|
687
708
|
contentClassName,
|
|
688
709
|
children
|
|
689
|
-
}) =>
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
children: trigger
|
|
701
|
-
}
|
|
702
|
-
),
|
|
703
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_portal.Portal, { children: [
|
|
704
|
-
showBackdrop && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
705
|
-
import_dialog.Dialog.Backdrop,
|
|
710
|
+
}) => {
|
|
711
|
+
const contentRef = (0, import_react4.useRef)(null);
|
|
712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
713
|
+
import_dialog.Dialog.Root,
|
|
714
|
+
{
|
|
715
|
+
open,
|
|
716
|
+
initialFocusEl: () => contentRef.current,
|
|
717
|
+
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
718
|
+
children: [
|
|
719
|
+
trigger && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
720
|
+
import_dialog.Dialog.Trigger,
|
|
706
721
|
{
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
)
|
|
722
|
+
asChild: triggerAsChild,
|
|
723
|
+
className: triggerClassName,
|
|
724
|
+
children: trigger
|
|
711
725
|
}
|
|
712
726
|
),
|
|
713
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
727
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_portal.Portal, { children: [
|
|
728
|
+
showBackdrop && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
729
|
+
import_dialog.Dialog.Backdrop,
|
|
730
|
+
{
|
|
731
|
+
className: cn2(
|
|
732
|
+
"polli:fixed polli:inset-0 polli:z-[100] polli:bg-gray-950/50",
|
|
733
|
+
backdropClassName
|
|
734
|
+
)
|
|
735
|
+
}
|
|
736
|
+
),
|
|
737
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
738
|
+
import_dialog.Dialog.Positioner,
|
|
739
|
+
{
|
|
740
|
+
"data-theme": theme,
|
|
741
|
+
className: cn2(
|
|
742
|
+
"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",
|
|
743
|
+
positionerClassName
|
|
744
|
+
),
|
|
745
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
746
|
+
import_dialog.Dialog.Content,
|
|
747
|
+
{
|
|
748
|
+
ref: contentRef,
|
|
749
|
+
"data-theme": theme,
|
|
750
|
+
"aria-label": ariaLabel,
|
|
751
|
+
"aria-labelledby": labelledBy,
|
|
752
|
+
className: cn2(
|
|
753
|
+
"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",
|
|
754
|
+
sizeClasses[size],
|
|
755
|
+
contentClassName
|
|
741
756
|
),
|
|
742
|
-
children
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
757
|
+
children: [
|
|
758
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
759
|
+
DialogTitle,
|
|
760
|
+
{
|
|
761
|
+
className: cn2(
|
|
762
|
+
"polli:px-6 polli:pt-6 polli:font-subheading polli:text-xl polli:text-theme-text-strong",
|
|
763
|
+
titleClassName
|
|
764
|
+
),
|
|
765
|
+
children: title
|
|
766
|
+
}
|
|
767
|
+
),
|
|
768
|
+
children
|
|
769
|
+
]
|
|
770
|
+
}
|
|
771
|
+
)
|
|
772
|
+
}
|
|
773
|
+
)
|
|
774
|
+
] })
|
|
775
|
+
]
|
|
776
|
+
}
|
|
777
|
+
);
|
|
778
|
+
};
|
|
752
779
|
var DialogTitle = import_dialog.Dialog.Title;
|
|
753
780
|
|
|
754
781
|
// src/primitives/Dropdown.tsx
|
|
755
782
|
var import_popover = require("@ark-ui/react/popover");
|
|
756
783
|
var import_portal2 = require("@ark-ui/react/portal");
|
|
757
|
-
var
|
|
784
|
+
var import_react5 = require("react");
|
|
758
785
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
759
|
-
var DEFAULT_PANEL = "polli:rounded-lg polli:border polli:border-theme-border polli:bg-
|
|
786
|
+
var DEFAULT_PANEL = "polli:rounded-lg polli:border polli:border-theme-border polli:bg-theme-bg-pale polli:shadow-lg";
|
|
760
787
|
var Dropdown = ({
|
|
761
788
|
theme,
|
|
762
789
|
trigger,
|
|
@@ -764,10 +791,9 @@ var Dropdown = ({
|
|
|
764
791
|
align = "start",
|
|
765
792
|
open: openProp,
|
|
766
793
|
onOpenChange,
|
|
767
|
-
panelClassName,
|
|
768
794
|
className
|
|
769
795
|
}) => {
|
|
770
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
796
|
+
const [internalOpen, setInternalOpen] = (0, import_react5.useState)(false);
|
|
771
797
|
const isControlled = openProp !== void 0;
|
|
772
798
|
const open = isControlled ? openProp : internalOpen;
|
|
773
799
|
const setOpen = (next) => {
|
|
@@ -790,7 +816,7 @@ var Dropdown = ({
|
|
|
790
816
|
"data-theme": theme,
|
|
791
817
|
className: cn2(
|
|
792
818
|
"polli:z-50 polli:overflow-hidden polli:focus:outline-none",
|
|
793
|
-
|
|
819
|
+
DEFAULT_PANEL,
|
|
794
820
|
className
|
|
795
821
|
),
|
|
796
822
|
children: typeof children === "function" ? children(() => setOpen(false)) : children
|
|
@@ -801,8 +827,31 @@ var Dropdown = ({
|
|
|
801
827
|
);
|
|
802
828
|
};
|
|
803
829
|
|
|
804
|
-
// src/primitives/
|
|
830
|
+
// src/primitives/DropdownItem.tsx
|
|
805
831
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
832
|
+
function DropdownItem({
|
|
833
|
+
as,
|
|
834
|
+
className,
|
|
835
|
+
children,
|
|
836
|
+
...rest
|
|
837
|
+
}) {
|
|
838
|
+
const Component = as || "button";
|
|
839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
840
|
+
Component,
|
|
841
|
+
{
|
|
842
|
+
...Component === "button" ? { type: "button" } : void 0,
|
|
843
|
+
...rest,
|
|
844
|
+
className: cn2(
|
|
845
|
+
"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",
|
|
846
|
+
className
|
|
847
|
+
),
|
|
848
|
+
children
|
|
849
|
+
}
|
|
850
|
+
);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
// src/primitives/icons/index.tsx
|
|
854
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
806
855
|
var strokeProps = {
|
|
807
856
|
fill: "none",
|
|
808
857
|
stroke: "currentColor",
|
|
@@ -811,26 +860,26 @@ var strokeProps = {
|
|
|
811
860
|
strokeLinejoin: "round"
|
|
812
861
|
};
|
|
813
862
|
function AppIcon(props) {
|
|
814
|
-
return /* @__PURE__ */ (0,
|
|
815
|
-
/* @__PURE__ */ (0,
|
|
816
|
-
/* @__PURE__ */ (0,
|
|
863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "2", y: "4", width: "20", height: "14", rx: "2" }),
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M2 20h20" })
|
|
817
866
|
] });
|
|
818
867
|
}
|
|
819
868
|
function BeakerIcon(props) {
|
|
820
|
-
return /* @__PURE__ */ (0,
|
|
821
|
-
/* @__PURE__ */ (0,
|
|
822
|
-
/* @__PURE__ */ (0,
|
|
823
|
-
/* @__PURE__ */ (0,
|
|
869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
870
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M9 3h6" }),
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M10 3v6.5L4.5 18a2 2 0 0 0 1.7 3h11.6a2 2 0 0 0 1.7-3L14 9.5V3" }),
|
|
872
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M7 14h10" })
|
|
824
873
|
] });
|
|
825
874
|
}
|
|
826
875
|
function BookIcon(props) {
|
|
827
|
-
return /* @__PURE__ */ (0,
|
|
828
|
-
/* @__PURE__ */ (0,
|
|
829
|
-
/* @__PURE__ */ (0,
|
|
876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
877
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M4 4h5a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H4z" }),
|
|
878
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M20 4h-5a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h6z" })
|
|
830
879
|
] });
|
|
831
880
|
}
|
|
832
881
|
function CheckIcon(props) {
|
|
833
|
-
return /* @__PURE__ */ (0,
|
|
882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
834
883
|
"svg",
|
|
835
884
|
{
|
|
836
885
|
"aria-hidden": "true",
|
|
@@ -838,24 +887,24 @@ function CheckIcon(props) {
|
|
|
838
887
|
...strokeProps,
|
|
839
888
|
strokeWidth: 2.5,
|
|
840
889
|
...props,
|
|
841
|
-
children: /* @__PURE__ */ (0,
|
|
890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("polyline", { points: "20 6 9 17 4 12" })
|
|
842
891
|
}
|
|
843
892
|
);
|
|
844
893
|
}
|
|
845
894
|
function ClipboardIcon(props) {
|
|
846
|
-
return /* @__PURE__ */ (0,
|
|
847
|
-
/* @__PURE__ */ (0,
|
|
848
|
-
/* @__PURE__ */ (0,
|
|
895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
896
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
849
898
|
] });
|
|
850
899
|
}
|
|
851
900
|
function ClockIcon(props) {
|
|
852
|
-
return /* @__PURE__ */ (0,
|
|
853
|
-
/* @__PURE__ */ (0,
|
|
854
|
-
/* @__PURE__ */ (0,
|
|
901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
902
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M12 7v5l3 2" })
|
|
855
904
|
] });
|
|
856
905
|
}
|
|
857
906
|
function DiscordIcon(props) {
|
|
858
|
-
return /* @__PURE__ */ (0,
|
|
907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
859
908
|
"path",
|
|
860
909
|
{
|
|
861
910
|
fill: "currentColor",
|
|
@@ -864,23 +913,23 @@ function DiscordIcon(props) {
|
|
|
864
913
|
) });
|
|
865
914
|
}
|
|
866
915
|
function DownloadIcon(props) {
|
|
867
|
-
return /* @__PURE__ */ (0,
|
|
868
|
-
/* @__PURE__ */ (0,
|
|
869
|
-
/* @__PURE__ */ (0,
|
|
870
|
-
/* @__PURE__ */ (0,
|
|
916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
917
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
918
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("polyline", { points: "7 10 12 15 17 10" }),
|
|
919
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
871
920
|
] });
|
|
872
921
|
}
|
|
873
922
|
function ExternalLinkIcon(props) {
|
|
874
|
-
return /* @__PURE__ */ (0,
|
|
923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M7 17 17 7M9 7h8v8" }) });
|
|
875
924
|
}
|
|
876
925
|
function GenApiIcon(props) {
|
|
877
|
-
return /* @__PURE__ */ (0,
|
|
878
|
-
/* @__PURE__ */ (0,
|
|
879
|
-
/* @__PURE__ */ (0,
|
|
926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "m8 3 4 1.5L16 3v18l-4-1.5L8 21z" }),
|
|
928
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M8 3v18M16 3v18" })
|
|
880
929
|
] });
|
|
881
930
|
}
|
|
882
931
|
function GitHubIcon(props) {
|
|
883
|
-
return /* @__PURE__ */ (0,
|
|
932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
884
933
|
"path",
|
|
885
934
|
{
|
|
886
935
|
fill: "currentColor",
|
|
@@ -889,69 +938,69 @@ function GitHubIcon(props) {
|
|
|
889
938
|
) });
|
|
890
939
|
}
|
|
891
940
|
function ImageIcon(props) {
|
|
892
|
-
return /* @__PURE__ */ (0,
|
|
893
|
-
/* @__PURE__ */ (0,
|
|
894
|
-
/* @__PURE__ */ (0,
|
|
895
|
-
/* @__PURE__ */ (0,
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
942
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
943
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: "9", cy: "9", r: "2" }),
|
|
944
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "m21 15-5-5L5 21" })
|
|
896
945
|
] });
|
|
897
946
|
}
|
|
898
947
|
function LockIcon(props) {
|
|
899
|
-
return /* @__PURE__ */ (0,
|
|
900
|
-
/* @__PURE__ */ (0,
|
|
901
|
-
/* @__PURE__ */ (0,
|
|
948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
949
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
902
951
|
] });
|
|
903
952
|
}
|
|
904
953
|
function MailIcon(props) {
|
|
905
|
-
return /* @__PURE__ */ (0,
|
|
906
|
-
/* @__PURE__ */ (0,
|
|
907
|
-
/* @__PURE__ */ (0,
|
|
954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
955
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
956
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "m3 7 9 7 9-7" })
|
|
908
957
|
] });
|
|
909
958
|
}
|
|
910
959
|
function McpIcon(props) {
|
|
911
|
-
return /* @__PURE__ */ (0,
|
|
912
|
-
/* @__PURE__ */ (0,
|
|
913
|
-
/* @__PURE__ */ (0,
|
|
914
|
-
/* @__PURE__ */ (0,
|
|
960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
961
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "2", y: "7", width: "8", height: "10", rx: "1.5" }),
|
|
962
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "14", y: "7", width: "8", height: "10", rx: "1.5" }),
|
|
963
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M10 12h4" })
|
|
915
964
|
] });
|
|
916
965
|
}
|
|
917
966
|
function MenuIcon(props) {
|
|
918
|
-
return /* @__PURE__ */ (0,
|
|
967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M4 7h16M4 12h16M4 17h16" }) });
|
|
919
968
|
}
|
|
920
969
|
function TerminalIcon(props) {
|
|
921
|
-
return /* @__PURE__ */ (0,
|
|
922
|
-
/* @__PURE__ */ (0,
|
|
923
|
-
/* @__PURE__ */ (0,
|
|
970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
971
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("polyline", { points: "4 8 8 12 4 16" }),
|
|
972
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("line", { x1: "12", y1: "20", x2: "20", y2: "20" })
|
|
924
973
|
] });
|
|
925
974
|
}
|
|
926
975
|
function TokensIcon(props) {
|
|
927
|
-
return /* @__PURE__ */ (0,
|
|
976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M4 9h16M4 15h16M10 3 8 21M16 3l-2 18" }) });
|
|
928
977
|
}
|
|
929
978
|
function TrendUpIcon(props) {
|
|
930
|
-
return /* @__PURE__ */ (0,
|
|
931
|
-
/* @__PURE__ */ (0,
|
|
932
|
-
/* @__PURE__ */ (0,
|
|
979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
980
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("polyline", { points: "3 17 9 11 13 15 21 7" }),
|
|
981
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("polyline", { points: "15 7 21 7 21 13" })
|
|
933
982
|
] });
|
|
934
983
|
}
|
|
935
984
|
function WalletIcon(props) {
|
|
936
|
-
return /* @__PURE__ */ (0,
|
|
937
|
-
/* @__PURE__ */ (0,
|
|
938
|
-
/* @__PURE__ */ (0,
|
|
939
|
-
/* @__PURE__ */ (0,
|
|
985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
986
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M3 7a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v2H5a2 2 0 0 0-2 2V7Z" }),
|
|
987
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" }),
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: "17", cy: "14", r: "1.25", fill: "currentColor" })
|
|
940
989
|
] });
|
|
941
990
|
}
|
|
942
991
|
function XIcon(props) {
|
|
943
|
-
return /* @__PURE__ */ (0,
|
|
992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
944
993
|
}
|
|
945
994
|
|
|
946
995
|
// src/primitives/ExternalLinkButton.tsx
|
|
947
|
-
var
|
|
996
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
948
997
|
var ExternalLinkButton = ({
|
|
949
998
|
theme,
|
|
950
999
|
href,
|
|
951
|
-
size = "
|
|
1000
|
+
size = "md",
|
|
952
1001
|
className,
|
|
953
1002
|
children
|
|
954
|
-
}) => /* @__PURE__ */ (0,
|
|
1003
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
955
1004
|
Button,
|
|
956
1005
|
{
|
|
957
1006
|
as: "a",
|
|
@@ -962,8 +1011,8 @@ var ExternalLinkButton = ({
|
|
|
962
1011
|
size,
|
|
963
1012
|
className: cn2("polli:gap-2", className),
|
|
964
1013
|
children: [
|
|
965
|
-
/* @__PURE__ */ (0,
|
|
966
|
-
/* @__PURE__ */ (0,
|
|
1014
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children }),
|
|
1015
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
967
1016
|
ExternalLinkIcon,
|
|
968
1017
|
{
|
|
969
1018
|
className: "polli:h-4 polli:w-4 polli:shrink-0 polli:opacity-60",
|
|
@@ -977,10 +1026,48 @@ var ExternalLinkButton = ({
|
|
|
977
1026
|
// src/primitives/Field.tsx
|
|
978
1027
|
var import_field = require("@ark-ui/react/field");
|
|
979
1028
|
|
|
1029
|
+
// src/primitives/FileUpload.tsx
|
|
1030
|
+
var import_react6 = require("react");
|
|
1031
|
+
|
|
1032
|
+
// src/lib/partition-files.ts
|
|
1033
|
+
function matchesAccept(file, accept) {
|
|
1034
|
+
if (!accept) return true;
|
|
1035
|
+
const tokens = accept.split(",").map((t) => t.trim()).filter(Boolean);
|
|
1036
|
+
if (tokens.length === 0) return true;
|
|
1037
|
+
return tokens.some((token) => {
|
|
1038
|
+
if (token.startsWith(".")) {
|
|
1039
|
+
return file.name.toLowerCase().endsWith(token.toLowerCase());
|
|
1040
|
+
}
|
|
1041
|
+
if (token.endsWith("/*")) {
|
|
1042
|
+
const prefix = token.slice(0, token.length - 1);
|
|
1043
|
+
return file.type.startsWith(prefix);
|
|
1044
|
+
}
|
|
1045
|
+
return file.type === token;
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
function partitionFiles(incoming, current, { maxFiles, maxSizeBytes, accept }) {
|
|
1049
|
+
const accepted = [];
|
|
1050
|
+
const rejected = [];
|
|
1051
|
+
let slots = Math.max(0, maxFiles - current.length);
|
|
1052
|
+
for (const file of incoming) {
|
|
1053
|
+
if (!matchesAccept(file, accept)) {
|
|
1054
|
+
rejected.push({ file, reason: "type" });
|
|
1055
|
+
} else if (file.size > maxSizeBytes) {
|
|
1056
|
+
rejected.push({ file, reason: "size" });
|
|
1057
|
+
} else if (slots <= 0) {
|
|
1058
|
+
rejected.push({ file, reason: "count" });
|
|
1059
|
+
} else {
|
|
1060
|
+
accepted.push(file);
|
|
1061
|
+
slots -= 1;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
return { accepted, rejected };
|
|
1065
|
+
}
|
|
1066
|
+
|
|
980
1067
|
// src/primitives/IconButton.tsx
|
|
981
|
-
var
|
|
1068
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
982
1069
|
var intentClasses4 = {
|
|
983
|
-
danger: "polli:bg-intent-danger-bg-light polli:hover:bg-
|
|
1070
|
+
danger: "polli:bg-intent-danger-bg-light polli:hover:bg-intent-danger-bg-hover polli:text-intent-danger-text"
|
|
984
1071
|
};
|
|
985
1072
|
var defaultClasses = "polli:bg-theme-bg-active polli:hover:bg-theme-bg-hover polli:text-theme-text-soft polli:hover:text-theme-text-strong";
|
|
986
1073
|
var IconButton = ({
|
|
@@ -989,15 +1076,16 @@ var IconButton = ({
|
|
|
989
1076
|
onClick,
|
|
990
1077
|
children,
|
|
991
1078
|
className
|
|
992
|
-
}) => /* @__PURE__ */ (0,
|
|
1079
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
993
1080
|
"button",
|
|
994
1081
|
{
|
|
995
1082
|
type: "button",
|
|
996
1083
|
onClick,
|
|
997
1084
|
title,
|
|
998
1085
|
"aria-label": title,
|
|
1086
|
+
"data-intent": intent,
|
|
999
1087
|
className: cn2(
|
|
1000
|
-
"polli:inline-flex polli:h-6 polli:w-6 polli:cursor-pointer polli:items-center polli:justify-center polli:rounded polli:transition-colors",
|
|
1088
|
+
"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",
|
|
1001
1089
|
intent ? intentClasses4[intent] : defaultClasses,
|
|
1002
1090
|
className
|
|
1003
1091
|
),
|
|
@@ -1005,26 +1093,252 @@ var IconButton = ({
|
|
|
1005
1093
|
}
|
|
1006
1094
|
);
|
|
1007
1095
|
|
|
1096
|
+
// src/primitives/FileUpload.tsx
|
|
1097
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1098
|
+
var PREVIEWABLE_IMAGE_TYPES = /* @__PURE__ */ new Set([
|
|
1099
|
+
"image/gif",
|
|
1100
|
+
"image/jpeg",
|
|
1101
|
+
"image/png",
|
|
1102
|
+
"image/webp"
|
|
1103
|
+
]);
|
|
1104
|
+
var PREVIEW_SIZE = 64;
|
|
1105
|
+
function isPreviewableImage(file) {
|
|
1106
|
+
return PREVIEWABLE_IMAGE_TYPES.has(file.type);
|
|
1107
|
+
}
|
|
1108
|
+
function PreviewPlaceholder() {
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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__ */ (0, import_jsx_runtime15.jsx)(ImageIcon, { className: "polli:h-5 polli:w-5" }) });
|
|
1110
|
+
}
|
|
1111
|
+
function FilePreview({ file }) {
|
|
1112
|
+
const canvasRef = (0, import_react6.useRef)(null);
|
|
1113
|
+
const [canPreview, setCanPreview] = (0, import_react6.useState)(
|
|
1114
|
+
() => isPreviewableImage(file)
|
|
1115
|
+
);
|
|
1116
|
+
(0, import_react6.useEffect)(() => {
|
|
1117
|
+
if (!isPreviewableImage(file)) {
|
|
1118
|
+
setCanPreview(false);
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
let cancelled = false;
|
|
1122
|
+
setCanPreview(true);
|
|
1123
|
+
async function drawPreview() {
|
|
1124
|
+
try {
|
|
1125
|
+
const bitmap = await createImageBitmap(file);
|
|
1126
|
+
if (cancelled) {
|
|
1127
|
+
bitmap.close();
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
const canvas = canvasRef.current;
|
|
1131
|
+
const context = canvas?.getContext("2d");
|
|
1132
|
+
if (!canvas || !context) {
|
|
1133
|
+
bitmap.close();
|
|
1134
|
+
setCanPreview(false);
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1137
|
+
canvas.width = PREVIEW_SIZE;
|
|
1138
|
+
canvas.height = PREVIEW_SIZE;
|
|
1139
|
+
const scale = Math.max(
|
|
1140
|
+
PREVIEW_SIZE / bitmap.width,
|
|
1141
|
+
PREVIEW_SIZE / bitmap.height
|
|
1142
|
+
);
|
|
1143
|
+
const width = bitmap.width * scale;
|
|
1144
|
+
const height = bitmap.height * scale;
|
|
1145
|
+
const x = (PREVIEW_SIZE - width) / 2;
|
|
1146
|
+
const y = (PREVIEW_SIZE - height) / 2;
|
|
1147
|
+
context.clearRect(0, 0, PREVIEW_SIZE, PREVIEW_SIZE);
|
|
1148
|
+
context.drawImage(bitmap, x, y, width, height);
|
|
1149
|
+
bitmap.close();
|
|
1150
|
+
} catch {
|
|
1151
|
+
if (!cancelled) setCanPreview(false);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
void drawPreview();
|
|
1155
|
+
return () => {
|
|
1156
|
+
cancelled = true;
|
|
1157
|
+
};
|
|
1158
|
+
}, [file]);
|
|
1159
|
+
if (!canPreview) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PreviewPlaceholder, {});
|
|
1160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1161
|
+
"canvas",
|
|
1162
|
+
{
|
|
1163
|
+
ref: canvasRef,
|
|
1164
|
+
role: "img",
|
|
1165
|
+
"aria-label": file.name,
|
|
1166
|
+
className: "polli:h-16 polli:w-16 polli:rounded-lg",
|
|
1167
|
+
width: PREVIEW_SIZE,
|
|
1168
|
+
height: PREVIEW_SIZE
|
|
1169
|
+
}
|
|
1170
|
+
);
|
|
1171
|
+
}
|
|
1172
|
+
function FileUpload({
|
|
1173
|
+
value,
|
|
1174
|
+
onChange,
|
|
1175
|
+
onReject,
|
|
1176
|
+
maxFiles = 4,
|
|
1177
|
+
maxSizeBytes = 10 * 1024 * 1024,
|
|
1178
|
+
accept = "image/*",
|
|
1179
|
+
disabled = false,
|
|
1180
|
+
theme,
|
|
1181
|
+
className
|
|
1182
|
+
}) {
|
|
1183
|
+
(0, import_react6.useEffect)(() => {
|
|
1184
|
+
const prevent = (event) => event.preventDefault();
|
|
1185
|
+
document.addEventListener("dragover", prevent);
|
|
1186
|
+
document.addEventListener("drop", prevent);
|
|
1187
|
+
return () => {
|
|
1188
|
+
document.removeEventListener("dragover", prevent);
|
|
1189
|
+
document.removeEventListener("drop", prevent);
|
|
1190
|
+
};
|
|
1191
|
+
}, []);
|
|
1192
|
+
function addFiles(incoming) {
|
|
1193
|
+
if (disabled || incoming.length === 0) return;
|
|
1194
|
+
const { accepted, rejected } = partitionFiles(incoming, value, {
|
|
1195
|
+
maxFiles,
|
|
1196
|
+
maxSizeBytes,
|
|
1197
|
+
accept
|
|
1198
|
+
});
|
|
1199
|
+
if (accepted.length > 0) onChange([...value, ...accepted]);
|
|
1200
|
+
if (rejected.length > 0) onReject?.(rejected);
|
|
1201
|
+
}
|
|
1202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1203
|
+
"div",
|
|
1204
|
+
{
|
|
1205
|
+
"data-theme": theme,
|
|
1206
|
+
className: cn2("polli:flex polli:flex-col polli:gap-3", className),
|
|
1207
|
+
children: [
|
|
1208
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1209
|
+
"label",
|
|
1210
|
+
{
|
|
1211
|
+
className: cn2(
|
|
1212
|
+
"polli-control polli:flex polli:flex-col polli:items-center polli:justify-center polli:gap-2",
|
|
1213
|
+
"polli:rounded-xl polli:border polli:border-dashed polli:border-theme-border",
|
|
1214
|
+
"polli:bg-theme-bg-pale polli:px-4 polli:py-6 polli:text-center polli:text-sm",
|
|
1215
|
+
"polli:text-theme-text-soft polli:transition-colors",
|
|
1216
|
+
disabled ? "polli:cursor-not-allowed polli:opacity-50" : "polli:cursor-pointer polli:hover:bg-theme-bg-hover"
|
|
1217
|
+
),
|
|
1218
|
+
onDragOver: (e) => e.preventDefault(),
|
|
1219
|
+
onDrop: (e) => {
|
|
1220
|
+
e.preventDefault();
|
|
1221
|
+
if (disabled) return;
|
|
1222
|
+
addFiles(Array.from(e.dataTransfer.files));
|
|
1223
|
+
},
|
|
1224
|
+
children: [
|
|
1225
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ImageIcon, { className: "polli:h-6 polli:w-6" }),
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
|
|
1227
|
+
"Drag images here or",
|
|
1228
|
+
" ",
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "polli:underline", children: "browse" })
|
|
1230
|
+
] }),
|
|
1231
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1232
|
+
"input",
|
|
1233
|
+
{
|
|
1234
|
+
type: "file",
|
|
1235
|
+
accept,
|
|
1236
|
+
multiple: maxFiles > 1,
|
|
1237
|
+
disabled,
|
|
1238
|
+
className: "polli:sr-only",
|
|
1239
|
+
onChange: (e) => {
|
|
1240
|
+
addFiles(Array.from(e.target.files ?? []));
|
|
1241
|
+
e.target.value = "";
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
)
|
|
1245
|
+
]
|
|
1246
|
+
}
|
|
1247
|
+
),
|
|
1248
|
+
value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "polli:m-0 polli:flex polli:flex-wrap polli:gap-3 polli:p-0", children: value.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1249
|
+
"li",
|
|
1250
|
+
{
|
|
1251
|
+
className: "polli:relative polli:flex polli:list-none polli:flex-col polli:gap-1",
|
|
1252
|
+
children: [
|
|
1253
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FilePreview, { file }),
|
|
1254
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "polli:max-w-16 polli:truncate polli:text-xs polli:text-theme-text-muted", children: file.name }),
|
|
1255
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "polli:absolute polli:-top-2 polli:-right-2", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1256
|
+
IconButton,
|
|
1257
|
+
{
|
|
1258
|
+
intent: "danger",
|
|
1259
|
+
title: `Remove ${file.name}`,
|
|
1260
|
+
onClick: () => onChange(
|
|
1261
|
+
value.filter(
|
|
1262
|
+
(_, i) => i !== index
|
|
1263
|
+
)
|
|
1264
|
+
),
|
|
1265
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(XIcon, { className: "polli:h-3 polli:w-3" })
|
|
1266
|
+
}
|
|
1267
|
+
) })
|
|
1268
|
+
]
|
|
1269
|
+
},
|
|
1270
|
+
`${file.name}-${index}`
|
|
1271
|
+
)) })
|
|
1272
|
+
]
|
|
1273
|
+
}
|
|
1274
|
+
);
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1008
1277
|
// src/primitives/InfoTip.tsx
|
|
1009
|
-
var
|
|
1278
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1010
1279
|
var InfoTip = ({
|
|
1011
1280
|
text,
|
|
1012
1281
|
content,
|
|
1013
1282
|
label = "More info"
|
|
1014
|
-
}) => /* @__PURE__ */ (0,
|
|
1283
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Tooltip, { content: content ?? text, ariaLabel: label, className: "polli:ml-1", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" }) });
|
|
1284
|
+
|
|
1285
|
+
// src/primitives/InlineLink.tsx
|
|
1286
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1287
|
+
function isExternalHref(href) {
|
|
1288
|
+
return typeof href === "string" && /^https?:\/\//.test(href);
|
|
1289
|
+
}
|
|
1290
|
+
function InlineLink({
|
|
1291
|
+
as,
|
|
1292
|
+
theme,
|
|
1293
|
+
external,
|
|
1294
|
+
showIcon = true,
|
|
1295
|
+
className,
|
|
1296
|
+
children,
|
|
1297
|
+
...linkProps
|
|
1298
|
+
}) {
|
|
1299
|
+
const Component = as || "a";
|
|
1300
|
+
const isExternal = external ?? isExternalHref(linkProps.href);
|
|
1301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1302
|
+
Component,
|
|
1303
|
+
{
|
|
1304
|
+
"data-theme": theme,
|
|
1305
|
+
target: isExternal ? "_blank" : void 0,
|
|
1306
|
+
rel: isExternal ? "noopener noreferrer" : void 0,
|
|
1307
|
+
className: cn2(
|
|
1308
|
+
"polli-control polli:inline-flex polli:items-center polli:gap-1 polli:rounded-sm polli:font-semibold polli:text-theme-text-strong",
|
|
1309
|
+
"polli:underline polli:decoration-theme-border polli:decoration-2 polli:underline-offset-3",
|
|
1310
|
+
"polli:transition-colors polli:hover:text-theme-text-soft polli:hover:decoration-theme-text-soft",
|
|
1311
|
+
className
|
|
1312
|
+
),
|
|
1313
|
+
...linkProps,
|
|
1314
|
+
children: [
|
|
1315
|
+
children,
|
|
1316
|
+
showIcon && isExternal && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1317
|
+
ExternalLinkIcon,
|
|
1318
|
+
{
|
|
1319
|
+
"aria-hidden": "true",
|
|
1320
|
+
className: "polli:h-3.5 polli:w-3.5 polli:shrink-0 polli:opacity-65"
|
|
1321
|
+
}
|
|
1322
|
+
)
|
|
1323
|
+
]
|
|
1324
|
+
}
|
|
1325
|
+
);
|
|
1326
|
+
}
|
|
1015
1327
|
|
|
1016
1328
|
// src/primitives/Input.tsx
|
|
1017
|
-
var
|
|
1018
|
-
var
|
|
1019
|
-
var Input = (0,
|
|
1020
|
-
({ className, error, hideNumberSteppers, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1329
|
+
var import_react7 = require("react");
|
|
1330
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1331
|
+
var Input = (0, import_react7.forwardRef)(
|
|
1332
|
+
({ className, error, hideNumberSteppers, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1021
1333
|
"input",
|
|
1022
1334
|
{
|
|
1023
1335
|
ref,
|
|
1336
|
+
"data-error": error ? "true" : void 0,
|
|
1024
1337
|
className: cn2(
|
|
1025
|
-
"polli:px-3 polli:py-2 polli:border polli:rounded-lg",
|
|
1338
|
+
"polli-input polli:px-3 polli:py-2 polli:border polli:rounded-lg",
|
|
1339
|
+
"polli:text-gray-950",
|
|
1340
|
+
"polli:transition-colors",
|
|
1026
1341
|
"polli:disabled:opacity-50 polli:disabled:cursor-not-allowed",
|
|
1027
|
-
error ? "polli:border-red-400" : "polli:border-gray-300",
|
|
1028
1342
|
hideNumberSteppers && "polli-input-number-clean",
|
|
1029
1343
|
className
|
|
1030
1344
|
),
|
|
@@ -1033,9 +1347,145 @@ var Input = (0, import_react5.forwardRef)(
|
|
|
1033
1347
|
)
|
|
1034
1348
|
);
|
|
1035
1349
|
|
|
1350
|
+
// src/primitives/Surface.tsx
|
|
1351
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1352
|
+
var variantClasses = {
|
|
1353
|
+
panel: "polli:rounded-2xl polli:border polli:border-theme-border polli:bg-theme-bg-subtle polli:p-6",
|
|
1354
|
+
card: "polli:rounded-xl polli:bg-surface-white polli:p-4",
|
|
1355
|
+
"card-themed": "polli:rounded-xl polli:bg-theme-bg-pale polli:p-4"
|
|
1356
|
+
};
|
|
1357
|
+
var Surface = ({
|
|
1358
|
+
theme,
|
|
1359
|
+
variant = "card",
|
|
1360
|
+
className,
|
|
1361
|
+
children,
|
|
1362
|
+
...rest
|
|
1363
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1364
|
+
"div",
|
|
1365
|
+
{
|
|
1366
|
+
...rest,
|
|
1367
|
+
"data-theme": theme,
|
|
1368
|
+
className: cn2("polli:min-w-0", variantClasses[variant], className),
|
|
1369
|
+
children
|
|
1370
|
+
}
|
|
1371
|
+
);
|
|
1372
|
+
|
|
1373
|
+
// src/primitives/LinkCard.tsx
|
|
1374
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1375
|
+
function isExternalHref2(href) {
|
|
1376
|
+
return typeof href === "string" && /^https?:\/\//.test(href);
|
|
1377
|
+
}
|
|
1378
|
+
function LinkCard({
|
|
1379
|
+
as,
|
|
1380
|
+
theme,
|
|
1381
|
+
external,
|
|
1382
|
+
showIcon = true,
|
|
1383
|
+
className,
|
|
1384
|
+
surfaceClassName,
|
|
1385
|
+
children,
|
|
1386
|
+
...linkProps
|
|
1387
|
+
}) {
|
|
1388
|
+
const Component = as || "a";
|
|
1389
|
+
const isExternal = external ?? isExternalHref2(linkProps.href);
|
|
1390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1391
|
+
Component,
|
|
1392
|
+
{
|
|
1393
|
+
"data-theme": theme,
|
|
1394
|
+
target: isExternal ? "_blank" : void 0,
|
|
1395
|
+
rel: isExternal ? "noopener noreferrer" : void 0,
|
|
1396
|
+
className: cn2(
|
|
1397
|
+
"polli:group polli:block polli:h-full polli:rounded-xl polli:outline-none",
|
|
1398
|
+
className
|
|
1399
|
+
),
|
|
1400
|
+
...linkProps,
|
|
1401
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1402
|
+
Surface,
|
|
1403
|
+
{
|
|
1404
|
+
theme,
|
|
1405
|
+
variant: "card",
|
|
1406
|
+
className: cn2(
|
|
1407
|
+
"polli:relative polli:flex polli:h-full polli:flex-col polli:gap-2 polli:bg-white/80 polli:p-5",
|
|
1408
|
+
showIcon && isExternal && "polli:pr-10",
|
|
1409
|
+
"polli:transition polli:group-hover:-translate-y-0.5 polli:group-hover:bg-white/95",
|
|
1410
|
+
"polli:group-focus-visible:ring-2 polli:group-focus-visible:ring-theme-border",
|
|
1411
|
+
surfaceClassName
|
|
1412
|
+
),
|
|
1413
|
+
children: [
|
|
1414
|
+
showIcon && isExternal && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1415
|
+
ExternalLinkIcon,
|
|
1416
|
+
{
|
|
1417
|
+
"aria-hidden": "true",
|
|
1418
|
+
className: "polli:absolute polli:top-4 polli:right-4 polli:h-3.5 polli:w-3.5 polli:text-theme-text-soft"
|
|
1419
|
+
}
|
|
1420
|
+
),
|
|
1421
|
+
children
|
|
1422
|
+
]
|
|
1423
|
+
}
|
|
1424
|
+
)
|
|
1425
|
+
}
|
|
1426
|
+
);
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
// src/primitives/Markdown.tsx
|
|
1430
|
+
var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
1431
|
+
var import_remark_gfm = __toESM(require("remark-gfm"), 1);
|
|
1432
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1433
|
+
var components = {
|
|
1434
|
+
ul: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1435
|
+
"ul",
|
|
1436
|
+
{
|
|
1437
|
+
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",
|
|
1438
|
+
...props
|
|
1439
|
+
}
|
|
1440
|
+
),
|
|
1441
|
+
ol: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1442
|
+
"ol",
|
|
1443
|
+
{
|
|
1444
|
+
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",
|
|
1445
|
+
...props
|
|
1446
|
+
}
|
|
1447
|
+
),
|
|
1448
|
+
p: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "polli:mb-2 polli:last:mb-0", ...props }),
|
|
1449
|
+
strong: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1450
|
+
"strong",
|
|
1451
|
+
{
|
|
1452
|
+
className: "polli:font-semibold polli:text-theme-text-strong",
|
|
1453
|
+
...props
|
|
1454
|
+
}
|
|
1455
|
+
),
|
|
1456
|
+
code: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1457
|
+
"code",
|
|
1458
|
+
{
|
|
1459
|
+
className: "polli:break-words polli:rounded polli:bg-theme-bg-subtle polli:px-1 polli:py-0.5 polli:font-mono polli:text-xs",
|
|
1460
|
+
...props
|
|
1461
|
+
}
|
|
1462
|
+
),
|
|
1463
|
+
a: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1464
|
+
"a",
|
|
1465
|
+
{
|
|
1466
|
+
target: "_blank",
|
|
1467
|
+
rel: "noopener noreferrer",
|
|
1468
|
+
className: "polli-control polli:rounded-sm polli:font-semibold polli:text-theme-text-strong polli:underline polli:underline-offset-2",
|
|
1469
|
+
...props
|
|
1470
|
+
}
|
|
1471
|
+
)
|
|
1472
|
+
};
|
|
1473
|
+
function Markdown({ children, className }) {
|
|
1474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1475
|
+
"div",
|
|
1476
|
+
{
|
|
1477
|
+
className: cn2(
|
|
1478
|
+
"polli:min-w-0 polli:font-body polli:leading-relaxed",
|
|
1479
|
+
className
|
|
1480
|
+
),
|
|
1481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_markdown.default, { remarkPlugins: [import_remark_gfm.default], components, children })
|
|
1482
|
+
}
|
|
1483
|
+
);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1036
1486
|
// src/primitives/ScrollArea.tsx
|
|
1037
|
-
var
|
|
1038
|
-
var
|
|
1487
|
+
var import_react8 = require("react");
|
|
1488
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1039
1489
|
var axisClasses = {
|
|
1040
1490
|
y: "polli:overflow-y-auto polli:overflow-x-hidden",
|
|
1041
1491
|
x: "polli:overflow-x-auto polli:overflow-y-hidden"
|
|
@@ -1044,17 +1494,17 @@ function assignRef(ref, value) {
|
|
|
1044
1494
|
if (typeof ref === "function") ref(value);
|
|
1045
1495
|
else if (ref) ref.current = value;
|
|
1046
1496
|
}
|
|
1047
|
-
var ScrollArea = (0,
|
|
1497
|
+
var ScrollArea = (0, import_react8.forwardRef)(
|
|
1048
1498
|
({ theme, axis = "y", className, children, ...rest }, externalRef) => {
|
|
1049
|
-
const innerRef = (0,
|
|
1050
|
-
const setRef = (0,
|
|
1499
|
+
const innerRef = (0, import_react8.useRef)(null);
|
|
1500
|
+
const setRef = (0, import_react8.useCallback)(
|
|
1051
1501
|
(node) => {
|
|
1052
1502
|
innerRef.current = node;
|
|
1053
1503
|
assignRef(externalRef, node);
|
|
1054
1504
|
},
|
|
1055
1505
|
[externalRef]
|
|
1056
1506
|
);
|
|
1057
|
-
(0,
|
|
1507
|
+
(0, import_react8.useEffect)(() => {
|
|
1058
1508
|
const element = innerRef.current;
|
|
1059
1509
|
if (!element) return;
|
|
1060
1510
|
let hideTimer = null;
|
|
@@ -1105,7 +1555,7 @@ var ScrollArea = (0, import_react6.forwardRef)(
|
|
|
1105
1555
|
element.removeEventListener("focusout", scheduleHide);
|
|
1106
1556
|
};
|
|
1107
1557
|
}, []);
|
|
1108
|
-
return /* @__PURE__ */ (0,
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1109
1559
|
"div",
|
|
1110
1560
|
{
|
|
1111
1561
|
...rest,
|
|
@@ -1124,9 +1574,9 @@ var ScrollArea = (0, import_react6.forwardRef)(
|
|
|
1124
1574
|
ScrollArea.displayName = "ScrollArea";
|
|
1125
1575
|
|
|
1126
1576
|
// src/primitives/MultiSelect.tsx
|
|
1127
|
-
var
|
|
1128
|
-
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";
|
|
1129
|
-
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";
|
|
1577
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1578
|
+
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";
|
|
1579
|
+
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";
|
|
1130
1580
|
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";
|
|
1131
1581
|
var MultiSelect = ({
|
|
1132
1582
|
options,
|
|
@@ -1149,16 +1599,16 @@ var MultiSelect = ({
|
|
|
1149
1599
|
};
|
|
1150
1600
|
const selectAll = () => onChange([]);
|
|
1151
1601
|
const displayText = disabled ? disabledText : isAllSelected ? "All" : `${selected.length} selected`;
|
|
1152
|
-
const labelNode = label ? /* @__PURE__ */ (0,
|
|
1602
|
+
const labelNode = label ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "polli:text-xs polli:font-medium polli:text-theme-text-soft", children: label }) : null;
|
|
1153
1603
|
if (disabled) {
|
|
1154
|
-
return /* @__PURE__ */ (0,
|
|
1604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1155
1605
|
"div",
|
|
1156
1606
|
{
|
|
1157
1607
|
"data-theme": theme,
|
|
1158
1608
|
className: "polli:group polli:relative polli:flex polli:items-center polli:gap-2",
|
|
1159
1609
|
children: [
|
|
1160
1610
|
labelNode,
|
|
1161
|
-
/* @__PURE__ */ (0,
|
|
1611
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1162
1612
|
"button",
|
|
1163
1613
|
{
|
|
1164
1614
|
type: "button",
|
|
@@ -1168,8 +1618,8 @@ var MultiSelect = ({
|
|
|
1168
1618
|
"polli:cursor-not-allowed polli:border-theme-border polli:bg-theme-bg-subtle polli:opacity-60"
|
|
1169
1619
|
),
|
|
1170
1620
|
children: [
|
|
1171
|
-
/* @__PURE__ */ (0,
|
|
1172
|
-
/* @__PURE__ */ (0,
|
|
1621
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "polli:flex-1 polli:truncate polli:text-left polli:text-theme-text-soft/60", children: displayText }),
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1173
1623
|
ChevronIcon,
|
|
1174
1624
|
{
|
|
1175
1625
|
expanded: false,
|
|
@@ -1179,25 +1629,25 @@ var MultiSelect = ({
|
|
|
1179
1629
|
]
|
|
1180
1630
|
}
|
|
1181
1631
|
),
|
|
1182
|
-
/* @__PURE__ */ (0,
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("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" })
|
|
1183
1633
|
]
|
|
1184
1634
|
}
|
|
1185
1635
|
);
|
|
1186
1636
|
}
|
|
1187
|
-
return /* @__PURE__ */ (0,
|
|
1637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1188
1638
|
"div",
|
|
1189
1639
|
{
|
|
1190
1640
|
"data-theme": theme,
|
|
1191
1641
|
className: "polli:flex polli:items-center polli:gap-2",
|
|
1192
1642
|
children: [
|
|
1193
1643
|
labelNode,
|
|
1194
|
-
/* @__PURE__ */ (0,
|
|
1644
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1195
1645
|
Dropdown,
|
|
1196
1646
|
{
|
|
1197
1647
|
theme,
|
|
1198
1648
|
align,
|
|
1199
1649
|
className: "polli:min-w-[320px]",
|
|
1200
|
-
trigger: (open) => /* @__PURE__ */ (0,
|
|
1650
|
+
trigger: (open) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1201
1651
|
"button",
|
|
1202
1652
|
{
|
|
1203
1653
|
type: "button",
|
|
@@ -1206,7 +1656,7 @@ var MultiSelect = ({
|
|
|
1206
1656
|
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"
|
|
1207
1657
|
),
|
|
1208
1658
|
children: [
|
|
1209
|
-
/* @__PURE__ */ (0,
|
|
1659
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1210
1660
|
"span",
|
|
1211
1661
|
{
|
|
1212
1662
|
className: cn2(
|
|
@@ -1216,7 +1666,7 @@ var MultiSelect = ({
|
|
|
1216
1666
|
children: displayText
|
|
1217
1667
|
}
|
|
1218
1668
|
),
|
|
1219
|
-
/* @__PURE__ */ (0,
|
|
1669
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1220
1670
|
ChevronIcon,
|
|
1221
1671
|
{
|
|
1222
1672
|
expanded: open,
|
|
@@ -1229,8 +1679,8 @@ var MultiSelect = ({
|
|
|
1229
1679
|
]
|
|
1230
1680
|
}
|
|
1231
1681
|
),
|
|
1232
|
-
children: /* @__PURE__ */ (0,
|
|
1233
|
-
/* @__PURE__ */ (0,
|
|
1682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(ScrollArea, { theme, className: "polli:max-h-64", children: [
|
|
1683
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1234
1684
|
"button",
|
|
1235
1685
|
{
|
|
1236
1686
|
type: "button",
|
|
@@ -1240,7 +1690,7 @@ var MultiSelect = ({
|
|
|
1240
1690
|
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"
|
|
1241
1691
|
),
|
|
1242
1692
|
children: [
|
|
1243
|
-
/* @__PURE__ */ (0,
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1244
1694
|
"span",
|
|
1245
1695
|
{
|
|
1246
1696
|
className: cn2(
|
|
@@ -1256,7 +1706,7 @@ var MultiSelect = ({
|
|
|
1256
1706
|
),
|
|
1257
1707
|
options.map((opt) => {
|
|
1258
1708
|
const isChecked = selected.includes(opt.value);
|
|
1259
|
-
return /* @__PURE__ */ (0,
|
|
1709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1260
1710
|
"button",
|
|
1261
1711
|
{
|
|
1262
1712
|
type: "button",
|
|
@@ -1266,7 +1716,7 @@ var MultiSelect = ({
|
|
|
1266
1716
|
isChecked ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-theme-text-base polli:hover:bg-theme-bg-subtle"
|
|
1267
1717
|
),
|
|
1268
1718
|
children: [
|
|
1269
|
-
/* @__PURE__ */ (0,
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1270
1720
|
"span",
|
|
1271
1721
|
{
|
|
1272
1722
|
className: cn2(
|
|
@@ -1276,7 +1726,7 @@ var MultiSelect = ({
|
|
|
1276
1726
|
children: isChecked && "\u2713"
|
|
1277
1727
|
}
|
|
1278
1728
|
),
|
|
1279
|
-
/* @__PURE__ */ (0,
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "polli:whitespace-nowrap", children: opt.label })
|
|
1280
1730
|
]
|
|
1281
1731
|
},
|
|
1282
1732
|
opt.value
|
|
@@ -1290,26 +1740,74 @@ var MultiSelect = ({
|
|
|
1290
1740
|
);
|
|
1291
1741
|
};
|
|
1292
1742
|
|
|
1743
|
+
// src/primitives/NavItem.tsx
|
|
1744
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1745
|
+
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";
|
|
1746
|
+
var activeClasses = "polli:bg-theme-bg-active polli:text-theme-text-strong";
|
|
1747
|
+
var inactiveClasses = "polli:text-gray-800 polli:hover:bg-white/60 polli:hover:text-gray-950";
|
|
1748
|
+
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)]";
|
|
1749
|
+
function NavItem({
|
|
1750
|
+
as,
|
|
1751
|
+
theme,
|
|
1752
|
+
active = false,
|
|
1753
|
+
className,
|
|
1754
|
+
children,
|
|
1755
|
+
...rest
|
|
1756
|
+
}) {
|
|
1757
|
+
const Component = as || "button";
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1759
|
+
Component,
|
|
1760
|
+
{
|
|
1761
|
+
"data-theme": theme,
|
|
1762
|
+
"aria-current": active ? "page" : void 0,
|
|
1763
|
+
className: cn2(
|
|
1764
|
+
base,
|
|
1765
|
+
active ? activeClasses : inactiveClasses,
|
|
1766
|
+
className
|
|
1767
|
+
),
|
|
1768
|
+
...rest,
|
|
1769
|
+
children: [
|
|
1770
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { "aria-hidden": "true", className: dotClasses }),
|
|
1771
|
+
children
|
|
1772
|
+
]
|
|
1773
|
+
}
|
|
1774
|
+
);
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1293
1777
|
// src/primitives/PeriodPicker.tsx
|
|
1294
|
-
var
|
|
1778
|
+
var import_react9 = require("react");
|
|
1295
1779
|
|
|
1296
1780
|
// src/primitives/TabButton.tsx
|
|
1297
|
-
var
|
|
1781
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1298
1782
|
var sizeClasses2 = {
|
|
1299
|
-
|
|
1300
|
-
|
|
1783
|
+
md: "polli:px-4 polli:py-1.5 polli:text-base",
|
|
1784
|
+
sm: "polli:px-3 polli:py-1.5 polli:text-sm"
|
|
1785
|
+
};
|
|
1786
|
+
var variantClasses2 = {
|
|
1787
|
+
default: {
|
|
1788
|
+
base: "polli:border",
|
|
1789
|
+
active: "polli:bg-theme-bg-active polli:text-theme-text-strong polli:border-theme-border",
|
|
1790
|
+
inactive: "polli:bg-theme-bg-subtle polli:text-theme-text-base polli:border-theme-border polli:hover:bg-theme-bg-active"
|
|
1791
|
+
},
|
|
1792
|
+
ghost: {
|
|
1793
|
+
base: "polli:border polli:border-transparent",
|
|
1794
|
+
active: "polli:bg-theme-bg-active polli:text-theme-text-strong",
|
|
1795
|
+
inactive: "polli:bg-transparent polli:text-theme-text-base polli:hover:bg-theme-bg-subtle polli:hover:text-theme-text-strong"
|
|
1796
|
+
}
|
|
1301
1797
|
};
|
|
1302
1798
|
var TabButton = ({
|
|
1303
1799
|
theme,
|
|
1304
1800
|
active,
|
|
1305
1801
|
onClick,
|
|
1306
1802
|
children,
|
|
1307
|
-
size = "
|
|
1803
|
+
size = "md",
|
|
1804
|
+
variant = "default",
|
|
1308
1805
|
ariaLabel,
|
|
1309
1806
|
disabled = false,
|
|
1310
1807
|
className
|
|
1311
1808
|
}) => {
|
|
1312
|
-
|
|
1809
|
+
const classes = variantClasses2[variant];
|
|
1810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1313
1811
|
"button",
|
|
1314
1812
|
{
|
|
1315
1813
|
type: "button",
|
|
@@ -1319,8 +1817,9 @@ var TabButton = ({
|
|
|
1319
1817
|
"aria-pressed": active,
|
|
1320
1818
|
disabled,
|
|
1321
1819
|
className: cn2(
|
|
1322
|
-
"polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:
|
|
1323
|
-
|
|
1820
|
+
"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",
|
|
1821
|
+
classes.base,
|
|
1822
|
+
active ? classes.active : classes.inactive,
|
|
1324
1823
|
disabled && "polli:cursor-not-allowed polli:opacity-50",
|
|
1325
1824
|
sizeClasses2[size],
|
|
1326
1825
|
className
|
|
@@ -1331,7 +1830,7 @@ var TabButton = ({
|
|
|
1331
1830
|
};
|
|
1332
1831
|
|
|
1333
1832
|
// src/primitives/PeriodPicker.tsx
|
|
1334
|
-
var
|
|
1833
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1335
1834
|
var WEEKDAY_LABELS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
1336
1835
|
var MONTH_LABELS = [
|
|
1337
1836
|
"Jan",
|
|
@@ -1347,7 +1846,7 @@ var MONTH_LABELS = [
|
|
|
1347
1846
|
"Nov",
|
|
1348
1847
|
"Dec"
|
|
1349
1848
|
];
|
|
1350
|
-
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";
|
|
1849
|
+
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";
|
|
1351
1850
|
function addUtcMonths2(date, months) {
|
|
1352
1851
|
return new Date(
|
|
1353
1852
|
Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + months, 1)
|
|
@@ -1384,13 +1883,13 @@ var PeriodPicker = ({
|
|
|
1384
1883
|
minDate = /* @__PURE__ */ new Date(0),
|
|
1385
1884
|
maxDate
|
|
1386
1885
|
}) => {
|
|
1387
|
-
const [open, setOpen] = (0,
|
|
1388
|
-
const [viewDate, setViewDate] = (0,
|
|
1886
|
+
const [open, setOpen] = (0, import_react9.useState)(false);
|
|
1887
|
+
const [viewDate, setViewDate] = (0, import_react9.useState)(() => periodDate(value));
|
|
1389
1888
|
const { granularity, period } = value;
|
|
1390
|
-
(0,
|
|
1889
|
+
(0, import_react9.useEffect)(() => {
|
|
1391
1890
|
setViewDate(periodDate({ granularity, period }));
|
|
1392
1891
|
}, [granularity, period]);
|
|
1393
|
-
const dates = (0,
|
|
1892
|
+
const dates = (0, import_react9.useMemo)(() => monthGridDates(viewDate), [viewDate]);
|
|
1394
1893
|
const selectedWindow = periodToWindow(value);
|
|
1395
1894
|
const today = startOfUtcDay(maxDate);
|
|
1396
1895
|
const previousViewDate = value.granularity === "month" ? addUtcMonths2(viewDate, -12) : addUtcMonths2(viewDate, -1);
|
|
@@ -1411,14 +1910,14 @@ var PeriodPicker = ({
|
|
|
1411
1910
|
month: "long",
|
|
1412
1911
|
year: "numeric"
|
|
1413
1912
|
});
|
|
1414
|
-
return /* @__PURE__ */ (0,
|
|
1913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1415
1914
|
"div",
|
|
1416
1915
|
{
|
|
1417
1916
|
"data-theme": theme,
|
|
1418
1917
|
className: "polli:flex polli:flex-wrap polli:items-center polli:gap-2",
|
|
1419
1918
|
children: [
|
|
1420
|
-
/* @__PURE__ */ (0,
|
|
1421
|
-
(granularity2) => /* @__PURE__ */ (0,
|
|
1919
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "polli:flex polli:flex-wrap polli:gap-1.5", children: ["day", "week", "month"].map(
|
|
1920
|
+
(granularity2) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1422
1921
|
TabButton,
|
|
1423
1922
|
{
|
|
1424
1923
|
active: value.granularity === granularity2,
|
|
@@ -1428,33 +1927,33 @@ var PeriodPicker = ({
|
|
|
1428
1927
|
granularity2
|
|
1429
1928
|
)
|
|
1430
1929
|
) }),
|
|
1431
|
-
/* @__PURE__ */ (0,
|
|
1930
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1432
1931
|
Dropdown,
|
|
1433
1932
|
{
|
|
1434
1933
|
theme,
|
|
1435
1934
|
open,
|
|
1436
1935
|
onOpenChange: setOpen,
|
|
1437
1936
|
className: "polli:w-[304px] polli:rounded-xl polli:p-3",
|
|
1438
|
-
trigger: (isOpen) => /* @__PURE__ */ (0,
|
|
1937
|
+
trigger: (isOpen) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1439
1938
|
"button",
|
|
1440
1939
|
{
|
|
1441
1940
|
type: "button",
|
|
1442
1941
|
"aria-label": `Select period, current ${formatPeriodLabel(value)}`,
|
|
1443
1942
|
className: cn2(
|
|
1444
|
-
"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",
|
|
1943
|
+
"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",
|
|
1445
1944
|
"polli:border-theme-border polli:bg-theme-bg-subtle polli:text-theme-text-base",
|
|
1446
1945
|
"polli:transition-all polli:duration-200 polli:ease-out polli:hover:bg-theme-bg-pale",
|
|
1447
1946
|
isOpen && "polli:bg-theme-bg-active polli:text-theme-text-strong polli:shadow-sm"
|
|
1448
1947
|
),
|
|
1449
1948
|
children: [
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1451
|
-
/* @__PURE__ */ (0,
|
|
1949
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: formatPeriodLabel(value) }),
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronIcon, { expanded: isOpen })
|
|
1452
1951
|
]
|
|
1453
1952
|
}
|
|
1454
1953
|
),
|
|
1455
1954
|
children: [
|
|
1456
|
-
/* @__PURE__ */ (0,
|
|
1457
|
-
/* @__PURE__ */ (0,
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "polli:mb-3 polli:flex polli:items-center polli:justify-between", children: [
|
|
1956
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1458
1957
|
"button",
|
|
1459
1958
|
{
|
|
1460
1959
|
type: "button",
|
|
@@ -1468,8 +1967,8 @@ var PeriodPicker = ({
|
|
|
1468
1967
|
children: "<"
|
|
1469
1968
|
}
|
|
1470
1969
|
),
|
|
1471
|
-
/* @__PURE__ */ (0,
|
|
1472
|
-
/* @__PURE__ */ (0,
|
|
1970
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "polli:text-sm polli:font-bold polli:text-theme-text-base", children: viewLabel }),
|
|
1971
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1473
1972
|
"button",
|
|
1474
1973
|
{
|
|
1475
1974
|
type: "button",
|
|
@@ -1484,7 +1983,7 @@ var PeriodPicker = ({
|
|
|
1484
1983
|
}
|
|
1485
1984
|
)
|
|
1486
1985
|
] }),
|
|
1487
|
-
value.granularity === "month" ? /* @__PURE__ */ (0,
|
|
1986
|
+
value.granularity === "month" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "polli:grid polli:grid-cols-3 polli:gap-1.5", children: MONTH_LABELS.map((label, monthIndex) => {
|
|
1488
1987
|
const date = new Date(
|
|
1489
1988
|
Date.UTC(
|
|
1490
1989
|
viewDate.getUTCFullYear(),
|
|
@@ -1503,7 +2002,7 @@ var PeriodPicker = ({
|
|
|
1503
2002
|
year: "numeric"
|
|
1504
2003
|
});
|
|
1505
2004
|
const selected = date.getUTCFullYear() === selectedWindow.start.getUTCFullYear() && date.getUTCMonth() === selectedWindow.start.getUTCMonth();
|
|
1506
|
-
return /* @__PURE__ */ (0,
|
|
2005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1507
2006
|
"button",
|
|
1508
2007
|
{
|
|
1509
2008
|
type: "button",
|
|
@@ -1511,7 +2010,7 @@ var PeriodPicker = ({
|
|
|
1511
2010
|
disabled: !selectable,
|
|
1512
2011
|
onClick: () => selectDate(date),
|
|
1513
2012
|
className: cn2(
|
|
1514
|
-
"polli:rounded-lg polli:px-3 polli:py-2 polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
2013
|
+
"polli-control polli:rounded-lg polli:px-3 polli:py-2 polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
1515
2014
|
selected ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-gray-700 polli:hover:bg-theme-bg-subtle",
|
|
1516
2015
|
!selectable && "polli:cursor-not-allowed polli:text-gray-300 polli:hover:bg-transparent"
|
|
1517
2016
|
),
|
|
@@ -1519,9 +2018,9 @@ var PeriodPicker = ({
|
|
|
1519
2018
|
},
|
|
1520
2019
|
label
|
|
1521
2020
|
);
|
|
1522
|
-
}) }) : /* @__PURE__ */ (0,
|
|
1523
|
-
/* @__PURE__ */ (0,
|
|
1524
|
-
/* @__PURE__ */ (0,
|
|
2021
|
+
}) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2022
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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__ */ (0, import_jsx_runtime26.jsx)("div", { children: label }, label)) }),
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "polli:grid polli:grid-cols-7 polli:gap-1", children: dates.map((date) => {
|
|
1525
2024
|
const inCurrentMonth = date.getUTCMonth() === viewDate.getUTCMonth();
|
|
1526
2025
|
const selectable = isPeriodSelectable(
|
|
1527
2026
|
periodFromDate(value.granularity, date),
|
|
@@ -1539,7 +2038,7 @@ var PeriodPicker = ({
|
|
|
1539
2038
|
}
|
|
1540
2039
|
)}`;
|
|
1541
2040
|
const selected = value.granularity === "day" ? sameUtcDay(date, selectedWindow.start) : date >= selectedWindow.start && date < selectedWindow.end;
|
|
1542
|
-
return /* @__PURE__ */ (0,
|
|
2041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1543
2042
|
"button",
|
|
1544
2043
|
{
|
|
1545
2044
|
type: "button",
|
|
@@ -1547,7 +2046,7 @@ var PeriodPicker = ({
|
|
|
1547
2046
|
disabled: !selectable,
|
|
1548
2047
|
onClick: () => selectDate(date),
|
|
1549
2048
|
className: cn2(
|
|
1550
|
-
"polli:aspect-square polli:rounded-lg polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
2049
|
+
"polli-control polli:aspect-square polli:rounded-lg polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
1551
2050
|
!inCurrentMonth && "polli:text-gray-300",
|
|
1552
2051
|
sameUtcDay(date, today) && "polli:ring-1 polli:ring-theme-border",
|
|
1553
2052
|
selected ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-gray-700 polli:hover:bg-theme-bg-subtle",
|
|
@@ -1567,58 +2066,189 @@ var PeriodPicker = ({
|
|
|
1567
2066
|
);
|
|
1568
2067
|
};
|
|
1569
2068
|
|
|
1570
|
-
// src/primitives/
|
|
1571
|
-
var
|
|
1572
|
-
var
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
2069
|
+
// src/primitives/Prose.tsx
|
|
2070
|
+
var import_react_markdown2 = __toESM(require("react-markdown"), 1);
|
|
2071
|
+
var import_rehype_slug = __toESM(require("rehype-slug"), 1);
|
|
2072
|
+
var import_remark_gfm2 = __toESM(require("remark-gfm"), 1);
|
|
2073
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2074
|
+
var components2 = {
|
|
2075
|
+
h1: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2076
|
+
"h1",
|
|
2077
|
+
{
|
|
2078
|
+
className: "polli:mt-0 polli:mb-5 polli:break-words polli:font-heading polli:text-4xl polli:leading-none polli:text-theme-text-strong",
|
|
2079
|
+
...props
|
|
2080
|
+
}
|
|
2081
|
+
),
|
|
2082
|
+
h2: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2083
|
+
"h2",
|
|
2084
|
+
{
|
|
2085
|
+
className: "polli:mt-8 polli:mb-3 polli:break-words polli:font-subheading polli:text-2xl polli:leading-tight polli:text-theme-text-strong",
|
|
2086
|
+
...props
|
|
2087
|
+
}
|
|
2088
|
+
),
|
|
2089
|
+
h3: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2090
|
+
"h3",
|
|
2091
|
+
{
|
|
2092
|
+
className: "polli:mt-6 polli:mb-2 polli:break-words polli:font-subheading polli:text-xl polli:leading-tight polli:text-theme-text-strong",
|
|
2093
|
+
...props
|
|
2094
|
+
}
|
|
2095
|
+
),
|
|
2096
|
+
p: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:my-4 polli:leading-relaxed", ...props }),
|
|
2097
|
+
a: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2098
|
+
"a",
|
|
2099
|
+
{
|
|
2100
|
+
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",
|
|
2101
|
+
...props
|
|
2102
|
+
}
|
|
2103
|
+
),
|
|
2104
|
+
ul: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2105
|
+
"ul",
|
|
2106
|
+
{
|
|
2107
|
+
className: "polli:my-4 polli:list-disc polli:pl-6 polli:leading-relaxed",
|
|
2108
|
+
...props
|
|
2109
|
+
}
|
|
2110
|
+
),
|
|
2111
|
+
ol: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2112
|
+
"ol",
|
|
2113
|
+
{
|
|
2114
|
+
className: "polli:my-4 polli:list-decimal polli:pl-6 polli:leading-relaxed",
|
|
2115
|
+
...props
|
|
2116
|
+
}
|
|
2117
|
+
),
|
|
2118
|
+
blockquote: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2119
|
+
"blockquote",
|
|
2120
|
+
{
|
|
2121
|
+
className: "polli:my-4 polli:border-l-4 polli:border-theme-border polli:pl-4 polli:text-theme-text-soft",
|
|
2122
|
+
...props
|
|
2123
|
+
}
|
|
2124
|
+
),
|
|
2125
|
+
code: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2126
|
+
"code",
|
|
2127
|
+
{
|
|
2128
|
+
className: "polli:rounded polli:bg-theme-bg-active polli:px-1 polli:py-0.5 polli:font-pixel polli:text-sm",
|
|
2129
|
+
...props
|
|
2130
|
+
}
|
|
2131
|
+
),
|
|
2132
|
+
pre: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2133
|
+
"pre",
|
|
2134
|
+
{
|
|
2135
|
+
className: "polli:my-4 polli:overflow-x-auto polli:rounded-lg polli:bg-theme-bg-active polli:p-4",
|
|
2136
|
+
...props
|
|
2137
|
+
}
|
|
2138
|
+
),
|
|
2139
|
+
table: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2140
|
+
"table",
|
|
2141
|
+
{
|
|
2142
|
+
className: "polli:my-4 polli:w-full polli:border-collapse polli:text-sm",
|
|
2143
|
+
...props
|
|
2144
|
+
}
|
|
2145
|
+
),
|
|
2146
|
+
th: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2147
|
+
"th",
|
|
2148
|
+
{
|
|
2149
|
+
className: "polli:border polli:border-theme-border polli:px-3 polli:py-2 polli:text-left polli:font-semibold",
|
|
2150
|
+
...props
|
|
2151
|
+
}
|
|
2152
|
+
),
|
|
2153
|
+
td: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2154
|
+
"td",
|
|
2155
|
+
{
|
|
2156
|
+
className: "polli:border polli:border-theme-border polli:px-3 polli:py-2",
|
|
2157
|
+
...props
|
|
2158
|
+
}
|
|
2159
|
+
),
|
|
2160
|
+
hr: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("hr", { className: "polli:my-6 polli:border-theme-border", ...props })
|
|
1576
2161
|
};
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
2162
|
+
function Prose({ children, className }) {
|
|
2163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2164
|
+
"div",
|
|
2165
|
+
{
|
|
2166
|
+
className: cn2(
|
|
2167
|
+
"polli:font-body polli:text-theme-text-base polli:leading-relaxed",
|
|
2168
|
+
className
|
|
2169
|
+
),
|
|
2170
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2171
|
+
import_react_markdown2.default,
|
|
2172
|
+
{
|
|
2173
|
+
remarkPlugins: [import_remark_gfm2.default],
|
|
2174
|
+
rehypePlugins: [import_rehype_slug.default],
|
|
2175
|
+
components: components2,
|
|
2176
|
+
children
|
|
2177
|
+
}
|
|
2178
|
+
)
|
|
2179
|
+
}
|
|
2180
|
+
);
|
|
2181
|
+
}
|
|
1592
2182
|
|
|
1593
2183
|
// src/primitives/Section.tsx
|
|
1594
|
-
var
|
|
2184
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1595
2185
|
var Section = ({
|
|
1596
2186
|
title,
|
|
1597
2187
|
theme,
|
|
1598
2188
|
id,
|
|
1599
2189
|
framed = false,
|
|
2190
|
+
intro,
|
|
1600
2191
|
action,
|
|
1601
2192
|
actionClassName,
|
|
2193
|
+
panelClassName,
|
|
2194
|
+
titleClassName,
|
|
1602
2195
|
children,
|
|
1603
2196
|
className
|
|
1604
|
-
}) => /* @__PURE__ */ (0,
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
children: title
|
|
1612
|
-
}
|
|
2197
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2198
|
+
"section",
|
|
2199
|
+
{
|
|
2200
|
+
id,
|
|
2201
|
+
className: cn2(
|
|
2202
|
+
"polli:flex polli:scroll-mt-10 polli:flex-col polli:gap-4",
|
|
2203
|
+
className
|
|
1613
2204
|
),
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
2205
|
+
children: [
|
|
2206
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "polli:flex polli:flex-wrap polli:items-center polli:justify-between polli:gap-3 polli:px-1", children: [
|
|
2207
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2208
|
+
"h2",
|
|
2209
|
+
{
|
|
2210
|
+
"data-theme": theme,
|
|
2211
|
+
className: cn2(
|
|
2212
|
+
"polli:text-left polli:font-subheading polli:text-2xl polli:leading-tight polli:text-theme-text-strong",
|
|
2213
|
+
titleClassName
|
|
2214
|
+
),
|
|
2215
|
+
children: title
|
|
2216
|
+
}
|
|
2217
|
+
),
|
|
2218
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn2("polli:shrink-0", actionClassName), children: action })
|
|
2219
|
+
] }),
|
|
2220
|
+
framed ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2221
|
+
Surface,
|
|
2222
|
+
{
|
|
2223
|
+
variant: "panel",
|
|
2224
|
+
theme,
|
|
2225
|
+
className: cn2(
|
|
2226
|
+
"polli:flex polli:flex-col polli:gap-5",
|
|
2227
|
+
panelClassName
|
|
2228
|
+
),
|
|
2229
|
+
children: [
|
|
2230
|
+
intro && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "polli:max-w-2xl polli:text-theme-text-base", children: intro }),
|
|
2231
|
+
children
|
|
2232
|
+
]
|
|
2233
|
+
}
|
|
2234
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2235
|
+
intro && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2236
|
+
"div",
|
|
2237
|
+
{
|
|
2238
|
+
"data-theme": theme,
|
|
2239
|
+
className: "polli:max-w-2xl polli:text-theme-text-base",
|
|
2240
|
+
children: intro
|
|
2241
|
+
}
|
|
2242
|
+
),
|
|
2243
|
+
children
|
|
2244
|
+
] })
|
|
2245
|
+
]
|
|
2246
|
+
}
|
|
2247
|
+
);
|
|
1618
2248
|
|
|
1619
2249
|
// src/primitives/Slider.tsx
|
|
1620
|
-
var
|
|
1621
|
-
var
|
|
2250
|
+
var import_react10 = require("react");
|
|
2251
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1622
2252
|
var toNumber = (value) => {
|
|
1623
2253
|
if (typeof value === "number") return value;
|
|
1624
2254
|
if (typeof value !== "string" || value.trim() === "") return void 0;
|
|
@@ -1645,7 +2275,7 @@ var getProgressPercent = ({
|
|
|
1645
2275
|
(numericValue - numericMin) / (numericMax - numericMin) * 100
|
|
1646
2276
|
);
|
|
1647
2277
|
};
|
|
1648
|
-
var Slider = (0,
|
|
2278
|
+
var Slider = (0, import_react10.forwardRef)(
|
|
1649
2279
|
({ className, defaultValue, max, min, progress, style, value, ...props }, ref) => {
|
|
1650
2280
|
const progressPercent = getProgressPercent({
|
|
1651
2281
|
progress,
|
|
@@ -1658,7 +2288,7 @@ var Slider = (0, import_react8.forwardRef)(
|
|
|
1658
2288
|
...style,
|
|
1659
2289
|
...progressPercent === void 0 ? null : { "--polli-slider-progress": `${progressPercent}%` }
|
|
1660
2290
|
};
|
|
1661
|
-
return /* @__PURE__ */ (0,
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1662
2292
|
"input",
|
|
1663
2293
|
{
|
|
1664
2294
|
ref,
|
|
@@ -1676,7 +2306,7 @@ var Slider = (0, import_react8.forwardRef)(
|
|
|
1676
2306
|
);
|
|
1677
2307
|
|
|
1678
2308
|
// src/primitives/StatCard.tsx
|
|
1679
|
-
var
|
|
2309
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1680
2310
|
var StatCard = ({
|
|
1681
2311
|
label,
|
|
1682
2312
|
value,
|
|
@@ -1686,8 +2316,8 @@ var StatCard = ({
|
|
|
1686
2316
|
labelClassName,
|
|
1687
2317
|
valueClassName,
|
|
1688
2318
|
detailClassName
|
|
1689
|
-
}) => /* @__PURE__ */ (0,
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
2319
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { "data-theme": theme, className: cn2("polli:text-sm", className), children: [
|
|
2320
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1691
2321
|
"div",
|
|
1692
2322
|
{
|
|
1693
2323
|
className: cn2(
|
|
@@ -1697,7 +2327,7 @@ var StatCard = ({
|
|
|
1697
2327
|
children: label
|
|
1698
2328
|
}
|
|
1699
2329
|
),
|
|
1700
|
-
/* @__PURE__ */ (0,
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1701
2331
|
"div",
|
|
1702
2332
|
{
|
|
1703
2333
|
className: cn2(
|
|
@@ -1707,7 +2337,7 @@ var StatCard = ({
|
|
|
1707
2337
|
children: value
|
|
1708
2338
|
}
|
|
1709
2339
|
),
|
|
1710
|
-
detail && /* @__PURE__ */ (0,
|
|
2340
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1711
2341
|
"div",
|
|
1712
2342
|
{
|
|
1713
2343
|
className: cn2(
|
|
@@ -1720,11 +2350,11 @@ var StatCard = ({
|
|
|
1720
2350
|
] });
|
|
1721
2351
|
|
|
1722
2352
|
// src/primitives/Switch.tsx
|
|
1723
|
-
var
|
|
2353
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1724
2354
|
var trackClasses = {
|
|
1725
2355
|
off: "polli:bg-gray-200",
|
|
1726
|
-
on: "polli:bg-
|
|
1727
|
-
invalid: "polli:bg-
|
|
2356
|
+
on: "polli:bg-intent-success-bg-light",
|
|
2357
|
+
invalid: "polli:bg-intent-danger-bg-light"
|
|
1728
2358
|
};
|
|
1729
2359
|
var Switch = ({
|
|
1730
2360
|
checked,
|
|
@@ -1736,7 +2366,7 @@ var Switch = ({
|
|
|
1736
2366
|
}) => {
|
|
1737
2367
|
const effectiveStatus = status ?? (checked ? "on" : "off");
|
|
1738
2368
|
const resolvedAriaLabel = ariaLabel ?? (checked ? "Turn off toggle" : "Turn on toggle");
|
|
1739
|
-
return /* @__PURE__ */ (0,
|
|
2369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1740
2370
|
"button",
|
|
1741
2371
|
{
|
|
1742
2372
|
type: "button",
|
|
@@ -1746,11 +2376,11 @@ var Switch = ({
|
|
|
1746
2376
|
onClick: () => onChange(!checked),
|
|
1747
2377
|
disabled,
|
|
1748
2378
|
className: cn2(
|
|
1749
|
-
"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",
|
|
2379
|
+
"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",
|
|
1750
2380
|
trackClasses[effectiveStatus],
|
|
1751
2381
|
className
|
|
1752
2382
|
),
|
|
1753
|
-
children: /* @__PURE__ */ (0,
|
|
2383
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1754
2384
|
"span",
|
|
1755
2385
|
{
|
|
1756
2386
|
className: cn2(
|
|
@@ -1764,7 +2394,7 @@ var Switch = ({
|
|
|
1764
2394
|
};
|
|
1765
2395
|
|
|
1766
2396
|
// src/primitives/Table.tsx
|
|
1767
|
-
var
|
|
2397
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1768
2398
|
var alignClasses = {
|
|
1769
2399
|
left: "polli:text-left",
|
|
1770
2400
|
center: "polli:text-center",
|
|
@@ -1776,7 +2406,7 @@ var rowIntentClasses = {
|
|
|
1776
2406
|
warning: "polli:bg-intent-warning-bg-light/65",
|
|
1777
2407
|
danger: "polli:bg-intent-danger-bg-light/65"
|
|
1778
2408
|
};
|
|
1779
|
-
var Table = ({ className, ...rest }) => /* @__PURE__ */ (0,
|
|
2409
|
+
var Table = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1780
2410
|
"table",
|
|
1781
2411
|
{
|
|
1782
2412
|
...rest,
|
|
@@ -1786,7 +2416,7 @@ var Table = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime25
|
|
|
1786
2416
|
)
|
|
1787
2417
|
}
|
|
1788
2418
|
);
|
|
1789
|
-
var TableHead = ({ className, ...rest }) => /* @__PURE__ */ (0,
|
|
2419
|
+
var TableHead = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1790
2420
|
"thead",
|
|
1791
2421
|
{
|
|
1792
2422
|
...rest,
|
|
@@ -1796,7 +2426,7 @@ var TableHead = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_runti
|
|
|
1796
2426
|
)
|
|
1797
2427
|
}
|
|
1798
2428
|
);
|
|
1799
|
-
var TableBody = ({ className, ...rest }) => /* @__PURE__ */ (0,
|
|
2429
|
+
var TableBody = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1800
2430
|
"tbody",
|
|
1801
2431
|
{
|
|
1802
2432
|
...rest,
|
|
@@ -1807,7 +2437,7 @@ var TableRow = ({
|
|
|
1807
2437
|
intent = "default",
|
|
1808
2438
|
className,
|
|
1809
2439
|
...rest
|
|
1810
|
-
}) => /* @__PURE__ */ (0,
|
|
2440
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1811
2441
|
"tr",
|
|
1812
2442
|
{
|
|
1813
2443
|
...rest,
|
|
@@ -1827,9 +2457,9 @@ var TableHeaderCell = ({
|
|
|
1827
2457
|
children,
|
|
1828
2458
|
...rest
|
|
1829
2459
|
}) => {
|
|
1830
|
-
const content = /* @__PURE__ */ (0,
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1832
|
-
active && sortDirection && /* @__PURE__ */ (0,
|
|
2460
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
2461
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children }),
|
|
2462
|
+
active && sortDirection && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { "aria-hidden": "true", children: sortDirection === "asc" ? "^" : "v" })
|
|
1833
2463
|
] });
|
|
1834
2464
|
const classes = cn2(
|
|
1835
2465
|
"polli:px-3 polli:py-2 polli:font-bold polli:uppercase polli:tracking-wide",
|
|
@@ -1839,15 +2469,15 @@ var TableHeaderCell = ({
|
|
|
1839
2469
|
className
|
|
1840
2470
|
);
|
|
1841
2471
|
if (!onSort) {
|
|
1842
|
-
return /* @__PURE__ */ (0,
|
|
2472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("th", { ...rest, className: classes, children: content });
|
|
1843
2473
|
}
|
|
1844
|
-
return /* @__PURE__ */ (0,
|
|
2474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("th", { ...rest, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1845
2475
|
"button",
|
|
1846
2476
|
{
|
|
1847
2477
|
type: "button",
|
|
1848
2478
|
onClick: onSort,
|
|
1849
2479
|
className: cn2(
|
|
1850
|
-
"polli:inline-flex polli:w-full polli:items-center polli:gap-1 polli:bg-transparent polli:p-0 polli:font-bold polli:text-inherit",
|
|
2480
|
+
"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",
|
|
1851
2481
|
align === "right" && "polli:justify-end",
|
|
1852
2482
|
align === "center" && "polli:justify-center"
|
|
1853
2483
|
),
|
|
@@ -1861,7 +2491,7 @@ var TableCell = ({
|
|
|
1861
2491
|
muted = false,
|
|
1862
2492
|
className,
|
|
1863
2493
|
...rest
|
|
1864
|
-
}) => /* @__PURE__ */ (0,
|
|
2494
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1865
2495
|
"td",
|
|
1866
2496
|
{
|
|
1867
2497
|
...rest,
|
|
@@ -1875,6 +2505,30 @@ var TableCell = ({
|
|
|
1875
2505
|
}
|
|
1876
2506
|
);
|
|
1877
2507
|
|
|
2508
|
+
// src/primitives/Textarea.tsx
|
|
2509
|
+
var import_react11 = require("react");
|
|
2510
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2511
|
+
var Textarea = (0, import_react11.forwardRef)(
|
|
2512
|
+
({ className, error, rows = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2513
|
+
"textarea",
|
|
2514
|
+
{
|
|
2515
|
+
ref,
|
|
2516
|
+
rows,
|
|
2517
|
+
"data-error": error ? "true" : void 0,
|
|
2518
|
+
className: cn2(
|
|
2519
|
+
"polli-textarea polli:w-full polli:rounded-lg polli:border polli:px-3 polli:py-2",
|
|
2520
|
+
"polli:min-h-20 polli:resize-y polli:font-body polli:text-base",
|
|
2521
|
+
"polli:text-gray-950",
|
|
2522
|
+
"polli:transition-colors",
|
|
2523
|
+
"polli:disabled:opacity-50 polli:disabled:cursor-not-allowed",
|
|
2524
|
+
className
|
|
2525
|
+
),
|
|
2526
|
+
...props
|
|
2527
|
+
}
|
|
2528
|
+
)
|
|
2529
|
+
);
|
|
2530
|
+
Textarea.displayName = "Textarea";
|
|
2531
|
+
|
|
1878
2532
|
// src/theme.ts
|
|
1879
2533
|
var themes = [
|
|
1880
2534
|
"amber",
|
|
@@ -1904,21 +2558,28 @@ var themes = [
|
|
|
1904
2558
|
DiscordIcon,
|
|
1905
2559
|
DownloadIcon,
|
|
1906
2560
|
Dropdown,
|
|
2561
|
+
DropdownItem,
|
|
1907
2562
|
ExternalLinkButton,
|
|
1908
2563
|
ExternalLinkIcon,
|
|
1909
2564
|
Field,
|
|
2565
|
+
FileUpload,
|
|
1910
2566
|
GenApiIcon,
|
|
1911
2567
|
GitHubIcon,
|
|
1912
2568
|
IconButton,
|
|
1913
2569
|
ImageIcon,
|
|
1914
2570
|
InfoTip,
|
|
2571
|
+
InlineLink,
|
|
1915
2572
|
Input,
|
|
2573
|
+
LinkCard,
|
|
1916
2574
|
LockIcon,
|
|
1917
2575
|
MailIcon,
|
|
2576
|
+
Markdown,
|
|
1918
2577
|
McpIcon,
|
|
1919
2578
|
MenuIcon,
|
|
1920
2579
|
MultiSelect,
|
|
2580
|
+
NavItem,
|
|
1921
2581
|
PeriodPicker,
|
|
2582
|
+
Prose,
|
|
1922
2583
|
ScrollArea,
|
|
1923
2584
|
Section,
|
|
1924
2585
|
Slider,
|
|
@@ -1933,6 +2594,7 @@ var themes = [
|
|
|
1933
2594
|
TableHeaderCell,
|
|
1934
2595
|
TableRow,
|
|
1935
2596
|
TerminalIcon,
|
|
2597
|
+
Textarea,
|
|
1936
2598
|
TokensIcon,
|
|
1937
2599
|
Tooltip,
|
|
1938
2600
|
TrendUpIcon,
|