@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.js
CHANGED
|
@@ -201,13 +201,13 @@ var Alert = ({
|
|
|
201
201
|
// src/primitives/Button.tsx
|
|
202
202
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
203
203
|
var sizes = {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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"
|
|
207
207
|
};
|
|
208
208
|
var themeClasses = "polli:bg-theme-bg-active polli:text-theme-text-base polli:hover:bg-theme-bg-hover polli:transition-colors";
|
|
209
209
|
var intentClasses2 = {
|
|
210
|
-
danger: "polli:bg-intent-danger-bg-light polli:text-intent-danger-text polli:hover:bg-
|
|
210
|
+
danger: "polli:bg-intent-danger-bg-light polli:text-intent-danger-text polli:hover:bg-intent-danger-bg-hover polli:transition-colors"
|
|
211
211
|
};
|
|
212
212
|
var buttonClasses = ({
|
|
213
213
|
theme: _theme,
|
|
@@ -218,10 +218,10 @@ var buttonClasses = ({
|
|
|
218
218
|
}) => {
|
|
219
219
|
const colorClasses = intent ? intentClasses2[intent] : themeClasses;
|
|
220
220
|
return cn2(
|
|
221
|
-
"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",
|
|
222
222
|
disabled ? "polli:opacity-50 polli:cursor-not-allowed" : "polli:hover:filter polli:hover:brightness-105 polli:cursor-pointer",
|
|
223
223
|
colorClasses,
|
|
224
|
-
sizes[size || "
|
|
224
|
+
sizes[size || "md"],
|
|
225
225
|
className
|
|
226
226
|
);
|
|
227
227
|
};
|
|
@@ -240,6 +240,7 @@ function Button({
|
|
|
240
240
|
Component,
|
|
241
241
|
{
|
|
242
242
|
"data-theme": intent ? void 0 : theme,
|
|
243
|
+
"data-intent": intent,
|
|
243
244
|
className: buttonClasses({
|
|
244
245
|
theme,
|
|
245
246
|
intent,
|
|
@@ -312,8 +313,8 @@ var chipSizes = {
|
|
|
312
313
|
lg: "polli:px-3 polli:py-1 polli:text-sm"
|
|
313
314
|
};
|
|
314
315
|
var intentClasses3 = {
|
|
315
|
-
news: "polli:bg-
|
|
316
|
-
alpha: "polli:bg-
|
|
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",
|
|
317
318
|
neutral: "polli:border polli:border-gray-400/70 polli:bg-gray-100/80 polli:text-gray-900",
|
|
318
319
|
success: "polli:border polli:border-intent-success-border polli:bg-intent-success-bg-light polli:text-intent-success-text",
|
|
319
320
|
warning: "polli:border polli:border-intent-warning-border polli:bg-intent-warning-bg-light polli:text-intent-warning-text",
|
|
@@ -375,7 +376,7 @@ var Collapsible = ({
|
|
|
375
376
|
disabled,
|
|
376
377
|
onClick: onToggle,
|
|
377
378
|
className: cn2(
|
|
378
|
-
"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",
|
|
379
380
|
expanded ? "polli:rounded-t-lg" : "polli:rounded-lg",
|
|
380
381
|
!disabled && hoverClassName,
|
|
381
382
|
focusClassName,
|
|
@@ -452,7 +453,7 @@ var Tooltip = ({
|
|
|
452
453
|
}
|
|
453
454
|
};
|
|
454
455
|
const triggerClassName = cn2(
|
|
455
|
-
"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",
|
|
456
457
|
className
|
|
457
458
|
);
|
|
458
459
|
const cursorClass = displayContents ? "polli:contents" : "polli:cursor-help";
|
|
@@ -568,6 +569,7 @@ function CopyButton({
|
|
|
568
569
|
type: "button",
|
|
569
570
|
onClick: handleCopy,
|
|
570
571
|
className: cn2(
|
|
572
|
+
"polli-control",
|
|
571
573
|
typeof className === "function" ? className(copied) : className
|
|
572
574
|
),
|
|
573
575
|
children: typeof children === "function" ? children(copied) : children
|
|
@@ -587,6 +589,7 @@ function CopyButton({
|
|
|
587
589
|
// src/primitives/Dialog.tsx
|
|
588
590
|
import { Dialog as ArkDialog } from "@ark-ui/react/dialog";
|
|
589
591
|
import { Portal } from "@ark-ui/react/portal";
|
|
592
|
+
import { useRef as useRef3 } from "react";
|
|
590
593
|
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
591
594
|
var sizeClasses = {
|
|
592
595
|
sm: "polli:max-w-md",
|
|
@@ -610,69 +613,75 @@ var Dialog = ({
|
|
|
610
613
|
positionerClassName,
|
|
611
614
|
contentClassName,
|
|
612
615
|
children
|
|
613
|
-
}) =>
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
children: trigger
|
|
625
|
-
}
|
|
626
|
-
),
|
|
627
|
-
/* @__PURE__ */ jsxs4(Portal, { children: [
|
|
628
|
-
showBackdrop && /* @__PURE__ */ jsx9(
|
|
629
|
-
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,
|
|
630
627
|
{
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
)
|
|
628
|
+
asChild: triggerAsChild,
|
|
629
|
+
className: triggerClassName,
|
|
630
|
+
children: trigger
|
|
635
631
|
}
|
|
636
632
|
),
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
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
|
|
665
662
|
),
|
|
666
|
-
children
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
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
|
+
};
|
|
676
685
|
var DialogTitle = ArkDialog.Title;
|
|
677
686
|
|
|
678
687
|
// src/primitives/Dropdown.tsx
|
|
@@ -680,7 +689,7 @@ import { Popover } from "@ark-ui/react/popover";
|
|
|
680
689
|
import { Portal as Portal2 } from "@ark-ui/react/portal";
|
|
681
690
|
import { useState as useState3 } from "react";
|
|
682
691
|
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
683
|
-
var DEFAULT_PANEL = "polli:rounded-lg polli:border polli:border-theme-border polli:bg-
|
|
692
|
+
var DEFAULT_PANEL = "polli:rounded-lg polli:border polli:border-theme-border polli:bg-theme-bg-pale polli:shadow-lg";
|
|
684
693
|
var Dropdown = ({
|
|
685
694
|
theme,
|
|
686
695
|
trigger,
|
|
@@ -688,7 +697,6 @@ var Dropdown = ({
|
|
|
688
697
|
align = "start",
|
|
689
698
|
open: openProp,
|
|
690
699
|
onOpenChange,
|
|
691
|
-
panelClassName,
|
|
692
700
|
className
|
|
693
701
|
}) => {
|
|
694
702
|
const [internalOpen, setInternalOpen] = useState3(false);
|
|
@@ -714,7 +722,7 @@ var Dropdown = ({
|
|
|
714
722
|
"data-theme": theme,
|
|
715
723
|
className: cn2(
|
|
716
724
|
"polli:z-50 polli:overflow-hidden polli:focus:outline-none",
|
|
717
|
-
|
|
725
|
+
DEFAULT_PANEL,
|
|
718
726
|
className
|
|
719
727
|
),
|
|
720
728
|
children: typeof children === "function" ? children(() => setOpen(false)) : children
|
|
@@ -725,8 +733,31 @@ var Dropdown = ({
|
|
|
725
733
|
);
|
|
726
734
|
};
|
|
727
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
|
+
|
|
728
759
|
// src/primitives/icons/index.tsx
|
|
729
|
-
import { jsx as
|
|
760
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
730
761
|
var strokeProps = {
|
|
731
762
|
fill: "none",
|
|
732
763
|
stroke: "currentColor",
|
|
@@ -736,25 +767,25 @@ var strokeProps = {
|
|
|
736
767
|
};
|
|
737
768
|
function AppIcon(props) {
|
|
738
769
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ jsx12("rect", { x: "2", y: "4", width: "20", height: "14", rx: "2" }),
|
|
771
|
+
/* @__PURE__ */ jsx12("path", { d: "M2 20h20" })
|
|
741
772
|
] });
|
|
742
773
|
}
|
|
743
774
|
function BeakerIcon(props) {
|
|
744
775
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
/* @__PURE__ */
|
|
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" })
|
|
748
779
|
] });
|
|
749
780
|
}
|
|
750
781
|
function BookIcon(props) {
|
|
751
782
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
/* @__PURE__ */
|
|
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" })
|
|
754
785
|
] });
|
|
755
786
|
}
|
|
756
787
|
function CheckIcon(props) {
|
|
757
|
-
return /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ jsx12(
|
|
758
789
|
"svg",
|
|
759
790
|
{
|
|
760
791
|
"aria-hidden": "true",
|
|
@@ -762,24 +793,24 @@ function CheckIcon(props) {
|
|
|
762
793
|
...strokeProps,
|
|
763
794
|
strokeWidth: 2.5,
|
|
764
795
|
...props,
|
|
765
|
-
children: /* @__PURE__ */
|
|
796
|
+
children: /* @__PURE__ */ jsx12("polyline", { points: "20 6 9 17 4 12" })
|
|
766
797
|
}
|
|
767
798
|
);
|
|
768
799
|
}
|
|
769
800
|
function ClipboardIcon(props) {
|
|
770
801
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
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" })
|
|
773
804
|
] });
|
|
774
805
|
}
|
|
775
806
|
function ClockIcon(props) {
|
|
776
807
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ jsx12("circle", { cx: "12", cy: "12", r: "9" }),
|
|
809
|
+
/* @__PURE__ */ jsx12("path", { d: "M12 7v5l3 2" })
|
|
779
810
|
] });
|
|
780
811
|
}
|
|
781
812
|
function DiscordIcon(props) {
|
|
782
|
-
return /* @__PURE__ */
|
|
813
|
+
return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx12(
|
|
783
814
|
"path",
|
|
784
815
|
{
|
|
785
816
|
fill: "currentColor",
|
|
@@ -789,22 +820,22 @@ function DiscordIcon(props) {
|
|
|
789
820
|
}
|
|
790
821
|
function DownloadIcon(props) {
|
|
791
822
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
792
|
-
/* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
794
|
-
/* @__PURE__ */
|
|
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" })
|
|
795
826
|
] });
|
|
796
827
|
}
|
|
797
828
|
function ExternalLinkIcon(props) {
|
|
798
|
-
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" }) });
|
|
799
830
|
}
|
|
800
831
|
function GenApiIcon(props) {
|
|
801
832
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ jsx12("path", { d: "m8 3 4 1.5L16 3v18l-4-1.5L8 21z" }),
|
|
834
|
+
/* @__PURE__ */ jsx12("path", { d: "M8 3v18M16 3v18" })
|
|
804
835
|
] });
|
|
805
836
|
}
|
|
806
837
|
function GitHubIcon(props) {
|
|
807
|
-
return /* @__PURE__ */
|
|
838
|
+
return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx12(
|
|
808
839
|
"path",
|
|
809
840
|
{
|
|
810
841
|
fill: "currentColor",
|
|
@@ -814,65 +845,65 @@ function GitHubIcon(props) {
|
|
|
814
845
|
}
|
|
815
846
|
function ImageIcon(props) {
|
|
816
847
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
817
|
-
/* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */
|
|
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" })
|
|
820
851
|
] });
|
|
821
852
|
}
|
|
822
853
|
function LockIcon(props) {
|
|
823
854
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
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" })
|
|
826
857
|
] });
|
|
827
858
|
}
|
|
828
859
|
function MailIcon(props) {
|
|
829
860
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
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" })
|
|
832
863
|
] });
|
|
833
864
|
}
|
|
834
865
|
function McpIcon(props) {
|
|
835
866
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
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" })
|
|
839
870
|
] });
|
|
840
871
|
}
|
|
841
872
|
function MenuIcon(props) {
|
|
842
|
-
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" }) });
|
|
843
874
|
}
|
|
844
875
|
function TerminalIcon(props) {
|
|
845
876
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ jsx12("polyline", { points: "4 8 8 12 4 16" }),
|
|
878
|
+
/* @__PURE__ */ jsx12("line", { x1: "12", y1: "20", x2: "20", y2: "20" })
|
|
848
879
|
] });
|
|
849
880
|
}
|
|
850
881
|
function TokensIcon(props) {
|
|
851
|
-
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" }) });
|
|
852
883
|
}
|
|
853
884
|
function TrendUpIcon(props) {
|
|
854
885
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
855
|
-
/* @__PURE__ */
|
|
856
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ jsx12("polyline", { points: "3 17 9 11 13 15 21 7" }),
|
|
887
|
+
/* @__PURE__ */ jsx12("polyline", { points: "15 7 21 7 21 13" })
|
|
857
888
|
] });
|
|
858
889
|
}
|
|
859
890
|
function WalletIcon(props) {
|
|
860
891
|
return /* @__PURE__ */ jsxs6("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
/* @__PURE__ */
|
|
863
|
-
/* @__PURE__ */
|
|
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" })
|
|
864
895
|
] });
|
|
865
896
|
}
|
|
866
897
|
function XIcon(props) {
|
|
867
|
-
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" }) });
|
|
868
899
|
}
|
|
869
900
|
|
|
870
901
|
// src/primitives/ExternalLinkButton.tsx
|
|
871
|
-
import { jsx as
|
|
902
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
872
903
|
var ExternalLinkButton = ({
|
|
873
904
|
theme,
|
|
874
905
|
href,
|
|
875
|
-
size = "
|
|
906
|
+
size = "md",
|
|
876
907
|
className,
|
|
877
908
|
children
|
|
878
909
|
}) => /* @__PURE__ */ jsxs7(
|
|
@@ -886,8 +917,8 @@ var ExternalLinkButton = ({
|
|
|
886
917
|
size,
|
|
887
918
|
className: cn2("polli:gap-2", className),
|
|
888
919
|
children: [
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ jsx13("span", { children }),
|
|
921
|
+
/* @__PURE__ */ jsx13(
|
|
891
922
|
ExternalLinkIcon,
|
|
892
923
|
{
|
|
893
924
|
className: "polli:h-4 polli:w-4 polli:shrink-0 polli:opacity-60",
|
|
@@ -901,10 +932,48 @@ var ExternalLinkButton = ({
|
|
|
901
932
|
// src/primitives/Field.tsx
|
|
902
933
|
import { Field } from "@ark-ui/react/field";
|
|
903
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
|
+
|
|
904
973
|
// src/primitives/IconButton.tsx
|
|
905
|
-
import { jsx as
|
|
974
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
906
975
|
var intentClasses4 = {
|
|
907
|
-
danger: "polli:bg-intent-danger-bg-light polli:hover:bg-
|
|
976
|
+
danger: "polli:bg-intent-danger-bg-light polli:hover:bg-intent-danger-bg-hover polli:text-intent-danger-text"
|
|
908
977
|
};
|
|
909
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";
|
|
910
979
|
var IconButton = ({
|
|
@@ -913,15 +982,16 @@ var IconButton = ({
|
|
|
913
982
|
onClick,
|
|
914
983
|
children,
|
|
915
984
|
className
|
|
916
|
-
}) => /* @__PURE__ */
|
|
985
|
+
}) => /* @__PURE__ */ jsx14(
|
|
917
986
|
"button",
|
|
918
987
|
{
|
|
919
988
|
type: "button",
|
|
920
989
|
onClick,
|
|
921
990
|
title,
|
|
922
991
|
"aria-label": title,
|
|
992
|
+
"data-intent": intent,
|
|
923
993
|
className: cn2(
|
|
924
|
-
"polli:inline-flex polli:h-6 polli:w-6 polli:cursor-pointer polli:items-center polli:justify-center polli:rounded polli:transition-colors",
|
|
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",
|
|
925
995
|
intent ? intentClasses4[intent] : defaultClasses,
|
|
926
996
|
className
|
|
927
997
|
),
|
|
@@ -929,26 +999,252 @@ var IconButton = ({
|
|
|
929
999
|
}
|
|
930
1000
|
);
|
|
931
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
|
+
|
|
932
1183
|
// src/primitives/InfoTip.tsx
|
|
933
|
-
import { jsx as
|
|
1184
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
934
1185
|
var InfoTip = ({
|
|
935
1186
|
text,
|
|
936
1187
|
content,
|
|
937
1188
|
label = "More info"
|
|
938
|
-
}) => /* @__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
|
+
}
|
|
939
1233
|
|
|
940
1234
|
// src/primitives/Input.tsx
|
|
941
1235
|
import { forwardRef } from "react";
|
|
942
|
-
import { jsx as
|
|
1236
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
943
1237
|
var Input = forwardRef(
|
|
944
|
-
({ className, error, hideNumberSteppers, ...props }, ref) => /* @__PURE__ */
|
|
1238
|
+
({ className, error, hideNumberSteppers, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
945
1239
|
"input",
|
|
946
1240
|
{
|
|
947
1241
|
ref,
|
|
1242
|
+
"data-error": error ? "true" : void 0,
|
|
948
1243
|
className: cn2(
|
|
949
|
-
"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",
|
|
950
1247
|
"polli:disabled:opacity-50 polli:disabled:cursor-not-allowed",
|
|
951
|
-
error ? "polli:border-red-400" : "polli:border-gray-300",
|
|
952
1248
|
hideNumberSteppers && "polli-input-number-clean",
|
|
953
1249
|
className
|
|
954
1250
|
),
|
|
@@ -957,14 +1253,150 @@ var Input = forwardRef(
|
|
|
957
1253
|
)
|
|
958
1254
|
);
|
|
959
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
|
+
|
|
960
1392
|
// src/primitives/ScrollArea.tsx
|
|
961
1393
|
import {
|
|
962
1394
|
forwardRef as forwardRef2,
|
|
963
1395
|
useCallback,
|
|
964
|
-
useEffect as
|
|
965
|
-
useRef as
|
|
1396
|
+
useEffect as useEffect4,
|
|
1397
|
+
useRef as useRef5
|
|
966
1398
|
} from "react";
|
|
967
|
-
import { jsx as
|
|
1399
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
968
1400
|
var axisClasses = {
|
|
969
1401
|
y: "polli:overflow-y-auto polli:overflow-x-hidden",
|
|
970
1402
|
x: "polli:overflow-x-auto polli:overflow-y-hidden"
|
|
@@ -975,7 +1407,7 @@ function assignRef(ref, value) {
|
|
|
975
1407
|
}
|
|
976
1408
|
var ScrollArea = forwardRef2(
|
|
977
1409
|
({ theme, axis = "y", className, children, ...rest }, externalRef) => {
|
|
978
|
-
const innerRef =
|
|
1410
|
+
const innerRef = useRef5(null);
|
|
979
1411
|
const setRef = useCallback(
|
|
980
1412
|
(node) => {
|
|
981
1413
|
innerRef.current = node;
|
|
@@ -983,7 +1415,7 @@ var ScrollArea = forwardRef2(
|
|
|
983
1415
|
},
|
|
984
1416
|
[externalRef]
|
|
985
1417
|
);
|
|
986
|
-
|
|
1418
|
+
useEffect4(() => {
|
|
987
1419
|
const element = innerRef.current;
|
|
988
1420
|
if (!element) return;
|
|
989
1421
|
let hideTimer = null;
|
|
@@ -1034,7 +1466,7 @@ var ScrollArea = forwardRef2(
|
|
|
1034
1466
|
element.removeEventListener("focusout", scheduleHide);
|
|
1035
1467
|
};
|
|
1036
1468
|
}, []);
|
|
1037
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ jsx22(
|
|
1038
1470
|
"div",
|
|
1039
1471
|
{
|
|
1040
1472
|
...rest,
|
|
@@ -1053,9 +1485,9 @@ var ScrollArea = forwardRef2(
|
|
|
1053
1485
|
ScrollArea.displayName = "ScrollArea";
|
|
1054
1486
|
|
|
1055
1487
|
// src/primitives/MultiSelect.tsx
|
|
1056
|
-
import { jsx as
|
|
1057
|
-
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";
|
|
1058
|
-
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";
|
|
1059
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";
|
|
1060
1492
|
var MultiSelect = ({
|
|
1061
1493
|
options,
|
|
@@ -1078,16 +1510,16 @@ var MultiSelect = ({
|
|
|
1078
1510
|
};
|
|
1079
1511
|
const selectAll = () => onChange([]);
|
|
1080
1512
|
const displayText = disabled ? disabledText : isAllSelected ? "All" : `${selected.length} selected`;
|
|
1081
|
-
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;
|
|
1082
1514
|
if (disabled) {
|
|
1083
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ jsxs11(
|
|
1084
1516
|
"div",
|
|
1085
1517
|
{
|
|
1086
1518
|
"data-theme": theme,
|
|
1087
1519
|
className: "polli:group polli:relative polli:flex polli:items-center polli:gap-2",
|
|
1088
1520
|
children: [
|
|
1089
1521
|
labelNode,
|
|
1090
|
-
/* @__PURE__ */
|
|
1522
|
+
/* @__PURE__ */ jsxs11(
|
|
1091
1523
|
"button",
|
|
1092
1524
|
{
|
|
1093
1525
|
type: "button",
|
|
@@ -1097,8 +1529,8 @@ var MultiSelect = ({
|
|
|
1097
1529
|
"polli:cursor-not-allowed polli:border-theme-border polli:bg-theme-bg-subtle polli:opacity-60"
|
|
1098
1530
|
),
|
|
1099
1531
|
children: [
|
|
1100
|
-
/* @__PURE__ */
|
|
1101
|
-
/* @__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(
|
|
1102
1534
|
ChevronIcon,
|
|
1103
1535
|
{
|
|
1104
1536
|
expanded: false,
|
|
@@ -1108,25 +1540,25 @@ var MultiSelect = ({
|
|
|
1108
1540
|
]
|
|
1109
1541
|
}
|
|
1110
1542
|
),
|
|
1111
|
-
/* @__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" })
|
|
1112
1544
|
]
|
|
1113
1545
|
}
|
|
1114
1546
|
);
|
|
1115
1547
|
}
|
|
1116
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ jsxs11(
|
|
1117
1549
|
"div",
|
|
1118
1550
|
{
|
|
1119
1551
|
"data-theme": theme,
|
|
1120
1552
|
className: "polli:flex polli:items-center polli:gap-2",
|
|
1121
1553
|
children: [
|
|
1122
1554
|
labelNode,
|
|
1123
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ jsx23(
|
|
1124
1556
|
Dropdown,
|
|
1125
1557
|
{
|
|
1126
1558
|
theme,
|
|
1127
1559
|
align,
|
|
1128
1560
|
className: "polli:min-w-[320px]",
|
|
1129
|
-
trigger: (open) => /* @__PURE__ */
|
|
1561
|
+
trigger: (open) => /* @__PURE__ */ jsxs11(
|
|
1130
1562
|
"button",
|
|
1131
1563
|
{
|
|
1132
1564
|
type: "button",
|
|
@@ -1135,7 +1567,7 @@ var MultiSelect = ({
|
|
|
1135
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"
|
|
1136
1568
|
),
|
|
1137
1569
|
children: [
|
|
1138
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx23(
|
|
1139
1571
|
"span",
|
|
1140
1572
|
{
|
|
1141
1573
|
className: cn2(
|
|
@@ -1145,7 +1577,7 @@ var MultiSelect = ({
|
|
|
1145
1577
|
children: displayText
|
|
1146
1578
|
}
|
|
1147
1579
|
),
|
|
1148
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ jsx23(
|
|
1149
1581
|
ChevronIcon,
|
|
1150
1582
|
{
|
|
1151
1583
|
expanded: open,
|
|
@@ -1158,8 +1590,8 @@ var MultiSelect = ({
|
|
|
1158
1590
|
]
|
|
1159
1591
|
}
|
|
1160
1592
|
),
|
|
1161
|
-
children: /* @__PURE__ */
|
|
1162
|
-
/* @__PURE__ */
|
|
1593
|
+
children: /* @__PURE__ */ jsxs11(ScrollArea, { theme, className: "polli:max-h-64", children: [
|
|
1594
|
+
/* @__PURE__ */ jsxs11(
|
|
1163
1595
|
"button",
|
|
1164
1596
|
{
|
|
1165
1597
|
type: "button",
|
|
@@ -1169,7 +1601,7 @@ var MultiSelect = ({
|
|
|
1169
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"
|
|
1170
1602
|
),
|
|
1171
1603
|
children: [
|
|
1172
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ jsx23(
|
|
1173
1605
|
"span",
|
|
1174
1606
|
{
|
|
1175
1607
|
className: cn2(
|
|
@@ -1185,7 +1617,7 @@ var MultiSelect = ({
|
|
|
1185
1617
|
),
|
|
1186
1618
|
options.map((opt) => {
|
|
1187
1619
|
const isChecked = selected.includes(opt.value);
|
|
1188
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsxs11(
|
|
1189
1621
|
"button",
|
|
1190
1622
|
{
|
|
1191
1623
|
type: "button",
|
|
@@ -1195,7 +1627,7 @@ var MultiSelect = ({
|
|
|
1195
1627
|
isChecked ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-theme-text-base polli:hover:bg-theme-bg-subtle"
|
|
1196
1628
|
),
|
|
1197
1629
|
children: [
|
|
1198
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ jsx23(
|
|
1199
1631
|
"span",
|
|
1200
1632
|
{
|
|
1201
1633
|
className: cn2(
|
|
@@ -1205,7 +1637,7 @@ var MultiSelect = ({
|
|
|
1205
1637
|
children: isChecked && "\u2713"
|
|
1206
1638
|
}
|
|
1207
1639
|
),
|
|
1208
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ jsx23("span", { className: "polli:whitespace-nowrap", children: opt.label })
|
|
1209
1641
|
]
|
|
1210
1642
|
},
|
|
1211
1643
|
opt.value
|
|
@@ -1219,26 +1651,74 @@ var MultiSelect = ({
|
|
|
1219
1651
|
);
|
|
1220
1652
|
};
|
|
1221
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
|
+
|
|
1222
1688
|
// src/primitives/PeriodPicker.tsx
|
|
1223
|
-
import { useEffect as
|
|
1689
|
+
import { useEffect as useEffect5, useMemo, useState as useState5 } from "react";
|
|
1224
1690
|
|
|
1225
1691
|
// src/primitives/TabButton.tsx
|
|
1226
|
-
import { jsx as
|
|
1692
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1227
1693
|
var sizeClasses2 = {
|
|
1228
|
-
|
|
1229
|
-
|
|
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
|
+
}
|
|
1230
1708
|
};
|
|
1231
1709
|
var TabButton = ({
|
|
1232
1710
|
theme,
|
|
1233
1711
|
active,
|
|
1234
1712
|
onClick,
|
|
1235
1713
|
children,
|
|
1236
|
-
size = "
|
|
1714
|
+
size = "md",
|
|
1715
|
+
variant = "default",
|
|
1237
1716
|
ariaLabel,
|
|
1238
1717
|
disabled = false,
|
|
1239
1718
|
className
|
|
1240
1719
|
}) => {
|
|
1241
|
-
|
|
1720
|
+
const classes = variantClasses2[variant];
|
|
1721
|
+
return /* @__PURE__ */ jsx25(
|
|
1242
1722
|
"button",
|
|
1243
1723
|
{
|
|
1244
1724
|
type: "button",
|
|
@@ -1248,8 +1728,9 @@ var TabButton = ({
|
|
|
1248
1728
|
"aria-pressed": active,
|
|
1249
1729
|
disabled,
|
|
1250
1730
|
className: cn2(
|
|
1251
|
-
"polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:
|
|
1252
|
-
|
|
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,
|
|
1253
1734
|
disabled && "polli:cursor-not-allowed polli:opacity-50",
|
|
1254
1735
|
sizeClasses2[size],
|
|
1255
1736
|
className
|
|
@@ -1260,7 +1741,7 @@ var TabButton = ({
|
|
|
1260
1741
|
};
|
|
1261
1742
|
|
|
1262
1743
|
// src/primitives/PeriodPicker.tsx
|
|
1263
|
-
import { Fragment as Fragment2, jsx as
|
|
1744
|
+
import { Fragment as Fragment2, jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1264
1745
|
var WEEKDAY_LABELS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
1265
1746
|
var MONTH_LABELS = [
|
|
1266
1747
|
"Jan",
|
|
@@ -1276,7 +1757,7 @@ var MONTH_LABELS = [
|
|
|
1276
1757
|
"Nov",
|
|
1277
1758
|
"Dec"
|
|
1278
1759
|
];
|
|
1279
|
-
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";
|
|
1280
1761
|
function addUtcMonths2(date, months) {
|
|
1281
1762
|
return new Date(
|
|
1282
1763
|
Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + months, 1)
|
|
@@ -1313,10 +1794,10 @@ var PeriodPicker = ({
|
|
|
1313
1794
|
minDate = /* @__PURE__ */ new Date(0),
|
|
1314
1795
|
maxDate
|
|
1315
1796
|
}) => {
|
|
1316
|
-
const [open, setOpen] =
|
|
1317
|
-
const [viewDate, setViewDate] =
|
|
1797
|
+
const [open, setOpen] = useState5(false);
|
|
1798
|
+
const [viewDate, setViewDate] = useState5(() => periodDate(value));
|
|
1318
1799
|
const { granularity, period } = value;
|
|
1319
|
-
|
|
1800
|
+
useEffect5(() => {
|
|
1320
1801
|
setViewDate(periodDate({ granularity, period }));
|
|
1321
1802
|
}, [granularity, period]);
|
|
1322
1803
|
const dates = useMemo(() => monthGridDates(viewDate), [viewDate]);
|
|
@@ -1340,14 +1821,14 @@ var PeriodPicker = ({
|
|
|
1340
1821
|
month: "long",
|
|
1341
1822
|
year: "numeric"
|
|
1342
1823
|
});
|
|
1343
|
-
return /* @__PURE__ */
|
|
1824
|
+
return /* @__PURE__ */ jsxs13(
|
|
1344
1825
|
"div",
|
|
1345
1826
|
{
|
|
1346
1827
|
"data-theme": theme,
|
|
1347
1828
|
className: "polli:flex polli:flex-wrap polli:items-center polli:gap-2",
|
|
1348
1829
|
children: [
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
(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(
|
|
1351
1832
|
TabButton,
|
|
1352
1833
|
{
|
|
1353
1834
|
active: value.granularity === granularity2,
|
|
@@ -1357,33 +1838,33 @@ var PeriodPicker = ({
|
|
|
1357
1838
|
granularity2
|
|
1358
1839
|
)
|
|
1359
1840
|
) }),
|
|
1360
|
-
/* @__PURE__ */
|
|
1841
|
+
/* @__PURE__ */ jsxs13(
|
|
1361
1842
|
Dropdown,
|
|
1362
1843
|
{
|
|
1363
1844
|
theme,
|
|
1364
1845
|
open,
|
|
1365
1846
|
onOpenChange: setOpen,
|
|
1366
1847
|
className: "polli:w-[304px] polli:rounded-xl polli:p-3",
|
|
1367
|
-
trigger: (isOpen) => /* @__PURE__ */
|
|
1848
|
+
trigger: (isOpen) => /* @__PURE__ */ jsxs13(
|
|
1368
1849
|
"button",
|
|
1369
1850
|
{
|
|
1370
1851
|
type: "button",
|
|
1371
1852
|
"aria-label": `Select period, current ${formatPeriodLabel(value)}`,
|
|
1372
1853
|
className: cn2(
|
|
1373
|
-
"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",
|
|
1374
1855
|
"polli:border-theme-border polli:bg-theme-bg-subtle polli:text-theme-text-base",
|
|
1375
1856
|
"polli:transition-all polli:duration-200 polli:ease-out polli:hover:bg-theme-bg-pale",
|
|
1376
1857
|
isOpen && "polli:bg-theme-bg-active polli:text-theme-text-strong polli:shadow-sm"
|
|
1377
1858
|
),
|
|
1378
1859
|
children: [
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ jsx26("span", { children: formatPeriodLabel(value) }),
|
|
1861
|
+
/* @__PURE__ */ jsx26(ChevronIcon, { expanded: isOpen })
|
|
1381
1862
|
]
|
|
1382
1863
|
}
|
|
1383
1864
|
),
|
|
1384
1865
|
children: [
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ jsxs13("div", { className: "polli:mb-3 polli:flex polli:items-center polli:justify-between", children: [
|
|
1867
|
+
/* @__PURE__ */ jsx26(
|
|
1387
1868
|
"button",
|
|
1388
1869
|
{
|
|
1389
1870
|
type: "button",
|
|
@@ -1397,8 +1878,8 @@ var PeriodPicker = ({
|
|
|
1397
1878
|
children: "<"
|
|
1398
1879
|
}
|
|
1399
1880
|
),
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
/* @__PURE__ */
|
|
1881
|
+
/* @__PURE__ */ jsx26("div", { className: "polli:text-sm polli:font-bold polli:text-theme-text-base", children: viewLabel }),
|
|
1882
|
+
/* @__PURE__ */ jsx26(
|
|
1402
1883
|
"button",
|
|
1403
1884
|
{
|
|
1404
1885
|
type: "button",
|
|
@@ -1413,7 +1894,7 @@ var PeriodPicker = ({
|
|
|
1413
1894
|
}
|
|
1414
1895
|
)
|
|
1415
1896
|
] }),
|
|
1416
|
-
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) => {
|
|
1417
1898
|
const date = new Date(
|
|
1418
1899
|
Date.UTC(
|
|
1419
1900
|
viewDate.getUTCFullYear(),
|
|
@@ -1432,7 +1913,7 @@ var PeriodPicker = ({
|
|
|
1432
1913
|
year: "numeric"
|
|
1433
1914
|
});
|
|
1434
1915
|
const selected = date.getUTCFullYear() === selectedWindow.start.getUTCFullYear() && date.getUTCMonth() === selectedWindow.start.getUTCMonth();
|
|
1435
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ jsx26(
|
|
1436
1917
|
"button",
|
|
1437
1918
|
{
|
|
1438
1919
|
type: "button",
|
|
@@ -1440,7 +1921,7 @@ var PeriodPicker = ({
|
|
|
1440
1921
|
disabled: !selectable,
|
|
1441
1922
|
onClick: () => selectDate(date),
|
|
1442
1923
|
className: cn2(
|
|
1443
|
-
"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",
|
|
1444
1925
|
selected ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-gray-700 polli:hover:bg-theme-bg-subtle",
|
|
1445
1926
|
!selectable && "polli:cursor-not-allowed polli:text-gray-300 polli:hover:bg-transparent"
|
|
1446
1927
|
),
|
|
@@ -1448,9 +1929,9 @@ var PeriodPicker = ({
|
|
|
1448
1929
|
},
|
|
1449
1930
|
label
|
|
1450
1931
|
);
|
|
1451
|
-
}) }) : /* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1453
|
-
/* @__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) => {
|
|
1454
1935
|
const inCurrentMonth = date.getUTCMonth() === viewDate.getUTCMonth();
|
|
1455
1936
|
const selectable = isPeriodSelectable(
|
|
1456
1937
|
periodFromDate(value.granularity, date),
|
|
@@ -1468,7 +1949,7 @@ var PeriodPicker = ({
|
|
|
1468
1949
|
}
|
|
1469
1950
|
)}`;
|
|
1470
1951
|
const selected = value.granularity === "day" ? sameUtcDay(date, selectedWindow.start) : date >= selectedWindow.start && date < selectedWindow.end;
|
|
1471
|
-
return /* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ jsx26(
|
|
1472
1953
|
"button",
|
|
1473
1954
|
{
|
|
1474
1955
|
type: "button",
|
|
@@ -1476,7 +1957,7 @@ var PeriodPicker = ({
|
|
|
1476
1957
|
disabled: !selectable,
|
|
1477
1958
|
onClick: () => selectDate(date),
|
|
1478
1959
|
className: cn2(
|
|
1479
|
-
"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",
|
|
1480
1961
|
!inCurrentMonth && "polli:text-gray-300",
|
|
1481
1962
|
sameUtcDay(date, today) && "polli:ring-1 polli:ring-theme-border",
|
|
1482
1963
|
selected ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-gray-700 polli:hover:bg-theme-bg-subtle",
|
|
@@ -1496,58 +1977,189 @@ var PeriodPicker = ({
|
|
|
1496
1977
|
);
|
|
1497
1978
|
};
|
|
1498
1979
|
|
|
1499
|
-
// src/primitives/
|
|
1500
|
-
import
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
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 })
|
|
1505
2072
|
};
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
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
|
+
}
|
|
1521
2093
|
|
|
1522
2094
|
// src/primitives/Section.tsx
|
|
1523
|
-
import { jsx as
|
|
2095
|
+
import { Fragment as Fragment3, jsx as jsx28, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1524
2096
|
var Section = ({
|
|
1525
2097
|
title,
|
|
1526
2098
|
theme,
|
|
1527
2099
|
id,
|
|
1528
2100
|
framed = false,
|
|
2101
|
+
intro,
|
|
1529
2102
|
action,
|
|
1530
2103
|
actionClassName,
|
|
2104
|
+
panelClassName,
|
|
2105
|
+
titleClassName,
|
|
1531
2106
|
children,
|
|
1532
2107
|
className
|
|
1533
|
-
}) => /* @__PURE__ */
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
children: title
|
|
1541
|
-
}
|
|
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
|
|
1542
2115
|
),
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
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
|
+
);
|
|
1547
2159
|
|
|
1548
2160
|
// src/primitives/Slider.tsx
|
|
1549
2161
|
import { forwardRef as forwardRef3 } from "react";
|
|
1550
|
-
import { jsx as
|
|
2162
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1551
2163
|
var toNumber = (value) => {
|
|
1552
2164
|
if (typeof value === "number") return value;
|
|
1553
2165
|
if (typeof value !== "string" || value.trim() === "") return void 0;
|
|
@@ -1587,7 +2199,7 @@ var Slider = forwardRef3(
|
|
|
1587
2199
|
...style,
|
|
1588
2200
|
...progressPercent === void 0 ? null : { "--polli-slider-progress": `${progressPercent}%` }
|
|
1589
2201
|
};
|
|
1590
|
-
return /* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ jsx29(
|
|
1591
2203
|
"input",
|
|
1592
2204
|
{
|
|
1593
2205
|
ref,
|
|
@@ -1605,7 +2217,7 @@ var Slider = forwardRef3(
|
|
|
1605
2217
|
);
|
|
1606
2218
|
|
|
1607
2219
|
// src/primitives/StatCard.tsx
|
|
1608
|
-
import { jsx as
|
|
2220
|
+
import { jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1609
2221
|
var StatCard = ({
|
|
1610
2222
|
label,
|
|
1611
2223
|
value,
|
|
@@ -1615,8 +2227,8 @@ var StatCard = ({
|
|
|
1615
2227
|
labelClassName,
|
|
1616
2228
|
valueClassName,
|
|
1617
2229
|
detailClassName
|
|
1618
|
-
}) => /* @__PURE__ */
|
|
1619
|
-
/* @__PURE__ */
|
|
2230
|
+
}) => /* @__PURE__ */ jsxs15("div", { "data-theme": theme, className: cn2("polli:text-sm", className), children: [
|
|
2231
|
+
/* @__PURE__ */ jsx30(
|
|
1620
2232
|
"div",
|
|
1621
2233
|
{
|
|
1622
2234
|
className: cn2(
|
|
@@ -1626,7 +2238,7 @@ var StatCard = ({
|
|
|
1626
2238
|
children: label
|
|
1627
2239
|
}
|
|
1628
2240
|
),
|
|
1629
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ jsx30(
|
|
1630
2242
|
"div",
|
|
1631
2243
|
{
|
|
1632
2244
|
className: cn2(
|
|
@@ -1636,7 +2248,7 @@ var StatCard = ({
|
|
|
1636
2248
|
children: value
|
|
1637
2249
|
}
|
|
1638
2250
|
),
|
|
1639
|
-
detail && /* @__PURE__ */
|
|
2251
|
+
detail && /* @__PURE__ */ jsx30(
|
|
1640
2252
|
"div",
|
|
1641
2253
|
{
|
|
1642
2254
|
className: cn2(
|
|
@@ -1649,11 +2261,11 @@ var StatCard = ({
|
|
|
1649
2261
|
] });
|
|
1650
2262
|
|
|
1651
2263
|
// src/primitives/Switch.tsx
|
|
1652
|
-
import { jsx as
|
|
2264
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1653
2265
|
var trackClasses = {
|
|
1654
2266
|
off: "polli:bg-gray-200",
|
|
1655
|
-
on: "polli:bg-
|
|
1656
|
-
invalid: "polli:bg-
|
|
2267
|
+
on: "polli:bg-intent-success-bg-light",
|
|
2268
|
+
invalid: "polli:bg-intent-danger-bg-light"
|
|
1657
2269
|
};
|
|
1658
2270
|
var Switch = ({
|
|
1659
2271
|
checked,
|
|
@@ -1665,7 +2277,7 @@ var Switch = ({
|
|
|
1665
2277
|
}) => {
|
|
1666
2278
|
const effectiveStatus = status ?? (checked ? "on" : "off");
|
|
1667
2279
|
const resolvedAriaLabel = ariaLabel ?? (checked ? "Turn off toggle" : "Turn on toggle");
|
|
1668
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ jsx31(
|
|
1669
2281
|
"button",
|
|
1670
2282
|
{
|
|
1671
2283
|
type: "button",
|
|
@@ -1675,11 +2287,11 @@ var Switch = ({
|
|
|
1675
2287
|
onClick: () => onChange(!checked),
|
|
1676
2288
|
disabled,
|
|
1677
2289
|
className: cn2(
|
|
1678
|
-
"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",
|
|
1679
2291
|
trackClasses[effectiveStatus],
|
|
1680
2292
|
className
|
|
1681
2293
|
),
|
|
1682
|
-
children: /* @__PURE__ */
|
|
2294
|
+
children: /* @__PURE__ */ jsx31(
|
|
1683
2295
|
"span",
|
|
1684
2296
|
{
|
|
1685
2297
|
className: cn2(
|
|
@@ -1693,7 +2305,7 @@ var Switch = ({
|
|
|
1693
2305
|
};
|
|
1694
2306
|
|
|
1695
2307
|
// src/primitives/Table.tsx
|
|
1696
|
-
import { Fragment as
|
|
2308
|
+
import { Fragment as Fragment4, jsx as jsx32, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1697
2309
|
var alignClasses = {
|
|
1698
2310
|
left: "polli:text-left",
|
|
1699
2311
|
center: "polli:text-center",
|
|
@@ -1705,7 +2317,7 @@ var rowIntentClasses = {
|
|
|
1705
2317
|
warning: "polli:bg-intent-warning-bg-light/65",
|
|
1706
2318
|
danger: "polli:bg-intent-danger-bg-light/65"
|
|
1707
2319
|
};
|
|
1708
|
-
var Table = ({ className, ...rest }) => /* @__PURE__ */
|
|
2320
|
+
var Table = ({ className, ...rest }) => /* @__PURE__ */ jsx32(
|
|
1709
2321
|
"table",
|
|
1710
2322
|
{
|
|
1711
2323
|
...rest,
|
|
@@ -1715,7 +2327,7 @@ var Table = ({ className, ...rest }) => /* @__PURE__ */ jsx25(
|
|
|
1715
2327
|
)
|
|
1716
2328
|
}
|
|
1717
2329
|
);
|
|
1718
|
-
var TableHead = ({ className, ...rest }) => /* @__PURE__ */
|
|
2330
|
+
var TableHead = ({ className, ...rest }) => /* @__PURE__ */ jsx32(
|
|
1719
2331
|
"thead",
|
|
1720
2332
|
{
|
|
1721
2333
|
...rest,
|
|
@@ -1725,7 +2337,7 @@ var TableHead = ({ className, ...rest }) => /* @__PURE__ */ jsx25(
|
|
|
1725
2337
|
)
|
|
1726
2338
|
}
|
|
1727
2339
|
);
|
|
1728
|
-
var TableBody = ({ className, ...rest }) => /* @__PURE__ */
|
|
2340
|
+
var TableBody = ({ className, ...rest }) => /* @__PURE__ */ jsx32(
|
|
1729
2341
|
"tbody",
|
|
1730
2342
|
{
|
|
1731
2343
|
...rest,
|
|
@@ -1736,7 +2348,7 @@ var TableRow = ({
|
|
|
1736
2348
|
intent = "default",
|
|
1737
2349
|
className,
|
|
1738
2350
|
...rest
|
|
1739
|
-
}) => /* @__PURE__ */
|
|
2351
|
+
}) => /* @__PURE__ */ jsx32(
|
|
1740
2352
|
"tr",
|
|
1741
2353
|
{
|
|
1742
2354
|
...rest,
|
|
@@ -1756,9 +2368,9 @@ var TableHeaderCell = ({
|
|
|
1756
2368
|
children,
|
|
1757
2369
|
...rest
|
|
1758
2370
|
}) => {
|
|
1759
|
-
const content = /* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
-
active && sortDirection && /* @__PURE__ */
|
|
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" })
|
|
1762
2374
|
] });
|
|
1763
2375
|
const classes = cn2(
|
|
1764
2376
|
"polli:px-3 polli:py-2 polli:font-bold polli:uppercase polli:tracking-wide",
|
|
@@ -1768,15 +2380,15 @@ var TableHeaderCell = ({
|
|
|
1768
2380
|
className
|
|
1769
2381
|
);
|
|
1770
2382
|
if (!onSort) {
|
|
1771
|
-
return /* @__PURE__ */
|
|
2383
|
+
return /* @__PURE__ */ jsx32("th", { ...rest, className: classes, children: content });
|
|
1772
2384
|
}
|
|
1773
|
-
return /* @__PURE__ */
|
|
2385
|
+
return /* @__PURE__ */ jsx32("th", { ...rest, className: classes, children: /* @__PURE__ */ jsx32(
|
|
1774
2386
|
"button",
|
|
1775
2387
|
{
|
|
1776
2388
|
type: "button",
|
|
1777
2389
|
onClick: onSort,
|
|
1778
2390
|
className: cn2(
|
|
1779
|
-
"polli:inline-flex polli:w-full polli:items-center polli:gap-1 polli:bg-transparent polli:p-0 polli:font-bold polli:text-inherit",
|
|
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",
|
|
1780
2392
|
align === "right" && "polli:justify-end",
|
|
1781
2393
|
align === "center" && "polli:justify-center"
|
|
1782
2394
|
),
|
|
@@ -1790,7 +2402,7 @@ var TableCell = ({
|
|
|
1790
2402
|
muted = false,
|
|
1791
2403
|
className,
|
|
1792
2404
|
...rest
|
|
1793
|
-
}) => /* @__PURE__ */
|
|
2405
|
+
}) => /* @__PURE__ */ jsx32(
|
|
1794
2406
|
"td",
|
|
1795
2407
|
{
|
|
1796
2408
|
...rest,
|
|
@@ -1804,6 +2416,30 @@ var TableCell = ({
|
|
|
1804
2416
|
}
|
|
1805
2417
|
);
|
|
1806
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
|
+
|
|
1807
2443
|
// src/theme.ts
|
|
1808
2444
|
var themes = [
|
|
1809
2445
|
"amber",
|
|
@@ -1832,21 +2468,28 @@ export {
|
|
|
1832
2468
|
DiscordIcon,
|
|
1833
2469
|
DownloadIcon,
|
|
1834
2470
|
Dropdown,
|
|
2471
|
+
DropdownItem,
|
|
1835
2472
|
ExternalLinkButton,
|
|
1836
2473
|
ExternalLinkIcon,
|
|
1837
2474
|
Field,
|
|
2475
|
+
FileUpload,
|
|
1838
2476
|
GenApiIcon,
|
|
1839
2477
|
GitHubIcon,
|
|
1840
2478
|
IconButton,
|
|
1841
2479
|
ImageIcon,
|
|
1842
2480
|
InfoTip,
|
|
2481
|
+
InlineLink,
|
|
1843
2482
|
Input,
|
|
2483
|
+
LinkCard,
|
|
1844
2484
|
LockIcon,
|
|
1845
2485
|
MailIcon,
|
|
2486
|
+
Markdown,
|
|
1846
2487
|
McpIcon,
|
|
1847
2488
|
MenuIcon,
|
|
1848
2489
|
MultiSelect,
|
|
2490
|
+
NavItem,
|
|
1849
2491
|
PeriodPicker,
|
|
2492
|
+
Prose,
|
|
1850
2493
|
ScrollArea,
|
|
1851
2494
|
Section,
|
|
1852
2495
|
Slider,
|
|
@@ -1861,6 +2504,7 @@ export {
|
|
|
1861
2504
|
TableHeaderCell,
|
|
1862
2505
|
TableRow,
|
|
1863
2506
|
TerminalIcon,
|
|
2507
|
+
Textarea,
|
|
1864
2508
|
TokensIcon,
|
|
1865
2509
|
Tooltip,
|
|
1866
2510
|
TrendUpIcon,
|