@pollinations/ui 0.0.1 → 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -16
- package/dist/{Button-DMJ2K6Gr.d.ts → Button-BvLF_Km2.d.cts} +4 -4
- package/dist/{Button-CNzpisJf.d.cts → Button-DQAZzvyQ.d.ts} +4 -4
- package/dist/{Chip-BS8ronOu.d.ts → Chip-C5impfYd.d.ts} +2 -2
- package/dist/{Chip-DyqWrq0r.d.cts → Chip-SM52sUbZ.d.cts} +2 -2
- package/dist/app.css +1 -1
- package/dist/auth/index.cjs +78 -71
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +1 -2
- package/dist/auth/index.d.ts +1 -2
- package/dist/auth/index.js +78 -71
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/sdk.cjs +7 -6
- package/dist/auth/sdk.cjs.map +1 -1
- package/dist/auth/sdk.d.cts +2 -2
- package/dist/auth/sdk.d.ts +2 -2
- package/dist/auth/sdk.js +7 -6
- package/dist/auth/sdk.js.map +1 -1
- package/dist/compositions/app-user.cjs +497 -0
- package/dist/compositions/app-user.cjs.map +1 -0
- package/dist/compositions/app-user.d.cts +18 -0
- package/dist/compositions/app-user.d.ts +18 -0
- package/dist/compositions/app-user.js +469 -0
- package/dist/compositions/app-user.js.map +1 -0
- package/dist/index.cjs +1151 -312
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +146 -13
- package/dist/index.d.ts +146 -13
- package/dist/index.js +1109 -295
- package/dist/index.js.map +1 -1
- package/dist/modality/index.cjs +27 -56
- package/dist/modality/index.cjs.map +1 -1
- package/dist/modality/index.d.cts +13 -32
- package/dist/modality/index.d.ts +13 -32
- package/dist/modality/index.js +27 -55
- package/dist/modality/index.js.map +1 -1
- package/dist/models/index.cjs +508 -0
- package/dist/models/index.cjs.map +1 -0
- package/dist/models/index.d.cts +22 -0
- package/dist/models/index.d.ts +22 -0
- package/dist/models/index.js +486 -0
- package/dist/models/index.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme-VMRlhqST.d.cts +9 -0
- package/dist/theme-VMRlhqST.d.ts +9 -0
- package/dist/wallet/index.cjs +17 -5
- package/dist/wallet/index.cjs.map +1 -1
- package/dist/wallet/index.d.cts +2 -2
- package/dist/wallet/index.d.ts +2 -2
- package/dist/wallet/index.js +17 -5
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/sdk.cjs +6 -3
- package/dist/wallet/sdk.cjs.map +1 -1
- package/dist/wallet/sdk.js +6 -3
- package/dist/wallet/sdk.js.map +1 -1
- package/package.json +17 -10
- package/dist/showcase/index.cjs +0 -2851
- package/dist/showcase/index.cjs.map +0 -1
- package/dist/showcase/index.d.cts +0 -19
- package/dist/showcase/index.d.ts +0 -19
- package/dist/showcase/index.js +0 -2839
- package/dist/showcase/index.js.map +0 -1
- package/dist/theme-DfHMjWB7.d.cts +0 -16
- package/dist/theme-DfHMjWB7.d.ts +0 -16
- package/dist/wallet.css +0 -73
package/dist/showcase/index.cjs
DELETED
|
@@ -1,2851 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/showcase/index.ts
|
|
21
|
-
var showcase_exports = {};
|
|
22
|
-
__export(showcase_exports, {
|
|
23
|
-
DesignShowcase: () => DesignShowcase
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(showcase_exports);
|
|
26
|
-
|
|
27
|
-
// src/showcase/DesignShowcase.tsx
|
|
28
|
-
var import_react8 = require("react");
|
|
29
|
-
|
|
30
|
-
// src/lib/period.ts
|
|
31
|
-
var MS_PER_DAY = 864e5;
|
|
32
|
-
function startOfUtcDay(date = /* @__PURE__ */ new Date()) {
|
|
33
|
-
return new Date(
|
|
34
|
-
Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
function addUtcDays(date, days) {
|
|
38
|
-
const next = new Date(date);
|
|
39
|
-
next.setUTCDate(next.getUTCDate() + days);
|
|
40
|
-
return next;
|
|
41
|
-
}
|
|
42
|
-
function startOfUtcMonth(date) {
|
|
43
|
-
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));
|
|
44
|
-
}
|
|
45
|
-
function addUtcMonths(date, months) {
|
|
46
|
-
return new Date(
|
|
47
|
-
Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + months, 1)
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
function startOfUtcIsoWeek(date) {
|
|
51
|
-
const day = date.getUTCDay() || 7;
|
|
52
|
-
return addUtcDays(startOfUtcDay(date), 1 - day);
|
|
53
|
-
}
|
|
54
|
-
function getUtcIsoWeekPeriod(date) {
|
|
55
|
-
const day = date.getUTCDay() || 7;
|
|
56
|
-
const thursday = addUtcDays(startOfUtcDay(date), 4 - day);
|
|
57
|
-
const isoYear = thursday.getUTCFullYear();
|
|
58
|
-
const yearStart = new Date(Date.UTC(isoYear, 0, 1));
|
|
59
|
-
const isoWeek = Math.ceil(
|
|
60
|
-
((thursday.getTime() - yearStart.getTime()) / MS_PER_DAY + 1) / 7
|
|
61
|
-
);
|
|
62
|
-
return `${isoYear}-W${String(isoWeek).padStart(2, "0")}`;
|
|
63
|
-
}
|
|
64
|
-
function formatUtcDatePeriod(date) {
|
|
65
|
-
return date.toISOString().slice(0, 10);
|
|
66
|
-
}
|
|
67
|
-
function formatUtcMonthPeriod(date) {
|
|
68
|
-
return date.toISOString().slice(0, 7);
|
|
69
|
-
}
|
|
70
|
-
function periodFromDate(granularity, date = /* @__PURE__ */ new Date()) {
|
|
71
|
-
if (granularity === "day") {
|
|
72
|
-
return {
|
|
73
|
-
granularity,
|
|
74
|
-
period: formatUtcDatePeriod(startOfUtcDay(date))
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
if (granularity === "week") {
|
|
78
|
-
return { granularity, period: getUtcIsoWeekPeriod(date) };
|
|
79
|
-
}
|
|
80
|
-
return { granularity, period: formatUtcMonthPeriod(startOfUtcMonth(date)) };
|
|
81
|
-
}
|
|
82
|
-
function currentPeriod() {
|
|
83
|
-
return periodFromDate("day");
|
|
84
|
-
}
|
|
85
|
-
function periodToWindow(selection) {
|
|
86
|
-
if (selection.granularity === "day") {
|
|
87
|
-
const start2 = /* @__PURE__ */ new Date(`${selection.period}T00:00:00.000Z`);
|
|
88
|
-
return { start: start2, end: addUtcDays(start2, 1) };
|
|
89
|
-
}
|
|
90
|
-
if (selection.granularity === "week") {
|
|
91
|
-
const [yearText2, weekText] = selection.period.split("-W");
|
|
92
|
-
const isoYear = Number(yearText2);
|
|
93
|
-
const isoWeek = Number(weekText);
|
|
94
|
-
const jan4 = new Date(Date.UTC(isoYear, 0, 4));
|
|
95
|
-
const start2 = addUtcDays(startOfUtcIsoWeek(jan4), (isoWeek - 1) * 7);
|
|
96
|
-
return { start: start2, end: addUtcDays(start2, 7) };
|
|
97
|
-
}
|
|
98
|
-
const [yearText, monthText] = selection.period.split("-");
|
|
99
|
-
const start = new Date(
|
|
100
|
-
Date.UTC(Number(yearText), Number(monthText) - 1, 1)
|
|
101
|
-
);
|
|
102
|
-
return { start, end: addUtcMonths(start, 1) };
|
|
103
|
-
}
|
|
104
|
-
function formatPeriodLabel(selection) {
|
|
105
|
-
const { start, end } = periodToWindow(selection);
|
|
106
|
-
if (selection.granularity === "day") {
|
|
107
|
-
const today = startOfUtcDay();
|
|
108
|
-
const yesterday = addUtcDays(today, -1);
|
|
109
|
-
if (start.getTime() === today.getTime()) return "Today";
|
|
110
|
-
if (start.getTime() === yesterday.getTime()) return "Yesterday";
|
|
111
|
-
return start.toLocaleDateString("en-US", {
|
|
112
|
-
timeZone: "UTC",
|
|
113
|
-
month: "short",
|
|
114
|
-
day: "numeric",
|
|
115
|
-
year: "numeric"
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
if (selection.granularity === "week") {
|
|
119
|
-
const weekEnd = addUtcDays(end, -1);
|
|
120
|
-
return `${start.toLocaleDateString("en-US", {
|
|
121
|
-
timeZone: "UTC",
|
|
122
|
-
month: "short",
|
|
123
|
-
day: "numeric"
|
|
124
|
-
})} - ${weekEnd.toLocaleDateString("en-US", {
|
|
125
|
-
timeZone: "UTC",
|
|
126
|
-
month: "short",
|
|
127
|
-
day: "numeric",
|
|
128
|
-
year: "numeric"
|
|
129
|
-
})}`;
|
|
130
|
-
}
|
|
131
|
-
return start.toLocaleDateString("en-US", {
|
|
132
|
-
timeZone: "UTC",
|
|
133
|
-
month: "long",
|
|
134
|
-
year: "numeric"
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
function isPeriodSelectable(selection, minDate = /* @__PURE__ */ new Date(0), maxDate = startOfUtcDay()) {
|
|
138
|
-
const { start, end } = periodToWindow(selection);
|
|
139
|
-
return end > minDate && start <= maxDate;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// src/assets/logo.svg
|
|
143
|
-
var logo_default = 'data:image/svg+xml,<?xml version="1.0" encoding="utf-8"?>%0A<svg xmlns="http://www.w3.org/2000/svg" viewBox="15 17.6409 119.9998 114.7498" width="160px" height="153px">%0A <path style="stroke:none;fill-rule:evenodd;fill:currentColor;fill-opacity:1" d="M73.832 19.293a1893.685 1893.685 0 0 0-7.742 9.047c-1.93 2.273-3.274 3.898-4.266 5.156-.988 1.258-1.62 2.149-2.117 2.957-.5.805-.86 1.531-1.309 2.453-.14.285-.277.563-.402.813-.121.254-.238.48-.332.676a20.107 20.107 0 0 1-.34.652c-.008.008-.062 0-.156-.02s-.227-.047-.383-.09c-.16-.039-.351-.09-.558-.148-.207-.059-.43-.121-.668-.191-1.079-.32-1.895-.559-2.684-.743-.79-.18-1.55-.3-2.516-.382-.96-.082-2.129-.121-3.734-.145-1.602-.02-3.64-.023-6.348-.023H35.31l-2.485-.004H30.34v20.574l-.527.059-.524.058-1.055.117c-.59.067-1.203.157-1.84.274-.636.113-1.292.25-1.968.414-.676.16-1.371.348-2.086.555-.715.21-1.445.441-2.195.695-.47.16-1.024.36-1.594.574a64.38 64.38 0 0 0-1.684.649c-.523.207-.992.398-1.328.546-.336.149-.539.246-.539.274 0 .039.07.234.191.535.118.297.29.7.485 1.156.195.453.418.961.644 1.473.227.508.461 1.02.676 1.484a52.041 52.041 0 0 0 9.54 13.926 47.507 47.507 0 0 0 6.14 5.41c2.164 1.59 4.426 2.953 6.75 4.047a51.197 51.197 0 0 0 3.414 1.461c1.129.43 2.242.805 3.36 1.125 1.112.324 2.226.59 3.343.809a39.04 39.04 0 0 0 3.375.504c.84.085 1.781.136 2.777.156a51.632 51.632 0 0 0 6.203-.266 34.786 34.786 0 0 0 2.836-.394 59.177 59.177 0 0 1 2.633-.442c.149-.02.235-.023.246-.015.043.043-.02.195-.152.414a9.01 9.01 0 0 1-.582.812c-.242.313-.527.645-.813.965-.289.316-.582.617-.851.86-.57.519-1.168.968-1.809 1.355-.64.383-1.324.703-2.07.969-.746.261-1.555.464-2.441.617-.891.156-1.856.258-2.926.316-1.36.07-2.582.207-3.703.422-1.118.211-2.13.496-3.07.871-.938.375-1.801.84-2.618 1.403a15.82 15.82 0 0 0-2.351 2 14.205 14.205 0 0 0-1.489 1.765 13.256 13.256 0 0 0-1.148 1.945 15.518 15.518 0 0 0-.856 2.207 20.834 20.834 0 0 0-.59 2.543c-.058.348-.105.61-.156.817-.05.207-.105.36-.183.484a1.184 1.184 0 0 1-.325.332c-.144.106-.332.211-.578.356a9.157 9.157 0 0 0-2.543 2.183 8.797 8.797 0 0 0-1.52 2.813 8.33 8.33 0 0 0-.382 3.113 7.995 7.995 0 0 0 .852 3.098 7.95 7.95 0 0 0 1.574 2.117 9.294 9.294 0 0 0 2.168 1.566c.789.418 1.629.715 2.469.868.84.152 1.68.167 2.472.007a7.941 7.941 0 0 0 1.188-.336c.406-.144.82-.32 1.222-.515.399-.2.79-.418 1.149-.653.36-.234.691-.476.976-.73a6.93 6.93 0 0 0 1.473-1.86c.39-.71.68-1.492.855-2.308.176-.82.243-1.676.188-2.527a8.74 8.74 0 0 0-.531-2.516 5.919 5.919 0 0 0-.68-1.281c-.289-.43-.64-.856-1.031-1.258a10.34 10.34 0 0 0-1.262-1.11 8.299 8.299 0 0 0-1.379-.847c-.414-.2-.722-.352-.95-.492-.226-.137-.366-.27-.44-.43-.075-.16-.083-.352-.043-.613.039-.266.125-.598.242-1.043.226-.871.566-1.695 1.004-2.465a10.426 10.426 0 0 1 3.672-3.754c.77-.46 1.605-.836 2.492-1.102.152-.046.386-.093.675-.144a30.829 30.829 0 0 1 2.246-.273c.43-.043.876-.075 1.317-.102a41.754 41.754 0 0 0 2.773-.25 19.813 19.813 0 0 0 2.243-.406 13.283 13.283 0 0 0 1.918-.621c.609-.246 1.199-.536 1.804-.88a20.824 20.824 0 0 0 1.774-1.116c.539-.383 1.031-.786 1.511-1.227.48-.445.942-.934 1.415-1.488.468-.559.953-1.18 1.468-1.899l.309-.426.308-.43.313-.429.309-.426v19.633l-.399.262-.402.265-.797.532a11.66 11.66 0 0 0-1.567 1.21c-.44.41-.808.837-1.113 1.305-.305.465-.55.97-.746 1.535-.2.567-.351 1.192-.473 1.903a7.401 7.401 0 0 0 .024 2.574 8.502 8.502 0 0 0 2.441 4.543 7.787 7.787 0 0 0 2.157 1.496c.804.367 1.632.61 2.46.715.829.105 1.66.082 2.47-.07a7.963 7.963 0 0 0 2.343-.828 8.831 8.831 0 0 0 2.094-1.567c.406-.402.738-.789 1.011-1.18.27-.394.48-.796.641-1.234.156-.441.266-.918.336-1.473.07-.55.102-1.171.105-1.894 0-.524 0-.93-.011-1.266a6.504 6.504 0 0 0-.074-.836 3.967 3.967 0 0 0-.192-.683c-.09-.23-.207-.485-.355-.805a7.845 7.845 0 0 0-1.594-2.262 8.117 8.117 0 0 0-1.07-.879 9.342 9.342 0 0 0-1.254-.718l-.348-.164-.348-.16-.343-.165-.348-.164v-4.957l-.004-2.476v-2.48c0-1.36.004-2.657.012-3.833.008-1.176.02-2.23.035-3.11.016-.882.035-1.589.055-2.07.02-.48.043-.734.066-.707.02.028.074.102.156.208l.301.421c.121.168.258.364.406.575.145.207.305.433.461.664.38.543.735 1.027 1.09 1.468.352.438.703.832 1.063 1.2.363.367.742.707 1.148 1.039.406.328.844.652 1.332.98.777.528 1.5.965 2.223 1.328.718.364 1.437.657 2.203.89.765.235 1.582.411 2.496.544.914.137 1.93.23 3.094.3.433.024.867.055 1.289.087a40.742 40.742 0 0 1 2.148.215c.27.035.477.07.602.101.965.234 1.898.64 2.761 1.168a11.119 11.119 0 0 1 2.34 1.93 10.355 10.355 0 0 1 1.688 2.437c.43.867.707 1.781.805 2.695l.03.313.032.309.035.316.031.309-.27.14-.538.274-.274.136c-.828.426-1.558.922-2.183 1.493a7.954 7.954 0 0 0-1.54 1.91 7.731 7.731 0 0 0-.87 2.273 9.264 9.264 0 0 0-.172 2.594c.066.96.285 1.871.64 2.703a7.903 7.903 0 0 0 1.446 2.258 8.316 8.316 0 0 0 2.14 1.683c.817.45 1.727.782 2.715.98 1.309.255 2.617.126 3.836-.3a8.813 8.813 0 0 0 3.266-2.05 8.893 8.893 0 0 0 2.117-3.239c.453-1.21.613-2.527.387-3.848a9.06 9.06 0 0 0-1.504-3.644 9.344 9.344 0 0 0-1.301-1.477 8.97 8.97 0 0 0-1.61-1.16c-.18-.097-.347-.2-.507-.293-.16-.097-.305-.183-.434-.265-.125-.082-.23-.153-.312-.211a.573.573 0 0 1-.137-.121.813.813 0 0 1-.063-.184c-.027-.094-.058-.223-.097-.375a11.147 11.147 0 0 1-.11-.512c-.039-.187-.082-.39-.12-.594-.098-.5-.227-1.023-.383-1.554a19.7 19.7 0 0 0-.551-1.594c-.207-.527-.43-1.039-.668-1.512a12.868 12.868 0 0 0-.735-1.3 12.93 12.93 0 0 0-1.582-1.954 15.064 15.064 0 0 0-1.98-1.691 15.833 15.833 0 0 0-2.27-1.355 14.35 14.35 0 0 0-2.449-.934 9.33 9.33 0 0 0-.836-.188 25.72 25.72 0 0 0-1.094-.18 40.224 40.224 0 0 0-2.605-.269 51.614 51.614 0 0 1-1.281-.11 47.27 47.27 0 0 1-1.242-.128 37.65 37.65 0 0 1-1.067-.14 12.643 12.643 0 0 1-.746-.133 11.48 11.48 0 0 1-1.508-.458c-.5-.187-.996-.414-1.472-.668a12.371 12.371 0 0 1-2.606-1.847 16.117 16.117 0 0 1-1.676-1.836 5.604 5.604 0 0 1-.465-.707c-.097-.192-.125-.324-.074-.375.016-.016.117-.012.285.004.168.015.407.047.696.09.293.039.633.093 1.008.156.37.062.78.137 1.207.215a60.65 60.65 0 0 0 1.789.304c.527.079 1.011.133 1.535.172.523.04 1.09.063 1.777.078.692.016 1.504.02 2.527.024 1.22 0 2.204-.008 3.06-.031a27.474 27.474 0 0 0 2.257-.153 20.662 20.662 0 0 0 2.047-.336 48.885 48.885 0 0 0 2.426-.59 44.634 44.634 0 0 0 5.347-1.761 42.256 42.256 0 0 0 4.98-2.387 43.059 43.059 0 0 0 4.633-3.031 46.976 46.976 0 0 0 4.329-3.692 55.822 55.822 0 0 0 3.312-3.468 49.244 49.244 0 0 0 2.879-3.63 50.142 50.142 0 0 0 2.516-3.886 57.29 57.29 0 0 0 2.23-4.258c.375-.793.691-1.48.95-2.066.257-.59.46-1.078.613-1.473.144-.398.242-.7.285-.918.047-.219.039-.351-.016-.402-.078-.07-.41-.23-.902-.442a57.272 57.272 0 0 0-1.828-.73c-.692-.262-1.434-.535-2.121-.777a36.517 36.517 0 0 0-1.778-.586 54.289 54.289 0 0 0-3.531-.879 48.341 48.341 0 0 0-1.715-.332 23.874 23.874 0 0 0-1.465-.215l-.633-.07-.312-.04-.316-.035V39.301l-2.461.004h-2.461l-2.457.004h-2.461c-2.645.004-4.664.007-6.266.03-1.605.024-2.797.067-3.789.141-.992.079-1.789.192-2.598.356-.812.164-1.64.383-2.703.668a23.531 23.531 0 0 1-1.203.3c-.16.036-.289.06-.383.075-.093.016-.148.02-.156.008a29.962 29.962 0 0 1-.355-.672c-.102-.2-.22-.434-.348-.692a79.19 79.19 0 0 1-.418-.828c-.45-.902-.785-1.578-1.168-2.234-.379-.66-.805-1.297-1.422-2.117-.617-.817-1.433-1.82-2.594-3.203-1.16-1.387-2.671-3.153-4.68-5.508-1.398-1.64-2.53-2.961-3.44-4.02a272.265 272.265 0 0 0-2.122-2.441c-.523-.59-.875-.973-1.11-1.211-.237-.234-.355-.324-.402-.32-.015 0-.07.047-.156.132-.086.086-.199.207-.34.356-.136.148-.296.328-.472.523-.172.2-.364.414-.555.641m7.059 11.504a151.52 151.52 0 0 1 3.582 4.336 58.05 58.05 0 0 1 2.488 3.336c.66.965 1.16 1.793 1.516 2.515.355.72.57 1.332.66 1.868.023.14.039.25.031.347a.526.526 0 0 1-.09.262 1.205 1.205 0 0 1-.266.262c-.12.093-.285.199-.492.332-.332.21-.773.554-1.265.976-.493.426-1.043.934-1.594 1.473a43.455 43.455 0 0 0-1.625 1.672 25.487 25.487 0 0 0-1.348 1.574c-.398.512-.812 1.09-1.222 1.703a39.76 39.76 0 0 0-1.204 1.91 39.73 39.73 0 0 0-1.085 1.946c-.329.636-.622 1.25-.86 1.812-.34.809-.672 1.727-.976 2.688-.305.96-.582 1.964-.817 2.945-.234.984-.43 1.945-.562 2.816-.137.871-.215 1.653-.215 2.282-.004.609-.024 1.054-.055 1.332-.035.277-.086.386-.152.328-.067-.055-.149-.278-.246-.664a26.572 26.572 0 0 1-.336-1.66 76.29 76.29 0 0 0-.54-2.758 81.86 81.86 0 0 0-.624-2.66c-.211-.844-.43-1.637-.645-2.34a22.878 22.878 0 0 0-.617-1.801 24.472 24.472 0 0 0-.742-1.66 48.94 48.94 0 0 0-2.047-3.746c-.36-.59-.707-1.13-1.027-1.582a21.393 21.393 0 0 0-1.153-1.446 44.776 44.776 0 0 0-1.558-1.71 47.283 47.283 0 0 0-1.657-1.657c-.539-.512-1.043-.96-1.468-1.3-.172-.141-.34-.278-.489-.41a8.144 8.144 0 0 1-.402-.376 3.846 3.846 0 0 1-.27-.293c-.066-.082-.101-.144-.101-.176 0-.105.098-.378.262-.753.16-.372.386-.848.644-1.356.258-.508.547-1.05.828-1.562a24.735 24.735 0 0 1 1.582-2.508c.262-.371.543-.746.871-1.16.329-.418.7-.871 1.149-1.407.45-.535.973-1.144 1.601-1.87.235-.27.536-.614.875-1.005.336-.394.715-.832 1.114-1.293.394-.46.808-.937 1.215-1.41.402-.472.8-.933 1.168-1.363l.668-.777.668-.774.667-.777.665-.778.117.118.113.12.117.118.113.117a110.75 110.75 0 0 1 1.668 1.914l1.555 1.809c.57.664 1.184 1.383 1.813 2.12M51.227 44.149c.425.09.867.2 1.304.317.434.117.864.242 1.254.37.395.13.754.259 1.055.38.297.12.535.234.687.332.051.035.09.094.11.191.02.098.023.239.011.442-.015.199-.046.457-.097.793-.055.336-.125.75-.215 1.257-.094.524-.172.989-.23 1.446-.06.457-.106.91-.137 1.41a32.68 32.68 0 0 0-.067 1.7c-.011.648-.015 1.401-.015 2.312 0 .98.004 1.761.015 2.414.012.648.035 1.172.07 1.644.04.473.09.89.165 1.336.07.446.164.918.285 1.488.074.348.156.72.242 1.094.082.375.168.754.254 1.11.086.359.168.695.242.992.074.3.14.554.195.75.055.195.102.383.149.554.043.172.082.329.113.461.031.13.059.239.07.317.016.078.02.125.012.133a.942.942 0 0 1-.183-.079 35.955 35.955 0 0 1-1.148-.629c-.255-.144-.532-.304-.821-.472a95.651 95.651 0 0 0-2.031-1.152 44.616 44.616 0 0 0-1.723-.899 34 34 0 0 0-1.633-.75 44.224 44.224 0 0 0-1.762-.715 50.86 50.86 0 0 0-2.855-1.004 45.68 45.68 0 0 0-2.8-.793 39.106 39.106 0 0 0-2.653-.562 26.924 26.924 0 0 0-2.406-.309l-.426-.03-.426-.036-.426-.031-.426-.035V43.758h7.215c1.578.004 2.832.008 3.852.015 1.02.012 1.8.028 2.437.055a20.37 20.37 0 0 1 1.547.117c.43.051.797.117 1.196.203m64.886 7.493c0 1.23-.008 2.34-.015 3.312-.008.977-.02 1.817-.04 2.504-.015.691-.038 1.23-.062 1.602-.023.367-.05.57-.082.59a1.259 1.259 0 0 1-.281.07c-.153.031-.367.062-.617.101-.254.035-.547.078-.868.117-.32.043-.664.083-1.02.122-.765.086-1.538.199-2.323.343-.79.141-1.59.313-2.407.516-.816.203-1.652.434-2.503.7-.856.26-1.73.558-2.625.882-.735.266-1.305.477-1.801.672-.496.195-.918.375-1.348.578-.43.203-.867.43-1.398.723-.528.289-1.149.644-1.946 1.101a34.54 34.54 0 0 1-1.644.895 9.035 9.035 0 0 1-.528.242c-.128.055-.21.074-.226.059-.016-.016-.02-.082-.012-.184a5.49 5.49 0 0 1 .055-.422c.031-.172.066-.371.113-.59.043-.219.098-.457.156-.699.258-1.082.454-1.906.602-2.613.152-.703.258-1.282.332-1.867.078-.583.125-1.172.156-1.895.035-.723.059-1.578.086-2.695.024-.98.04-1.77.043-2.434.004-.66-.004-1.2-.027-1.684a17.76 17.76 0 0 0-.113-1.355 29.95 29.95 0 0 0-.223-1.445c-.152-.887-.27-1.543-.336-2.035-.066-.493-.086-.825-.04-1.059a.664.664 0 0 1 .333-.492c.18-.117.437-.207.781-.336.692-.266 1.29-.469 1.926-.63.637-.16 1.309-.276 2.152-.358.84-.082 1.852-.133 3.164-.16 1.309-.032 2.922-.044 4.965-.047l3.813-.008h1.902l1.906-.004v7.883m-25.05-2.368c.195 1.02.343 1.977.437 2.91.098.934.14 1.837.133 2.75a25.621 25.621 0 0 1-.18 2.797c-.11.961-.273 1.961-.488 3.036a39.395 39.395 0 0 1-.746 3.12 31.161 31.161 0 0 1-.946 2.829c-.355.906-.75 1.781-1.187 2.64a30.9 30.9 0 0 1-1.473 2.555c-.215.34-.597.86-1.074 1.469a76.18 76.18 0 0 1-1.625 2.012 79.82 79.82 0 0 1-1.73 2.011 30.987 30.987 0 0 1-1.387 1.489l-.258.25-.262.254-.257.253-.262.254.02-1.62.023-1.622.02-1.617.019-1.621c.02-1.414.035-2.543.058-3.465.02-.922.047-1.637.082-2.227.036-.59.082-1.054.141-1.472.059-.422.133-.797.227-1.211a38.117 38.117 0 0 1 1.086-3.91c.418-1.235.89-2.403 1.433-3.524a28.68 28.68 0 0 1 1.82-3.222 31.184 31.184 0 0 1 2.258-3.012 18.08 18.08 0 0 1 1.012-1.086c.367-.363.746-.715 1.106-1.023.355-.31.69-.575.964-.762.27-.188.48-.297.59-.297.035 0 .07.031.11.086.039.05.078.129.12.226a4.214 4.214 0 0 1 .216.75m-28.895.91c.914.915 1.738 1.86 2.488 2.86a25.52 25.52 0 0 1 2.028 3.187 30.027 30.027 0 0 1 1.636 3.645 42.64 42.64 0 0 1 1.32 4.23c.122.485.22.872.294 1.274.074.406.125.832.164 1.387.043.554.07 1.242.09 2.171.023.934.039 2.11.058 3.645.02 1.441.035 2.566.04 3.438.003.87 0 1.488-.016 1.921-.016.434-.043.68-.086.813-.04.129-.094.14-.16.101-.106-.058-.376-.324-.743-.722-.367-.399-.84-.926-1.34-1.512a82.643 82.643 0 0 1-1.539-1.832 48.185 48.185 0 0 1-1.34-1.695c-.34-.45-.722-1.031-1.117-1.688a40.534 40.534 0 0 1-1.183-2.125 43.623 43.623 0 0 1-1.075-2.207 21.82 21.82 0 0 1-.773-1.933c-.07-.215-.152-.477-.238-.762-.082-.29-.172-.602-.258-.922a49.961 49.961 0 0 1-.461-1.844c-.187-.86-.316-2.113-.395-3.508a62.606 62.606 0 0 1-.066-4.378c.027-1.434.106-2.762.227-3.735.12-.969.285-1.578.492-1.578.023 0 .097.05.21.14.11.09.259.22.438.38a44.358 44.358 0 0 1 1.305 1.25m53.23 15.39a24.897 24.897 0 0 1-.965 4.492 26.72 26.72 0 0 1-.824 2.25 33.11 33.11 0 0 1-1.058 2.305c-.344.676-.66 1.262-.98 1.805-.321.543-.641 1.035-.997 1.523-.351.485-.734.961-1.18 1.473-.445.508-.953 1.05-1.542 1.66a35.204 35.204 0 0 1-1.579 1.54c-.496.448-.976.847-1.468 1.21-.493.367-1 .703-1.551 1.031-.55.328-1.145.649-1.817.989-.84.421-1.624.761-2.445 1.03a15.58 15.58 0 0 1-2.683.626c-1.004.152-2.145.25-3.532.308-1.382.063-3.011.082-4.98.082H82.18l.03-.113.036-.113.031-.113.035-.114c.055-.199.243-.582.516-1.074.274-.496.633-1.101 1.027-1.746.399-.645.836-1.324 1.266-1.969.43-.644.852-1.25 1.219-1.746a44.604 44.604 0 0 1 5.883-6.445 41.569 41.569 0 0 1 6.812-4.977 38.048 38.048 0 0 1 7.477-3.36 34.711 34.711 0 0 1 7.886-1.585c.11-.008.22-.02.325-.027.105-.008.203-.02.293-.028.09-.008.164-.02.226-.023.063-.008.106-.016.13-.02.023-.004.038.024.05.078a.934.934 0 0 1 .023.239c.004.101 0 .226-.007.363-.008.137-.02.29-.04.45M30.934 66.89c.242 1.234.562 2.488.945 3.738a41.182 41.182 0 0 0 1.32 3.68 37.438 37.438 0 0 0 1.61 3.425 27.185 27.185 0 0 0 1.816 2.961c.45.633.992 1.313 1.594 2.004a38.232 38.232 0 0 0 1.949 2.074c.687.68 1.395 1.34 2.098 1.942.699.597 1.39 1.144 2.03 1.597.298.208.575.407.825.59.25.184.469.352.649.496.18.141.32.258.41.344.09.082.129.133.105.14-.066.028-.328-.038-.71-.167-.384-.13-.891-.324-1.458-.555a48.612 48.612 0 0 1-1.812-.777 38.066 38.066 0 0 1-7.352-4.297 42.01 42.01 0 0 1-5.043-4.422 44.733 44.733 0 0 1-4.37-5.254 45.026 45.026 0 0 1-3.575-5.941c-.125-.258-.25-.504-.356-.735-.109-.226-.207-.433-.285-.609-.078-.176-.14-.32-.18-.422-.042-.101-.058-.164-.05-.172.008-.008.062-.031.148-.066.09-.035.211-.082.36-.137.144-.05.32-.113.507-.18l.614-.21c.433-.145.988-.297 1.593-.446a39.578 39.578 0 0 1 3.805-.73c.574-.078 1.07-.125 1.434-.133l.23-.004.235-.004.23-.004.234-.004.114.57.109.57.113.567.114.57m8.199-1.87c1.383.238 2.8.59 4.226 1.039 1.426.449 2.856 1 4.27 1.636a42.064 42.064 0 0 1 4.16 2.164c1.348.801 2.648 1.68 3.879 2.621.41.317.95.778 1.547 1.32a69.069 69.069 0 0 1 1.914 1.805c.652.641 1.3 1.293 1.871 1.899a31.34 31.34 0 0 1 1.422 1.586 46.416 46.416 0 0 1 1.726 2.27c.57.796 1.125 1.613 1.622 2.39.5.781.94 1.52 1.285 2.152.343.637.593 1.172.71 1.543l.032.114.035.113.04.113.03.113h-5.511c-1.918 0-3.48-.02-4.801-.078-1.324-.058-2.41-.156-3.371-.312a15.68 15.68 0 0 1-2.63-.653c-.831-.289-1.651-.652-2.581-1.109a20.527 20.527 0 0 1-3.137-1.926 24.776 24.776 0 0 1-2.902-2.523 26.07 26.07 0 0 1-2.528-2.988 24.005 24.005 0 0 1-2.011-3.305 35.404 35.404 0 0 1-1.192-2.649 38.321 38.321 0 0 1-.968-2.66 25.394 25.394 0 0 1-.645-2.39c-.156-.72-.238-1.348-.238-1.832 0-.211 0-.371.011-.489.012-.12.032-.203.079-.257.043-.055.105-.082.203-.098.093-.016.222-.016.39-.016.094 0 .25.012.453.032.204.023.454.05.73.09.278.035.583.078.903.128.32.047.653.102.977.157m84.953.085c.336.06.809.168 1.336.297.523.13 1.101.282 1.64.434.543.152 1.051.305 1.43.43.387.125.649.222.7.273.027.023-.028.184-.149.45-.121.265-.3.632-.527 1.062-.223.433-.493.93-.79 1.457a56.9 56.9 0 0 1-.937 1.633 44.31 44.31 0 0 1-3.473 5.027 46.345 46.345 0 0 1-4.12 4.531 43.203 43.203 0 0 1-4.571 3.848 34.726 34.726 0 0 1-4.82 2.969 42.898 42.898 0 0 1-3.02 1.367c-.469.191-.89.351-1.207.457-.32.105-.535.156-.598.137-.027-.012.004-.055.079-.133.074-.074.195-.18.351-.309.153-.129.348-.281.563-.445.218-.164.465-.344.722-.531a31.987 31.987 0 0 0 3.067-2.473 30.025 30.025 0 0 0 4.992-5.887 32.018 32.018 0 0 0 1.953-3.441c.398-.809.75-1.57 1.059-2.309a30.121 30.121 0 0 0 1.48-4.39c.188-.758.363-1.547.52-2.391l.109-.59.113-.586.11-.59.109-.586h1.133c.156 0 .347.008.566.024.215.012.457.035.703.062a20.21 20.21 0 0 1 1.477.203m-79.191 55.711c.363.23.671.555.917.934.247.379.426.816.536 1.273.109.457.148.938.105 1.407a3.61 3.61 0 0 1-.371 1.336c-.156.304-.332.57-.539.808a3.303 3.303 0 0 1-1.512.996 4.104 4.104 0 0 1-.965.184 4.468 4.468 0 0 1-1.03-.043 3.427 3.427 0 0 1-1.719-.805 4.434 4.434 0 0 1-.696-.77 3.378 3.378 0 0 1-.555-1.284 4.203 4.203 0 0 1-.046-1.434c.066-.48.21-.945.43-1.36.214-.413.507-.78.87-1.058a3.654 3.654 0 0 1 1.059-.555c.383-.132.789-.207 1.2-.222.41-.02.82.023 1.214.12.39.102.766.259 1.102.473m64.375-.195c.175.086.37.23.574.406.199.176.402.38.586.598.187.215.36.438.492.652.133.211.226.407.266.567.019.07.035.168.042.285.012.113.02.25.024.398.004.145 0 .301-.004.457a8.875 8.875 0 0 1-.023.461 3.545 3.545 0 0 1-.774 1.953 3.866 3.866 0 0 1-3.625 1.368 3.584 3.584 0 0 1-1.883-.95 4.289 4.289 0 0 1-.55-.609 2.827 2.827 0 0 1-.352-.637 3.475 3.475 0 0 1-.188-.746 6.793 6.793 0 0 1-.054-.941c0-.352.027-.672.082-.961.05-.293.137-.555.25-.797.117-.242.265-.465.449-.676.188-.21.406-.41.668-.601.25-.188.547-.328.879-.434a4.168 4.168 0 0 1 1.05-.187c.364-.024.735 0 1.09.066.36.062.7.176 1 .328m-31.93.473c.177.125.368.328.556.57.183.242.367.531.527.824.16.293.297.598.394.88a2.5 2.5 0 0 1 .16.737c0 .258-.074.567-.206.895a5.551 5.551 0 0 1-.54.996 6 6 0 0 1-.742.906c-.265.27-.547.489-.816.63a2.93 2.93 0 0 1-1.024.3 3.709 3.709 0 0 1-1.117-.047 3.928 3.928 0 0 1-1.066-.37 3.194 3.194 0 0 1-.871-.669 4.034 4.034 0 0 1-.68-1.012 4.028 4.028 0 0 1-.355-1.12 3.802 3.802 0 0 1-.012-1.153 3.5 3.5 0 0 1 .344-1.094c.187-.363.375-.664.586-.91.21-.242.441-.43.71-.57.266-.14.57-.23.922-.282a6.496 6.496 0 0 1 1.239-.046c.254.011.472.027.664.046.195.024.363.055.515.098a2.284 2.284 0 0 1 .813.39" id="path6"/>%0A</svg>';
|
|
144
|
-
|
|
145
|
-
// src/primitives/Dialog.tsx
|
|
146
|
-
var import_dialog = require("@ark-ui/react/dialog");
|
|
147
|
-
var import_portal = require("@ark-ui/react/portal");
|
|
148
|
-
|
|
149
|
-
// src/lib/cn.ts
|
|
150
|
-
var import_clsx = require("clsx");
|
|
151
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
152
|
-
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({ prefix: "polli" });
|
|
153
|
-
function cn(...inputs) {
|
|
154
|
-
return twMerge((0, import_clsx.clsx)(...inputs));
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// src/primitives/Dialog.tsx
|
|
158
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
159
|
-
var sizeClasses = {
|
|
160
|
-
sm: "polli:max-w-md",
|
|
161
|
-
md: "polli:max-w-xl",
|
|
162
|
-
lg: "polli:max-w-2xl"
|
|
163
|
-
};
|
|
164
|
-
var Dialog = ({
|
|
165
|
-
open,
|
|
166
|
-
onOpenChange,
|
|
167
|
-
trigger,
|
|
168
|
-
triggerAsChild = false,
|
|
169
|
-
triggerClassName,
|
|
170
|
-
title,
|
|
171
|
-
titleClassName,
|
|
172
|
-
ariaLabel,
|
|
173
|
-
labelledBy,
|
|
174
|
-
theme = "blue",
|
|
175
|
-
size = "md",
|
|
176
|
-
showBackdrop = true,
|
|
177
|
-
backdropClassName,
|
|
178
|
-
positionerClassName,
|
|
179
|
-
contentClassName,
|
|
180
|
-
children
|
|
181
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
182
|
-
import_dialog.Dialog.Root,
|
|
183
|
-
{
|
|
184
|
-
open,
|
|
185
|
-
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
186
|
-
children: [
|
|
187
|
-
trigger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
188
|
-
import_dialog.Dialog.Trigger,
|
|
189
|
-
{
|
|
190
|
-
asChild: triggerAsChild,
|
|
191
|
-
className: triggerClassName,
|
|
192
|
-
children: trigger
|
|
193
|
-
}
|
|
194
|
-
),
|
|
195
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_portal.Portal, { children: [
|
|
196
|
-
showBackdrop && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
197
|
-
import_dialog.Dialog.Backdrop,
|
|
198
|
-
{
|
|
199
|
-
className: cn(
|
|
200
|
-
"polli:fixed polli:inset-0 polli:z-[100] polli:bg-gray-950/50",
|
|
201
|
-
backdropClassName
|
|
202
|
-
)
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
206
|
-
import_dialog.Dialog.Positioner,
|
|
207
|
-
{
|
|
208
|
-
className: cn(
|
|
209
|
-
"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",
|
|
210
|
-
positionerClassName
|
|
211
|
-
),
|
|
212
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
213
|
-
import_dialog.Dialog.Content,
|
|
214
|
-
{
|
|
215
|
-
"data-theme": theme,
|
|
216
|
-
"aria-label": ariaLabel,
|
|
217
|
-
"aria-labelledby": labelledBy,
|
|
218
|
-
className: cn(
|
|
219
|
-
"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",
|
|
220
|
-
sizeClasses[size],
|
|
221
|
-
contentClassName
|
|
222
|
-
),
|
|
223
|
-
children: [
|
|
224
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
225
|
-
DialogTitle,
|
|
226
|
-
{
|
|
227
|
-
className: cn(
|
|
228
|
-
"polli:px-6 polli:pt-6 polli:font-subheading polli:text-xl polli:text-theme-text-strong",
|
|
229
|
-
titleClassName
|
|
230
|
-
),
|
|
231
|
-
children: title
|
|
232
|
-
}
|
|
233
|
-
),
|
|
234
|
-
children
|
|
235
|
-
]
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
}
|
|
239
|
-
)
|
|
240
|
-
] })
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
);
|
|
244
|
-
var DialogTitle = import_dialog.Dialog.Title;
|
|
245
|
-
|
|
246
|
-
// src/modules/auth/AuthModal.tsx
|
|
247
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
248
|
-
var authLogoMask = {
|
|
249
|
-
WebkitMask: `url(${logo_default}) center / contain no-repeat`,
|
|
250
|
-
mask: `url(${logo_default}) center / contain no-repeat`
|
|
251
|
-
};
|
|
252
|
-
function ErrorBanner({ children }) {
|
|
253
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "polli:rounded-lg polli:border-2 polli:border-intent-danger-border polli:bg-intent-danger-bg-light polli:p-4", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "polli:text-sm polli:text-intent-danger-text", children }) });
|
|
254
|
-
}
|
|
255
|
-
function AuthInfoCard({
|
|
256
|
-
title = "Authorize",
|
|
257
|
-
titleId,
|
|
258
|
-
children
|
|
259
|
-
}) {
|
|
260
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "polli:rounded-lg polli:border-2 polli:border-theme-border polli:bg-theme-bg-pale polli:p-4", children: [
|
|
261
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
262
|
-
"p",
|
|
263
|
-
{
|
|
264
|
-
id: titleId,
|
|
265
|
-
className: "polli:mb-2 polli:font-body polli:text-xs polli:font-semibold polli:tracking-wide polli:text-theme-text-soft",
|
|
266
|
-
children: title
|
|
267
|
-
}
|
|
268
|
-
),
|
|
269
|
-
children
|
|
270
|
-
] });
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// src/modules/modality/colors.ts
|
|
274
|
-
var MODALITY_COLORS = {
|
|
275
|
-
text: {
|
|
276
|
-
filled: "polli:bg-blue-200 polli:text-blue-900",
|
|
277
|
-
hover: "polli:hover:bg-blue-100 polli:hover:text-blue-900",
|
|
278
|
-
text: "polli:text-blue-800"
|
|
279
|
-
},
|
|
280
|
-
image: {
|
|
281
|
-
filled: "polli:bg-pink-200 polli:text-pink-900",
|
|
282
|
-
hover: "polli:hover:bg-pink-100 polli:hover:text-pink-900",
|
|
283
|
-
text: "polli:text-pink-800"
|
|
284
|
-
},
|
|
285
|
-
video: {
|
|
286
|
-
filled: "polli:bg-teal-200 polli:text-teal-900",
|
|
287
|
-
hover: "polli:hover:bg-teal-100 polli:hover:text-teal-900",
|
|
288
|
-
text: "polli:text-teal-800"
|
|
289
|
-
},
|
|
290
|
-
audio: {
|
|
291
|
-
filled: "polli:bg-violet-200 polli:text-violet-900",
|
|
292
|
-
hover: "polli:hover:bg-violet-100 polli:hover:text-violet-900",
|
|
293
|
-
text: "polli:text-violet-800"
|
|
294
|
-
},
|
|
295
|
-
realtime: {
|
|
296
|
-
filled: "polli:bg-green-200 polli:text-green-900",
|
|
297
|
-
hover: "polli:hover:bg-green-100 polli:hover:text-green-900",
|
|
298
|
-
text: "polli:text-green-800"
|
|
299
|
-
},
|
|
300
|
-
embedding: {
|
|
301
|
-
filled: "polli:bg-amber-200 polli:text-amber-900",
|
|
302
|
-
hover: "polli:hover:bg-amber-100 polli:hover:text-amber-900",
|
|
303
|
-
text: "polli:text-amber-800"
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
function normalize(category) {
|
|
307
|
-
const lower = category.toLowerCase();
|
|
308
|
-
if (lower === "images") return "image";
|
|
309
|
-
if (lower === "embeddings") return "embedding";
|
|
310
|
-
if (lower === "text" || lower === "image" || lower === "video" || lower === "audio" || lower === "realtime" || lower === "embedding") {
|
|
311
|
-
return lower;
|
|
312
|
-
}
|
|
313
|
-
return null;
|
|
314
|
-
}
|
|
315
|
-
function getModalityColors(category) {
|
|
316
|
-
const key = normalize(category);
|
|
317
|
-
return key ? MODALITY_COLORS[key] : null;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// src/modules/modality/ModalityButton.tsx
|
|
321
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
322
|
-
var ModalityButton = ({
|
|
323
|
-
category,
|
|
324
|
-
selected = true,
|
|
325
|
-
onClick,
|
|
326
|
-
disabled,
|
|
327
|
-
children
|
|
328
|
-
}) => {
|
|
329
|
-
const colors = getModalityColors(category ?? "");
|
|
330
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
331
|
-
"button",
|
|
332
|
-
{
|
|
333
|
-
type: "button",
|
|
334
|
-
onClick,
|
|
335
|
-
disabled,
|
|
336
|
-
"aria-pressed": selected,
|
|
337
|
-
className: cn(
|
|
338
|
-
"polli:inline-flex polli:shrink-0 polli:items-center polli:gap-1 polli:rounded-full polli:px-3 polli:py-1 polli:text-left polli:text-sm polli:font-medium polli:leading-normal polli:transition-colors",
|
|
339
|
-
selected ? colors?.filled ?? "polli:bg-gray-200 polli:text-gray-900" : "polli:bg-gray-100 polli:text-gray-600",
|
|
340
|
-
!disabled && !selected && colors?.hover,
|
|
341
|
-
disabled ? "polli:cursor-not-allowed polli:opacity-50" : "polli:cursor-pointer"
|
|
342
|
-
),
|
|
343
|
-
children
|
|
344
|
-
}
|
|
345
|
-
);
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
// src/primitives/Chip.tsx
|
|
349
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
350
|
-
var chipSizes = {
|
|
351
|
-
sm: "polli:px-2 polli:py-0.5 polli:text-xs",
|
|
352
|
-
md: "polli:px-2.5 polli:py-0.5 polli:text-sm",
|
|
353
|
-
lg: "polli:px-3 polli:py-1 polli:text-sm"
|
|
354
|
-
};
|
|
355
|
-
var intentClasses = {
|
|
356
|
-
news: "polli:bg-[oklch(0.935_0.06_158)] polli:text-[oklch(0.46_0.13_158)]",
|
|
357
|
-
alpha: "polli:bg-[oklch(0.93_0.06_300)] polli:text-[oklch(0.42_0.18_300)]",
|
|
358
|
-
neutral: "polli:border polli:border-gray-400/70 polli:bg-gray-100/80 polli:text-gray-900"
|
|
359
|
-
};
|
|
360
|
-
var Chip = ({
|
|
361
|
-
theme,
|
|
362
|
-
intent,
|
|
363
|
-
size = "md",
|
|
364
|
-
className,
|
|
365
|
-
children,
|
|
366
|
-
...rest
|
|
367
|
-
}) => {
|
|
368
|
-
const intentClass = intent ? intentClasses[intent] : "polli:bg-theme-bg-active polli:text-theme-text-strong";
|
|
369
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
370
|
-
"span",
|
|
371
|
-
{
|
|
372
|
-
...rest,
|
|
373
|
-
"data-theme": theme,
|
|
374
|
-
className: cn(
|
|
375
|
-
"polli:inline-flex polli:shrink-0 polli:items-center polli:gap-1 polli:rounded-lg polli:font-medium polli:leading-normal",
|
|
376
|
-
chipSizes[size],
|
|
377
|
-
intentClass,
|
|
378
|
-
className
|
|
379
|
-
),
|
|
380
|
-
children
|
|
381
|
-
}
|
|
382
|
-
);
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
// src/modules/wallet/chips.tsx
|
|
386
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
387
|
-
var PaidChip = ({
|
|
388
|
-
className,
|
|
389
|
-
children,
|
|
390
|
-
...props
|
|
391
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Chip, { ...props, className: cn("polli-wallet-chip-paid", className), children });
|
|
392
|
-
var TierChip = ({
|
|
393
|
-
className,
|
|
394
|
-
children,
|
|
395
|
-
...props
|
|
396
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Chip, { ...props, className: cn("polli-wallet-chip-tier", className), children });
|
|
397
|
-
|
|
398
|
-
// src/modules/wallet/format-pollen.ts
|
|
399
|
-
var BUDGET = 5;
|
|
400
|
-
var MAX_DECIMALS = 4;
|
|
401
|
-
var COMPACT_THRESHOLD = 1e5;
|
|
402
|
-
function floorTo(value, decimals) {
|
|
403
|
-
const factor = 10 ** decimals;
|
|
404
|
-
return Math.floor(value * factor) / factor;
|
|
405
|
-
}
|
|
406
|
-
function formatCompact(value) {
|
|
407
|
-
const abs = Math.abs(value);
|
|
408
|
-
const sign = value < 0 ? "-" : "";
|
|
409
|
-
const [unit, scale] = abs >= 1e9 ? ["B", 1e9] : abs >= 1e6 ? ["M", 1e6] : ["K", 1e3];
|
|
410
|
-
const ratio = abs / scale;
|
|
411
|
-
const intDigits = Math.max(1, Math.floor(Math.log10(ratio)) + 1);
|
|
412
|
-
const decimals = Math.max(0, 3 - intDigits);
|
|
413
|
-
const floored = floorTo(ratio, decimals);
|
|
414
|
-
return `${sign}${Number(floored.toFixed(decimals)).toString()}${unit}`;
|
|
415
|
-
}
|
|
416
|
-
function formatPollen(value) {
|
|
417
|
-
if (!Number.isFinite(value) || value === 0) return "0";
|
|
418
|
-
const abs = Math.abs(value);
|
|
419
|
-
if (abs >= COMPACT_THRESHOLD) return formatCompact(value);
|
|
420
|
-
const intDigits = abs >= 1 ? Math.floor(Math.log10(abs)) + 1 : 1;
|
|
421
|
-
const decimals = Math.min(MAX_DECIMALS, Math.max(0, BUDGET - intDigits));
|
|
422
|
-
const floored = floorTo(value, decimals);
|
|
423
|
-
if (floored === 0) return "0";
|
|
424
|
-
return Number(floored.toFixed(decimals)).toString();
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
// src/modules/wallet/wallet-display.tsx
|
|
428
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
429
|
-
var walletPanelClasses = {
|
|
430
|
-
paid: "polli-wallet-panel-paid",
|
|
431
|
-
tier: "polli-wallet-panel-tier"
|
|
432
|
-
};
|
|
433
|
-
var walletTextClasses = {
|
|
434
|
-
paid: "polli-wallet-text-paid",
|
|
435
|
-
tier: "polli-wallet-text-tier"
|
|
436
|
-
};
|
|
437
|
-
var WalletDot = ({ kind, className }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
438
|
-
"span",
|
|
439
|
-
{
|
|
440
|
-
className: cn(
|
|
441
|
-
"polli:h-2 polli:w-2 polli:rounded-full",
|
|
442
|
-
kind === "paid" ? "polli-wallet-dot-paid" : "polli-wallet-dot-tier",
|
|
443
|
-
className
|
|
444
|
-
),
|
|
445
|
-
"aria-hidden": "true"
|
|
446
|
-
}
|
|
447
|
-
);
|
|
448
|
-
var WalletBalanceCard = ({
|
|
449
|
-
kind,
|
|
450
|
-
label,
|
|
451
|
-
value,
|
|
452
|
-
info,
|
|
453
|
-
footer,
|
|
454
|
-
className
|
|
455
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
456
|
-
"div",
|
|
457
|
-
{
|
|
458
|
-
className: cn(
|
|
459
|
-
"polli:rounded-xl polli:p-4",
|
|
460
|
-
walletPanelClasses[kind],
|
|
461
|
-
className
|
|
462
|
-
),
|
|
463
|
-
children: [
|
|
464
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "polli:flex polli:items-center polli:gap-2", children: [
|
|
465
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WalletDot, { kind }),
|
|
466
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "polli:text-sm polli:font-bold polli:uppercase polli:tracking-wide polli:text-amber-900", children: label }),
|
|
467
|
-
info
|
|
468
|
-
] }),
|
|
469
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
470
|
-
"div",
|
|
471
|
-
{
|
|
472
|
-
className: cn(
|
|
473
|
-
"polli-wallet-balance-value polli:mt-1 polli:font-bold polli:leading-none polli:tracking-tight polli:tabular-nums",
|
|
474
|
-
walletTextClasses[kind]
|
|
475
|
-
),
|
|
476
|
-
children: value
|
|
477
|
-
}
|
|
478
|
-
),
|
|
479
|
-
footer && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "polli:mt-1.5 polli:text-sm polli:font-bold polli:tabular-nums polli:text-green-700", children: footer })
|
|
480
|
-
]
|
|
481
|
-
}
|
|
482
|
-
);
|
|
483
|
-
|
|
484
|
-
// src/primitives/Button.tsx
|
|
485
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
486
|
-
var sizes = {
|
|
487
|
-
small: "polli:px-2 polli:pt-0.5 polli:pb-1",
|
|
488
|
-
medium: "polli:px-4 polli:pt-1.5 polli:pb-2",
|
|
489
|
-
large: "polli:px-6 polli:py-3"
|
|
490
|
-
};
|
|
491
|
-
var themeClasses = "polli:bg-theme-bg-active polli:text-theme-text-base polli:hover:bg-theme-bg-hover polli:transition-colors";
|
|
492
|
-
var intentClasses2 = {
|
|
493
|
-
danger: "polli:bg-intent-danger-bg-light polli:text-intent-danger-text polli:hover:bg-[oklch(0.88_0.075_25)] polli:transition-colors"
|
|
494
|
-
};
|
|
495
|
-
var buttonClasses = ({
|
|
496
|
-
theme: _theme,
|
|
497
|
-
intent,
|
|
498
|
-
size,
|
|
499
|
-
className,
|
|
500
|
-
disabled
|
|
501
|
-
}) => {
|
|
502
|
-
const colorClasses = intent ? intentClasses2[intent] : themeClasses;
|
|
503
|
-
return cn(
|
|
504
|
-
"polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:self-center polli:placeholder-green-950 polli:font-medium polli:leading-normal polli:box-border",
|
|
505
|
-
disabled ? "polli:opacity-50 polli:cursor-not-allowed" : "polli:hover:filter polli:hover:brightness-105 polli:cursor-pointer",
|
|
506
|
-
colorClasses,
|
|
507
|
-
sizes[size || "medium"],
|
|
508
|
-
className
|
|
509
|
-
);
|
|
510
|
-
};
|
|
511
|
-
function Button({
|
|
512
|
-
as,
|
|
513
|
-
children,
|
|
514
|
-
theme,
|
|
515
|
-
intent,
|
|
516
|
-
size,
|
|
517
|
-
className,
|
|
518
|
-
disabled,
|
|
519
|
-
...buttonProps
|
|
520
|
-
}) {
|
|
521
|
-
const Component = as || "button";
|
|
522
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
523
|
-
Component,
|
|
524
|
-
{
|
|
525
|
-
"data-theme": intent ? void 0 : theme,
|
|
526
|
-
className: buttonClasses({
|
|
527
|
-
theme,
|
|
528
|
-
intent,
|
|
529
|
-
size,
|
|
530
|
-
className,
|
|
531
|
-
disabled
|
|
532
|
-
}),
|
|
533
|
-
disabled,
|
|
534
|
-
...buttonProps,
|
|
535
|
-
children
|
|
536
|
-
}
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
// src/primitives/ChevronIcon.tsx
|
|
541
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
542
|
-
var ChevronIcon = ({ expanded, className }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
543
|
-
"svg",
|
|
544
|
-
{
|
|
545
|
-
"aria-hidden": "true",
|
|
546
|
-
width: "12",
|
|
547
|
-
height: "12",
|
|
548
|
-
viewBox: "0 0 12 12",
|
|
549
|
-
className: cn(
|
|
550
|
-
"polli:shrink-0 polli:transition-transform polli:duration-200 polli:ease-out",
|
|
551
|
-
expanded && "polli:rotate-180",
|
|
552
|
-
className
|
|
553
|
-
),
|
|
554
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
555
|
-
"path",
|
|
556
|
-
{
|
|
557
|
-
d: "M3 4.5 6 7.5l3-3",
|
|
558
|
-
fill: "none",
|
|
559
|
-
stroke: "currentColor",
|
|
560
|
-
strokeLinecap: "round",
|
|
561
|
-
strokeLinejoin: "round",
|
|
562
|
-
strokeWidth: "1.5"
|
|
563
|
-
}
|
|
564
|
-
)
|
|
565
|
-
}
|
|
566
|
-
);
|
|
567
|
-
|
|
568
|
-
// src/primitives/Collapsible.tsx
|
|
569
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
570
|
-
var Collapsible = ({
|
|
571
|
-
label,
|
|
572
|
-
expanded,
|
|
573
|
-
onToggle,
|
|
574
|
-
children,
|
|
575
|
-
disabled = false,
|
|
576
|
-
wrapperClassName,
|
|
577
|
-
hoverClassName = "polli:hover:bg-theme-bg-active",
|
|
578
|
-
focusClassName,
|
|
579
|
-
panelClassName = "polli:border-t polli:border-theme-border polli:px-3 polli:pt-3 polli:pb-3",
|
|
580
|
-
ariaLabel
|
|
581
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
582
|
-
"div",
|
|
583
|
-
{
|
|
584
|
-
className: cn(
|
|
585
|
-
"polli:rounded-lg polli:border polli:transition-all",
|
|
586
|
-
wrapperClassName,
|
|
587
|
-
disabled && "polli:opacity-50"
|
|
588
|
-
),
|
|
589
|
-
children: [
|
|
590
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
591
|
-
"button",
|
|
592
|
-
{
|
|
593
|
-
type: "button",
|
|
594
|
-
"aria-expanded": expanded,
|
|
595
|
-
"aria-label": ariaLabel,
|
|
596
|
-
disabled,
|
|
597
|
-
onClick: onToggle,
|
|
598
|
-
className: cn(
|
|
599
|
-
"polli:w-full polli:flex polli:items-center polli:gap-3 polli:px-3 polli:py-2 polli:text-left polli:transition-colors",
|
|
600
|
-
expanded ? "polli:rounded-t-lg" : "polli:rounded-lg",
|
|
601
|
-
!disabled && hoverClassName,
|
|
602
|
-
focusClassName,
|
|
603
|
-
disabled ? "polli:cursor-not-allowed" : "polli:cursor-pointer"
|
|
604
|
-
),
|
|
605
|
-
children: [
|
|
606
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "polli:flex-1 polli:min-w-0", children: label }),
|
|
607
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
608
|
-
ChevronIcon,
|
|
609
|
-
{
|
|
610
|
-
expanded,
|
|
611
|
-
className: "polli:text-theme-text-soft"
|
|
612
|
-
}
|
|
613
|
-
)
|
|
614
|
-
]
|
|
615
|
-
}
|
|
616
|
-
),
|
|
617
|
-
expanded && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: panelClassName, children })
|
|
618
|
-
]
|
|
619
|
-
}
|
|
620
|
-
);
|
|
621
|
-
|
|
622
|
-
// src/primitives/CopyButton.tsx
|
|
623
|
-
var import_react2 = require("react");
|
|
624
|
-
|
|
625
|
-
// src/primitives/Tooltip.tsx
|
|
626
|
-
var import_react = require("react");
|
|
627
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
628
|
-
var TOOLTIP_MAX_WIDTH = 288;
|
|
629
|
-
var TOOLTIP_VIEWPORT_MARGIN = 12;
|
|
630
|
-
var Tooltip = ({
|
|
631
|
-
children,
|
|
632
|
-
content,
|
|
633
|
-
ariaLabel,
|
|
634
|
-
className,
|
|
635
|
-
onClick,
|
|
636
|
-
style,
|
|
637
|
-
triggerAs = "button",
|
|
638
|
-
displayContents = false
|
|
639
|
-
}) => {
|
|
640
|
-
const [showTooltip, setShowTooltip] = (0, import_react.useState)(false);
|
|
641
|
-
const [tooltipPosition, setTooltipPosition] = (0, import_react.useState)({
|
|
642
|
-
top: 0,
|
|
643
|
-
left: 0,
|
|
644
|
-
maxWidth: TOOLTIP_MAX_WIDTH
|
|
645
|
-
});
|
|
646
|
-
const triggerRef = (0, import_react.useRef)(null);
|
|
647
|
-
const updateTooltipPosition = () => {
|
|
648
|
-
if (triggerRef.current) {
|
|
649
|
-
const rect = triggerRef.current.getBoundingClientRect();
|
|
650
|
-
const maxWidth = Math.min(
|
|
651
|
-
TOOLTIP_MAX_WIDTH,
|
|
652
|
-
window.innerWidth - TOOLTIP_VIEWPORT_MARGIN * 2
|
|
653
|
-
);
|
|
654
|
-
const left = Math.min(
|
|
655
|
-
Math.max(rect.left, TOOLTIP_VIEWPORT_MARGIN),
|
|
656
|
-
Math.max(
|
|
657
|
-
TOOLTIP_VIEWPORT_MARGIN,
|
|
658
|
-
window.innerWidth - maxWidth - TOOLTIP_VIEWPORT_MARGIN
|
|
659
|
-
)
|
|
660
|
-
);
|
|
661
|
-
setTooltipPosition({
|
|
662
|
-
top: rect.bottom + 4,
|
|
663
|
-
left,
|
|
664
|
-
maxWidth
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
const triggerClassName = cn(
|
|
669
|
-
"polli:relative polli:cursor-help polli:text-left polli:inline-flex polli:items-center",
|
|
670
|
-
className
|
|
671
|
-
);
|
|
672
|
-
const cursorClass = displayContents ? "polli:contents" : "polli:cursor-help";
|
|
673
|
-
const popupClasses = "polli:fixed polli:w-max polli:px-2 polli:py-1 polli:bg-theme-bg-pale polli:text-theme-text-strong polli:border polli:border-theme-border polli:text-xs polli:rounded-md polli:shadow-sm polli:z-50 polli:pointer-events-none polli:transition-opacity polli:whitespace-pre-line polli:break-words";
|
|
674
|
-
const contentNode = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
675
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: cursorClass, children }),
|
|
676
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
677
|
-
"span",
|
|
678
|
-
{
|
|
679
|
-
style: {
|
|
680
|
-
top: tooltipPosition.top,
|
|
681
|
-
left: tooltipPosition.left,
|
|
682
|
-
maxWidth: tooltipPosition.maxWidth
|
|
683
|
-
},
|
|
684
|
-
className: `${showTooltip ? "polli:visible polli:opacity-100" : "polli:invisible polli:opacity-0"} ${popupClasses}`,
|
|
685
|
-
children: content
|
|
686
|
-
}
|
|
687
|
-
)
|
|
688
|
-
] });
|
|
689
|
-
const sharedProps = {
|
|
690
|
-
"aria-label": ariaLabel,
|
|
691
|
-
className: triggerClassName,
|
|
692
|
-
onMouseEnter: () => {
|
|
693
|
-
updateTooltipPosition();
|
|
694
|
-
setShowTooltip(true);
|
|
695
|
-
},
|
|
696
|
-
onMouseLeave: () => setShowTooltip(false),
|
|
697
|
-
onClick: (e) => {
|
|
698
|
-
e.stopPropagation();
|
|
699
|
-
if (onClick) {
|
|
700
|
-
onClick();
|
|
701
|
-
}
|
|
702
|
-
if (triggerAs === "span") {
|
|
703
|
-
return;
|
|
704
|
-
}
|
|
705
|
-
updateTooltipPosition();
|
|
706
|
-
setShowTooltip((prev) => !prev);
|
|
707
|
-
},
|
|
708
|
-
style
|
|
709
|
-
};
|
|
710
|
-
if (triggerAs === "span") {
|
|
711
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
712
|
-
"span",
|
|
713
|
-
{
|
|
714
|
-
ref: (node) => {
|
|
715
|
-
triggerRef.current = node;
|
|
716
|
-
},
|
|
717
|
-
...sharedProps,
|
|
718
|
-
children: contentNode
|
|
719
|
-
}
|
|
720
|
-
);
|
|
721
|
-
}
|
|
722
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
723
|
-
"button",
|
|
724
|
-
{
|
|
725
|
-
ref: (node) => {
|
|
726
|
-
triggerRef.current = node;
|
|
727
|
-
},
|
|
728
|
-
type: "button",
|
|
729
|
-
"aria-label": ariaLabel,
|
|
730
|
-
className: triggerClassName,
|
|
731
|
-
onMouseEnter: sharedProps.onMouseEnter,
|
|
732
|
-
onMouseLeave: sharedProps.onMouseLeave,
|
|
733
|
-
onClick: sharedProps.onClick,
|
|
734
|
-
style,
|
|
735
|
-
children: contentNode
|
|
736
|
-
}
|
|
737
|
-
);
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
// src/primitives/CopyButton.tsx
|
|
741
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
742
|
-
function CopyButton({
|
|
743
|
-
value,
|
|
744
|
-
children,
|
|
745
|
-
copiedTimeoutMs = 2e3,
|
|
746
|
-
tooltip = "Click to copy",
|
|
747
|
-
copiedTooltip = "Copied!",
|
|
748
|
-
tooltipClassName,
|
|
749
|
-
className,
|
|
750
|
-
onCopied,
|
|
751
|
-
onCopyError,
|
|
752
|
-
...buttonProps
|
|
753
|
-
}) {
|
|
754
|
-
const [copied, setCopied] = (0, import_react2.useState)(false);
|
|
755
|
-
const timeoutRef = (0, import_react2.useRef)(null);
|
|
756
|
-
(0, import_react2.useEffect)(
|
|
757
|
-
() => () => {
|
|
758
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
759
|
-
},
|
|
760
|
-
[]
|
|
761
|
-
);
|
|
762
|
-
async function handleCopy(event) {
|
|
763
|
-
event.stopPropagation();
|
|
764
|
-
try {
|
|
765
|
-
const text = typeof value === "function" ? await value() : value;
|
|
766
|
-
await navigator.clipboard.writeText(text);
|
|
767
|
-
setCopied(true);
|
|
768
|
-
onCopied?.();
|
|
769
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
770
|
-
timeoutRef.current = setTimeout(
|
|
771
|
-
() => setCopied(false),
|
|
772
|
-
copiedTimeoutMs
|
|
773
|
-
);
|
|
774
|
-
} catch (error) {
|
|
775
|
-
onCopyError?.(error);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
const button = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
779
|
-
"button",
|
|
780
|
-
{
|
|
781
|
-
...buttonProps,
|
|
782
|
-
type: "button",
|
|
783
|
-
onClick: handleCopy,
|
|
784
|
-
className: cn(
|
|
785
|
-
typeof className === "function" ? className(copied) : className
|
|
786
|
-
),
|
|
787
|
-
children: typeof children === "function" ? children(copied) : children
|
|
788
|
-
}
|
|
789
|
-
);
|
|
790
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
791
|
-
Tooltip,
|
|
792
|
-
{
|
|
793
|
-
triggerAs: "span",
|
|
794
|
-
content: copied ? copiedTooltip : tooltip,
|
|
795
|
-
className: tooltipClassName,
|
|
796
|
-
children: button
|
|
797
|
-
}
|
|
798
|
-
);
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
// src/primitives/Dropdown.tsx
|
|
802
|
-
var import_popover = require("@ark-ui/react/popover");
|
|
803
|
-
var import_portal2 = require("@ark-ui/react/portal");
|
|
804
|
-
var import_react3 = require("react");
|
|
805
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
806
|
-
var DEFAULT_PANEL = "polli:rounded-lg polli:border polli:border-theme-border polli:bg-surface-white polli:shadow-lg";
|
|
807
|
-
var Dropdown = ({
|
|
808
|
-
theme,
|
|
809
|
-
trigger,
|
|
810
|
-
children,
|
|
811
|
-
align = "start",
|
|
812
|
-
open: openProp,
|
|
813
|
-
onOpenChange,
|
|
814
|
-
panelClassName,
|
|
815
|
-
className
|
|
816
|
-
}) => {
|
|
817
|
-
const [internalOpen, setInternalOpen] = (0, import_react3.useState)(false);
|
|
818
|
-
const isControlled = openProp !== void 0;
|
|
819
|
-
const open = isControlled ? openProp : internalOpen;
|
|
820
|
-
const setOpen = (next) => {
|
|
821
|
-
if (!isControlled) setInternalOpen(next);
|
|
822
|
-
onOpenChange?.(next);
|
|
823
|
-
};
|
|
824
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
825
|
-
import_popover.Popover.Root,
|
|
826
|
-
{
|
|
827
|
-
open,
|
|
828
|
-
onOpenChange: (details) => setOpen(details.open),
|
|
829
|
-
positioning: {
|
|
830
|
-
placement: align === "end" ? "bottom-end" : "bottom-start"
|
|
831
|
-
},
|
|
832
|
-
children: [
|
|
833
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_popover.Popover.Trigger, { asChild: true, children: trigger(open) }),
|
|
834
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_portal2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_popover.Popover.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
835
|
-
import_popover.Popover.Content,
|
|
836
|
-
{
|
|
837
|
-
"data-theme": theme,
|
|
838
|
-
className: cn(
|
|
839
|
-
"polli:z-50 polli:overflow-hidden polli:focus:outline-none",
|
|
840
|
-
panelClassName ?? DEFAULT_PANEL,
|
|
841
|
-
className
|
|
842
|
-
),
|
|
843
|
-
children: typeof children === "function" ? children(() => setOpen(false)) : children
|
|
844
|
-
}
|
|
845
|
-
) }) })
|
|
846
|
-
]
|
|
847
|
-
}
|
|
848
|
-
);
|
|
849
|
-
};
|
|
850
|
-
|
|
851
|
-
// src/primitives/icons/index.tsx
|
|
852
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
853
|
-
var strokeProps = {
|
|
854
|
-
fill: "none",
|
|
855
|
-
stroke: "currentColor",
|
|
856
|
-
strokeWidth: 2,
|
|
857
|
-
strokeLinecap: "round",
|
|
858
|
-
strokeLinejoin: "round"
|
|
859
|
-
};
|
|
860
|
-
function AppIcon(props) {
|
|
861
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
862
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("rect", { x: "2", y: "4", width: "20", height: "14", rx: "2" }),
|
|
863
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M2 20h20" })
|
|
864
|
-
] });
|
|
865
|
-
}
|
|
866
|
-
function BeakerIcon(props) {
|
|
867
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
868
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M9 3h6" }),
|
|
869
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.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" }),
|
|
870
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M7 14h10" })
|
|
871
|
-
] });
|
|
872
|
-
}
|
|
873
|
-
function BookIcon(props) {
|
|
874
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
875
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M4 4h5a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H4z" }),
|
|
876
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M20 4h-5a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h6z" })
|
|
877
|
-
] });
|
|
878
|
-
}
|
|
879
|
-
function CheckIcon(props) {
|
|
880
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
881
|
-
"svg",
|
|
882
|
-
{
|
|
883
|
-
"aria-hidden": "true",
|
|
884
|
-
viewBox: "0 0 24 24",
|
|
885
|
-
...strokeProps,
|
|
886
|
-
strokeWidth: 2.5,
|
|
887
|
-
...props,
|
|
888
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("polyline", { points: "20 6 9 17 4 12" })
|
|
889
|
-
}
|
|
890
|
-
);
|
|
891
|
-
}
|
|
892
|
-
function ClipboardIcon(props) {
|
|
893
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
894
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
895
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
896
|
-
] });
|
|
897
|
-
}
|
|
898
|
-
function ClockIcon(props) {
|
|
899
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
900
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
901
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M12 7v5l3 2" })
|
|
902
|
-
] });
|
|
903
|
-
}
|
|
904
|
-
function DiscordIcon(props) {
|
|
905
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
906
|
-
"path",
|
|
907
|
-
{
|
|
908
|
-
fill: "currentColor",
|
|
909
|
-
d: "M20.32 4.37A19.8 19.8 0 0 0 15.36 2.83a.07.07 0 0 0-.08.04c-.21.38-.45.88-.62 1.27a18.27 18.27 0 0 0-5.52 0 12.84 12.84 0 0 0-.63-1.27.08.08 0 0 0-.08-.04A19.74 19.74 0 0 0 3.47 4.37a.07.07 0 0 0-.03.03C.31 9.07-.55 13.61-.13 18.1a.08.08 0 0 0 .03.06 19.9 19.9 0 0 0 6.08 3.07.08.08 0 0 0 .09-.03c.47-.64.88-1.31 1.24-2.02a.08.08 0 0 0-.04-.1 13.08 13.08 0 0 1-1.9-.91.08.08 0 0 1-.01-.13c.13-.1.25-.2.37-.29a.07.07 0 0 1 .08-.01 14.24 14.24 0 0 0 12.38 0 .07.07 0 0 1 .08.01c.12.1.25.2.38.3a.08.08 0 0 1-.01.12 12.22 12.22 0 0 1-1.9.9.08.08 0 0 0-.04.11c.36.7.77 1.38 1.23 2.02a.08.08 0 0 0 .1.03 19.84 19.84 0 0 0 6.08-3.07.08.08 0 0 0 .03-.05c.5-5.2-.84-9.7-3.77-13.71a.06.06 0 0 0-.03-.03ZM8.02 15.37c-1.18 0-2.16-1.08-2.16-2.4 0-1.32.96-2.4 2.16-2.4 1.2 0 2.18 1.09 2.16 2.4 0 1.32-.96 2.4-2.16 2.4Zm7.96 0c-1.18 0-2.16-1.08-2.16-2.4 0-1.32.96-2.4 2.16-2.4 1.2 0 2.18 1.09 2.16 2.4 0 1.32-.95 2.4-2.16 2.4Z"
|
|
910
|
-
}
|
|
911
|
-
) });
|
|
912
|
-
}
|
|
913
|
-
function DownloadIcon(props) {
|
|
914
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
915
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
916
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("polyline", { points: "7 10 12 15 17 10" }),
|
|
917
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
918
|
-
] });
|
|
919
|
-
}
|
|
920
|
-
function ExternalLinkIcon(props) {
|
|
921
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M7 17 17 7M9 7h8v8" }) });
|
|
922
|
-
}
|
|
923
|
-
function GenApiIcon(props) {
|
|
924
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
925
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "m8 3 4 1.5L16 3v18l-4-1.5L8 21z" }),
|
|
926
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M8 3v18M16 3v18" })
|
|
927
|
-
] });
|
|
928
|
-
}
|
|
929
|
-
function GitHubIcon(props) {
|
|
930
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
931
|
-
"path",
|
|
932
|
-
{
|
|
933
|
-
fill: "currentColor",
|
|
934
|
-
d: "M12 .5A11.5 11.5 0 0 0 8.36 22.9c.58.11.79-.25.79-.56v-2.16c-3.21.7-3.89-1.38-3.89-1.38-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.04 1.76 2.71 1.25 3.37.96.11-.75.4-1.25.74-1.54-2.56-.29-5.26-1.28-5.26-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.06 0 0 .97-.31 3.16 1.18a10.88 10.88 0 0 1 5.76 0c2.19-1.49 3.15-1.18 3.15-1.18.63 1.6.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.41.36.78 1.06.78 2.14v3.19c0 .31.21.68.8.56A11.5 11.5 0 0 0 12 .5Z"
|
|
935
|
-
}
|
|
936
|
-
) });
|
|
937
|
-
}
|
|
938
|
-
function ImageIcon(props) {
|
|
939
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
940
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
941
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("circle", { cx: "9", cy: "9", r: "2" }),
|
|
942
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "m21 15-5-5L5 21" })
|
|
943
|
-
] });
|
|
944
|
-
}
|
|
945
|
-
function LockIcon(props) {
|
|
946
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
947
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
|
|
948
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
949
|
-
] });
|
|
950
|
-
}
|
|
951
|
-
function MailIcon(props) {
|
|
952
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
953
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
954
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "m3 7 9 7 9-7" })
|
|
955
|
-
] });
|
|
956
|
-
}
|
|
957
|
-
function McpIcon(props) {
|
|
958
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
959
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("rect", { x: "2", y: "7", width: "8", height: "10", rx: "1.5" }),
|
|
960
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("rect", { x: "14", y: "7", width: "8", height: "10", rx: "1.5" }),
|
|
961
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M10 12h4" })
|
|
962
|
-
] });
|
|
963
|
-
}
|
|
964
|
-
function MenuIcon(props) {
|
|
965
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M4 7h16M4 12h16M4 17h16" }) });
|
|
966
|
-
}
|
|
967
|
-
function TerminalIcon(props) {
|
|
968
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
969
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("polyline", { points: "4 8 8 12 4 16" }),
|
|
970
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("line", { x1: "12", y1: "20", x2: "20", y2: "20" })
|
|
971
|
-
] });
|
|
972
|
-
}
|
|
973
|
-
function TokensIcon(props) {
|
|
974
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M4 9h16M4 15h16M10 3 8 21M16 3l-2 18" }) });
|
|
975
|
-
}
|
|
976
|
-
function TrendUpIcon(props) {
|
|
977
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
978
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("polyline", { points: "3 17 9 11 13 15 21 7" }),
|
|
979
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("polyline", { points: "15 7 21 7 21 13" })
|
|
980
|
-
] });
|
|
981
|
-
}
|
|
982
|
-
function WalletIcon(props) {
|
|
983
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: [
|
|
984
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M3 7a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v2H5a2 2 0 0 0-2 2V7Z" }),
|
|
985
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.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" }),
|
|
986
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("circle", { cx: "17", cy: "14", r: "1.25", fill: "currentColor" })
|
|
987
|
-
] });
|
|
988
|
-
}
|
|
989
|
-
function XIcon(props) {
|
|
990
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", ...strokeProps, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
// src/primitives/ExternalLinkButton.tsx
|
|
994
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
995
|
-
var ExternalLinkButton = ({
|
|
996
|
-
theme,
|
|
997
|
-
href,
|
|
998
|
-
size = "medium",
|
|
999
|
-
className,
|
|
1000
|
-
children
|
|
1001
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1002
|
-
Button,
|
|
1003
|
-
{
|
|
1004
|
-
as: "a",
|
|
1005
|
-
href,
|
|
1006
|
-
target: "_blank",
|
|
1007
|
-
rel: "noopener noreferrer",
|
|
1008
|
-
theme,
|
|
1009
|
-
size,
|
|
1010
|
-
className: cn("polli:gap-2", className),
|
|
1011
|
-
children: [
|
|
1012
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children }),
|
|
1013
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1014
|
-
ExternalLinkIcon,
|
|
1015
|
-
{
|
|
1016
|
-
className: "polli:h-4 polli:w-4 polli:shrink-0 polli:opacity-60",
|
|
1017
|
-
"aria-hidden": "true"
|
|
1018
|
-
}
|
|
1019
|
-
)
|
|
1020
|
-
]
|
|
1021
|
-
}
|
|
1022
|
-
);
|
|
1023
|
-
|
|
1024
|
-
// src/primitives/Field.tsx
|
|
1025
|
-
var import_field = require("@ark-ui/react/field");
|
|
1026
|
-
|
|
1027
|
-
// src/primitives/IconButton.tsx
|
|
1028
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1029
|
-
var intentClasses3 = {
|
|
1030
|
-
danger: "polli:bg-intent-danger-bg-light polli:hover:bg-[oklch(0.88_0.075_25)] polli:text-intent-danger-text"
|
|
1031
|
-
};
|
|
1032
|
-
var defaultClasses = "polli:bg-theme-bg-active polli:hover:bg-theme-bg-hover polli:text-theme-text-soft polli:hover:text-theme-text-strong";
|
|
1033
|
-
var IconButton = ({
|
|
1034
|
-
intent,
|
|
1035
|
-
title,
|
|
1036
|
-
onClick,
|
|
1037
|
-
children,
|
|
1038
|
-
className
|
|
1039
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1040
|
-
"button",
|
|
1041
|
-
{
|
|
1042
|
-
type: "button",
|
|
1043
|
-
onClick,
|
|
1044
|
-
title,
|
|
1045
|
-
"aria-label": title,
|
|
1046
|
-
className: cn(
|
|
1047
|
-
"polli:inline-flex polli:h-6 polli:w-6 polli:cursor-pointer polli:items-center polli:justify-center polli:rounded polli:transition-colors",
|
|
1048
|
-
intent ? intentClasses3[intent] : defaultClasses,
|
|
1049
|
-
className
|
|
1050
|
-
),
|
|
1051
|
-
children
|
|
1052
|
-
}
|
|
1053
|
-
);
|
|
1054
|
-
|
|
1055
|
-
// src/primitives/InfoTip.tsx
|
|
1056
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1057
|
-
var InfoTip = ({
|
|
1058
|
-
text,
|
|
1059
|
-
content,
|
|
1060
|
-
label = "More info"
|
|
1061
|
-
}) => /* @__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" }) });
|
|
1062
|
-
|
|
1063
|
-
// src/primitives/Input.tsx
|
|
1064
|
-
var import_react4 = require("react");
|
|
1065
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1066
|
-
var Input = (0, import_react4.forwardRef)(
|
|
1067
|
-
({ className, error, hideNumberSteppers, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1068
|
-
"input",
|
|
1069
|
-
{
|
|
1070
|
-
ref,
|
|
1071
|
-
className: cn(
|
|
1072
|
-
"polli:px-3 polli:py-2 polli:border polli:rounded-lg",
|
|
1073
|
-
"polli:disabled:opacity-50 polli:disabled:cursor-not-allowed",
|
|
1074
|
-
error ? "polli:border-red-400" : "polli:border-gray-300",
|
|
1075
|
-
hideNumberSteppers && "polli-input-number-clean",
|
|
1076
|
-
className
|
|
1077
|
-
),
|
|
1078
|
-
...props
|
|
1079
|
-
}
|
|
1080
|
-
)
|
|
1081
|
-
);
|
|
1082
|
-
|
|
1083
|
-
// src/primitives/ScrollArea.tsx
|
|
1084
|
-
var import_react5 = require("react");
|
|
1085
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1086
|
-
var axisClasses = {
|
|
1087
|
-
y: "polli:overflow-y-auto polli:overflow-x-hidden",
|
|
1088
|
-
x: "polli:overflow-x-auto polli:overflow-y-hidden",
|
|
1089
|
-
both: "polli:overflow-auto"
|
|
1090
|
-
};
|
|
1091
|
-
function assignRef(ref, value) {
|
|
1092
|
-
if (typeof ref === "function") ref(value);
|
|
1093
|
-
else if (ref) ref.current = value;
|
|
1094
|
-
}
|
|
1095
|
-
var ScrollArea = (0, import_react5.forwardRef)(
|
|
1096
|
-
({ theme, axis = "y", hideDelayMs = 2e3, className, children, ...rest }, externalRef) => {
|
|
1097
|
-
const innerRef = (0, import_react5.useRef)(null);
|
|
1098
|
-
const setRef = (0, import_react5.useCallback)(
|
|
1099
|
-
(node) => {
|
|
1100
|
-
innerRef.current = node;
|
|
1101
|
-
assignRef(externalRef, node);
|
|
1102
|
-
},
|
|
1103
|
-
[externalRef]
|
|
1104
|
-
);
|
|
1105
|
-
(0, import_react5.useEffect)(() => {
|
|
1106
|
-
const element = innerRef.current;
|
|
1107
|
-
if (!element) return;
|
|
1108
|
-
let hideTimer = null;
|
|
1109
|
-
const clearHideTimer = () => {
|
|
1110
|
-
if (hideTimer !== null) {
|
|
1111
|
-
window.clearTimeout(hideTimer);
|
|
1112
|
-
hideTimer = null;
|
|
1113
|
-
}
|
|
1114
|
-
};
|
|
1115
|
-
const show = () => {
|
|
1116
|
-
element.dataset.scrollbarActive = "true";
|
|
1117
|
-
clearHideTimer();
|
|
1118
|
-
};
|
|
1119
|
-
const hide = () => {
|
|
1120
|
-
element.dataset.scrollbarActive = "false";
|
|
1121
|
-
clearHideTimer();
|
|
1122
|
-
};
|
|
1123
|
-
const scheduleHide = () => {
|
|
1124
|
-
clearHideTimer();
|
|
1125
|
-
hideTimer = window.setTimeout(hide, hideDelayMs);
|
|
1126
|
-
};
|
|
1127
|
-
const handleInteraction = () => {
|
|
1128
|
-
show();
|
|
1129
|
-
scheduleHide();
|
|
1130
|
-
};
|
|
1131
|
-
hide();
|
|
1132
|
-
element.addEventListener("scroll", handleInteraction, {
|
|
1133
|
-
passive: true
|
|
1134
|
-
});
|
|
1135
|
-
element.addEventListener("wheel", handleInteraction, {
|
|
1136
|
-
passive: true
|
|
1137
|
-
});
|
|
1138
|
-
element.addEventListener("touchstart", handleInteraction, {
|
|
1139
|
-
passive: true
|
|
1140
|
-
});
|
|
1141
|
-
element.addEventListener("pointerdown", handleInteraction);
|
|
1142
|
-
element.addEventListener("keydown", handleInteraction);
|
|
1143
|
-
element.addEventListener("focusin", handleInteraction);
|
|
1144
|
-
element.addEventListener("focusout", scheduleHide);
|
|
1145
|
-
return () => {
|
|
1146
|
-
clearHideTimer();
|
|
1147
|
-
element.removeEventListener("scroll", handleInteraction);
|
|
1148
|
-
element.removeEventListener("wheel", handleInteraction);
|
|
1149
|
-
element.removeEventListener("touchstart", handleInteraction);
|
|
1150
|
-
element.removeEventListener("pointerdown", handleInteraction);
|
|
1151
|
-
element.removeEventListener("keydown", handleInteraction);
|
|
1152
|
-
element.removeEventListener("focusin", handleInteraction);
|
|
1153
|
-
element.removeEventListener("focusout", scheduleHide);
|
|
1154
|
-
};
|
|
1155
|
-
}, [hideDelayMs]);
|
|
1156
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1157
|
-
"div",
|
|
1158
|
-
{
|
|
1159
|
-
...rest,
|
|
1160
|
-
ref: setRef,
|
|
1161
|
-
"data-theme": theme,
|
|
1162
|
-
className: cn(
|
|
1163
|
-
"polli-scrollbar-subtle",
|
|
1164
|
-
axisClasses[axis],
|
|
1165
|
-
className
|
|
1166
|
-
),
|
|
1167
|
-
children
|
|
1168
|
-
}
|
|
1169
|
-
);
|
|
1170
|
-
}
|
|
1171
|
-
);
|
|
1172
|
-
ScrollArea.displayName = "ScrollArea";
|
|
1173
|
-
|
|
1174
|
-
// src/primitives/MultiSelect.tsx
|
|
1175
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1176
|
-
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";
|
|
1177
|
-
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";
|
|
1178
|
-
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";
|
|
1179
|
-
var MultiSelect = ({
|
|
1180
|
-
options,
|
|
1181
|
-
selected,
|
|
1182
|
-
onChange,
|
|
1183
|
-
placeholder,
|
|
1184
|
-
disabled,
|
|
1185
|
-
disabledText,
|
|
1186
|
-
align = "start",
|
|
1187
|
-
label,
|
|
1188
|
-
theme
|
|
1189
|
-
}) => {
|
|
1190
|
-
const isAllSelected = selected.length === 0;
|
|
1191
|
-
const toggleItem = (itemId) => {
|
|
1192
|
-
if (selected.includes(itemId)) {
|
|
1193
|
-
onChange(selected.filter((m) => m !== itemId));
|
|
1194
|
-
} else {
|
|
1195
|
-
onChange([...selected, itemId]);
|
|
1196
|
-
}
|
|
1197
|
-
};
|
|
1198
|
-
const selectAll = () => onChange([]);
|
|
1199
|
-
const displayText = disabled ? disabledText : isAllSelected ? "All" : `${selected.length} selected`;
|
|
1200
|
-
const labelNode = label ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "polli:text-xs polli:font-medium polli:text-theme-text-soft", children: label }) : null;
|
|
1201
|
-
if (disabled) {
|
|
1202
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1203
|
-
"div",
|
|
1204
|
-
{
|
|
1205
|
-
"data-theme": theme,
|
|
1206
|
-
className: "polli:group polli:relative polli:flex polli:items-center polli:gap-2",
|
|
1207
|
-
children: [
|
|
1208
|
-
labelNode,
|
|
1209
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1210
|
-
"button",
|
|
1211
|
-
{
|
|
1212
|
-
type: "button",
|
|
1213
|
-
disabled: true,
|
|
1214
|
-
className: cn(
|
|
1215
|
-
TRIGGER_BASE,
|
|
1216
|
-
"polli:cursor-not-allowed polli:border-theme-border polli:bg-theme-bg-subtle polli:opacity-60"
|
|
1217
|
-
),
|
|
1218
|
-
children: [
|
|
1219
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "polli:flex-1 polli:truncate polli:text-left polli:text-theme-text-soft/60", children: displayText }),
|
|
1220
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1221
|
-
ChevronIcon,
|
|
1222
|
-
{
|
|
1223
|
-
expanded: false,
|
|
1224
|
-
className: "polli:h-3 polli:w-3 polli:text-theme-text-soft"
|
|
1225
|
-
}
|
|
1226
|
-
)
|
|
1227
|
-
]
|
|
1228
|
-
}
|
|
1229
|
-
),
|
|
1230
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.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" })
|
|
1231
|
-
]
|
|
1232
|
-
}
|
|
1233
|
-
);
|
|
1234
|
-
}
|
|
1235
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1236
|
-
"div",
|
|
1237
|
-
{
|
|
1238
|
-
"data-theme": theme,
|
|
1239
|
-
className: "polli:flex polli:items-center polli:gap-2",
|
|
1240
|
-
children: [
|
|
1241
|
-
labelNode,
|
|
1242
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1243
|
-
Dropdown,
|
|
1244
|
-
{
|
|
1245
|
-
theme,
|
|
1246
|
-
align,
|
|
1247
|
-
className: "polli:min-w-[320px]",
|
|
1248
|
-
trigger: (open) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1249
|
-
"button",
|
|
1250
|
-
{
|
|
1251
|
-
type: "button",
|
|
1252
|
-
className: cn(
|
|
1253
|
-
TRIGGER_BASE,
|
|
1254
|
-
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"
|
|
1255
|
-
),
|
|
1256
|
-
children: [
|
|
1257
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1258
|
-
"span",
|
|
1259
|
-
{
|
|
1260
|
-
className: cn(
|
|
1261
|
-
"polli:flex-1 polli:truncate polli:text-left",
|
|
1262
|
-
open ? "polli:text-theme-text-strong" : "polli:text-theme-text-base"
|
|
1263
|
-
),
|
|
1264
|
-
children: displayText
|
|
1265
|
-
}
|
|
1266
|
-
),
|
|
1267
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1268
|
-
ChevronIcon,
|
|
1269
|
-
{
|
|
1270
|
-
expanded: open,
|
|
1271
|
-
className: cn(
|
|
1272
|
-
"polli:h-3 polli:w-3 polli:transition-transform",
|
|
1273
|
-
open ? "polli:text-theme-text-strong" : "polli:text-theme-text-soft"
|
|
1274
|
-
)
|
|
1275
|
-
}
|
|
1276
|
-
)
|
|
1277
|
-
]
|
|
1278
|
-
}
|
|
1279
|
-
),
|
|
1280
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(ScrollArea, { theme, className: "polli:max-h-64", children: [
|
|
1281
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1282
|
-
"button",
|
|
1283
|
-
{
|
|
1284
|
-
type: "button",
|
|
1285
|
-
onClick: selectAll,
|
|
1286
|
-
className: cn(
|
|
1287
|
-
ROW_BASE,
|
|
1288
|
-
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"
|
|
1289
|
-
),
|
|
1290
|
-
children: [
|
|
1291
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1292
|
-
"span",
|
|
1293
|
-
{
|
|
1294
|
-
className: cn(
|
|
1295
|
-
CHECK_BASE,
|
|
1296
|
-
isAllSelected && "polli:bg-theme-bg-active polli:text-theme-text-strong"
|
|
1297
|
-
),
|
|
1298
|
-
children: isAllSelected && "\u2713"
|
|
1299
|
-
}
|
|
1300
|
-
),
|
|
1301
|
-
placeholder
|
|
1302
|
-
]
|
|
1303
|
-
}
|
|
1304
|
-
),
|
|
1305
|
-
options.map((opt) => {
|
|
1306
|
-
const isChecked = selected.includes(opt.value);
|
|
1307
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1308
|
-
"button",
|
|
1309
|
-
{
|
|
1310
|
-
type: "button",
|
|
1311
|
-
onClick: () => toggleItem(opt.value),
|
|
1312
|
-
className: cn(
|
|
1313
|
-
ROW_BASE,
|
|
1314
|
-
isChecked ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-theme-text-base polli:hover:bg-theme-bg-subtle"
|
|
1315
|
-
),
|
|
1316
|
-
children: [
|
|
1317
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1318
|
-
"span",
|
|
1319
|
-
{
|
|
1320
|
-
className: cn(
|
|
1321
|
-
CHECK_BASE,
|
|
1322
|
-
isChecked && "polli:bg-theme-bg-active polli:text-theme-text-strong"
|
|
1323
|
-
),
|
|
1324
|
-
children: isChecked && "\u2713"
|
|
1325
|
-
}
|
|
1326
|
-
),
|
|
1327
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "polli:whitespace-nowrap", children: opt.label })
|
|
1328
|
-
]
|
|
1329
|
-
},
|
|
1330
|
-
opt.value
|
|
1331
|
-
);
|
|
1332
|
-
})
|
|
1333
|
-
] })
|
|
1334
|
-
}
|
|
1335
|
-
)
|
|
1336
|
-
]
|
|
1337
|
-
}
|
|
1338
|
-
);
|
|
1339
|
-
};
|
|
1340
|
-
|
|
1341
|
-
// src/primitives/PeriodPicker.tsx
|
|
1342
|
-
var import_react6 = require("react");
|
|
1343
|
-
|
|
1344
|
-
// src/primitives/TabButton.tsx
|
|
1345
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1346
|
-
var sizeClasses2 = {
|
|
1347
|
-
medium: "polli:px-4 polli:py-1.5 polli:text-base",
|
|
1348
|
-
small: "polli:px-3 polli:py-1.5 polli:text-sm"
|
|
1349
|
-
};
|
|
1350
|
-
var TabButton = ({
|
|
1351
|
-
theme,
|
|
1352
|
-
active,
|
|
1353
|
-
onClick,
|
|
1354
|
-
children,
|
|
1355
|
-
size = "medium",
|
|
1356
|
-
ariaLabel,
|
|
1357
|
-
disabled = false,
|
|
1358
|
-
className
|
|
1359
|
-
}) => {
|
|
1360
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1361
|
-
"button",
|
|
1362
|
-
{
|
|
1363
|
-
type: "button",
|
|
1364
|
-
"data-theme": theme,
|
|
1365
|
-
onClick,
|
|
1366
|
-
"aria-label": ariaLabel,
|
|
1367
|
-
"aria-pressed": active,
|
|
1368
|
-
disabled,
|
|
1369
|
-
className: cn(
|
|
1370
|
-
"polli:inline-flex polli:items-center polli:justify-center polli:rounded-full polli:border polli:font-medium polli:leading-normal polli:transition-all polli:duration-200",
|
|
1371
|
-
active ? "polli:bg-theme-bg-active polli:text-theme-text-strong polli:border-theme-border" : "polli:bg-theme-bg-subtle polli:text-theme-text-base polli:border-theme-border polli:hover:bg-theme-bg-active",
|
|
1372
|
-
disabled && "polli:cursor-not-allowed polli:opacity-50",
|
|
1373
|
-
sizeClasses2[size],
|
|
1374
|
-
className
|
|
1375
|
-
),
|
|
1376
|
-
children
|
|
1377
|
-
}
|
|
1378
|
-
);
|
|
1379
|
-
};
|
|
1380
|
-
|
|
1381
|
-
// src/primitives/PeriodPicker.tsx
|
|
1382
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1383
|
-
var WEEKDAY_LABELS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
1384
|
-
var MONTH_LABELS = [
|
|
1385
|
-
"Jan",
|
|
1386
|
-
"Feb",
|
|
1387
|
-
"Mar",
|
|
1388
|
-
"Apr",
|
|
1389
|
-
"May",
|
|
1390
|
-
"Jun",
|
|
1391
|
-
"Jul",
|
|
1392
|
-
"Aug",
|
|
1393
|
-
"Sep",
|
|
1394
|
-
"Oct",
|
|
1395
|
-
"Nov",
|
|
1396
|
-
"Dec"
|
|
1397
|
-
];
|
|
1398
|
-
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";
|
|
1399
|
-
function addUtcMonths2(date, months) {
|
|
1400
|
-
return new Date(
|
|
1401
|
-
Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + months, 1)
|
|
1402
|
-
);
|
|
1403
|
-
}
|
|
1404
|
-
function monthGridDates(viewMonth) {
|
|
1405
|
-
const firstDay = new Date(
|
|
1406
|
-
Date.UTC(viewMonth.getUTCFullYear(), viewMonth.getUTCMonth(), 1)
|
|
1407
|
-
);
|
|
1408
|
-
const firstWeekday = firstDay.getUTCDay() || 7;
|
|
1409
|
-
const cursor = addUtcDays(firstDay, 1 - firstWeekday);
|
|
1410
|
-
return Array.from({ length: 42 }, (_, index) => addUtcDays(cursor, index));
|
|
1411
|
-
}
|
|
1412
|
-
function sameUtcDay(left, right) {
|
|
1413
|
-
return left.getTime() === right.getTime();
|
|
1414
|
-
}
|
|
1415
|
-
function periodDate(value) {
|
|
1416
|
-
return periodToWindow(value).start;
|
|
1417
|
-
}
|
|
1418
|
-
function viewBounds(viewDate, granularity) {
|
|
1419
|
-
if (granularity === "month") {
|
|
1420
|
-
const start2 = new Date(Date.UTC(viewDate.getUTCFullYear(), 0, 1));
|
|
1421
|
-
return { start: start2, end: addUtcMonths2(start2, 12) };
|
|
1422
|
-
}
|
|
1423
|
-
const start = new Date(
|
|
1424
|
-
Date.UTC(viewDate.getUTCFullYear(), viewDate.getUTCMonth(), 1)
|
|
1425
|
-
);
|
|
1426
|
-
return { start, end: addUtcMonths2(start, 1) };
|
|
1427
|
-
}
|
|
1428
|
-
var PeriodPicker = ({
|
|
1429
|
-
value,
|
|
1430
|
-
onChange,
|
|
1431
|
-
theme,
|
|
1432
|
-
minDate = /* @__PURE__ */ new Date(0),
|
|
1433
|
-
maxDate
|
|
1434
|
-
}) => {
|
|
1435
|
-
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
1436
|
-
const [viewDate, setViewDate] = (0, import_react6.useState)(() => periodDate(value));
|
|
1437
|
-
const { granularity, period } = value;
|
|
1438
|
-
(0, import_react6.useEffect)(() => {
|
|
1439
|
-
setViewDate(periodDate({ granularity, period }));
|
|
1440
|
-
}, [granularity, period]);
|
|
1441
|
-
const dates = (0, import_react6.useMemo)(() => monthGridDates(viewDate), [viewDate]);
|
|
1442
|
-
const selectedWindow = periodToWindow(value);
|
|
1443
|
-
const today = startOfUtcDay(maxDate);
|
|
1444
|
-
const previousViewDate = value.granularity === "month" ? addUtcMonths2(viewDate, -12) : addUtcMonths2(viewDate, -1);
|
|
1445
|
-
const nextViewDate = value.granularity === "month" ? addUtcMonths2(viewDate, 12) : addUtcMonths2(viewDate, 1);
|
|
1446
|
-
const previousBounds = viewBounds(previousViewDate, value.granularity);
|
|
1447
|
-
const nextBounds = viewBounds(nextViewDate, value.granularity);
|
|
1448
|
-
const previousDisabled = previousBounds.end <= minDate;
|
|
1449
|
-
const nextDisabled = nextBounds.start > today;
|
|
1450
|
-
const setGranularity = (granularity2) => {
|
|
1451
|
-
onChange(periodFromDate(granularity2, periodDate(value)));
|
|
1452
|
-
};
|
|
1453
|
-
const selectDate = (date) => {
|
|
1454
|
-
onChange(periodFromDate(value.granularity, date));
|
|
1455
|
-
setOpen(false);
|
|
1456
|
-
};
|
|
1457
|
-
const viewLabel = value.granularity === "month" ? String(viewDate.getUTCFullYear()) : viewDate.toLocaleDateString("en-US", {
|
|
1458
|
-
timeZone: "UTC",
|
|
1459
|
-
month: "long",
|
|
1460
|
-
year: "numeric"
|
|
1461
|
-
});
|
|
1462
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1463
|
-
"div",
|
|
1464
|
-
{
|
|
1465
|
-
"data-theme": theme,
|
|
1466
|
-
className: "polli:flex polli:flex-wrap polli:items-center polli:gap-2",
|
|
1467
|
-
children: [
|
|
1468
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "polli:flex polli:flex-wrap polli:gap-1.5", children: ["day", "week", "month"].map(
|
|
1469
|
-
(granularity2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1470
|
-
TabButton,
|
|
1471
|
-
{
|
|
1472
|
-
active: value.granularity === granularity2,
|
|
1473
|
-
onClick: () => setGranularity(granularity2),
|
|
1474
|
-
children: granularity2[0].toUpperCase() + granularity2.slice(1)
|
|
1475
|
-
},
|
|
1476
|
-
granularity2
|
|
1477
|
-
)
|
|
1478
|
-
) }),
|
|
1479
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1480
|
-
Dropdown,
|
|
1481
|
-
{
|
|
1482
|
-
theme,
|
|
1483
|
-
open,
|
|
1484
|
-
onOpenChange: setOpen,
|
|
1485
|
-
className: "polli:w-[304px] polli:rounded-xl polli:p-3",
|
|
1486
|
-
trigger: (isOpen) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1487
|
-
"button",
|
|
1488
|
-
{
|
|
1489
|
-
type: "button",
|
|
1490
|
-
"aria-label": `Select period, current ${formatPeriodLabel(value)}`,
|
|
1491
|
-
className: cn(
|
|
1492
|
-
"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",
|
|
1493
|
-
"polli:border-theme-border polli:bg-theme-bg-subtle polli:text-theme-text-base",
|
|
1494
|
-
"polli:transition-all polli:duration-200 polli:ease-out polli:hover:bg-theme-bg-pale",
|
|
1495
|
-
isOpen && "polli:bg-theme-bg-active polli:text-theme-text-strong polli:shadow-sm"
|
|
1496
|
-
),
|
|
1497
|
-
children: [
|
|
1498
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: formatPeriodLabel(value) }),
|
|
1499
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ChevronIcon, { expanded: isOpen })
|
|
1500
|
-
]
|
|
1501
|
-
}
|
|
1502
|
-
),
|
|
1503
|
-
children: [
|
|
1504
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "polli:mb-3 polli:flex polli:items-center polli:justify-between", children: [
|
|
1505
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1506
|
-
"button",
|
|
1507
|
-
{
|
|
1508
|
-
type: "button",
|
|
1509
|
-
"aria-label": value.granularity === "month" ? "Previous year" : "Previous month",
|
|
1510
|
-
disabled: previousDisabled,
|
|
1511
|
-
onClick: () => setViewDate(previousViewDate),
|
|
1512
|
-
className: cn(
|
|
1513
|
-
NAV_BUTTON,
|
|
1514
|
-
previousDisabled && "polli:cursor-not-allowed polli:opacity-30 polli:hover:bg-transparent"
|
|
1515
|
-
),
|
|
1516
|
-
children: "<"
|
|
1517
|
-
}
|
|
1518
|
-
),
|
|
1519
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "polli:text-sm polli:font-bold polli:text-theme-text-base", children: viewLabel }),
|
|
1520
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1521
|
-
"button",
|
|
1522
|
-
{
|
|
1523
|
-
type: "button",
|
|
1524
|
-
"aria-label": value.granularity === "month" ? "Next year" : "Next month",
|
|
1525
|
-
disabled: nextDisabled,
|
|
1526
|
-
onClick: () => setViewDate(nextViewDate),
|
|
1527
|
-
className: cn(
|
|
1528
|
-
NAV_BUTTON,
|
|
1529
|
-
nextDisabled && "polli:cursor-not-allowed polli:opacity-30 polli:hover:bg-transparent"
|
|
1530
|
-
),
|
|
1531
|
-
children: ">"
|
|
1532
|
-
}
|
|
1533
|
-
)
|
|
1534
|
-
] }),
|
|
1535
|
-
value.granularity === "month" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "polli:grid polli:grid-cols-3 polli:gap-1.5", children: MONTH_LABELS.map((label, monthIndex) => {
|
|
1536
|
-
const date = new Date(
|
|
1537
|
-
Date.UTC(
|
|
1538
|
-
viewDate.getUTCFullYear(),
|
|
1539
|
-
monthIndex,
|
|
1540
|
-
1
|
|
1541
|
-
)
|
|
1542
|
-
);
|
|
1543
|
-
const selectable = isPeriodSelectable(
|
|
1544
|
-
periodFromDate("month", date),
|
|
1545
|
-
minDate,
|
|
1546
|
-
today
|
|
1547
|
-
);
|
|
1548
|
-
const ariaLabel = date.toLocaleDateString("en-US", {
|
|
1549
|
-
timeZone: "UTC",
|
|
1550
|
-
month: "long",
|
|
1551
|
-
year: "numeric"
|
|
1552
|
-
});
|
|
1553
|
-
const selected = date.getUTCFullYear() === selectedWindow.start.getUTCFullYear() && date.getUTCMonth() === selectedWindow.start.getUTCMonth();
|
|
1554
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1555
|
-
"button",
|
|
1556
|
-
{
|
|
1557
|
-
type: "button",
|
|
1558
|
-
"aria-label": ariaLabel,
|
|
1559
|
-
disabled: !selectable,
|
|
1560
|
-
onClick: () => selectDate(date),
|
|
1561
|
-
className: cn(
|
|
1562
|
-
"polli:rounded-lg polli:px-3 polli:py-2 polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
1563
|
-
selected ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-gray-700 polli:hover:bg-theme-bg-subtle",
|
|
1564
|
-
!selectable && "polli:cursor-not-allowed polli:text-gray-300 polli:hover:bg-transparent"
|
|
1565
|
-
),
|
|
1566
|
-
children: label
|
|
1567
|
-
},
|
|
1568
|
-
label
|
|
1569
|
-
);
|
|
1570
|
-
}) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1571
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.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_runtime21.jsx)("div", { children: label }, label)) }),
|
|
1572
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "polli:grid polli:grid-cols-7 polli:gap-1", children: dates.map((date) => {
|
|
1573
|
-
const inCurrentMonth = date.getUTCMonth() === viewDate.getUTCMonth();
|
|
1574
|
-
const selectable = isPeriodSelectable(
|
|
1575
|
-
periodFromDate(value.granularity, date),
|
|
1576
|
-
minDate,
|
|
1577
|
-
today
|
|
1578
|
-
);
|
|
1579
|
-
const ariaLabel = value.granularity === "week" ? `Select week ${formatPeriodLabel(periodFromDate("week", date))}` : `Select ${date.toLocaleDateString(
|
|
1580
|
-
"en-US",
|
|
1581
|
-
{
|
|
1582
|
-
timeZone: "UTC",
|
|
1583
|
-
weekday: "long",
|
|
1584
|
-
month: "long",
|
|
1585
|
-
day: "numeric",
|
|
1586
|
-
year: "numeric"
|
|
1587
|
-
}
|
|
1588
|
-
)}`;
|
|
1589
|
-
const selected = value.granularity === "day" ? sameUtcDay(date, selectedWindow.start) : date >= selectedWindow.start && date < selectedWindow.end;
|
|
1590
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1591
|
-
"button",
|
|
1592
|
-
{
|
|
1593
|
-
type: "button",
|
|
1594
|
-
"aria-label": ariaLabel,
|
|
1595
|
-
disabled: !selectable,
|
|
1596
|
-
onClick: () => selectDate(date),
|
|
1597
|
-
className: cn(
|
|
1598
|
-
"polli:aspect-square polli:rounded-lg polli:text-xs polli:font-medium polli:transition-colors polli:duration-150",
|
|
1599
|
-
!inCurrentMonth && "polli:text-gray-300",
|
|
1600
|
-
sameUtcDay(date, today) && "polli:ring-1 polli:ring-theme-border",
|
|
1601
|
-
selected ? "polli:bg-theme-bg-active polli:text-theme-text-strong" : "polli:text-gray-700 polli:hover:bg-theme-bg-subtle",
|
|
1602
|
-
!selectable && "polli:cursor-not-allowed polli:text-gray-300 polli:hover:bg-transparent"
|
|
1603
|
-
),
|
|
1604
|
-
children: date.getUTCDate()
|
|
1605
|
-
},
|
|
1606
|
-
date.toISOString()
|
|
1607
|
-
);
|
|
1608
|
-
}) })
|
|
1609
|
-
] })
|
|
1610
|
-
]
|
|
1611
|
-
}
|
|
1612
|
-
)
|
|
1613
|
-
]
|
|
1614
|
-
}
|
|
1615
|
-
);
|
|
1616
|
-
};
|
|
1617
|
-
|
|
1618
|
-
// src/primitives/Surface.tsx
|
|
1619
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1620
|
-
var variantClasses = {
|
|
1621
|
-
panel: "polli:rounded-2xl polli:border polli:border-theme-border polli:bg-theme-bg-subtle polli:p-6",
|
|
1622
|
-
card: "polli:rounded-xl polli:bg-surface-white polli:p-4",
|
|
1623
|
-
"card-themed": "polli:rounded-xl polli:bg-theme-bg-pale polli:p-4"
|
|
1624
|
-
};
|
|
1625
|
-
var Surface = ({
|
|
1626
|
-
theme,
|
|
1627
|
-
variant = "card",
|
|
1628
|
-
className,
|
|
1629
|
-
children,
|
|
1630
|
-
...rest
|
|
1631
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1632
|
-
"div",
|
|
1633
|
-
{
|
|
1634
|
-
...rest,
|
|
1635
|
-
"data-theme": theme,
|
|
1636
|
-
className: cn("polli:min-w-0", variantClasses[variant], className),
|
|
1637
|
-
children
|
|
1638
|
-
}
|
|
1639
|
-
);
|
|
1640
|
-
|
|
1641
|
-
// src/primitives/Section.tsx
|
|
1642
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1643
|
-
var Section = ({
|
|
1644
|
-
title,
|
|
1645
|
-
theme,
|
|
1646
|
-
id,
|
|
1647
|
-
framed = false,
|
|
1648
|
-
action,
|
|
1649
|
-
actionClassName,
|
|
1650
|
-
children,
|
|
1651
|
-
className
|
|
1652
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("section", { id, className: cn("scroll-mt-10 space-y-2", className), children: [
|
|
1653
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 px-1", children: [
|
|
1654
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1655
|
-
"h2",
|
|
1656
|
-
{
|
|
1657
|
-
"data-theme": theme,
|
|
1658
|
-
className: "text-left text-lg font-semibold sm:text-xl text-theme-text-strong",
|
|
1659
|
-
children: title
|
|
1660
|
-
}
|
|
1661
|
-
),
|
|
1662
|
-
action && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("shrink-0", actionClassName), children: action })
|
|
1663
|
-
] }),
|
|
1664
|
-
framed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Surface, { variant: "panel", theme, children }) : children
|
|
1665
|
-
] });
|
|
1666
|
-
|
|
1667
|
-
// src/primitives/Slider.tsx
|
|
1668
|
-
var import_react7 = require("react");
|
|
1669
|
-
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1670
|
-
var toNumber = (value) => {
|
|
1671
|
-
if (typeof value === "number") return value;
|
|
1672
|
-
if (typeof value !== "string" || value.trim() === "") return void 0;
|
|
1673
|
-
const numericValue = Number(value);
|
|
1674
|
-
return Number.isFinite(numericValue) ? numericValue : void 0;
|
|
1675
|
-
};
|
|
1676
|
-
var clampPercent = (value) => Math.min(100, Math.max(0, value));
|
|
1677
|
-
var getProgressPercent = ({
|
|
1678
|
-
progress,
|
|
1679
|
-
value,
|
|
1680
|
-
defaultValue,
|
|
1681
|
-
min,
|
|
1682
|
-
max
|
|
1683
|
-
}) => {
|
|
1684
|
-
if (typeof progress === "number" && Number.isFinite(progress)) {
|
|
1685
|
-
return clampPercent(progress);
|
|
1686
|
-
}
|
|
1687
|
-
const numericValue = toNumber(value ?? defaultValue);
|
|
1688
|
-
if (numericValue === void 0) return void 0;
|
|
1689
|
-
const numericMin = toNumber(min) ?? 0;
|
|
1690
|
-
const numericMax = toNumber(max) ?? 100;
|
|
1691
|
-
if (numericMax <= numericMin) return 100;
|
|
1692
|
-
return clampPercent(
|
|
1693
|
-
(numericValue - numericMin) / (numericMax - numericMin) * 100
|
|
1694
|
-
);
|
|
1695
|
-
};
|
|
1696
|
-
var Slider = (0, import_react7.forwardRef)(
|
|
1697
|
-
({ className, defaultValue, max, min, progress, style, value, ...props }, ref) => {
|
|
1698
|
-
const progressPercent = getProgressPercent({
|
|
1699
|
-
progress,
|
|
1700
|
-
value,
|
|
1701
|
-
defaultValue,
|
|
1702
|
-
min,
|
|
1703
|
-
max
|
|
1704
|
-
});
|
|
1705
|
-
const sliderStyle = {
|
|
1706
|
-
...style,
|
|
1707
|
-
...progressPercent === void 0 ? null : { "--polli-slider-progress": `${progressPercent}%` }
|
|
1708
|
-
};
|
|
1709
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1710
|
-
"input",
|
|
1711
|
-
{
|
|
1712
|
-
ref,
|
|
1713
|
-
type: "range",
|
|
1714
|
-
min,
|
|
1715
|
-
max,
|
|
1716
|
-
value,
|
|
1717
|
-
defaultValue,
|
|
1718
|
-
style: sliderStyle,
|
|
1719
|
-
className: cn("polli-slider", className),
|
|
1720
|
-
...props
|
|
1721
|
-
}
|
|
1722
|
-
);
|
|
1723
|
-
}
|
|
1724
|
-
);
|
|
1725
|
-
|
|
1726
|
-
// src/primitives/StatCard.tsx
|
|
1727
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1728
|
-
var StatCard = ({
|
|
1729
|
-
label,
|
|
1730
|
-
value,
|
|
1731
|
-
detail,
|
|
1732
|
-
theme,
|
|
1733
|
-
className,
|
|
1734
|
-
labelClassName,
|
|
1735
|
-
valueClassName,
|
|
1736
|
-
detailClassName
|
|
1737
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { "data-theme": theme, className: cn("polli:text-sm", className), children: [
|
|
1738
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1739
|
-
"div",
|
|
1740
|
-
{
|
|
1741
|
-
className: cn(
|
|
1742
|
-
"polli:text-micro polli:font-bold polli:uppercase polli:tracking-wide polli:text-theme-text-strong",
|
|
1743
|
-
labelClassName
|
|
1744
|
-
),
|
|
1745
|
-
children: label
|
|
1746
|
-
}
|
|
1747
|
-
),
|
|
1748
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1749
|
-
"div",
|
|
1750
|
-
{
|
|
1751
|
-
className: cn(
|
|
1752
|
-
"polli:mt-1 polli:min-h-8 polli:break-words polli:text-2xl polli:font-bold polli:leading-tight polli:tabular-nums polli:text-theme-text-strong",
|
|
1753
|
-
valueClassName
|
|
1754
|
-
),
|
|
1755
|
-
children: value
|
|
1756
|
-
}
|
|
1757
|
-
),
|
|
1758
|
-
detail && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1759
|
-
"div",
|
|
1760
|
-
{
|
|
1761
|
-
className: cn(
|
|
1762
|
-
"polli:mt-2 polli:text-xs polli:text-theme-text-soft",
|
|
1763
|
-
detailClassName
|
|
1764
|
-
),
|
|
1765
|
-
children: detail
|
|
1766
|
-
}
|
|
1767
|
-
)
|
|
1768
|
-
] });
|
|
1769
|
-
|
|
1770
|
-
// src/primitives/Switch.tsx
|
|
1771
|
-
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1772
|
-
var trackClasses = {
|
|
1773
|
-
off: "polli:bg-gray-200",
|
|
1774
|
-
on: "polli:bg-[oklch(0.88_0.12_158)]",
|
|
1775
|
-
invalid: "polli:bg-[oklch(0.88_0.12_25)]"
|
|
1776
|
-
};
|
|
1777
|
-
var Switch = ({
|
|
1778
|
-
checked,
|
|
1779
|
-
onChange,
|
|
1780
|
-
status,
|
|
1781
|
-
ariaLabel,
|
|
1782
|
-
disabled = false,
|
|
1783
|
-
className
|
|
1784
|
-
}) => {
|
|
1785
|
-
const effectiveStatus = status ?? (checked ? "on" : "off");
|
|
1786
|
-
const resolvedAriaLabel = ariaLabel ?? (checked ? "Turn off toggle" : "Turn on toggle");
|
|
1787
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1788
|
-
"button",
|
|
1789
|
-
{
|
|
1790
|
-
type: "button",
|
|
1791
|
-
role: "switch",
|
|
1792
|
-
"aria-checked": checked,
|
|
1793
|
-
"aria-label": resolvedAriaLabel,
|
|
1794
|
-
onClick: () => onChange(!checked),
|
|
1795
|
-
disabled,
|
|
1796
|
-
className: cn(
|
|
1797
|
-
"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",
|
|
1798
|
-
trackClasses[effectiveStatus],
|
|
1799
|
-
className
|
|
1800
|
-
),
|
|
1801
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1802
|
-
"span",
|
|
1803
|
-
{
|
|
1804
|
-
className: cn(
|
|
1805
|
-
"polli:inline-block polli:h-5 polli:w-5 polli:rounded-full polli:bg-white polli:shadow-sm polli:transition-transform",
|
|
1806
|
-
checked ? "polli:translate-x-6" : "polli:translate-x-1"
|
|
1807
|
-
)
|
|
1808
|
-
}
|
|
1809
|
-
)
|
|
1810
|
-
}
|
|
1811
|
-
);
|
|
1812
|
-
};
|
|
1813
|
-
|
|
1814
|
-
// src/theme.ts
|
|
1815
|
-
var themes = [
|
|
1816
|
-
"amber",
|
|
1817
|
-
"blue",
|
|
1818
|
-
"pink",
|
|
1819
|
-
"teal",
|
|
1820
|
-
"violet",
|
|
1821
|
-
"green"
|
|
1822
|
-
];
|
|
1823
|
-
|
|
1824
|
-
// src/showcase/DesignShowcase.tsx
|
|
1825
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1826
|
-
var DesignShowcase = ({
|
|
1827
|
-
headerSlot,
|
|
1828
|
-
hideHeader = false,
|
|
1829
|
-
hideThemeTabs = false,
|
|
1830
|
-
theme: controlledTheme,
|
|
1831
|
-
onThemeChange
|
|
1832
|
-
}) => {
|
|
1833
|
-
const [internalTheme, setInternalTheme] = (0, import_react8.useState)("amber");
|
|
1834
|
-
const theme = controlledTheme ?? internalTheme;
|
|
1835
|
-
const setTheme = onThemeChange ?? setInternalTheme;
|
|
1836
|
-
(0, import_react8.useEffect)(() => {
|
|
1837
|
-
document.documentElement.classList.add("polli-ui-root");
|
|
1838
|
-
document.documentElement.classList.add("polli-ui-shell");
|
|
1839
|
-
document.body.classList.add("polli-ui-shell");
|
|
1840
|
-
return () => {
|
|
1841
|
-
document.documentElement.classList.remove("polli-ui-root");
|
|
1842
|
-
document.documentElement.classList.remove("polli-ui-shell");
|
|
1843
|
-
document.body.classList.remove("polli-ui-shell");
|
|
1844
|
-
};
|
|
1845
|
-
}, []);
|
|
1846
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1847
|
-
ScrollArea,
|
|
1848
|
-
{
|
|
1849
|
-
theme,
|
|
1850
|
-
"data-theme": theme,
|
|
1851
|
-
className: `polli:w-full polli:overflow-x-hidden polli:bg-emerald-100 polli:text-theme-text-base ${hideHeader ? "polli:min-h-0 polli:flex-1" : "polli:h-dvh"}`,
|
|
1852
|
-
children: [
|
|
1853
|
-
hideHeader && (headerSlot || !hideThemeTabs) ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:mx-auto polli:flex polli:w-full polli:max-w-[1220px] polli:flex-col polli:gap-4 polli:px-5 polli:pt-8", children: [
|
|
1854
|
-
headerSlot ? headerSlot : null,
|
|
1855
|
-
!hideThemeTabs ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1856
|
-
ThemeTabs,
|
|
1857
|
-
{
|
|
1858
|
-
value: theme,
|
|
1859
|
-
options: themes,
|
|
1860
|
-
onChange: setTheme
|
|
1861
|
-
}
|
|
1862
|
-
) : null
|
|
1863
|
-
] }) : !hideHeader ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1864
|
-
Header,
|
|
1865
|
-
{
|
|
1866
|
-
theme,
|
|
1867
|
-
onThemeChange: setTheme,
|
|
1868
|
-
headerSlot
|
|
1869
|
-
}
|
|
1870
|
-
) : null,
|
|
1871
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:mx-auto polli:flex polli:w-full polli:max-w-[1220px] polli:flex-col polli:gap-8 polli:px-5 polli:pt-8 polli:pb-10", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("main", { className: "polli:flex polli:min-w-0 polli:flex-col polli:gap-10", children: [
|
|
1872
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CoverageDemo, {}),
|
|
1873
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TypographyDemo, {}),
|
|
1874
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ThemeDemo, { theme, onThemeChange: setTheme }),
|
|
1875
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TokensDemo, {}),
|
|
1876
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconsDemo, {}),
|
|
1877
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ButtonsDemo, { theme }),
|
|
1878
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InputsDemo, {}),
|
|
1879
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectionDemo, { theme }),
|
|
1880
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(OverlaysDemo, { theme }),
|
|
1881
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LayoutDemo, { theme }),
|
|
1882
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FeedbackDemo, {}),
|
|
1883
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ModuleRecipesDemo, {})
|
|
1884
|
-
] }) })
|
|
1885
|
-
]
|
|
1886
|
-
}
|
|
1887
|
-
);
|
|
1888
|
-
};
|
|
1889
|
-
var Header = ({ theme, onThemeChange, headerSlot }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("header", { className: "polli:sticky polli:top-0 polli:z-20 polli:border-b polli:border-green-950/10 polli:bg-emerald-100 polli:px-5 polli:py-4 polli:backdrop-blur", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:mx-auto polli:flex polli:w-full polli:max-w-[1220px] polli:min-w-0 polli:flex-col polli:items-start polli:gap-4", children: [
|
|
1890
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:flex polli:w-full polli:min-w-0 polli:flex-col polli:gap-3 polli:md:flex-row polli:md:items-start polli:md:justify-between", children: [
|
|
1891
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:min-w-0", children: [
|
|
1892
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h1", { className: "polli:font-serif polli:text-2xl polli:font-black polli:text-theme-text-strong", children: "Design Showcase" }),
|
|
1893
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:max-w-3xl polli:text-sm polli:leading-6 polli:text-theme-text-soft", children: "Package primitives, icons, tokens, and SDK-free recipes." })
|
|
1894
|
-
] }),
|
|
1895
|
-
headerSlot ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:w-full polli:md:w-auto", children: headerSlot }) : null
|
|
1896
|
-
] }),
|
|
1897
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1898
|
-
ThemeTabs,
|
|
1899
|
-
{
|
|
1900
|
-
value: theme,
|
|
1901
|
-
options: themes,
|
|
1902
|
-
onChange: onThemeChange
|
|
1903
|
-
}
|
|
1904
|
-
)
|
|
1905
|
-
] }) });
|
|
1906
|
-
var ThemeTabs = ({ value, options, onChange }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:flex polli:min-w-0 polli:max-w-full polli:flex-col polli:items-start polli:gap-2", children: [
|
|
1907
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-xs polli:font-semibold polli:uppercase polli:tracking-wide polli:text-theme-text-strong", children: "Theme" }),
|
|
1908
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:flex polli:w-full polli:max-w-full polli:flex-wrap polli:gap-1.5", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1909
|
-
TabButton,
|
|
1910
|
-
{
|
|
1911
|
-
active: value === option,
|
|
1912
|
-
onClick: () => onChange(option),
|
|
1913
|
-
theme: option,
|
|
1914
|
-
size: "small",
|
|
1915
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:capitalize", children: option })
|
|
1916
|
-
},
|
|
1917
|
-
option
|
|
1918
|
-
)) })
|
|
1919
|
-
] });
|
|
1920
|
-
var ShowcaseSection = ({
|
|
1921
|
-
id,
|
|
1922
|
-
title,
|
|
1923
|
-
caption,
|
|
1924
|
-
children
|
|
1925
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1926
|
-
"section",
|
|
1927
|
-
{
|
|
1928
|
-
id,
|
|
1929
|
-
className: "polli:flex polli:w-full polli:min-w-0 polli:scroll-mt-24 polli:flex-col polli:gap-3",
|
|
1930
|
-
children: [
|
|
1931
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:flex polli:flex-col polli:gap-1", children: [
|
|
1932
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { className: "polli:font-serif polli:text-2xl polli:font-black polli:text-theme-text-strong", children: title }),
|
|
1933
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:max-w-3xl polli:break-words polli:text-sm polli:leading-6 polli:text-theme-text-soft polli:[overflow-wrap:anywhere]", children: caption })
|
|
1934
|
-
] }),
|
|
1935
|
-
children
|
|
1936
|
-
]
|
|
1937
|
-
}
|
|
1938
|
-
);
|
|
1939
|
-
var Row = ({
|
|
1940
|
-
label,
|
|
1941
|
-
children
|
|
1942
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1943
|
-
Surface,
|
|
1944
|
-
{
|
|
1945
|
-
variant: "card-themed",
|
|
1946
|
-
className: "polli:flex polli:flex-wrap polli:items-center polli:gap-3",
|
|
1947
|
-
children: [
|
|
1948
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:w-44 polli:shrink-0 polli:text-xs polli:font-semibold polli:uppercase polli:tracking-wide polli:text-theme-text-strong", children: label }),
|
|
1949
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:flex polli:min-w-0 polli:flex-1 polli:flex-wrap polli:items-center polli:gap-2", children })
|
|
1950
|
-
]
|
|
1951
|
-
}
|
|
1952
|
-
);
|
|
1953
|
-
var ControlGroup = ({
|
|
1954
|
-
label,
|
|
1955
|
-
children
|
|
1956
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:flex polli:min-w-0 polli:flex-col polli:gap-1", children: [
|
|
1957
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-xs polli:font-semibold polli:uppercase polli:tracking-wide polli:text-theme-text-strong", children: label }),
|
|
1958
|
-
children
|
|
1959
|
-
] });
|
|
1960
|
-
var primitiveNames = [
|
|
1961
|
-
"Button",
|
|
1962
|
-
"ChevronIcon",
|
|
1963
|
-
"Chip",
|
|
1964
|
-
"Collapsible",
|
|
1965
|
-
"CopyButton",
|
|
1966
|
-
"Dialog",
|
|
1967
|
-
"DialogTitle",
|
|
1968
|
-
"Dropdown",
|
|
1969
|
-
"ExternalLinkButton",
|
|
1970
|
-
"Field",
|
|
1971
|
-
"IconButton",
|
|
1972
|
-
"InfoTip",
|
|
1973
|
-
"Input",
|
|
1974
|
-
"MultiSelect",
|
|
1975
|
-
"PeriodPicker",
|
|
1976
|
-
"ScrollArea",
|
|
1977
|
-
"Section",
|
|
1978
|
-
"Slider",
|
|
1979
|
-
"StatCard",
|
|
1980
|
-
"Surface",
|
|
1981
|
-
"Switch",
|
|
1982
|
-
"TabButton",
|
|
1983
|
-
"Tooltip"
|
|
1984
|
-
];
|
|
1985
|
-
var moduleNames = [
|
|
1986
|
-
"AuthInfoCard",
|
|
1987
|
-
"ErrorBanner",
|
|
1988
|
-
"ModalityButton",
|
|
1989
|
-
"PaidChip",
|
|
1990
|
-
"TierChip",
|
|
1991
|
-
"WalletBalanceCard",
|
|
1992
|
-
"WalletDot",
|
|
1993
|
-
"formatPollen"
|
|
1994
|
-
];
|
|
1995
|
-
var CoverageDemo = () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1996
|
-
ShowcaseSection,
|
|
1997
|
-
{
|
|
1998
|
-
id: "coverage",
|
|
1999
|
-
title: "Coverage",
|
|
2000
|
-
caption: "Every SDK-free primitive exported from the package appears below, plus the icon set and reusable module recipes.",
|
|
2001
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2002
|
-
Surface,
|
|
2003
|
-
{
|
|
2004
|
-
variant: "panel",
|
|
2005
|
-
className: "polli:grid polli:grid-cols-[repeat(auto-fit,minmax(220px,1fr))] polli:gap-3",
|
|
2006
|
-
children: [
|
|
2007
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2008
|
-
StatCard,
|
|
2009
|
-
{
|
|
2010
|
-
label: "Primitives",
|
|
2011
|
-
value: primitiveNames.length,
|
|
2012
|
-
detail: "Buttons, inputs, overlays, layout, and feedback.",
|
|
2013
|
-
className: "polli:rounded-xl polli:bg-surface-white polli:p-4"
|
|
2014
|
-
}
|
|
2015
|
-
),
|
|
2016
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2017
|
-
StatCard,
|
|
2018
|
-
{
|
|
2019
|
-
label: "Icons",
|
|
2020
|
-
value: iconItems.length + 1,
|
|
2021
|
-
detail: "All exported icons plus the canonical chevron.",
|
|
2022
|
-
className: "polli:rounded-xl polli:bg-surface-white polli:p-4"
|
|
2023
|
-
}
|
|
2024
|
-
),
|
|
2025
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2026
|
-
StatCard,
|
|
2027
|
-
{
|
|
2028
|
-
label: "Recipes",
|
|
2029
|
-
value: moduleNames.length,
|
|
2030
|
-
detail: "Auth, wallet, and modality pieces without SDK state.",
|
|
2031
|
-
className: "polli:rounded-xl polli:bg-surface-white polli:p-4"
|
|
2032
|
-
}
|
|
2033
|
-
),
|
|
2034
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Surface, { className: "polli:col-span-full polli:flex polli:flex-wrap polli:gap-2", children: primitiveNames.map((name) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Chip, { size: "sm", children: name }, name)) })
|
|
2035
|
-
]
|
|
2036
|
-
}
|
|
2037
|
-
)
|
|
2038
|
-
}
|
|
2039
|
-
);
|
|
2040
|
-
var typographyRows = [
|
|
2041
|
-
{
|
|
2042
|
-
label: "Heading",
|
|
2043
|
-
className: "polli:font-heading polli:text-4xl",
|
|
2044
|
-
sample: "Pollinations"
|
|
2045
|
-
},
|
|
2046
|
-
{
|
|
2047
|
-
label: "Subheading",
|
|
2048
|
-
className: "polli:font-subheading polli:text-3xl",
|
|
2049
|
-
sample: "Reusable UI"
|
|
2050
|
-
},
|
|
2051
|
-
{
|
|
2052
|
-
label: "Body",
|
|
2053
|
-
className: "polli:font-body polli:text-base",
|
|
2054
|
-
sample: "Clear defaults for product surfaces."
|
|
2055
|
-
},
|
|
2056
|
-
{
|
|
2057
|
-
label: "Pixel",
|
|
2058
|
-
className: "polli:font-pixel polli:text-base",
|
|
2059
|
-
sample: "API 200 OK"
|
|
2060
|
-
},
|
|
2061
|
-
{
|
|
2062
|
-
label: "Micro",
|
|
2063
|
-
className: "polli:font-body polli:text-micro polli:uppercase",
|
|
2064
|
-
sample: "Status label"
|
|
2065
|
-
}
|
|
2066
|
-
];
|
|
2067
|
-
var textRows = [
|
|
2068
|
-
["strong", "polli:text-theme-text-strong"],
|
|
2069
|
-
["base", "polli:text-theme-text-base"],
|
|
2070
|
-
["soft", "polli:text-theme-text-soft"],
|
|
2071
|
-
["muted", "polli:text-theme-text-muted"]
|
|
2072
|
-
];
|
|
2073
|
-
var TypographyDemo = () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2074
|
-
ShowcaseSection,
|
|
2075
|
-
{
|
|
2076
|
-
id: "type",
|
|
2077
|
-
title: "Typography",
|
|
2078
|
-
caption: "Font, size, and semantic text color utilities backed by package tokens.",
|
|
2079
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2080
|
-
Surface,
|
|
2081
|
-
{
|
|
2082
|
-
variant: "panel",
|
|
2083
|
-
className: "polli:flex polli:flex-col polli:gap-3",
|
|
2084
|
-
children: [
|
|
2085
|
-
typographyRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2086
|
-
"div",
|
|
2087
|
-
{
|
|
2088
|
-
className: "polli:flex polli:flex-wrap polli:items-baseline polli:gap-x-4 polli:gap-y-1 polli:border-b polli:border-theme-border polli:pb-3 polli:last:border-b-0 polli:last:pb-0",
|
|
2089
|
-
children: [
|
|
2090
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2091
|
-
"span",
|
|
2092
|
-
{
|
|
2093
|
-
className: `polli:w-80 polli:shrink-0 polli:text-theme-text-strong ${row.className}`,
|
|
2094
|
-
children: row.sample
|
|
2095
|
-
}
|
|
2096
|
-
),
|
|
2097
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("code", { className: "polli:w-36 polli:shrink-0 polli:font-mono polli:text-xs polli:text-theme-text-strong", children: row.label }),
|
|
2098
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:min-w-0 polli:flex-1 polli:text-xs polli:text-theme-text-soft", children: row.className.replaceAll("polli:", "") })
|
|
2099
|
-
]
|
|
2100
|
-
},
|
|
2101
|
-
row.label
|
|
2102
|
-
)),
|
|
2103
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:flex polli:flex-wrap polli:gap-2 polli:pt-1", children: textRows.map(([label, className]) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2104
|
-
"span",
|
|
2105
|
-
{
|
|
2106
|
-
className: `polli:rounded-lg polli:bg-theme-bg-pale polli:px-3 polli:py-1 polli:text-sm ${className}`,
|
|
2107
|
-
children: [
|
|
2108
|
-
"text-",
|
|
2109
|
-
label
|
|
2110
|
-
]
|
|
2111
|
-
},
|
|
2112
|
-
label
|
|
2113
|
-
)) })
|
|
2114
|
-
]
|
|
2115
|
-
}
|
|
2116
|
-
)
|
|
2117
|
-
}
|
|
2118
|
-
);
|
|
2119
|
-
var ThemeDemo = ({ theme, onThemeChange }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2120
|
-
ShowcaseSection,
|
|
2121
|
-
{
|
|
2122
|
-
id: "themes",
|
|
2123
|
-
title: "Themes",
|
|
2124
|
-
caption: "The theme cascade is driven by data-theme on any ancestor or by component theme props.",
|
|
2125
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2126
|
-
Surface,
|
|
2127
|
-
{
|
|
2128
|
-
variant: "panel",
|
|
2129
|
-
className: "polli:grid polli:grid-cols-[repeat(auto-fit,minmax(150px,1fr))] polli:gap-3",
|
|
2130
|
-
children: themes.map((item) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2131
|
-
"button",
|
|
2132
|
-
{
|
|
2133
|
-
type: "button",
|
|
2134
|
-
"data-theme": item,
|
|
2135
|
-
"aria-pressed": theme === item,
|
|
2136
|
-
onClick: () => onThemeChange(item),
|
|
2137
|
-
className: "polli:flex polli:min-w-0 polli:flex-col polli:gap-2 polli:rounded-xl polli:border polli:border-theme-border polli:bg-theme-bg-subtle polli:p-3 polli:text-left polli:transition-colors polli:hover:bg-theme-bg-pale",
|
|
2138
|
-
children: [
|
|
2139
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-sm polli:font-bold polli:capitalize polli:text-theme-text-strong", children: item }),
|
|
2140
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "polli:flex polli:h-8 polli:overflow-hidden polli:rounded-lg", children: [
|
|
2141
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:flex-1 polli:bg-theme-bg-subtle" }),
|
|
2142
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:flex-1 polli:bg-theme-bg-active" }),
|
|
2143
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:flex-1 polli:bg-theme-bg-hover" }),
|
|
2144
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:flex-1 polli:bg-theme-bg-pale" })
|
|
2145
|
-
] }),
|
|
2146
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-xs polli:text-theme-text-soft", children: theme === item ? "Selected" : "Preview" })
|
|
2147
|
-
]
|
|
2148
|
-
},
|
|
2149
|
-
item
|
|
2150
|
-
))
|
|
2151
|
-
}
|
|
2152
|
-
)
|
|
2153
|
-
}
|
|
2154
|
-
);
|
|
2155
|
-
var tokenRows = [
|
|
2156
|
-
["text-base", "var(--polli-color-text-base)", "polli:bg-theme-text-base"],
|
|
2157
|
-
[
|
|
2158
|
-
"text-strong",
|
|
2159
|
-
"var(--polli-color-text-strong)",
|
|
2160
|
-
"polli:bg-theme-text-strong"
|
|
2161
|
-
],
|
|
2162
|
-
["text-soft", "var(--polli-color-text-soft)", "polli:bg-theme-text-soft"],
|
|
2163
|
-
[
|
|
2164
|
-
"text-muted",
|
|
2165
|
-
"var(--polli-color-text-muted)",
|
|
2166
|
-
"polli:bg-theme-text-muted"
|
|
2167
|
-
],
|
|
2168
|
-
["border", "var(--polli-color-border)", "polli:bg-theme-border"],
|
|
2169
|
-
["bg-subtle", "var(--polli-color-bg-subtle)", "polli:bg-theme-bg-subtle"],
|
|
2170
|
-
["bg-active", "var(--polli-color-bg-active)", "polli:bg-theme-bg-active"],
|
|
2171
|
-
["bg-hover", "var(--polli-color-bg-hover)", "polli:bg-theme-bg-hover"],
|
|
2172
|
-
["bg-pale", "var(--polli-color-bg-pale)", "polli:bg-theme-bg-pale"]
|
|
2173
|
-
];
|
|
2174
|
-
var TokensDemo = () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2175
|
-
ShowcaseSection,
|
|
2176
|
-
{
|
|
2177
|
-
id: "tokens",
|
|
2178
|
-
title: "Tokens",
|
|
2179
|
-
caption: "Public CSS variables and utility bridges used by the primitives.",
|
|
2180
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2181
|
-
Surface,
|
|
2182
|
-
{
|
|
2183
|
-
variant: "panel",
|
|
2184
|
-
className: "polli:grid polli:grid-cols-[repeat(auto-fit,minmax(230px,1fr))] polli:gap-3",
|
|
2185
|
-
children: tokenRows.map(([name, variable, swatchClass]) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2186
|
-
Surface,
|
|
2187
|
-
{
|
|
2188
|
-
className: "polli:flex polli:items-center polli:gap-3",
|
|
2189
|
-
children: [
|
|
2190
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2191
|
-
"span",
|
|
2192
|
-
{
|
|
2193
|
-
className: `polli:h-10 polli:w-10 polli:shrink-0 polli:rounded-lg polli:border polli:border-theme-border ${swatchClass}`
|
|
2194
|
-
}
|
|
2195
|
-
),
|
|
2196
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "polli:min-w-0", children: [
|
|
2197
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:block polli:text-sm polli:font-bold polli:text-theme-text-strong", children: name }),
|
|
2198
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("code", { className: "polli:block polli:truncate polli:text-xs polli:text-theme-text-soft", children: variable })
|
|
2199
|
-
] })
|
|
2200
|
-
]
|
|
2201
|
-
},
|
|
2202
|
-
name
|
|
2203
|
-
))
|
|
2204
|
-
}
|
|
2205
|
-
)
|
|
2206
|
-
}
|
|
2207
|
-
);
|
|
2208
|
-
var iconItems = [
|
|
2209
|
-
{ name: "AppIcon", Icon: AppIcon },
|
|
2210
|
-
{ name: "BeakerIcon", Icon: BeakerIcon },
|
|
2211
|
-
{ name: "BookIcon", Icon: BookIcon },
|
|
2212
|
-
{ name: "CheckIcon", Icon: CheckIcon },
|
|
2213
|
-
{ name: "ClipboardIcon", Icon: ClipboardIcon },
|
|
2214
|
-
{ name: "ClockIcon", Icon: ClockIcon },
|
|
2215
|
-
{ name: "DiscordIcon", Icon: DiscordIcon },
|
|
2216
|
-
{ name: "DownloadIcon", Icon: DownloadIcon },
|
|
2217
|
-
{ name: "ExternalLinkIcon", Icon: ExternalLinkIcon },
|
|
2218
|
-
{ name: "GenApiIcon", Icon: GenApiIcon },
|
|
2219
|
-
{ name: "GitHubIcon", Icon: GitHubIcon },
|
|
2220
|
-
{ name: "ImageIcon", Icon: ImageIcon },
|
|
2221
|
-
{ name: "LockIcon", Icon: LockIcon },
|
|
2222
|
-
{ name: "MailIcon", Icon: MailIcon },
|
|
2223
|
-
{ name: "McpIcon", Icon: McpIcon },
|
|
2224
|
-
{ name: "MenuIcon", Icon: MenuIcon },
|
|
2225
|
-
{ name: "TerminalIcon", Icon: TerminalIcon },
|
|
2226
|
-
{ name: "TokensIcon", Icon: TokensIcon },
|
|
2227
|
-
{ name: "TrendUpIcon", Icon: TrendUpIcon },
|
|
2228
|
-
{ name: "WalletIcon", Icon: WalletIcon },
|
|
2229
|
-
{ name: "XIcon", Icon: XIcon }
|
|
2230
|
-
];
|
|
2231
|
-
var IconsDemo = () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2232
|
-
ShowcaseSection,
|
|
2233
|
-
{
|
|
2234
|
-
id: "icons",
|
|
2235
|
-
title: "Icons",
|
|
2236
|
-
caption: "Every exported SVG icon appears here with the same currentColor contract used by buttons and links.",
|
|
2237
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2238
|
-
Surface,
|
|
2239
|
-
{
|
|
2240
|
-
variant: "panel",
|
|
2241
|
-
className: "polli:grid polli:gap-3",
|
|
2242
|
-
style: {
|
|
2243
|
-
gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))"
|
|
2244
|
-
},
|
|
2245
|
-
children: [
|
|
2246
|
-
iconItems.map(({ name, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2247
|
-
Surface,
|
|
2248
|
-
{
|
|
2249
|
-
className: "polli:flex polli:items-center polli:gap-3",
|
|
2250
|
-
children: [
|
|
2251
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:flex polli:h-10 polli:w-10 polli:shrink-0 polli:items-center polli:justify-center polli:rounded-lg polli:bg-theme-bg-pale polli:text-theme-text-strong", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { className: "polli:h-5 polli:w-5" }) }),
|
|
2252
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("code", { className: "polli:min-w-0 polli:whitespace-nowrap polli:text-xs polli:text-theme-text-strong", children: name })
|
|
2253
|
-
]
|
|
2254
|
-
},
|
|
2255
|
-
name
|
|
2256
|
-
)),
|
|
2257
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Surface, { className: "polli:flex polli:items-center polli:gap-3", children: [
|
|
2258
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:flex polli:h-10 polli:w-10 polli:shrink-0 polli:items-center polli:justify-center polli:rounded-lg polli:bg-theme-bg-pale polli:text-theme-text-strong", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronIcon, { className: "polli:h-4 polli:w-4" }) }),
|
|
2259
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "polli:min-w-0", children: [
|
|
2260
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("code", { className: "polli:block polli:whitespace-nowrap polli:text-xs polli:text-theme-text-strong", children: "ChevronIcon" }),
|
|
2261
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "polli:mt-1 polli:flex polli:gap-2 polli:text-theme-text-soft", children: [
|
|
2262
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronIcon, {}),
|
|
2263
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronIcon, { expanded: true })
|
|
2264
|
-
] })
|
|
2265
|
-
] })
|
|
2266
|
-
] })
|
|
2267
|
-
]
|
|
2268
|
-
}
|
|
2269
|
-
)
|
|
2270
|
-
}
|
|
2271
|
-
);
|
|
2272
|
-
var ButtonsDemo = ({ theme }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2273
|
-
ShowcaseSection,
|
|
2274
|
-
{
|
|
2275
|
-
id: "buttons",
|
|
2276
|
-
title: "Buttons",
|
|
2277
|
-
caption: "Button, link, icon, copy, chip, and tab affordances in their supported states.",
|
|
2278
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:flex polli:flex-col polli:gap-3", children: [
|
|
2279
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "Button", children: [
|
|
2280
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { children: "Default" }),
|
|
2281
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { size: "small", children: "Small" }),
|
|
2282
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { size: "large", children: "Large" }),
|
|
2283
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { theme: "blue", children: "Theme prop" }),
|
|
2284
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { disabled: true, children: "Disabled" }),
|
|
2285
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { intent: "danger", children: "Delete" })
|
|
2286
|
-
] }),
|
|
2287
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "External link", children: [
|
|
2288
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2289
|
-
ExternalLinkButton,
|
|
2290
|
-
{
|
|
2291
|
-
theme,
|
|
2292
|
-
href: "https://pollinations.ai",
|
|
2293
|
-
children: "Pollinations"
|
|
2294
|
-
}
|
|
2295
|
-
),
|
|
2296
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2297
|
-
ExternalLinkButton,
|
|
2298
|
-
{
|
|
2299
|
-
theme,
|
|
2300
|
-
href: "https://pollinations.ai",
|
|
2301
|
-
size: "small",
|
|
2302
|
-
children: "Small link"
|
|
2303
|
-
}
|
|
2304
|
-
)
|
|
2305
|
-
] }),
|
|
2306
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "Icon button", children: [
|
|
2307
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "Copy", onClick: noop, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ClipboardIcon, { className: "polli:h-3.5 polli:w-3.5" }) }),
|
|
2308
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "Open", onClick: noop, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ExternalLinkIcon, { className: "polli:h-3.5 polli:w-3.5" }) }),
|
|
2309
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "Delete", intent: "danger", onClick: noop, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(XIcon, { className: "polli:h-3.5 polli:w-3.5" }) })
|
|
2310
|
-
] }),
|
|
2311
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Row, { label: "Copy button", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2312
|
-
CopyButton,
|
|
2313
|
-
{
|
|
2314
|
-
value: "pk_showcase_123",
|
|
2315
|
-
className: (copied) => `polli:inline-flex polli:h-8 polli:items-center polli:gap-2 polli:rounded-full polli:px-3 polli:text-sm polli:font-medium polli:transition-colors ${copied ? "polli:bg-green-100 polli:text-green-800" : "polli:bg-theme-bg-active polli:text-theme-text-strong"}`,
|
|
2316
|
-
children: (copied) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
2317
|
-
copied ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckIcon, { className: "polli:h-4 polli:w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ClipboardIcon, { className: "polli:h-4 polli:w-4" }),
|
|
2318
|
-
copied ? "Copied" : "Copy key"
|
|
2319
|
-
] })
|
|
2320
|
-
}
|
|
2321
|
-
) }),
|
|
2322
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "Tab button", children: [
|
|
2323
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TabButton, { active: true, onClick: noop, children: "Active" }),
|
|
2324
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TabButton, { active: false, onClick: noop, children: "Inactive" }),
|
|
2325
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TabButton, { active: false, disabled: true, onClick: noop, children: "Disabled" })
|
|
2326
|
-
] }),
|
|
2327
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "Chip", children: [
|
|
2328
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Chip, { children: "Default" }),
|
|
2329
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Chip, { size: "sm", children: "Small" }),
|
|
2330
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Chip, { size: "lg", children: "Large" }),
|
|
2331
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Chip, { intent: "news", children: "NEW" }),
|
|
2332
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Chip, { intent: "alpha", children: "ALPHA" }),
|
|
2333
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Chip, { intent: "neutral", children: "Neutral" }),
|
|
2334
|
-
themes.map((theme2) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Chip, { theme: theme2, children: theme2 }, theme2))
|
|
2335
|
-
] })
|
|
2336
|
-
] })
|
|
2337
|
-
}
|
|
2338
|
-
);
|
|
2339
|
-
var InputsDemo = () => {
|
|
2340
|
-
const [sliderValue, setSliderValue] = (0, import_react8.useState)(35);
|
|
2341
|
-
const [switches, setSwitches] = (0, import_react8.useState)({
|
|
2342
|
-
off: false,
|
|
2343
|
-
on: true,
|
|
2344
|
-
invalid: true
|
|
2345
|
-
});
|
|
2346
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2347
|
-
ShowcaseSection,
|
|
2348
|
-
{
|
|
2349
|
-
id: "inputs",
|
|
2350
|
-
title: "Inputs",
|
|
2351
|
-
caption: "Text, number, field composition, range, and binary toggle primitives.",
|
|
2352
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2353
|
-
Surface,
|
|
2354
|
-
{
|
|
2355
|
-
variant: "panel",
|
|
2356
|
-
className: "polli:grid polli:grid-cols-[repeat(auto-fit,minmax(220px,1fr))] polli:gap-4",
|
|
2357
|
-
children: [
|
|
2358
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: "Input", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Input, { placeholder: "Name" }) }),
|
|
2359
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: "Number", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Input, { type: "number", placeholder: "100", hideNumberSteppers: true }) }),
|
|
2360
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: "Error", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Input, { placeholder: "Invalid", error: true }) }),
|
|
2361
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: "Disabled", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Input, { placeholder: "Disabled", disabled: true }) }),
|
|
2362
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:col-span-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2363
|
-
import_field.Field.Root,
|
|
2364
|
-
{
|
|
2365
|
-
invalid: true,
|
|
2366
|
-
className: "polli:flex polli:max-w-xl polli:flex-col polli:gap-1",
|
|
2367
|
-
children: [
|
|
2368
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_field.Field.Label, { className: "polli:text-xs polli:font-semibold polli:uppercase polli:tracking-wide polli:text-theme-text-strong", children: [
|
|
2369
|
-
"Field",
|
|
2370
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_field.Field.RequiredIndicator, { className: "polli:ml-1 polli:text-intent-danger-text" })
|
|
2371
|
-
] }),
|
|
2372
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2373
|
-
import_field.Field.Input,
|
|
2374
|
-
{
|
|
2375
|
-
placeholder: "email@example.com",
|
|
2376
|
-
className: "polli:rounded-lg polli:border polli:border-intent-danger-border polli:bg-white polli:px-3 polli:py-2 polli:text-sm"
|
|
2377
|
-
}
|
|
2378
|
-
),
|
|
2379
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_field.Field.HelperText, { className: "polli:text-xs polli:text-theme-text-soft", children: "Exported Ark field namespace with package styling." }),
|
|
2380
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_field.Field.ErrorText, { className: "polli:text-xs polli:font-medium polli:text-intent-danger-text", children: "Enter a valid email address." })
|
|
2381
|
-
]
|
|
2382
|
-
}
|
|
2383
|
-
) }),
|
|
2384
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:col-span-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: `Slider ${sliderValue}`, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2385
|
-
Slider,
|
|
2386
|
-
{
|
|
2387
|
-
min: 0,
|
|
2388
|
-
max: 100,
|
|
2389
|
-
value: sliderValue,
|
|
2390
|
-
"aria-label": "Slider",
|
|
2391
|
-
onChange: (event) => setSliderValue(
|
|
2392
|
-
Number(event.currentTarget.value)
|
|
2393
|
-
)
|
|
2394
|
-
}
|
|
2395
|
-
) }) }),
|
|
2396
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:col-span-full polli:flex polli:flex-wrap polli:gap-5", children: [
|
|
2397
|
-
switchStatuses.map((status) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2398
|
-
"div",
|
|
2399
|
-
{
|
|
2400
|
-
className: "polli:flex polli:flex-col polli:gap-1",
|
|
2401
|
-
children: [
|
|
2402
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-xs polli:font-semibold polli:uppercase polli:tracking-wide polli:text-theme-text-strong", children: status }),
|
|
2403
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2404
|
-
Switch,
|
|
2405
|
-
{
|
|
2406
|
-
checked: switches[status],
|
|
2407
|
-
status,
|
|
2408
|
-
ariaLabel: `${status} switch`,
|
|
2409
|
-
onChange: (checked) => setSwitches((current) => ({
|
|
2410
|
-
...current,
|
|
2411
|
-
[status]: checked
|
|
2412
|
-
}))
|
|
2413
|
-
}
|
|
2414
|
-
)
|
|
2415
|
-
]
|
|
2416
|
-
},
|
|
2417
|
-
status
|
|
2418
|
-
)),
|
|
2419
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:flex polli:flex-col polli:gap-1", children: [
|
|
2420
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-xs polli:font-semibold polli:uppercase polli:tracking-wide polli:text-theme-text-strong", children: "disabled" }),
|
|
2421
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2422
|
-
Switch,
|
|
2423
|
-
{
|
|
2424
|
-
checked: true,
|
|
2425
|
-
disabled: true,
|
|
2426
|
-
status: "on",
|
|
2427
|
-
ariaLabel: "Disabled switch",
|
|
2428
|
-
onChange: noopSwitch
|
|
2429
|
-
}
|
|
2430
|
-
)
|
|
2431
|
-
] })
|
|
2432
|
-
] })
|
|
2433
|
-
]
|
|
2434
|
-
}
|
|
2435
|
-
)
|
|
2436
|
-
}
|
|
2437
|
-
);
|
|
2438
|
-
};
|
|
2439
|
-
var switchStatuses = ["off", "on", "invalid"];
|
|
2440
|
-
var selectionOptions = [
|
|
2441
|
-
{ value: "images", label: "Images" },
|
|
2442
|
-
{ value: "text", label: "Text" },
|
|
2443
|
-
{ value: "audio", label: "Audio" },
|
|
2444
|
-
{ value: "video", label: "Video" },
|
|
2445
|
-
{ value: "embeddings", label: "Embeddings" },
|
|
2446
|
-
{ value: "tools", label: "Tools" },
|
|
2447
|
-
{ value: "agents", label: "Agents" },
|
|
2448
|
-
{ value: "apps", label: "Apps" }
|
|
2449
|
-
];
|
|
2450
|
-
var tabOptions = ["Request", "Pollen", "Usage"];
|
|
2451
|
-
var SelectionDemo = ({ theme }) => {
|
|
2452
|
-
const [activeTab, setActiveTab] = (0, import_react8.useState)("Request");
|
|
2453
|
-
const [selected, setSelected] = (0, import_react8.useState)(["images", "text"]);
|
|
2454
|
-
const [period, setPeriod] = (0, import_react8.useState)(
|
|
2455
|
-
() => currentPeriod()
|
|
2456
|
-
);
|
|
2457
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2458
|
-
ShowcaseSection,
|
|
2459
|
-
{
|
|
2460
|
-
id: "selection",
|
|
2461
|
-
title: "Selection",
|
|
2462
|
-
caption: "Mutually exclusive tabs, multiple selection, dropdowns, and period selection.",
|
|
2463
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2464
|
-
Surface,
|
|
2465
|
-
{
|
|
2466
|
-
variant: "panel",
|
|
2467
|
-
className: "polli:flex polli:flex-col polli:gap-4",
|
|
2468
|
-
children: [
|
|
2469
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: "TabButton", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:flex polli:flex-wrap polli:gap-1.5", children: tabOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2470
|
-
TabButton,
|
|
2471
|
-
{
|
|
2472
|
-
active: activeTab === option,
|
|
2473
|
-
onClick: () => setActiveTab(option),
|
|
2474
|
-
children: option
|
|
2475
|
-
},
|
|
2476
|
-
option
|
|
2477
|
-
)) }) }),
|
|
2478
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: "Dropdown", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2479
|
-
Dropdown,
|
|
2480
|
-
{
|
|
2481
|
-
theme,
|
|
2482
|
-
align: "start",
|
|
2483
|
-
className: "polli:w-56 polli:p-2",
|
|
2484
|
-
trigger: (open) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2485
|
-
"button",
|
|
2486
|
-
{
|
|
2487
|
-
type: "button",
|
|
2488
|
-
className: "polli:inline-flex polli:min-h-8 polli:items-center polli:gap-2 polli:rounded-full polli:border polli:border-theme-border polli:bg-theme-bg-subtle polli:px-3 polli:text-sm polli:font-medium polli:text-theme-text-base polli:hover:bg-theme-bg-pale",
|
|
2489
|
-
children: [
|
|
2490
|
-
"Menu",
|
|
2491
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronIcon, { expanded: open })
|
|
2492
|
-
]
|
|
2493
|
-
}
|
|
2494
|
-
),
|
|
2495
|
-
children: (close) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:flex polli:flex-col", children: ["Account", "Usage", "Settings"].map(
|
|
2496
|
-
(item) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2497
|
-
"button",
|
|
2498
|
-
{
|
|
2499
|
-
type: "button",
|
|
2500
|
-
onClick: close,
|
|
2501
|
-
className: "polli:rounded-md polli:px-3 polli:py-2 polli:text-left polli:text-sm polli:text-theme-text-base polli:hover:bg-theme-bg-subtle",
|
|
2502
|
-
children: item
|
|
2503
|
-
},
|
|
2504
|
-
item
|
|
2505
|
-
)
|
|
2506
|
-
) })
|
|
2507
|
-
}
|
|
2508
|
-
) }),
|
|
2509
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: "MultiSelect", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:flex polli:flex-wrap polli:gap-3", children: [
|
|
2510
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2511
|
-
MultiSelect,
|
|
2512
|
-
{
|
|
2513
|
-
options: [...selectionOptions],
|
|
2514
|
-
selected,
|
|
2515
|
-
onChange: setSelected,
|
|
2516
|
-
placeholder: "All",
|
|
2517
|
-
align: "start",
|
|
2518
|
-
label: "Types",
|
|
2519
|
-
theme
|
|
2520
|
-
}
|
|
2521
|
-
),
|
|
2522
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2523
|
-
MultiSelect,
|
|
2524
|
-
{
|
|
2525
|
-
options: [],
|
|
2526
|
-
selected: [],
|
|
2527
|
-
onChange: noopSelected,
|
|
2528
|
-
placeholder: "All",
|
|
2529
|
-
disabled: true,
|
|
2530
|
-
disabledText: "Unavailable",
|
|
2531
|
-
label: "Disabled",
|
|
2532
|
-
theme
|
|
2533
|
-
}
|
|
2534
|
-
)
|
|
2535
|
-
] }) }),
|
|
2536
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlGroup, { label: "PeriodPicker", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2537
|
-
PeriodPicker,
|
|
2538
|
-
{
|
|
2539
|
-
value: period,
|
|
2540
|
-
onChange: setPeriod,
|
|
2541
|
-
theme
|
|
2542
|
-
}
|
|
2543
|
-
) })
|
|
2544
|
-
]
|
|
2545
|
-
}
|
|
2546
|
-
)
|
|
2547
|
-
}
|
|
2548
|
-
);
|
|
2549
|
-
};
|
|
2550
|
-
var OverlaysDemo = ({ theme }) => {
|
|
2551
|
-
const [dialogOpen, setDialogOpen] = (0, import_react8.useState)(false);
|
|
2552
|
-
const [firstOpen, setFirstOpen] = (0, import_react8.useState)(false);
|
|
2553
|
-
const [secondOpen, setSecondOpen] = (0, import_react8.useState)(true);
|
|
2554
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2555
|
-
ShowcaseSection,
|
|
2556
|
-
{
|
|
2557
|
-
id: "overlays",
|
|
2558
|
-
title: "Overlays and Disclosure",
|
|
2559
|
-
caption: "Dialog, DialogTitle, Dropdown, Collapsible, and ScrollArea share the package interaction language.",
|
|
2560
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2561
|
-
Surface,
|
|
2562
|
-
{
|
|
2563
|
-
variant: "panel",
|
|
2564
|
-
className: "polli:flex polli:flex-col polli:gap-4",
|
|
2565
|
-
children: [
|
|
2566
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "Dialog", children: [
|
|
2567
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { onClick: () => setDialogOpen(true), children: "Open dialog" }),
|
|
2568
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2569
|
-
Dialog,
|
|
2570
|
-
{
|
|
2571
|
-
open: dialogOpen,
|
|
2572
|
-
onOpenChange: setDialogOpen,
|
|
2573
|
-
labelledBy: "showcase-dialog-title",
|
|
2574
|
-
theme,
|
|
2575
|
-
size: "sm",
|
|
2576
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:p-6", children: [
|
|
2577
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2578
|
-
DialogTitle,
|
|
2579
|
-
{
|
|
2580
|
-
id: "showcase-dialog-title",
|
|
2581
|
-
className: "polli:font-subheading polli:text-xl polli:text-theme-text-strong",
|
|
2582
|
-
children: "DialogTitle export"
|
|
2583
|
-
}
|
|
2584
|
-
),
|
|
2585
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:mt-2 polli:text-sm polli:text-theme-text-base", children: "The dialog is controlled by the host and uses the same themed surface tokens." }),
|
|
2586
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:mt-5 polli:flex polli:justify-end polli:gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2587
|
-
Button,
|
|
2588
|
-
{
|
|
2589
|
-
size: "small",
|
|
2590
|
-
onClick: () => setDialogOpen(false),
|
|
2591
|
-
children: "Close"
|
|
2592
|
-
}
|
|
2593
|
-
) })
|
|
2594
|
-
] })
|
|
2595
|
-
}
|
|
2596
|
-
)
|
|
2597
|
-
] }),
|
|
2598
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Surface, { className: "polli:grid polli:grid-cols-[repeat(auto-fit,minmax(260px,1fr))] polli:gap-3", children: [
|
|
2599
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2600
|
-
Collapsible,
|
|
2601
|
-
{
|
|
2602
|
-
expanded: firstOpen,
|
|
2603
|
-
onToggle: () => setFirstOpen((open) => !open),
|
|
2604
|
-
wrapperClassName: "polli:border-theme-border polli:bg-theme-bg-pale",
|
|
2605
|
-
label: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-sm polli:font-medium polli:text-theme-text-strong", children: "Advanced settings" }),
|
|
2606
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:text-sm polli:text-theme-text-base", children: "Body content is fully controlled by the caller." })
|
|
2607
|
-
}
|
|
2608
|
-
),
|
|
2609
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2610
|
-
Collapsible,
|
|
2611
|
-
{
|
|
2612
|
-
expanded: secondOpen,
|
|
2613
|
-
onToggle: () => setSecondOpen((open) => !open),
|
|
2614
|
-
wrapperClassName: "polli:border-theme-border polli:bg-theme-bg-pale",
|
|
2615
|
-
label: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-sm polli:font-medium polli:text-theme-text-strong", children: "Nested details" }),
|
|
2616
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:flex polli:flex-col polli:gap-2", children: [
|
|
2617
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:text-sm polli:text-theme-text-base", children: "The same primitive works inside compact panels." }),
|
|
2618
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { size: "small", children: "Nested action" })
|
|
2619
|
-
] })
|
|
2620
|
-
}
|
|
2621
|
-
),
|
|
2622
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2623
|
-
Collapsible,
|
|
2624
|
-
{
|
|
2625
|
-
expanded: false,
|
|
2626
|
-
onToggle: noop,
|
|
2627
|
-
disabled: true,
|
|
2628
|
-
wrapperClassName: "polli:border-theme-border polli:bg-theme-bg-pale",
|
|
2629
|
-
label: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:text-sm polli:font-medium polli:text-theme-text-strong", children: "Disabled row" }),
|
|
2630
|
-
children: "Disabled content"
|
|
2631
|
-
}
|
|
2632
|
-
)
|
|
2633
|
-
] })
|
|
2634
|
-
]
|
|
2635
|
-
}
|
|
2636
|
-
)
|
|
2637
|
-
}
|
|
2638
|
-
);
|
|
2639
|
-
};
|
|
2640
|
-
var LayoutDemo = ({ theme }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2641
|
-
ShowcaseSection,
|
|
2642
|
-
{
|
|
2643
|
-
id: "layout",
|
|
2644
|
-
title: "Layout",
|
|
2645
|
-
caption: "Surface, Section, StatCard, and ScrollArea primitives for dense product screens.",
|
|
2646
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2647
|
-
Surface,
|
|
2648
|
-
{
|
|
2649
|
-
variant: "panel",
|
|
2650
|
-
className: "polli:flex polli:flex-col polli:gap-4",
|
|
2651
|
-
children: [
|
|
2652
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:grid polli:grid-cols-[repeat(auto-fit,minmax(210px,1fr))] polli:gap-3", children: [
|
|
2653
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Surface, { children: [
|
|
2654
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "polli:font-subheading polli:text-xl polli:text-theme-text-strong", children: "Surface card" }),
|
|
2655
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:mt-1 polli:text-sm polli:text-theme-text-soft", children: "Neutral inner surface for dense content." })
|
|
2656
|
-
] }),
|
|
2657
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Surface, { variant: "card-themed", children: [
|
|
2658
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "polli:font-subheading polli:text-xl polli:text-theme-text-strong", children: "Surface themed" }),
|
|
2659
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:mt-1 polli:text-sm polli:text-theme-text-soft", children: "Themed wash for highlights and grouped state." })
|
|
2660
|
-
] }),
|
|
2661
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2662
|
-
StatCard,
|
|
2663
|
-
{
|
|
2664
|
-
label: "StatCard",
|
|
2665
|
-
value: formatPollen(1234.5678),
|
|
2666
|
-
detail: "Tabular value with optional detail.",
|
|
2667
|
-
className: "polli:rounded-xl polli:bg-surface-white polli:p-4"
|
|
2668
|
-
}
|
|
2669
|
-
)
|
|
2670
|
-
] }),
|
|
2671
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2672
|
-
Section,
|
|
2673
|
-
{
|
|
2674
|
-
title: "Primitive section",
|
|
2675
|
-
theme,
|
|
2676
|
-
framed: true,
|
|
2677
|
-
action: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { size: "small", children: "Action" }),
|
|
2678
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:text-sm polli:text-theme-text-soft", children: "Section owns heading layout and optional framing. The app owns the content inside it." })
|
|
2679
|
-
}
|
|
2680
|
-
),
|
|
2681
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:grid polli:grid-cols-[repeat(auto-fit,minmax(260px,1fr))] polli:gap-4", children: [
|
|
2682
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Surface, { children: [
|
|
2683
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:mb-2 polli:font-mono polli:text-xs polli:uppercase polli:tracking-wide polli:text-theme-text-soft", children: "ScrollArea vertical" }),
|
|
2684
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ScrollArea, { className: "polli:h-44 polli:rounded-lg polli:bg-theme-bg-subtle polli:p-3", children: scrollRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2685
|
-
"p",
|
|
2686
|
-
{
|
|
2687
|
-
className: "polli:py-1 polli:text-sm polli:text-theme-text-base",
|
|
2688
|
-
children: [
|
|
2689
|
-
"Row ",
|
|
2690
|
-
row
|
|
2691
|
-
]
|
|
2692
|
-
},
|
|
2693
|
-
row
|
|
2694
|
-
)) })
|
|
2695
|
-
] }),
|
|
2696
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Surface, { children: [
|
|
2697
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:mb-2 polli:font-mono polli:text-xs polli:uppercase polli:tracking-wide polli:text-theme-text-soft", children: "ScrollArea horizontal" }),
|
|
2698
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2699
|
-
ScrollArea,
|
|
2700
|
-
{
|
|
2701
|
-
axis: "x",
|
|
2702
|
-
theme: "violet",
|
|
2703
|
-
className: "polli:rounded-lg polli:bg-theme-bg-subtle polli:p-3",
|
|
2704
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "polli:flex polli:w-max polli:gap-2", children: scrollRows.slice(0, 16).map((row) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Chip, { theme: "violet", children: [
|
|
2705
|
-
"item ",
|
|
2706
|
-
row
|
|
2707
|
-
] }, row)) })
|
|
2708
|
-
}
|
|
2709
|
-
)
|
|
2710
|
-
] })
|
|
2711
|
-
] })
|
|
2712
|
-
]
|
|
2713
|
-
}
|
|
2714
|
-
)
|
|
2715
|
-
}
|
|
2716
|
-
);
|
|
2717
|
-
var scrollRows = Array.from(
|
|
2718
|
-
{ length: 28 },
|
|
2719
|
-
(_, index) => String(index + 1).padStart(2, "0")
|
|
2720
|
-
);
|
|
2721
|
-
var FeedbackDemo = () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2722
|
-
ShowcaseSection,
|
|
2723
|
-
{
|
|
2724
|
-
id: "feedback",
|
|
2725
|
-
title: "Feedback",
|
|
2726
|
-
caption: "Tooltip, InfoTip, and formatted value examples for compact product UI.",
|
|
2727
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2728
|
-
Surface,
|
|
2729
|
-
{
|
|
2730
|
-
variant: "panel",
|
|
2731
|
-
className: "polli:flex polli:flex-col polli:gap-3",
|
|
2732
|
-
children: [
|
|
2733
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Row, { label: "InfoTip", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "polli:inline-flex polli:items-center polli:text-sm polli:text-theme-text-strong", children: [
|
|
2734
|
-
"Pollen balance",
|
|
2735
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InfoTip, { content: "A compact inline information trigger." })
|
|
2736
|
-
] }) }),
|
|
2737
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "Tooltip", children: [
|
|
2738
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2739
|
-
Tooltip,
|
|
2740
|
-
{
|
|
2741
|
-
content: "Formatted with formatPollen()",
|
|
2742
|
-
displayContents: true,
|
|
2743
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(PaidChip, { size: "lg", children: [
|
|
2744
|
-
formatPollen(1234.5678),
|
|
2745
|
-
" Pollen"
|
|
2746
|
-
] })
|
|
2747
|
-
}
|
|
2748
|
-
),
|
|
2749
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2750
|
-
Tooltip,
|
|
2751
|
-
{
|
|
2752
|
-
content: "Use triggerAs='span' around inline text.",
|
|
2753
|
-
triggerAs: "span",
|
|
2754
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:cursor-help polli:text-sm polli:text-theme-text-strong polli:underline polli:decoration-dotted", children: "inline help" })
|
|
2755
|
-
}
|
|
2756
|
-
)
|
|
2757
|
-
] })
|
|
2758
|
-
]
|
|
2759
|
-
}
|
|
2760
|
-
)
|
|
2761
|
-
}
|
|
2762
|
-
);
|
|
2763
|
-
var modalities = [
|
|
2764
|
-
"text",
|
|
2765
|
-
"image",
|
|
2766
|
-
"video",
|
|
2767
|
-
"audio",
|
|
2768
|
-
"realtime",
|
|
2769
|
-
"embedding"
|
|
2770
|
-
];
|
|
2771
|
-
var ModuleRecipesDemo = () => {
|
|
2772
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2773
|
-
ShowcaseSection,
|
|
2774
|
-
{
|
|
2775
|
-
id: "modules",
|
|
2776
|
-
title: "Shared Modules",
|
|
2777
|
-
caption: "Package-owned pieces used by product screens; host apps provide the data and flows.",
|
|
2778
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2779
|
-
Surface,
|
|
2780
|
-
{
|
|
2781
|
-
variant: "panel",
|
|
2782
|
-
className: "polli:flex polli:flex-col polli:gap-4",
|
|
2783
|
-
children: [
|
|
2784
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "Wallet markers", children: [
|
|
2785
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PaidChip, { children: "Paid" }),
|
|
2786
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TierChip, { children: "Tier" }),
|
|
2787
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "polli:inline-flex polli:items-center polli:gap-2 polli:text-sm polli:text-theme-text-strong", children: [
|
|
2788
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(WalletDot, { kind: "paid" }),
|
|
2789
|
-
"paid balance"
|
|
2790
|
-
] }),
|
|
2791
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "polli:inline-flex polli:items-center polli:gap-2 polli:text-sm polli:text-theme-text-strong", children: [
|
|
2792
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(WalletDot, { kind: "tier" }),
|
|
2793
|
-
"tier balance"
|
|
2794
|
-
] })
|
|
2795
|
-
] }),
|
|
2796
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "polli:grid polli:grid-cols-[repeat(auto-fit,minmax(220px,1fr))] polli:gap-3", children: [
|
|
2797
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2798
|
-
WalletBalanceCard,
|
|
2799
|
-
{
|
|
2800
|
-
kind: "paid",
|
|
2801
|
-
label: "Paid",
|
|
2802
|
-
value: formatPollen(24.812),
|
|
2803
|
-
footer: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
2804
|
-
"+",
|
|
2805
|
-
formatPollen(2.1),
|
|
2806
|
-
" ",
|
|
2807
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:font-medium polli:text-amber-800/70", children: "/ 7d" })
|
|
2808
|
-
] }),
|
|
2809
|
-
info: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InfoTip, { content: "Paid wallet balance." })
|
|
2810
|
-
}
|
|
2811
|
-
),
|
|
2812
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2813
|
-
WalletBalanceCard,
|
|
2814
|
-
{
|
|
2815
|
-
kind: "tier",
|
|
2816
|
-
label: "Tier",
|
|
2817
|
-
value: formatPollen(183.4),
|
|
2818
|
-
footer: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
2819
|
-
"+",
|
|
2820
|
-
formatPollen(8),
|
|
2821
|
-
" ",
|
|
2822
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "polli:font-medium polli:text-amber-800/70", children: "/ 7d" })
|
|
2823
|
-
] }),
|
|
2824
|
-
info: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InfoTip, { content: "Tier allowance balance." })
|
|
2825
|
-
}
|
|
2826
|
-
)
|
|
2827
|
-
] }),
|
|
2828
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Row, { label: "ModalityButton", children: [
|
|
2829
|
-
modalities.map((modality) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ModalityButton, { category: modality, children: modality }, modality)),
|
|
2830
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ModalityButton, { category: "unknown", selected: false, children: "unknown" }),
|
|
2831
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ModalityButton, { category: "text", disabled: true, children: "disabled" })
|
|
2832
|
-
] }),
|
|
2833
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Surface, { className: "polli:flex polli:flex-col polli:gap-3", children: [
|
|
2834
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "polli:font-subheading polli:text-xl polli:text-theme-text-strong", children: "Auth feedback" }),
|
|
2835
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AuthInfoCard, { title: "Authorize", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "polli:text-sm polli:text-theme-text-base", children: "Sign in to approve this request and return to the app." }) }),
|
|
2836
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ErrorBanner, { children: "Authorization failed. Try again." })
|
|
2837
|
-
] })
|
|
2838
|
-
]
|
|
2839
|
-
}
|
|
2840
|
-
)
|
|
2841
|
-
}
|
|
2842
|
-
);
|
|
2843
|
-
};
|
|
2844
|
-
var noop = () => void 0;
|
|
2845
|
-
var noopSwitch = (_checked) => void 0;
|
|
2846
|
-
var noopSelected = (_selected) => void 0;
|
|
2847
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
2848
|
-
0 && (module.exports = {
|
|
2849
|
-
DesignShowcase
|
|
2850
|
-
});
|
|
2851
|
-
//# sourceMappingURL=index.cjs.map
|