@dinofront/design_system 0.1.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 +65 -0
- package/dist/components/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/Accordion.types.d.ts +21 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +3 -0
- package/dist/components/Avatar/Avatar.types.d.ts +18 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +2 -0
- package/dist/components/Badge/Badge.types.d.ts +14 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.types.d.ts +15 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +6 -0
- package/dist/components/ButtonGroup/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +2 -0
- package/dist/components/Card/Card.types.d.ts +14 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +11 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +24 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +2 -0
- package/dist/components/Drawer/Drawer.types.d.ts +23 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -0
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +37 -0
- package/dist/components/DropdownMenu/index.d.ts +2 -0
- package/dist/components/Filter/Filter.d.ts +2 -0
- package/dist/components/Filter/Filter.types.d.ts +17 -0
- package/dist/components/Filter/index.d.ts +2 -0
- package/dist/components/IconTile/IconTile.d.ts +2 -0
- package/dist/components/IconTile/IconTile.types.d.ts +13 -0
- package/dist/components/IconTile/index.d.ts +2 -0
- package/dist/components/InfoField/InfoField.d.ts +2 -0
- package/dist/components/InfoField/InfoField.types.d.ts +16 -0
- package/dist/components/InfoField/index.d.ts +2 -0
- package/dist/components/InlineAlert/InlineAlert.d.ts +2 -0
- package/dist/components/InlineAlert/InlineAlert.types.d.ts +15 -0
- package/dist/components/InlineAlert/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.types.d.ts +15 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts +2 -0
- package/dist/components/Modal/Modal.types.d.ts +21 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +44 -0
- package/dist/components/MultiSelect/index.d.ts +2 -0
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +2 -0
- package/dist/components/NotificationBadge/NotificationBadge.types.d.ts +15 -0
- package/dist/components/NotificationBadge/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +2 -0
- package/dist/components/Pagination/Pagination.types.d.ts +14 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/PersonCard/PersonCard.d.ts +2 -0
- package/dist/components/PersonCard/PersonCard.types.d.ts +20 -0
- package/dist/components/PersonCard/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +3 -0
- package/dist/components/Radio/Radio.types.d.ts +22 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.types.d.ts +24 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +3 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts +25 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Snackbar/Snackbar.d.ts +3 -0
- package/dist/components/Snackbar/Snackbar.types.d.ts +28 -0
- package/dist/components/Snackbar/index.d.ts +2 -0
- package/dist/components/Status/Status.d.ts +2 -0
- package/dist/components/Status/Status.types.d.ts +12 -0
- package/dist/components/Status/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +2 -0
- package/dist/components/Switch/Switch.types.d.ts +9 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +8 -0
- package/dist/components/Table/Table.types.d.ts +55 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +5 -0
- package/dist/components/Tabs/Tabs.types.d.ts +26 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +2 -0
- package/dist/components/Text/Text.types.d.ts +15 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/TextArea/TextArea.d.ts +2 -0
- package/dist/components/TextArea/TextArea.types.d.ts +10 -0
- package/dist/components/TextArea/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +15 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Upload/Upload.d.ts +3 -0
- package/dist/components/Upload/Upload.types.d.ts +24 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +2663 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +8 -0
- package/dist/styles.css +2624 -0
- package/dist/tailwind/preset.d.ts +41 -0
- package/dist/tailwind/preset.js +151 -0
- package/dist/tailwind/preset.js.map +1 -0
- package/dist/tailwind/tokens.d.ts +141 -0
- package/dist/tokens/colors.d.ts +286 -0
- package/dist/tokens/index.d.ts +5 -0
- package/dist/tokens/radius.d.ts +15 -0
- package/dist/tokens/shadows.d.ts +13 -0
- package/dist/tokens/spacing.d.ts +18 -0
- package/dist/tokens/typography.d.ts +161 -0
- package/dist/types/base.d.ts +5 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +78 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2663 @@
|
|
|
1
|
+
import { Children as e, cloneElement as t, createContext as n, createElement as r, forwardRef as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
2
|
+
import { AlertCircle as p, AlertTriangle as m, ArrowDown as h, ArrowUp as g, Calendar as _, Check as v, CheckCircle2 as y, ChevronDown as b, ChevronLeft as x, ChevronRight as S, ChevronsUpDown as C, File as w, Info as T, Loader2 as E, Menu as ee, Minus as D, MoreHorizontal as O, Search as k, Sparkles as A, Trash2 as j, UploadCloud as M, User as N, Users as te, X as P, XCircle as F } from "lucide-react";
|
|
3
|
+
import { clsx as I } from "clsx";
|
|
4
|
+
import { twMerge as L } from "tailwind-merge";
|
|
5
|
+
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
6
|
+
import { createPortal as V } from "react-dom";
|
|
7
|
+
//#region src/lib/cn.ts
|
|
8
|
+
function H(...e) {
|
|
9
|
+
return L(I(e));
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/Accordion/Accordion.tsx
|
|
13
|
+
var ne = n(null);
|
|
14
|
+
function re() {
|
|
15
|
+
let e = s(ne);
|
|
16
|
+
if (!e) throw Error("AccordionItem must be used inside <Accordion>");
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
function U(e) {
|
|
20
|
+
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
21
|
+
}
|
|
22
|
+
var W = i(function({ type: e = "single", defaultValue: t, value: n, onValueChange: r, className: i, children: a, dataTestId: o, ...s }, c) {
|
|
23
|
+
let [l, u] = f(() => U(t)), d = n !== void 0, p = d ? U(n) : l;
|
|
24
|
+
return /* @__PURE__ */ z(ne.Provider, {
|
|
25
|
+
value: {
|
|
26
|
+
openValues: p,
|
|
27
|
+
toggle: (t) => {
|
|
28
|
+
let n;
|
|
29
|
+
n = e === "single" ? p.includes(t) ? [] : [t] : p.includes(t) ? p.filter((e) => e !== t) : [...p, t], d || u(n), r?.(e === "single" ? n[0] ?? "" : n);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ z("div", {
|
|
33
|
+
ref: c,
|
|
34
|
+
"data-test-id": o,
|
|
35
|
+
className: H("flex flex-col divide-y divide-border-default border border-border-default rounded-lg overflow-hidden bg-bg-default", i),
|
|
36
|
+
...s,
|
|
37
|
+
children: a
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}), G = i(function({ value: e, title: t, icon: n, disabled: r, className: i, children: a, dataTestId: o, ...s }, c) {
|
|
41
|
+
let { openValues: u, toggle: d } = re(), f = u.includes(e), p = l();
|
|
42
|
+
return /* @__PURE__ */ B("div", {
|
|
43
|
+
ref: c,
|
|
44
|
+
"data-test-id": o,
|
|
45
|
+
"data-state": f ? "open" : "closed",
|
|
46
|
+
className: H("group", i),
|
|
47
|
+
...s,
|
|
48
|
+
children: [/* @__PURE__ */ z("h3", { children: /* @__PURE__ */ B("button", {
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: () => d(e),
|
|
51
|
+
disabled: r,
|
|
52
|
+
"aria-expanded": f,
|
|
53
|
+
"aria-controls": p,
|
|
54
|
+
className: H("flex w-full items-center justify-between gap-3 px-5 py-4 text-left", "text-p-md font-medium text-fg-default", "hover:bg-bg-container transition-colors", "focus-visible:outline-none focus-visible:bg-bg-container", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
55
|
+
children: [/* @__PURE__ */ B("span", {
|
|
56
|
+
className: "inline-flex items-center gap-3",
|
|
57
|
+
children: [n && /* @__PURE__ */ z("span", {
|
|
58
|
+
className: "inline-flex text-fg-secondary",
|
|
59
|
+
children: n
|
|
60
|
+
}), t]
|
|
61
|
+
}), /* @__PURE__ */ z(b, {
|
|
62
|
+
className: H("h-5 w-5 shrink-0 text-fg-secondary transition-transform duration-200", f && "rotate-180"),
|
|
63
|
+
"aria-hidden": !0
|
|
64
|
+
})]
|
|
65
|
+
}) }), /* @__PURE__ */ z("div", {
|
|
66
|
+
id: p,
|
|
67
|
+
role: "region",
|
|
68
|
+
hidden: !f,
|
|
69
|
+
className: "px-5 pb-4 text-p-std text-fg-secondary",
|
|
70
|
+
children: a
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
}), ie = {
|
|
74
|
+
xs: "h-6 w-6 text-p-xs",
|
|
75
|
+
sm: "h-8 w-8 text-p-sm",
|
|
76
|
+
md: "h-10 w-10 text-p-std",
|
|
77
|
+
lg: "h-12 w-12 text-p-md",
|
|
78
|
+
xl: "h-16 w-16 text-h-xs",
|
|
79
|
+
"2xl": "h-20 w-20 text-h-xs"
|
|
80
|
+
}, ae = {
|
|
81
|
+
xs: "h-1.5 w-1.5",
|
|
82
|
+
sm: "h-2 w-2",
|
|
83
|
+
md: "h-2.5 w-2.5",
|
|
84
|
+
lg: "h-3 w-3",
|
|
85
|
+
xl: "h-3.5 w-3.5",
|
|
86
|
+
"2xl": "h-4 w-4"
|
|
87
|
+
}, oe = {
|
|
88
|
+
online: "bg-green-500",
|
|
89
|
+
offline: "bg-gray-400 dark:bg-gray-500",
|
|
90
|
+
away: "bg-yellow-600",
|
|
91
|
+
busy: "bg-red-600"
|
|
92
|
+
}, se = {
|
|
93
|
+
xs: "-ml-1.5",
|
|
94
|
+
sm: "-ml-2",
|
|
95
|
+
md: "-ml-2.5",
|
|
96
|
+
lg: "-ml-3",
|
|
97
|
+
xl: "-ml-4",
|
|
98
|
+
"2xl": "-ml-5"
|
|
99
|
+
};
|
|
100
|
+
function ce(e) {
|
|
101
|
+
let t = e.trim().split(/\s+/);
|
|
102
|
+
return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
|
|
103
|
+
}
|
|
104
|
+
function le(e) {
|
|
105
|
+
let t = [
|
|
106
|
+
"bg-brand-500",
|
|
107
|
+
"bg-blue-600",
|
|
108
|
+
"bg-purple-500",
|
|
109
|
+
"bg-pink-500",
|
|
110
|
+
"bg-yellow-600",
|
|
111
|
+
"bg-green-500"
|
|
112
|
+
], n = 0;
|
|
113
|
+
for (let t = 0; t < e.length; t++) n = (n << 5) - n + e.charCodeAt(t), n |= 0;
|
|
114
|
+
return t[Math.abs(n) % t.length];
|
|
115
|
+
}
|
|
116
|
+
var K = i(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape: a = "circle", fallback: o, className: s, dataTestId: c, ...l }, u) {
|
|
117
|
+
let [d, p] = f(!1), m = !!e && !d, h = n ? ce(n) : "", g = n ? le(n) : "bg-gray-300 dark:bg-gray-600";
|
|
118
|
+
return /* @__PURE__ */ B("span", {
|
|
119
|
+
ref: u,
|
|
120
|
+
"data-test-id": c,
|
|
121
|
+
className: H("relative inline-flex shrink-0", s),
|
|
122
|
+
...l,
|
|
123
|
+
children: [/* @__PURE__ */ z("span", {
|
|
124
|
+
className: H("inline-flex items-center justify-center overflow-hidden font-semibold text-white select-none", ie[r], a === "circle" ? "rounded-full" : "rounded-md", !m && g),
|
|
125
|
+
children: m ? /* @__PURE__ */ z("img", {
|
|
126
|
+
src: e,
|
|
127
|
+
alt: t ?? n ?? "",
|
|
128
|
+
onError: () => p(!0),
|
|
129
|
+
className: "h-full w-full object-cover"
|
|
130
|
+
}) : n ? h : o ?? /* @__PURE__ */ z(N, { className: "h-1/2 w-1/2 text-white/90" })
|
|
131
|
+
}), i && /* @__PURE__ */ z("span", {
|
|
132
|
+
"aria-label": i,
|
|
133
|
+
className: H("absolute right-0 bottom-0 rounded-full ring-2 ring-white", ae[r], oe[i])
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
}), ue = i(function({ size: e = "md", max: t, children: n, className: r, dataTestId: i, ...a }, o) {
|
|
137
|
+
let s = Array.isArray(n) ? n : [n], c = t === void 0 ? s : s.slice(0, t), l = t === void 0 ? 0 : s.length - t;
|
|
138
|
+
return /* @__PURE__ */ B("div", {
|
|
139
|
+
ref: o,
|
|
140
|
+
"data-test-id": i,
|
|
141
|
+
className: H("inline-flex items-center", r),
|
|
142
|
+
...a,
|
|
143
|
+
children: [c.map((t, n) => /* @__PURE__ */ z("div", {
|
|
144
|
+
className: H("rounded-full ring-2 ring-white", n > 0 && se[e]),
|
|
145
|
+
style: { zIndex: c.length - n },
|
|
146
|
+
children: t
|
|
147
|
+
}, n)), l > 0 && /* @__PURE__ */ z("div", {
|
|
148
|
+
className: H("rounded-full ring-2 ring-white", se[e]),
|
|
149
|
+
children: /* @__PURE__ */ z(K, {
|
|
150
|
+
size: e,
|
|
151
|
+
name: `+${l}`
|
|
152
|
+
})
|
|
153
|
+
})]
|
|
154
|
+
});
|
|
155
|
+
}), de = {
|
|
156
|
+
lg: "h-7 px-2.5 text-p-std gap-1.5 rounded-md",
|
|
157
|
+
md: "h-6 px-2 text-p-sm gap-1 rounded-md",
|
|
158
|
+
sm: "h-5 px-1.5 text-p-sm gap-1 rounded",
|
|
159
|
+
xs: "h-4 px-1 text-p-xs gap-0.5 rounded"
|
|
160
|
+
}, fe = {
|
|
161
|
+
neutral: "bg-bg-subtle text-fg-default border border-border-default",
|
|
162
|
+
brand: "bg-brand-20 text-brand-800 border border-brand-100",
|
|
163
|
+
success: "bg-green-50 text-green-800 border border-green-100",
|
|
164
|
+
warning: "bg-yellow-50 text-yellow-900 border border-yellow-100",
|
|
165
|
+
danger: "bg-red-50 text-red-800 border border-red-100",
|
|
166
|
+
info: "bg-blue-50 text-blue-800 border border-blue-100",
|
|
167
|
+
privacy: "bg-purple-50 text-purple-800 border border-purple-100"
|
|
168
|
+
}, pe = {
|
|
169
|
+
neutral: "bg-transparent text-fg-default border border-border-strong",
|
|
170
|
+
brand: "bg-transparent text-brand-700 border border-brand-500",
|
|
171
|
+
success: "bg-transparent text-green-700 border border-green-500",
|
|
172
|
+
warning: "bg-transparent text-yellow-800 border border-yellow-600",
|
|
173
|
+
danger: "bg-transparent text-red-700 border border-red-500",
|
|
174
|
+
info: "bg-transparent text-blue-700 border border-blue-500",
|
|
175
|
+
privacy: "bg-transparent text-purple-700 border border-purple-500"
|
|
176
|
+
}, me = {
|
|
177
|
+
neutral: "bg-fg-default text-bg-default",
|
|
178
|
+
brand: "bg-brand-500 text-white",
|
|
179
|
+
success: "bg-green-600 text-white",
|
|
180
|
+
warning: "bg-yellow-600 text-gray-900 dark:text-gray-900",
|
|
181
|
+
danger: "bg-red-700 text-white",
|
|
182
|
+
info: "bg-blue-600 text-white",
|
|
183
|
+
privacy: "bg-purple-500 text-white"
|
|
184
|
+
}, he = i(function({ variant: e = "neutral", appearance: t = "filled", size: n = "md", leftIcon: r, rightIcon: i, onDismiss: a, className: o, children: s, dataTestId: c, ...l }, u) {
|
|
185
|
+
let d = t === "filled" ? fe[e] : t === "outline" ? pe[e] : me[e];
|
|
186
|
+
return /* @__PURE__ */ B("span", {
|
|
187
|
+
ref: u,
|
|
188
|
+
"data-test-id": c,
|
|
189
|
+
className: H("inline-flex items-center font-medium whitespace-nowrap select-none", de[n], d, o),
|
|
190
|
+
...l,
|
|
191
|
+
children: [
|
|
192
|
+
r && /* @__PURE__ */ z("span", {
|
|
193
|
+
className: "inline-flex shrink-0",
|
|
194
|
+
children: r
|
|
195
|
+
}),
|
|
196
|
+
s,
|
|
197
|
+
i && !a && /* @__PURE__ */ z("span", {
|
|
198
|
+
className: "inline-flex shrink-0",
|
|
199
|
+
children: i
|
|
200
|
+
}),
|
|
201
|
+
a && /* @__PURE__ */ z("button", {
|
|
202
|
+
type: "button",
|
|
203
|
+
onClick: a,
|
|
204
|
+
"aria-label": "Dismiss",
|
|
205
|
+
className: "inline-flex shrink-0 -mr-0.5 rounded-full p-0.5 hover:bg-black/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
206
|
+
children: /* @__PURE__ */ z(P, { className: "h-3 w-3" })
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
});
|
|
210
|
+
}), ge = {
|
|
211
|
+
lg: "h-12 px-5 text-p-md gap-2 rounded-lg",
|
|
212
|
+
md: "h-10 px-4 text-p-std gap-2 rounded-lg",
|
|
213
|
+
sm: "h-8 px-3 text-p-sm gap-1.5 rounded-md"
|
|
214
|
+
}, _e = {
|
|
215
|
+
lg: "h-12 w-12 rounded-lg",
|
|
216
|
+
md: "h-10 w-10 rounded-lg",
|
|
217
|
+
sm: "h-8 w-8 rounded-md"
|
|
218
|
+
}, ve = {
|
|
219
|
+
primary: [
|
|
220
|
+
"bg-brand-500 text-white border border-transparent",
|
|
221
|
+
"hover:bg-brand-600 active:bg-brand-700",
|
|
222
|
+
"disabled:bg-bg-subtle disabled:text-fg-disabled disabled:cursor-not-allowed",
|
|
223
|
+
"focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2"
|
|
224
|
+
].join(" "),
|
|
225
|
+
secondary: [
|
|
226
|
+
"bg-bg-default text-fg-default border border-border-default",
|
|
227
|
+
"hover:bg-bg-container active:bg-bg-subtle",
|
|
228
|
+
"disabled:bg-bg-container disabled:text-fg-disabled disabled:cursor-not-allowed",
|
|
229
|
+
"focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2"
|
|
230
|
+
].join(" "),
|
|
231
|
+
tertiary: [
|
|
232
|
+
"bg-transparent text-fg-default border border-transparent",
|
|
233
|
+
"hover:bg-bg-subtle active:bg-bg-subtle",
|
|
234
|
+
"disabled:text-fg-disabled disabled:cursor-not-allowed",
|
|
235
|
+
"focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2"
|
|
236
|
+
].join(" "),
|
|
237
|
+
danger: [
|
|
238
|
+
"bg-red-700 text-white border border-transparent",
|
|
239
|
+
"hover:bg-red-800 active:bg-red-900",
|
|
240
|
+
"disabled:bg-bg-subtle disabled:text-fg-disabled disabled:cursor-not-allowed",
|
|
241
|
+
"focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:ring-offset-2"
|
|
242
|
+
].join(" ")
|
|
243
|
+
}, ye = {
|
|
244
|
+
primary: "bg-brand-700",
|
|
245
|
+
secondary: "bg-bg-subtle",
|
|
246
|
+
tertiary: "bg-bg-subtle",
|
|
247
|
+
danger: "bg-red-900"
|
|
248
|
+
}, be = i(function({ variant: e = "primary", size: t = "md", leftIcon: n, rightIcon: r, loading: i = !1, iconOnly: a = !1, fullWidth: o = !1, pressed: s = !1, disabled: c, className: l, children: u, onClick: d, dataTestId: f, ...p }, m) {
|
|
249
|
+
return /* @__PURE__ */ z("button", {
|
|
250
|
+
ref: m,
|
|
251
|
+
disabled: c || i,
|
|
252
|
+
"aria-pressed": s,
|
|
253
|
+
"data-test-id": f,
|
|
254
|
+
onClick: (e) => {
|
|
255
|
+
if (s || c || i) {
|
|
256
|
+
e.preventDefault();
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
d?.(e);
|
|
260
|
+
},
|
|
261
|
+
className: H("inline-flex items-center justify-center font-medium transition-colors outline-none", a ? _e[t] : ge[t], ve[e], s && ye[e], o && "w-full", l),
|
|
262
|
+
...p,
|
|
263
|
+
children: i ? /* @__PURE__ */ z(E, {
|
|
264
|
+
className: "h-4 w-4 animate-spin",
|
|
265
|
+
"aria-hidden": !0
|
|
266
|
+
}) : /* @__PURE__ */ B(R, { children: [
|
|
267
|
+
n && /* @__PURE__ */ z("span", {
|
|
268
|
+
className: "inline-flex shrink-0",
|
|
269
|
+
children: n
|
|
270
|
+
}),
|
|
271
|
+
u,
|
|
272
|
+
r && /* @__PURE__ */ z("span", {
|
|
273
|
+
className: "inline-flex shrink-0",
|
|
274
|
+
children: r
|
|
275
|
+
})
|
|
276
|
+
] })
|
|
277
|
+
});
|
|
278
|
+
}), xe = {
|
|
279
|
+
horizontal: "flex-row [&>*]:rounded-none [&>*:first-child]:rounded-l-lg [&>*:last-child]:rounded-r-lg [&>*:not(:first-child)]:-ml-px",
|
|
280
|
+
vertical: "flex-col [&>*]:rounded-none [&>*:first-child]:rounded-t-lg [&>*:last-child]:rounded-b-lg [&>*:not(:first-child)]:-mt-px"
|
|
281
|
+
}, Se = i(function({ orientation: e = "horizontal", className: t, children: n, dataTestId: r, ...i }, a) {
|
|
282
|
+
return /* @__PURE__ */ z("div", {
|
|
283
|
+
ref: a,
|
|
284
|
+
role: "group",
|
|
285
|
+
"data-test-id": r,
|
|
286
|
+
className: H("inline-flex isolate", xe[e], "[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10", t),
|
|
287
|
+
...i,
|
|
288
|
+
children: n
|
|
289
|
+
});
|
|
290
|
+
}), Ce = {
|
|
291
|
+
elevated: "bg-bg-default border border-border-default shadow-z1",
|
|
292
|
+
outlined: "bg-bg-default border border-border-default",
|
|
293
|
+
filled: "bg-bg-container border border-transparent"
|
|
294
|
+
}, we = {
|
|
295
|
+
none: "p-0",
|
|
296
|
+
sm: "p-4",
|
|
297
|
+
md: "p-5",
|
|
298
|
+
lg: "p-6"
|
|
299
|
+
}, Te = i(function({ variant: e = "outlined", padding: t = "md", header: n, footer: r, interactive: i = !1, className: a, children: o, dataTestId: s, ...c }, l) {
|
|
300
|
+
let u = n || r;
|
|
301
|
+
return /* @__PURE__ */ B("div", {
|
|
302
|
+
ref: l,
|
|
303
|
+
"data-test-id": s,
|
|
304
|
+
className: H("rounded-xl overflow-hidden", Ce[e], i && "transition-all hover:border-brand-500 hover:shadow-z2", !u && we[t], a),
|
|
305
|
+
...c,
|
|
306
|
+
children: [
|
|
307
|
+
n && /* @__PURE__ */ z("div", {
|
|
308
|
+
className: H("border-b border-border-subtle", we[t]),
|
|
309
|
+
children: n
|
|
310
|
+
}),
|
|
311
|
+
u ? /* @__PURE__ */ z("div", {
|
|
312
|
+
className: we[t],
|
|
313
|
+
children: o
|
|
314
|
+
}) : o,
|
|
315
|
+
r && /* @__PURE__ */ z("div", {
|
|
316
|
+
className: H("border-t border-border-subtle", we[t]),
|
|
317
|
+
children: r
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
});
|
|
321
|
+
}), Ee = {
|
|
322
|
+
md: "h-5 w-5 rounded-sm",
|
|
323
|
+
sm: "h-4 w-4 rounded-sm"
|
|
324
|
+
}, De = {
|
|
325
|
+
md: "h-3.5 w-3.5",
|
|
326
|
+
sm: "h-3 w-3"
|
|
327
|
+
}, Oe = i(function({ size: e = "md", label: t, description: n, indeterminate: r = !1, error: i = !1, id: a, disabled: o, checked: s, defaultChecked: c, className: u, dataTestId: d, ...f }, p) {
|
|
328
|
+
let m = l(), h = a ?? m;
|
|
329
|
+
return /* @__PURE__ */ B("label", {
|
|
330
|
+
htmlFor: h,
|
|
331
|
+
"data-test-id": d,
|
|
332
|
+
className: H("inline-flex items-start gap-2.5 group/checkbox", o ? "cursor-not-allowed opacity-60" : "cursor-pointer", u),
|
|
333
|
+
children: [/* @__PURE__ */ B("span", {
|
|
334
|
+
className: "relative inline-flex shrink-0 items-center justify-center mt-0.5",
|
|
335
|
+
children: [/* @__PURE__ */ z("input", {
|
|
336
|
+
ref: p,
|
|
337
|
+
id: h,
|
|
338
|
+
type: "checkbox",
|
|
339
|
+
checked: s,
|
|
340
|
+
defaultChecked: c,
|
|
341
|
+
disabled: o,
|
|
342
|
+
className: "peer sr-only",
|
|
343
|
+
"aria-invalid": i || void 0,
|
|
344
|
+
"aria-checked": r ? "mixed" : void 0,
|
|
345
|
+
...f
|
|
346
|
+
}), /* @__PURE__ */ z("span", {
|
|
347
|
+
className: H("flex items-center justify-center border transition-colors", Ee[e], !r && "bg-bg-default", i ? "border-red-600" : r ? "border-brand-500" : "border-border-strong", !o && !r && (i ? "peer-hover:border-red-700" : "peer-hover:border-fg-tertiary"), "peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-1", !r && "peer-checked:bg-brand-500 peer-checked:border-brand-500", r && "bg-brand-500", o && !r && "peer-checked:bg-bg-subtle peer-checked:border-border-strong", !r && "[&_svg]:opacity-0 peer-checked:[&_svg]:opacity-100 [&_svg]:transition-opacity"),
|
|
348
|
+
children: z(r ? D : v, {
|
|
349
|
+
className: H(De[e], "text-white"),
|
|
350
|
+
strokeWidth: 3,
|
|
351
|
+
"aria-hidden": !0
|
|
352
|
+
})
|
|
353
|
+
})]
|
|
354
|
+
}), (t || n) && /* @__PURE__ */ B("span", {
|
|
355
|
+
className: "flex flex-col gap-0.5",
|
|
356
|
+
children: [t && /* @__PURE__ */ z("span", {
|
|
357
|
+
className: "text-p-std font-medium text-fg-default leading-tight",
|
|
358
|
+
children: t
|
|
359
|
+
}), n && /* @__PURE__ */ z("span", {
|
|
360
|
+
className: "text-p-sm text-fg-secondary leading-snug",
|
|
361
|
+
children: n
|
|
362
|
+
})]
|
|
363
|
+
})]
|
|
364
|
+
});
|
|
365
|
+
}), ke = {
|
|
366
|
+
lg: "h-12 text-p-md px-3.5",
|
|
367
|
+
md: "h-10 text-p-std px-3",
|
|
368
|
+
sm: "h-8 text-p-sm px-2.5"
|
|
369
|
+
}, Ae = [
|
|
370
|
+
"Jan",
|
|
371
|
+
"Feb",
|
|
372
|
+
"Mar",
|
|
373
|
+
"Apr",
|
|
374
|
+
"May",
|
|
375
|
+
"Jun",
|
|
376
|
+
"Jul",
|
|
377
|
+
"Aug",
|
|
378
|
+
"Sep",
|
|
379
|
+
"Oct",
|
|
380
|
+
"Nov",
|
|
381
|
+
"Dec"
|
|
382
|
+
], je = [
|
|
383
|
+
"Mo",
|
|
384
|
+
"Tu",
|
|
385
|
+
"We",
|
|
386
|
+
"Th",
|
|
387
|
+
"Fr",
|
|
388
|
+
"Sa",
|
|
389
|
+
"Su"
|
|
390
|
+
];
|
|
391
|
+
function Me(e) {
|
|
392
|
+
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
393
|
+
}
|
|
394
|
+
function Ne(e, t) {
|
|
395
|
+
return !!e && !!t && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
396
|
+
}
|
|
397
|
+
function Pe(e) {
|
|
398
|
+
return `${String(e.getDate()).padStart(2, "0")}.${String(e.getMonth() + 1).padStart(2, "0")}.${e.getFullYear()}`;
|
|
399
|
+
}
|
|
400
|
+
function Fe(e) {
|
|
401
|
+
let t = (Me(e).getDay() + 6) % 7, n = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate(), r = [];
|
|
402
|
+
for (let e = 0; e < t; e++) r.push(null);
|
|
403
|
+
for (let t = 1; t <= n; t++) r.push(new Date(e.getFullYear(), e.getMonth(), t));
|
|
404
|
+
for (; r.length % 7 != 0;) r.push(null);
|
|
405
|
+
return r;
|
|
406
|
+
}
|
|
407
|
+
var Ie = i(function({ value: e, onChange: t, range: n = !1, rangeValue: r, onChangeRange: i, size: a = "md", label: o, placeholder: s = "Select date", fullWidth: u = !1, id: p, className: m, wrapperClassName: h, dataTestId: g }, v) {
|
|
408
|
+
let y = l(), b = p ?? y, [C, w] = f(!1), [T, E] = f(e ?? r?.start ?? /* @__PURE__ */ new Date()), [ee, D] = f(null), O = d(null);
|
|
409
|
+
c(() => {
|
|
410
|
+
if (!C) return;
|
|
411
|
+
let e = (e) => {
|
|
412
|
+
O.current && !O.current.contains(e.target) && w(!1);
|
|
413
|
+
};
|
|
414
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
415
|
+
}, [C]);
|
|
416
|
+
let k = n ? r?.start ? `${Pe(r.start)}${r.end ? ` – ${Pe(r.end)}` : ""}` : "" : e ? Pe(e) : "";
|
|
417
|
+
function A(e) {
|
|
418
|
+
if (!n) {
|
|
419
|
+
t?.(e), w(!1);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
let a = r ?? {
|
|
423
|
+
start: null,
|
|
424
|
+
end: null
|
|
425
|
+
};
|
|
426
|
+
if (!a.start || a.start && a.end) {
|
|
427
|
+
i?.({
|
|
428
|
+
start: e,
|
|
429
|
+
end: null
|
|
430
|
+
});
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
if (e < a.start) {
|
|
434
|
+
i?.({
|
|
435
|
+
start: e,
|
|
436
|
+
end: a.start
|
|
437
|
+
});
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
i?.({
|
|
441
|
+
start: a.start,
|
|
442
|
+
end: e
|
|
443
|
+
}), w(!1);
|
|
444
|
+
}
|
|
445
|
+
let j = Fe(T), M = r ?? {
|
|
446
|
+
start: null,
|
|
447
|
+
end: null
|
|
448
|
+
}, N = M.end ?? ee;
|
|
449
|
+
return /* @__PURE__ */ B("div", {
|
|
450
|
+
ref: O,
|
|
451
|
+
"data-test-id": g,
|
|
452
|
+
className: H("flex flex-col gap-1.5", u && "w-full", h),
|
|
453
|
+
children: [o && /* @__PURE__ */ z("label", {
|
|
454
|
+
htmlFor: b,
|
|
455
|
+
className: "text-p-std font-medium text-fg-default inline-flex",
|
|
456
|
+
children: o
|
|
457
|
+
}), /* @__PURE__ */ B("div", {
|
|
458
|
+
className: "relative",
|
|
459
|
+
children: [/* @__PURE__ */ B("button", {
|
|
460
|
+
ref: v,
|
|
461
|
+
id: b,
|
|
462
|
+
type: "button",
|
|
463
|
+
onClick: () => w((e) => !e),
|
|
464
|
+
className: H("inline-flex items-center gap-2 rounded-lg border border-border-default bg-bg-default text-left transition-colors hover:border-border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:border-brand-500", u ? "w-full min-w-0" : "min-w-[260px]", ke[a], m),
|
|
465
|
+
children: [/* @__PURE__ */ z("span", {
|
|
466
|
+
className: H("flex-1 text-left truncate", k ? "text-fg-default" : "text-fg-tertiary"),
|
|
467
|
+
children: k || s
|
|
468
|
+
}), /* @__PURE__ */ z(_, { className: "w-4 h-4 text-fg-secondary" })]
|
|
469
|
+
}), C && /* @__PURE__ */ B("div", {
|
|
470
|
+
className: "absolute z-50 mt-1 left-0 rounded-xl border border-border-default bg-bg-default shadow-z3 p-3 w-[300px]",
|
|
471
|
+
children: [/* @__PURE__ */ B("div", {
|
|
472
|
+
className: "flex items-center justify-between mb-2",
|
|
473
|
+
children: [
|
|
474
|
+
/* @__PURE__ */ z("button", {
|
|
475
|
+
type: "button",
|
|
476
|
+
className: "w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary",
|
|
477
|
+
onClick: () => E(new Date(T.getFullYear(), T.getMonth() - 1, 1)),
|
|
478
|
+
"aria-label": "Previous month",
|
|
479
|
+
children: /* @__PURE__ */ z(x, { className: "w-4 h-4" })
|
|
480
|
+
}),
|
|
481
|
+
/* @__PURE__ */ B("div", {
|
|
482
|
+
className: "text-p-md font-semibold text-fg-default",
|
|
483
|
+
children: [
|
|
484
|
+
Ae[T.getMonth()],
|
|
485
|
+
" ",
|
|
486
|
+
T.getFullYear()
|
|
487
|
+
]
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ z("button", {
|
|
490
|
+
type: "button",
|
|
491
|
+
className: "w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary",
|
|
492
|
+
onClick: () => E(new Date(T.getFullYear(), T.getMonth() + 1, 1)),
|
|
493
|
+
"aria-label": "Next month",
|
|
494
|
+
children: /* @__PURE__ */ z(S, { className: "w-4 h-4" })
|
|
495
|
+
})
|
|
496
|
+
]
|
|
497
|
+
}), /* @__PURE__ */ B("div", {
|
|
498
|
+
className: "grid grid-cols-7 gap-1 text-center",
|
|
499
|
+
children: [je.map((e) => /* @__PURE__ */ z("div", {
|
|
500
|
+
className: "text-p-xs text-fg-tertiary py-1",
|
|
501
|
+
children: e
|
|
502
|
+
}, e)), j.map((t, r) => {
|
|
503
|
+
if (!t) return /* @__PURE__ */ z("div", {}, r);
|
|
504
|
+
let i = !n && Ne(t, e ?? null), a = n && Ne(t, M.start), o = n && Ne(t, N), s = n && !!M.start && !!N && t > M.start && t < N;
|
|
505
|
+
return /* @__PURE__ */ z("button", {
|
|
506
|
+
type: "button",
|
|
507
|
+
onMouseEnter: () => n && M.start && !M.end && D(t),
|
|
508
|
+
onClick: () => A(t),
|
|
509
|
+
className: H("h-8 rounded-md text-p-sm font-medium", i || a || o ? "bg-brand-500 text-white" : s ? "bg-bg-brand-lighter text-brand-700" : "text-fg-default hover:bg-bg-container"),
|
|
510
|
+
children: t.getDate()
|
|
511
|
+
}, r);
|
|
512
|
+
})]
|
|
513
|
+
})]
|
|
514
|
+
})]
|
|
515
|
+
})]
|
|
516
|
+
});
|
|
517
|
+
}), Le = {
|
|
518
|
+
sm: "w-[320px]",
|
|
519
|
+
md: "w-[420px]",
|
|
520
|
+
lg: "w-[560px]",
|
|
521
|
+
xl: "w-[720px]"
|
|
522
|
+
}, Re = {
|
|
523
|
+
sm: "h-[240px]",
|
|
524
|
+
md: "h-[360px]",
|
|
525
|
+
lg: "h-[480px]",
|
|
526
|
+
xl: "h-[600px]"
|
|
527
|
+
}, ze = {
|
|
528
|
+
right: "inset-y-0 right-0 border-l",
|
|
529
|
+
left: "inset-y-0 left-0 border-r",
|
|
530
|
+
top: "inset-x-0 top-0 border-b",
|
|
531
|
+
bottom: "inset-x-0 bottom-0 border-t"
|
|
532
|
+
};
|
|
533
|
+
function Be(...e) {
|
|
534
|
+
return (t) => {
|
|
535
|
+
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
var Ve = i(function({ open: e, onClose: t, side: n = "right", size: r = "md", title: i, description: a, children: o, footer: s, closeOnOverlayClick: l = !0, showClose: u = !0, className: f, dataTestId: p }, m) {
|
|
539
|
+
let h = d(null);
|
|
540
|
+
if (c(() => {
|
|
541
|
+
if (!e) return;
|
|
542
|
+
let n = (e) => {
|
|
543
|
+
e.key === "Escape" && t();
|
|
544
|
+
};
|
|
545
|
+
document.addEventListener("keydown", n);
|
|
546
|
+
let r = document.body.style.overflow;
|
|
547
|
+
return document.body.style.overflow = "hidden", () => {
|
|
548
|
+
document.removeEventListener("keydown", n), document.body.style.overflow = r;
|
|
549
|
+
};
|
|
550
|
+
}, [e, t]), c(() => {
|
|
551
|
+
if (!e) return;
|
|
552
|
+
let t = document.activeElement;
|
|
553
|
+
return h.current?.focus(), () => t?.focus?.();
|
|
554
|
+
}, [e]), !e) return null;
|
|
555
|
+
let g = n === "left" || n === "right", _ = g ? Le[r] : Re[r];
|
|
556
|
+
return V(/* @__PURE__ */ B("div", {
|
|
557
|
+
role: "dialog",
|
|
558
|
+
"aria-modal": "true",
|
|
559
|
+
"aria-labelledby": i ? "drawer-title" : void 0,
|
|
560
|
+
"aria-describedby": a ? "drawer-desc" : void 0,
|
|
561
|
+
className: "fixed inset-0 z-50",
|
|
562
|
+
"data-test-id": p,
|
|
563
|
+
children: [/* @__PURE__ */ z("div", {
|
|
564
|
+
className: "absolute inset-0 bg-black/50",
|
|
565
|
+
onClick: () => l && t(),
|
|
566
|
+
"aria-hidden": !0
|
|
567
|
+
}), /* @__PURE__ */ B("div", {
|
|
568
|
+
ref: Be(m, h),
|
|
569
|
+
tabIndex: -1,
|
|
570
|
+
className: H("absolute bg-bg-default shadow-z5 outline-none flex flex-col", ze[n], g ? `${_} h-full max-w-full` : `${_} w-full max-h-full`, "border-border-default", f),
|
|
571
|
+
children: [
|
|
572
|
+
(i || u) && /* @__PURE__ */ B("div", {
|
|
573
|
+
className: "flex items-start justify-between gap-4 px-6 pt-6 pb-4 border-b border-border-default",
|
|
574
|
+
children: [/* @__PURE__ */ B("div", {
|
|
575
|
+
className: "flex-1 min-w-0",
|
|
576
|
+
children: [i && /* @__PURE__ */ z("h2", {
|
|
577
|
+
id: "drawer-title",
|
|
578
|
+
className: "text-h-xs font-semibold text-fg-default",
|
|
579
|
+
children: i
|
|
580
|
+
}), a && /* @__PURE__ */ z("p", {
|
|
581
|
+
id: "drawer-desc",
|
|
582
|
+
className: "mt-1 text-p-std text-fg-secondary",
|
|
583
|
+
children: a
|
|
584
|
+
})]
|
|
585
|
+
}), u && /* @__PURE__ */ z("button", {
|
|
586
|
+
type: "button",
|
|
587
|
+
onClick: t,
|
|
588
|
+
"aria-label": "Close",
|
|
589
|
+
className: "-mr-2 -mt-2 p-2 rounded-md text-fg-secondary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
590
|
+
children: /* @__PURE__ */ z(P, { className: "h-5 w-5" })
|
|
591
|
+
})]
|
|
592
|
+
}),
|
|
593
|
+
o && /* @__PURE__ */ z("div", {
|
|
594
|
+
className: "flex-1 overflow-y-auto px-6 py-4",
|
|
595
|
+
children: o
|
|
596
|
+
}),
|
|
597
|
+
s && /* @__PURE__ */ z("div", {
|
|
598
|
+
className: "flex items-center justify-end gap-2 px-6 py-4 border-t border-border-default bg-bg-container",
|
|
599
|
+
children: s
|
|
600
|
+
})
|
|
601
|
+
]
|
|
602
|
+
})]
|
|
603
|
+
}), document.body);
|
|
604
|
+
}), He = n(null);
|
|
605
|
+
function Ue() {
|
|
606
|
+
let e = s(He);
|
|
607
|
+
if (!e) throw Error("Dropdown parts must be used inside <DropdownMenu>");
|
|
608
|
+
return e;
|
|
609
|
+
}
|
|
610
|
+
function We(...e) {
|
|
611
|
+
return (t) => {
|
|
612
|
+
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
var Ge = i(function({ children: e, defaultOpen: t = !1, open: n, onOpenChange: r, className: i, dataTestId: a, ...o }, s) {
|
|
616
|
+
let [l, u] = f(t), p = n !== void 0, m = p ? n : l, h = d(null), g = (e) => {
|
|
617
|
+
p || u(e), r?.(e);
|
|
618
|
+
};
|
|
619
|
+
return c(() => {
|
|
620
|
+
if (!m) return;
|
|
621
|
+
let e = (e) => {
|
|
622
|
+
e.key === "Escape" && g(!1);
|
|
623
|
+
};
|
|
624
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
625
|
+
}, [m]), /* @__PURE__ */ z(He.Provider, {
|
|
626
|
+
value: {
|
|
627
|
+
open: m,
|
|
628
|
+
setOpen: g,
|
|
629
|
+
triggerRef: h
|
|
630
|
+
},
|
|
631
|
+
children: /* @__PURE__ */ z("div", {
|
|
632
|
+
ref: s,
|
|
633
|
+
"data-test-id": a,
|
|
634
|
+
className: H("relative inline-block", i),
|
|
635
|
+
...o,
|
|
636
|
+
children: e
|
|
637
|
+
})
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
function Ke({ children: e }) {
|
|
641
|
+
let { open: n, setOpen: r, triggerRef: i } = Ue();
|
|
642
|
+
if (!a(e)) return e;
|
|
643
|
+
let o = e.props ?? {};
|
|
644
|
+
return t(e, {
|
|
645
|
+
ref: i,
|
|
646
|
+
onClick: (e) => {
|
|
647
|
+
let t = o.onClick;
|
|
648
|
+
t?.(e), e.defaultPrevented || r(!n);
|
|
649
|
+
},
|
|
650
|
+
"aria-haspopup": "menu",
|
|
651
|
+
"aria-expanded": n
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
var qe = i(function({ children: e, align: t = "start", className: n, dataTestId: r, ...i }, a) {
|
|
655
|
+
let { open: o, setOpen: s, triggerRef: l } = Ue(), u = d(null);
|
|
656
|
+
return c(() => {
|
|
657
|
+
if (!o) return;
|
|
658
|
+
let e = (e) => {
|
|
659
|
+
let t = e.target;
|
|
660
|
+
u.current?.contains(t) || l.current?.contains(t) || s(!1);
|
|
661
|
+
};
|
|
662
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
663
|
+
}, [
|
|
664
|
+
o,
|
|
665
|
+
s,
|
|
666
|
+
l
|
|
667
|
+
]), o ? /* @__PURE__ */ z("div", {
|
|
668
|
+
ref: We(a, u),
|
|
669
|
+
role: "menu",
|
|
670
|
+
"data-test-id": r,
|
|
671
|
+
className: H("absolute top-full mt-1 min-w-[200px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1", t === "end" ? "right-0" : "left-0", n),
|
|
672
|
+
...i,
|
|
673
|
+
children: e
|
|
674
|
+
}) : null;
|
|
675
|
+
}), Je = i(function({ children: e, onSelect: t, disabled: n, icon: r, shortcut: i, destructive: a, checked: o, className: s, dataTestId: c, onClick: l, ...u }, d) {
|
|
676
|
+
let { setOpen: f } = Ue();
|
|
677
|
+
return /* @__PURE__ */ B("button", {
|
|
678
|
+
ref: d,
|
|
679
|
+
type: "button",
|
|
680
|
+
role: "menuitem",
|
|
681
|
+
disabled: n,
|
|
682
|
+
"data-test-id": c,
|
|
683
|
+
onClick: (e) => {
|
|
684
|
+
l?.(e), t?.(), f(!1);
|
|
685
|
+
},
|
|
686
|
+
className: H("flex w-full items-center gap-2 px-3 py-2 text-left text-p-std text-fg-default", "hover:bg-bg-subtle focus-visible:outline-none focus-visible:bg-bg-subtle", n && "opacity-50 cursor-not-allowed hover:bg-transparent", a && "text-red-700 hover:bg-red-50", s),
|
|
687
|
+
...u,
|
|
688
|
+
children: [
|
|
689
|
+
o !== void 0 && /* @__PURE__ */ z("span", {
|
|
690
|
+
className: "w-4 shrink-0",
|
|
691
|
+
children: o && /* @__PURE__ */ z(v, { className: "h-4 w-4 text-brand-500" })
|
|
692
|
+
}),
|
|
693
|
+
r && /* @__PURE__ */ z("span", {
|
|
694
|
+
className: "inline-flex shrink-0 text-fg-secondary",
|
|
695
|
+
children: r
|
|
696
|
+
}),
|
|
697
|
+
/* @__PURE__ */ z("span", {
|
|
698
|
+
className: "flex-1 truncate",
|
|
699
|
+
children: e
|
|
700
|
+
}),
|
|
701
|
+
i && /* @__PURE__ */ z("span", {
|
|
702
|
+
className: "text-p-sm text-fg-tertiary shrink-0 tabular-nums",
|
|
703
|
+
children: i
|
|
704
|
+
})
|
|
705
|
+
]
|
|
706
|
+
});
|
|
707
|
+
}), Ye = i(function({ className: e, dataTestId: t, ...n }, r) {
|
|
708
|
+
return /* @__PURE__ */ z("div", {
|
|
709
|
+
ref: r,
|
|
710
|
+
role: "separator",
|
|
711
|
+
"data-test-id": t,
|
|
712
|
+
className: H("my-1 h-px bg-border-default", e),
|
|
713
|
+
...n
|
|
714
|
+
});
|
|
715
|
+
}), Xe = i(function({ children: e, className: t, dataTestId: n, ...r }, i) {
|
|
716
|
+
return /* @__PURE__ */ z("div", {
|
|
717
|
+
ref: i,
|
|
718
|
+
"data-test-id": n,
|
|
719
|
+
className: H("px-3 py-1.5 text-p-xs font-semibold uppercase tracking-wider text-fg-tertiary", t),
|
|
720
|
+
...r,
|
|
721
|
+
children: e
|
|
722
|
+
});
|
|
723
|
+
}), Ze = {
|
|
724
|
+
lg: "h-10 px-3 text-p-std gap-2",
|
|
725
|
+
md: "h-9 px-2.5 text-p-std gap-1.5",
|
|
726
|
+
sm: "h-8 px-2 text-p-sm gap-1.5"
|
|
727
|
+
};
|
|
728
|
+
function Qe(...e) {
|
|
729
|
+
return (t) => {
|
|
730
|
+
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
var $e = i(function({ label: e, value: t, active: n = !1, size: r = "md", disabled: i, onClear: a, children: o, className: s, dataTestId: l, ...u }, p) {
|
|
734
|
+
let [m, h] = f(!1), g = d(null);
|
|
735
|
+
c(() => {
|
|
736
|
+
if (!m) return;
|
|
737
|
+
let e = (e) => {
|
|
738
|
+
g.current?.contains(e.target) || h(!1);
|
|
739
|
+
};
|
|
740
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
741
|
+
}, [m]);
|
|
742
|
+
let _ = n || t !== void 0;
|
|
743
|
+
return /* @__PURE__ */ B("div", {
|
|
744
|
+
ref: Qe(p, g),
|
|
745
|
+
"data-test-id": l,
|
|
746
|
+
className: H("relative inline-flex", s),
|
|
747
|
+
...u,
|
|
748
|
+
children: [/* @__PURE__ */ B("button", {
|
|
749
|
+
type: "button",
|
|
750
|
+
disabled: i,
|
|
751
|
+
onClick: () => h((e) => !e),
|
|
752
|
+
"aria-haspopup": "dialog",
|
|
753
|
+
"aria-expanded": m,
|
|
754
|
+
className: H("inline-flex items-center rounded-full border transition-colors outline-none", Ze[r], _ ? "bg-brand-20 text-brand-800 border-brand-500" : "bg-bg-default text-fg-default border-border-default", !i && "hover:border-border-strong", "focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1", i && "bg-bg-container text-fg-disabled cursor-not-allowed"),
|
|
755
|
+
children: [
|
|
756
|
+
/* @__PURE__ */ z("span", {
|
|
757
|
+
className: "font-medium",
|
|
758
|
+
children: e
|
|
759
|
+
}),
|
|
760
|
+
t !== void 0 && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("span", {
|
|
761
|
+
className: "mx-0.5 text-fg-tertiary",
|
|
762
|
+
"aria-hidden": !0,
|
|
763
|
+
children: "•"
|
|
764
|
+
}), /* @__PURE__ */ z("span", {
|
|
765
|
+
className: "font-semibold truncate max-w-[140px]",
|
|
766
|
+
children: t
|
|
767
|
+
})] }),
|
|
768
|
+
_ && a ? /* @__PURE__ */ z("span", {
|
|
769
|
+
role: "button",
|
|
770
|
+
tabIndex: 0,
|
|
771
|
+
"aria-label": "Clear filter",
|
|
772
|
+
onClick: (e) => {
|
|
773
|
+
e.stopPropagation(), a();
|
|
774
|
+
},
|
|
775
|
+
onKeyDown: (e) => {
|
|
776
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), a());
|
|
777
|
+
},
|
|
778
|
+
className: "inline-flex items-center justify-center rounded-full p-0.5 hover:bg-black/10",
|
|
779
|
+
children: /* @__PURE__ */ z(P, { className: "h-3 w-3" })
|
|
780
|
+
}) : /* @__PURE__ */ z(b, {
|
|
781
|
+
className: H("h-4 w-4 text-fg-secondary transition-transform", m && "rotate-180"),
|
|
782
|
+
"aria-hidden": !0
|
|
783
|
+
})
|
|
784
|
+
]
|
|
785
|
+
}), m && o && /* @__PURE__ */ z("div", {
|
|
786
|
+
className: "absolute left-0 top-full mt-1 min-w-[220px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 p-3",
|
|
787
|
+
children: o
|
|
788
|
+
})]
|
|
789
|
+
});
|
|
790
|
+
}), et = {
|
|
791
|
+
brand: {
|
|
792
|
+
bg: "bg-bg-brand-lighter",
|
|
793
|
+
icon: "text-brand-700"
|
|
794
|
+
},
|
|
795
|
+
info: {
|
|
796
|
+
bg: "bg-bg-info-lighter",
|
|
797
|
+
icon: "text-blue-700"
|
|
798
|
+
},
|
|
799
|
+
gray: {
|
|
800
|
+
bg: "bg-bg-subtle",
|
|
801
|
+
icon: "text-fg-tertiary"
|
|
802
|
+
},
|
|
803
|
+
purple: {
|
|
804
|
+
bg: "bg-purple-50 dark:bg-purple-900/30",
|
|
805
|
+
icon: "text-purple-700 dark:text-purple-300"
|
|
806
|
+
},
|
|
807
|
+
pink: {
|
|
808
|
+
bg: "bg-pink-50 dark:bg-pink-900/30",
|
|
809
|
+
icon: "text-pink-700 dark:text-pink-300"
|
|
810
|
+
},
|
|
811
|
+
yellow: {
|
|
812
|
+
bg: "bg-bg-warning-lighter",
|
|
813
|
+
icon: "text-yellow-800"
|
|
814
|
+
},
|
|
815
|
+
success: {
|
|
816
|
+
bg: "bg-bg-success-lighter",
|
|
817
|
+
icon: "text-green-600"
|
|
818
|
+
},
|
|
819
|
+
warning: {
|
|
820
|
+
bg: "bg-bg-warning-lighter",
|
|
821
|
+
icon: "text-yellow-800"
|
|
822
|
+
},
|
|
823
|
+
danger: {
|
|
824
|
+
bg: "bg-bg-danger-lighter",
|
|
825
|
+
icon: "text-red-700"
|
|
826
|
+
}
|
|
827
|
+
}, tt = {
|
|
828
|
+
sm: {
|
|
829
|
+
box: "h-8 w-8",
|
|
830
|
+
icon: "h-4 w-4",
|
|
831
|
+
radius: "rounded-md"
|
|
832
|
+
},
|
|
833
|
+
md: {
|
|
834
|
+
box: "h-10 w-10",
|
|
835
|
+
icon: "h-5 w-5",
|
|
836
|
+
radius: "rounded-lg"
|
|
837
|
+
},
|
|
838
|
+
lg: {
|
|
839
|
+
box: "h-12 w-12",
|
|
840
|
+
icon: "h-6 w-6",
|
|
841
|
+
radius: "rounded-lg"
|
|
842
|
+
},
|
|
843
|
+
xl: {
|
|
844
|
+
box: "h-14 w-14",
|
|
845
|
+
icon: "h-7 w-7",
|
|
846
|
+
radius: "rounded-xl"
|
|
847
|
+
}
|
|
848
|
+
}, nt = i(function({ icon: e, tone: t = "gray", size: n = "md", shape: r = "rounded", className: i, dataTestId: a, ...o }, s) {
|
|
849
|
+
let c = et[t], l = tt[n];
|
|
850
|
+
return /* @__PURE__ */ z("div", {
|
|
851
|
+
ref: s,
|
|
852
|
+
"data-test-id": a,
|
|
853
|
+
"aria-hidden": !o["aria-label"] || void 0,
|
|
854
|
+
className: H("inline-flex items-center justify-center shrink-0", l.box, r === "circle" ? "rounded-full" : l.radius, c.bg, i),
|
|
855
|
+
...o,
|
|
856
|
+
children: /* @__PURE__ */ z(e, { className: H(l.icon, c.icon) })
|
|
857
|
+
});
|
|
858
|
+
}), rt = i(function({ icon: e, iconTone: t = "brand", label: n, value: r, action: i, className: a, dataTestId: o, ...s }, c) {
|
|
859
|
+
return /* @__PURE__ */ B("div", {
|
|
860
|
+
ref: c,
|
|
861
|
+
"data-test-id": o,
|
|
862
|
+
className: H("flex items-start gap-3", a),
|
|
863
|
+
...s,
|
|
864
|
+
children: [
|
|
865
|
+
/* @__PURE__ */ z(nt, {
|
|
866
|
+
icon: e,
|
|
867
|
+
tone: t,
|
|
868
|
+
size: "md"
|
|
869
|
+
}),
|
|
870
|
+
/* @__PURE__ */ B("div", {
|
|
871
|
+
className: "min-w-0 flex-1",
|
|
872
|
+
children: [/* @__PURE__ */ z("div", {
|
|
873
|
+
className: "text-p-xs font-medium uppercase tracking-widest text-fg-tertiary",
|
|
874
|
+
children: n
|
|
875
|
+
}), /* @__PURE__ */ z("div", {
|
|
876
|
+
className: "text-p-std font-semibold text-fg-default mt-1 break-words",
|
|
877
|
+
children: r
|
|
878
|
+
})]
|
|
879
|
+
}),
|
|
880
|
+
i && /* @__PURE__ */ z("div", {
|
|
881
|
+
className: "shrink-0 flex items-center",
|
|
882
|
+
children: i
|
|
883
|
+
})
|
|
884
|
+
]
|
|
885
|
+
});
|
|
886
|
+
}), it = {
|
|
887
|
+
success: {
|
|
888
|
+
container: "bg-green-50 border-green-200",
|
|
889
|
+
iconColor: "text-green-600",
|
|
890
|
+
DefaultIcon: y
|
|
891
|
+
},
|
|
892
|
+
warning: {
|
|
893
|
+
container: "bg-yellow-50 border-yellow-200",
|
|
894
|
+
iconColor: "text-yellow-800",
|
|
895
|
+
DefaultIcon: m
|
|
896
|
+
},
|
|
897
|
+
danger: {
|
|
898
|
+
container: "bg-red-50 border-red-200",
|
|
899
|
+
iconColor: "text-red-700",
|
|
900
|
+
DefaultIcon: F
|
|
901
|
+
},
|
|
902
|
+
info: {
|
|
903
|
+
container: "bg-blue-50 border-blue-200",
|
|
904
|
+
iconColor: "text-blue-700",
|
|
905
|
+
DefaultIcon: T
|
|
906
|
+
},
|
|
907
|
+
discovery: {
|
|
908
|
+
container: "bg-purple-50 border-purple-200",
|
|
909
|
+
iconColor: "text-purple-700",
|
|
910
|
+
DefaultIcon: A
|
|
911
|
+
}
|
|
912
|
+
}, at = i(function({ variant: e = "info", title: t, description: n, onDismiss: r, actions: i, icon: a, className: o, dataTestId: s, ...c }, l) {
|
|
913
|
+
let { container: u, iconColor: d, DefaultIcon: f } = it[e];
|
|
914
|
+
return /* @__PURE__ */ B("div", {
|
|
915
|
+
ref: l,
|
|
916
|
+
role: "alert",
|
|
917
|
+
"data-test-id": s,
|
|
918
|
+
className: H("flex gap-3 p-4 border rounded-lg", u, o),
|
|
919
|
+
...c,
|
|
920
|
+
children: [
|
|
921
|
+
/* @__PURE__ */ z("div", {
|
|
922
|
+
className: H("flex-shrink-0 mt-0.5", d),
|
|
923
|
+
children: a ?? /* @__PURE__ */ z(f, {
|
|
924
|
+
className: "h-5 w-5",
|
|
925
|
+
"aria-hidden": !0
|
|
926
|
+
})
|
|
927
|
+
}),
|
|
928
|
+
/* @__PURE__ */ B("div", {
|
|
929
|
+
className: "flex-1 min-w-0",
|
|
930
|
+
children: [
|
|
931
|
+
t && /* @__PURE__ */ z("div", {
|
|
932
|
+
className: "text-p-std font-semibold text-fg-default mb-0.5",
|
|
933
|
+
children: t
|
|
934
|
+
}),
|
|
935
|
+
n && /* @__PURE__ */ z("div", {
|
|
936
|
+
className: "text-p-std text-fg-secondary",
|
|
937
|
+
children: n
|
|
938
|
+
}),
|
|
939
|
+
i && /* @__PURE__ */ z("div", {
|
|
940
|
+
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
941
|
+
children: i
|
|
942
|
+
})
|
|
943
|
+
]
|
|
944
|
+
}),
|
|
945
|
+
r && /* @__PURE__ */ z("button", {
|
|
946
|
+
type: "button",
|
|
947
|
+
onClick: r,
|
|
948
|
+
"aria-label": "Dismiss",
|
|
949
|
+
className: "flex-shrink-0 -mr-1 -mt-1 p-1 rounded-md text-fg-secondary hover:text-fg-default hover:bg-black/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
950
|
+
children: /* @__PURE__ */ z(P, { className: "h-4 w-4" })
|
|
951
|
+
})
|
|
952
|
+
]
|
|
953
|
+
});
|
|
954
|
+
}), ot = {
|
|
955
|
+
lg: "h-12 text-p-md",
|
|
956
|
+
md: "h-10 text-p-std",
|
|
957
|
+
sm: "h-8 text-p-sm"
|
|
958
|
+
}, st = {
|
|
959
|
+
lg: "pl-10",
|
|
960
|
+
md: "pl-9",
|
|
961
|
+
sm: "pl-8"
|
|
962
|
+
}, ct = {
|
|
963
|
+
lg: "pr-10",
|
|
964
|
+
md: "pr-9",
|
|
965
|
+
sm: "pr-8"
|
|
966
|
+
}, lt = {
|
|
967
|
+
lg: "w-10",
|
|
968
|
+
md: "w-9",
|
|
969
|
+
sm: "w-8"
|
|
970
|
+
}, ut = i(function({ label: e, helperText: t, errorText: n, size: r = "md", leftIcon: i, rightIcon: a, leftAddon: o, rightAddon: s, error: c = !1, id: u, disabled: d, className: f, wrapperClassName: m, required: h, dataTestId: g, ..._ }, v) {
|
|
971
|
+
let y = l(), b = u ?? y, x = n ? `${b}-error` : t ? `${b}-help` : void 0, S = c || !!n;
|
|
972
|
+
return /* @__PURE__ */ B("div", {
|
|
973
|
+
className: H("flex flex-col gap-1.5 w-full", m),
|
|
974
|
+
"data-test-id": g,
|
|
975
|
+
children: [
|
|
976
|
+
e && /* @__PURE__ */ B("label", {
|
|
977
|
+
htmlFor: b,
|
|
978
|
+
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
979
|
+
children: [e, h && /* @__PURE__ */ z("span", {
|
|
980
|
+
className: "text-red-600",
|
|
981
|
+
"aria-hidden": !0,
|
|
982
|
+
children: "*"
|
|
983
|
+
})]
|
|
984
|
+
}),
|
|
985
|
+
/* @__PURE__ */ B("div", {
|
|
986
|
+
className: H("flex items-stretch w-full rounded-lg bg-bg-default transition-colors", "border", S ? "border-red-600" : "border-border-default", !d && !S && "hover:border-border-strong", "focus-within:ring-2 focus-within:ring-offset-0", S ? "focus-within:ring-red-300 focus-within:border-red-600" : "focus-within:ring-brand-300 focus-within:border-brand-500", d && "bg-bg-container border-border-default cursor-not-allowed", ot[r]),
|
|
987
|
+
children: [
|
|
988
|
+
o && /* @__PURE__ */ z("span", {
|
|
989
|
+
className: "inline-flex items-center px-3 text-fg-secondary bg-bg-container border-r border-border-default rounded-l-lg whitespace-nowrap",
|
|
990
|
+
children: o
|
|
991
|
+
}),
|
|
992
|
+
/* @__PURE__ */ B("div", {
|
|
993
|
+
className: "relative flex-1 min-w-0",
|
|
994
|
+
children: [
|
|
995
|
+
i && /* @__PURE__ */ z("span", {
|
|
996
|
+
"aria-hidden": !0,
|
|
997
|
+
className: H("absolute inset-y-0 left-0 flex items-center justify-center text-fg-secondary pointer-events-none", lt[r]),
|
|
998
|
+
children: i
|
|
999
|
+
}),
|
|
1000
|
+
/* @__PURE__ */ z("input", {
|
|
1001
|
+
ref: v,
|
|
1002
|
+
id: b,
|
|
1003
|
+
disabled: d,
|
|
1004
|
+
required: h,
|
|
1005
|
+
"aria-invalid": S || void 0,
|
|
1006
|
+
"aria-describedby": x,
|
|
1007
|
+
className: H("w-full h-full bg-transparent outline-none", "placeholder:text-fg-tertiary text-fg-default", "disabled:cursor-not-allowed disabled:text-fg-disabled", i ? st[r] : "pl-3", a || S ? ct[r] : "pr-3", f),
|
|
1008
|
+
..._
|
|
1009
|
+
}),
|
|
1010
|
+
(a || S) && /* @__PURE__ */ z("span", {
|
|
1011
|
+
"aria-hidden": !0,
|
|
1012
|
+
className: H("absolute inset-y-0 right-0 flex items-center justify-center pointer-events-none", lt[r], S ? "text-red-600" : "text-fg-secondary"),
|
|
1013
|
+
children: S ? /* @__PURE__ */ z(p, { className: "h-4 w-4" }) : a
|
|
1014
|
+
})
|
|
1015
|
+
]
|
|
1016
|
+
}),
|
|
1017
|
+
s && /* @__PURE__ */ z("span", {
|
|
1018
|
+
className: "inline-flex items-center px-3 text-fg-secondary bg-bg-container border-l border-border-default rounded-r-lg whitespace-nowrap",
|
|
1019
|
+
children: s
|
|
1020
|
+
})
|
|
1021
|
+
]
|
|
1022
|
+
}),
|
|
1023
|
+
n ? /* @__PURE__ */ z("p", {
|
|
1024
|
+
id: `${b}-error`,
|
|
1025
|
+
className: "text-p-sm text-red-700",
|
|
1026
|
+
children: n
|
|
1027
|
+
}) : t ? /* @__PURE__ */ z("p", {
|
|
1028
|
+
id: `${b}-help`,
|
|
1029
|
+
className: "text-p-sm text-fg-secondary",
|
|
1030
|
+
children: t
|
|
1031
|
+
}) : null
|
|
1032
|
+
]
|
|
1033
|
+
});
|
|
1034
|
+
}), dt = {
|
|
1035
|
+
sm: "max-w-sm",
|
|
1036
|
+
md: "max-w-md",
|
|
1037
|
+
lg: "max-w-lg",
|
|
1038
|
+
xl: "max-w-2xl",
|
|
1039
|
+
"2xl": "max-w-4xl"
|
|
1040
|
+
};
|
|
1041
|
+
function ft(...e) {
|
|
1042
|
+
return (t) => {
|
|
1043
|
+
for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
var pt = i(function({ open: e, onClose: t, title: n, description: r, children: i, footer: a, size: o = "md", closeOnOverlayClick: s = !0, showClose: l = !0, className: u, dataTestId: f }, p) {
|
|
1047
|
+
let m = d(null);
|
|
1048
|
+
return c(() => {
|
|
1049
|
+
if (!e) return;
|
|
1050
|
+
let n = (e) => {
|
|
1051
|
+
e.key === "Escape" && t();
|
|
1052
|
+
};
|
|
1053
|
+
document.addEventListener("keydown", n);
|
|
1054
|
+
let r = document.body.style.overflow;
|
|
1055
|
+
return document.body.style.overflow = "hidden", () => {
|
|
1056
|
+
document.removeEventListener("keydown", n), document.body.style.overflow = r;
|
|
1057
|
+
};
|
|
1058
|
+
}, [e, t]), c(() => {
|
|
1059
|
+
if (!e) return;
|
|
1060
|
+
let t = document.activeElement;
|
|
1061
|
+
return m.current?.focus(), () => t?.focus?.();
|
|
1062
|
+
}, [e]), e ? V(/* @__PURE__ */ B("div", {
|
|
1063
|
+
role: "dialog",
|
|
1064
|
+
"aria-modal": "true",
|
|
1065
|
+
"aria-labelledby": n ? "modal-title" : void 0,
|
|
1066
|
+
"aria-describedby": r ? "modal-desc" : void 0,
|
|
1067
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
1068
|
+
children: [/* @__PURE__ */ z("div", {
|
|
1069
|
+
className: "absolute inset-0 bg-black/50",
|
|
1070
|
+
onClick: () => s && t(),
|
|
1071
|
+
"aria-hidden": !0
|
|
1072
|
+
}), /* @__PURE__ */ B("div", {
|
|
1073
|
+
ref: ft(m, p),
|
|
1074
|
+
tabIndex: -1,
|
|
1075
|
+
"data-test-id": f,
|
|
1076
|
+
className: H("relative w-full bg-bg-default rounded-xl shadow-z5 outline-none flex flex-col max-h-[90vh]", dt[o], u),
|
|
1077
|
+
children: [
|
|
1078
|
+
(n || l) && /* @__PURE__ */ B("div", {
|
|
1079
|
+
className: "flex items-start justify-between gap-4 px-6 pt-6 pb-4",
|
|
1080
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1081
|
+
className: "flex-1 min-w-0",
|
|
1082
|
+
children: [n && /* @__PURE__ */ z("h2", {
|
|
1083
|
+
id: "modal-title",
|
|
1084
|
+
className: "text-h-xs font-semibold text-fg-default",
|
|
1085
|
+
children: n
|
|
1086
|
+
}), r && /* @__PURE__ */ z("p", {
|
|
1087
|
+
id: "modal-desc",
|
|
1088
|
+
className: "mt-1 text-p-std text-fg-secondary",
|
|
1089
|
+
children: r
|
|
1090
|
+
})]
|
|
1091
|
+
}), l && /* @__PURE__ */ z("button", {
|
|
1092
|
+
type: "button",
|
|
1093
|
+
onClick: t,
|
|
1094
|
+
"aria-label": "Close",
|
|
1095
|
+
className: "-mr-2 -mt-2 p-2 rounded-md text-fg-secondary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
1096
|
+
children: /* @__PURE__ */ z(P, { className: "h-5 w-5" })
|
|
1097
|
+
})]
|
|
1098
|
+
}),
|
|
1099
|
+
i && /* @__PURE__ */ z("div", {
|
|
1100
|
+
className: "px-6 pb-6 overflow-y-auto",
|
|
1101
|
+
children: i
|
|
1102
|
+
}),
|
|
1103
|
+
a && /* @__PURE__ */ z("div", {
|
|
1104
|
+
className: "flex items-center justify-end gap-2 px-6 py-4 border-t border-border-default bg-bg-container rounded-b-xl",
|
|
1105
|
+
children: a
|
|
1106
|
+
})
|
|
1107
|
+
]
|
|
1108
|
+
})]
|
|
1109
|
+
}), document.body) : null;
|
|
1110
|
+
}), q = {
|
|
1111
|
+
sm: {
|
|
1112
|
+
box: "px-1.5 py-1.5 gap-1",
|
|
1113
|
+
chip: "h-6 pl-0.5 pr-1.5",
|
|
1114
|
+
chipText: "text-p-xs",
|
|
1115
|
+
input: "h-6 text-p-sm min-w-[100px]",
|
|
1116
|
+
avatar: "xs"
|
|
1117
|
+
},
|
|
1118
|
+
md: {
|
|
1119
|
+
box: "px-2 py-2 gap-1.5",
|
|
1120
|
+
chip: "h-7 pl-1 pr-2",
|
|
1121
|
+
chipText: "text-p-sm",
|
|
1122
|
+
input: "h-7 text-p-std min-w-[120px]",
|
|
1123
|
+
avatar: "xs"
|
|
1124
|
+
},
|
|
1125
|
+
lg: {
|
|
1126
|
+
box: "px-2.5 py-2.5 gap-2",
|
|
1127
|
+
chip: "h-8 pl-1 pr-2.5",
|
|
1128
|
+
chipText: "text-p-std",
|
|
1129
|
+
input: "h-8 text-p-md min-w-[140px]",
|
|
1130
|
+
avatar: "sm"
|
|
1131
|
+
}
|
|
1132
|
+
}, mt = i(function({ options: e, value: t, onChange: n, size: r = "md", placeholder: i = "Select…", addMorePlaceholder: a = "Add another…", disabled: o = !1, error: s = !1, label: p, helperText: m, errorText: h, required: g = !1, lockedValues: _ = [], max: v, searchable: y = !0, suggestionsLabel: b = "Suggestions", emptyText: x = "No matches. Try a different search.", id: S, className: C, wrapperClassName: w, dataTestId: T }, E) {
|
|
1133
|
+
let ee = l(), D = S ?? ee, O = `${D}-listbox`, A = s || !!h, [j, M] = f(""), [N, F] = f(!1), [I, L] = f(0), R = d(null), V = d(null), ne = (e) => {
|
|
1134
|
+
V.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
1135
|
+
}, re = u(() => new Map(e.map((e) => [e.value, e])), [e]), U = u(() => t.map((e) => re.get(e)).filter((e) => !!e), [t, re]), W = u(() => {
|
|
1136
|
+
let n = j.trim().toLowerCase();
|
|
1137
|
+
return e.filter((e) => !t.includes(e.value) && (n === "" || e.label.toLowerCase().includes(n) || (e.description ?? "").toLowerCase().includes(n)));
|
|
1138
|
+
}, [
|
|
1139
|
+
e,
|
|
1140
|
+
t,
|
|
1141
|
+
j
|
|
1142
|
+
]), G = v !== void 0 && t.length >= v;
|
|
1143
|
+
c(() => {
|
|
1144
|
+
if (!N) return;
|
|
1145
|
+
let e = (e) => {
|
|
1146
|
+
R.current && !R.current.contains(e.target) && F(!1);
|
|
1147
|
+
};
|
|
1148
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1149
|
+
}, [N]), c(() => {
|
|
1150
|
+
L((e) => Math.min(e, Math.max(0, W.length - 1)));
|
|
1151
|
+
}, [W.length]);
|
|
1152
|
+
let ie = (e) => {
|
|
1153
|
+
let r = re.get(e);
|
|
1154
|
+
o || G || !r || r.disabled || (n([...t, e]), M(""), L(0), V.current?.focus());
|
|
1155
|
+
}, ae = (e) => {
|
|
1156
|
+
o || _.includes(e) || n(t.filter((t) => t !== e));
|
|
1157
|
+
}, oe = (e) => {
|
|
1158
|
+
if (!W.length) return;
|
|
1159
|
+
let t = I;
|
|
1160
|
+
for (let n = 0; n < W.length && (t = (t + e + W.length) % W.length, W[t]?.disabled); n++);
|
|
1161
|
+
L(t);
|
|
1162
|
+
}, se = (e) => {
|
|
1163
|
+
if (e.key === "ArrowDown") e.preventDefault(), N ? oe(1) : F(!0);
|
|
1164
|
+
else if (e.key === "ArrowUp") e.preventDefault(), oe(-1);
|
|
1165
|
+
else if (e.key === "Enter") N && W[I] && !W[I].disabled && (e.preventDefault(), ie(W[I].value));
|
|
1166
|
+
else if (e.key === "Escape") F(!1);
|
|
1167
|
+
else if (e.key === "Backspace" && j === "" && U.length > 0) {
|
|
1168
|
+
let e = [...U].reverse().find((e) => !_.includes(e.value));
|
|
1169
|
+
e && ae(e.value);
|
|
1170
|
+
}
|
|
1171
|
+
}, ce = h ? `${D}-error` : m ? `${D}-help` : void 0;
|
|
1172
|
+
return /* @__PURE__ */ B("div", {
|
|
1173
|
+
"data-test-id": T,
|
|
1174
|
+
className: H("flex flex-col gap-1.5 w-full", w),
|
|
1175
|
+
children: [
|
|
1176
|
+
p && /* @__PURE__ */ B("label", {
|
|
1177
|
+
htmlFor: D,
|
|
1178
|
+
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
1179
|
+
children: [p, g && /* @__PURE__ */ z("span", {
|
|
1180
|
+
className: "text-red-600",
|
|
1181
|
+
"aria-hidden": !0,
|
|
1182
|
+
children: "*"
|
|
1183
|
+
})]
|
|
1184
|
+
}),
|
|
1185
|
+
/* @__PURE__ */ B("div", {
|
|
1186
|
+
ref: R,
|
|
1187
|
+
className: "relative",
|
|
1188
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1189
|
+
className: H("flex flex-wrap items-center rounded-lg border bg-bg-default transition-colors", q[r].box, o ? "opacity-60 cursor-not-allowed border-border-default" : A ? "border-red-500 focus-within:ring-2 focus-within:ring-red-300 focus-within:ring-offset-1 cursor-text" : "border-border-default hover:border-border-strong focus-within:border-fg-tertiary focus-within:ring-2 focus-within:ring-brand-300 focus-within:ring-offset-1 cursor-text", C),
|
|
1190
|
+
onClick: () => !o && V.current?.focus(),
|
|
1191
|
+
children: [U.map((e) => {
|
|
1192
|
+
let t = _.includes(e.value);
|
|
1193
|
+
return /* @__PURE__ */ B("span", {
|
|
1194
|
+
className: H("inline-flex items-center gap-1.5 rounded-full text-fg-default bg-bg-subtle", q[r].chip, q[r].chipText),
|
|
1195
|
+
title: e.description,
|
|
1196
|
+
children: [
|
|
1197
|
+
e.avatarSrc && /* @__PURE__ */ z(K, {
|
|
1198
|
+
src: e.avatarSrc,
|
|
1199
|
+
name: e.label,
|
|
1200
|
+
size: q[r].avatar
|
|
1201
|
+
}),
|
|
1202
|
+
/* @__PURE__ */ z("span", {
|
|
1203
|
+
className: "font-medium",
|
|
1204
|
+
children: e.label
|
|
1205
|
+
}),
|
|
1206
|
+
e.badge && /* @__PURE__ */ z("span", {
|
|
1207
|
+
className: "text-label-xxs uppercase tracking-wider opacity-70",
|
|
1208
|
+
children: e.badge
|
|
1209
|
+
}),
|
|
1210
|
+
!t && !o && /* @__PURE__ */ z("button", {
|
|
1211
|
+
type: "button",
|
|
1212
|
+
onClick: (t) => {
|
|
1213
|
+
t.stopPropagation(), ae(e.value);
|
|
1214
|
+
},
|
|
1215
|
+
"aria-label": `Remove ${e.label}`,
|
|
1216
|
+
className: "-mr-0.5 ml-0.5 text-fg-tertiary hover:text-fg-default p-0.5 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
1217
|
+
children: /* @__PURE__ */ z(P, { className: "w-3 h-3" })
|
|
1218
|
+
})
|
|
1219
|
+
]
|
|
1220
|
+
}, e.value);
|
|
1221
|
+
}), /* @__PURE__ */ z("input", {
|
|
1222
|
+
ref: ne,
|
|
1223
|
+
id: D,
|
|
1224
|
+
type: "text",
|
|
1225
|
+
role: "combobox",
|
|
1226
|
+
"aria-expanded": N,
|
|
1227
|
+
"aria-controls": O,
|
|
1228
|
+
"aria-autocomplete": "list",
|
|
1229
|
+
"aria-activedescendant": N && W[I] ? `${O}-opt-${I}` : void 0,
|
|
1230
|
+
"aria-invalid": A || void 0,
|
|
1231
|
+
"aria-describedby": ce,
|
|
1232
|
+
value: j,
|
|
1233
|
+
readOnly: !y,
|
|
1234
|
+
disabled: o || G,
|
|
1235
|
+
onChange: (e) => {
|
|
1236
|
+
M(e.target.value), F(!0);
|
|
1237
|
+
},
|
|
1238
|
+
onFocus: () => F(!0),
|
|
1239
|
+
onKeyDown: se,
|
|
1240
|
+
placeholder: U.length === 0 ? i : G ? `Limit ${v} reached` : a,
|
|
1241
|
+
className: H("flex-1 bg-transparent outline-none text-fg-default placeholder:text-fg-tertiary disabled:cursor-not-allowed", !y && "cursor-pointer", q[r].input)
|
|
1242
|
+
})]
|
|
1243
|
+
}), N && !o && !G && /* @__PURE__ */ B("div", {
|
|
1244
|
+
className: "absolute top-full left-0 right-0 mt-1 z-20 max-h-80 overflow-y-auto rounded-lg border border-border-default bg-bg-default shadow-z4",
|
|
1245
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1246
|
+
className: "px-3 py-2 border-b border-border-subtle flex items-center gap-2 text-p-sm text-fg-tertiary",
|
|
1247
|
+
children: [/* @__PURE__ */ z(k, { className: "w-3.5 h-3.5 shrink-0" }), /* @__PURE__ */ z("span", {
|
|
1248
|
+
className: "truncate",
|
|
1249
|
+
children: j ? `Matches for "${j}"` : b
|
|
1250
|
+
})]
|
|
1251
|
+
}), W.length === 0 ? /* @__PURE__ */ B("div", {
|
|
1252
|
+
className: "px-3 py-6 text-center",
|
|
1253
|
+
children: [/* @__PURE__ */ z(te, { className: "w-5 h-5 mx-auto text-fg-tertiary mb-2" }), /* @__PURE__ */ z("span", {
|
|
1254
|
+
className: "text-p-sm text-fg-secondary",
|
|
1255
|
+
children: x
|
|
1256
|
+
})]
|
|
1257
|
+
}) : /* @__PURE__ */ z("ul", {
|
|
1258
|
+
role: "listbox",
|
|
1259
|
+
id: O,
|
|
1260
|
+
className: "py-1",
|
|
1261
|
+
children: W.map((e, t) => /* @__PURE__ */ z("li", {
|
|
1262
|
+
role: "option",
|
|
1263
|
+
id: `${O}-opt-${t}`,
|
|
1264
|
+
"aria-selected": t === I,
|
|
1265
|
+
"aria-disabled": e.disabled || void 0,
|
|
1266
|
+
children: /* @__PURE__ */ B("button", {
|
|
1267
|
+
type: "button",
|
|
1268
|
+
disabled: e.disabled,
|
|
1269
|
+
onMouseEnter: () => L(t),
|
|
1270
|
+
onMouseDown: (t) => {
|
|
1271
|
+
t.preventDefault(), ie(e.value);
|
|
1272
|
+
},
|
|
1273
|
+
className: H("w-full px-3 py-2 flex items-center gap-3 text-left transition", e.disabled ? "opacity-50 cursor-not-allowed" : t === I ? "bg-bg-subtle" : "hover:bg-bg-subtle"),
|
|
1274
|
+
children: [e.avatarSrc && /* @__PURE__ */ z(K, {
|
|
1275
|
+
src: e.avatarSrc,
|
|
1276
|
+
name: e.label,
|
|
1277
|
+
size: "sm"
|
|
1278
|
+
}), /* @__PURE__ */ B("span", {
|
|
1279
|
+
className: "flex-1 min-w-0",
|
|
1280
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1281
|
+
className: "block text-p-std font-medium text-fg-default truncate",
|
|
1282
|
+
children: e.label
|
|
1283
|
+
}), e.description && /* @__PURE__ */ z("span", {
|
|
1284
|
+
className: "block text-p-sm text-fg-secondary truncate",
|
|
1285
|
+
children: e.description
|
|
1286
|
+
})]
|
|
1287
|
+
})]
|
|
1288
|
+
})
|
|
1289
|
+
}, e.value))
|
|
1290
|
+
})]
|
|
1291
|
+
})]
|
|
1292
|
+
}),
|
|
1293
|
+
h ? /* @__PURE__ */ z("p", {
|
|
1294
|
+
id: `${D}-error`,
|
|
1295
|
+
className: "text-p-sm text-red-700",
|
|
1296
|
+
children: h
|
|
1297
|
+
}) : m ? /* @__PURE__ */ z("p", {
|
|
1298
|
+
id: `${D}-help`,
|
|
1299
|
+
className: "text-p-sm text-fg-secondary",
|
|
1300
|
+
children: m
|
|
1301
|
+
}) : null
|
|
1302
|
+
]
|
|
1303
|
+
});
|
|
1304
|
+
}), ht = {
|
|
1305
|
+
brand: "bg-brand-500 text-white",
|
|
1306
|
+
danger: "bg-red-600 text-white",
|
|
1307
|
+
success: "bg-green-600 text-white",
|
|
1308
|
+
warning: "bg-yellow-600 text-gray-900 dark:text-gray-900",
|
|
1309
|
+
info: "bg-blue-600 text-white"
|
|
1310
|
+
}, gt = {
|
|
1311
|
+
lg: "min-w-[18px] h-[18px] px-1 text-[11px]",
|
|
1312
|
+
sm: "min-w-[14px] h-[14px] px-0.5 text-[10px]"
|
|
1313
|
+
}, _t = {
|
|
1314
|
+
lg: "h-2.5 w-2.5",
|
|
1315
|
+
sm: "h-1.5 w-1.5"
|
|
1316
|
+
};
|
|
1317
|
+
function vt(e, t) {
|
|
1318
|
+
return e > t ? `${t}+` : e >= 1e3 ? `${(e / 1e3).toFixed(0)}K` : String(e);
|
|
1319
|
+
}
|
|
1320
|
+
var yt = i(function({ count: e = 0, max: t = 99, kind: n = "count", size: r = "lg", variant: i = "danger", children: a, showZero: o = !1, className: s, dataTestId: c, ...l }, u) {
|
|
1321
|
+
let d = n === "dot" || e > 0 || o, f = a != null && a !== !1, p = d ? /* @__PURE__ */ z("span", {
|
|
1322
|
+
ref: u,
|
|
1323
|
+
"data-test-id": c,
|
|
1324
|
+
className: H("inline-flex items-center justify-center rounded-full font-semibold ring-2 ring-white", ht[i], n === "count" ? gt[r] : _t[r], f ? "absolute -top-1 -right-1" : "static", s),
|
|
1325
|
+
...l,
|
|
1326
|
+
children: n === "count" && vt(e, t)
|
|
1327
|
+
}) : null;
|
|
1328
|
+
return f ? /* @__PURE__ */ B("span", {
|
|
1329
|
+
className: "relative inline-flex",
|
|
1330
|
+
children: [a, p]
|
|
1331
|
+
}) : p;
|
|
1332
|
+
});
|
|
1333
|
+
//#endregion
|
|
1334
|
+
//#region src/components/Pagination/Pagination.tsx
|
|
1335
|
+
function bt(e, t, n, r) {
|
|
1336
|
+
if (t <= n * 2 + 3 + r * 2) return Array.from({ length: t }, (e, t) => t + 1);
|
|
1337
|
+
let i = Math.max(e - n, r + 2), a = Math.min(e + n, t - r - 1), o = i > r + 2, s = a < t - r - 1, c = Array.from({ length: r }, (e, t) => t + 1), l = Array.from({ length: r }, (e, n) => t - r + 1 + n), u = [];
|
|
1338
|
+
if (o) {
|
|
1339
|
+
u.push("ellipsis-left");
|
|
1340
|
+
for (let e = i; e <= a; e++) u.push(e);
|
|
1341
|
+
} else for (let e = r + 1; e <= a; e++) u.push(e);
|
|
1342
|
+
if (s) u.push("ellipsis-right");
|
|
1343
|
+
else for (let e = a + 1; e <= t - r; e++) u.push(e);
|
|
1344
|
+
return [
|
|
1345
|
+
...c,
|
|
1346
|
+
...u,
|
|
1347
|
+
...l
|
|
1348
|
+
];
|
|
1349
|
+
}
|
|
1350
|
+
var xt = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300", St = "text-fg-default hover:bg-bg-subtle disabled:text-fg-disabled disabled:hover:bg-transparent disabled:cursor-not-allowed", Ct = i(function({ page: e, pageCount: t, onPageChange: n, siblingCount: r = 1, boundaryCount: i = 1, className: a, dataTestId: o, "aria-label": s, ...c }, l) {
|
|
1351
|
+
let u = bt(e, t, r, i), d = e <= 1, f = e >= t;
|
|
1352
|
+
return /* @__PURE__ */ B("nav", {
|
|
1353
|
+
ref: l,
|
|
1354
|
+
"aria-label": s ?? "Pagination",
|
|
1355
|
+
"data-test-id": o,
|
|
1356
|
+
className: H("inline-flex items-center gap-1", a),
|
|
1357
|
+
...c,
|
|
1358
|
+
children: [
|
|
1359
|
+
/* @__PURE__ */ z("button", {
|
|
1360
|
+
type: "button",
|
|
1361
|
+
onClick: () => !d && n(e - 1),
|
|
1362
|
+
disabled: d,
|
|
1363
|
+
"aria-label": "Previous page",
|
|
1364
|
+
className: H(xt, St),
|
|
1365
|
+
children: /* @__PURE__ */ z(x, { className: "h-4 w-4" })
|
|
1366
|
+
}),
|
|
1367
|
+
u.map((t, r) => {
|
|
1368
|
+
if (t === "ellipsis-left" || t === "ellipsis-right") return /* @__PURE__ */ z("span", {
|
|
1369
|
+
"aria-hidden": !0,
|
|
1370
|
+
className: "inline-flex items-center justify-center w-9 h-9 text-fg-tertiary",
|
|
1371
|
+
children: /* @__PURE__ */ z(O, { className: "h-4 w-4" })
|
|
1372
|
+
}, `${t}-${r}`);
|
|
1373
|
+
let i = t === e;
|
|
1374
|
+
return /* @__PURE__ */ z("button", {
|
|
1375
|
+
type: "button",
|
|
1376
|
+
onClick: () => n(t),
|
|
1377
|
+
"aria-current": i ? "page" : void 0,
|
|
1378
|
+
className: H(xt, i ? "bg-brand-500 text-white font-semibold hover:bg-brand-600" : "text-fg-default hover:bg-bg-subtle"),
|
|
1379
|
+
children: t
|
|
1380
|
+
}, t);
|
|
1381
|
+
}),
|
|
1382
|
+
/* @__PURE__ */ z("button", {
|
|
1383
|
+
type: "button",
|
|
1384
|
+
onClick: () => !f && n(e + 1),
|
|
1385
|
+
disabled: f,
|
|
1386
|
+
"aria-label": "Next page",
|
|
1387
|
+
className: H(xt, St),
|
|
1388
|
+
children: /* @__PURE__ */ z(S, { className: "h-4 w-4" })
|
|
1389
|
+
})
|
|
1390
|
+
]
|
|
1391
|
+
});
|
|
1392
|
+
}), wt = {
|
|
1393
|
+
sm: {
|
|
1394
|
+
padding: "px-3 py-2",
|
|
1395
|
+
avatar: "sm",
|
|
1396
|
+
gap: "gap-2.5"
|
|
1397
|
+
},
|
|
1398
|
+
md: {
|
|
1399
|
+
padding: "px-3.5 py-2.5",
|
|
1400
|
+
avatar: "md",
|
|
1401
|
+
gap: "gap-3"
|
|
1402
|
+
}
|
|
1403
|
+
}, Tt = {
|
|
1404
|
+
default: "border-border-default bg-bg-default hover:border-fg-tertiary/40",
|
|
1405
|
+
highlight: "border-brand-500 bg-brand-200/15 dark:bg-brand-500/10 ring-1 ring-brand-500/40",
|
|
1406
|
+
warning: "border-yellow-500 bg-yellow-50 dark:bg-yellow-900/20"
|
|
1407
|
+
}, Et = i(function({ name: e, role: t, avatar: n, variant: r = "default", size: i = "md", badge: a, onClick: o, className: s, dataTestId: c, ...l }, u) {
|
|
1408
|
+
let d = wt[i], f = Tt[r], p = /* @__PURE__ */ B(R, { children: [
|
|
1409
|
+
/* @__PURE__ */ z(K, {
|
|
1410
|
+
src: n,
|
|
1411
|
+
name: e,
|
|
1412
|
+
size: d.avatar
|
|
1413
|
+
}),
|
|
1414
|
+
/* @__PURE__ */ B("div", {
|
|
1415
|
+
className: "min-w-0 flex-1",
|
|
1416
|
+
children: [/* @__PURE__ */ z("div", {
|
|
1417
|
+
className: "text-p-std font-semibold text-fg-default truncate leading-tight",
|
|
1418
|
+
children: e
|
|
1419
|
+
}), t && /* @__PURE__ */ z("div", {
|
|
1420
|
+
className: "text-p-sm text-fg-secondary truncate mt-0.5 leading-tight",
|
|
1421
|
+
children: t
|
|
1422
|
+
})]
|
|
1423
|
+
}),
|
|
1424
|
+
a && /* @__PURE__ */ z("span", {
|
|
1425
|
+
className: "shrink-0 self-center",
|
|
1426
|
+
children: a
|
|
1427
|
+
})
|
|
1428
|
+
] }), m = H("relative inline-flex items-center rounded-xl border transition", d.padding, d.gap, f, o && "cursor-pointer hover:shadow-z1", s);
|
|
1429
|
+
return o ? /* @__PURE__ */ z("button", {
|
|
1430
|
+
ref: u,
|
|
1431
|
+
type: "button",
|
|
1432
|
+
onClick: o,
|
|
1433
|
+
"data-test-id": c,
|
|
1434
|
+
className: H(m, "text-left"),
|
|
1435
|
+
...l,
|
|
1436
|
+
children: p
|
|
1437
|
+
}) : /* @__PURE__ */ z("div", {
|
|
1438
|
+
ref: u,
|
|
1439
|
+
"data-test-id": c,
|
|
1440
|
+
className: m,
|
|
1441
|
+
...l,
|
|
1442
|
+
children: p
|
|
1443
|
+
});
|
|
1444
|
+
}), Dt = n(null), Ot = i(function({ name: e, value: t, defaultValue: n, onChange: r, disabled: i, size: a = "md", orientation: o = "vertical", children: s, className: c, dataTestId: u }, d) {
|
|
1445
|
+
let f = l(), p = e ?? f;
|
|
1446
|
+
return /* @__PURE__ */ z(Dt.Provider, {
|
|
1447
|
+
value: {
|
|
1448
|
+
name: p,
|
|
1449
|
+
value: t,
|
|
1450
|
+
defaultValue: n,
|
|
1451
|
+
onChange: r,
|
|
1452
|
+
disabled: i,
|
|
1453
|
+
size: a
|
|
1454
|
+
},
|
|
1455
|
+
children: /* @__PURE__ */ z("div", {
|
|
1456
|
+
ref: d,
|
|
1457
|
+
role: "radiogroup",
|
|
1458
|
+
"data-test-id": u,
|
|
1459
|
+
className: H("flex gap-3", o === "vertical" ? "flex-col" : "flex-row flex-wrap items-center gap-4", c),
|
|
1460
|
+
children: s
|
|
1461
|
+
})
|
|
1462
|
+
});
|
|
1463
|
+
}), kt = {
|
|
1464
|
+
md: "h-5 w-5",
|
|
1465
|
+
sm: "h-4 w-4"
|
|
1466
|
+
}, At = {
|
|
1467
|
+
md: "h-2 w-2",
|
|
1468
|
+
sm: "h-1.5 w-1.5"
|
|
1469
|
+
}, jt = i(function({ value: e, size: t, label: n, description: r, error: i = !1, id: a, disabled: o, checked: c, defaultChecked: u, onChange: d, className: f, dataTestId: p, ...m }, h) {
|
|
1470
|
+
let g = s(Dt), _ = l(), v = a ?? _, y = t ?? g?.size ?? "md", b = o ?? g?.disabled, x = g !== null, S = x && g.value !== void 0 ? g.value === e : void 0, C = x && g.defaultValue !== void 0 ? g.defaultValue === e : void 0, w = x ? S : c, T = x ? C : u;
|
|
1471
|
+
return /* @__PURE__ */ B("label", {
|
|
1472
|
+
htmlFor: v,
|
|
1473
|
+
"data-test-id": p,
|
|
1474
|
+
className: H("inline-flex items-start gap-2.5", b ? "cursor-not-allowed opacity-60" : "cursor-pointer", f),
|
|
1475
|
+
children: [/* @__PURE__ */ B("span", {
|
|
1476
|
+
className: "relative inline-flex shrink-0 items-center justify-center mt-0.5",
|
|
1477
|
+
children: [/* @__PURE__ */ z("input", {
|
|
1478
|
+
ref: h,
|
|
1479
|
+
id: v,
|
|
1480
|
+
type: "radio",
|
|
1481
|
+
name: g?.name,
|
|
1482
|
+
value: e,
|
|
1483
|
+
checked: w,
|
|
1484
|
+
defaultChecked: T,
|
|
1485
|
+
disabled: b,
|
|
1486
|
+
onChange: (t) => {
|
|
1487
|
+
g?.onChange?.(e), d?.(t);
|
|
1488
|
+
},
|
|
1489
|
+
className: "peer sr-only",
|
|
1490
|
+
"aria-invalid": i || void 0,
|
|
1491
|
+
...m
|
|
1492
|
+
}), /* @__PURE__ */ z("span", {
|
|
1493
|
+
className: H("flex items-center justify-center rounded-full border bg-bg-default transition-colors", kt[y], i ? "border-red-600" : "border-border-strong", !b && !i && "peer-hover:border-fg-tertiary", "peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-1", "peer-checked:border-brand-500", b && "!bg-bg-subtle !border-border-default", "[&>span]:opacity-0 peer-checked:[&>span]:opacity-100"),
|
|
1494
|
+
children: /* @__PURE__ */ z("span", { className: H("rounded-full bg-brand-500 transition-opacity", At[y], b && "!bg-fg-disabled") })
|
|
1495
|
+
})]
|
|
1496
|
+
}), (n || r) && /* @__PURE__ */ B("span", {
|
|
1497
|
+
className: "flex flex-col gap-0.5",
|
|
1498
|
+
children: [n && /* @__PURE__ */ z("span", {
|
|
1499
|
+
className: "text-p-std font-medium text-fg-default leading-tight",
|
|
1500
|
+
children: n
|
|
1501
|
+
}), r && /* @__PURE__ */ z("span", {
|
|
1502
|
+
className: "text-p-sm text-fg-secondary leading-snug",
|
|
1503
|
+
children: r
|
|
1504
|
+
})]
|
|
1505
|
+
})]
|
|
1506
|
+
});
|
|
1507
|
+
}), Mt = {
|
|
1508
|
+
lg: "h-12 text-p-md px-3.5",
|
|
1509
|
+
md: "h-10 text-p-std px-3",
|
|
1510
|
+
sm: "h-8 text-p-sm px-2.5"
|
|
1511
|
+
}, Nt = i(function({ options: e, value: t, defaultValue: n, onChange: r, placeholder: i = "Select…", label: a, helperText: o, errorText: s, error: u = !1, size: p = "md", disabled: m, id: h, className: g, wrapperClassName: _, dataTestId: y }, x) {
|
|
1512
|
+
let S = l(), C = h ?? S, [w, T] = f(!1), [E, ee] = f(n), D = t !== void 0, O = D ? t : E, k = d(null), [A, j] = f(-1), M = u || !!s, N = e.find((e) => e.value === O), te = (e) => {
|
|
1513
|
+
D || ee(e), r?.(e), T(!1);
|
|
1514
|
+
};
|
|
1515
|
+
return c(() => {
|
|
1516
|
+
if (!w) return;
|
|
1517
|
+
let e = (e) => {
|
|
1518
|
+
k.current?.contains(e.target) || T(!1);
|
|
1519
|
+
};
|
|
1520
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1521
|
+
}, [w]), c(() => {
|
|
1522
|
+
if (w) {
|
|
1523
|
+
let t = e.findIndex((e) => e.value === O);
|
|
1524
|
+
j(t >= 0 ? t : 0);
|
|
1525
|
+
} else j(-1);
|
|
1526
|
+
}, [
|
|
1527
|
+
w,
|
|
1528
|
+
O,
|
|
1529
|
+
e
|
|
1530
|
+
]), /* @__PURE__ */ B("div", {
|
|
1531
|
+
ref: k,
|
|
1532
|
+
"data-test-id": y,
|
|
1533
|
+
className: H("flex flex-col gap-1.5 w-full relative", _),
|
|
1534
|
+
children: [
|
|
1535
|
+
a && /* @__PURE__ */ z("label", {
|
|
1536
|
+
htmlFor: C,
|
|
1537
|
+
className: "text-p-std font-medium text-fg-default inline-flex",
|
|
1538
|
+
children: a
|
|
1539
|
+
}),
|
|
1540
|
+
/* @__PURE__ */ B("button", {
|
|
1541
|
+
ref: x,
|
|
1542
|
+
id: C,
|
|
1543
|
+
type: "button",
|
|
1544
|
+
disabled: m,
|
|
1545
|
+
onClick: () => T((e) => !e),
|
|
1546
|
+
onKeyDown: (t) => {
|
|
1547
|
+
if (!m) if (t.key === "ArrowDown" || t.key === "ArrowUp" || t.key === "Enter" || t.key === " ") {
|
|
1548
|
+
if (t.preventDefault(), !w) {
|
|
1549
|
+
T(!0);
|
|
1550
|
+
return;
|
|
1551
|
+
}
|
|
1552
|
+
if (t.key === "Enter" || t.key === " ") {
|
|
1553
|
+
let t = e[A];
|
|
1554
|
+
t && !t.disabled && te(t.value);
|
|
1555
|
+
return;
|
|
1556
|
+
}
|
|
1557
|
+
let n = t.key === "ArrowDown" ? 1 : -1, r = A;
|
|
1558
|
+
for (let t = 0; t < e.length && (r = (r + n + e.length) % e.length, e[r]?.disabled); t++);
|
|
1559
|
+
j(r);
|
|
1560
|
+
} else t.key === "Escape" && T(!1);
|
|
1561
|
+
},
|
|
1562
|
+
"aria-haspopup": "listbox",
|
|
1563
|
+
"aria-expanded": w,
|
|
1564
|
+
"aria-invalid": M || void 0,
|
|
1565
|
+
className: H("inline-flex items-center justify-between w-full rounded-lg border bg-bg-default transition-colors outline-none", "text-left", M ? "border-red-600" : "border-border-default", !m && !M && "hover:border-border-strong", "focus-visible:ring-2", M ? "focus-visible:ring-red-300 focus-visible:border-red-600" : "focus-visible:ring-brand-300 focus-visible:border-brand-500", m && "bg-bg-container border-border-default cursor-not-allowed text-fg-disabled", Mt[p], g),
|
|
1566
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1567
|
+
className: H("truncate", !N && "text-fg-tertiary"),
|
|
1568
|
+
children: N ? N.label : i
|
|
1569
|
+
}), /* @__PURE__ */ z(b, {
|
|
1570
|
+
className: H("h-4 w-4 ml-2 shrink-0 text-fg-secondary transition-transform", w && "rotate-180"),
|
|
1571
|
+
"aria-hidden": !0
|
|
1572
|
+
})]
|
|
1573
|
+
}),
|
|
1574
|
+
w && /* @__PURE__ */ z("ul", {
|
|
1575
|
+
role: "listbox",
|
|
1576
|
+
className: "absolute left-0 right-0 top-full mt-1 max-h-60 overflow-y-auto rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1",
|
|
1577
|
+
children: e.map((e, t) => {
|
|
1578
|
+
let n = e.value === O, r = t === A;
|
|
1579
|
+
return /* @__PURE__ */ B("li", {
|
|
1580
|
+
role: "option",
|
|
1581
|
+
"aria-selected": n,
|
|
1582
|
+
"aria-disabled": e.disabled || void 0,
|
|
1583
|
+
onMouseEnter: () => !e.disabled && j(t),
|
|
1584
|
+
onClick: () => !e.disabled && te(e.value),
|
|
1585
|
+
className: H("flex items-center justify-between gap-2 px-3 py-2 text-p-std cursor-pointer select-none", e.disabled && "opacity-50 cursor-not-allowed", r && !e.disabled && "bg-bg-subtle", n && "font-medium"),
|
|
1586
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1587
|
+
className: "truncate",
|
|
1588
|
+
children: e.label
|
|
1589
|
+
}), n && /* @__PURE__ */ z(v, { className: "h-4 w-4 text-brand-500 shrink-0" })]
|
|
1590
|
+
}, e.value);
|
|
1591
|
+
})
|
|
1592
|
+
}),
|
|
1593
|
+
s ? /* @__PURE__ */ z("p", {
|
|
1594
|
+
className: "text-p-sm text-red-700",
|
|
1595
|
+
children: s
|
|
1596
|
+
}) : o ? /* @__PURE__ */ z("p", {
|
|
1597
|
+
className: "text-p-sm text-fg-secondary",
|
|
1598
|
+
children: o
|
|
1599
|
+
}) : null
|
|
1600
|
+
]
|
|
1601
|
+
});
|
|
1602
|
+
}), Pt = n(null);
|
|
1603
|
+
function Ft() {
|
|
1604
|
+
return s(Pt) ?? {
|
|
1605
|
+
collapsed: !1,
|
|
1606
|
+
toggle: () => {}
|
|
1607
|
+
};
|
|
1608
|
+
}
|
|
1609
|
+
var It = i(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange: n, children: r, className: i, logo: a, title: o, subtitle: s, dataTestId: c, ...l }, u) {
|
|
1610
|
+
let [d, p] = f(e), m = t !== void 0, h = m ? t : d, g = () => {
|
|
1611
|
+
let e = !h;
|
|
1612
|
+
m || p(e), n?.(e);
|
|
1613
|
+
};
|
|
1614
|
+
return /* @__PURE__ */ z(Pt.Provider, {
|
|
1615
|
+
value: {
|
|
1616
|
+
collapsed: h,
|
|
1617
|
+
toggle: g
|
|
1618
|
+
},
|
|
1619
|
+
children: /* @__PURE__ */ B("aside", {
|
|
1620
|
+
ref: u,
|
|
1621
|
+
"data-test-id": c,
|
|
1622
|
+
className: H("flex flex-col bg-bg-default border-r border-border-default transition-all duration-200", h ? "w-16" : "w-64", i),
|
|
1623
|
+
...l,
|
|
1624
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1625
|
+
className: H("flex items-center gap-3 px-4 py-4 border-b border-border-default", h && "justify-center px-2"),
|
|
1626
|
+
children: [
|
|
1627
|
+
a && /* @__PURE__ */ z("div", {
|
|
1628
|
+
className: "shrink-0",
|
|
1629
|
+
children: a
|
|
1630
|
+
}),
|
|
1631
|
+
!h && /* @__PURE__ */ B("div", {
|
|
1632
|
+
className: "flex flex-col min-w-0",
|
|
1633
|
+
children: [o && /* @__PURE__ */ z("div", {
|
|
1634
|
+
className: "text-p-md font-semibold text-fg-default truncate",
|
|
1635
|
+
children: o
|
|
1636
|
+
}), s && /* @__PURE__ */ z("div", {
|
|
1637
|
+
className: "text-p-sm text-fg-secondary truncate",
|
|
1638
|
+
children: s
|
|
1639
|
+
})]
|
|
1640
|
+
}),
|
|
1641
|
+
/* @__PURE__ */ z("button", {
|
|
1642
|
+
type: "button",
|
|
1643
|
+
onClick: g,
|
|
1644
|
+
"aria-label": h ? "Expand sidebar" : "Collapse sidebar",
|
|
1645
|
+
className: H("ml-auto inline-flex items-center justify-center h-8 w-8 rounded-md text-fg-secondary hover:bg-bg-subtle hover:text-fg-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300", h && "ml-0"),
|
|
1646
|
+
children: /* @__PURE__ */ z(ee, { className: "h-4 w-4" })
|
|
1647
|
+
})
|
|
1648
|
+
]
|
|
1649
|
+
}), /* @__PURE__ */ z("nav", {
|
|
1650
|
+
className: "flex-1 overflow-y-auto p-2 flex flex-col gap-0.5",
|
|
1651
|
+
children: r
|
|
1652
|
+
})]
|
|
1653
|
+
})
|
|
1654
|
+
});
|
|
1655
|
+
}), Lt = i(function({ icon: e, label: t, active: n, badge: r, children: i, onClick: a, href: o, className: s, dataTestId: c, ...l }, u) {
|
|
1656
|
+
let { collapsed: d } = Ft(), [p, m] = f(n ?? !1), h = !!i, g = /* @__PURE__ */ B(R, { children: [e && /* @__PURE__ */ z("span", {
|
|
1657
|
+
className: "inline-flex shrink-0",
|
|
1658
|
+
children: e
|
|
1659
|
+
}), !d && /* @__PURE__ */ B(R, { children: [
|
|
1660
|
+
/* @__PURE__ */ z("span", {
|
|
1661
|
+
className: "flex-1 truncate text-left",
|
|
1662
|
+
children: t
|
|
1663
|
+
}),
|
|
1664
|
+
r && /* @__PURE__ */ z("span", {
|
|
1665
|
+
className: "shrink-0",
|
|
1666
|
+
children: r
|
|
1667
|
+
}),
|
|
1668
|
+
h && /* @__PURE__ */ z(S, {
|
|
1669
|
+
className: H("h-4 w-4 shrink-0 text-fg-tertiary transition-transform", p && "rotate-90"),
|
|
1670
|
+
"aria-hidden": !0
|
|
1671
|
+
})
|
|
1672
|
+
] })] }), _ = () => {
|
|
1673
|
+
h && m((e) => !e), a?.();
|
|
1674
|
+
}, v = H("group relative flex items-center gap-3 rounded-md px-3 py-2 text-p-std font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300", d && "px-2 justify-center", n ? "bg-brand-20 text-brand-800 before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:h-5 before:w-0.5 before:rounded-r before:bg-brand-500" : "text-fg-default hover:bg-bg-container", s);
|
|
1675
|
+
return /* @__PURE__ */ B(R, { children: [o ? /* @__PURE__ */ z("a", {
|
|
1676
|
+
ref: u,
|
|
1677
|
+
href: o,
|
|
1678
|
+
onClick: _,
|
|
1679
|
+
"data-test-id": c,
|
|
1680
|
+
className: v,
|
|
1681
|
+
...l,
|
|
1682
|
+
children: g
|
|
1683
|
+
}) : /* @__PURE__ */ z("button", {
|
|
1684
|
+
ref: u,
|
|
1685
|
+
type: "button",
|
|
1686
|
+
onClick: _,
|
|
1687
|
+
"data-test-id": c,
|
|
1688
|
+
className: H(v, "w-full"),
|
|
1689
|
+
...l,
|
|
1690
|
+
children: g
|
|
1691
|
+
}), h && p && !d && /* @__PURE__ */ z("div", {
|
|
1692
|
+
className: "flex flex-col gap-0.5 pl-8",
|
|
1693
|
+
children: i
|
|
1694
|
+
})] });
|
|
1695
|
+
}), Rt = {
|
|
1696
|
+
success: {
|
|
1697
|
+
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
1698
|
+
icon: y
|
|
1699
|
+
},
|
|
1700
|
+
warning: {
|
|
1701
|
+
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
1702
|
+
icon: m
|
|
1703
|
+
},
|
|
1704
|
+
danger: {
|
|
1705
|
+
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
1706
|
+
icon: F
|
|
1707
|
+
},
|
|
1708
|
+
info: {
|
|
1709
|
+
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
1710
|
+
icon: T
|
|
1711
|
+
},
|
|
1712
|
+
neutral: {
|
|
1713
|
+
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
1714
|
+
icon: T
|
|
1715
|
+
}
|
|
1716
|
+
}, zt = {
|
|
1717
|
+
success: "text-green-400",
|
|
1718
|
+
warning: "text-yellow-300",
|
|
1719
|
+
danger: "text-red-400",
|
|
1720
|
+
info: "text-blue-400",
|
|
1721
|
+
neutral: "text-white/70"
|
|
1722
|
+
}, Bt = n(null);
|
|
1723
|
+
function Vt() {
|
|
1724
|
+
let e = s(Bt);
|
|
1725
|
+
if (!e) throw Error("useSnackbar must be used inside <SnackbarProvider>");
|
|
1726
|
+
return e;
|
|
1727
|
+
}
|
|
1728
|
+
function Ht({ children: e, dataTestId: t }) {
|
|
1729
|
+
let [n, r] = f([]), i = d(/* @__PURE__ */ new Map()), a = o((e) => {
|
|
1730
|
+
r((t) => t.filter((t) => t.id !== e));
|
|
1731
|
+
let t = i.current.get(e);
|
|
1732
|
+
t && (clearTimeout(t), i.current.delete(e));
|
|
1733
|
+
}, []), s = o((e) => {
|
|
1734
|
+
let t = e.id ?? Math.random().toString(36).slice(2), n = {
|
|
1735
|
+
duration: 5e3,
|
|
1736
|
+
variant: "neutral",
|
|
1737
|
+
...e,
|
|
1738
|
+
id: t
|
|
1739
|
+
};
|
|
1740
|
+
if (r((e) => [...e, n]), n.duration && n.duration > 0) {
|
|
1741
|
+
let e = setTimeout(() => a(t), n.duration);
|
|
1742
|
+
i.current.set(t, e);
|
|
1743
|
+
}
|
|
1744
|
+
return t;
|
|
1745
|
+
}, [a]);
|
|
1746
|
+
return c(() => {
|
|
1747
|
+
let e = i.current;
|
|
1748
|
+
return () => {
|
|
1749
|
+
e.forEach(clearTimeout), e.clear();
|
|
1750
|
+
};
|
|
1751
|
+
}, []), /* @__PURE__ */ B(Bt.Provider, {
|
|
1752
|
+
value: {
|
|
1753
|
+
show: s,
|
|
1754
|
+
dismiss: a
|
|
1755
|
+
},
|
|
1756
|
+
children: [e, V(/* @__PURE__ */ z("div", {
|
|
1757
|
+
"data-test-id": t,
|
|
1758
|
+
className: "fixed left-1/2 -translate-x-1/2 bottom-6 z-[100] flex flex-col gap-2 w-[min(400px,calc(100vw-2rem))] pointer-events-none",
|
|
1759
|
+
children: n.map((e) => {
|
|
1760
|
+
let { container: t, icon: n } = Rt[e.variant ?? "neutral"];
|
|
1761
|
+
return /* @__PURE__ */ B("div", {
|
|
1762
|
+
role: "status",
|
|
1763
|
+
"data-test-id": e.dataTestId,
|
|
1764
|
+
className: H("pointer-events-auto flex items-center gap-3 px-4 py-3 rounded-lg shadow-z4", t),
|
|
1765
|
+
children: [
|
|
1766
|
+
/* @__PURE__ */ z(n, {
|
|
1767
|
+
className: H("h-5 w-5 shrink-0", zt[e.variant ?? "neutral"]),
|
|
1768
|
+
"aria-hidden": !0
|
|
1769
|
+
}),
|
|
1770
|
+
/* @__PURE__ */ z("p", {
|
|
1771
|
+
className: "flex-1 text-p-std",
|
|
1772
|
+
children: e.message
|
|
1773
|
+
}),
|
|
1774
|
+
e.action && /* @__PURE__ */ z("button", {
|
|
1775
|
+
type: "button",
|
|
1776
|
+
onClick: () => {
|
|
1777
|
+
e.action?.onClick(), a(e.id);
|
|
1778
|
+
},
|
|
1779
|
+
className: "text-p-std font-semibold text-brand-400 hover:text-brand-300 px-1",
|
|
1780
|
+
children: e.action.label
|
|
1781
|
+
}),
|
|
1782
|
+
/* @__PURE__ */ z("button", {
|
|
1783
|
+
type: "button",
|
|
1784
|
+
onClick: () => a(e.id),
|
|
1785
|
+
"aria-label": "Close",
|
|
1786
|
+
className: "shrink-0 p-1 rounded-md text-white/70 hover:text-white hover:bg-white/10",
|
|
1787
|
+
children: /* @__PURE__ */ z(P, { className: "h-4 w-4" })
|
|
1788
|
+
})
|
|
1789
|
+
]
|
|
1790
|
+
}, e.id);
|
|
1791
|
+
})
|
|
1792
|
+
}), document.body)]
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
//#endregion
|
|
1796
|
+
//#region src/components/Status/Status.tsx
|
|
1797
|
+
var Ut = {
|
|
1798
|
+
lg: "h-7 px-2.5 text-p-std gap-1.5",
|
|
1799
|
+
md: "h-6 px-2 text-p-sm gap-1.5",
|
|
1800
|
+
sm: "h-5 px-1.5 text-p-sm gap-1"
|
|
1801
|
+
}, Wt = {
|
|
1802
|
+
lg: "h-2 w-2",
|
|
1803
|
+
md: "h-1.5 w-1.5",
|
|
1804
|
+
sm: "h-1.5 w-1.5"
|
|
1805
|
+
}, Gt = {
|
|
1806
|
+
general: {
|
|
1807
|
+
container: "bg-bg-subtle text-fg-default dark:text-fg-default",
|
|
1808
|
+
dot: "bg-gray-600 dark:bg-gray-400"
|
|
1809
|
+
},
|
|
1810
|
+
info: {
|
|
1811
|
+
container: "bg-bg-info-lighter text-blue-800 dark:text-blue-300",
|
|
1812
|
+
dot: "bg-blue-600"
|
|
1813
|
+
},
|
|
1814
|
+
brand: {
|
|
1815
|
+
container: "bg-bg-brand-lighter text-brand-800 dark:text-brand-500",
|
|
1816
|
+
dot: "bg-brand-500"
|
|
1817
|
+
},
|
|
1818
|
+
danger: {
|
|
1819
|
+
container: "bg-bg-danger-lighter text-red-800 dark:text-red-300",
|
|
1820
|
+
dot: "bg-red-600"
|
|
1821
|
+
},
|
|
1822
|
+
warning: {
|
|
1823
|
+
container: "bg-bg-warning-lighter text-yellow-900 dark:text-yellow-300",
|
|
1824
|
+
dot: "bg-yellow-600"
|
|
1825
|
+
},
|
|
1826
|
+
success: {
|
|
1827
|
+
container: "bg-bg-success-lighter text-green-800 dark:text-green-300",
|
|
1828
|
+
dot: "bg-green-600"
|
|
1829
|
+
},
|
|
1830
|
+
discovery: {
|
|
1831
|
+
container: "bg-purple-50 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300",
|
|
1832
|
+
dot: "bg-purple-500"
|
|
1833
|
+
},
|
|
1834
|
+
disabled: {
|
|
1835
|
+
container: "bg-bg-subtle text-fg-disabled",
|
|
1836
|
+
dot: "bg-border-strong"
|
|
1837
|
+
}
|
|
1838
|
+
}, Kt = i(function({ variant: e = "general", size: t = "md", leftIcon: n, rightIcon: r, dot: i = !0, className: a, children: o, dataTestId: s, ...c }, l) {
|
|
1839
|
+
let { container: u, dot: d } = Gt[e];
|
|
1840
|
+
return /* @__PURE__ */ B("span", {
|
|
1841
|
+
ref: l,
|
|
1842
|
+
"data-test-id": s,
|
|
1843
|
+
className: H("inline-flex items-center rounded-full font-medium whitespace-nowrap select-none", Ut[t], u, a),
|
|
1844
|
+
...c,
|
|
1845
|
+
children: [
|
|
1846
|
+
n ? /* @__PURE__ */ z("span", {
|
|
1847
|
+
className: "inline-flex shrink-0",
|
|
1848
|
+
children: n
|
|
1849
|
+
}) : i ? /* @__PURE__ */ z("span", {
|
|
1850
|
+
className: H("inline-block shrink-0 rounded-full", Wt[t], d),
|
|
1851
|
+
"aria-hidden": !0
|
|
1852
|
+
}) : null,
|
|
1853
|
+
o,
|
|
1854
|
+
r && /* @__PURE__ */ z("span", {
|
|
1855
|
+
className: "inline-flex shrink-0",
|
|
1856
|
+
children: r
|
|
1857
|
+
})
|
|
1858
|
+
]
|
|
1859
|
+
});
|
|
1860
|
+
}), qt = {
|
|
1861
|
+
md: "h-6 w-11",
|
|
1862
|
+
sm: "h-5 w-9"
|
|
1863
|
+
}, Jt = {
|
|
1864
|
+
md: "h-5 w-5 peer-checked:translate-x-5",
|
|
1865
|
+
sm: "h-4 w-4 peer-checked:translate-x-4"
|
|
1866
|
+
}, Yt = i(function({ size: e = "md", label: t, description: n, labelPosition: r = "right", id: i, disabled: a, checked: o, defaultChecked: s, className: c, dataTestId: u, ...d }, f) {
|
|
1867
|
+
let p = l(), m = i ?? p, h = /* @__PURE__ */ B("span", {
|
|
1868
|
+
className: "relative inline-flex shrink-0",
|
|
1869
|
+
children: [
|
|
1870
|
+
/* @__PURE__ */ z("input", {
|
|
1871
|
+
ref: f,
|
|
1872
|
+
id: m,
|
|
1873
|
+
type: "checkbox",
|
|
1874
|
+
role: "switch",
|
|
1875
|
+
checked: o,
|
|
1876
|
+
defaultChecked: s,
|
|
1877
|
+
disabled: a,
|
|
1878
|
+
className: "peer sr-only",
|
|
1879
|
+
...d
|
|
1880
|
+
}),
|
|
1881
|
+
/* @__PURE__ */ z("span", { className: H("rounded-full bg-gray-300 dark:bg-gray-700 transition-colors", qt[e], "peer-checked:bg-brand-500 dark:peer-checked:bg-brand-500", "peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-2", a && "!bg-bg-subtle") }),
|
|
1882
|
+
/* @__PURE__ */ z("span", { className: H("absolute top-0.5 left-0.5 rounded-full bg-white dark:bg-white shadow-z1 transition-transform", Jt[e]) })
|
|
1883
|
+
]
|
|
1884
|
+
});
|
|
1885
|
+
return !t && !n ? /* @__PURE__ */ z("label", {
|
|
1886
|
+
htmlFor: m,
|
|
1887
|
+
"data-test-id": u,
|
|
1888
|
+
className: H("inline-flex", a ? "cursor-not-allowed opacity-60" : "cursor-pointer", c),
|
|
1889
|
+
children: h
|
|
1890
|
+
}) : /* @__PURE__ */ B("label", {
|
|
1891
|
+
htmlFor: m,
|
|
1892
|
+
"data-test-id": u,
|
|
1893
|
+
className: H("inline-flex items-start gap-3", r === "left" && "flex-row-reverse justify-end", a ? "cursor-not-allowed opacity-60" : "cursor-pointer", c),
|
|
1894
|
+
children: [h, /* @__PURE__ */ B("span", {
|
|
1895
|
+
className: "flex flex-col gap-0.5",
|
|
1896
|
+
children: [t && /* @__PURE__ */ z("span", {
|
|
1897
|
+
className: "text-p-std font-medium text-fg-default leading-tight",
|
|
1898
|
+
children: t
|
|
1899
|
+
}), n && /* @__PURE__ */ z("span", {
|
|
1900
|
+
className: "text-p-sm text-fg-secondary leading-snug",
|
|
1901
|
+
children: n
|
|
1902
|
+
})]
|
|
1903
|
+
})]
|
|
1904
|
+
});
|
|
1905
|
+
}), Xt = {
|
|
1906
|
+
comfortable: "[&_td]:py-3 [&_th]:py-3",
|
|
1907
|
+
compact: "[&_td]:py-2 [&_th]:py-2"
|
|
1908
|
+
}, Zt = {
|
|
1909
|
+
left: "text-left",
|
|
1910
|
+
center: "text-center",
|
|
1911
|
+
right: "text-right"
|
|
1912
|
+
}, Qt = i(function({ density: e = "comfortable", striped: t = !1, hoverable: n = !0, stickyHeader: r = !1, wrapperClassName: i, className: a, children: o, dataTestId: s, ...c }, l) {
|
|
1913
|
+
return /* @__PURE__ */ z("div", {
|
|
1914
|
+
"data-test-id": s,
|
|
1915
|
+
className: H("w-full overflow-x-auto rounded-lg border border-border-default bg-bg-default", i),
|
|
1916
|
+
children: /* @__PURE__ */ z("table", {
|
|
1917
|
+
ref: l,
|
|
1918
|
+
className: H("w-full border-collapse text-p-std text-fg-default", Xt[e], a),
|
|
1919
|
+
"data-striped": t || void 0,
|
|
1920
|
+
"data-hoverable": n || void 0,
|
|
1921
|
+
"data-sticky": r || void 0,
|
|
1922
|
+
...c,
|
|
1923
|
+
children: o
|
|
1924
|
+
})
|
|
1925
|
+
});
|
|
1926
|
+
}), $t = i(function({ className: e, children: t, dataTestId: n, ...r }, i) {
|
|
1927
|
+
return /* @__PURE__ */ z("thead", {
|
|
1928
|
+
ref: i,
|
|
1929
|
+
"data-test-id": n,
|
|
1930
|
+
className: H("bg-bg-container text-p-sm font-semibold text-fg-secondary uppercase tracking-wider", "[[data-sticky]_&]:sticky [[data-sticky]_&]:top-0 [[data-sticky]_&]:z-10", e),
|
|
1931
|
+
...r,
|
|
1932
|
+
children: t
|
|
1933
|
+
});
|
|
1934
|
+
}), en = i(function({ className: e, children: t, dataTestId: n, ...r }, i) {
|
|
1935
|
+
return /* @__PURE__ */ z("tbody", {
|
|
1936
|
+
ref: i,
|
|
1937
|
+
"data-test-id": n,
|
|
1938
|
+
className: H("[&>tr]:border-t [&>tr]:border-border-default", "[[data-striped]_&>tr:nth-child(even)]:bg-bg-container", "[[data-hoverable]_&>tr:hover]:bg-bg-container", e),
|
|
1939
|
+
...r,
|
|
1940
|
+
children: t
|
|
1941
|
+
});
|
|
1942
|
+
}), tn = i(function({ className: e, children: t, dataTestId: n, ...r }, i) {
|
|
1943
|
+
return /* @__PURE__ */ z("tr", {
|
|
1944
|
+
ref: i,
|
|
1945
|
+
"data-test-id": n,
|
|
1946
|
+
className: e,
|
|
1947
|
+
...r,
|
|
1948
|
+
children: t
|
|
1949
|
+
});
|
|
1950
|
+
}), nn = i(function({ sortable: e = !1, sortDir: t = null, onSortChange: n, align: r = "left", className: i, children: a, dataTestId: o, ...s }, c) {
|
|
1951
|
+
let l = /* @__PURE__ */ B(R, { children: [a, e && /* @__PURE__ */ z("span", {
|
|
1952
|
+
className: "inline-flex ml-1 align-middle text-fg-tertiary",
|
|
1953
|
+
children: z(t === "asc" ? g : t === "desc" ? h : C, { className: "h-3.5 w-3.5" })
|
|
1954
|
+
})] });
|
|
1955
|
+
return /* @__PURE__ */ z("th", {
|
|
1956
|
+
ref: c,
|
|
1957
|
+
scope: "col",
|
|
1958
|
+
"data-test-id": o,
|
|
1959
|
+
className: H("px-4 whitespace-nowrap", Zt[r], i),
|
|
1960
|
+
"aria-sort": t === "asc" ? "ascending" : t === "desc" ? "descending" : void 0,
|
|
1961
|
+
...s,
|
|
1962
|
+
children: e ? /* @__PURE__ */ z("button", {
|
|
1963
|
+
type: "button",
|
|
1964
|
+
onClick: () => {
|
|
1965
|
+
n?.(t === "asc" ? "desc" : t === "desc" ? null : "asc");
|
|
1966
|
+
},
|
|
1967
|
+
className: "inline-flex items-center hover:text-fg-default focus-visible:outline-none",
|
|
1968
|
+
children: l
|
|
1969
|
+
}) : l
|
|
1970
|
+
});
|
|
1971
|
+
}), rn = i(function({ align: e = "left", className: t, children: n, dataTestId: r, ...i }, a) {
|
|
1972
|
+
return /* @__PURE__ */ z("td", {
|
|
1973
|
+
ref: a,
|
|
1974
|
+
"data-test-id": r,
|
|
1975
|
+
className: H("px-4", Zt[e], t),
|
|
1976
|
+
...i,
|
|
1977
|
+
children: n
|
|
1978
|
+
});
|
|
1979
|
+
});
|
|
1980
|
+
function an({ columns: e, rows: t, rowKey: n, empty: r = "No results", density: i, striped: a, hoverable: o, sortKey: s, sortDir: c = null, onSortChange: l, onRowClick: u, className: d, dataTestId: f }) {
|
|
1981
|
+
return /* @__PURE__ */ B(Qt, {
|
|
1982
|
+
density: i,
|
|
1983
|
+
striped: a,
|
|
1984
|
+
hoverable: o,
|
|
1985
|
+
className: d,
|
|
1986
|
+
dataTestId: f,
|
|
1987
|
+
children: [/* @__PURE__ */ z($t, { children: /* @__PURE__ */ z(tn, { children: e.map((e) => /* @__PURE__ */ z(nn, {
|
|
1988
|
+
align: e.align,
|
|
1989
|
+
sortable: e.sortable,
|
|
1990
|
+
sortDir: s === e.key ? c : null,
|
|
1991
|
+
onSortChange: (t) => l?.(e.key, t),
|
|
1992
|
+
children: e.header
|
|
1993
|
+
}, e.key)) }) }), /* @__PURE__ */ z(en, { children: t.length === 0 ? /* @__PURE__ */ z(tn, { children: /* @__PURE__ */ z(rn, {
|
|
1994
|
+
colSpan: e.length,
|
|
1995
|
+
className: "text-center text-fg-tertiary py-10",
|
|
1996
|
+
align: "center",
|
|
1997
|
+
children: r
|
|
1998
|
+
}) }) : t.map((t, r) => /* @__PURE__ */ z(tn, {
|
|
1999
|
+
onClick: u ? () => u(t) : void 0,
|
|
2000
|
+
className: u ? "cursor-pointer" : void 0,
|
|
2001
|
+
children: e.map((e) => /* @__PURE__ */ z(rn, {
|
|
2002
|
+
align: e.align,
|
|
2003
|
+
children: e.render ? e.render(t) : e.accessor ? e.accessor(t) : null
|
|
2004
|
+
}, e.key))
|
|
2005
|
+
}, n(t, r))) })]
|
|
2006
|
+
});
|
|
2007
|
+
}
|
|
2008
|
+
//#endregion
|
|
2009
|
+
//#region src/components/Tabs/Tabs.tsx
|
|
2010
|
+
var on = n(null);
|
|
2011
|
+
function sn() {
|
|
2012
|
+
let e = s(on);
|
|
2013
|
+
if (!e) throw Error("Tab components must be used inside <Tabs>");
|
|
2014
|
+
return e;
|
|
2015
|
+
}
|
|
2016
|
+
function cn(t) {
|
|
2017
|
+
let n = [];
|
|
2018
|
+
e.forEach(t, (e) => {
|
|
2019
|
+
a(e) && n.push(e);
|
|
2020
|
+
});
|
|
2021
|
+
let r = n.find((e) => e.type?.displayName === "TabList");
|
|
2022
|
+
if (!a(r)) return "";
|
|
2023
|
+
let i = e.toArray(r.props.children);
|
|
2024
|
+
for (let e of i) if (a(e)) {
|
|
2025
|
+
let t = e.props.value;
|
|
2026
|
+
if (t !== void 0) return t;
|
|
2027
|
+
}
|
|
2028
|
+
return "";
|
|
2029
|
+
}
|
|
2030
|
+
var ln = i(function({ defaultValue: e, value: t, onValueChange: n, variant: r = "underline", size: i = "md", className: a, children: o, dataTestId: s, ...c }, l) {
|
|
2031
|
+
let [u, d] = f(() => e ?? cn(o)), p = t !== void 0, m = p ? t : u;
|
|
2032
|
+
return /* @__PURE__ */ z(on.Provider, {
|
|
2033
|
+
value: {
|
|
2034
|
+
value: m,
|
|
2035
|
+
setValue: (e) => {
|
|
2036
|
+
p || d(e), n?.(e);
|
|
2037
|
+
},
|
|
2038
|
+
variant: r,
|
|
2039
|
+
size: i
|
|
2040
|
+
},
|
|
2041
|
+
children: /* @__PURE__ */ z("div", {
|
|
2042
|
+
ref: l,
|
|
2043
|
+
"data-test-id": s,
|
|
2044
|
+
className: H("flex flex-col gap-4", a),
|
|
2045
|
+
...c,
|
|
2046
|
+
children: o
|
|
2047
|
+
})
|
|
2048
|
+
});
|
|
2049
|
+
}), un = i(function({ children: e, className: t, dataTestId: n, ...r }, i) {
|
|
2050
|
+
let { variant: a } = sn();
|
|
2051
|
+
return /* @__PURE__ */ z("div", {
|
|
2052
|
+
ref: i,
|
|
2053
|
+
role: "tablist",
|
|
2054
|
+
"data-test-id": n,
|
|
2055
|
+
className: H("inline-flex", a === "underline" && "border-b border-border-default gap-1 w-full", a === "pills" && "gap-1 p-1 rounded-full bg-bg-container", a === "boxed" && "gap-0 rounded-lg border border-border-default overflow-hidden bg-bg-container", t),
|
|
2056
|
+
...r,
|
|
2057
|
+
children: e
|
|
2058
|
+
});
|
|
2059
|
+
});
|
|
2060
|
+
un.displayName = "TabList";
|
|
2061
|
+
var dn = {
|
|
2062
|
+
lg: "h-11 px-4 text-p-md",
|
|
2063
|
+
md: "h-10 px-3 text-p-std",
|
|
2064
|
+
sm: "h-8 px-2.5 text-p-sm"
|
|
2065
|
+
}, fn = {
|
|
2066
|
+
underline: {
|
|
2067
|
+
on: "bg-brand-500 text-white",
|
|
2068
|
+
off: "bg-bg-subtle text-fg-secondary"
|
|
2069
|
+
},
|
|
2070
|
+
pills: {
|
|
2071
|
+
on: "bg-brand-500 text-white",
|
|
2072
|
+
off: "bg-bg-subtle text-fg-secondary"
|
|
2073
|
+
},
|
|
2074
|
+
boxed: {
|
|
2075
|
+
on: "bg-brand-500 text-white",
|
|
2076
|
+
off: "bg-bg-subtle text-fg-secondary"
|
|
2077
|
+
}
|
|
2078
|
+
}, pn = i(function({ value: e, children: t, disabled: n, icon: r, badge: i, className: a, dataTestId: o, onClick: s, ...c }, l) {
|
|
2079
|
+
let { value: u, setValue: d, variant: f, size: p } = sn(), m = u === e, h = i != null && i !== !1;
|
|
2080
|
+
return /* @__PURE__ */ B("button", {
|
|
2081
|
+
ref: l,
|
|
2082
|
+
type: "button",
|
|
2083
|
+
role: "tab",
|
|
2084
|
+
"aria-selected": m,
|
|
2085
|
+
disabled: n,
|
|
2086
|
+
"data-test-id": o,
|
|
2087
|
+
onClick: (t) => {
|
|
2088
|
+
n || (d(e), s?.(t));
|
|
2089
|
+
},
|
|
2090
|
+
className: H(H("group relative inline-flex items-center justify-center gap-2 font-medium outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1 focus-visible:rounded-md", dn[p], n && "opacity-50 cursor-not-allowed"), f === "underline" ? H("rounded-t-lg", m ? "text-fg-default" : "text-fg-secondary hover:text-fg-default hover:bg-bg-subtle/60") : f === "pills" ? H("rounded-full", m ? "bg-bg-default text-fg-default shadow-z1" : "bg-transparent text-fg-secondary hover:text-fg-default") : H("border-r border-border-default last:border-r-0", m ? "bg-bg-default text-fg-default" : "bg-transparent text-fg-secondary hover:bg-bg-subtle"), a),
|
|
2091
|
+
...c,
|
|
2092
|
+
children: [
|
|
2093
|
+
r && /* @__PURE__ */ z("span", {
|
|
2094
|
+
className: "inline-flex shrink-0",
|
|
2095
|
+
children: r
|
|
2096
|
+
}),
|
|
2097
|
+
/* @__PURE__ */ z("span", {
|
|
2098
|
+
className: "truncate",
|
|
2099
|
+
children: t
|
|
2100
|
+
}),
|
|
2101
|
+
h && /* @__PURE__ */ z("span", {
|
|
2102
|
+
className: H("inline-flex items-center justify-center shrink-0 rounded-full px-1.5 h-5 min-w-[1.25rem]", "text-label-xs font-semibold tabular-nums leading-none transition-colors", m ? fn[f].on : fn[f].off),
|
|
2103
|
+
children: i
|
|
2104
|
+
}),
|
|
2105
|
+
f === "underline" && /* @__PURE__ */ z("span", {
|
|
2106
|
+
"aria-hidden": !0,
|
|
2107
|
+
className: H("pointer-events-none absolute inset-x-0 -bottom-px h-[2px] rounded-full bg-brand-500 transition-opacity duration-150", m ? "opacity-100" : "opacity-0")
|
|
2108
|
+
})
|
|
2109
|
+
]
|
|
2110
|
+
});
|
|
2111
|
+
}), mn = i(function({ value: e, children: t, className: n, dataTestId: r, ...i }, a) {
|
|
2112
|
+
let { value: o } = sn();
|
|
2113
|
+
return o === e ? /* @__PURE__ */ z("div", {
|
|
2114
|
+
ref: a,
|
|
2115
|
+
role: "tabpanel",
|
|
2116
|
+
"data-test-id": r,
|
|
2117
|
+
className: n,
|
|
2118
|
+
...i,
|
|
2119
|
+
children: t
|
|
2120
|
+
}) : null;
|
|
2121
|
+
}), hn = {
|
|
2122
|
+
"h-xl": "text-h-xl",
|
|
2123
|
+
"h-lg": "text-h-lg",
|
|
2124
|
+
"h-md": "text-h-md",
|
|
2125
|
+
"h-std": "text-h-std",
|
|
2126
|
+
"h-sm": "text-h-sm",
|
|
2127
|
+
"h-xs": "text-h-xs",
|
|
2128
|
+
"p-lg": "text-p-lg",
|
|
2129
|
+
"p-md": "text-p-md",
|
|
2130
|
+
"p-std": "text-p-std",
|
|
2131
|
+
"p-sm": "text-p-sm",
|
|
2132
|
+
"p-xs": "text-p-xs",
|
|
2133
|
+
"label-lg": "text-label-lg",
|
|
2134
|
+
"label-md": "text-label-md",
|
|
2135
|
+
"label-std": "text-label-std",
|
|
2136
|
+
"label-sm": "text-label-sm",
|
|
2137
|
+
"label-xs": "text-label-xs",
|
|
2138
|
+
"label-xxs": "text-label-xxs"
|
|
2139
|
+
}, gn = {
|
|
2140
|
+
normal: "font-normal",
|
|
2141
|
+
medium: "font-medium",
|
|
2142
|
+
semibold: "font-semibold",
|
|
2143
|
+
bold: "font-bold"
|
|
2144
|
+
}, _n = {
|
|
2145
|
+
default: "text-fg-default",
|
|
2146
|
+
secondary: "text-fg-secondary",
|
|
2147
|
+
tertiary: "text-fg-tertiary",
|
|
2148
|
+
disabled: "text-fg-disabled",
|
|
2149
|
+
inverse: "text-fg-inverse",
|
|
2150
|
+
brand: "text-fg-brand",
|
|
2151
|
+
info: "text-fg-info",
|
|
2152
|
+
success: "text-fg-success",
|
|
2153
|
+
warning: "text-fg-warning",
|
|
2154
|
+
danger: "text-fg-danger"
|
|
2155
|
+
}, vn = {
|
|
2156
|
+
"h-xl": "h1",
|
|
2157
|
+
"h-lg": "h1",
|
|
2158
|
+
"h-md": "h2",
|
|
2159
|
+
"h-std": "h3",
|
|
2160
|
+
"h-sm": "h4",
|
|
2161
|
+
"h-xs": "h5",
|
|
2162
|
+
"p-lg": "p",
|
|
2163
|
+
"p-md": "p",
|
|
2164
|
+
"p-std": "p",
|
|
2165
|
+
"p-sm": "p",
|
|
2166
|
+
"p-xs": "p",
|
|
2167
|
+
"label-lg": "span",
|
|
2168
|
+
"label-md": "span",
|
|
2169
|
+
"label-std": "span",
|
|
2170
|
+
"label-sm": "span",
|
|
2171
|
+
"label-xs": "span",
|
|
2172
|
+
"label-xxs": "span"
|
|
2173
|
+
}, yn = i(function({ variant: e = "p-std", weight: t, color: n = "default", as: i, truncate: a, className: o, children: s, dataTestId: c, ...l }, u) {
|
|
2174
|
+
return r(i ?? vn[e], {
|
|
2175
|
+
ref: u,
|
|
2176
|
+
"data-test-id": c,
|
|
2177
|
+
className: H(hn[e], t && gn[t], _n[n], a && "truncate", o),
|
|
2178
|
+
...l
|
|
2179
|
+
}, s);
|
|
2180
|
+
}), bn = i(function({ label: e, helperText: t, errorText: n, error: r = !1, id: i, disabled: a, required: o, maxLength: s, showCount: c = !1, className: u, wrapperClassName: d, value: f, defaultValue: p, rows: m = 4, dataTestId: h, ...g }, _) {
|
|
2181
|
+
let v = l(), y = i ?? v, b = r || !!n, x = n ? `${y}-error` : t ? `${y}-help` : void 0, S = f === void 0 ? p === void 0 ? 0 : String(p).length : String(f).length;
|
|
2182
|
+
return /* @__PURE__ */ B("div", {
|
|
2183
|
+
className: H("flex flex-col gap-1.5 w-full", d),
|
|
2184
|
+
"data-test-id": h,
|
|
2185
|
+
children: [
|
|
2186
|
+
e && /* @__PURE__ */ B("label", {
|
|
2187
|
+
htmlFor: y,
|
|
2188
|
+
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
2189
|
+
children: [e, o && /* @__PURE__ */ z("span", {
|
|
2190
|
+
className: "text-red-600",
|
|
2191
|
+
"aria-hidden": !0,
|
|
2192
|
+
children: "*"
|
|
2193
|
+
})]
|
|
2194
|
+
}),
|
|
2195
|
+
/* @__PURE__ */ z("textarea", {
|
|
2196
|
+
ref: _,
|
|
2197
|
+
id: y,
|
|
2198
|
+
disabled: a,
|
|
2199
|
+
required: o,
|
|
2200
|
+
maxLength: s,
|
|
2201
|
+
rows: m,
|
|
2202
|
+
value: f,
|
|
2203
|
+
defaultValue: p,
|
|
2204
|
+
"aria-invalid": b || void 0,
|
|
2205
|
+
"aria-describedby": x,
|
|
2206
|
+
className: H("w-full px-3 py-2.5 rounded-lg border bg-bg-default text-p-std text-fg-default placeholder:text-fg-tertiary outline-none transition-colors resize-y", b ? "border-red-600" : "border-border-default", !a && !b && "hover:border-border-strong", "focus:ring-2", b ? "focus:ring-red-300 focus:border-red-600" : "focus:ring-brand-300 focus:border-brand-500", a && "bg-bg-container border-border-default cursor-not-allowed", u),
|
|
2207
|
+
...g
|
|
2208
|
+
}),
|
|
2209
|
+
/* @__PURE__ */ B("div", {
|
|
2210
|
+
className: "flex items-start justify-between gap-2",
|
|
2211
|
+
children: [/* @__PURE__ */ z("div", {
|
|
2212
|
+
className: "flex-1 min-w-0",
|
|
2213
|
+
children: n ? /* @__PURE__ */ z("p", {
|
|
2214
|
+
id: `${y}-error`,
|
|
2215
|
+
className: "text-p-sm text-red-700",
|
|
2216
|
+
children: n
|
|
2217
|
+
}) : t ? /* @__PURE__ */ z("p", {
|
|
2218
|
+
id: `${y}-help`,
|
|
2219
|
+
className: "text-p-sm text-fg-secondary",
|
|
2220
|
+
children: t
|
|
2221
|
+
}) : null
|
|
2222
|
+
}), c && s && /* @__PURE__ */ B("p", {
|
|
2223
|
+
className: "text-p-sm text-fg-tertiary tabular-nums shrink-0",
|
|
2224
|
+
children: [
|
|
2225
|
+
S,
|
|
2226
|
+
"/",
|
|
2227
|
+
s
|
|
2228
|
+
]
|
|
2229
|
+
})]
|
|
2230
|
+
})
|
|
2231
|
+
]
|
|
2232
|
+
});
|
|
2233
|
+
}), xn = {
|
|
2234
|
+
lg: "px-3 py-2 text-p-std",
|
|
2235
|
+
sm: "px-2 py-1 text-p-sm"
|
|
2236
|
+
}, Sn = {
|
|
2237
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
2238
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2239
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
2240
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
2241
|
+
}, Cn = {
|
|
2242
|
+
top: "top-full left-1/2 -translate-x-1/2 border-t-fg-default border-x-transparent border-b-transparent",
|
|
2243
|
+
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-fg-default border-x-transparent border-t-transparent",
|
|
2244
|
+
left: "left-full top-1/2 -translate-y-1/2 border-l-fg-default border-y-transparent border-r-transparent",
|
|
2245
|
+
right: "right-full top-1/2 -translate-y-1/2 border-r-fg-default border-y-transparent border-l-transparent"
|
|
2246
|
+
}, wn = i(function({ content: e, children: n, side: r = "top", size: i = "sm", delay: o = 150, className: s, dataTestId: c }, u) {
|
|
2247
|
+
let [p, m] = f(!1), h = d(null), g = l(), _ = () => {
|
|
2248
|
+
h.current && clearTimeout(h.current), h.current = setTimeout(() => m(!0), o);
|
|
2249
|
+
}, v = () => {
|
|
2250
|
+
h.current && clearTimeout(h.current), m(!1);
|
|
2251
|
+
};
|
|
2252
|
+
if (!a(n)) return n;
|
|
2253
|
+
let y = n.props ?? {};
|
|
2254
|
+
return /* @__PURE__ */ B("span", {
|
|
2255
|
+
ref: u,
|
|
2256
|
+
"data-test-id": c,
|
|
2257
|
+
className: "relative inline-flex",
|
|
2258
|
+
children: [t(n, {
|
|
2259
|
+
onMouseEnter: _,
|
|
2260
|
+
onMouseLeave: v,
|
|
2261
|
+
onFocus: _,
|
|
2262
|
+
onBlur: v,
|
|
2263
|
+
"aria-describedby": p ? g : y["aria-describedby"]
|
|
2264
|
+
}), p && /* @__PURE__ */ B("span", {
|
|
2265
|
+
role: "tooltip",
|
|
2266
|
+
id: g,
|
|
2267
|
+
className: H("absolute z-50 whitespace-nowrap rounded-md bg-fg-default text-bg-default shadow-z3 pointer-events-none select-none", xn[i], Sn[r], s),
|
|
2268
|
+
children: [e, /* @__PURE__ */ z("span", {
|
|
2269
|
+
"aria-hidden": !0,
|
|
2270
|
+
className: H("absolute h-0 w-0 border-4", Cn[r])
|
|
2271
|
+
})]
|
|
2272
|
+
})]
|
|
2273
|
+
});
|
|
2274
|
+
}), Tn = i(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFiles: i, disabled: a, className: o, dataTestId: s, ...c }, l) {
|
|
2275
|
+
let u = d(null), [p, m] = f(!1), h = (e) => {
|
|
2276
|
+
if (e.preventDefault(), m(!1), a) return;
|
|
2277
|
+
let t = Array.from(e.dataTransfer.files ?? []);
|
|
2278
|
+
t.length && i?.(t);
|
|
2279
|
+
}, g = r ?? `${e ? e.toUpperCase().replace(/\./g, "") : "Any file"}${n ? `, up to ${n} MB` : ""}`;
|
|
2280
|
+
return /* @__PURE__ */ B("div", {
|
|
2281
|
+
ref: l,
|
|
2282
|
+
onDragOver: (e) => {
|
|
2283
|
+
e.preventDefault(), a || m(!0);
|
|
2284
|
+
},
|
|
2285
|
+
onDragLeave: () => m(!1),
|
|
2286
|
+
onDrop: h,
|
|
2287
|
+
onClick: () => !a && u.current?.click(),
|
|
2288
|
+
role: "button",
|
|
2289
|
+
tabIndex: 0,
|
|
2290
|
+
onKeyDown: (e) => {
|
|
2291
|
+
(e.key === "Enter" || e.key === " ") && !a && (e.preventDefault(), u.current?.click());
|
|
2292
|
+
},
|
|
2293
|
+
"aria-disabled": a || void 0,
|
|
2294
|
+
"data-test-id": s,
|
|
2295
|
+
className: H("flex flex-col items-center justify-center text-center gap-2 px-6 py-8 rounded-lg border-2 border-dashed cursor-pointer transition-colors outline-none", p ? "border-brand-500 bg-brand-20" : "border-border-default bg-bg-container hover:bg-bg-subtle", "focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1", a && "opacity-50 cursor-not-allowed", o),
|
|
2296
|
+
...c,
|
|
2297
|
+
children: [
|
|
2298
|
+
/* @__PURE__ */ z("div", {
|
|
2299
|
+
className: "h-10 w-10 rounded-full bg-bg-default flex items-center justify-center text-fg-secondary shadow-z1",
|
|
2300
|
+
children: /* @__PURE__ */ z(M, { className: "h-5 w-5" })
|
|
2301
|
+
}),
|
|
2302
|
+
/* @__PURE__ */ B("div", {
|
|
2303
|
+
className: "flex flex-col gap-0.5",
|
|
2304
|
+
children: [/* @__PURE__ */ B("p", {
|
|
2305
|
+
className: "text-p-std text-fg-default",
|
|
2306
|
+
children: [/* @__PURE__ */ z("span", {
|
|
2307
|
+
className: "font-semibold text-brand-700",
|
|
2308
|
+
children: "Choose a file"
|
|
2309
|
+
}), " or drag & drop it here."]
|
|
2310
|
+
}), /* @__PURE__ */ z("p", {
|
|
2311
|
+
className: "text-p-sm text-fg-tertiary",
|
|
2312
|
+
children: g
|
|
2313
|
+
})]
|
|
2314
|
+
}),
|
|
2315
|
+
/* @__PURE__ */ z("input", {
|
|
2316
|
+
ref: u,
|
|
2317
|
+
type: "file",
|
|
2318
|
+
accept: e,
|
|
2319
|
+
multiple: t,
|
|
2320
|
+
disabled: a,
|
|
2321
|
+
onChange: (e) => {
|
|
2322
|
+
let t = Array.from(e.target.files ?? []);
|
|
2323
|
+
t.length && i?.(t), e.target.value = "";
|
|
2324
|
+
},
|
|
2325
|
+
className: "sr-only"
|
|
2326
|
+
})
|
|
2327
|
+
]
|
|
2328
|
+
});
|
|
2329
|
+
}), En = {
|
|
2330
|
+
processing: "border-border-default bg-bg-default",
|
|
2331
|
+
completed: "border-border-default bg-bg-default",
|
|
2332
|
+
error: "border-red-300 bg-bg-danger-lighter"
|
|
2333
|
+
}, Dn = i(function({ name: e, meta: t, status: n = "processing", progress: r = 0, errorText: i, onRetry: a, onRemove: o, className: s, dataTestId: c, ...l }, u) {
|
|
2334
|
+
return /* @__PURE__ */ B("div", {
|
|
2335
|
+
ref: u,
|
|
2336
|
+
"data-test-id": c,
|
|
2337
|
+
className: H("flex items-start gap-3 px-3 py-2.5 rounded-lg border", En[n], s),
|
|
2338
|
+
...l,
|
|
2339
|
+
children: [
|
|
2340
|
+
/* @__PURE__ */ z("div", {
|
|
2341
|
+
className: H("shrink-0 flex items-center justify-center h-9 w-9 rounded-md", n === "error" ? "bg-red-100 dark:bg-red-900/30 text-red-700" : "bg-bg-subtle text-fg-secondary"),
|
|
2342
|
+
children: /* @__PURE__ */ z(w, { className: "h-4 w-4" })
|
|
2343
|
+
}),
|
|
2344
|
+
/* @__PURE__ */ B("div", {
|
|
2345
|
+
className: "flex-1 min-w-0",
|
|
2346
|
+
children: [
|
|
2347
|
+
/* @__PURE__ */ B("div", {
|
|
2348
|
+
className: "flex items-baseline justify-between gap-2",
|
|
2349
|
+
children: [/* @__PURE__ */ z("p", {
|
|
2350
|
+
className: "truncate text-p-std font-medium text-fg-default",
|
|
2351
|
+
children: e
|
|
2352
|
+
}), /* @__PURE__ */ B("div", {
|
|
2353
|
+
className: "flex items-center gap-1 shrink-0",
|
|
2354
|
+
children: [n === "completed" && /* @__PURE__ */ z(y, {
|
|
2355
|
+
className: "h-4 w-4 text-green-600",
|
|
2356
|
+
"aria-label": "Completed"
|
|
2357
|
+
}), n === "error" && /* @__PURE__ */ z(p, {
|
|
2358
|
+
className: "h-4 w-4 text-red-600",
|
|
2359
|
+
"aria-label": "Failed"
|
|
2360
|
+
})]
|
|
2361
|
+
})]
|
|
2362
|
+
}),
|
|
2363
|
+
t && /* @__PURE__ */ z("p", {
|
|
2364
|
+
className: "text-p-sm text-fg-tertiary mt-0.5",
|
|
2365
|
+
children: t
|
|
2366
|
+
}),
|
|
2367
|
+
n === "processing" && /* @__PURE__ */ z("div", {
|
|
2368
|
+
className: "mt-2 h-1 w-full rounded-full bg-bg-subtle overflow-hidden",
|
|
2369
|
+
children: /* @__PURE__ */ z("div", {
|
|
2370
|
+
className: "h-full bg-brand-500 transition-[width] duration-200",
|
|
2371
|
+
style: { width: `${Math.min(100, Math.max(0, r))}%` }
|
|
2372
|
+
})
|
|
2373
|
+
}),
|
|
2374
|
+
n === "error" && i && /* @__PURE__ */ B("p", {
|
|
2375
|
+
className: "text-p-sm text-red-700 mt-1",
|
|
2376
|
+
children: [i, a && /* @__PURE__ */ z("button", {
|
|
2377
|
+
type: "button",
|
|
2378
|
+
onClick: a,
|
|
2379
|
+
className: "ml-2 underline font-medium hover:no-underline",
|
|
2380
|
+
children: "Try again"
|
|
2381
|
+
})]
|
|
2382
|
+
})
|
|
2383
|
+
]
|
|
2384
|
+
}),
|
|
2385
|
+
o && /* @__PURE__ */ z("button", {
|
|
2386
|
+
type: "button",
|
|
2387
|
+
onClick: o,
|
|
2388
|
+
"aria-label": "Remove",
|
|
2389
|
+
className: "shrink-0 p-1 rounded-md text-fg-tertiary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
2390
|
+
children: z(n === "completed" ? j : P, { className: "h-4 w-4" })
|
|
2391
|
+
})
|
|
2392
|
+
]
|
|
2393
|
+
});
|
|
2394
|
+
}), J = {
|
|
2395
|
+
900: "#31531C",
|
|
2396
|
+
800: "#416E26",
|
|
2397
|
+
700: "#518A2F",
|
|
2398
|
+
600: "#61A539",
|
|
2399
|
+
500: "#72BF44",
|
|
2400
|
+
400: "#80C557",
|
|
2401
|
+
300: "#8ECC69",
|
|
2402
|
+
200: "#9CD27C",
|
|
2403
|
+
100: "#AAD98F",
|
|
2404
|
+
50: "#B8DFA2",
|
|
2405
|
+
40: "#CAE7B9",
|
|
2406
|
+
30: "#DBEFD1",
|
|
2407
|
+
20: "#EDF7E8"
|
|
2408
|
+
}, Y = {
|
|
2409
|
+
900: "#0e121b",
|
|
2410
|
+
800: "#222530",
|
|
2411
|
+
700: "#2b303b",
|
|
2412
|
+
600: "#525866",
|
|
2413
|
+
500: "#717784",
|
|
2414
|
+
400: "#99a0ae",
|
|
2415
|
+
300: "#cacfd8",
|
|
2416
|
+
200: "#e1e4ea",
|
|
2417
|
+
100: "#f2f5f8",
|
|
2418
|
+
50: "#f5f7fa",
|
|
2419
|
+
20: "#f7f9fc"
|
|
2420
|
+
}, X = "#FEFEFE", On = {
|
|
2421
|
+
900: "#0b4627",
|
|
2422
|
+
800: "#0f5c33",
|
|
2423
|
+
700: "#3D8B46",
|
|
2424
|
+
600: "#199754",
|
|
2425
|
+
500: "#1fc16b",
|
|
2426
|
+
400: "#5ed495",
|
|
2427
|
+
300: "#83dfae",
|
|
2428
|
+
200: "#aeeacb",
|
|
2429
|
+
100: "#d0f5e1",
|
|
2430
|
+
50: "#e0faec"
|
|
2431
|
+
}, Z = {
|
|
2432
|
+
900: "#2443B8",
|
|
2433
|
+
800: "#2E63D6",
|
|
2434
|
+
700: "#3475E8",
|
|
2435
|
+
600: "#3C88F7",
|
|
2436
|
+
500: "#4396F7",
|
|
2437
|
+
400: "#54A6F8",
|
|
2438
|
+
300: "#71B6F9",
|
|
2439
|
+
200: "#9ACAFA",
|
|
2440
|
+
100: "#C1DEFC",
|
|
2441
|
+
50: "#E6F2FE"
|
|
2442
|
+
}, kn = {
|
|
2443
|
+
900: "#081FA6",
|
|
2444
|
+
800: "#0E2AB2",
|
|
2445
|
+
700: "#2431B9",
|
|
2446
|
+
600: "#3838C1",
|
|
2447
|
+
500: "#453DC7",
|
|
2448
|
+
400: "#6559D0",
|
|
2449
|
+
300: "#8377D7",
|
|
2450
|
+
200: "#A89DE2",
|
|
2451
|
+
100: "#CBC4ED",
|
|
2452
|
+
50: "#EAE7F7",
|
|
2453
|
+
20: "#F5F3FB"
|
|
2454
|
+
}, An = {
|
|
2455
|
+
900: "#4A0A20",
|
|
2456
|
+
800: "#79012F",
|
|
2457
|
+
700: "#A2023F",
|
|
2458
|
+
600: "#AD0244",
|
|
2459
|
+
500: "#CA024F",
|
|
2460
|
+
400: "#F50260",
|
|
2461
|
+
300: "#FD2779",
|
|
2462
|
+
200: "#FE7DAF",
|
|
2463
|
+
100: "#FEA8C9",
|
|
2464
|
+
50: "#FFD4E4"
|
|
2465
|
+
}, Q = {
|
|
2466
|
+
900: "#8b1822",
|
|
2467
|
+
800: "#ad1f2b",
|
|
2468
|
+
700: "#d02533",
|
|
2469
|
+
600: "#e93544",
|
|
2470
|
+
500: "#fb3748",
|
|
2471
|
+
400: "#ff6875",
|
|
2472
|
+
300: "#ff97a0",
|
|
2473
|
+
200: "#ffc0c5",
|
|
2474
|
+
100: "#ffd5d8",
|
|
2475
|
+
50: "#ffebec",
|
|
2476
|
+
20: "#fff4f4"
|
|
2477
|
+
}, $ = {
|
|
2478
|
+
900: "#EB7520",
|
|
2479
|
+
800: "#ED912A",
|
|
2480
|
+
700: "#EEA02F",
|
|
2481
|
+
600: "#F0B134",
|
|
2482
|
+
500: "#F1BE39",
|
|
2483
|
+
400: "#F2C74A",
|
|
2484
|
+
300: "#F4D264",
|
|
2485
|
+
200: "#F7DE8E",
|
|
2486
|
+
100: "#FAEBB9",
|
|
2487
|
+
50: "#FDF7E4"
|
|
2488
|
+
}, jn = {
|
|
2489
|
+
brand: J,
|
|
2490
|
+
gray: Y,
|
|
2491
|
+
green: On,
|
|
2492
|
+
blue: Z,
|
|
2493
|
+
purple: kn,
|
|
2494
|
+
pink: An,
|
|
2495
|
+
red: Q,
|
|
2496
|
+
yellow: $
|
|
2497
|
+
}, Mn = {
|
|
2498
|
+
bgDefault: X,
|
|
2499
|
+
bgContainer: Y[50],
|
|
2500
|
+
bgSubtle: Y[100],
|
|
2501
|
+
bgBrandLighter: J[20],
|
|
2502
|
+
bgInfoLighter: Z[50],
|
|
2503
|
+
bgSuccessLighter: On[50],
|
|
2504
|
+
bgWarningLighter: $[50],
|
|
2505
|
+
bgDangerLighter: Q[50],
|
|
2506
|
+
fgDefault: Y[900],
|
|
2507
|
+
fgSecondary: Y[600],
|
|
2508
|
+
fgTertiary: Y[500],
|
|
2509
|
+
fgDisabled: Y[400],
|
|
2510
|
+
fgInverse: X,
|
|
2511
|
+
fgBrand: J[500],
|
|
2512
|
+
fgInfo: Z[600],
|
|
2513
|
+
fgSuccess: On[600],
|
|
2514
|
+
fgWarning: $[800],
|
|
2515
|
+
fgDanger: Q[800],
|
|
2516
|
+
borderDefault: Y[200],
|
|
2517
|
+
borderSubtle: Y[100],
|
|
2518
|
+
borderStrong: Y[300],
|
|
2519
|
+
borderBrand: J[500],
|
|
2520
|
+
iconPrimary: Y[900],
|
|
2521
|
+
iconSecondary: Y[600],
|
|
2522
|
+
iconInverse: X,
|
|
2523
|
+
iconBrand: J[500],
|
|
2524
|
+
iconInfo: Z[600],
|
|
2525
|
+
iconDanger: Q[800],
|
|
2526
|
+
iconWarning: $[800]
|
|
2527
|
+
}, Nn = {
|
|
2528
|
+
...Mn,
|
|
2529
|
+
bgDefault: "#0B1120",
|
|
2530
|
+
bgContainer: "#0F172A",
|
|
2531
|
+
bgSubtle: "#121C30",
|
|
2532
|
+
bgBrandLighter: "rgba(114, 191, 68, 0.15)",
|
|
2533
|
+
bgInfoLighter: "rgba(67, 150, 247, 0.15)",
|
|
2534
|
+
bgSuccessLighter: "rgba(31, 193, 107, 0.15)",
|
|
2535
|
+
bgWarningLighter: "rgba(237, 145, 42, 0.15)",
|
|
2536
|
+
bgDangerLighter: "rgba(230, 27, 0, 0.15)",
|
|
2537
|
+
fgDefault: X,
|
|
2538
|
+
fgSecondary: Y[400],
|
|
2539
|
+
fgTertiary: Y[500],
|
|
2540
|
+
fgDisabled: Y[600],
|
|
2541
|
+
borderDefault: "rgba(255, 255, 255, 0.05)",
|
|
2542
|
+
borderSubtle: "rgba(255, 255, 255, 0.03)",
|
|
2543
|
+
borderStrong: "rgba(255, 255, 255, 0.10)",
|
|
2544
|
+
iconPrimary: X,
|
|
2545
|
+
iconSecondary: Y[400]
|
|
2546
|
+
}, Pn = {
|
|
2547
|
+
ps: [
|
|
2548
|
+
"Noto Sans Armenian",
|
|
2549
|
+
"Noto Sans",
|
|
2550
|
+
"ui-sans-serif",
|
|
2551
|
+
"system-ui",
|
|
2552
|
+
"sans-serif"
|
|
2553
|
+
],
|
|
2554
|
+
sans: [
|
|
2555
|
+
"Noto Sans Armenian",
|
|
2556
|
+
"Noto Sans",
|
|
2557
|
+
"ui-sans-serif",
|
|
2558
|
+
"system-ui",
|
|
2559
|
+
"sans-serif"
|
|
2560
|
+
]
|
|
2561
|
+
}, Fn = {
|
|
2562
|
+
xl: {
|
|
2563
|
+
fontSize: "64px",
|
|
2564
|
+
lineHeight: "72px"
|
|
2565
|
+
},
|
|
2566
|
+
lg: {
|
|
2567
|
+
fontSize: "48px",
|
|
2568
|
+
lineHeight: "56px"
|
|
2569
|
+
},
|
|
2570
|
+
md: {
|
|
2571
|
+
fontSize: "40px",
|
|
2572
|
+
lineHeight: "48px"
|
|
2573
|
+
},
|
|
2574
|
+
std: {
|
|
2575
|
+
fontSize: "36px",
|
|
2576
|
+
lineHeight: "44px"
|
|
2577
|
+
},
|
|
2578
|
+
sm: {
|
|
2579
|
+
fontSize: "32px",
|
|
2580
|
+
lineHeight: "40px"
|
|
2581
|
+
},
|
|
2582
|
+
xs: {
|
|
2583
|
+
fontSize: "24px",
|
|
2584
|
+
lineHeight: "32px"
|
|
2585
|
+
}
|
|
2586
|
+
}, In = {
|
|
2587
|
+
lg: {
|
|
2588
|
+
fontSize: "20px",
|
|
2589
|
+
lineHeight: "28px"
|
|
2590
|
+
},
|
|
2591
|
+
md: {
|
|
2592
|
+
fontSize: "16px",
|
|
2593
|
+
lineHeight: "24px"
|
|
2594
|
+
},
|
|
2595
|
+
std: {
|
|
2596
|
+
fontSize: "14px",
|
|
2597
|
+
lineHeight: "20px"
|
|
2598
|
+
},
|
|
2599
|
+
sm: {
|
|
2600
|
+
fontSize: "12px",
|
|
2601
|
+
lineHeight: "16px"
|
|
2602
|
+
},
|
|
2603
|
+
xs: {
|
|
2604
|
+
fontSize: "10px",
|
|
2605
|
+
lineHeight: "14px"
|
|
2606
|
+
}
|
|
2607
|
+
}, Ln = {
|
|
2608
|
+
lg: {
|
|
2609
|
+
fontSize: "20px",
|
|
2610
|
+
lineHeight: "28px"
|
|
2611
|
+
},
|
|
2612
|
+
md: {
|
|
2613
|
+
fontSize: "16px",
|
|
2614
|
+
lineHeight: "24px"
|
|
2615
|
+
},
|
|
2616
|
+
std: {
|
|
2617
|
+
fontSize: "14px",
|
|
2618
|
+
lineHeight: "20px"
|
|
2619
|
+
},
|
|
2620
|
+
sm: {
|
|
2621
|
+
fontSize: "12px",
|
|
2622
|
+
lineHeight: "16px"
|
|
2623
|
+
},
|
|
2624
|
+
xs: {
|
|
2625
|
+
fontSize: "10px",
|
|
2626
|
+
lineHeight: "14px"
|
|
2627
|
+
},
|
|
2628
|
+
xxs: {
|
|
2629
|
+
fontSize: "6px",
|
|
2630
|
+
lineHeight: "6px"
|
|
2631
|
+
}
|
|
2632
|
+
}, Rn = {
|
|
2633
|
+
headline: Fn,
|
|
2634
|
+
paragraph: In,
|
|
2635
|
+
label: Ln
|
|
2636
|
+
}, zn = {
|
|
2637
|
+
sm: "2rem",
|
|
2638
|
+
md: "2.5rem",
|
|
2639
|
+
lg: "3rem"
|
|
2640
|
+
}, Bn = {
|
|
2641
|
+
sm: "0.875rem",
|
|
2642
|
+
md: "1rem",
|
|
2643
|
+
lg: "1.25rem"
|
|
2644
|
+
}, Vn = {
|
|
2645
|
+
xs: "2px",
|
|
2646
|
+
sm: "4px",
|
|
2647
|
+
md: "8px",
|
|
2648
|
+
lg: "12px",
|
|
2649
|
+
xl: "16px",
|
|
2650
|
+
"2xl": "20px",
|
|
2651
|
+
"3xl": "24px",
|
|
2652
|
+
full: "9999px"
|
|
2653
|
+
}, Hn = {
|
|
2654
|
+
z1: "0 1px 2px 0 rgba(0, 0, 0, 0.06)",
|
|
2655
|
+
z2: "0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04)",
|
|
2656
|
+
z3: "0 4px 8px 0 rgba(0, 0, 0, 0.08), 0 2px 4px 0 rgba(0, 0, 0, 0.04)",
|
|
2657
|
+
z4: "0 1px 4px 0 rgba(0, 0, 0, 0.12), 0 12px 16px 0 rgba(0, 0, 0, 0.10), 0 3px 5px 0 rgba(0, 0, 0, 0.12)",
|
|
2658
|
+
z5: "0 8px 16px 0 rgba(0, 0, 0, 0.12), 0 24px 32px 0 rgba(0, 0, 0, 0.12)"
|
|
2659
|
+
};
|
|
2660
|
+
//#endregion
|
|
2661
|
+
export { W as Accordion, G as AccordionItem, K as Avatar, ue as AvatarGroup, he as Badge, be as Button, Se as ButtonGroup, Te as Card, Oe as Checkbox, an as DataTable, Ie as DatePicker, Ve as Drawer, qe as DropdownContent, Je as DropdownItem, Xe as DropdownLabel, Ge as DropdownMenu, Ye as DropdownSeparator, Ke as DropdownTrigger, $e as Filter, nt as IconTile, rt as InfoField, at as InlineAlert, ut as Input, pt as Modal, mt as MultiSelect, yt as NotificationBadge, Ct as Pagination, Et as PersonCard, jt as Radio, Ot as RadioGroup, Nt as Select, It as Sidebar, Lt as SidebarItem, Ht as SnackbarProvider, Kt as Status, Yt as Switch, en as TBody, rn as TD, nn as TH, $t as THead, tn as TR, pn as Tab, un as TabList, mn as TabPanel, Qt as Table, ln as Tabs, yn as Text, bn as TextArea, wn as Tooltip, Tn as Upload, Dn as UploadItem, Z as blue, J as brand, H as cn, jn as colorPrimitives, zn as controlHeight, Nn as darkTheme, Pn as fontFamily, Y as gray, On as green, Fn as headline, Bn as iconSize, Ln as label, Mn as lightTheme, In as paragraph, An as pink, kn as purple, Vn as radius, Q as red, Hn as shadows, Rn as typography, Vt as useSnackbar, X as white, $ as yellow };
|
|
2662
|
+
|
|
2663
|
+
//# sourceMappingURL=index.js.map
|