@goliapkg/gds 0.9.4 → 0.9.6
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/dist/avatar-By0U5Vts.js +74 -0
- package/dist/avatar-By0U5Vts.js.map +1 -0
- package/dist/badge-DTJq6AXr.js +59 -0
- package/dist/badge-DTJq6AXr.js.map +1 -0
- package/dist/button-avu-rQU4.js +99 -0
- package/dist/button-avu-rQU4.js.map +1 -0
- package/dist/dom-17XgfxMq.js +20 -0
- package/dist/dom-17XgfxMq.js.map +1 -0
- package/dist/gesture-BCGijGek.js +104 -0
- package/dist/gesture-BCGijGek.js.map +1 -0
- package/dist/gesture-system-v-bjvnCe.js +56 -0
- package/dist/gesture-system-v-bjvnCe.js.map +1 -0
- package/dist/glass-CQTlX7IO.js +1702 -0
- package/dist/glass-CQTlX7IO.js.map +1 -0
- package/dist/highlight-BAGZc-4h.js +28 -0
- package/dist/highlight-BAGZc-4h.js.map +1 -0
- package/dist/hooks-BE-_EmDI.js +87 -0
- package/dist/hooks-BE-_EmDI.js.map +1 -0
- package/dist/icon-button-YatlVZnz.js +44 -0
- package/dist/icon-button-YatlVZnz.js.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -18495
- package/dist/l0-tokens/deps.d.ts +5 -0
- package/dist/l0-tokens/deps.d.ts.map +1 -1
- package/dist/l0-tokens/index.js +4 -0
- package/dist/l0-tokens-DZkyVlac.js +296 -0
- package/dist/l0-tokens-DZkyVlac.js.map +1 -0
- package/dist/l1-systems/index.js +2 -0
- package/dist/l2-primitives/index.js +11 -0
- package/dist/l2-primitives/screen-overlay.d.ts.map +1 -1
- package/dist/l2-primitives/truncate.d.ts +2 -1
- package/dist/l2-primitives/truncate.d.ts.map +1 -1
- package/dist/l2-primitives-CqrezrJ4.js +482 -0
- package/dist/l2-primitives-CqrezrJ4.js.map +1 -0
- package/dist/l3-atoms/index.js +6 -0
- package/dist/l3-atoms/keyboard-shortcut.d.ts +1 -1
- package/dist/l3-atoms/keyboard-shortcut.d.ts.map +1 -1
- package/dist/l3-atoms/sparkle.d.ts +1 -1
- package/dist/l3-atoms/sparkle.d.ts.map +1 -1
- package/dist/l3-atoms-CsN9IA9J.js +1794 -0
- package/dist/l3-atoms-CsN9IA9J.js.map +1 -0
- package/dist/l4-molecules/dialog.d.ts.map +1 -1
- package/dist/l4-molecules/index.js +4 -0
- package/dist/l4-molecules-DCc074MJ.js +4048 -0
- package/dist/l4-molecules-DCc074MJ.js.map +1 -0
- package/dist/l5-organisms/command-palette.d.ts.map +1 -1
- package/dist/l5-organisms/confetti.d.ts.map +1 -1
- package/dist/l5-organisms/cookie-banner.d.ts.map +1 -1
- package/dist/l5-organisms/image-preview.d.ts.map +1 -1
- package/dist/l5-organisms/index.js +2 -0
- package/dist/l5-organisms/notification-toast.d.ts.map +1 -1
- package/dist/l5-organisms-8KB_8a-H.js +3798 -0
- package/dist/l5-organisms-8KB_8a-H.js.map +1 -0
- package/dist/l6-charts/candlestick-chart.d.ts.map +1 -1
- package/dist/l6-charts/index.js +2 -0
- package/dist/l6-charts-DYnr5B9X.js +1743 -0
- package/dist/l6-charts-DYnr5B9X.js.map +1 -0
- package/dist/l7-patterns/index.js +2 -0
- package/dist/l7-patterns-DZXveS4Y.js +1826 -0
- package/dist/l7-patterns-DZXveS4Y.js.map +1 -0
- package/dist/loading-dots-fB4X_Zh0.js +24 -0
- package/dist/loading-dots-fB4X_Zh0.js.map +1 -0
- package/dist/motion-DUPegem-.js +22 -0
- package/dist/motion-DUPegem-.js.map +1 -0
- package/dist/portal-Bbl6F_Wj.js +9 -0
- package/dist/portal-Bbl6F_Wj.js.map +1 -0
- package/dist/progress-wAKN3Czz.js +44 -0
- package/dist/progress-wAKN3Czz.js.map +1 -0
- package/dist/resize-handle-CktEYqwi.js +77 -0
- package/dist/resize-handle-CktEYqwi.js.map +1 -0
- package/dist/scales-C80FTPsL.js +1299 -0
- package/dist/scales-C80FTPsL.js.map +1 -0
- package/dist/separator-Dqs23A9D.js +65 -0
- package/dist/separator-Dqs23A9D.js.map +1 -0
- package/dist/skeleton-C9FFZSYN.js +43 -0
- package/dist/skeleton-C9FFZSYN.js.map +1 -0
- package/dist/spinner-D8Ti-TFe.js +101 -0
- package/dist/spinner-D8Ti-TFe.js.map +1 -0
- package/dist/stepper-DhpGORX8.js +140 -0
- package/dist/stepper-DhpGORX8.js.map +1 -0
- package/dist/switch-DC85Os9r.js +130 -0
- package/dist/switch-DC85Os9r.js.map +1 -0
- package/dist/textarea-BJCl_aH2.js +40 -0
- package/dist/textarea-BJCl_aH2.js.map +1 -0
- package/dist/toast-DN5xANLM.js +442 -0
- package/dist/toast-DN5xANLM.js.map +1 -0
- package/dist/use-theme-C0aWVw70.js +203 -0
- package/dist/use-theme-C0aWVw70.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +7 -0
- package/dist/utils/portal.d.ts +3 -0
- package/dist/utils/portal.d.ts.map +1 -0
- package/package.json +37 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,4048 @@
|
|
|
1
|
+
import { r as e, t } from "./glass-CQTlX7IO.js";
|
|
2
|
+
import { r as n, t as r } from "./button-avu-rQU4.js";
|
|
3
|
+
import { r as i } from "./motion-DUPegem-.js";
|
|
4
|
+
import { t as a } from "./icon-button-YatlVZnz.js";
|
|
5
|
+
import { i as o, r as s, t as c } from "./spinner-D8Ti-TFe.js";
|
|
6
|
+
import { t as l } from "./progress-wAKN3Czz.js";
|
|
7
|
+
import { t as u } from "./portal-Bbl6F_Wj.js";
|
|
8
|
+
import { t as d } from "./avatar-By0U5Vts.js";
|
|
9
|
+
import { i as f, r as p, t as m } from "./switch-DC85Os9r.js";
|
|
10
|
+
import { n as h, r as g } from "./dom-17XgfxMq.js";
|
|
11
|
+
import { n as _, r as v, s as y, t as b } from "./hooks-BE-_EmDI.js";
|
|
12
|
+
import { forwardRef as x, useCallback as S, useEffect as C, useMemo as w, useRef as T, useState as E } from "react";
|
|
13
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
14
|
+
//#region src/l4-molecules/action-card.tsx
|
|
15
|
+
var A = x(function({ className: t, description: n, icon: r, onClick: i, title: a, ...o }, s) {
|
|
16
|
+
return /* @__PURE__ */ k("div", {
|
|
17
|
+
className: e("flex cursor-pointer items-center gds-gap gds-pad gds-radius", "border border-border bg-surface transition-colors hover:bg-surface-hover", t),
|
|
18
|
+
"data-component": "action-card",
|
|
19
|
+
onClick: i,
|
|
20
|
+
onKeyDown: (e) => {
|
|
21
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i());
|
|
22
|
+
},
|
|
23
|
+
ref: s,
|
|
24
|
+
role: "button",
|
|
25
|
+
tabIndex: 0,
|
|
26
|
+
...o,
|
|
27
|
+
children: [r !== void 0 && /* @__PURE__ */ O("span", {
|
|
28
|
+
className: "shrink-0 text-accent",
|
|
29
|
+
children: r
|
|
30
|
+
}), /* @__PURE__ */ k("div", {
|
|
31
|
+
className: "flex flex-col gap-0.5",
|
|
32
|
+
children: [/* @__PURE__ */ O("span", {
|
|
33
|
+
className: "text-sm font-medium text-fg",
|
|
34
|
+
children: a
|
|
35
|
+
}), n !== void 0 && /* @__PURE__ */ O("span", {
|
|
36
|
+
className: "text-xs text-fg-muted",
|
|
37
|
+
children: n
|
|
38
|
+
})]
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}), j = /* @__PURE__ */ k("svg", {
|
|
42
|
+
className: "h-4 w-4",
|
|
43
|
+
fill: "currentColor",
|
|
44
|
+
viewBox: "0 0 16 16",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ O("circle", {
|
|
47
|
+
cx: "8",
|
|
48
|
+
cy: "3",
|
|
49
|
+
r: "1.5"
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ O("circle", {
|
|
52
|
+
cx: "8",
|
|
53
|
+
cy: "8",
|
|
54
|
+
r: "1.5"
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ O("circle", {
|
|
57
|
+
cx: "8",
|
|
58
|
+
cy: "13",
|
|
59
|
+
r: "1.5"
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
}), M = x(function({ className: t, disabled: n, items: r, onSelect: i }, o) {
|
|
63
|
+
let [s, c] = E(!1), l = T(null);
|
|
64
|
+
return b(l, s, () => c(!1)), _(s, () => c(!1)), /* @__PURE__ */ O("div", {
|
|
65
|
+
className: e("relative inline-block", t),
|
|
66
|
+
"data-component": "action-menu",
|
|
67
|
+
ref: o,
|
|
68
|
+
children: /* @__PURE__ */ k("div", {
|
|
69
|
+
ref: l,
|
|
70
|
+
children: [/* @__PURE__ */ O(a, {
|
|
71
|
+
disabled: n,
|
|
72
|
+
icon: j,
|
|
73
|
+
onClick: () => c((e) => !e),
|
|
74
|
+
tooltip: "Actions",
|
|
75
|
+
variant: "default"
|
|
76
|
+
}), s && /* @__PURE__ */ O("div", {
|
|
77
|
+
className: "absolute right-0 z-50 mt-1 min-w-[140px] animate-popup rounded-lg border border-border bg-surface py-1 shadow-lg",
|
|
78
|
+
children: r.map((t) => /* @__PURE__ */ k("button", {
|
|
79
|
+
className: e("flex w-full items-center gds-gap-sm px-3 py-1.5 gds-text-body transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg", t.danger === !0 ? "text-danger hover:bg-danger/10" : "text-fg hover:bg-bg-tertiary"),
|
|
80
|
+
onClick: () => {
|
|
81
|
+
i(t.id), c(!1);
|
|
82
|
+
},
|
|
83
|
+
type: "button",
|
|
84
|
+
children: [t.icon !== void 0 && /* @__PURE__ */ O("span", {
|
|
85
|
+
className: "shrink-0",
|
|
86
|
+
children: t.icon
|
|
87
|
+
}), /* @__PURE__ */ O("span", { children: t.label })]
|
|
88
|
+
}, t.id))
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
}), N = n("flex items-start gds-gap gds-radius-popover border gds-pad-x gds-pad-y gds-text-body", {
|
|
93
|
+
variants: { variant: {
|
|
94
|
+
default: "border-border bg-bg-secondary text-fg",
|
|
95
|
+
info: "border-accent/30 bg-accent/10 text-accent",
|
|
96
|
+
success: "border-success/30 bg-success/10 text-success",
|
|
97
|
+
warning: "border-warning/30 bg-warning/10 text-warning",
|
|
98
|
+
danger: "border-danger/30 bg-danger/10 text-danger"
|
|
99
|
+
} },
|
|
100
|
+
defaultVariants: { variant: "default" }
|
|
101
|
+
}), P = {
|
|
102
|
+
default: /* @__PURE__ */ k("svg", {
|
|
103
|
+
width: "16",
|
|
104
|
+
height: "16",
|
|
105
|
+
viewBox: "0 0 16 16",
|
|
106
|
+
fill: "none",
|
|
107
|
+
stroke: "currentColor",
|
|
108
|
+
strokeWidth: "1.5",
|
|
109
|
+
strokeLinecap: "round",
|
|
110
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
111
|
+
cx: "8",
|
|
112
|
+
cy: "8",
|
|
113
|
+
r: "6.5"
|
|
114
|
+
}), /* @__PURE__ */ O("path", { d: "M8 5.5v3M8 10.5h.01" })]
|
|
115
|
+
}),
|
|
116
|
+
info: /* @__PURE__ */ k("svg", {
|
|
117
|
+
width: "16",
|
|
118
|
+
height: "16",
|
|
119
|
+
viewBox: "0 0 16 16",
|
|
120
|
+
fill: "none",
|
|
121
|
+
stroke: "currentColor",
|
|
122
|
+
strokeWidth: "1.5",
|
|
123
|
+
strokeLinecap: "round",
|
|
124
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
125
|
+
cx: "8",
|
|
126
|
+
cy: "8",
|
|
127
|
+
r: "6.5"
|
|
128
|
+
}), /* @__PURE__ */ O("path", { d: "M8 5.5h.01M8 7.5v3" })]
|
|
129
|
+
}),
|
|
130
|
+
success: /* @__PURE__ */ k("svg", {
|
|
131
|
+
width: "16",
|
|
132
|
+
height: "16",
|
|
133
|
+
viewBox: "0 0 16 16",
|
|
134
|
+
fill: "none",
|
|
135
|
+
stroke: "currentColor",
|
|
136
|
+
strokeWidth: "1.5",
|
|
137
|
+
strokeLinecap: "round",
|
|
138
|
+
strokeLinejoin: "round",
|
|
139
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
140
|
+
cx: "8",
|
|
141
|
+
cy: "8",
|
|
142
|
+
r: "6.5"
|
|
143
|
+
}), /* @__PURE__ */ O("path", { d: "M5.5 8l2 2 3-3.5" })]
|
|
144
|
+
}),
|
|
145
|
+
warning: /* @__PURE__ */ k("svg", {
|
|
146
|
+
width: "16",
|
|
147
|
+
height: "16",
|
|
148
|
+
viewBox: "0 0 16 16",
|
|
149
|
+
fill: "none",
|
|
150
|
+
stroke: "currentColor",
|
|
151
|
+
strokeWidth: "1.5",
|
|
152
|
+
strokeLinecap: "round",
|
|
153
|
+
children: [/* @__PURE__ */ O("path", { d: "M7.13 2.5l-5.5 10h11l-5.5-10z" }), /* @__PURE__ */ O("path", { d: "M7.63 6.5v2.5M7.63 11h.01" })]
|
|
154
|
+
}),
|
|
155
|
+
danger: /* @__PURE__ */ k("svg", {
|
|
156
|
+
width: "16",
|
|
157
|
+
height: "16",
|
|
158
|
+
viewBox: "0 0 16 16",
|
|
159
|
+
fill: "none",
|
|
160
|
+
stroke: "currentColor",
|
|
161
|
+
strokeWidth: "1.5",
|
|
162
|
+
strokeLinecap: "round",
|
|
163
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
164
|
+
cx: "8",
|
|
165
|
+
cy: "8",
|
|
166
|
+
r: "6.5"
|
|
167
|
+
}), /* @__PURE__ */ O("path", { d: "M5.5 5.5l5 5M10.5 5.5l-5 5" })]
|
|
168
|
+
})
|
|
169
|
+
};
|
|
170
|
+
function F({ children: n, title: r, variant: i = "default", onClose: a, glass: o, className: s, ...c }) {
|
|
171
|
+
let l = i ?? "default";
|
|
172
|
+
return /* @__PURE__ */ k("div", {
|
|
173
|
+
className: e(N({ variant: i }), o === !0 && t(o), s),
|
|
174
|
+
"data-component": "alert",
|
|
175
|
+
"data-variant": l,
|
|
176
|
+
role: "alert",
|
|
177
|
+
...c,
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ O("span", {
|
|
180
|
+
className: "mt-px shrink-0",
|
|
181
|
+
children: P[l]
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ k("div", {
|
|
184
|
+
className: "min-w-0 flex-1",
|
|
185
|
+
children: [r !== void 0 && /* @__PURE__ */ O("p", {
|
|
186
|
+
className: "mb-0.5 font-medium",
|
|
187
|
+
children: r
|
|
188
|
+
}), /* @__PURE__ */ O("div", {
|
|
189
|
+
className: "text-inherit/80",
|
|
190
|
+
children: n
|
|
191
|
+
})]
|
|
192
|
+
}),
|
|
193
|
+
a !== void 0 && /* @__PURE__ */ O("button", {
|
|
194
|
+
type: "button",
|
|
195
|
+
onClick: a,
|
|
196
|
+
className: e("shrink-0 gds-radius-button p-0.5 opacity-60 hover:opacity-100", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
197
|
+
"aria-label": "Dismiss",
|
|
198
|
+
children: /* @__PURE__ */ O("svg", {
|
|
199
|
+
width: "12",
|
|
200
|
+
height: "12",
|
|
201
|
+
viewBox: "0 0 12 12",
|
|
202
|
+
fill: "none",
|
|
203
|
+
stroke: "currentColor",
|
|
204
|
+
strokeWidth: "2",
|
|
205
|
+
strokeLinecap: "round",
|
|
206
|
+
children: /* @__PURE__ */ O("path", { d: "M2 2l8 8M10 2l-8 8" })
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/l4-molecules/banner.tsx
|
|
214
|
+
var ee = {
|
|
215
|
+
danger: "bg-danger/10 text-danger",
|
|
216
|
+
info: "bg-accent/10 text-accent",
|
|
217
|
+
success: "bg-success/10 text-success",
|
|
218
|
+
warning: "bg-warning/10 text-warning"
|
|
219
|
+
}, te = {
|
|
220
|
+
danger: /* @__PURE__ */ k("svg", {
|
|
221
|
+
width: "16",
|
|
222
|
+
height: "16",
|
|
223
|
+
viewBox: "0 0 16 16",
|
|
224
|
+
fill: "none",
|
|
225
|
+
stroke: "currentColor",
|
|
226
|
+
strokeWidth: "1.5",
|
|
227
|
+
strokeLinecap: "round",
|
|
228
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
229
|
+
cx: "8",
|
|
230
|
+
cy: "8",
|
|
231
|
+
r: "6.5"
|
|
232
|
+
}), /* @__PURE__ */ O("path", { d: "M5.5 5.5l5 5M10.5 5.5l-5 5" })]
|
|
233
|
+
}),
|
|
234
|
+
info: /* @__PURE__ */ k("svg", {
|
|
235
|
+
width: "16",
|
|
236
|
+
height: "16",
|
|
237
|
+
viewBox: "0 0 16 16",
|
|
238
|
+
fill: "none",
|
|
239
|
+
stroke: "currentColor",
|
|
240
|
+
strokeWidth: "1.5",
|
|
241
|
+
strokeLinecap: "round",
|
|
242
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
243
|
+
cx: "8",
|
|
244
|
+
cy: "8",
|
|
245
|
+
r: "6.5"
|
|
246
|
+
}), /* @__PURE__ */ O("path", { d: "M8 5.5h.01M8 7.5v3" })]
|
|
247
|
+
}),
|
|
248
|
+
success: /* @__PURE__ */ k("svg", {
|
|
249
|
+
width: "16",
|
|
250
|
+
height: "16",
|
|
251
|
+
viewBox: "0 0 16 16",
|
|
252
|
+
fill: "none",
|
|
253
|
+
stroke: "currentColor",
|
|
254
|
+
strokeWidth: "1.5",
|
|
255
|
+
strokeLinecap: "round",
|
|
256
|
+
strokeLinejoin: "round",
|
|
257
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
258
|
+
cx: "8",
|
|
259
|
+
cy: "8",
|
|
260
|
+
r: "6.5"
|
|
261
|
+
}), /* @__PURE__ */ O("path", { d: "M5.5 8l2 2 3-3.5" })]
|
|
262
|
+
}),
|
|
263
|
+
warning: /* @__PURE__ */ k("svg", {
|
|
264
|
+
width: "16",
|
|
265
|
+
height: "16",
|
|
266
|
+
viewBox: "0 0 16 16",
|
|
267
|
+
fill: "none",
|
|
268
|
+
stroke: "currentColor",
|
|
269
|
+
strokeWidth: "1.5",
|
|
270
|
+
strokeLinecap: "round",
|
|
271
|
+
children: [/* @__PURE__ */ O("path", { d: "M7.13 2.5l-5.5 10h11l-5.5-10z" }), /* @__PURE__ */ O("path", { d: "M7.63 6.5v2.5M7.63 11h.01" })]
|
|
272
|
+
})
|
|
273
|
+
}, ne = x(function({ message: n, variant: r = "info", dismissible: i = !1, onDismiss: a, glass: o, className: s }, c) {
|
|
274
|
+
return /* @__PURE__ */ k("div", {
|
|
275
|
+
ref: c,
|
|
276
|
+
className: e("flex w-full items-center gds-gap gds-pad-x gds-pad-y gds-text-body", ee[r], o === !0 && t(o), s),
|
|
277
|
+
"data-component": "banner",
|
|
278
|
+
"data-variant": r,
|
|
279
|
+
role: "status",
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ O("span", {
|
|
282
|
+
className: "shrink-0",
|
|
283
|
+
children: te[r]
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ O("span", {
|
|
286
|
+
className: "flex-1",
|
|
287
|
+
children: n
|
|
288
|
+
}),
|
|
289
|
+
i && a !== void 0 && /* @__PURE__ */ O("button", {
|
|
290
|
+
type: "button",
|
|
291
|
+
onClick: a,
|
|
292
|
+
className: e("shrink-0 gds-radius-button p-0.5 transition-opacity hover:opacity-70", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
293
|
+
"aria-label": "Dismiss",
|
|
294
|
+
children: /* @__PURE__ */ O("svg", {
|
|
295
|
+
width: "12",
|
|
296
|
+
height: "12",
|
|
297
|
+
viewBox: "0 0 12 12",
|
|
298
|
+
fill: "none",
|
|
299
|
+
stroke: "currentColor",
|
|
300
|
+
strokeWidth: "2",
|
|
301
|
+
strokeLinecap: "round",
|
|
302
|
+
children: /* @__PURE__ */ O("path", { d: "M2 2l8 8M10 2l-8 8" })
|
|
303
|
+
})
|
|
304
|
+
})
|
|
305
|
+
]
|
|
306
|
+
});
|
|
307
|
+
}), re = x(function({ before: t, after: n, initialPosition: r = 50, className: i }, a) {
|
|
308
|
+
let [o, s] = E(r), c = T(null), l = T(!1), u = S((e) => {
|
|
309
|
+
let t = c.current;
|
|
310
|
+
if (t === null) return;
|
|
311
|
+
let n = t.getBoundingClientRect(), r = e - n.left;
|
|
312
|
+
s(Math.max(0, Math.min(100, r / n.width * 100)));
|
|
313
|
+
}, []), d = S((e) => {
|
|
314
|
+
l.current = !0, e.target.setPointerCapture(e.pointerId), u(e.clientX);
|
|
315
|
+
}, [u]), f = S((e) => {
|
|
316
|
+
l.current && u(e.clientX);
|
|
317
|
+
}, [u]), p = S(() => {
|
|
318
|
+
l.current = !1;
|
|
319
|
+
}, []);
|
|
320
|
+
return /* @__PURE__ */ k("div", {
|
|
321
|
+
ref: (e) => {
|
|
322
|
+
c.current = e, typeof a == "function" ? a(e) : a != null && (a.current = e);
|
|
323
|
+
},
|
|
324
|
+
className: e("relative overflow-hidden gds-radius select-none", i),
|
|
325
|
+
"data-component": "before-after",
|
|
326
|
+
style: { cursor: "ew-resize" },
|
|
327
|
+
onPointerDown: d,
|
|
328
|
+
onPointerMove: f,
|
|
329
|
+
onPointerUp: p,
|
|
330
|
+
children: [
|
|
331
|
+
/* @__PURE__ */ O("div", {
|
|
332
|
+
className: "relative",
|
|
333
|
+
children: n
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ O("div", {
|
|
336
|
+
className: "absolute inset-0",
|
|
337
|
+
style: { clipPath: `inset(0 ${100 - o}% 0 0)` },
|
|
338
|
+
children: t
|
|
339
|
+
}),
|
|
340
|
+
/* @__PURE__ */ O("div", {
|
|
341
|
+
className: "absolute inset-y-0 z-10 w-0.5 bg-fg/80",
|
|
342
|
+
style: { left: `${o}%` },
|
|
343
|
+
children: /* @__PURE__ */ O("div", {
|
|
344
|
+
className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-border bg-bg p-1 shadow",
|
|
345
|
+
children: /* @__PURE__ */ O("svg", {
|
|
346
|
+
className: "h-3 w-3 text-fg-muted",
|
|
347
|
+
fill: "none",
|
|
348
|
+
stroke: "currentColor",
|
|
349
|
+
strokeWidth: "2",
|
|
350
|
+
viewBox: "0 0 24 24",
|
|
351
|
+
children: /* @__PURE__ */ O("path", { d: "M8 6l-4 6 4 6M16 6l4 6-4 6" })
|
|
352
|
+
})
|
|
353
|
+
})
|
|
354
|
+
})
|
|
355
|
+
]
|
|
356
|
+
});
|
|
357
|
+
}), ie = /* @__PURE__ */ O("svg", {
|
|
358
|
+
width: "12",
|
|
359
|
+
height: "12",
|
|
360
|
+
viewBox: "0 0 12 12",
|
|
361
|
+
fill: "none",
|
|
362
|
+
stroke: "currentColor",
|
|
363
|
+
strokeWidth: "1.5",
|
|
364
|
+
strokeLinecap: "round",
|
|
365
|
+
children: /* @__PURE__ */ O("path", { d: "M4.5 3l3 3-3 3" })
|
|
366
|
+
}), ae = x(function({ items: t, separator: n = ie, maxItems: r, className: i }, a) {
|
|
367
|
+
let o = t;
|
|
368
|
+
return r !== void 0 && t.length > r && r >= 2 && (o = [
|
|
369
|
+
t[0],
|
|
370
|
+
{ label: "..." },
|
|
371
|
+
t[t.length - 1]
|
|
372
|
+
]), /* @__PURE__ */ O("nav", {
|
|
373
|
+
ref: a,
|
|
374
|
+
"aria-label": "Breadcrumb",
|
|
375
|
+
className: e(i),
|
|
376
|
+
"data-component": "breadcrumb",
|
|
377
|
+
children: /* @__PURE__ */ O("ol", {
|
|
378
|
+
className: "flex items-center gds-gap-sm gds-text-body text-fg-muted",
|
|
379
|
+
children: o.map((t, r) => /* @__PURE__ */ k("li", {
|
|
380
|
+
className: "flex items-center gds-gap-sm",
|
|
381
|
+
children: [
|
|
382
|
+
r > 0 && /* @__PURE__ */ O("span", {
|
|
383
|
+
className: "text-fg-muted/50",
|
|
384
|
+
"aria-hidden": "true",
|
|
385
|
+
children: n
|
|
386
|
+
}),
|
|
387
|
+
t.icon !== void 0 && /* @__PURE__ */ O("span", {
|
|
388
|
+
className: "shrink-0",
|
|
389
|
+
children: t.icon
|
|
390
|
+
}),
|
|
391
|
+
t.href === void 0 ? /* @__PURE__ */ O("span", {
|
|
392
|
+
className: e(r === o.length - 1 && "text-fg"),
|
|
393
|
+
children: t.label
|
|
394
|
+
}) : /* @__PURE__ */ O("a", {
|
|
395
|
+
href: t.href,
|
|
396
|
+
className: "transition-colors hover:text-fg",
|
|
397
|
+
children: t.label
|
|
398
|
+
})
|
|
399
|
+
]
|
|
400
|
+
}, r))
|
|
401
|
+
})
|
|
402
|
+
});
|
|
403
|
+
}), oe = /* @__PURE__ */ O("svg", {
|
|
404
|
+
width: "14",
|
|
405
|
+
height: "14",
|
|
406
|
+
viewBox: "0 0 14 14",
|
|
407
|
+
fill: "none",
|
|
408
|
+
stroke: "currentColor",
|
|
409
|
+
strokeWidth: "2",
|
|
410
|
+
strokeLinecap: "round",
|
|
411
|
+
children: /* @__PURE__ */ O("path", { d: "M3 3l8 8M11 3l-8 8" })
|
|
412
|
+
}), se = x(function({ actions: t, className: n, count: r, onClear: i }, a) {
|
|
413
|
+
return r <= 0 ? null : /* @__PURE__ */ k("div", {
|
|
414
|
+
ref: a,
|
|
415
|
+
className: e("fixed bottom-4 left-1/2 z-40 flex -translate-x-1/2 items-center gds-gap gds-pad-x-lg gds-pad-y", "animate-popup gds-radius-popover border border-border bg-surface gds-shadow-xl", n),
|
|
416
|
+
"data-component": "bulk-action-bar",
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ k("span", {
|
|
419
|
+
className: "gds-text-body select-none whitespace-nowrap font-medium text-fg",
|
|
420
|
+
children: [r, " selected"]
|
|
421
|
+
}),
|
|
422
|
+
/* @__PURE__ */ O("div", {
|
|
423
|
+
className: "flex items-center gds-gap-sm",
|
|
424
|
+
children: t
|
|
425
|
+
}),
|
|
426
|
+
i !== void 0 && /* @__PURE__ */ O("button", {
|
|
427
|
+
"aria-label": "Clear selection",
|
|
428
|
+
className: e("shrink-0 p-0.5 text-fg-muted hover:text-fg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
429
|
+
onClick: i,
|
|
430
|
+
type: "button",
|
|
431
|
+
children: oe
|
|
432
|
+
})
|
|
433
|
+
]
|
|
434
|
+
});
|
|
435
|
+
}), ce = {
|
|
436
|
+
info: "border-l-accent bg-accent/5 text-accent",
|
|
437
|
+
tip: "border-l-success bg-success/5 text-success",
|
|
438
|
+
warning: "border-l-warning bg-warning/5 text-warning",
|
|
439
|
+
danger: "border-l-danger bg-danger/5 text-danger"
|
|
440
|
+
}, le = {
|
|
441
|
+
info: /* @__PURE__ */ k("svg", {
|
|
442
|
+
width: "20",
|
|
443
|
+
height: "20",
|
|
444
|
+
viewBox: "0 0 20 20",
|
|
445
|
+
fill: "none",
|
|
446
|
+
stroke: "currentColor",
|
|
447
|
+
strokeWidth: "1.5",
|
|
448
|
+
strokeLinecap: "round",
|
|
449
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
450
|
+
cx: "10",
|
|
451
|
+
cy: "10",
|
|
452
|
+
r: "8"
|
|
453
|
+
}), /* @__PURE__ */ O("path", { d: "M10 7h.01M10 9.5v4" })]
|
|
454
|
+
}),
|
|
455
|
+
tip: /* @__PURE__ */ O("svg", {
|
|
456
|
+
width: "20",
|
|
457
|
+
height: "20",
|
|
458
|
+
viewBox: "0 0 20 20",
|
|
459
|
+
fill: "none",
|
|
460
|
+
stroke: "currentColor",
|
|
461
|
+
strokeWidth: "1.5",
|
|
462
|
+
strokeLinecap: "round",
|
|
463
|
+
strokeLinejoin: "round",
|
|
464
|
+
children: /* @__PURE__ */ O("path", { d: "M7.5 15h5M8 17h4M10 2a5.5 5.5 0 0 0-2 10.65V14h4v-1.35A5.5 5.5 0 0 0 10 2z" })
|
|
465
|
+
}),
|
|
466
|
+
warning: /* @__PURE__ */ k("svg", {
|
|
467
|
+
width: "20",
|
|
468
|
+
height: "20",
|
|
469
|
+
viewBox: "0 0 20 20",
|
|
470
|
+
fill: "none",
|
|
471
|
+
stroke: "currentColor",
|
|
472
|
+
strokeWidth: "1.5",
|
|
473
|
+
strokeLinecap: "round",
|
|
474
|
+
children: [/* @__PURE__ */ O("path", { d: "M9.13 3l-7 12.5h14l-7-12.5z" }), /* @__PURE__ */ O("path", { d: "M9.63 8.5v3M9.63 13.5h.01" })]
|
|
475
|
+
}),
|
|
476
|
+
danger: /* @__PURE__ */ k("svg", {
|
|
477
|
+
width: "20",
|
|
478
|
+
height: "20",
|
|
479
|
+
viewBox: "0 0 20 20",
|
|
480
|
+
fill: "none",
|
|
481
|
+
stroke: "currentColor",
|
|
482
|
+
strokeWidth: "1.5",
|
|
483
|
+
strokeLinecap: "round",
|
|
484
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
485
|
+
cx: "10",
|
|
486
|
+
cy: "10",
|
|
487
|
+
r: "8"
|
|
488
|
+
}), /* @__PURE__ */ O("path", { d: "M7 7l6 6M13 7l-6 6" })]
|
|
489
|
+
})
|
|
490
|
+
}, ue = x(function({ variant: n = "info", title: r, children: i, icon: a, glass: o, className: s }, c) {
|
|
491
|
+
let l = a ?? le[n];
|
|
492
|
+
return /* @__PURE__ */ k("div", {
|
|
493
|
+
ref: c,
|
|
494
|
+
className: e("flex items-start gap-3 border-l-[3px] gds-radius-popover gds-pad-x-lg gds-pad-y-lg gds-text-body", ce[n], o === !0 && t(o), s),
|
|
495
|
+
"data-component": "callout",
|
|
496
|
+
"data-variant": n,
|
|
497
|
+
children: [/* @__PURE__ */ O("span", {
|
|
498
|
+
className: "mt-0.5 shrink-0",
|
|
499
|
+
children: l
|
|
500
|
+
}), /* @__PURE__ */ k("div", {
|
|
501
|
+
className: "min-w-0 flex-1",
|
|
502
|
+
children: [r !== void 0 && /* @__PURE__ */ O("p", {
|
|
503
|
+
className: "mb-1 font-semibold",
|
|
504
|
+
children: r
|
|
505
|
+
}), /* @__PURE__ */ O("div", {
|
|
506
|
+
className: "text-inherit/80",
|
|
507
|
+
children: i
|
|
508
|
+
})]
|
|
509
|
+
})]
|
|
510
|
+
});
|
|
511
|
+
}), I = {
|
|
512
|
+
none: "",
|
|
513
|
+
sm: "gds-pad-x gds-pad-y",
|
|
514
|
+
default: "gds-pad-x-lg gds-pad-y-lg",
|
|
515
|
+
lg: "gds-pad-x-lg gds-pad-y-lg"
|
|
516
|
+
}, de = x(function({ children: n, glass: r, padding: i = "default", loading: a, className: o }, s) {
|
|
517
|
+
return a === !0 ? /* @__PURE__ */ O("div", {
|
|
518
|
+
ref: s,
|
|
519
|
+
className: e("gds-ctx animate-pulse gds-radius-card border border-border bg-bg-tertiary", I[i], o),
|
|
520
|
+
"data-component": "card",
|
|
521
|
+
"data-state": "loading",
|
|
522
|
+
children: /* @__PURE__ */ O("div", { className: "h-20" })
|
|
523
|
+
}) : /* @__PURE__ */ O("div", {
|
|
524
|
+
ref: s,
|
|
525
|
+
className: e("gds-ctx gds-radius-card border", r ? e(t(r), "border-white/10 bg-bg/60") : "border-border bg-surface", I[i], o),
|
|
526
|
+
"data-component": "card",
|
|
527
|
+
children: n
|
|
528
|
+
});
|
|
529
|
+
});
|
|
530
|
+
function fe({ title: t, description: n, action: r, className: i }) {
|
|
531
|
+
return /* @__PURE__ */ k("div", {
|
|
532
|
+
className: e("flex items-start justify-between gds-gap", i),
|
|
533
|
+
children: [/* @__PURE__ */ k("div", {
|
|
534
|
+
className: "min-w-0",
|
|
535
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
536
|
+
className: "text-sm font-semibold text-fg",
|
|
537
|
+
children: t
|
|
538
|
+
}), n !== void 0 && /* @__PURE__ */ O("p", {
|
|
539
|
+
className: "mt-0.5 gds-text-body text-fg-muted",
|
|
540
|
+
children: n
|
|
541
|
+
})]
|
|
542
|
+
}), r !== void 0 && /* @__PURE__ */ O("div", {
|
|
543
|
+
className: "shrink-0",
|
|
544
|
+
children: r
|
|
545
|
+
})]
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
function pe({ children: t, className: n }) {
|
|
549
|
+
return /* @__PURE__ */ O("div", {
|
|
550
|
+
className: e("mt-3", n),
|
|
551
|
+
children: t
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
function me({ children: t, className: n }) {
|
|
555
|
+
return /* @__PURE__ */ O("div", {
|
|
556
|
+
className: e("mt-3 flex items-center gds-gap-sm border-t border-border pt-3", n),
|
|
557
|
+
children: t
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/l4-molecules/category-tag.tsx
|
|
562
|
+
var he = x(function({ className: t, color: n, count: r, label: i, onClick: a, ...o }, s) {
|
|
563
|
+
return /* @__PURE__ */ k("div", {
|
|
564
|
+
className: e("inline-flex items-center gap-2 rounded-md border border-border bg-surface px-2.5 py-1", a !== void 0 && "cursor-pointer hover:bg-bg-tertiary", t),
|
|
565
|
+
"data-component": "category-tag",
|
|
566
|
+
onClick: a,
|
|
567
|
+
ref: s,
|
|
568
|
+
role: a === void 0 ? void 0 : "button",
|
|
569
|
+
...o,
|
|
570
|
+
children: [
|
|
571
|
+
/* @__PURE__ */ O("span", {
|
|
572
|
+
className: "h-3 w-1 shrink-0 rounded-full",
|
|
573
|
+
style: { backgroundColor: n }
|
|
574
|
+
}),
|
|
575
|
+
/* @__PURE__ */ O("span", {
|
|
576
|
+
className: "gds-text-label text-fg",
|
|
577
|
+
children: i
|
|
578
|
+
}),
|
|
579
|
+
r !== void 0 && /* @__PURE__ */ O("span", {
|
|
580
|
+
className: "gds-text-label text-fg-muted",
|
|
581
|
+
children: r
|
|
582
|
+
})
|
|
583
|
+
]
|
|
584
|
+
});
|
|
585
|
+
}), L = {
|
|
586
|
+
valid: "bg-success/15 text-success border-success/20",
|
|
587
|
+
expiring: "bg-warning/15 text-warning border-warning/20",
|
|
588
|
+
expired: "bg-danger/15 text-danger border-danger/20"
|
|
589
|
+
}, R = {
|
|
590
|
+
valid: "🔒",
|
|
591
|
+
expiring: "⚠️",
|
|
592
|
+
expired: "❌"
|
|
593
|
+
}, ge = x(function({ className: t, domain: n, expiresAt: r, status: i, ...a }, o) {
|
|
594
|
+
return /* @__PURE__ */ k("div", {
|
|
595
|
+
className: e("inline-flex items-center gap-2 rounded-md border px-2.5 py-1.5", L[i], t),
|
|
596
|
+
"data-component": "cert-badge",
|
|
597
|
+
ref: o,
|
|
598
|
+
...a,
|
|
599
|
+
children: [
|
|
600
|
+
/* @__PURE__ */ O("span", {
|
|
601
|
+
className: "text-xs",
|
|
602
|
+
children: R[i]
|
|
603
|
+
}),
|
|
604
|
+
/* @__PURE__ */ O("span", {
|
|
605
|
+
className: "gds-text-label font-medium",
|
|
606
|
+
children: n
|
|
607
|
+
}),
|
|
608
|
+
/* @__PURE__ */ O("span", {
|
|
609
|
+
className: "gds-text-label opacity-70",
|
|
610
|
+
children: r
|
|
611
|
+
})
|
|
612
|
+
]
|
|
613
|
+
});
|
|
614
|
+
}), _e = x(function({ options: t, value: n, onChange: r, exclusive: a = !1, className: o, ...s }, c) {
|
|
615
|
+
function l(e) {
|
|
616
|
+
if (a) {
|
|
617
|
+
r(n.includes(e) ? [] : [e]);
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
r(n.includes(e) ? n.filter((t) => t !== e) : [...n, e]);
|
|
621
|
+
}
|
|
622
|
+
return /* @__PURE__ */ O("div", {
|
|
623
|
+
className: e("flex flex-wrap gds-gap", o),
|
|
624
|
+
"data-component": "chip-group",
|
|
625
|
+
ref: c,
|
|
626
|
+
...s,
|
|
627
|
+
children: t.map((t) => /* @__PURE__ */ O("button", {
|
|
628
|
+
type: "button",
|
|
629
|
+
className: e("cursor-pointer", i),
|
|
630
|
+
onClick: () => l(t.value),
|
|
631
|
+
children: /* @__PURE__ */ O(f, {
|
|
632
|
+
label: t.label,
|
|
633
|
+
variant: n.includes(t.value) ? "accent" : "default"
|
|
634
|
+
})
|
|
635
|
+
}, t.value))
|
|
636
|
+
});
|
|
637
|
+
}), ve = x(function({ code: n, language: r, showLineNumbers: a = !0, maxHeight: o, glass: s, className: c }, l) {
|
|
638
|
+
let [u, d] = E(!1), f = S(() => {
|
|
639
|
+
navigator.clipboard.writeText(n).then(() => {
|
|
640
|
+
d(!0), setTimeout(() => d(!1), 1500);
|
|
641
|
+
}).catch(() => {});
|
|
642
|
+
}, [n]), p = n.split("\n"), m = String(p.length).length;
|
|
643
|
+
return /* @__PURE__ */ k("div", {
|
|
644
|
+
ref: l,
|
|
645
|
+
className: e("gds-radius-popover border overflow-hidden", s === !0 ? e(t(s), "border-white/10 bg-bg/60") : "border-border bg-bg-tertiary", c),
|
|
646
|
+
"data-component": "code-block",
|
|
647
|
+
"data-variant": s === !0 ? "glass" : "default",
|
|
648
|
+
children: [/* @__PURE__ */ k("div", {
|
|
649
|
+
className: "flex items-center justify-between border-b border-border/50 px-3 py-1.5",
|
|
650
|
+
children: [/* @__PURE__ */ O("span", {
|
|
651
|
+
className: "select-none text-xs text-fg-muted",
|
|
652
|
+
"data-testid": "code-language",
|
|
653
|
+
children: r ?? "code"
|
|
654
|
+
}), /* @__PURE__ */ O("button", {
|
|
655
|
+
type: "button",
|
|
656
|
+
onClick: f,
|
|
657
|
+
className: e("select-none gds-radius-button px-2 py-0.5 text-xs text-fg-muted transition-colors hover:text-fg", i),
|
|
658
|
+
"aria-label": "Copy code",
|
|
659
|
+
children: u ? /* @__PURE__ */ O("svg", {
|
|
660
|
+
width: "14",
|
|
661
|
+
height: "14",
|
|
662
|
+
viewBox: "0 0 14 14",
|
|
663
|
+
fill: "none",
|
|
664
|
+
stroke: "currentColor",
|
|
665
|
+
strokeWidth: "1.5",
|
|
666
|
+
strokeLinecap: "round",
|
|
667
|
+
strokeLinejoin: "round",
|
|
668
|
+
children: /* @__PURE__ */ O("path", { d: "M3 7.5l3 3 5-6" })
|
|
669
|
+
}) : /* @__PURE__ */ k("svg", {
|
|
670
|
+
width: "14",
|
|
671
|
+
height: "14",
|
|
672
|
+
viewBox: "0 0 14 14",
|
|
673
|
+
fill: "none",
|
|
674
|
+
stroke: "currentColor",
|
|
675
|
+
strokeWidth: "1.5",
|
|
676
|
+
strokeLinecap: "round",
|
|
677
|
+
strokeLinejoin: "round",
|
|
678
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
679
|
+
x: "4.5",
|
|
680
|
+
y: "4.5",
|
|
681
|
+
width: "7",
|
|
682
|
+
height: "7",
|
|
683
|
+
rx: "1.5"
|
|
684
|
+
}), /* @__PURE__ */ O("path", { d: "M9.5 4.5V3a1.5 1.5 0 00-1.5-1.5H3A1.5 1.5 0 001.5 3v5A1.5 1.5 0 003 9.5h1.5" })]
|
|
685
|
+
})
|
|
686
|
+
})]
|
|
687
|
+
}), /* @__PURE__ */ O("div", {
|
|
688
|
+
className: "overflow-auto",
|
|
689
|
+
style: o === void 0 ? void 0 : { maxHeight: o },
|
|
690
|
+
"data-selectable": !0,
|
|
691
|
+
children: /* @__PURE__ */ O("pre", {
|
|
692
|
+
className: "m-0 p-0",
|
|
693
|
+
children: /* @__PURE__ */ O("code", {
|
|
694
|
+
className: "block px-3 py-2 font-mono text-xs leading-5 text-fg",
|
|
695
|
+
children: p.map((e, t) => /* @__PURE__ */ k("div", {
|
|
696
|
+
className: "flex",
|
|
697
|
+
children: [a && /* @__PURE__ */ O("span", {
|
|
698
|
+
className: "mr-3 inline-block select-none border-r border-border/30 pr-3 text-right text-fg-muted/40",
|
|
699
|
+
style: { minWidth: `${m}ch` },
|
|
700
|
+
children: t + 1
|
|
701
|
+
}), /* @__PURE__ */ O("span", {
|
|
702
|
+
className: "flex-1 whitespace-pre",
|
|
703
|
+
children: e
|
|
704
|
+
})]
|
|
705
|
+
}, t))
|
|
706
|
+
})
|
|
707
|
+
})
|
|
708
|
+
})]
|
|
709
|
+
});
|
|
710
|
+
}), ye = x(function({ code: n, language: r, copyable: i = !0, showLineNumbers: a = !0, glass: o, className: s }, c) {
|
|
711
|
+
let [l, u] = E(!1), d = n.split("\n"), f = S(() => {
|
|
712
|
+
navigator.clipboard.writeText(n).then(() => {
|
|
713
|
+
u(!0), setTimeout(() => u(!1), 2e3);
|
|
714
|
+
}).catch(() => {});
|
|
715
|
+
}, [n]);
|
|
716
|
+
return /* @__PURE__ */ k("div", {
|
|
717
|
+
className: e("group relative overflow-hidden gds-radius-popover border", o === !0 ? e(t(o), "border-white/10 bg-bg/60") : "border-border/40 bg-bg-secondary", s),
|
|
718
|
+
"data-component": "code-snippet",
|
|
719
|
+
children: [
|
|
720
|
+
r !== void 0 && /* @__PURE__ */ O("div", {
|
|
721
|
+
className: "flex items-center justify-between border-b border-border/20 px-3 py-1.5",
|
|
722
|
+
children: /* @__PURE__ */ O("span", {
|
|
723
|
+
className: "select-none text-[10px] uppercase text-fg-muted/40",
|
|
724
|
+
children: r
|
|
725
|
+
})
|
|
726
|
+
}),
|
|
727
|
+
i && /* @__PURE__ */ O("button", {
|
|
728
|
+
type: "button",
|
|
729
|
+
"aria-label": "Copy code",
|
|
730
|
+
className: e("absolute top-2 right-2 flex h-6 w-6 items-center justify-center gds-radius-button bg-bg-tertiary/80 text-fg-muted opacity-0 transition-opacity group-hover:opacity-100 hover:text-fg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
731
|
+
onClick: f,
|
|
732
|
+
children: l ? /* @__PURE__ */ O("svg", {
|
|
733
|
+
width: "12",
|
|
734
|
+
height: "12",
|
|
735
|
+
viewBox: "0 0 14 14",
|
|
736
|
+
fill: "none",
|
|
737
|
+
stroke: "currentColor",
|
|
738
|
+
strokeWidth: "1.5",
|
|
739
|
+
strokeLinecap: "round",
|
|
740
|
+
strokeLinejoin: "round",
|
|
741
|
+
children: /* @__PURE__ */ O("path", { d: "M3 7.5l3 3 5-6" })
|
|
742
|
+
}) : /* @__PURE__ */ k("svg", {
|
|
743
|
+
width: "12",
|
|
744
|
+
height: "12",
|
|
745
|
+
viewBox: "0 0 14 14",
|
|
746
|
+
fill: "none",
|
|
747
|
+
stroke: "currentColor",
|
|
748
|
+
strokeWidth: "1.5",
|
|
749
|
+
strokeLinecap: "round",
|
|
750
|
+
strokeLinejoin: "round",
|
|
751
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
752
|
+
x: "4.5",
|
|
753
|
+
y: "4.5",
|
|
754
|
+
width: "7",
|
|
755
|
+
height: "7",
|
|
756
|
+
rx: "1.5"
|
|
757
|
+
}), /* @__PURE__ */ O("path", { d: "M9.5 4.5V3a1.5 1.5 0 00-1.5-1.5H3A1.5 1.5 0 001.5 3v5A1.5 1.5 0 003 9.5h1.5" })]
|
|
758
|
+
})
|
|
759
|
+
}),
|
|
760
|
+
/* @__PURE__ */ O("pre", {
|
|
761
|
+
ref: c,
|
|
762
|
+
className: "overflow-x-auto p-3 font-mono text-[11px] leading-relaxed text-fg",
|
|
763
|
+
"data-selectable": !0,
|
|
764
|
+
children: /* @__PURE__ */ O("code", { children: d.map((e, t) => /* @__PURE__ */ k("div", {
|
|
765
|
+
className: "flex",
|
|
766
|
+
children: [a && /* @__PURE__ */ O("span", {
|
|
767
|
+
className: "mr-4 inline-block w-6 shrink-0 select-none text-right text-fg-muted/30",
|
|
768
|
+
children: t + 1
|
|
769
|
+
}), /* @__PURE__ */ O("span", {
|
|
770
|
+
className: "flex-1",
|
|
771
|
+
children: e || " "
|
|
772
|
+
})]
|
|
773
|
+
}, t)) })
|
|
774
|
+
})
|
|
775
|
+
]
|
|
776
|
+
});
|
|
777
|
+
}), be = x(function({ trigger: t, children: n, defaultOpen: r = !1, open: i, onOpenChange: a, className: o }, s) {
|
|
778
|
+
let [c, l] = E(r), u = i !== void 0, d = u ? i : c;
|
|
779
|
+
function f() {
|
|
780
|
+
let e = !d;
|
|
781
|
+
u || l(e), a !== void 0 && a(e);
|
|
782
|
+
}
|
|
783
|
+
return /* @__PURE__ */ k("div", {
|
|
784
|
+
ref: s,
|
|
785
|
+
className: e("w-full", o),
|
|
786
|
+
"data-component": "collapsible",
|
|
787
|
+
children: [/* @__PURE__ */ O("button", {
|
|
788
|
+
"aria-expanded": d,
|
|
789
|
+
className: "w-full cursor-pointer select-none text-left",
|
|
790
|
+
onClick: f,
|
|
791
|
+
type: "button",
|
|
792
|
+
children: t
|
|
793
|
+
}), /* @__PURE__ */ O("div", {
|
|
794
|
+
className: e("overflow-hidden transition-[max-height] duration-200", d ? "max-h-[2000px]" : "max-h-0"),
|
|
795
|
+
"data-state": d ? "open" : "closed",
|
|
796
|
+
children: d ? n : null
|
|
797
|
+
})]
|
|
798
|
+
});
|
|
799
|
+
}), xe = [
|
|
800
|
+
"#ef4444",
|
|
801
|
+
"#f97316",
|
|
802
|
+
"#eab308",
|
|
803
|
+
"#22c55e",
|
|
804
|
+
"#06b6d4",
|
|
805
|
+
"#3b82f6",
|
|
806
|
+
"#8b5cf6",
|
|
807
|
+
"#ec4899",
|
|
808
|
+
"#64748b",
|
|
809
|
+
"#ffffff"
|
|
810
|
+
], Se = /^#[0-9a-fA-F]{6}$/, Ce = x(function({ value: t, onChange: n, presets: r, showInput: a = !0, disabled: o = !1, className: s }, c) {
|
|
811
|
+
let l = r ?? xe, [u, d] = E(t), f = S((e) => {
|
|
812
|
+
o || (n(e), d(e));
|
|
813
|
+
}, [o, n]), p = S((e) => {
|
|
814
|
+
let t = e.startsWith("#") ? e : `#${e}`;
|
|
815
|
+
d(t), Se.test(t) && n(t);
|
|
816
|
+
}, [n]);
|
|
817
|
+
return /* @__PURE__ */ k("div", {
|
|
818
|
+
ref: c,
|
|
819
|
+
className: e("flex flex-col gds-gap", s),
|
|
820
|
+
"data-component": "color-picker",
|
|
821
|
+
"data-disabled": o ? "" : void 0,
|
|
822
|
+
children: [
|
|
823
|
+
/* @__PURE__ */ k("div", {
|
|
824
|
+
className: "flex items-center gds-gap",
|
|
825
|
+
children: [/* @__PURE__ */ O("div", {
|
|
826
|
+
className: "h-8 w-8 shrink-0 gds-radius-button border border-border",
|
|
827
|
+
style: { backgroundColor: t }
|
|
828
|
+
}), /* @__PURE__ */ O("span", {
|
|
829
|
+
className: "gds-text-body font-mono text-fg-muted",
|
|
830
|
+
children: t
|
|
831
|
+
})]
|
|
832
|
+
}),
|
|
833
|
+
/* @__PURE__ */ O("div", {
|
|
834
|
+
className: "flex flex-wrap gap-1.5",
|
|
835
|
+
children: l.map((n) => /* @__PURE__ */ O("button", {
|
|
836
|
+
type: "button",
|
|
837
|
+
disabled: o,
|
|
838
|
+
onClick: () => f(n),
|
|
839
|
+
className: e("h-6 w-6 rounded-full border transition-shadow", n.toLowerCase() === t.toLowerCase() ? "ring-2 ring-accent ring-offset-1 ring-offset-bg border-transparent" : "border-border hover:scale-110", o && "cursor-not-allowed opacity-40", i),
|
|
840
|
+
style: { backgroundColor: n },
|
|
841
|
+
"aria-label": `Select color ${n}`
|
|
842
|
+
}, n))
|
|
843
|
+
}),
|
|
844
|
+
a && /* @__PURE__ */ k("div", {
|
|
845
|
+
className: "flex items-center gds-gap",
|
|
846
|
+
children: [/* @__PURE__ */ O("span", {
|
|
847
|
+
className: "gds-text-body font-mono text-fg-muted select-none",
|
|
848
|
+
children: "#"
|
|
849
|
+
}), /* @__PURE__ */ O("input", {
|
|
850
|
+
type: "text",
|
|
851
|
+
value: u.replace(/^#/, ""),
|
|
852
|
+
onChange: (e) => p(e.target.value),
|
|
853
|
+
disabled: o,
|
|
854
|
+
maxLength: 6,
|
|
855
|
+
placeholder: "000000",
|
|
856
|
+
className: e("w-20 rounded border border-border bg-transparent px-2 py-1 font-mono gds-text-body text-fg", "focus:border-accent focus:outline-none", o && "cursor-not-allowed opacity-40"),
|
|
857
|
+
"aria-label": "Hex color input"
|
|
858
|
+
})]
|
|
859
|
+
})
|
|
860
|
+
]
|
|
861
|
+
});
|
|
862
|
+
});
|
|
863
|
+
//#endregion
|
|
864
|
+
//#region src/l4-molecules/combobox-list.tsx
|
|
865
|
+
function we({ filtered: n, glass: r, highlightedIndex: i, onSearchChange: a, onSelect: o, query: s, searchPlaceholder: c, searchRef: l, setHighlightedIndex: u, value: d }) {
|
|
866
|
+
let f = S((e) => {
|
|
867
|
+
if (e.key === "ArrowDown" && (e.preventDefault(), u(i >= n.length - 1 ? 0 : i + 1)), e.key === "ArrowUp" && (e.preventDefault(), u(i <= 0 ? n.length - 1 : i - 1)), e.key === "Enter") {
|
|
868
|
+
e.preventDefault();
|
|
869
|
+
let t = n[i];
|
|
870
|
+
t !== void 0 && o(t.value);
|
|
871
|
+
}
|
|
872
|
+
}, [
|
|
873
|
+
n,
|
|
874
|
+
i,
|
|
875
|
+
o,
|
|
876
|
+
u
|
|
877
|
+
]);
|
|
878
|
+
return /* @__PURE__ */ k("div", {
|
|
879
|
+
className: e("absolute left-0 right-0 z-50 mt-1 animate-popup gds-radius-popover border gds-shadow-lg", r ? e(t(r), "border-white/10 bg-bg/60") : "border-border bg-surface"),
|
|
880
|
+
children: [/* @__PURE__ */ O("div", {
|
|
881
|
+
className: "border-b border-border p-1.5",
|
|
882
|
+
children: /* @__PURE__ */ O("input", {
|
|
883
|
+
className: "w-full bg-transparent px-2 py-1 text-sm text-fg outline-none placeholder:text-fg-muted/50",
|
|
884
|
+
onChange: (e) => a(e.target.value),
|
|
885
|
+
onKeyDown: f,
|
|
886
|
+
placeholder: c,
|
|
887
|
+
ref: l,
|
|
888
|
+
type: "text",
|
|
889
|
+
value: s
|
|
890
|
+
})
|
|
891
|
+
}), /* @__PURE__ */ k("div", {
|
|
892
|
+
className: "max-h-60 overflow-y-auto py-1",
|
|
893
|
+
children: [n.length === 0 && /* @__PURE__ */ O("div", {
|
|
894
|
+
className: "gds-pad-x gds-pad-y-sm text-sm text-fg-muted",
|
|
895
|
+
children: "No results"
|
|
896
|
+
}), n.map((t, n) => {
|
|
897
|
+
let r = t.value === d, a = n === i;
|
|
898
|
+
return /* @__PURE__ */ O("button", {
|
|
899
|
+
className: e("flex w-full items-center gds-pad-x gds-pad-y-sm text-left text-sm transition-colors", r && "bg-accent/10 text-accent", !r && "text-fg", a && !r && "bg-bg-tertiary", !a && !r && "hover:bg-bg-tertiary"),
|
|
900
|
+
onClick: () => o(t.value),
|
|
901
|
+
onMouseEnter: () => u(n),
|
|
902
|
+
type: "button",
|
|
903
|
+
children: t.label
|
|
904
|
+
}, t.value);
|
|
905
|
+
})]
|
|
906
|
+
})]
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/l4-molecules/combobox.tsx
|
|
911
|
+
function Te({ open: t }) {
|
|
912
|
+
return /* @__PURE__ */ O("svg", {
|
|
913
|
+
className: e("h-3 w-3 text-fg-muted transition-transform", t && "rotate-180"),
|
|
914
|
+
fill: "none",
|
|
915
|
+
stroke: "currentColor",
|
|
916
|
+
strokeLinecap: "round",
|
|
917
|
+
strokeLinejoin: "round",
|
|
918
|
+
strokeWidth: 2,
|
|
919
|
+
viewBox: "0 0 12 12",
|
|
920
|
+
children: /* @__PURE__ */ O("path", { d: "M3 4.5l3 3 3-3" })
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
var Ee = x(function({ className: n, disabled: r = !1, error: a = !1, glass: o, onChange: s, options: c, placeholder: l = "Select...", searchPlaceholder: u = "Search...", value: d }, f) {
|
|
924
|
+
let [p, m] = E(!1), [h, g] = E(""), [v, y] = E(0), x = T(null), C = T(null), D = f ?? x, A = w(() => {
|
|
925
|
+
if (h === "") return c;
|
|
926
|
+
let e = h.toLowerCase();
|
|
927
|
+
return c.filter((t) => t.label.toLowerCase().includes(e));
|
|
928
|
+
}, [c, h]), j = w(() => c.find((e) => e.value === d), [c, d]), M = S(() => {
|
|
929
|
+
r || (m(!0), g(""), y(0), requestAnimationFrame(() => {
|
|
930
|
+
C.current?.focus();
|
|
931
|
+
}));
|
|
932
|
+
}, [r]), N = S(() => {
|
|
933
|
+
m(!1), g("");
|
|
934
|
+
}, []), P = S((e) => {
|
|
935
|
+
s(e), N();
|
|
936
|
+
}, [s, N]), F = S((e) => {
|
|
937
|
+
g(e), y(0);
|
|
938
|
+
}, []);
|
|
939
|
+
return b(D, p, N), _(p, N), /* @__PURE__ */ k("div", {
|
|
940
|
+
ref: D,
|
|
941
|
+
className: e("relative", n),
|
|
942
|
+
"data-component": "combobox",
|
|
943
|
+
"data-state": p ? "open" : "closed",
|
|
944
|
+
children: [/* @__PURE__ */ k("button", {
|
|
945
|
+
className: e("flex w-full items-center justify-between gds-h gds-radius-popover gds-pad-x border bg-transparent text-left text-sm text-fg transition-colors", i, !a && "border-border hover:border-fg-muted", a && "border-danger", a && "focus-visible:ring-danger", r && "cursor-not-allowed opacity-50", t(o), o === !0 && "border-white/10 bg-bg/60"),
|
|
946
|
+
disabled: r,
|
|
947
|
+
onClick: M,
|
|
948
|
+
type: "button",
|
|
949
|
+
children: [/* @__PURE__ */ O("span", {
|
|
950
|
+
className: e(j === void 0 ? "text-fg-muted" : "text-fg"),
|
|
951
|
+
children: j === void 0 ? l : j.label
|
|
952
|
+
}), /* @__PURE__ */ O(Te, { open: p })]
|
|
953
|
+
}), p && /* @__PURE__ */ O(we, {
|
|
954
|
+
filtered: A,
|
|
955
|
+
glass: o,
|
|
956
|
+
highlightedIndex: v,
|
|
957
|
+
onSearchChange: F,
|
|
958
|
+
onSelect: P,
|
|
959
|
+
query: h,
|
|
960
|
+
searchPlaceholder: u,
|
|
961
|
+
searchRef: C,
|
|
962
|
+
setHighlightedIndex: y,
|
|
963
|
+
value: d
|
|
964
|
+
})]
|
|
965
|
+
});
|
|
966
|
+
});
|
|
967
|
+
//#endregion
|
|
968
|
+
//#region src/l4-molecules/command-menu.tsx
|
|
969
|
+
function De({ items: n, onSelect: r, searchable: i = !0, placeholder: a = "Type a command...", glass: o, className: s }) {
|
|
970
|
+
let [c, l] = E(""), [u, d] = E(0), f = w(() => {
|
|
971
|
+
if (c === "") return n;
|
|
972
|
+
let e = c.toLowerCase();
|
|
973
|
+
return n.filter((t) => t.label.toLowerCase().includes(e));
|
|
974
|
+
}, [n, c]), p = w(() => {
|
|
975
|
+
let e = /* @__PURE__ */ new Map();
|
|
976
|
+
for (let t of f) {
|
|
977
|
+
let n = t.group ?? "", r = e.get(n);
|
|
978
|
+
r === void 0 ? e.set(n, [t]) : r.push(t);
|
|
979
|
+
}
|
|
980
|
+
return e;
|
|
981
|
+
}, [f]), m = S((e) => {
|
|
982
|
+
if (e.key === "ArrowDown") e.preventDefault(), d((e) => (e + 1) % f.length);
|
|
983
|
+
else if (e.key === "ArrowUp") e.preventDefault(), d((e) => (e - 1 + f.length) % f.length);
|
|
984
|
+
else if (h(e)) {
|
|
985
|
+
e.preventDefault();
|
|
986
|
+
let t = f[u];
|
|
987
|
+
t !== void 0 && r(t.id);
|
|
988
|
+
}
|
|
989
|
+
}, [
|
|
990
|
+
f,
|
|
991
|
+
u,
|
|
992
|
+
r
|
|
993
|
+
]), g = -1;
|
|
994
|
+
return /* @__PURE__ */ k("div", {
|
|
995
|
+
className: e("gds-radius-card border border-border overflow-hidden", o !== void 0 && o !== !1 ? e("border-white/10 bg-bg/60", t(o)) : "", s),
|
|
996
|
+
"data-component": "command-menu",
|
|
997
|
+
onKeyDown: m,
|
|
998
|
+
children: [i && /* @__PURE__ */ O("div", {
|
|
999
|
+
className: "border-b border-border",
|
|
1000
|
+
children: /* @__PURE__ */ O("input", {
|
|
1001
|
+
type: "text",
|
|
1002
|
+
"data-testid": "command-menu-search",
|
|
1003
|
+
placeholder: a,
|
|
1004
|
+
className: e("w-full bg-transparent gds-pad-x gds-pad-y text-sm text-fg placeholder:text-fg-muted/40 outline-none", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
1005
|
+
value: c,
|
|
1006
|
+
onChange: (e) => {
|
|
1007
|
+
l(e.target.value), d(0);
|
|
1008
|
+
}
|
|
1009
|
+
})
|
|
1010
|
+
}), /* @__PURE__ */ k("div", {
|
|
1011
|
+
className: "max-h-64 overflow-y-auto gds-pad-y-sm",
|
|
1012
|
+
children: [f.length === 0 && /* @__PURE__ */ O("div", {
|
|
1013
|
+
className: "py-6 text-center text-sm text-fg-muted/40",
|
|
1014
|
+
children: "No results"
|
|
1015
|
+
}), Array.from(p.entries()).map(([t, n]) => /* @__PURE__ */ k("div", { children: [t !== "" && /* @__PURE__ */ O("div", {
|
|
1016
|
+
className: "px-3 pb-1 pt-3 text-[10px] font-semibold uppercase tracking-[0.1em] text-fg-muted/30",
|
|
1017
|
+
children: t
|
|
1018
|
+
}), n.map((t) => {
|
|
1019
|
+
g++;
|
|
1020
|
+
let n = g === u;
|
|
1021
|
+
return /* @__PURE__ */ k("button", {
|
|
1022
|
+
type: "button",
|
|
1023
|
+
onClick: () => r(t.id),
|
|
1024
|
+
"data-active": n,
|
|
1025
|
+
"data-testid": `command-menu-item-${t.id}`,
|
|
1026
|
+
className: e("flex w-full items-center gap-3 px-3 py-2 text-left gds-text-body transition-colors select-none", n ? "bg-accent/10 text-accent" : "", t.danger === !0 ? "text-danger" : n ? "" : "text-fg hover:bg-white/[0.04]"),
|
|
1027
|
+
children: [
|
|
1028
|
+
t.icon !== void 0 && /* @__PURE__ */ O("span", {
|
|
1029
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center text-fg-muted/50",
|
|
1030
|
+
children: t.icon
|
|
1031
|
+
}),
|
|
1032
|
+
/* @__PURE__ */ O("span", {
|
|
1033
|
+
className: "flex-1 truncate",
|
|
1034
|
+
children: t.label
|
|
1035
|
+
}),
|
|
1036
|
+
t.shortcut !== void 0 && /* @__PURE__ */ O("kbd", {
|
|
1037
|
+
className: "shrink-0 rounded border border-white/[0.06] bg-white/[0.03] px-1.5 py-px text-[10px] text-fg-muted/30",
|
|
1038
|
+
children: t.shortcut
|
|
1039
|
+
})
|
|
1040
|
+
]
|
|
1041
|
+
}, t.id);
|
|
1042
|
+
})] }, t))]
|
|
1043
|
+
})]
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
//#endregion
|
|
1047
|
+
//#region src/l4-molecules/dialog.tsx
|
|
1048
|
+
var Oe = {
|
|
1049
|
+
sm: "max-w-sm",
|
|
1050
|
+
default: "max-w-lg",
|
|
1051
|
+
lg: "max-w-2xl",
|
|
1052
|
+
xl: "max-w-4xl"
|
|
1053
|
+
}, z = x(function({ open: n, onClose: r, title: i, description: a, children: o, glass: s, width: c = "default", className: l }, d) {
|
|
1054
|
+
let f = v(n);
|
|
1055
|
+
return y(n), _(n, r), n ? u(/* @__PURE__ */ O("div", {
|
|
1056
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50",
|
|
1057
|
+
onClick: (e) => {
|
|
1058
|
+
e.target === e.currentTarget && r();
|
|
1059
|
+
},
|
|
1060
|
+
"data-component": "dialog",
|
|
1061
|
+
"data-state": "open",
|
|
1062
|
+
children: /* @__PURE__ */ k("div", {
|
|
1063
|
+
ref: (e) => {
|
|
1064
|
+
f.current = e, typeof d == "function" ? d(e) : d != null && (d.current = e);
|
|
1065
|
+
},
|
|
1066
|
+
className: e("gds-ctx w-full animate-popup gds-radius-card border gds-shadow-xl", s ? e(t(s), "border-white/10 bg-bg/60") : "border-border bg-surface", Oe[c], l),
|
|
1067
|
+
children: [(i !== void 0 || a !== void 0) && /* @__PURE__ */ k("div", {
|
|
1068
|
+
className: "flex items-start justify-between gds-gap border-b border-border gds-pad-x-lg gds-pad-y-lg",
|
|
1069
|
+
children: [/* @__PURE__ */ k("div", {
|
|
1070
|
+
className: "min-w-0",
|
|
1071
|
+
children: [i !== void 0 && /* @__PURE__ */ O("h2", {
|
|
1072
|
+
className: "text-sm font-semibold text-fg",
|
|
1073
|
+
children: i
|
|
1074
|
+
}), a !== void 0 && /* @__PURE__ */ O("p", {
|
|
1075
|
+
className: "mt-0.5 gds-text-body text-fg-muted",
|
|
1076
|
+
children: a
|
|
1077
|
+
})]
|
|
1078
|
+
}), /* @__PURE__ */ O("button", {
|
|
1079
|
+
type: "button",
|
|
1080
|
+
onClick: r,
|
|
1081
|
+
className: e("shrink-0 gds-radius-button p-1 text-fg-muted hover:text-fg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
1082
|
+
"aria-label": "Close",
|
|
1083
|
+
children: /* @__PURE__ */ O("svg", {
|
|
1084
|
+
width: "14",
|
|
1085
|
+
height: "14",
|
|
1086
|
+
viewBox: "0 0 14 14",
|
|
1087
|
+
fill: "none",
|
|
1088
|
+
stroke: "currentColor",
|
|
1089
|
+
strokeWidth: "2",
|
|
1090
|
+
strokeLinecap: "round",
|
|
1091
|
+
children: /* @__PURE__ */ O("path", { d: "M3 3l8 8M11 3l-8 8" })
|
|
1092
|
+
})
|
|
1093
|
+
})]
|
|
1094
|
+
}), /* @__PURE__ */ O("div", {
|
|
1095
|
+
className: "gds-pad-x-lg gds-pad-y-lg",
|
|
1096
|
+
children: o
|
|
1097
|
+
})]
|
|
1098
|
+
})
|
|
1099
|
+
})) : null;
|
|
1100
|
+
}), ke = x(function({ cancelLabel: e = "Cancel", className: t, confirmLabel: n = "Confirm", loading: i = !1, message: a, onClose: o, onConfirm: s, open: c, title: l = "Confirm", variant: u = "default" }, d) {
|
|
1101
|
+
return /* @__PURE__ */ O(z, {
|
|
1102
|
+
className: t,
|
|
1103
|
+
onClose: o,
|
|
1104
|
+
open: c,
|
|
1105
|
+
ref: d,
|
|
1106
|
+
title: l,
|
|
1107
|
+
width: "sm",
|
|
1108
|
+
children: /* @__PURE__ */ k("div", {
|
|
1109
|
+
className: "flex flex-col gds-gap",
|
|
1110
|
+
"data-component": "confirm-dialog",
|
|
1111
|
+
"data-variant": u,
|
|
1112
|
+
children: [a !== void 0 && /* @__PURE__ */ O("p", {
|
|
1113
|
+
className: "gds-text-body text-fg-muted",
|
|
1114
|
+
children: a
|
|
1115
|
+
}), /* @__PURE__ */ k("div", {
|
|
1116
|
+
className: "flex items-center justify-end gds-gap-sm",
|
|
1117
|
+
children: [/* @__PURE__ */ O(r, {
|
|
1118
|
+
disabled: i,
|
|
1119
|
+
onClick: o,
|
|
1120
|
+
size: "sm",
|
|
1121
|
+
variant: "ghost",
|
|
1122
|
+
children: e
|
|
1123
|
+
}), /* @__PURE__ */ O(r, {
|
|
1124
|
+
disabled: i,
|
|
1125
|
+
onClick: s,
|
|
1126
|
+
size: "sm",
|
|
1127
|
+
variant: u === "danger" ? "danger" : "primary",
|
|
1128
|
+
children: i ? "Loading..." : n
|
|
1129
|
+
})]
|
|
1130
|
+
})]
|
|
1131
|
+
})
|
|
1132
|
+
});
|
|
1133
|
+
});
|
|
1134
|
+
//#endregion
|
|
1135
|
+
//#region src/l4-molecules/context-menu.tsx
|
|
1136
|
+
function Ae({ trigger: t, items: n, onSelect: r, className: i }) {
|
|
1137
|
+
let [a, o] = E(!1), [s, c] = E({
|
|
1138
|
+
x: 0,
|
|
1139
|
+
y: 0
|
|
1140
|
+
}), l = T(null), u = S(() => o(!1), []);
|
|
1141
|
+
b(l, a, u), _(a, u);
|
|
1142
|
+
let d = S((e) => {
|
|
1143
|
+
e.preventDefault(), c({
|
|
1144
|
+
x: e.clientX,
|
|
1145
|
+
y: e.clientY
|
|
1146
|
+
}), o(!0);
|
|
1147
|
+
}, []), f = S((e) => {
|
|
1148
|
+
o(!1), r(e);
|
|
1149
|
+
}, [r]);
|
|
1150
|
+
return /* @__PURE__ */ k("div", {
|
|
1151
|
+
className: i,
|
|
1152
|
+
"data-component": "context-menu",
|
|
1153
|
+
"data-state": a ? "open" : "closed",
|
|
1154
|
+
onContextMenu: d,
|
|
1155
|
+
children: [t, a && /* @__PURE__ */ O("div", {
|
|
1156
|
+
ref: l,
|
|
1157
|
+
className: "fixed z-50 min-w-[160px] animate-popup gds-radius-popover border border-border bg-surface py-1 gds-shadow-lg",
|
|
1158
|
+
style: {
|
|
1159
|
+
left: s.x,
|
|
1160
|
+
top: s.y
|
|
1161
|
+
},
|
|
1162
|
+
children: n.map((t) => t.separator ? /* @__PURE__ */ O("div", { className: "my-1 h-px bg-border" }, t.id) : /* @__PURE__ */ k("button", {
|
|
1163
|
+
type: "button",
|
|
1164
|
+
disabled: t.disabled,
|
|
1165
|
+
className: e("flex w-full items-center gds-gap-sm gds-pad-x gds-pad-y-sm text-left gds-text-body", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg", t.danger ? "text-danger hover:bg-danger/10" : "text-fg hover:bg-bg-secondary", t.disabled === !0 && "pointer-events-none opacity-40"),
|
|
1166
|
+
onClick: () => f(t.id),
|
|
1167
|
+
children: [
|
|
1168
|
+
t.icon !== void 0 && /* @__PURE__ */ O("span", {
|
|
1169
|
+
className: "flex h-4 w-4 shrink-0 items-center justify-center",
|
|
1170
|
+
children: t.icon
|
|
1171
|
+
}),
|
|
1172
|
+
/* @__PURE__ */ O("span", {
|
|
1173
|
+
className: "flex-1",
|
|
1174
|
+
children: t.label
|
|
1175
|
+
}),
|
|
1176
|
+
t.shortcut !== void 0 && /* @__PURE__ */ O("span", {
|
|
1177
|
+
className: "ml-4 gds-text-caption text-fg-muted",
|
|
1178
|
+
children: t.shortcut
|
|
1179
|
+
})
|
|
1180
|
+
]
|
|
1181
|
+
}, t.id))
|
|
1182
|
+
})]
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
//#endregion
|
|
1186
|
+
//#region src/l4-molecules/copy-field.tsx
|
|
1187
|
+
var je = x(function({ value: t, label: n, masked: r = !1, className: i }, a) {
|
|
1188
|
+
let [o, s] = E(!1), [c, l] = E(!1), u = T(null);
|
|
1189
|
+
C(() => () => {
|
|
1190
|
+
u.current !== null && clearTimeout(u.current);
|
|
1191
|
+
}, []);
|
|
1192
|
+
let d = S(() => {
|
|
1193
|
+
navigator.clipboard.writeText(t).catch(() => {}), s(!0), u.current !== null && clearTimeout(u.current), u.current = setTimeout(() => s(!1), 1500);
|
|
1194
|
+
}, [t]), f = r && !c ? "•".repeat(Math.min(t.length, 20)) : t;
|
|
1195
|
+
return /* @__PURE__ */ k("div", {
|
|
1196
|
+
ref: a,
|
|
1197
|
+
className: e("flex flex-col gap-1", i),
|
|
1198
|
+
"data-component": "copy-field",
|
|
1199
|
+
children: [n !== void 0 && /* @__PURE__ */ O("label", {
|
|
1200
|
+
className: "text-xs text-fg-muted select-none",
|
|
1201
|
+
children: n
|
|
1202
|
+
}), /* @__PURE__ */ k("div", {
|
|
1203
|
+
className: "flex items-center gap-2 rounded-md border border-border bg-surface px-3 py-1.5",
|
|
1204
|
+
children: [/* @__PURE__ */ O("span", {
|
|
1205
|
+
className: "flex-1 truncate font-mono text-sm text-fg select-all",
|
|
1206
|
+
onMouseEnter: r ? () => l(!0) : void 0,
|
|
1207
|
+
onMouseLeave: r ? () => l(!1) : void 0,
|
|
1208
|
+
children: f
|
|
1209
|
+
}), /* @__PURE__ */ O("button", {
|
|
1210
|
+
type: "button",
|
|
1211
|
+
onClick: d,
|
|
1212
|
+
className: "shrink-0 text-fg-muted hover:text-fg transition-colors",
|
|
1213
|
+
"aria-label": "Copy",
|
|
1214
|
+
children: o ? /* @__PURE__ */ O("svg", {
|
|
1215
|
+
width: "14",
|
|
1216
|
+
height: "14",
|
|
1217
|
+
viewBox: "0 0 14 14",
|
|
1218
|
+
fill: "none",
|
|
1219
|
+
stroke: "currentColor",
|
|
1220
|
+
strokeWidth: "2",
|
|
1221
|
+
children: /* @__PURE__ */ O("path", { d: "M2 7l3 3 7-7" })
|
|
1222
|
+
}) : /* @__PURE__ */ k("svg", {
|
|
1223
|
+
width: "14",
|
|
1224
|
+
height: "14",
|
|
1225
|
+
viewBox: "0 0 14 14",
|
|
1226
|
+
fill: "none",
|
|
1227
|
+
stroke: "currentColor",
|
|
1228
|
+
strokeWidth: "1.5",
|
|
1229
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
1230
|
+
x: "4",
|
|
1231
|
+
y: "4",
|
|
1232
|
+
width: "8",
|
|
1233
|
+
height: "8",
|
|
1234
|
+
rx: "1.5"
|
|
1235
|
+
}), /* @__PURE__ */ O("path", { d: "M10 4V2.5A1.5 1.5 0 008.5 1h-6A1.5 1.5 0 001 2.5v6A1.5 1.5 0 002.5 10H4" })]
|
|
1236
|
+
})
|
|
1237
|
+
})]
|
|
1238
|
+
})]
|
|
1239
|
+
});
|
|
1240
|
+
}), Me = x(function({ children: t, value: n, feedback: r = "Copied!", className: a }, o) {
|
|
1241
|
+
let [s, c] = E(!1), l = T(null), u = S(() => {
|
|
1242
|
+
navigator.clipboard.writeText(n).then(() => {
|
|
1243
|
+
c(!0), l.current !== null && clearTimeout(l.current), l.current = setTimeout(() => {
|
|
1244
|
+
c(!1), l.current = null;
|
|
1245
|
+
}, 2e3);
|
|
1246
|
+
}).catch(() => {});
|
|
1247
|
+
}, [n]);
|
|
1248
|
+
return /* @__PURE__ */ k("span", {
|
|
1249
|
+
ref: o,
|
|
1250
|
+
className: e("relative inline-flex cursor-pointer select-none", i, a),
|
|
1251
|
+
"data-component": "copy-to-clipboard",
|
|
1252
|
+
onClick: u,
|
|
1253
|
+
role: "button",
|
|
1254
|
+
tabIndex: 0,
|
|
1255
|
+
children: [t, s && /* @__PURE__ */ O("span", {
|
|
1256
|
+
className: "absolute -top-8 left-1/2 -translate-x-1/2 rounded bg-fg px-2 py-0.5 text-[11px] whitespace-nowrap text-bg shadow-md",
|
|
1257
|
+
children: r
|
|
1258
|
+
})]
|
|
1259
|
+
});
|
|
1260
|
+
}), Ne = x(function({ amount: t, change: n, className: r, currency: i = "¥", period: a, ...o }, s) {
|
|
1261
|
+
let c = t.toLocaleString();
|
|
1262
|
+
return /* @__PURE__ */ k("div", {
|
|
1263
|
+
className: e("flex items-baseline gds-gap", r),
|
|
1264
|
+
"data-component": "currency-display",
|
|
1265
|
+
ref: s,
|
|
1266
|
+
...o,
|
|
1267
|
+
children: [
|
|
1268
|
+
/* @__PURE__ */ k("span", {
|
|
1269
|
+
className: "text-2xl font-bold text-fg",
|
|
1270
|
+
children: [i, c]
|
|
1271
|
+
}),
|
|
1272
|
+
n !== void 0 && /* @__PURE__ */ k("span", {
|
|
1273
|
+
className: e("text-sm font-medium", n >= 0 ? "text-success" : "text-danger"),
|
|
1274
|
+
children: [
|
|
1275
|
+
n >= 0 ? "↑" : "↓",
|
|
1276
|
+
Math.abs(n),
|
|
1277
|
+
"%"
|
|
1278
|
+
]
|
|
1279
|
+
}),
|
|
1280
|
+
a !== void 0 && /* @__PURE__ */ O("span", {
|
|
1281
|
+
className: "text-xs text-fg-muted",
|
|
1282
|
+
children: a
|
|
1283
|
+
})
|
|
1284
|
+
]
|
|
1285
|
+
});
|
|
1286
|
+
});
|
|
1287
|
+
//#endregion
|
|
1288
|
+
//#region src/l4-molecules/currency-input.tsx
|
|
1289
|
+
function Pe(e, t) {
|
|
1290
|
+
return new Intl.NumberFormat(t).format(e);
|
|
1291
|
+
}
|
|
1292
|
+
function Fe(e, t, n) {
|
|
1293
|
+
let r = e;
|
|
1294
|
+
return t !== void 0 && r < t && (r = t), n !== void 0 && r > n && (r = n), r;
|
|
1295
|
+
}
|
|
1296
|
+
var Ie = x(function({ value: t, onChange: n, currency: r = "¥", locale: a = "ja-JP", min: o, max: s, disabled: c = !1, error: l = !1, placeholder: u = "0", className: d }, f) {
|
|
1297
|
+
let [p, m] = E(!1), [h, g] = E(""), _ = t === null ? "" : Pe(t, a), v = S(() => {
|
|
1298
|
+
m(!0), g(t === null ? "" : String(t));
|
|
1299
|
+
}, [t]), y = S(() => {
|
|
1300
|
+
m(!1);
|
|
1301
|
+
let e = h.replace(/[^\d.-]/g, "");
|
|
1302
|
+
if (e === "" || e === "-") {
|
|
1303
|
+
n(null);
|
|
1304
|
+
return;
|
|
1305
|
+
}
|
|
1306
|
+
let t = Number(e);
|
|
1307
|
+
if (Number.isNaN(t)) {
|
|
1308
|
+
n(null);
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1311
|
+
n(Fe(t, o, s));
|
|
1312
|
+
}, [
|
|
1313
|
+
h,
|
|
1314
|
+
s,
|
|
1315
|
+
o,
|
|
1316
|
+
n
|
|
1317
|
+
]), b = S((e) => {
|
|
1318
|
+
g(e.replace(/[^\d.-]/g, ""));
|
|
1319
|
+
}, []);
|
|
1320
|
+
return /* @__PURE__ */ k("div", {
|
|
1321
|
+
ref: f,
|
|
1322
|
+
className: e("inline-flex items-center gds-h gds-radius-input border", l ? "border-danger" : "border-border", c && "cursor-not-allowed opacity-40", d),
|
|
1323
|
+
"data-component": "currency-input",
|
|
1324
|
+
"data-disabled": c ? "" : void 0,
|
|
1325
|
+
"data-error": l ? "" : void 0,
|
|
1326
|
+
children: [/* @__PURE__ */ O("span", {
|
|
1327
|
+
className: "select-none pl-3 text-fg-muted gds-text-body",
|
|
1328
|
+
children: r
|
|
1329
|
+
}), /* @__PURE__ */ O("input", {
|
|
1330
|
+
type: "text",
|
|
1331
|
+
inputMode: "numeric",
|
|
1332
|
+
value: p ? h : _,
|
|
1333
|
+
onChange: (e) => b(e.target.value),
|
|
1334
|
+
onFocus: v,
|
|
1335
|
+
onBlur: y,
|
|
1336
|
+
disabled: c,
|
|
1337
|
+
placeholder: u,
|
|
1338
|
+
className: e("flex-1 bg-transparent px-2 text-right text-fg gds-text-body focus:outline-none", i),
|
|
1339
|
+
"aria-label": "Currency amount"
|
|
1340
|
+
})]
|
|
1341
|
+
});
|
|
1342
|
+
}), Le = {
|
|
1343
|
+
down: "text-danger",
|
|
1344
|
+
neutral: "text-fg-muted",
|
|
1345
|
+
up: "text-success"
|
|
1346
|
+
}, Re = x(function({ title: n, value: r, change: i, changeType: a = "neutral", icon: o, footer: s, glass: c, className: l }, u) {
|
|
1347
|
+
return /* @__PURE__ */ k("div", {
|
|
1348
|
+
ref: u,
|
|
1349
|
+
className: e("gds-ctx gds-radius border border-border/40 bg-surface gds-pad select-none", c === !0 && t(c), l),
|
|
1350
|
+
"data-component": "data-card",
|
|
1351
|
+
children: [
|
|
1352
|
+
/* @__PURE__ */ k("div", {
|
|
1353
|
+
className: "flex items-start justify-between",
|
|
1354
|
+
children: [/* @__PURE__ */ O("span", {
|
|
1355
|
+
className: "gds-text-body text-fg-muted",
|
|
1356
|
+
children: n
|
|
1357
|
+
}), o !== void 0 && /* @__PURE__ */ O("span", {
|
|
1358
|
+
className: "text-fg-muted/30",
|
|
1359
|
+
children: o
|
|
1360
|
+
})]
|
|
1361
|
+
}),
|
|
1362
|
+
/* @__PURE__ */ O("div", {
|
|
1363
|
+
className: "mt-2 text-xl font-bold text-fg",
|
|
1364
|
+
children: r
|
|
1365
|
+
}),
|
|
1366
|
+
i !== void 0 && /* @__PURE__ */ k("div", {
|
|
1367
|
+
className: e("mt-1 flex items-center gap-1 text-[11px]", Le[a]),
|
|
1368
|
+
children: [
|
|
1369
|
+
a === "up" && /* @__PURE__ */ k("svg", {
|
|
1370
|
+
width: "12",
|
|
1371
|
+
height: "12",
|
|
1372
|
+
viewBox: "0 0 16 16",
|
|
1373
|
+
fill: "none",
|
|
1374
|
+
stroke: "currentColor",
|
|
1375
|
+
strokeWidth: "1.5",
|
|
1376
|
+
strokeLinecap: "round",
|
|
1377
|
+
strokeLinejoin: "round",
|
|
1378
|
+
children: [/* @__PURE__ */ O("path", { d: "M2 12l5-5 3 3 5-6" }), /* @__PURE__ */ O("path", { d: "M11 4h4v4" })]
|
|
1379
|
+
}),
|
|
1380
|
+
a === "down" && /* @__PURE__ */ k("svg", {
|
|
1381
|
+
width: "12",
|
|
1382
|
+
height: "12",
|
|
1383
|
+
viewBox: "0 0 16 16",
|
|
1384
|
+
fill: "none",
|
|
1385
|
+
stroke: "currentColor",
|
|
1386
|
+
strokeWidth: "1.5",
|
|
1387
|
+
strokeLinecap: "round",
|
|
1388
|
+
strokeLinejoin: "round",
|
|
1389
|
+
children: [/* @__PURE__ */ O("path", { d: "M2 4l5 5 3-3 5 6" }), /* @__PURE__ */ O("path", { d: "M11 12h4V8" })]
|
|
1390
|
+
}),
|
|
1391
|
+
/* @__PURE__ */ O("span", { children: i })
|
|
1392
|
+
]
|
|
1393
|
+
}),
|
|
1394
|
+
s !== void 0 && /* @__PURE__ */ O("div", {
|
|
1395
|
+
className: "mt-3 border-t border-border/20 pt-2 text-[10px] text-fg-muted/50",
|
|
1396
|
+
children: s
|
|
1397
|
+
})
|
|
1398
|
+
]
|
|
1399
|
+
});
|
|
1400
|
+
});
|
|
1401
|
+
//#endregion
|
|
1402
|
+
//#region src/l4-molecules/date-display.tsx
|
|
1403
|
+
function B(e) {
|
|
1404
|
+
let t = Math.floor(e / 1e3);
|
|
1405
|
+
if (t < 60) return "just now";
|
|
1406
|
+
let n = Math.floor(t / 60);
|
|
1407
|
+
if (n < 60) return `${n}m ago`;
|
|
1408
|
+
let r = Math.floor(n / 60);
|
|
1409
|
+
return r < 24 ? `${r}h ago` : r < 48 ? "yesterday" : `${Math.floor(r / 24)} days ago`;
|
|
1410
|
+
}
|
|
1411
|
+
function V(e) {
|
|
1412
|
+
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
1413
|
+
}
|
|
1414
|
+
var ze = 10080 * 60 * 1e3, Be = x(function({ date: t, format: n = "auto", className: r }, i) {
|
|
1415
|
+
let a = w(() => {
|
|
1416
|
+
let e = t instanceof Date ? t : new Date(t), r = Date.now() - e.getTime();
|
|
1417
|
+
return n === "relative" ? B(r) : n === "absolute" ? V(e) : r < ze ? B(r) : V(e);
|
|
1418
|
+
}, [t, n]), o = t instanceof Date ? t : new Date(t);
|
|
1419
|
+
return /* @__PURE__ */ O("span", {
|
|
1420
|
+
ref: i,
|
|
1421
|
+
className: e("text-fg-muted gds-text", r),
|
|
1422
|
+
"data-component": "date-display",
|
|
1423
|
+
title: o.toISOString(),
|
|
1424
|
+
children: a
|
|
1425
|
+
});
|
|
1426
|
+
}), Ve = x(function({ className: t, disabled: n = !1, endDate: r, error: i = !1, onChange: a, placeholder: o, startDate: s }, c) {
|
|
1427
|
+
return /* @__PURE__ */ k("div", {
|
|
1428
|
+
className: e("flex items-center gds-radius-input border bg-bg transition-colors", i ? "border-danger" : "border-border hover:border-border-strong", n && "cursor-not-allowed opacity-50", t),
|
|
1429
|
+
"data-component": "date-range-input",
|
|
1430
|
+
"data-error": i ? "" : void 0,
|
|
1431
|
+
ref: c,
|
|
1432
|
+
children: [
|
|
1433
|
+
/* @__PURE__ */ O("input", {
|
|
1434
|
+
"aria-label": o?.start ?? "Start date",
|
|
1435
|
+
className: "gds-h flex-1 bg-transparent gds-text-body text-fg outline-none gds-pad-x disabled:cursor-not-allowed",
|
|
1436
|
+
disabled: n,
|
|
1437
|
+
onChange: (e) => {
|
|
1438
|
+
a(e.target.value === "" ? null : e.target.value, r);
|
|
1439
|
+
},
|
|
1440
|
+
placeholder: o?.start,
|
|
1441
|
+
type: "date",
|
|
1442
|
+
value: s ?? ""
|
|
1443
|
+
}),
|
|
1444
|
+
/* @__PURE__ */ O("span", {
|
|
1445
|
+
className: "shrink-0 text-fg-muted/40 select-none gds-text-label",
|
|
1446
|
+
children: "→"
|
|
1447
|
+
}),
|
|
1448
|
+
/* @__PURE__ */ O("input", {
|
|
1449
|
+
"aria-label": o?.end ?? "End date",
|
|
1450
|
+
className: "gds-h flex-1 border-l border-inherit bg-transparent gds-text-body text-fg outline-none gds-pad-x disabled:cursor-not-allowed",
|
|
1451
|
+
disabled: n,
|
|
1452
|
+
min: s ?? void 0,
|
|
1453
|
+
onChange: (e) => {
|
|
1454
|
+
a(s, e.target.value === "" ? null : e.target.value);
|
|
1455
|
+
},
|
|
1456
|
+
placeholder: o?.end,
|
|
1457
|
+
type: "date",
|
|
1458
|
+
value: r ?? ""
|
|
1459
|
+
})
|
|
1460
|
+
]
|
|
1461
|
+
});
|
|
1462
|
+
}), He = x(function({ children: t, title: n, className: r }, i) {
|
|
1463
|
+
return /* @__PURE__ */ k("div", {
|
|
1464
|
+
ref: i,
|
|
1465
|
+
className: e("space-y-0.5", r),
|
|
1466
|
+
"data-component": "description",
|
|
1467
|
+
children: [n !== void 0 && /* @__PURE__ */ O("div", {
|
|
1468
|
+
className: "gds-text-body font-medium text-fg",
|
|
1469
|
+
children: n
|
|
1470
|
+
}), /* @__PURE__ */ O("div", {
|
|
1471
|
+
className: "gds-text-body text-fg-muted",
|
|
1472
|
+
children: t
|
|
1473
|
+
})]
|
|
1474
|
+
});
|
|
1475
|
+
}), Ue = x(function({ className: n, glass: r = !0, items: i, onSelect: a, ...o }, s) {
|
|
1476
|
+
let [c, l] = E(null);
|
|
1477
|
+
return /* @__PURE__ */ O("div", {
|
|
1478
|
+
className: e("inline-flex items-end gap-1 gds-radius-card p-2", "border border-white/[0.06] bg-bg-secondary/80", t(r === !0 ? !0 : void 0), r === !0 && "border-white/10", n),
|
|
1479
|
+
"data-component": "dock",
|
|
1480
|
+
ref: s,
|
|
1481
|
+
...o,
|
|
1482
|
+
children: i.map((t, n) => {
|
|
1483
|
+
let r = c === n, i = c !== null && Math.abs(n - c) === 1, o = 1;
|
|
1484
|
+
return r ? o = 1.3 : i && (o = 1.1), /* @__PURE__ */ k("div", {
|
|
1485
|
+
className: "group relative flex flex-col items-center",
|
|
1486
|
+
onMouseEnter: () => l(n),
|
|
1487
|
+
onMouseLeave: () => l(null),
|
|
1488
|
+
children: [/* @__PURE__ */ O("span", {
|
|
1489
|
+
className: e("pointer-events-none absolute -top-8 whitespace-nowrap rounded-md bg-bg-secondary px-2 py-1 text-[10px] text-fg-muted shadow-lg", "transition-opacity duration-150", r ? "opacity-100" : "opacity-0"),
|
|
1490
|
+
"data-testid": `dock-tooltip-${t.id}`,
|
|
1491
|
+
children: t.label
|
|
1492
|
+
}), /* @__PURE__ */ O("button", {
|
|
1493
|
+
className: e("flex items-center justify-center rounded-lg p-2", "transition-transform duration-200", "hover:bg-white/[0.06]"),
|
|
1494
|
+
"data-testid": `dock-item-${t.id}`,
|
|
1495
|
+
onClick: () => a(t.id),
|
|
1496
|
+
style: {
|
|
1497
|
+
transform: `scale(${o})`,
|
|
1498
|
+
transitionTimingFunction: "cubic-bezier(0.25, 0.46, 0.45, 0.94)"
|
|
1499
|
+
},
|
|
1500
|
+
type: "button",
|
|
1501
|
+
children: /* @__PURE__ */ O("span", {
|
|
1502
|
+
className: "gds-icon-child",
|
|
1503
|
+
children: t.icon
|
|
1504
|
+
})
|
|
1505
|
+
})]
|
|
1506
|
+
}, t.id);
|
|
1507
|
+
})
|
|
1508
|
+
});
|
|
1509
|
+
}), We = x(function({ label: t, progress: n, complete: r = !1, onClick: a, disabled: o = !1, className: s }, c) {
|
|
1510
|
+
let l = n !== void 0 && !r, u = o || l;
|
|
1511
|
+
return /* @__PURE__ */ k("button", {
|
|
1512
|
+
ref: c,
|
|
1513
|
+
type: "button",
|
|
1514
|
+
className: e("inline-flex items-center gap-2 gds-radius-button border border-border bg-bg px-4 py-2 text-sm font-medium text-fg transition-colors select-none", "hover:bg-bg-secondary", u && "cursor-not-allowed opacity-50", r && "border-success/30 text-success", i, s),
|
|
1515
|
+
"data-component": "download-button",
|
|
1516
|
+
disabled: u,
|
|
1517
|
+
onClick: a,
|
|
1518
|
+
children: [
|
|
1519
|
+
r && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("svg", {
|
|
1520
|
+
width: "16",
|
|
1521
|
+
height: "16",
|
|
1522
|
+
viewBox: "0 0 16 16",
|
|
1523
|
+
fill: "none",
|
|
1524
|
+
stroke: "currentColor",
|
|
1525
|
+
strokeWidth: "1.5",
|
|
1526
|
+
strokeLinecap: "round",
|
|
1527
|
+
strokeLinejoin: "round",
|
|
1528
|
+
children: /* @__PURE__ */ O("path", { d: "M3 8.5l4 4 6-7" })
|
|
1529
|
+
}), /* @__PURE__ */ O("span", { children: "Downloaded" })] }),
|
|
1530
|
+
!r && l && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("svg", {
|
|
1531
|
+
width: "16",
|
|
1532
|
+
height: "16",
|
|
1533
|
+
viewBox: "0 0 16 16",
|
|
1534
|
+
fill: "none",
|
|
1535
|
+
stroke: "currentColor",
|
|
1536
|
+
strokeWidth: "1.5",
|
|
1537
|
+
strokeLinecap: "round",
|
|
1538
|
+
className: "animate-spin",
|
|
1539
|
+
children: /* @__PURE__ */ O("path", { d: "M8 2a6 6 0 1 0 6 6" })
|
|
1540
|
+
}), /* @__PURE__ */ k("span", {
|
|
1541
|
+
className: "tabular-nums",
|
|
1542
|
+
children: [n, "%"]
|
|
1543
|
+
})] }),
|
|
1544
|
+
!r && !l && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ k("svg", {
|
|
1545
|
+
width: "16",
|
|
1546
|
+
height: "16",
|
|
1547
|
+
viewBox: "0 0 16 16",
|
|
1548
|
+
fill: "none",
|
|
1549
|
+
stroke: "currentColor",
|
|
1550
|
+
strokeWidth: "1.5",
|
|
1551
|
+
strokeLinecap: "round",
|
|
1552
|
+
strokeLinejoin: "round",
|
|
1553
|
+
children: [/* @__PURE__ */ O("path", { d: "M8 2v8M4.5 7.5L8 11l3.5-3.5" }), /* @__PURE__ */ O("path", { d: "M3 13h10" })]
|
|
1554
|
+
}), /* @__PURE__ */ O("span", { children: t })] })
|
|
1555
|
+
]
|
|
1556
|
+
});
|
|
1557
|
+
}), Ge = {
|
|
1558
|
+
sm: "h-[30vh]",
|
|
1559
|
+
default: "h-[50vh]",
|
|
1560
|
+
lg: "h-[75vh]",
|
|
1561
|
+
full: "h-screen"
|
|
1562
|
+
}, Ke = x(function({ open: n, onClose: r, title: i, children: a, height: o = "default", glass: s, className: c }, l) {
|
|
1563
|
+
return y(n), _(n, r), n ? /* @__PURE__ */ O("div", {
|
|
1564
|
+
className: "fixed inset-0 z-50 bg-black/50",
|
|
1565
|
+
onClick: (e) => {
|
|
1566
|
+
e.target === e.currentTarget && r();
|
|
1567
|
+
},
|
|
1568
|
+
"data-component": "drawer",
|
|
1569
|
+
"data-state": "open",
|
|
1570
|
+
children: /* @__PURE__ */ k("div", {
|
|
1571
|
+
ref: l,
|
|
1572
|
+
className: e("gds-ctx fixed inset-x-0 bottom-0 flex flex-col rounded-t-xl border-t transition-transform duration-200", Ge[o], s ? e(t(s), "border-white/10 bg-bg/60") : "border-border bg-surface", c),
|
|
1573
|
+
children: [
|
|
1574
|
+
/* @__PURE__ */ O("div", {
|
|
1575
|
+
className: "flex justify-center py-2",
|
|
1576
|
+
children: /* @__PURE__ */ O("div", {
|
|
1577
|
+
className: "h-1 w-8 rounded-full bg-fg-muted/30",
|
|
1578
|
+
"data-testid": "drag-handle"
|
|
1579
|
+
})
|
|
1580
|
+
}),
|
|
1581
|
+
i !== void 0 && /* @__PURE__ */ k("div", {
|
|
1582
|
+
className: "flex items-center justify-between gds-pad-x-lg pb-2",
|
|
1583
|
+
children: [/* @__PURE__ */ O("h2", {
|
|
1584
|
+
className: "text-sm font-semibold text-fg",
|
|
1585
|
+
children: i
|
|
1586
|
+
}), /* @__PURE__ */ O("button", {
|
|
1587
|
+
type: "button",
|
|
1588
|
+
onClick: r,
|
|
1589
|
+
className: e("shrink-0 gds-radius-button p-1 text-fg-muted hover:text-fg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
1590
|
+
"aria-label": "Close",
|
|
1591
|
+
children: /* @__PURE__ */ O("svg", {
|
|
1592
|
+
width: "14",
|
|
1593
|
+
height: "14",
|
|
1594
|
+
viewBox: "0 0 14 14",
|
|
1595
|
+
fill: "none",
|
|
1596
|
+
stroke: "currentColor",
|
|
1597
|
+
strokeWidth: "2",
|
|
1598
|
+
strokeLinecap: "round",
|
|
1599
|
+
children: /* @__PURE__ */ O("path", { d: "M3 3l8 8M11 3l-8 8" })
|
|
1600
|
+
})
|
|
1601
|
+
})]
|
|
1602
|
+
}),
|
|
1603
|
+
/* @__PURE__ */ O("div", {
|
|
1604
|
+
className: "flex-1 overflow-y-auto gds-pad-x-lg gds-pad-y-lg",
|
|
1605
|
+
children: a
|
|
1606
|
+
})
|
|
1607
|
+
]
|
|
1608
|
+
})
|
|
1609
|
+
}) : null;
|
|
1610
|
+
}), qe = x(function({ onDrop: n, accept: r, active: a, children: o, glass: s, className: c }, l) {
|
|
1611
|
+
let [u, d] = E(!1), f = a === !0 || u, p = S((e) => {
|
|
1612
|
+
e.preventDefault(), d(!0);
|
|
1613
|
+
}, []), m = S((e) => {
|
|
1614
|
+
e.preventDefault(), d(!1);
|
|
1615
|
+
}, []), h = S((e) => {
|
|
1616
|
+
e.preventDefault(), d(!1), n(Array.from(e.dataTransfer.files));
|
|
1617
|
+
}, [n]);
|
|
1618
|
+
return /* @__PURE__ */ k("div", {
|
|
1619
|
+
ref: l,
|
|
1620
|
+
className: e("flex flex-col items-center justify-center gds-gap gds-radius border-2 border-dashed p-8 transition-colors", i, f ? "border-accent bg-accent/5" : "border-border/40 bg-bg-secondary/20", s === !0 && t(s), c),
|
|
1621
|
+
"data-component": "drop-zone",
|
|
1622
|
+
"data-state": f ? "active" : "idle",
|
|
1623
|
+
onDragOver: p,
|
|
1624
|
+
onDragLeave: m,
|
|
1625
|
+
onDrop: h,
|
|
1626
|
+
children: [o ?? /* @__PURE__ */ O("span", {
|
|
1627
|
+
className: "text-sm text-fg-muted select-none",
|
|
1628
|
+
children: "Drop files here"
|
|
1629
|
+
}), r !== void 0 && /* @__PURE__ */ O("span", {
|
|
1630
|
+
className: "text-xs text-fg-muted/60",
|
|
1631
|
+
children: r
|
|
1632
|
+
})]
|
|
1633
|
+
});
|
|
1634
|
+
});
|
|
1635
|
+
//#endregion
|
|
1636
|
+
//#region src/l4-molecules/dropdown.tsx
|
|
1637
|
+
function Je({ items: n, onSelect: r, trigger: a, align: o = "start", glass: s, className: c }) {
|
|
1638
|
+
let [l, u] = E(!1), d = T(null);
|
|
1639
|
+
return b(d, l, () => u(!1)), _(l, () => u(!1)), /* @__PURE__ */ k("div", {
|
|
1640
|
+
ref: d,
|
|
1641
|
+
className: e("relative inline-block", c),
|
|
1642
|
+
"data-component": "dropdown",
|
|
1643
|
+
"data-state": l ? "open" : "closed",
|
|
1644
|
+
children: [/* @__PURE__ */ O("button", {
|
|
1645
|
+
type: "button",
|
|
1646
|
+
onClick: () => u((e) => !e),
|
|
1647
|
+
className: i,
|
|
1648
|
+
children: a
|
|
1649
|
+
}), l && /* @__PURE__ */ O("div", {
|
|
1650
|
+
className: e("absolute z-50 mt-1 min-w-[160px] animate-popup gds-radius-popover border py-1 gds-shadow-lg", o === "end" ? "right-0" : "left-0", s ? e(t(s), "border-white/10 bg-bg/60") : "border-border bg-surface"),
|
|
1651
|
+
children: n.map((t) => t.separator ? /* @__PURE__ */ O("div", { className: "my-1 h-px bg-border" }, t.id) : /* @__PURE__ */ k("button", {
|
|
1652
|
+
type: "button",
|
|
1653
|
+
disabled: t.disabled,
|
|
1654
|
+
onClick: () => {
|
|
1655
|
+
r(t.id), u(!1);
|
|
1656
|
+
},
|
|
1657
|
+
className: e("flex w-full items-center gds-gap-sm gds-pad-x gds-pad-y-sm gds-text-body transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg", t.danger ? "text-danger hover:bg-danger/10" : "text-fg hover:bg-bg-tertiary", t.disabled === !0 && "pointer-events-none opacity-40"),
|
|
1658
|
+
children: [
|
|
1659
|
+
t.icon !== void 0 && /* @__PURE__ */ O("span", {
|
|
1660
|
+
className: "shrink-0",
|
|
1661
|
+
children: t.icon
|
|
1662
|
+
}),
|
|
1663
|
+
/* @__PURE__ */ O("span", {
|
|
1664
|
+
className: "flex-1 text-left",
|
|
1665
|
+
children: t.label
|
|
1666
|
+
}),
|
|
1667
|
+
t.shortcut !== void 0 && /* @__PURE__ */ O("span", {
|
|
1668
|
+
className: "ml-4 gds-text-caption text-fg-muted",
|
|
1669
|
+
children: t.shortcut
|
|
1670
|
+
})
|
|
1671
|
+
]
|
|
1672
|
+
}, t.id))
|
|
1673
|
+
})]
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
//#endregion
|
|
1677
|
+
//#region src/l4-molecules/editable.tsx
|
|
1678
|
+
var Ye = x(function({ value: t, onChange: n, placeholder: r = "Click to edit", disabled: a, className: o }, s) {
|
|
1679
|
+
let [c, l] = E(!1), [u, d] = E(t), f = T(null), p = S(() => {
|
|
1680
|
+
a !== !0 && (d(t), l(!0));
|
|
1681
|
+
}, [a, t]), m = S(() => {
|
|
1682
|
+
l(!1), n(u);
|
|
1683
|
+
}, [u, n]), h = S(() => {
|
|
1684
|
+
l(!1), d(t);
|
|
1685
|
+
}, [t]), g = S((e) => {
|
|
1686
|
+
e.key === "Enter" && m(), e.key === "Escape" && h();
|
|
1687
|
+
}, [m, h]);
|
|
1688
|
+
if (c) return /* @__PURE__ */ O("input", {
|
|
1689
|
+
ref: f,
|
|
1690
|
+
autoFocus: !0,
|
|
1691
|
+
className: e("bg-transparent underline gds-text-body text-fg outline-none", i, o),
|
|
1692
|
+
"data-component": "editable",
|
|
1693
|
+
"data-state": "editing",
|
|
1694
|
+
onBlur: m,
|
|
1695
|
+
onChange: (e) => d(e.target.value),
|
|
1696
|
+
onKeyDown: g,
|
|
1697
|
+
type: "text",
|
|
1698
|
+
value: u
|
|
1699
|
+
});
|
|
1700
|
+
let _ = t === "";
|
|
1701
|
+
return /* @__PURE__ */ O("span", {
|
|
1702
|
+
ref: s,
|
|
1703
|
+
className: e("inline cursor-pointer gds-text-body hover:underline", a === !0 && "pointer-events-none opacity-50", _ ? "text-fg-muted" : "text-fg", i, o),
|
|
1704
|
+
"data-component": "editable",
|
|
1705
|
+
"data-state": "display",
|
|
1706
|
+
onClick: p,
|
|
1707
|
+
onKeyDown: (e) => {
|
|
1708
|
+
(e.key === "Enter" || e.key === " ") && p();
|
|
1709
|
+
},
|
|
1710
|
+
role: "button",
|
|
1711
|
+
tabIndex: a === !0 ? -1 : 0,
|
|
1712
|
+
children: _ ? r : t
|
|
1713
|
+
});
|
|
1714
|
+
}), Xe = [
|
|
1715
|
+
{
|
|
1716
|
+
name: "Smileys",
|
|
1717
|
+
emojis: [
|
|
1718
|
+
"😀",
|
|
1719
|
+
"😂",
|
|
1720
|
+
"🥹",
|
|
1721
|
+
"😍",
|
|
1722
|
+
"🤔",
|
|
1723
|
+
"😎",
|
|
1724
|
+
"🥳",
|
|
1725
|
+
"😴",
|
|
1726
|
+
"🤯",
|
|
1727
|
+
"😱",
|
|
1728
|
+
"🙄",
|
|
1729
|
+
"😤"
|
|
1730
|
+
]
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
name: "Gestures",
|
|
1734
|
+
emojis: [
|
|
1735
|
+
"👍",
|
|
1736
|
+
"👎",
|
|
1737
|
+
"👏",
|
|
1738
|
+
"🤝",
|
|
1739
|
+
"✌️",
|
|
1740
|
+
"🤞",
|
|
1741
|
+
"🫶",
|
|
1742
|
+
"💪",
|
|
1743
|
+
"🙏",
|
|
1744
|
+
"👋",
|
|
1745
|
+
"🫡",
|
|
1746
|
+
"🤙"
|
|
1747
|
+
]
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
name: "Animals",
|
|
1751
|
+
emojis: [
|
|
1752
|
+
"🐶",
|
|
1753
|
+
"🐱",
|
|
1754
|
+
"🐻",
|
|
1755
|
+
"🦊",
|
|
1756
|
+
"🐸",
|
|
1757
|
+
"🐵",
|
|
1758
|
+
"🦁",
|
|
1759
|
+
"🐧",
|
|
1760
|
+
"🦋",
|
|
1761
|
+
"🐝",
|
|
1762
|
+
"🐢",
|
|
1763
|
+
"🐬"
|
|
1764
|
+
]
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
name: "Objects",
|
|
1768
|
+
emojis: [
|
|
1769
|
+
"🔥",
|
|
1770
|
+
"⭐",
|
|
1771
|
+
"💡",
|
|
1772
|
+
"🎯",
|
|
1773
|
+
"🚀",
|
|
1774
|
+
"💎",
|
|
1775
|
+
"🎉",
|
|
1776
|
+
"📌",
|
|
1777
|
+
"🔔",
|
|
1778
|
+
"💬",
|
|
1779
|
+
"❤️",
|
|
1780
|
+
"✅"
|
|
1781
|
+
]
|
|
1782
|
+
}
|
|
1783
|
+
], Ze = x(function({ onSelect: t, categories: n = Xe, columns: r = 8, glass: i = !1, className: a, ...o }, s) {
|
|
1784
|
+
let [c, l] = E(0), [u, d] = E(""), f = w(() => u === "" ? n[c]?.emojis ?? [] : n.flatMap((e) => e.emojis), [
|
|
1785
|
+
u,
|
|
1786
|
+
c,
|
|
1787
|
+
n
|
|
1788
|
+
]);
|
|
1789
|
+
return /* @__PURE__ */ k("div", {
|
|
1790
|
+
ref: s,
|
|
1791
|
+
className: e("w-fit rounded-lg border border-border p-2 shadow-lg", i ? "bg-bg/80 backdrop-blur-xl" : "bg-bg-secondary", a),
|
|
1792
|
+
"data-component": "emoji-picker",
|
|
1793
|
+
...o,
|
|
1794
|
+
children: [
|
|
1795
|
+
/* @__PURE__ */ O("input", {
|
|
1796
|
+
type: "text",
|
|
1797
|
+
placeholder: "Search...",
|
|
1798
|
+
value: u,
|
|
1799
|
+
onChange: (e) => d(e.target.value),
|
|
1800
|
+
className: "mb-2 w-full rounded-md border border-border bg-transparent px-2 py-1 text-xs text-fg placeholder:text-fg-muted outline-none"
|
|
1801
|
+
}),
|
|
1802
|
+
u === "" && /* @__PURE__ */ O("div", {
|
|
1803
|
+
className: "mb-2 flex gap-1 overflow-x-auto",
|
|
1804
|
+
children: n.map((t, n) => /* @__PURE__ */ O("button", {
|
|
1805
|
+
className: e("shrink-0 rounded-md px-2 py-0.5 text-[10px] font-medium transition-colors", n === c ? "bg-accent/15 text-accent" : "text-fg-muted hover:text-fg"),
|
|
1806
|
+
onClick: () => l(n),
|
|
1807
|
+
children: t.name
|
|
1808
|
+
}, t.name))
|
|
1809
|
+
}),
|
|
1810
|
+
/* @__PURE__ */ O("div", {
|
|
1811
|
+
className: "grid gap-0.5",
|
|
1812
|
+
style: { gridTemplateColumns: `repeat(${r}, 1fr)` },
|
|
1813
|
+
children: f.map((e, n) => /* @__PURE__ */ O("button", {
|
|
1814
|
+
className: "flex h-8 w-8 items-center justify-center rounded-md text-base hover:bg-white/10 transition-colors",
|
|
1815
|
+
onClick: () => t(e),
|
|
1816
|
+
children: e
|
|
1817
|
+
}, `${e}-${n}`))
|
|
1818
|
+
})
|
|
1819
|
+
]
|
|
1820
|
+
});
|
|
1821
|
+
}), Qe = x(function({ message: t, icon: n, action: r, className: i }, a) {
|
|
1822
|
+
return /* @__PURE__ */ k("div", {
|
|
1823
|
+
ref: a,
|
|
1824
|
+
className: e("flex flex-col items-center justify-center gap-2 py-6 select-none", i),
|
|
1825
|
+
"data-component": "empty-placeholder",
|
|
1826
|
+
children: [
|
|
1827
|
+
n !== void 0 && /* @__PURE__ */ O("div", {
|
|
1828
|
+
className: "text-fg-muted/30",
|
|
1829
|
+
children: n
|
|
1830
|
+
}),
|
|
1831
|
+
/* @__PURE__ */ O("p", {
|
|
1832
|
+
className: "gds-text-body text-fg-muted",
|
|
1833
|
+
children: t
|
|
1834
|
+
}),
|
|
1835
|
+
r !== void 0 && /* @__PURE__ */ O("div", {
|
|
1836
|
+
className: "mt-1",
|
|
1837
|
+
children: r
|
|
1838
|
+
})
|
|
1839
|
+
]
|
|
1840
|
+
});
|
|
1841
|
+
}), $e = x(function({ query: t, suggestions: n, className: r }, i) {
|
|
1842
|
+
return /* @__PURE__ */ k("div", {
|
|
1843
|
+
ref: i,
|
|
1844
|
+
className: e("flex flex-col items-center justify-center py-12 text-center select-none", r),
|
|
1845
|
+
"data-component": "empty-search",
|
|
1846
|
+
children: [
|
|
1847
|
+
/* @__PURE__ */ O("div", {
|
|
1848
|
+
className: "flex h-12 w-12 items-center justify-center rounded-full bg-bg-tertiary/50",
|
|
1849
|
+
children: /* @__PURE__ */ k("svg", {
|
|
1850
|
+
width: "24",
|
|
1851
|
+
height: "24",
|
|
1852
|
+
viewBox: "0 0 24 24",
|
|
1853
|
+
fill: "none",
|
|
1854
|
+
stroke: "currentColor",
|
|
1855
|
+
strokeWidth: "1.5",
|
|
1856
|
+
strokeLinecap: "round",
|
|
1857
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
1858
|
+
cx: "11",
|
|
1859
|
+
cy: "11",
|
|
1860
|
+
r: "7"
|
|
1861
|
+
}), /* @__PURE__ */ O("path", { d: "M21 21l-4.35-4.35" })]
|
|
1862
|
+
})
|
|
1863
|
+
}),
|
|
1864
|
+
/* @__PURE__ */ k("h3", {
|
|
1865
|
+
className: "mt-3 text-sm font-medium text-fg",
|
|
1866
|
+
children: [
|
|
1867
|
+
"No results for '",
|
|
1868
|
+
t,
|
|
1869
|
+
"'"
|
|
1870
|
+
]
|
|
1871
|
+
}),
|
|
1872
|
+
n !== void 0 && n.length > 0 && /* @__PURE__ */ O("div", {
|
|
1873
|
+
className: "mt-3 flex flex-wrap justify-center gap-2",
|
|
1874
|
+
children: n.map((e) => /* @__PURE__ */ O("span", {
|
|
1875
|
+
className: "rounded-full bg-bg-tertiary/50 px-3 py-1 text-[11px] text-fg-muted",
|
|
1876
|
+
children: e
|
|
1877
|
+
}, e))
|
|
1878
|
+
})
|
|
1879
|
+
]
|
|
1880
|
+
});
|
|
1881
|
+
}), et = {
|
|
1882
|
+
production: "bg-success/15 text-success",
|
|
1883
|
+
staging: "bg-warning/15 text-warning",
|
|
1884
|
+
development: "bg-accent/15 text-accent",
|
|
1885
|
+
local: "bg-bg-tertiary text-fg-muted"
|
|
1886
|
+
}, tt = {
|
|
1887
|
+
production: "bg-success",
|
|
1888
|
+
staging: "bg-warning",
|
|
1889
|
+
development: "bg-accent",
|
|
1890
|
+
local: "bg-fg-muted"
|
|
1891
|
+
}, nt = x(function({ className: t, env: n, showDot: r = !0, ...i }, a) {
|
|
1892
|
+
return /* @__PURE__ */ k("span", {
|
|
1893
|
+
className: e("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium", et[n], t),
|
|
1894
|
+
"data-component": "environment-badge",
|
|
1895
|
+
ref: a,
|
|
1896
|
+
...i,
|
|
1897
|
+
children: [r && /* @__PURE__ */ O("span", { className: e("h-1.5 w-1.5 rounded-full", tt[n]) }), n]
|
|
1898
|
+
});
|
|
1899
|
+
}), rt = {
|
|
1900
|
+
1: "grid-cols-1",
|
|
1901
|
+
2: "grid-cols-1 md:grid-cols-2",
|
|
1902
|
+
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
1903
|
+
}, it = x(function({ children: t, columns: n = 1, title: r, description: i, className: a }, o) {
|
|
1904
|
+
return /* @__PURE__ */ k("fieldset", {
|
|
1905
|
+
ref: o,
|
|
1906
|
+
className: e("space-y-4", a),
|
|
1907
|
+
"data-component": "field-group",
|
|
1908
|
+
children: [r !== void 0 && /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("legend", {
|
|
1909
|
+
className: "text-sm font-semibold text-fg",
|
|
1910
|
+
children: r
|
|
1911
|
+
}), i !== void 0 && /* @__PURE__ */ O("p", {
|
|
1912
|
+
className: "mt-0.5 gds-text-body text-fg-muted",
|
|
1913
|
+
children: i
|
|
1914
|
+
})] }), /* @__PURE__ */ O("div", {
|
|
1915
|
+
className: e("grid gds-gap", rt[n]),
|
|
1916
|
+
children: t
|
|
1917
|
+
})]
|
|
1918
|
+
});
|
|
1919
|
+
}), at = x(function({ children: t, legend: n, disabled: r = !1, className: i }, a) {
|
|
1920
|
+
return /* @__PURE__ */ k("fieldset", {
|
|
1921
|
+
ref: a,
|
|
1922
|
+
className: e("gds-radius border border-border gds-pad", r && "cursor-not-allowed opacity-50", i),
|
|
1923
|
+
"data-component": "field-set",
|
|
1924
|
+
disabled: r,
|
|
1925
|
+
children: [/* @__PURE__ */ O("legend", {
|
|
1926
|
+
className: "px-2 text-xs font-medium text-fg-muted select-none",
|
|
1927
|
+
children: n
|
|
1928
|
+
}), t]
|
|
1929
|
+
});
|
|
1930
|
+
});
|
|
1931
|
+
//#endregion
|
|
1932
|
+
//#region src/l4-molecules/file-upload.tsx
|
|
1933
|
+
function ot(e, t) {
|
|
1934
|
+
return t === void 0 ? e : e.filter((e) => e.size <= t);
|
|
1935
|
+
}
|
|
1936
|
+
function st() {
|
|
1937
|
+
return /* @__PURE__ */ k("svg", {
|
|
1938
|
+
className: "h-8 w-8 text-fg-muted/40",
|
|
1939
|
+
fill: "none",
|
|
1940
|
+
stroke: "currentColor",
|
|
1941
|
+
strokeLinecap: "round",
|
|
1942
|
+
strokeLinejoin: "round",
|
|
1943
|
+
strokeWidth: 1.5,
|
|
1944
|
+
viewBox: "0 0 24 24",
|
|
1945
|
+
children: [
|
|
1946
|
+
/* @__PURE__ */ O("path", { d: "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" }),
|
|
1947
|
+
/* @__PURE__ */ O("polyline", { points: "17 8 12 3 7 8" }),
|
|
1948
|
+
/* @__PURE__ */ O("line", {
|
|
1949
|
+
x1: "12",
|
|
1950
|
+
x2: "12",
|
|
1951
|
+
y1: "3",
|
|
1952
|
+
y2: "15"
|
|
1953
|
+
})
|
|
1954
|
+
]
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
var ct = x(function({ accept: n, children: r, className: i, disabled: a = !1, glass: o, maxSize: s, multiple: c = !1, onFiles: l }, u) {
|
|
1958
|
+
let [d, f] = E(!1), [p, m] = E([]), h = T(null), g = S((e) => {
|
|
1959
|
+
let t = ot(Array.from(e), s);
|
|
1960
|
+
m(t), l(t);
|
|
1961
|
+
}, [s, l]), _ = S(() => {
|
|
1962
|
+
a || h.current?.click();
|
|
1963
|
+
}, [a]), v = S((e) => {
|
|
1964
|
+
e.preventDefault(), !a && f(!0);
|
|
1965
|
+
}, [a]), y = S((e) => {
|
|
1966
|
+
e.preventDefault(), f(!1);
|
|
1967
|
+
}, []), b = S((e) => {
|
|
1968
|
+
e.preventDefault(), f(!1), !a && g(e.dataTransfer.files);
|
|
1969
|
+
}, [a, g]), x = S((e) => {
|
|
1970
|
+
e.target.files !== null && g(e.target.files);
|
|
1971
|
+
}, [g]);
|
|
1972
|
+
return /* @__PURE__ */ k("div", {
|
|
1973
|
+
ref: u,
|
|
1974
|
+
className: e("flex cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-6 transition-colors", !d && !a && "border-border hover:border-fg-muted", d && "border-accent bg-accent/5", a && "pointer-events-none cursor-not-allowed opacity-50", t(o), i),
|
|
1975
|
+
"data-component": "file-upload",
|
|
1976
|
+
"data-state": d ? "drag-over" : "idle",
|
|
1977
|
+
onClick: _,
|
|
1978
|
+
onDragLeave: y,
|
|
1979
|
+
onDragOver: v,
|
|
1980
|
+
onDrop: b,
|
|
1981
|
+
children: [/* @__PURE__ */ O("input", {
|
|
1982
|
+
accept: n,
|
|
1983
|
+
className: "hidden",
|
|
1984
|
+
multiple: c,
|
|
1985
|
+
onChange: x,
|
|
1986
|
+
ref: h,
|
|
1987
|
+
type: "file"
|
|
1988
|
+
}), r === void 0 ? /* @__PURE__ */ k(D, { children: [
|
|
1989
|
+
/* @__PURE__ */ O(st, {}),
|
|
1990
|
+
/* @__PURE__ */ O("div", {
|
|
1991
|
+
className: "text-sm text-fg-muted",
|
|
1992
|
+
children: "Drop files here or click to browse"
|
|
1993
|
+
}),
|
|
1994
|
+
p.length > 0 && /* @__PURE__ */ k("div", {
|
|
1995
|
+
className: "text-xs text-fg-muted/60",
|
|
1996
|
+
children: [
|
|
1997
|
+
p.length,
|
|
1998
|
+
" file",
|
|
1999
|
+
p.length > 1 ? "s" : "",
|
|
2000
|
+
" selected"
|
|
2001
|
+
]
|
|
2002
|
+
})
|
|
2003
|
+
] }) : r]
|
|
2004
|
+
});
|
|
2005
|
+
}), lt = x(function({ className: t, filters: n, onChange: r, onClear: a, ...o }, s) {
|
|
2006
|
+
let c = n.some((e) => e.active);
|
|
2007
|
+
return /* @__PURE__ */ k("div", {
|
|
2008
|
+
className: e("flex flex-wrap items-center gds-gap", t),
|
|
2009
|
+
"data-component": "filter-bar",
|
|
2010
|
+
ref: s,
|
|
2011
|
+
...o,
|
|
2012
|
+
children: [n.map((t) => /* @__PURE__ */ O("button", {
|
|
2013
|
+
className: e("cursor-pointer", i),
|
|
2014
|
+
onClick: () => r(t.id, !t.active),
|
|
2015
|
+
type: "button",
|
|
2016
|
+
children: /* @__PURE__ */ O(f, {
|
|
2017
|
+
label: t.label,
|
|
2018
|
+
variant: t.active ? "accent" : "default"
|
|
2019
|
+
})
|
|
2020
|
+
}, t.id)), c && a !== void 0 && /* @__PURE__ */ O("button", {
|
|
2021
|
+
className: e("gds-text-caption text-fg-muted hover:text-fg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
2022
|
+
onClick: a,
|
|
2023
|
+
type: "button",
|
|
2024
|
+
children: "Clear all"
|
|
2025
|
+
})]
|
|
2026
|
+
});
|
|
2027
|
+
}), ut = x(function({ className: t, disabled: n, loading: i, onCancel: a, onReset: o, onSave: s, saveLabel: c = "Save", ...l }, u) {
|
|
2028
|
+
return /* @__PURE__ */ k("div", {
|
|
2029
|
+
className: e("flex items-center justify-end gds-gap", t),
|
|
2030
|
+
"data-component": "form-actions",
|
|
2031
|
+
ref: u,
|
|
2032
|
+
...l,
|
|
2033
|
+
children: [
|
|
2034
|
+
o !== void 0 && /* @__PURE__ */ O(r, {
|
|
2035
|
+
variant: "ghost",
|
|
2036
|
+
disabled: n,
|
|
2037
|
+
onClick: o,
|
|
2038
|
+
type: "button",
|
|
2039
|
+
children: "Reset"
|
|
2040
|
+
}),
|
|
2041
|
+
a !== void 0 && /* @__PURE__ */ O(r, {
|
|
2042
|
+
variant: "secondary",
|
|
2043
|
+
disabled: n,
|
|
2044
|
+
onClick: a,
|
|
2045
|
+
type: "button",
|
|
2046
|
+
children: "Cancel"
|
|
2047
|
+
}),
|
|
2048
|
+
s !== void 0 && /* @__PURE__ */ O(r, {
|
|
2049
|
+
disabled: n ?? i,
|
|
2050
|
+
loading: i,
|
|
2051
|
+
onClick: s,
|
|
2052
|
+
type: "submit",
|
|
2053
|
+
children: i === !0 ? "Saving..." : c
|
|
2054
|
+
})
|
|
2055
|
+
]
|
|
2056
|
+
});
|
|
2057
|
+
}), dt = x(function({ children: t, className: n, error: r, helperText: i, label: a, required: o, ...c }, l) {
|
|
2058
|
+
let u = r !== void 0 && r !== "";
|
|
2059
|
+
return /* @__PURE__ */ k("div", {
|
|
2060
|
+
className: e("flex flex-col gds-gap-sm", n),
|
|
2061
|
+
"data-component": "field-wrapper",
|
|
2062
|
+
"data-state": u ? "error" : "idle",
|
|
2063
|
+
ref: l,
|
|
2064
|
+
...c,
|
|
2065
|
+
children: [
|
|
2066
|
+
/* @__PURE__ */ O(s, {
|
|
2067
|
+
required: o,
|
|
2068
|
+
children: a
|
|
2069
|
+
}),
|
|
2070
|
+
t,
|
|
2071
|
+
u && /* @__PURE__ */ O("span", {
|
|
2072
|
+
className: "gds-text-caption text-danger",
|
|
2073
|
+
children: r
|
|
2074
|
+
}),
|
|
2075
|
+
!u && i !== void 0 && /* @__PURE__ */ O("span", {
|
|
2076
|
+
className: "gds-text-caption text-fg-muted",
|
|
2077
|
+
children: i
|
|
2078
|
+
})
|
|
2079
|
+
]
|
|
2080
|
+
});
|
|
2081
|
+
}), H = n(e("inline-flex select-none items-center justify-center font-medium gds-glass transition-colors", i), {
|
|
2082
|
+
variants: {
|
|
2083
|
+
variant: {
|
|
2084
|
+
default: "border border-border/30 bg-bg/50 text-fg hover:bg-bg/70",
|
|
2085
|
+
accent: "border border-accent/30 bg-accent/20 text-accent hover:bg-accent/30"
|
|
2086
|
+
},
|
|
2087
|
+
size: {
|
|
2088
|
+
sm: "h-7 gap-1 gds-radius-button px-2 text-[11px]",
|
|
2089
|
+
default: "h-8 gap-1.5 gds-radius-button px-3 text-xs",
|
|
2090
|
+
lg: "h-9 gap-2 gds-radius px-4 text-sm"
|
|
2091
|
+
}
|
|
2092
|
+
},
|
|
2093
|
+
defaultVariants: {
|
|
2094
|
+
variant: "default",
|
|
2095
|
+
size: "default"
|
|
2096
|
+
}
|
|
2097
|
+
}), ft = x(function({ children: t, className: n, size: r, variant: i, ...a }, o) {
|
|
2098
|
+
return /* @__PURE__ */ O("button", {
|
|
2099
|
+
ref: o,
|
|
2100
|
+
className: e(H({
|
|
2101
|
+
size: r,
|
|
2102
|
+
variant: i
|
|
2103
|
+
}), n),
|
|
2104
|
+
"data-component": "glass-button",
|
|
2105
|
+
...a,
|
|
2106
|
+
children: t
|
|
2107
|
+
});
|
|
2108
|
+
}), U = n("gds-ctx gds-radius border bg-bg/60", {
|
|
2109
|
+
variants: { blur: {
|
|
2110
|
+
sm: "gds-glass-sm border-border/25",
|
|
2111
|
+
default: "gds-glass border-border/20",
|
|
2112
|
+
lg: "gds-glass-lg border-border/15"
|
|
2113
|
+
} },
|
|
2114
|
+
defaultVariants: { blur: "default" }
|
|
2115
|
+
}), pt = x(function({ blur: t, children: n, className: r }, i) {
|
|
2116
|
+
return /* @__PURE__ */ O("div", {
|
|
2117
|
+
ref: i,
|
|
2118
|
+
className: e(U({ blur: t }), r),
|
|
2119
|
+
"data-component": "glass-card",
|
|
2120
|
+
children: n
|
|
2121
|
+
});
|
|
2122
|
+
}), mt = {
|
|
2123
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2124
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
2125
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
2126
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2"
|
|
2127
|
+
}, ht = x(function({ trigger: t, children: n, delay: r = 300, placement: i = "bottom", className: a, ...o }, s) {
|
|
2128
|
+
let [c, l] = E(!1), u = T(void 0), d = T(void 0), f = S(() => {
|
|
2129
|
+
clearTimeout(d.current), u.current = setTimeout(() => l(!0), r);
|
|
2130
|
+
}, [r]), p = S(() => {
|
|
2131
|
+
clearTimeout(u.current), d.current = setTimeout(() => l(!1), 150);
|
|
2132
|
+
}, []);
|
|
2133
|
+
return /* @__PURE__ */ k("div", {
|
|
2134
|
+
ref: s,
|
|
2135
|
+
className: e("relative inline-flex", a),
|
|
2136
|
+
"data-component": "hover-card",
|
|
2137
|
+
"data-state": c ? "open" : "closed",
|
|
2138
|
+
onMouseEnter: f,
|
|
2139
|
+
onMouseLeave: p,
|
|
2140
|
+
...o,
|
|
2141
|
+
children: [t, c && /* @__PURE__ */ O("div", {
|
|
2142
|
+
className: e("absolute z-50 animate-popup gds-radius-popover border border-border bg-surface gds-pad-x gds-pad-y gds-shadow-lg", mt[i]),
|
|
2143
|
+
onMouseEnter: f,
|
|
2144
|
+
onMouseLeave: p,
|
|
2145
|
+
children: n
|
|
2146
|
+
})]
|
|
2147
|
+
});
|
|
2148
|
+
}), gt = x(function({ label: t, value: n, icon: r, className: i }, a) {
|
|
2149
|
+
return /* @__PURE__ */ k("div", {
|
|
2150
|
+
ref: a,
|
|
2151
|
+
className: e("flex items-center gap-2 gds-text-body select-none", i),
|
|
2152
|
+
"data-component": "info-row",
|
|
2153
|
+
children: [
|
|
2154
|
+
r !== void 0 && /* @__PURE__ */ O("span", {
|
|
2155
|
+
className: "text-fg-muted/60",
|
|
2156
|
+
children: r
|
|
2157
|
+
}),
|
|
2158
|
+
/* @__PURE__ */ O("span", {
|
|
2159
|
+
className: "text-fg-muted",
|
|
2160
|
+
children: t
|
|
2161
|
+
}),
|
|
2162
|
+
/* @__PURE__ */ O("span", {
|
|
2163
|
+
className: "ml-auto font-medium text-fg",
|
|
2164
|
+
children: n
|
|
2165
|
+
})
|
|
2166
|
+
]
|
|
2167
|
+
});
|
|
2168
|
+
}), _t = x(function({ prefix: t, suffix: n, error: r, disabled: i, className: a, children: o, ...s }, c) {
|
|
2169
|
+
return /* @__PURE__ */ k("div", {
|
|
2170
|
+
ref: c,
|
|
2171
|
+
"data-component": "input-group",
|
|
2172
|
+
className: e("flex items-center gds-radius-input overflow-hidden border transition-colors", r ? "border-danger" : "border-border", i && "opacity-50 pointer-events-none", "[&_input]:border-0 [&_input]:rounded-none [&_input]:ring-0 [&_input]:focus-visible:ring-0 [&_input]:flex-1", a),
|
|
2173
|
+
...s,
|
|
2174
|
+
children: [
|
|
2175
|
+
t !== void 0 && /* @__PURE__ */ O("span", {
|
|
2176
|
+
className: "flex items-center bg-bg-tertiary border-r border-border px-3 text-sm text-fg-muted select-none",
|
|
2177
|
+
children: t
|
|
2178
|
+
}),
|
|
2179
|
+
o,
|
|
2180
|
+
n !== void 0 && /* @__PURE__ */ O("span", {
|
|
2181
|
+
className: "flex items-center bg-bg-tertiary border-l border-border px-3 text-sm text-fg-muted select-none",
|
|
2182
|
+
children: n
|
|
2183
|
+
})
|
|
2184
|
+
]
|
|
2185
|
+
});
|
|
2186
|
+
}), vt = x(function({ buttonLabel: t, className: n, disabled: r = !1, onChange: i, onSubmit: a, placeholder: o, value: s, ...c }, l) {
|
|
2187
|
+
return /* @__PURE__ */ k("div", {
|
|
2188
|
+
className: e("inline-flex items-center overflow-hidden rounded-md border border-border", n),
|
|
2189
|
+
"data-component": "input-with-button",
|
|
2190
|
+
ref: l,
|
|
2191
|
+
...c,
|
|
2192
|
+
children: [/* @__PURE__ */ O("input", {
|
|
2193
|
+
className: "min-w-0 flex-1 bg-transparent px-3 py-1.5 text-sm text-fg outline-none placeholder:text-fg-muted",
|
|
2194
|
+
disabled: r,
|
|
2195
|
+
onChange: (e) => i(e.target.value),
|
|
2196
|
+
onKeyDown: (e) => {
|
|
2197
|
+
e.key === "Enter" && a();
|
|
2198
|
+
},
|
|
2199
|
+
placeholder: o,
|
|
2200
|
+
type: "text",
|
|
2201
|
+
value: s
|
|
2202
|
+
}), /* @__PURE__ */ O("button", {
|
|
2203
|
+
className: "shrink-0 border-l border-border bg-accent/10 px-3 py-1.5 text-sm font-medium text-accent hover:bg-accent/20 disabled:opacity-50",
|
|
2204
|
+
disabled: r,
|
|
2205
|
+
onClick: a,
|
|
2206
|
+
type: "button",
|
|
2207
|
+
children: t
|
|
2208
|
+
})]
|
|
2209
|
+
});
|
|
2210
|
+
}), yt = x(function({ items: t, columns: n = 1, className: r }, i) {
|
|
2211
|
+
return /* @__PURE__ */ O("div", {
|
|
2212
|
+
ref: i,
|
|
2213
|
+
className: e("grid gap-x-8 gap-y-2", n === 2 ? "grid-cols-2" : "grid-cols-1", r),
|
|
2214
|
+
"data-component": "key-value-list",
|
|
2215
|
+
children: t.map((e) => /* @__PURE__ */ k("div", {
|
|
2216
|
+
className: "flex items-baseline justify-between gap-4",
|
|
2217
|
+
children: [/* @__PURE__ */ O("span", {
|
|
2218
|
+
className: "shrink-0 gds-text-body text-fg-muted",
|
|
2219
|
+
children: e.key
|
|
2220
|
+
}), /* @__PURE__ */ O("span", {
|
|
2221
|
+
className: "text-right gds-text-body text-fg",
|
|
2222
|
+
children: e.value
|
|
2223
|
+
})]
|
|
2224
|
+
}, e.key))
|
|
2225
|
+
});
|
|
2226
|
+
}), bt = x(function({ items: t, columns: n = 1, striped: r, className: i }, a) {
|
|
2227
|
+
let o = n === 2;
|
|
2228
|
+
return /* @__PURE__ */ O("div", {
|
|
2229
|
+
ref: a,
|
|
2230
|
+
className: e("gds-text-body", o && "grid grid-cols-2 gap-x-6", i),
|
|
2231
|
+
"data-component": "kv-table",
|
|
2232
|
+
"data-variant": o ? "2col" : "1col",
|
|
2233
|
+
children: t.map((e, t) => /* @__PURE__ */ O(xt, {
|
|
2234
|
+
item: e,
|
|
2235
|
+
striped: r === !0 && t % 2 == 1
|
|
2236
|
+
}, e.key))
|
|
2237
|
+
});
|
|
2238
|
+
});
|
|
2239
|
+
function xt({ item: t, striped: n }) {
|
|
2240
|
+
let [r, i] = E(!1);
|
|
2241
|
+
return /* @__PURE__ */ k("div", {
|
|
2242
|
+
className: e("group flex items-baseline justify-between gap-4 gds-pad-x gds-pad-y-sm", n && "bg-bg-tertiary/40"),
|
|
2243
|
+
children: [/* @__PURE__ */ O("dt", {
|
|
2244
|
+
className: "shrink-0 font-medium text-fg-muted",
|
|
2245
|
+
children: t.key
|
|
2246
|
+
}), /* @__PURE__ */ k("dd", {
|
|
2247
|
+
className: "flex items-center gap-1.5 text-right text-fg",
|
|
2248
|
+
children: [/* @__PURE__ */ O("span", { children: t.value }), t.copyable === !0 && /* @__PURE__ */ O("button", {
|
|
2249
|
+
onClick: () => {
|
|
2250
|
+
let e = typeof t.value == "string" ? t.value : String(t.value);
|
|
2251
|
+
navigator.clipboard.writeText(e).catch(() => {}), i(!0), setTimeout(() => i(!1), 1500);
|
|
2252
|
+
},
|
|
2253
|
+
className: "invisible text-fg-muted/50 hover:text-fg-muted group-hover:visible",
|
|
2254
|
+
"aria-label": `Copy ${t.key}`,
|
|
2255
|
+
children: r ? "✓" : "⎘"
|
|
2256
|
+
})]
|
|
2257
|
+
})]
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
//#endregion
|
|
2261
|
+
//#region src/l4-molecules/link-preview.tsx
|
|
2262
|
+
var St = x(function({ title: n, url: r, description: i, domain: a, image: o, glass: s, className: c }, l) {
|
|
2263
|
+
return /* @__PURE__ */ k("a", {
|
|
2264
|
+
ref: l,
|
|
2265
|
+
className: e("flex gds-gap gds-radius border-l-4 border-accent bg-bg-secondary gds-pad transition-colors select-none hover:bg-bg-tertiary", s === !0 && t(s), c),
|
|
2266
|
+
"data-component": "link-preview",
|
|
2267
|
+
href: r,
|
|
2268
|
+
rel: "noopener noreferrer",
|
|
2269
|
+
target: "_blank",
|
|
2270
|
+
children: [/* @__PURE__ */ k("div", {
|
|
2271
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
2272
|
+
children: [
|
|
2273
|
+
/* @__PURE__ */ O("span", {
|
|
2274
|
+
className: "truncate text-sm font-medium text-accent",
|
|
2275
|
+
children: n
|
|
2276
|
+
}),
|
|
2277
|
+
i !== void 0 && /* @__PURE__ */ O("span", {
|
|
2278
|
+
className: "line-clamp-2 gds-text-body text-fg-muted",
|
|
2279
|
+
children: i
|
|
2280
|
+
}),
|
|
2281
|
+
a !== void 0 && /* @__PURE__ */ O("span", {
|
|
2282
|
+
className: "text-[10px] text-fg-muted/60",
|
|
2283
|
+
children: a
|
|
2284
|
+
})
|
|
2285
|
+
]
|
|
2286
|
+
}), o !== void 0 && /* @__PURE__ */ O("img", {
|
|
2287
|
+
alt: n,
|
|
2288
|
+
className: "h-16 w-16 shrink-0 gds-radius object-cover",
|
|
2289
|
+
src: o
|
|
2290
|
+
})]
|
|
2291
|
+
});
|
|
2292
|
+
}), Ct = x(function({ visible: n, message: r, glass: i = !0, className: a }, o) {
|
|
2293
|
+
return n ? /* @__PURE__ */ k("div", {
|
|
2294
|
+
ref: o,
|
|
2295
|
+
className: e("absolute inset-0 z-10 flex flex-col items-center justify-center", i === !0 ? t(!0) : "bg-bg/80", a),
|
|
2296
|
+
"data-component": "loading-overlay",
|
|
2297
|
+
children: [/* @__PURE__ */ O(c, {}), r !== void 0 && /* @__PURE__ */ O("span", {
|
|
2298
|
+
className: "mt-2 text-xs text-fg-muted",
|
|
2299
|
+
children: r
|
|
2300
|
+
})]
|
|
2301
|
+
}) : null;
|
|
2302
|
+
}), wt = x(function({ align: t = "top", children: n, className: r, media: i, reverse: a = !1 }, o) {
|
|
2303
|
+
return /* @__PURE__ */ k("div", {
|
|
2304
|
+
ref: o,
|
|
2305
|
+
className: e("flex gds-gap", t === "center" && "items-center", t === "top" && "items-start", a === !0 && "flex-row-reverse", r),
|
|
2306
|
+
"data-component": "media-object",
|
|
2307
|
+
children: [/* @__PURE__ */ O("div", {
|
|
2308
|
+
className: "shrink-0",
|
|
2309
|
+
children: i
|
|
2310
|
+
}), /* @__PURE__ */ O("div", {
|
|
2311
|
+
className: "min-w-0 flex-1",
|
|
2312
|
+
children: n
|
|
2313
|
+
})]
|
|
2314
|
+
});
|
|
2315
|
+
});
|
|
2316
|
+
//#endregion
|
|
2317
|
+
//#region src/l4-molecules/mention-list.tsx
|
|
2318
|
+
function Tt({ filtered: t, highlightedIndex: n, onSelect: r, trigger: i }) {
|
|
2319
|
+
return /* @__PURE__ */ O("div", {
|
|
2320
|
+
className: "absolute left-0 right-0 top-full z-50 mt-1 gds-radius-popover border border-border bg-surface shadow-lg",
|
|
2321
|
+
role: "listbox",
|
|
2322
|
+
"data-testid": "mention-suggestions",
|
|
2323
|
+
children: t.map((t, a) => /* @__PURE__ */ k("button", {
|
|
2324
|
+
type: "button",
|
|
2325
|
+
role: "option",
|
|
2326
|
+
"aria-selected": a === n,
|
|
2327
|
+
className: e("flex w-full items-center px-3 py-1.5 text-left text-sm text-fg transition-colors", a === n && "bg-accent/10 text-accent", a !== n && "hover:bg-bg-secondary"),
|
|
2328
|
+
onMouseDown: (e) => {
|
|
2329
|
+
e.preventDefault(), r(t);
|
|
2330
|
+
},
|
|
2331
|
+
children: [/* @__PURE__ */ O("span", {
|
|
2332
|
+
className: "mr-1.5 text-fg-muted",
|
|
2333
|
+
children: i
|
|
2334
|
+
}), t.label]
|
|
2335
|
+
}, t.id))
|
|
2336
|
+
});
|
|
2337
|
+
}
|
|
2338
|
+
//#endregion
|
|
2339
|
+
//#region src/l4-molecules/mention-input.tsx
|
|
2340
|
+
var Et = x(function({ value: t, onChange: n, suggestions: r, trigger: a = "@", placeholder: o, disabled: s, className: c }, l) {
|
|
2341
|
+
let [u, d] = E(!1), [f, p] = E(""), [m, h] = E(0), g = T(null), _ = r.filter((e) => e.label.toLowerCase().includes(f.toLowerCase())), v = S((e) => {
|
|
2342
|
+
let t = e.lastIndexOf(a);
|
|
2343
|
+
return t < 0 || t > 0 && e[t - 1] !== " " || e.slice(t + a.length).includes(" ") ? -1 : t;
|
|
2344
|
+
}, [a]), y = S((e) => {
|
|
2345
|
+
let t = e.target.value;
|
|
2346
|
+
n(t);
|
|
2347
|
+
let r = v(t);
|
|
2348
|
+
r >= 0 ? (p(t.slice(r + a.length)), d(!0), h(0)) : (d(!1), p(""));
|
|
2349
|
+
}, [
|
|
2350
|
+
n,
|
|
2351
|
+
v,
|
|
2352
|
+
a
|
|
2353
|
+
]), b = S((e) => {
|
|
2354
|
+
let r = v(t);
|
|
2355
|
+
r < 0 || (n(t.slice(0, r) + `${a}${e.label} `), d(!1), p(""));
|
|
2356
|
+
}, [
|
|
2357
|
+
t,
|
|
2358
|
+
n,
|
|
2359
|
+
v,
|
|
2360
|
+
a
|
|
2361
|
+
]), x = S((e) => {
|
|
2362
|
+
u && (e.key === "ArrowDown" ? (e.preventDefault(), h((e) => e >= _.length - 1 ? 0 : e + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), h((e) => e <= 0 ? _.length - 1 : e - 1)) : e.key === "Enter" ? (e.preventDefault(), _.length > 0 && b(_[m])) : e.key === "Escape" && (e.preventDefault(), d(!1)));
|
|
2363
|
+
}, [
|
|
2364
|
+
u,
|
|
2365
|
+
_,
|
|
2366
|
+
m,
|
|
2367
|
+
b
|
|
2368
|
+
]);
|
|
2369
|
+
return C(() => {
|
|
2370
|
+
if (!u) return;
|
|
2371
|
+
function e(e) {
|
|
2372
|
+
g.current !== null && !g.current.contains(e.target) && d(!1);
|
|
2373
|
+
}
|
|
2374
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
2375
|
+
}, [u]), /* @__PURE__ */ k("div", {
|
|
2376
|
+
ref: g,
|
|
2377
|
+
className: "relative",
|
|
2378
|
+
"data-component": "mention-input",
|
|
2379
|
+
children: [/* @__PURE__ */ O("input", {
|
|
2380
|
+
ref: l,
|
|
2381
|
+
type: "text",
|
|
2382
|
+
value: t,
|
|
2383
|
+
onChange: y,
|
|
2384
|
+
onKeyDown: x,
|
|
2385
|
+
placeholder: o,
|
|
2386
|
+
disabled: s,
|
|
2387
|
+
className: e("w-full gds-radius-button border border-border bg-bg-secondary px-3 py-2 text-sm text-fg", "placeholder:text-fg-muted/50", s === !0 && "pointer-events-none opacity-50", i, c)
|
|
2388
|
+
}), u && _.length > 0 && /* @__PURE__ */ O(Tt, {
|
|
2389
|
+
filtered: _,
|
|
2390
|
+
highlightedIndex: m,
|
|
2391
|
+
onSelect: b,
|
|
2392
|
+
trigger: a
|
|
2393
|
+
})]
|
|
2394
|
+
});
|
|
2395
|
+
}), Dt = {
|
|
2396
|
+
default: "text-fg",
|
|
2397
|
+
success: "text-success",
|
|
2398
|
+
warning: "text-warning",
|
|
2399
|
+
danger: "text-danger"
|
|
2400
|
+
}, Ot = x(function({ metrics: t, className: n }, r) {
|
|
2401
|
+
return /* @__PURE__ */ O("div", {
|
|
2402
|
+
ref: r,
|
|
2403
|
+
className: e("flex items-center gds-gap gds-text-body select-none", n),
|
|
2404
|
+
"data-component": "metric-row",
|
|
2405
|
+
children: t.map((t) => /* @__PURE__ */ k("div", {
|
|
2406
|
+
className: "flex items-baseline gap-1.5",
|
|
2407
|
+
children: [/* @__PURE__ */ O("span", {
|
|
2408
|
+
className: "text-fg-muted",
|
|
2409
|
+
children: t.label
|
|
2410
|
+
}), /* @__PURE__ */ k("span", {
|
|
2411
|
+
className: e("font-semibold", Dt[t.variant ?? "default"]),
|
|
2412
|
+
children: [t.value, t.unit !== void 0 && /* @__PURE__ */ O("span", {
|
|
2413
|
+
className: "ml-0.5 font-normal text-fg-muted",
|
|
2414
|
+
children: t.unit
|
|
2415
|
+
})]
|
|
2416
|
+
})]
|
|
2417
|
+
}, t.label))
|
|
2418
|
+
});
|
|
2419
|
+
}), kt = {
|
|
2420
|
+
default: "text-fg",
|
|
2421
|
+
success: "text-success",
|
|
2422
|
+
warning: "text-warning",
|
|
2423
|
+
danger: "text-danger"
|
|
2424
|
+
}, At = x(function({ className: t, label: n, unit: r, value: i, variant: a = "default", ...o }, s) {
|
|
2425
|
+
return /* @__PURE__ */ k("div", {
|
|
2426
|
+
className: e("flex flex-col items-center gds-pad gds-radius bg-surface", t),
|
|
2427
|
+
"data-component": "metric-tile",
|
|
2428
|
+
ref: s,
|
|
2429
|
+
...o,
|
|
2430
|
+
children: [/* @__PURE__ */ k("span", {
|
|
2431
|
+
className: e("text-lg font-bold tabular-nums", kt[a]),
|
|
2432
|
+
children: [i, r !== void 0 && /* @__PURE__ */ O("span", {
|
|
2433
|
+
className: "ml-0.5 text-xs font-normal text-fg-muted",
|
|
2434
|
+
children: r
|
|
2435
|
+
})]
|
|
2436
|
+
}), /* @__PURE__ */ O("span", {
|
|
2437
|
+
className: "text-xs text-fg-muted",
|
|
2438
|
+
children: n
|
|
2439
|
+
})]
|
|
2440
|
+
});
|
|
2441
|
+
});
|
|
2442
|
+
//#endregion
|
|
2443
|
+
//#region src/l4-molecules/multi-select-list.tsx
|
|
2444
|
+
function jt() {
|
|
2445
|
+
return /* @__PURE__ */ O("svg", {
|
|
2446
|
+
className: "h-3.5 w-3.5 text-accent",
|
|
2447
|
+
fill: "none",
|
|
2448
|
+
stroke: "currentColor",
|
|
2449
|
+
strokeLinecap: "round",
|
|
2450
|
+
strokeLinejoin: "round",
|
|
2451
|
+
strokeWidth: 2,
|
|
2452
|
+
viewBox: "0 0 16 16",
|
|
2453
|
+
children: /* @__PURE__ */ O("path", { d: "M3.5 8l3 3 6-6" })
|
|
2454
|
+
});
|
|
2455
|
+
}
|
|
2456
|
+
function Mt({ filtered: n, glass: r, onSearchChange: i, onToggle: a, searchQuery: o, searchRef: s, value: c }) {
|
|
2457
|
+
return /* @__PURE__ */ k("div", {
|
|
2458
|
+
className: e("absolute left-0 right-0 z-50 mt-1 animate-popup gds-radius-popover border gds-shadow-lg", r ? e(t(r), "border-white/10 bg-bg/60") : "border-border bg-surface"),
|
|
2459
|
+
children: [/* @__PURE__ */ O("div", {
|
|
2460
|
+
className: "border-b border-border p-1.5",
|
|
2461
|
+
children: /* @__PURE__ */ O("input", {
|
|
2462
|
+
className: "w-full bg-transparent px-2 py-1 text-sm text-fg outline-none placeholder:text-fg-muted/50",
|
|
2463
|
+
onChange: (e) => i(e.target.value),
|
|
2464
|
+
placeholder: "Search...",
|
|
2465
|
+
ref: s,
|
|
2466
|
+
type: "text",
|
|
2467
|
+
value: o
|
|
2468
|
+
})
|
|
2469
|
+
}), /* @__PURE__ */ k("div", {
|
|
2470
|
+
className: "max-h-60 overflow-y-auto py-1",
|
|
2471
|
+
children: [n.length === 0 && /* @__PURE__ */ O("div", {
|
|
2472
|
+
className: "gds-pad-x gds-pad-y-sm text-sm text-fg-muted",
|
|
2473
|
+
children: "No results"
|
|
2474
|
+
}), n.map((t) => {
|
|
2475
|
+
let n = c.includes(t.value);
|
|
2476
|
+
return /* @__PURE__ */ k("button", {
|
|
2477
|
+
className: e("flex w-full items-center gap-2 gds-pad-x gds-pad-y-sm text-left text-sm transition-colors", n && "text-accent", !n && "text-fg hover:bg-bg-tertiary"),
|
|
2478
|
+
onClick: () => a(t.value),
|
|
2479
|
+
type: "button",
|
|
2480
|
+
children: [/* @__PURE__ */ O("span", {
|
|
2481
|
+
className: e("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors", n ? "border-accent bg-accent/10" : "border-border"),
|
|
2482
|
+
children: n && /* @__PURE__ */ O(jt, {})
|
|
2483
|
+
}), t.label]
|
|
2484
|
+
}, t.value);
|
|
2485
|
+
})]
|
|
2486
|
+
})]
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
//#endregion
|
|
2490
|
+
//#region src/l4-molecules/multi-select.tsx
|
|
2491
|
+
function Nt({ open: t }) {
|
|
2492
|
+
return /* @__PURE__ */ O("svg", {
|
|
2493
|
+
className: e("h-3 w-3 shrink-0 text-fg-muted transition-transform", t && "rotate-180"),
|
|
2494
|
+
fill: "none",
|
|
2495
|
+
stroke: "currentColor",
|
|
2496
|
+
strokeLinecap: "round",
|
|
2497
|
+
strokeLinejoin: "round",
|
|
2498
|
+
strokeWidth: 2,
|
|
2499
|
+
viewBox: "0 0 12 12",
|
|
2500
|
+
children: /* @__PURE__ */ O("path", { d: "M3 4.5l3 3 3-3" })
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
var Pt = x(function({ className: n, disabled: r = !1, error: a = !1, glass: o, maxDisplay: s = 3, onChange: c, options: l, placeholder: u = "Select...", value: d }, f) {
|
|
2504
|
+
let [p, m] = E(!1), [h, g] = E(""), v = T(null), y = T(null), x = f ?? v, C = w(() => {
|
|
2505
|
+
if (h === "") return l;
|
|
2506
|
+
let e = h.toLowerCase();
|
|
2507
|
+
return l.filter((t) => t.label.toLowerCase().includes(e));
|
|
2508
|
+
}, [l, h]), D = w(() => l.filter((e) => d.includes(e.value)), [l, d]), A = S(() => {
|
|
2509
|
+
r || (m(!0), g(""), requestAnimationFrame(() => {
|
|
2510
|
+
y.current?.focus();
|
|
2511
|
+
}));
|
|
2512
|
+
}, [r]), j = S(() => {
|
|
2513
|
+
m(!1), g("");
|
|
2514
|
+
}, []), M = S((e) => {
|
|
2515
|
+
d.includes(e) ? c(d.filter((t) => t !== e)) : c([...d, e]);
|
|
2516
|
+
}, [c, d]);
|
|
2517
|
+
b(x, p, j), _(p, j);
|
|
2518
|
+
let N = D.slice(0, s), P = D.length - s;
|
|
2519
|
+
return /* @__PURE__ */ k("div", {
|
|
2520
|
+
ref: x,
|
|
2521
|
+
className: e("relative", n),
|
|
2522
|
+
"data-component": "multi-select",
|
|
2523
|
+
"data-state": p ? "open" : "closed",
|
|
2524
|
+
children: [/* @__PURE__ */ k("button", {
|
|
2525
|
+
className: e("flex w-full items-center justify-between gap-1 gds-h gds-radius-popover gds-pad-x border bg-transparent text-left text-sm text-fg transition-colors", i, !a && "border-border hover:border-fg-muted", a && "border-danger", a && "focus-visible:ring-danger", r && "cursor-not-allowed opacity-50", t(o), o === !0 && "border-white/10 bg-bg/60"),
|
|
2526
|
+
disabled: r,
|
|
2527
|
+
onClick: A,
|
|
2528
|
+
type: "button",
|
|
2529
|
+
children: [/* @__PURE__ */ k("span", {
|
|
2530
|
+
className: "flex min-w-0 flex-1 flex-wrap items-center gap-1",
|
|
2531
|
+
children: [
|
|
2532
|
+
D.length === 0 && /* @__PURE__ */ O("span", {
|
|
2533
|
+
className: "text-fg-muted",
|
|
2534
|
+
children: u
|
|
2535
|
+
}),
|
|
2536
|
+
N.map((e) => /* @__PURE__ */ O("span", {
|
|
2537
|
+
className: "inline-flex max-w-[120px] items-center truncate rounded bg-accent/10 px-1.5 py-0.5 text-xs text-accent",
|
|
2538
|
+
children: e.label
|
|
2539
|
+
}, e.value)),
|
|
2540
|
+
P > 0 && /* @__PURE__ */ k("span", {
|
|
2541
|
+
className: "text-xs text-fg-muted",
|
|
2542
|
+
children: [
|
|
2543
|
+
"+",
|
|
2544
|
+
P,
|
|
2545
|
+
" more"
|
|
2546
|
+
]
|
|
2547
|
+
})
|
|
2548
|
+
]
|
|
2549
|
+
}), /* @__PURE__ */ O(Nt, { open: p })]
|
|
2550
|
+
}), p && /* @__PURE__ */ O(Mt, {
|
|
2551
|
+
filtered: C,
|
|
2552
|
+
glass: o,
|
|
2553
|
+
onSearchChange: g,
|
|
2554
|
+
onToggle: M,
|
|
2555
|
+
searchQuery: h,
|
|
2556
|
+
searchRef: y,
|
|
2557
|
+
value: d
|
|
2558
|
+
})]
|
|
2559
|
+
});
|
|
2560
|
+
}), Ft = x(function({ icon: t, label: n, active: r, badge: i, onClick: a, collapsed: o, className: s }, c) {
|
|
2561
|
+
return /* @__PURE__ */ k("button", {
|
|
2562
|
+
ref: c,
|
|
2563
|
+
type: "button",
|
|
2564
|
+
onClick: a,
|
|
2565
|
+
title: o === !0 ? n : void 0,
|
|
2566
|
+
className: e("relative flex w-full items-center gap-3 gds-pad-x gds-pad-y-sm gds-text-body select-none", "hover:bg-bg-tertiary transition-colors", r === !0 && "bg-accent/10 text-accent font-medium", r !== !0 && "text-fg-muted", o === !0 && "justify-center", s),
|
|
2567
|
+
"data-component": "nav-item",
|
|
2568
|
+
"data-state": r === !0 ? "active" : void 0,
|
|
2569
|
+
children: [
|
|
2570
|
+
t !== void 0 && /* @__PURE__ */ O("span", {
|
|
2571
|
+
className: "shrink-0",
|
|
2572
|
+
children: t
|
|
2573
|
+
}),
|
|
2574
|
+
o !== !0 && /* @__PURE__ */ O("span", {
|
|
2575
|
+
className: "flex-1 truncate text-left",
|
|
2576
|
+
children: n
|
|
2577
|
+
}),
|
|
2578
|
+
i !== void 0 && i > 0 && /* @__PURE__ */ O("span", {
|
|
2579
|
+
className: "inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-accent px-1 text-[10px] font-bold text-accent-fg",
|
|
2580
|
+
children: i > 99 ? "99+" : i
|
|
2581
|
+
})
|
|
2582
|
+
]
|
|
2583
|
+
});
|
|
2584
|
+
}), It = x(function({ unread: t, onClick: n, className: r }, a) {
|
|
2585
|
+
return /* @__PURE__ */ k("button", {
|
|
2586
|
+
ref: a,
|
|
2587
|
+
type: "button",
|
|
2588
|
+
className: e("relative inline-flex h-8 w-8 items-center justify-center gds-radius-button text-fg-muted transition-colors select-none hover:bg-bg-tertiary hover:text-fg", i, r),
|
|
2589
|
+
"data-component": "notification-bell",
|
|
2590
|
+
onClick: n,
|
|
2591
|
+
"aria-label": `Notifications${t > 0 ? ` (${t} unread)` : ""}`,
|
|
2592
|
+
children: [/* @__PURE__ */ k("svg", {
|
|
2593
|
+
width: "18",
|
|
2594
|
+
height: "18",
|
|
2595
|
+
viewBox: "0 0 24 24",
|
|
2596
|
+
fill: "none",
|
|
2597
|
+
stroke: "currentColor",
|
|
2598
|
+
strokeWidth: "1.5",
|
|
2599
|
+
strokeLinecap: "round",
|
|
2600
|
+
strokeLinejoin: "round",
|
|
2601
|
+
className: e(t > 0 && "animate-pulse"),
|
|
2602
|
+
children: [/* @__PURE__ */ O("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }), /* @__PURE__ */ O("path", { d: "M13.73 21a2 2 0 0 1-3.46 0" })]
|
|
2603
|
+
}), t > 0 && /* @__PURE__ */ O("span", {
|
|
2604
|
+
className: "absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-danger px-1 text-[10px] font-medium text-white",
|
|
2605
|
+
children: t > 99 ? "99+" : t
|
|
2606
|
+
})]
|
|
2607
|
+
});
|
|
2608
|
+
}), Lt = {
|
|
2609
|
+
danger: "bg-danger text-white",
|
|
2610
|
+
accent: "bg-accent text-accent-fg"
|
|
2611
|
+
}, Rt = x(function({ children: t, count: n = 0, max: r = 99, variant: i = "danger", className: a, ...o }, s) {
|
|
2612
|
+
let c = n > 0, l = n > r ? `${r}+` : String(n);
|
|
2613
|
+
return /* @__PURE__ */ k("div", {
|
|
2614
|
+
ref: s,
|
|
2615
|
+
className: e("relative inline-flex", a),
|
|
2616
|
+
"data-component": "notification-dot",
|
|
2617
|
+
...o,
|
|
2618
|
+
children: [t, c && /* @__PURE__ */ O("span", {
|
|
2619
|
+
className: e("absolute -right-1.5 -top-1.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-bold leading-none", Lt[i]),
|
|
2620
|
+
children: l
|
|
2621
|
+
})]
|
|
2622
|
+
});
|
|
2623
|
+
}), zt = x(function({ items: t, onSelect: n, className: r, ...a }, o) {
|
|
2624
|
+
let [s, c] = E(!1), l = T(null);
|
|
2625
|
+
return b(l, s, () => c(!1)), _(s, () => c(!1)), /* @__PURE__ */ k("div", {
|
|
2626
|
+
ref: g(o, l),
|
|
2627
|
+
className: e("relative inline-flex", r),
|
|
2628
|
+
"data-component": "overflow-menu",
|
|
2629
|
+
"data-state": s ? "open" : "closed",
|
|
2630
|
+
...a,
|
|
2631
|
+
children: [/* @__PURE__ */ O("button", {
|
|
2632
|
+
type: "button",
|
|
2633
|
+
onClick: () => c((e) => !e),
|
|
2634
|
+
"aria-label": "More options",
|
|
2635
|
+
className: e("select-none rounded px-2 py-1 text-sm text-fg-muted hover:bg-bg-tertiary transition-colors", i),
|
|
2636
|
+
children: "..."
|
|
2637
|
+
}), s && /* @__PURE__ */ O("div", {
|
|
2638
|
+
className: "absolute right-0 top-full z-50 mt-1 min-w-[140px] animate-popup gds-radius-popover border border-border bg-surface py-1 gds-shadow-lg",
|
|
2639
|
+
children: t.map((t) => /* @__PURE__ */ O("button", {
|
|
2640
|
+
type: "button",
|
|
2641
|
+
onClick: () => {
|
|
2642
|
+
n(t.id), c(!1);
|
|
2643
|
+
},
|
|
2644
|
+
className: e("flex w-full items-center gds-pad-x gds-pad-y-sm gds-text-body text-fg hover:bg-bg-tertiary transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
2645
|
+
children: t.label
|
|
2646
|
+
}, t.id))
|
|
2647
|
+
})]
|
|
2648
|
+
});
|
|
2649
|
+
}), W = e("flex items-center gap-1.5 gds-radius-button gds-pad-x gds-pad-y gds-text-body text-fg-muted hover:text-fg transition-colors", i), Bt = x(function({ prev: t, next: n, className: r, ...i }, a) {
|
|
2650
|
+
return /* @__PURE__ */ k("nav", {
|
|
2651
|
+
ref: a,
|
|
2652
|
+
className: e("flex w-full items-center justify-between", r),
|
|
2653
|
+
"data-component": "page-nav",
|
|
2654
|
+
...i,
|
|
2655
|
+
children: [/* @__PURE__ */ O("div", { children: t !== void 0 && /* @__PURE__ */ k("a", {
|
|
2656
|
+
href: t.href,
|
|
2657
|
+
onClick: t.onClick,
|
|
2658
|
+
className: W,
|
|
2659
|
+
children: [/* @__PURE__ */ O("svg", {
|
|
2660
|
+
width: "14",
|
|
2661
|
+
height: "14",
|
|
2662
|
+
viewBox: "0 0 14 14",
|
|
2663
|
+
fill: "none",
|
|
2664
|
+
stroke: "currentColor",
|
|
2665
|
+
strokeWidth: "2",
|
|
2666
|
+
strokeLinecap: "round",
|
|
2667
|
+
strokeLinejoin: "round",
|
|
2668
|
+
children: /* @__PURE__ */ O("path", { d: "M9 3L5 7l4 4" })
|
|
2669
|
+
}), t.label]
|
|
2670
|
+
}) }), /* @__PURE__ */ O("div", { children: n !== void 0 && /* @__PURE__ */ k("a", {
|
|
2671
|
+
href: n.href,
|
|
2672
|
+
onClick: n.onClick,
|
|
2673
|
+
className: W,
|
|
2674
|
+
children: [n.label, /* @__PURE__ */ O("svg", {
|
|
2675
|
+
width: "14",
|
|
2676
|
+
height: "14",
|
|
2677
|
+
viewBox: "0 0 14 14",
|
|
2678
|
+
fill: "none",
|
|
2679
|
+
stroke: "currentColor",
|
|
2680
|
+
strokeWidth: "2",
|
|
2681
|
+
strokeLinecap: "round",
|
|
2682
|
+
strokeLinejoin: "round",
|
|
2683
|
+
children: /* @__PURE__ */ O("path", { d: "M5 3l4 4-4 4" })
|
|
2684
|
+
})]
|
|
2685
|
+
}) })]
|
|
2686
|
+
});
|
|
2687
|
+
});
|
|
2688
|
+
//#endregion
|
|
2689
|
+
//#region src/l4-molecules/pagination.tsx
|
|
2690
|
+
function G(e, t) {
|
|
2691
|
+
let n = [];
|
|
2692
|
+
for (let r = e; r <= t; r++) n.push(r);
|
|
2693
|
+
return n;
|
|
2694
|
+
}
|
|
2695
|
+
var Vt = x(function({ page: t, totalPages: n, onPageChange: r, siblings: a = 1, className: o, ...s }, c) {
|
|
2696
|
+
let l = w(() => {
|
|
2697
|
+
let e = n;
|
|
2698
|
+
if (e <= a + 3 + 2) return G(1, e);
|
|
2699
|
+
let r = Math.max(t - a, 2), i = Math.min(t + a, e - 1), o = r > 2, s = i < e - 1, c = G(r, i), l = [1];
|
|
2700
|
+
return o && l.push("dots-l"), l.push(...c), s && l.push("dots-r"), l.push(e), l;
|
|
2701
|
+
}, [
|
|
2702
|
+
t,
|
|
2703
|
+
n,
|
|
2704
|
+
a
|
|
2705
|
+
]), u = (e) => /* @__PURE__ */ O("svg", {
|
|
2706
|
+
width: "14",
|
|
2707
|
+
height: "14",
|
|
2708
|
+
viewBox: "0 0 14 14",
|
|
2709
|
+
fill: "none",
|
|
2710
|
+
stroke: "currentColor",
|
|
2711
|
+
strokeWidth: "2",
|
|
2712
|
+
strokeLinecap: "round",
|
|
2713
|
+
strokeLinejoin: "round",
|
|
2714
|
+
children: /* @__PURE__ */ O("path", { d: e === "left" ? "M9 3L5 7l4 4" : "M5 3l4 4-4 4" })
|
|
2715
|
+
}), d = e("inline-flex gds-sq items-center justify-center gds-radius-button gds-text-body select-none", i);
|
|
2716
|
+
return /* @__PURE__ */ k("nav", {
|
|
2717
|
+
ref: c,
|
|
2718
|
+
className: e("flex items-center gds-gap-xs", o),
|
|
2719
|
+
"data-component": "pagination",
|
|
2720
|
+
"aria-label": "Pagination",
|
|
2721
|
+
...s,
|
|
2722
|
+
children: [
|
|
2723
|
+
/* @__PURE__ */ O("button", {
|
|
2724
|
+
type: "button",
|
|
2725
|
+
className: e(d, "text-fg-muted", t <= 1 ? "pointer-events-none opacity-40" : "hover:bg-bg-secondary"),
|
|
2726
|
+
disabled: t <= 1,
|
|
2727
|
+
onClick: () => r(t - 1),
|
|
2728
|
+
"aria-label": "Previous page",
|
|
2729
|
+
children: u("left")
|
|
2730
|
+
}),
|
|
2731
|
+
l.map((n) => {
|
|
2732
|
+
if (n === "dots-l" || n === "dots-r") return /* @__PURE__ */ O("span", {
|
|
2733
|
+
className: "inline-flex gds-sq items-center justify-center gds-text-body text-fg-muted select-none",
|
|
2734
|
+
children: "…"
|
|
2735
|
+
}, n);
|
|
2736
|
+
let i = n === t;
|
|
2737
|
+
return /* @__PURE__ */ O("button", {
|
|
2738
|
+
type: "button",
|
|
2739
|
+
className: e(d, i ? "bg-accent font-medium text-accent-fg" : "text-fg-muted hover:bg-bg-secondary hover:text-fg"),
|
|
2740
|
+
"aria-current": i ? "page" : void 0,
|
|
2741
|
+
onClick: () => r(n),
|
|
2742
|
+
children: n
|
|
2743
|
+
}, n);
|
|
2744
|
+
}),
|
|
2745
|
+
/* @__PURE__ */ O("button", {
|
|
2746
|
+
type: "button",
|
|
2747
|
+
className: e(d, "text-fg-muted", t >= n ? "pointer-events-none opacity-40" : "hover:bg-bg-secondary"),
|
|
2748
|
+
disabled: t >= n,
|
|
2749
|
+
onClick: () => r(t + 1),
|
|
2750
|
+
"aria-label": "Next page",
|
|
2751
|
+
children: u("right")
|
|
2752
|
+
})
|
|
2753
|
+
]
|
|
2754
|
+
});
|
|
2755
|
+
});
|
|
2756
|
+
//#endregion
|
|
2757
|
+
//#region src/l4-molecules/panel.tsx
|
|
2758
|
+
function Ht({ open: t }) {
|
|
2759
|
+
return /* @__PURE__ */ O("svg", {
|
|
2760
|
+
className: e("h-3.5 w-3.5 shrink-0 text-fg-muted transition-transform duration-200", t && "rotate-90"),
|
|
2761
|
+
fill: "none",
|
|
2762
|
+
stroke: "currentColor",
|
|
2763
|
+
strokeLinecap: "round",
|
|
2764
|
+
strokeWidth: 2,
|
|
2765
|
+
viewBox: "0 0 24 24",
|
|
2766
|
+
children: /* @__PURE__ */ O("path", { d: "M9 5l7 7-7 7" })
|
|
2767
|
+
});
|
|
2768
|
+
}
|
|
2769
|
+
var Ut = x(function({ children: n, className: r, collapsible: a = !0, defaultOpen: o = !0, glass: s, headerAction: c, title: l, ...u }, d) {
|
|
2770
|
+
let [f, p] = E(o), m = a ? f : !0;
|
|
2771
|
+
return /* @__PURE__ */ k("div", {
|
|
2772
|
+
className: e("gds-ctx gds-radius-popover border border-border bg-surface", t(s), s === !0 && "border-white/10 bg-white/5", r),
|
|
2773
|
+
"data-component": "panel",
|
|
2774
|
+
"data-state": m ? "open" : "closed",
|
|
2775
|
+
ref: d,
|
|
2776
|
+
...u,
|
|
2777
|
+
children: [/* @__PURE__ */ k("div", {
|
|
2778
|
+
className: "flex items-center border-b border-border gds-pad-x gds-pad-y-sm",
|
|
2779
|
+
children: [a ? /* @__PURE__ */ k("button", {
|
|
2780
|
+
className: e("flex flex-1 items-center gap-2 text-left text-sm font-medium text-fg", i),
|
|
2781
|
+
onClick: () => p((e) => !e),
|
|
2782
|
+
type: "button",
|
|
2783
|
+
children: [/* @__PURE__ */ O(Ht, { open: m }), /* @__PURE__ */ O("span", { children: l })]
|
|
2784
|
+
}) : /* @__PURE__ */ O("span", {
|
|
2785
|
+
className: "flex-1 text-sm font-medium text-fg",
|
|
2786
|
+
children: l
|
|
2787
|
+
}), c !== void 0 && /* @__PURE__ */ O("div", {
|
|
2788
|
+
className: "ml-2 shrink-0",
|
|
2789
|
+
children: c
|
|
2790
|
+
})]
|
|
2791
|
+
}), m && /* @__PURE__ */ O("div", {
|
|
2792
|
+
className: "gds-pad-x gds-pad-y",
|
|
2793
|
+
children: n
|
|
2794
|
+
})]
|
|
2795
|
+
});
|
|
2796
|
+
});
|
|
2797
|
+
//#endregion
|
|
2798
|
+
//#region src/l4-molecules/password-input.tsx
|
|
2799
|
+
function Wt(e) {
|
|
2800
|
+
if (e.length === 0) return "none";
|
|
2801
|
+
let t = 0;
|
|
2802
|
+
return e.length >= 8 && (t += 1), /[a-z]/.test(e) && /[A-Z]/.test(e) && (t += 1), /\d/.test(e) && (t += 1), /[^a-zA-Z0-9]/.test(e) && (t += 1), t <= 1 ? "weak" : t <= 2 ? "fair" : "strong";
|
|
2803
|
+
}
|
|
2804
|
+
var K = {
|
|
2805
|
+
weak: {
|
|
2806
|
+
label: "Weak",
|
|
2807
|
+
value: 33,
|
|
2808
|
+
variant: "danger"
|
|
2809
|
+
},
|
|
2810
|
+
fair: {
|
|
2811
|
+
label: "Fair",
|
|
2812
|
+
value: 66,
|
|
2813
|
+
variant: "warning"
|
|
2814
|
+
},
|
|
2815
|
+
strong: {
|
|
2816
|
+
label: "Strong",
|
|
2817
|
+
value: 100,
|
|
2818
|
+
variant: "success"
|
|
2819
|
+
}
|
|
2820
|
+
}, Gt = /* @__PURE__ */ k("svg", {
|
|
2821
|
+
viewBox: "0 0 24 24",
|
|
2822
|
+
fill: "none",
|
|
2823
|
+
stroke: "currentColor",
|
|
2824
|
+
strokeWidth: "2",
|
|
2825
|
+
strokeLinecap: "round",
|
|
2826
|
+
strokeLinejoin: "round",
|
|
2827
|
+
children: [/* @__PURE__ */ O("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }), /* @__PURE__ */ O("circle", {
|
|
2828
|
+
cx: "12",
|
|
2829
|
+
cy: "12",
|
|
2830
|
+
r: "3"
|
|
2831
|
+
})]
|
|
2832
|
+
}), Kt = /* @__PURE__ */ k("svg", {
|
|
2833
|
+
viewBox: "0 0 24 24",
|
|
2834
|
+
fill: "none",
|
|
2835
|
+
stroke: "currentColor",
|
|
2836
|
+
strokeWidth: "2",
|
|
2837
|
+
strokeLinecap: "round",
|
|
2838
|
+
strokeLinejoin: "round",
|
|
2839
|
+
children: [/* @__PURE__ */ O("path", { d: "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24" }), /* @__PURE__ */ O("line", {
|
|
2840
|
+
x1: "1",
|
|
2841
|
+
y1: "1",
|
|
2842
|
+
x2: "23",
|
|
2843
|
+
y2: "23"
|
|
2844
|
+
})]
|
|
2845
|
+
}), qt = x(function({ className: t, showStrength: n = !1, ...r }, i) {
|
|
2846
|
+
let [a, s] = E(!1), c = typeof r.value == "string" ? r.value : "", u = n ? Wt(c) : "none", d = /* @__PURE__ */ O("button", {
|
|
2847
|
+
"aria-label": a ? "Hide password" : "Show password",
|
|
2848
|
+
className: "cursor-pointer text-fg-muted/50 hover:text-fg-muted",
|
|
2849
|
+
onClick: () => s((e) => !e),
|
|
2850
|
+
tabIndex: -1,
|
|
2851
|
+
type: "button",
|
|
2852
|
+
children: a ? Kt : Gt
|
|
2853
|
+
});
|
|
2854
|
+
return /* @__PURE__ */ k("div", {
|
|
2855
|
+
className: e("flex flex-col gap-1.5", t),
|
|
2856
|
+
"data-component": "password-input",
|
|
2857
|
+
children: [/* @__PURE__ */ O(o, {
|
|
2858
|
+
...r,
|
|
2859
|
+
ref: i,
|
|
2860
|
+
rightIcon: d,
|
|
2861
|
+
type: a ? "text" : "password"
|
|
2862
|
+
}), n && u !== "none" && /* @__PURE__ */ k("div", {
|
|
2863
|
+
className: "flex items-center gap-2",
|
|
2864
|
+
children: [/* @__PURE__ */ O(l, {
|
|
2865
|
+
size: "sm",
|
|
2866
|
+
value: K[u].value,
|
|
2867
|
+
variant: K[u].variant
|
|
2868
|
+
}), /* @__PURE__ */ O("span", {
|
|
2869
|
+
className: "shrink-0 text-[10px] text-fg-muted select-none",
|
|
2870
|
+
children: K[u].label
|
|
2871
|
+
})]
|
|
2872
|
+
})]
|
|
2873
|
+
});
|
|
2874
|
+
}), Jt = [
|
|
2875
|
+
{
|
|
2876
|
+
code: "+1",
|
|
2877
|
+
label: "US",
|
|
2878
|
+
flag: "🇺🇸"
|
|
2879
|
+
},
|
|
2880
|
+
{
|
|
2881
|
+
code: "+44",
|
|
2882
|
+
label: "UK",
|
|
2883
|
+
flag: "🇬🇧"
|
|
2884
|
+
},
|
|
2885
|
+
{
|
|
2886
|
+
code: "+81",
|
|
2887
|
+
label: "JP",
|
|
2888
|
+
flag: "🇯🇵"
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
code: "+86",
|
|
2892
|
+
label: "CN",
|
|
2893
|
+
flag: "🇨🇳"
|
|
2894
|
+
},
|
|
2895
|
+
{
|
|
2896
|
+
code: "+82",
|
|
2897
|
+
label: "KR",
|
|
2898
|
+
flag: "🇰🇷"
|
|
2899
|
+
}
|
|
2900
|
+
], Yt = x(function({ value: t, onChange: n, defaultCountry: r = "+81", countries: a, disabled: o = !1, error: s = !1, placeholder: c = "Phone number", className: l }, u) {
|
|
2901
|
+
let d = a ?? Jt, [f, p] = E(r), [m, h] = E(!1), g = T(null);
|
|
2902
|
+
b(g, m, () => h(!1));
|
|
2903
|
+
let _ = d.find((e) => e.code === f) ?? d[0], v = S((e) => {
|
|
2904
|
+
p(e), h(!1);
|
|
2905
|
+
}, []), y = S((e) => {
|
|
2906
|
+
n(e.replace(/[^\d-]/g, ""));
|
|
2907
|
+
}, [n]);
|
|
2908
|
+
return /* @__PURE__ */ k("div", {
|
|
2909
|
+
ref: u,
|
|
2910
|
+
className: e("relative inline-flex items-stretch gds-h gds-radius-input border", s ? "border-danger" : "border-border", o && "cursor-not-allowed opacity-40", l),
|
|
2911
|
+
"data-component": "phone-input",
|
|
2912
|
+
"data-disabled": o ? "" : void 0,
|
|
2913
|
+
"data-error": s ? "" : void 0,
|
|
2914
|
+
children: [/* @__PURE__ */ k("div", {
|
|
2915
|
+
ref: g,
|
|
2916
|
+
className: "relative",
|
|
2917
|
+
children: [/* @__PURE__ */ k("button", {
|
|
2918
|
+
type: "button",
|
|
2919
|
+
disabled: o,
|
|
2920
|
+
className: e("flex h-full items-center gap-1 border-r border-border px-2 text-sm select-none", "hover:bg-white/5 transition-colors gds-radius-input rounded-r-none", i),
|
|
2921
|
+
onClick: () => h((e) => !e),
|
|
2922
|
+
"aria-label": "Select country code",
|
|
2923
|
+
children: [/* @__PURE__ */ O("span", { children: _?.flag }), /* @__PURE__ */ O("span", {
|
|
2924
|
+
className: "text-fg-muted gds-text-body",
|
|
2925
|
+
children: _?.code
|
|
2926
|
+
})]
|
|
2927
|
+
}), m && /* @__PURE__ */ O("div", {
|
|
2928
|
+
className: "absolute left-0 top-full z-50 mt-1 min-w-[140px] animate-popup rounded-lg border border-border bg-surface shadow-lg",
|
|
2929
|
+
children: d.map((t) => /* @__PURE__ */ k("button", {
|
|
2930
|
+
type: "button",
|
|
2931
|
+
className: e("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm hover:bg-white/5 transition-colors", t.code === f && "bg-accent/10 text-accent"),
|
|
2932
|
+
onClick: () => v(t.code),
|
|
2933
|
+
children: [
|
|
2934
|
+
/* @__PURE__ */ O("span", { children: t.flag }),
|
|
2935
|
+
/* @__PURE__ */ O("span", {
|
|
2936
|
+
className: "text-fg-muted",
|
|
2937
|
+
children: t.label
|
|
2938
|
+
}),
|
|
2939
|
+
/* @__PURE__ */ O("span", {
|
|
2940
|
+
className: "ml-auto text-fg-muted/60",
|
|
2941
|
+
children: t.code
|
|
2942
|
+
})
|
|
2943
|
+
]
|
|
2944
|
+
}, t.code))
|
|
2945
|
+
})]
|
|
2946
|
+
}), /* @__PURE__ */ O("input", {
|
|
2947
|
+
type: "tel",
|
|
2948
|
+
value: t,
|
|
2949
|
+
onChange: (e) => y(e.target.value),
|
|
2950
|
+
disabled: o,
|
|
2951
|
+
placeholder: c,
|
|
2952
|
+
className: e("flex-1 bg-transparent px-3 text-fg gds-text-body focus:outline-none", i),
|
|
2953
|
+
"aria-label": "Phone number"
|
|
2954
|
+
})]
|
|
2955
|
+
});
|
|
2956
|
+
}), Xt = x(function({ className: t, disabled: n = !1, error: r = !1, length: a = 4, mask: o = !1, numeric: s = !1, onChange: c, onComplete: l, value: u, ...d }, f) {
|
|
2957
|
+
let [p, m] = E(() => Array.from({ length: a }, () => "")), h = u !== void 0, g = T([]), _ = S((e) => (t) => {
|
|
2958
|
+
g.current[e] = t;
|
|
2959
|
+
}, []), v = S((e) => {
|
|
2960
|
+
g.current[e]?.focus();
|
|
2961
|
+
}, []), y = () => h ? Array.from({ length: a }, (e, t) => u[t] ?? "") : p, b = S((e, t) => {
|
|
2962
|
+
l !== void 0 && (h ? e.length === a && l(e) : t !== void 0 && t.every((e) => e !== "") && t.join("").length === a && l(t.join("")));
|
|
2963
|
+
}, [
|
|
2964
|
+
h,
|
|
2965
|
+
a,
|
|
2966
|
+
l
|
|
2967
|
+
]), x = S((e, t) => {
|
|
2968
|
+
if (t.length === 1 && !(s && !/^\d$/.test(t))) {
|
|
2969
|
+
if (h) {
|
|
2970
|
+
let n = (u ?? "").split("");
|
|
2971
|
+
for (; n.length < e;) n.push("");
|
|
2972
|
+
n[e] = t;
|
|
2973
|
+
let r = n.join("");
|
|
2974
|
+
c !== void 0 && c(r), b(r);
|
|
2975
|
+
} else {
|
|
2976
|
+
let n = [...p];
|
|
2977
|
+
n[e] = t, m(n), b("", n);
|
|
2978
|
+
}
|
|
2979
|
+
e < a - 1 && v(e + 1);
|
|
2980
|
+
}
|
|
2981
|
+
}, [
|
|
2982
|
+
u,
|
|
2983
|
+
a,
|
|
2984
|
+
s,
|
|
2985
|
+
h,
|
|
2986
|
+
p,
|
|
2987
|
+
c,
|
|
2988
|
+
b,
|
|
2989
|
+
v
|
|
2990
|
+
]), C = S((e, t) => {
|
|
2991
|
+
if (t.key === "Backspace") if (t.preventDefault(), h) {
|
|
2992
|
+
let t = (u ?? "").split("");
|
|
2993
|
+
t[e] !== void 0 && t[e] !== "" ? (t[e] = "", c !== void 0 && c(t.join("").replace(/\s+$/, ""))) : e > 0 && (t.splice(e - 1, 1), c !== void 0 && c(t.join("")), v(e - 1));
|
|
2994
|
+
} else {
|
|
2995
|
+
let t = [...p];
|
|
2996
|
+
t[e] === "" ? e > 0 && (t[e - 1] = "", m(t), v(e - 1)) : (t[e] = "", m(t));
|
|
2997
|
+
}
|
|
2998
|
+
}, [
|
|
2999
|
+
u,
|
|
3000
|
+
h,
|
|
3001
|
+
p,
|
|
3002
|
+
c,
|
|
3003
|
+
v
|
|
3004
|
+
]), w = S((e) => {
|
|
3005
|
+
e.preventDefault();
|
|
3006
|
+
let t = e.clipboardData.getData("text").slice(0, a);
|
|
3007
|
+
if (s && (t = t.replace(/\D/g, "")), t.length !== 0) {
|
|
3008
|
+
if (h) c !== void 0 && c(t), b(t);
|
|
3009
|
+
else {
|
|
3010
|
+
let e = Array.from({ length: a }, (e, n) => t[n] ?? "");
|
|
3011
|
+
m(e), b("", e);
|
|
3012
|
+
}
|
|
3013
|
+
v(Math.min(t.length, a - 1));
|
|
3014
|
+
}
|
|
3015
|
+
}, [
|
|
3016
|
+
a,
|
|
3017
|
+
s,
|
|
3018
|
+
h,
|
|
3019
|
+
c,
|
|
3020
|
+
b,
|
|
3021
|
+
v
|
|
3022
|
+
]), D = y();
|
|
3023
|
+
return /* @__PURE__ */ O("div", {
|
|
3024
|
+
className: e("flex gap-2", r && "animate-shake", t),
|
|
3025
|
+
"data-component": "pin-input",
|
|
3026
|
+
ref: f,
|
|
3027
|
+
...d,
|
|
3028
|
+
children: Array.from({ length: a }, (t, a) => /* @__PURE__ */ O("input", {
|
|
3029
|
+
"aria-label": `${s ? "Digit" : "Pin digit"} ${a + 1}`,
|
|
3030
|
+
autoComplete: s ? "one-time-code" : void 0,
|
|
3031
|
+
className: e("h-10 w-10 rounded-md border bg-bg text-center text-sm text-fg transition-colors outline-none", s && "h-12 font-mono text-lg tabular-nums", r ? "border-danger" : "border-border hover:border-border-strong", i, n && "cursor-not-allowed opacity-50"),
|
|
3032
|
+
disabled: n,
|
|
3033
|
+
inputMode: s ? "numeric" : void 0,
|
|
3034
|
+
maxLength: 1,
|
|
3035
|
+
onInput: (e) => {
|
|
3036
|
+
let t = e.target, n = t.value;
|
|
3037
|
+
n.length > 0 && x(a, n[n.length - 1]), t.value = D[a] ?? "";
|
|
3038
|
+
},
|
|
3039
|
+
onKeyDown: (e) => C(a, e),
|
|
3040
|
+
onPaste: w,
|
|
3041
|
+
pattern: s ? "[0-9]*" : void 0,
|
|
3042
|
+
ref: _(a),
|
|
3043
|
+
type: o ? "password" : "text",
|
|
3044
|
+
value: o && D[a] !== void 0 && D[a] !== "" ? "•" : D[a] ?? ""
|
|
3045
|
+
}, a))
|
|
3046
|
+
});
|
|
3047
|
+
}), Zt = {
|
|
3048
|
+
bottom: {
|
|
3049
|
+
center: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
3050
|
+
end: "top-full right-0 mt-2",
|
|
3051
|
+
start: "top-full left-0 mt-2"
|
|
3052
|
+
},
|
|
3053
|
+
left: {
|
|
3054
|
+
center: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
3055
|
+
end: "right-full bottom-0 mr-2",
|
|
3056
|
+
start: "right-full top-0 mr-2"
|
|
3057
|
+
},
|
|
3058
|
+
right: {
|
|
3059
|
+
center: "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
3060
|
+
end: "left-full bottom-0 ml-2",
|
|
3061
|
+
start: "left-full top-0 ml-2"
|
|
3062
|
+
},
|
|
3063
|
+
top: {
|
|
3064
|
+
center: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
3065
|
+
end: "bottom-full right-0 mb-2",
|
|
3066
|
+
start: "bottom-full left-0 mb-2"
|
|
3067
|
+
}
|
|
3068
|
+
}, Qt = x(function({ align: t = "start", className: n, content: r, placement: i = "bottom", trigger: a, ...o }, s) {
|
|
3069
|
+
let [c, l] = E(!1), u = T(null);
|
|
3070
|
+
return b(u, c, () => l(!1)), _(c, () => l(!1)), /* @__PURE__ */ k("div", {
|
|
3071
|
+
className: e("relative inline-flex", n),
|
|
3072
|
+
"data-component": "popover",
|
|
3073
|
+
"data-state": c ? "open" : "closed",
|
|
3074
|
+
ref: (e) => {
|
|
3075
|
+
u.current = e, typeof s == "function" ? s(e) : s != null && (s.current = e);
|
|
3076
|
+
},
|
|
3077
|
+
...o,
|
|
3078
|
+
children: [/* @__PURE__ */ O("span", {
|
|
3079
|
+
onClick: () => l((e) => !e),
|
|
3080
|
+
role: "button",
|
|
3081
|
+
tabIndex: 0,
|
|
3082
|
+
children: a
|
|
3083
|
+
}), c && /* @__PURE__ */ O("div", {
|
|
3084
|
+
className: e("absolute z-50 animate-popup gds-radius-popover border border-border bg-surface gds-pad-x gds-pad-y gds-shadow-lg", Zt[i]?.[t]),
|
|
3085
|
+
children: r
|
|
3086
|
+
})]
|
|
3087
|
+
});
|
|
3088
|
+
}), $t = x(function({ className: t, icon: n, label: r, trend: i, value: a, ...o }, s) {
|
|
3089
|
+
let c = i !== void 0 && i > 0 ? "text-success" : i !== void 0 && i < 0 ? "text-danger" : "text-fg-muted";
|
|
3090
|
+
return /* @__PURE__ */ k("div", {
|
|
3091
|
+
className: e("inline-flex items-center gap-3 select-none", t),
|
|
3092
|
+
"data-component": "quick-stat",
|
|
3093
|
+
ref: s,
|
|
3094
|
+
...o,
|
|
3095
|
+
children: [n !== void 0 && /* @__PURE__ */ O("div", {
|
|
3096
|
+
className: "text-fg-muted",
|
|
3097
|
+
children: n
|
|
3098
|
+
}), /* @__PURE__ */ k("div", {
|
|
3099
|
+
className: "flex flex-col",
|
|
3100
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3101
|
+
className: "flex items-baseline gap-1.5",
|
|
3102
|
+
children: [/* @__PURE__ */ O("span", {
|
|
3103
|
+
className: "text-lg font-semibold text-fg leading-tight",
|
|
3104
|
+
children: a
|
|
3105
|
+
}), i !== void 0 && /* @__PURE__ */ k("span", {
|
|
3106
|
+
className: e("text-xs font-medium", c),
|
|
3107
|
+
children: [
|
|
3108
|
+
i > 0 ? "+" : "",
|
|
3109
|
+
i,
|
|
3110
|
+
"%"
|
|
3111
|
+
]
|
|
3112
|
+
})]
|
|
3113
|
+
}), /* @__PURE__ */ O("span", {
|
|
3114
|
+
className: "text-xs text-fg-muted leading-tight",
|
|
3115
|
+
children: r
|
|
3116
|
+
})]
|
|
3117
|
+
})]
|
|
3118
|
+
});
|
|
3119
|
+
}), en = {
|
|
3120
|
+
1: "grid-cols-1",
|
|
3121
|
+
2: "grid-cols-2",
|
|
3122
|
+
3: "grid-cols-3"
|
|
3123
|
+
}, tn = x(function({ options: n, value: r, onChange: i, columns: a = 1, disabled: o, glass: s, className: c }, l) {
|
|
3124
|
+
return /* @__PURE__ */ O("div", {
|
|
3125
|
+
ref: l,
|
|
3126
|
+
className: e("grid gds-gap", en[a], c),
|
|
3127
|
+
"data-component": "radio-card",
|
|
3128
|
+
role: "radiogroup",
|
|
3129
|
+
children: n.map((n) => {
|
|
3130
|
+
let a = r === n.value;
|
|
3131
|
+
return /* @__PURE__ */ k("button", {
|
|
3132
|
+
type: "button",
|
|
3133
|
+
role: "radio",
|
|
3134
|
+
"aria-checked": a,
|
|
3135
|
+
disabled: o,
|
|
3136
|
+
onClick: () => {
|
|
3137
|
+
o !== !0 && i(n.value);
|
|
3138
|
+
},
|
|
3139
|
+
className: e("flex items-center gds-gap gds-radius-card gds-pad-x gds-pad-y text-left transition-colors", "cursor-pointer select-none", s === !0 ? e(t(s), "border border-white/10") : a ? "border border-accent bg-accent/5 ring-1 ring-accent" : "border border-border hover:border-border-strong", o === !0 && "pointer-events-none opacity-50"),
|
|
3140
|
+
"data-state": a ? "selected" : "idle",
|
|
3141
|
+
children: [
|
|
3142
|
+
/* @__PURE__ */ O("span", {
|
|
3143
|
+
className: e("flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors", a ? "border-accent bg-accent" : "border-border-strong"),
|
|
3144
|
+
children: a && /* @__PURE__ */ O("span", { className: "h-1.5 w-1.5 rounded-full bg-fg" })
|
|
3145
|
+
}),
|
|
3146
|
+
n.icon !== void 0 && /* @__PURE__ */ O("span", {
|
|
3147
|
+
className: "shrink-0 text-fg-muted",
|
|
3148
|
+
children: n.icon
|
|
3149
|
+
}),
|
|
3150
|
+
/* @__PURE__ */ k("div", {
|
|
3151
|
+
className: "min-w-0 flex-1",
|
|
3152
|
+
children: [/* @__PURE__ */ O("div", {
|
|
3153
|
+
className: "text-sm font-medium text-fg",
|
|
3154
|
+
children: n.label
|
|
3155
|
+
}), n.description !== void 0 && /* @__PURE__ */ O("div", {
|
|
3156
|
+
className: "mt-0.5 text-xs text-fg-muted",
|
|
3157
|
+
children: n.description
|
|
3158
|
+
})]
|
|
3159
|
+
})
|
|
3160
|
+
]
|
|
3161
|
+
}, n.value);
|
|
3162
|
+
})
|
|
3163
|
+
});
|
|
3164
|
+
}), nn = /* @__PURE__ */ k("svg", {
|
|
3165
|
+
viewBox: "0 0 24 24",
|
|
3166
|
+
fill: "none",
|
|
3167
|
+
stroke: "currentColor",
|
|
3168
|
+
strokeWidth: "2",
|
|
3169
|
+
strokeLinecap: "round",
|
|
3170
|
+
strokeLinejoin: "round",
|
|
3171
|
+
children: [/* @__PURE__ */ O("circle", {
|
|
3172
|
+
cx: "11",
|
|
3173
|
+
cy: "11",
|
|
3174
|
+
r: "8"
|
|
3175
|
+
}), /* @__PURE__ */ O("line", {
|
|
3176
|
+
x1: "21",
|
|
3177
|
+
y1: "21",
|
|
3178
|
+
x2: "16.65",
|
|
3179
|
+
y2: "16.65"
|
|
3180
|
+
})]
|
|
3181
|
+
}), rn = /* @__PURE__ */ k("svg", {
|
|
3182
|
+
viewBox: "0 0 24 24",
|
|
3183
|
+
fill: "none",
|
|
3184
|
+
stroke: "currentColor",
|
|
3185
|
+
strokeWidth: "2",
|
|
3186
|
+
strokeLinecap: "round",
|
|
3187
|
+
strokeLinejoin: "round",
|
|
3188
|
+
children: [/* @__PURE__ */ O("line", {
|
|
3189
|
+
x1: "18",
|
|
3190
|
+
y1: "6",
|
|
3191
|
+
x2: "6",
|
|
3192
|
+
y2: "18"
|
|
3193
|
+
}), /* @__PURE__ */ O("line", {
|
|
3194
|
+
x1: "6",
|
|
3195
|
+
y1: "6",
|
|
3196
|
+
x2: "18",
|
|
3197
|
+
y2: "18"
|
|
3198
|
+
})]
|
|
3199
|
+
}), an = x(function({ className: t, clearable: n = !0, disabled: r = !1, inputSize: i, loading: a = !1, onChange: s, onSearch: l, placeholder: u = "Search...", value: d }, f) {
|
|
3200
|
+
let p = a ? /* @__PURE__ */ O(c, { size: "sm" }) : nn, m = n && d.length > 0 ? /* @__PURE__ */ O("button", {
|
|
3201
|
+
"aria-label": "Clear search",
|
|
3202
|
+
className: "cursor-pointer text-fg-muted/50 hover:text-fg-muted",
|
|
3203
|
+
onClick: () => s(""),
|
|
3204
|
+
tabIndex: -1,
|
|
3205
|
+
type: "button",
|
|
3206
|
+
children: rn
|
|
3207
|
+
}) : void 0;
|
|
3208
|
+
return /* @__PURE__ */ O(o, {
|
|
3209
|
+
className: e(t),
|
|
3210
|
+
"data-component": "search-input",
|
|
3211
|
+
disabled: r,
|
|
3212
|
+
icon: p,
|
|
3213
|
+
inputSize: i,
|
|
3214
|
+
onChange: (e) => s(e.target.value),
|
|
3215
|
+
onKeyDown: (e) => {
|
|
3216
|
+
e.key === "Enter" && l !== void 0 && l(d);
|
|
3217
|
+
},
|
|
3218
|
+
placeholder: u,
|
|
3219
|
+
ref: f,
|
|
3220
|
+
rightIcon: m,
|
|
3221
|
+
type: "search",
|
|
3222
|
+
value: d
|
|
3223
|
+
});
|
|
3224
|
+
}), q = n(e("w-full appearance-none gds-radius-popover border bg-transparent pr-8 text-fg transition-colors", "placeholder:text-fg-muted", i), {
|
|
3225
|
+
compoundVariants: [{
|
|
3226
|
+
error: !0,
|
|
3227
|
+
className: "focus-visible:ring-danger"
|
|
3228
|
+
}],
|
|
3229
|
+
variants: {
|
|
3230
|
+
error: {
|
|
3231
|
+
true: "border-danger text-danger",
|
|
3232
|
+
false: "border-border hover:border-fg-muted"
|
|
3233
|
+
},
|
|
3234
|
+
inputSize: {
|
|
3235
|
+
default: "gds-h-lg gds-pad-x text-sm",
|
|
3236
|
+
sm: "gds-h-sm gds-pad-x-sm gds-text-body"
|
|
3237
|
+
}
|
|
3238
|
+
},
|
|
3239
|
+
defaultVariants: {
|
|
3240
|
+
error: !1,
|
|
3241
|
+
inputSize: "default"
|
|
3242
|
+
}
|
|
3243
|
+
}), on = x(function({ error: n, inputSize: r, glass: i, className: a, children: o, ...s }, c) {
|
|
3244
|
+
return /* @__PURE__ */ k("div", {
|
|
3245
|
+
className: "relative",
|
|
3246
|
+
"data-component": "select",
|
|
3247
|
+
children: [/* @__PURE__ */ O("select", {
|
|
3248
|
+
ref: c,
|
|
3249
|
+
className: e(q({
|
|
3250
|
+
error: n,
|
|
3251
|
+
inputSize: r
|
|
3252
|
+
}), t(i), a),
|
|
3253
|
+
...s,
|
|
3254
|
+
children: o
|
|
3255
|
+
}), /* @__PURE__ */ O("span", {
|
|
3256
|
+
className: "pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-fg-muted",
|
|
3257
|
+
children: /* @__PURE__ */ O("svg", {
|
|
3258
|
+
width: "12",
|
|
3259
|
+
height: "12",
|
|
3260
|
+
viewBox: "0 0 12 12",
|
|
3261
|
+
fill: "none",
|
|
3262
|
+
stroke: "currentColor",
|
|
3263
|
+
strokeWidth: "2",
|
|
3264
|
+
strokeLinecap: "round",
|
|
3265
|
+
strokeLinejoin: "round",
|
|
3266
|
+
children: /* @__PURE__ */ O("path", { d: "M3 4.5l3 3 3-3" })
|
|
3267
|
+
})
|
|
3268
|
+
})]
|
|
3269
|
+
});
|
|
3270
|
+
}), sn = x(function({ open: n, onClose: r, children: i, side: a = "right", title: o, description: s, glass: c, width: l = 320, className: u }, d) {
|
|
3271
|
+
if (y(n), _(n, r), !n) return null;
|
|
3272
|
+
let f = a === "right", p = { width: typeof l == "number" ? `${l}px` : l };
|
|
3273
|
+
return /* @__PURE__ */ O("div", {
|
|
3274
|
+
className: "fixed inset-0 z-50 bg-black/50",
|
|
3275
|
+
onClick: (e) => {
|
|
3276
|
+
e.target === e.currentTarget && r();
|
|
3277
|
+
},
|
|
3278
|
+
"data-component": "sheet",
|
|
3279
|
+
"data-state": "open",
|
|
3280
|
+
children: /* @__PURE__ */ k("div", {
|
|
3281
|
+
ref: d,
|
|
3282
|
+
style: p,
|
|
3283
|
+
className: e("gds-ctx fixed bottom-0 top-0 flex flex-col border gds-shadow-xl transition-transform duration-200", f ? "right-0 border-l" : "left-0 border-r", c ? e(t(c), "border-white/10 bg-bg/60") : "border-border bg-surface", u),
|
|
3284
|
+
children: [(o !== void 0 || s !== void 0) && /* @__PURE__ */ k("div", {
|
|
3285
|
+
className: "flex items-start justify-between gds-gap border-b border-border gds-pad-x-lg gds-pad-y-lg",
|
|
3286
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3287
|
+
className: "min-w-0",
|
|
3288
|
+
children: [o !== void 0 && /* @__PURE__ */ O("h2", {
|
|
3289
|
+
className: "text-sm font-semibold text-fg",
|
|
3290
|
+
children: o
|
|
3291
|
+
}), s !== void 0 && /* @__PURE__ */ O("p", {
|
|
3292
|
+
className: "mt-0.5 gds-text-body text-fg-muted",
|
|
3293
|
+
children: s
|
|
3294
|
+
})]
|
|
3295
|
+
}), /* @__PURE__ */ O("button", {
|
|
3296
|
+
type: "button",
|
|
3297
|
+
onClick: r,
|
|
3298
|
+
className: e("shrink-0 gds-radius-button p-1 text-fg-muted hover:text-fg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
3299
|
+
"aria-label": "Close",
|
|
3300
|
+
children: /* @__PURE__ */ O("svg", {
|
|
3301
|
+
width: "14",
|
|
3302
|
+
height: "14",
|
|
3303
|
+
viewBox: "0 0 14 14",
|
|
3304
|
+
fill: "none",
|
|
3305
|
+
stroke: "currentColor",
|
|
3306
|
+
strokeWidth: "2",
|
|
3307
|
+
strokeLinecap: "round",
|
|
3308
|
+
children: /* @__PURE__ */ O("path", { d: "M3 3l8 8M11 3l-8 8" })
|
|
3309
|
+
})
|
|
3310
|
+
})]
|
|
3311
|
+
}), /* @__PURE__ */ O("div", {
|
|
3312
|
+
className: "flex-1 overflow-y-auto gds-pad-x-lg gds-pad-y-lg",
|
|
3313
|
+
children: i
|
|
3314
|
+
})]
|
|
3315
|
+
})
|
|
3316
|
+
});
|
|
3317
|
+
}), cn = x(function({ label: t, value: n, onChange: r, min: i = 0, max: a = 100, step: o = 1, unit: s, className: c, ...l }, u) {
|
|
3318
|
+
return /* @__PURE__ */ k("div", {
|
|
3319
|
+
ref: u,
|
|
3320
|
+
className: e("flex flex-col gap-1.5", c),
|
|
3321
|
+
"data-component": "slider-field",
|
|
3322
|
+
...l,
|
|
3323
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3324
|
+
className: "flex items-center justify-between",
|
|
3325
|
+
children: [/* @__PURE__ */ O("label", {
|
|
3326
|
+
className: "select-none gds-text-body text-fg-muted",
|
|
3327
|
+
children: t
|
|
3328
|
+
}), /* @__PURE__ */ k("span", {
|
|
3329
|
+
className: "gds-text-body tabular-nums text-fg",
|
|
3330
|
+
children: [n, s === void 0 ? "" : ` ${s}`]
|
|
3331
|
+
})]
|
|
3332
|
+
}), /* @__PURE__ */ O(p, {
|
|
3333
|
+
value: n,
|
|
3334
|
+
onChange: r,
|
|
3335
|
+
min: i,
|
|
3336
|
+
max: a,
|
|
3337
|
+
step: o
|
|
3338
|
+
})]
|
|
3339
|
+
});
|
|
3340
|
+
}), ln = x(function({ label: t, direction: n, onSort: r, className: a }, o) {
|
|
3341
|
+
return /* @__PURE__ */ O("th", {
|
|
3342
|
+
ref: o,
|
|
3343
|
+
className: e("px-3 py-2 text-left text-xs font-medium transition-colors select-none", i, n === null ? "text-fg-muted" : "text-accent", "cursor-pointer hover:text-accent", a),
|
|
3344
|
+
"data-component": "sortable-header",
|
|
3345
|
+
"data-state": n ?? "none",
|
|
3346
|
+
onClick: r,
|
|
3347
|
+
role: "columnheader",
|
|
3348
|
+
tabIndex: 0,
|
|
3349
|
+
children: /* @__PURE__ */ k("span", {
|
|
3350
|
+
className: "inline-flex items-center gap-1",
|
|
3351
|
+
children: [
|
|
3352
|
+
t,
|
|
3353
|
+
n === "asc" && /* @__PURE__ */ O("svg", {
|
|
3354
|
+
width: "12",
|
|
3355
|
+
height: "12",
|
|
3356
|
+
viewBox: "0 0 16 16",
|
|
3357
|
+
fill: "none",
|
|
3358
|
+
stroke: "currentColor",
|
|
3359
|
+
strokeWidth: "2",
|
|
3360
|
+
strokeLinecap: "round",
|
|
3361
|
+
strokeLinejoin: "round",
|
|
3362
|
+
children: /* @__PURE__ */ O("path", { d: "M8 12V4M4.5 7.5L8 4l3.5 3.5" })
|
|
3363
|
+
}),
|
|
3364
|
+
n === "desc" && /* @__PURE__ */ O("svg", {
|
|
3365
|
+
width: "12",
|
|
3366
|
+
height: "12",
|
|
3367
|
+
viewBox: "0 0 16 16",
|
|
3368
|
+
fill: "none",
|
|
3369
|
+
stroke: "currentColor",
|
|
3370
|
+
strokeWidth: "2",
|
|
3371
|
+
strokeLinecap: "round",
|
|
3372
|
+
strokeLinejoin: "round",
|
|
3373
|
+
children: /* @__PURE__ */ O("path", { d: "M8 4v8M4.5 8.5L8 12l3.5-3.5" })
|
|
3374
|
+
})
|
|
3375
|
+
]
|
|
3376
|
+
})
|
|
3377
|
+
});
|
|
3378
|
+
}), J = {
|
|
3379
|
+
primary: "bg-accent text-accent-fg hover:bg-accent/90",
|
|
3380
|
+
secondary: "bg-bg-secondary text-fg border border-border hover:bg-bg-tertiary",
|
|
3381
|
+
danger: "bg-danger text-white hover:bg-danger/90"
|
|
3382
|
+
}, un = {
|
|
3383
|
+
primary: "border-l-white/20",
|
|
3384
|
+
secondary: "border-l-border",
|
|
3385
|
+
danger: "border-l-white/20"
|
|
3386
|
+
}, Y = {
|
|
3387
|
+
sm: {
|
|
3388
|
+
main: "px-2.5 py-1 text-xs",
|
|
3389
|
+
trigger: "px-1.5 py-1"
|
|
3390
|
+
},
|
|
3391
|
+
default: {
|
|
3392
|
+
main: "px-3 py-1.5 text-sm",
|
|
3393
|
+
trigger: "px-2 py-1.5"
|
|
3394
|
+
},
|
|
3395
|
+
lg: {
|
|
3396
|
+
main: "px-4 py-2 text-sm",
|
|
3397
|
+
trigger: "px-2.5 py-2"
|
|
3398
|
+
}
|
|
3399
|
+
}, dn = x(function({ children: t, variant: n = "primary", size: r = "default", items: a, onSelect: o, onClick: s, disabled: c, className: l, ...u }, d) {
|
|
3400
|
+
let [f, p] = E(!1), m = T(null);
|
|
3401
|
+
b(m, f, () => p(!1)), _(f, () => p(!1));
|
|
3402
|
+
let h = n ?? "primary", v = r ?? "default";
|
|
3403
|
+
return /* @__PURE__ */ k("div", {
|
|
3404
|
+
ref: g(d, m),
|
|
3405
|
+
className: e("relative inline-flex", l),
|
|
3406
|
+
"data-component": "split-button",
|
|
3407
|
+
"data-variant": h,
|
|
3408
|
+
"data-state": f ? "open" : "closed",
|
|
3409
|
+
...u,
|
|
3410
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3411
|
+
className: "inline-flex",
|
|
3412
|
+
children: [/* @__PURE__ */ O("button", {
|
|
3413
|
+
type: "button",
|
|
3414
|
+
disabled: c,
|
|
3415
|
+
onClick: s,
|
|
3416
|
+
className: e("inline-flex select-none items-center font-medium transition-colors rounded-l-md", J[h], Y[v].main, i, c === !0 && "pointer-events-none opacity-50"),
|
|
3417
|
+
children: t
|
|
3418
|
+
}), /* @__PURE__ */ O("button", {
|
|
3419
|
+
type: "button",
|
|
3420
|
+
disabled: c,
|
|
3421
|
+
onClick: () => p((e) => !e),
|
|
3422
|
+
"aria-label": "More actions",
|
|
3423
|
+
className: e("inline-flex select-none items-center border-l font-medium transition-colors rounded-r-md", J[h], un[h], Y[v].trigger, i, c === !0 && "pointer-events-none opacity-50"),
|
|
3424
|
+
children: /* @__PURE__ */ O("svg", {
|
|
3425
|
+
width: "12",
|
|
3426
|
+
height: "12",
|
|
3427
|
+
viewBox: "0 0 12 12",
|
|
3428
|
+
fill: "none",
|
|
3429
|
+
stroke: "currentColor",
|
|
3430
|
+
strokeWidth: "2",
|
|
3431
|
+
strokeLinecap: "round",
|
|
3432
|
+
strokeLinejoin: "round",
|
|
3433
|
+
children: /* @__PURE__ */ O("path", { d: "M3 5l3 3 3-3" })
|
|
3434
|
+
})
|
|
3435
|
+
})]
|
|
3436
|
+
}), f && /* @__PURE__ */ O("div", {
|
|
3437
|
+
className: "absolute left-0 top-full z-50 mt-1 min-w-[160px] animate-popup gds-radius-popover border border-border bg-surface py-1 gds-shadow-lg",
|
|
3438
|
+
children: a.map((t) => /* @__PURE__ */ O("button", {
|
|
3439
|
+
type: "button",
|
|
3440
|
+
onClick: () => {
|
|
3441
|
+
o(t.id), p(!1);
|
|
3442
|
+
},
|
|
3443
|
+
className: e("flex w-full items-center gds-pad-x gds-pad-y-sm gds-text-body transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg", t.danger === !0 ? "text-danger hover:bg-danger/10" : "text-fg hover:bg-bg-tertiary"),
|
|
3444
|
+
children: t.label
|
|
3445
|
+
}, t.id))
|
|
3446
|
+
})]
|
|
3447
|
+
});
|
|
3448
|
+
}), X = [
|
|
3449
|
+
"var(--color-accent)",
|
|
3450
|
+
"var(--color-success)",
|
|
3451
|
+
"var(--color-warning)",
|
|
3452
|
+
"var(--color-danger)",
|
|
3453
|
+
"var(--color-fg-muted)"
|
|
3454
|
+
], fn = x(function({ segments: t, showLabels: n = !0, className: r }, i) {
|
|
3455
|
+
let a = t.reduce((e, t) => e + t.value, 0);
|
|
3456
|
+
return /* @__PURE__ */ k("div", {
|
|
3457
|
+
ref: i,
|
|
3458
|
+
className: e("select-none", r),
|
|
3459
|
+
"data-component": "stacked-progress",
|
|
3460
|
+
children: [/* @__PURE__ */ O("div", {
|
|
3461
|
+
className: "flex h-3 overflow-hidden rounded-full bg-fg-muted/10",
|
|
3462
|
+
children: t.map((e, t) => {
|
|
3463
|
+
let n = a > 0 ? e.value / a * 100 : 0;
|
|
3464
|
+
if (n <= 0) return null;
|
|
3465
|
+
let r = e.color ?? X[t % X.length];
|
|
3466
|
+
return /* @__PURE__ */ O("div", {
|
|
3467
|
+
className: "transition-all duration-300",
|
|
3468
|
+
style: {
|
|
3469
|
+
width: `${n}%`,
|
|
3470
|
+
backgroundColor: r
|
|
3471
|
+
}
|
|
3472
|
+
}, t);
|
|
3473
|
+
})
|
|
3474
|
+
}), n && /* @__PURE__ */ O("div", {
|
|
3475
|
+
className: "mt-2 flex flex-wrap gap-3",
|
|
3476
|
+
children: t.map((e, t) => {
|
|
3477
|
+
let n = a > 0 ? e.value / a * 100 : 0;
|
|
3478
|
+
return /* @__PURE__ */ k("div", {
|
|
3479
|
+
className: "flex items-center gap-1.5 gds-text-body text-fg-muted",
|
|
3480
|
+
children: [
|
|
3481
|
+
/* @__PURE__ */ O("div", {
|
|
3482
|
+
className: "h-2 w-2 rounded-full",
|
|
3483
|
+
style: { backgroundColor: e.color ?? X[t % X.length] }
|
|
3484
|
+
}),
|
|
3485
|
+
/* @__PURE__ */ O("span", { children: e.label }),
|
|
3486
|
+
/* @__PURE__ */ k("span", {
|
|
3487
|
+
className: "font-medium text-fg",
|
|
3488
|
+
children: [n.toFixed(1), "%"]
|
|
3489
|
+
})
|
|
3490
|
+
]
|
|
3491
|
+
}, t);
|
|
3492
|
+
})
|
|
3493
|
+
})]
|
|
3494
|
+
});
|
|
3495
|
+
}), pn = x(function({ className: t, highlight: n = "none", left: r, right: i, ...a }, o) {
|
|
3496
|
+
let s = (t) => e("flex flex-1 flex-col items-center rounded-lg border border-border p-3", n === t && "border-accent bg-accent/5");
|
|
3497
|
+
return /* @__PURE__ */ k("div", {
|
|
3498
|
+
className: e("flex items-center gds-gap", t),
|
|
3499
|
+
"data-component": "stat-comparison",
|
|
3500
|
+
ref: o,
|
|
3501
|
+
...a,
|
|
3502
|
+
children: [
|
|
3503
|
+
/* @__PURE__ */ k("div", {
|
|
3504
|
+
className: s("left"),
|
|
3505
|
+
children: [/* @__PURE__ */ O("span", {
|
|
3506
|
+
className: "gds-text-label text-fg-muted",
|
|
3507
|
+
children: r.label
|
|
3508
|
+
}), /* @__PURE__ */ O("span", {
|
|
3509
|
+
className: "text-lg font-semibold text-fg",
|
|
3510
|
+
children: r.value
|
|
3511
|
+
})]
|
|
3512
|
+
}),
|
|
3513
|
+
/* @__PURE__ */ O("span", {
|
|
3514
|
+
className: "shrink-0 text-xs font-medium text-fg-muted",
|
|
3515
|
+
children: "vs"
|
|
3516
|
+
}),
|
|
3517
|
+
/* @__PURE__ */ k("div", {
|
|
3518
|
+
className: s("right"),
|
|
3519
|
+
children: [/* @__PURE__ */ O("span", {
|
|
3520
|
+
className: "gds-text-label text-fg-muted",
|
|
3521
|
+
children: i.label
|
|
3522
|
+
}), /* @__PURE__ */ O("span", {
|
|
3523
|
+
className: "text-lg font-semibold text-fg",
|
|
3524
|
+
children: i.value
|
|
3525
|
+
})]
|
|
3526
|
+
})
|
|
3527
|
+
]
|
|
3528
|
+
});
|
|
3529
|
+
}), mn = x(function({ items: t, className: n }, r) {
|
|
3530
|
+
return /* @__PURE__ */ O("div", {
|
|
3531
|
+
ref: r,
|
|
3532
|
+
className: e("flex h-7 items-center border-t border-border bg-surface px-3 text-xs text-fg-muted select-none", n),
|
|
3533
|
+
"data-component": "status-bar",
|
|
3534
|
+
children: t.map((e, t) => /* @__PURE__ */ k("div", {
|
|
3535
|
+
className: "flex items-center",
|
|
3536
|
+
children: [t > 0 && /* @__PURE__ */ O("span", { className: "mx-2 h-3 w-px bg-border" }), /* @__PURE__ */ O("span", { children: e })]
|
|
3537
|
+
}, t))
|
|
3538
|
+
});
|
|
3539
|
+
}), hn = n(e("relative inline-flex items-center border-b-2 transition-colors", i), {
|
|
3540
|
+
variants: {
|
|
3541
|
+
size: {
|
|
3542
|
+
default: "gds-pad-x gds-pad-y text-sm",
|
|
3543
|
+
sm: "gds-pad-x-sm gds-pad-y-sm gds-text-body"
|
|
3544
|
+
},
|
|
3545
|
+
active: {
|
|
3546
|
+
true: "border-accent text-accent",
|
|
3547
|
+
false: "border-transparent text-fg-muted hover:text-fg"
|
|
3548
|
+
}
|
|
3549
|
+
},
|
|
3550
|
+
defaultVariants: {
|
|
3551
|
+
size: "default",
|
|
3552
|
+
active: !1
|
|
3553
|
+
}
|
|
3554
|
+
});
|
|
3555
|
+
function Z({ tabs: n, active: r, onChange: i, glass: a, size: o = "default", className: s }) {
|
|
3556
|
+
return /* @__PURE__ */ O("div", {
|
|
3557
|
+
className: e("flex border-b border-border", a ? e("rounded-t-lg border-white/10 bg-bg/60", t(a)) : "", s),
|
|
3558
|
+
"data-component": "tabs",
|
|
3559
|
+
role: "tablist",
|
|
3560
|
+
children: n.map((e) => {
|
|
3561
|
+
let t = e.id === r;
|
|
3562
|
+
return /* @__PURE__ */ k("button", {
|
|
3563
|
+
type: "button",
|
|
3564
|
+
role: "tab",
|
|
3565
|
+
"aria-selected": t,
|
|
3566
|
+
onClick: () => i(e.id),
|
|
3567
|
+
className: hn({
|
|
3568
|
+
size: o,
|
|
3569
|
+
active: t
|
|
3570
|
+
}),
|
|
3571
|
+
children: [e.label, e.count !== void 0 && /* @__PURE__ */ O("span", {
|
|
3572
|
+
className: "ml-1.5 gds-radius-badge bg-fg-muted/10 px-1.5 gds-text-caption",
|
|
3573
|
+
children: e.count
|
|
3574
|
+
})]
|
|
3575
|
+
}, e.id);
|
|
3576
|
+
})
|
|
3577
|
+
});
|
|
3578
|
+
}
|
|
3579
|
+
//#endregion
|
|
3580
|
+
//#region src/l4-molecules/tab-group.tsx
|
|
3581
|
+
function gn({ tabs: n, defaultTab: r, glass: i, className: a }) {
|
|
3582
|
+
let [o, s] = E(r ?? (n.length > 0 ? n[0].id : "")), c = n.map((e) => ({
|
|
3583
|
+
id: e.id,
|
|
3584
|
+
label: e.label
|
|
3585
|
+
})), l = (e) => {
|
|
3586
|
+
let t = n.find((t) => t.id === e);
|
|
3587
|
+
t !== void 0 && t.disabled !== !0 && s(e);
|
|
3588
|
+
}, u = n.find((e) => e.id === o);
|
|
3589
|
+
return /* @__PURE__ */ k("div", {
|
|
3590
|
+
className: e("gds-ctx gds-radius-card border border-border overflow-hidden", i !== void 0 && i !== !1 ? e("border-white/10 bg-bg/60", t(i)) : "", a),
|
|
3591
|
+
"data-component": "tab-group",
|
|
3592
|
+
children: [/* @__PURE__ */ O(Z, {
|
|
3593
|
+
tabs: c,
|
|
3594
|
+
active: o,
|
|
3595
|
+
onChange: l,
|
|
3596
|
+
size: "sm"
|
|
3597
|
+
}), /* @__PURE__ */ O("div", {
|
|
3598
|
+
className: "gds-pad",
|
|
3599
|
+
children: u === void 0 ? null : u.content
|
|
3600
|
+
})]
|
|
3601
|
+
});
|
|
3602
|
+
}
|
|
3603
|
+
//#endregion
|
|
3604
|
+
//#region src/l4-molecules/tag-input.tsx
|
|
3605
|
+
function _n() {
|
|
3606
|
+
return /* @__PURE__ */ O("svg", {
|
|
3607
|
+
className: "h-3 w-3",
|
|
3608
|
+
fill: "none",
|
|
3609
|
+
stroke: "currentColor",
|
|
3610
|
+
strokeWidth: 2,
|
|
3611
|
+
viewBox: "0 0 24 24",
|
|
3612
|
+
children: /* @__PURE__ */ O("path", {
|
|
3613
|
+
d: "M18 6L6 18M6 6l12 12",
|
|
3614
|
+
strokeLinecap: "round",
|
|
3615
|
+
strokeLinejoin: "round"
|
|
3616
|
+
})
|
|
3617
|
+
});
|
|
3618
|
+
}
|
|
3619
|
+
var vn = x(function({ className: n, disabled: r = !1, error: i = !1, glass: a, maxTags: o, onChange: s, placeholder: c, value: l, ...u }, d) {
|
|
3620
|
+
let [f, p] = E(""), [m, h] = E(!1), g = T(null), _ = d ?? g, v = o !== void 0 && l.length >= o, y = S((e) => {
|
|
3621
|
+
let t = e.trim();
|
|
3622
|
+
t !== "" && (l.includes(t) || v || (s([...l, t]), p("")));
|
|
3623
|
+
}, [
|
|
3624
|
+
v,
|
|
3625
|
+
s,
|
|
3626
|
+
l
|
|
3627
|
+
]), b = S((e) => {
|
|
3628
|
+
s(l.filter((t, n) => n !== e));
|
|
3629
|
+
}, [s, l]), x = S((e) => {
|
|
3630
|
+
e.key === "Enter" && (e.preventDefault(), y(f)), e.key === "Backspace" && f === "" && l.length > 0 && b(l.length - 1);
|
|
3631
|
+
}, [
|
|
3632
|
+
y,
|
|
3633
|
+
f,
|
|
3634
|
+
b,
|
|
3635
|
+
l.length
|
|
3636
|
+
]), C = S(() => {
|
|
3637
|
+
r || _.current?.focus();
|
|
3638
|
+
}, [r, _]);
|
|
3639
|
+
return /* @__PURE__ */ k("div", {
|
|
3640
|
+
className: e("flex min-h-[var(--gds-h)] flex-wrap items-center gds-gap-xs gds-pad-x gds-pad-y-sm gds-radius-input border bg-bg transition-colors", !i && !m && "border-border hover:border-border-strong", !i && m && "border-accent ring-2 ring-accent ring-offset-1 ring-offset-bg", i && "border-danger", i && m && "ring-2 ring-danger ring-offset-1 ring-offset-bg", r && "cursor-not-allowed opacity-50", t(a), a === !0 && "border-white/10 bg-bg/60", n),
|
|
3641
|
+
"data-component": "tag-input",
|
|
3642
|
+
"data-state": m ? "focused" : "idle",
|
|
3643
|
+
onClick: C,
|
|
3644
|
+
children: [l.map((t, n) => /* @__PURE__ */ k("span", {
|
|
3645
|
+
className: "inline-flex select-none items-center gds-gap-xs gds-radius-badge gds-pad-x-sm gds-pad-y-sm gds-text-label font-medium bg-fg-muted/10 text-fg-muted",
|
|
3646
|
+
children: [t, !r && /* @__PURE__ */ O("button", {
|
|
3647
|
+
className: e("ml-0.5 gds-radius-badge p-0.5 transition-colors hover:bg-current/10", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg"),
|
|
3648
|
+
onClick: (e) => {
|
|
3649
|
+
e.stopPropagation(), b(n);
|
|
3650
|
+
},
|
|
3651
|
+
tabIndex: -1,
|
|
3652
|
+
type: "button",
|
|
3653
|
+
children: /* @__PURE__ */ O(_n, {})
|
|
3654
|
+
})]
|
|
3655
|
+
}, t)), !v && /* @__PURE__ */ O("input", {
|
|
3656
|
+
className: "min-w-[60px] flex-1 border-none bg-transparent text-fg outline-none gds-text-body placeholder:text-fg-muted/50 disabled:cursor-not-allowed",
|
|
3657
|
+
disabled: r,
|
|
3658
|
+
onBlur: () => h(!1),
|
|
3659
|
+
onChange: (e) => p(e.target.value),
|
|
3660
|
+
onFocus: () => h(!0),
|
|
3661
|
+
onKeyDown: x,
|
|
3662
|
+
placeholder: l.length === 0 ? c : void 0,
|
|
3663
|
+
ref: _,
|
|
3664
|
+
type: "text",
|
|
3665
|
+
value: f,
|
|
3666
|
+
...u
|
|
3667
|
+
})]
|
|
3668
|
+
});
|
|
3669
|
+
});
|
|
3670
|
+
//#endregion
|
|
3671
|
+
//#region src/l4-molecules/time-picker-grid.tsx
|
|
3672
|
+
function Q(e) {
|
|
3673
|
+
return e < 10 ? `0${e}` : `${e}`;
|
|
3674
|
+
}
|
|
3675
|
+
function yn({ glass: n, hours: r, minutes: i, onHourClick: a, onMinuteClick: o, selectedHour: s, selectedMinute: c }) {
|
|
3676
|
+
return /* @__PURE__ */ k("div", {
|
|
3677
|
+
className: e("absolute left-0 right-0 z-50 mt-1 flex animate-popup gds-radius-popover border gds-shadow-lg", n ? e(t(n), "border-white/10 bg-bg/60") : "border-border bg-surface"),
|
|
3678
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3679
|
+
className: "flex-1 overflow-y-auto border-r border-border",
|
|
3680
|
+
style: { maxHeight: 200 },
|
|
3681
|
+
children: [/* @__PURE__ */ O("div", {
|
|
3682
|
+
className: "px-2 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-muted/50",
|
|
3683
|
+
children: "Hour"
|
|
3684
|
+
}), r.map((t) => /* @__PURE__ */ O("button", {
|
|
3685
|
+
className: e("flex w-full items-center justify-center py-1.5 text-sm transition-colors", t === s ? "bg-accent/10 font-medium text-accent" : "text-fg hover:bg-bg-tertiary"),
|
|
3686
|
+
onClick: () => a(t),
|
|
3687
|
+
type: "button",
|
|
3688
|
+
children: Q(t)
|
|
3689
|
+
}, t))]
|
|
3690
|
+
}), /* @__PURE__ */ k("div", {
|
|
3691
|
+
className: "flex-1 overflow-y-auto",
|
|
3692
|
+
style: { maxHeight: 200 },
|
|
3693
|
+
children: [/* @__PURE__ */ O("div", {
|
|
3694
|
+
className: "px-2 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-muted/50",
|
|
3695
|
+
children: "Min"
|
|
3696
|
+
}), i.map((t) => /* @__PURE__ */ O("button", {
|
|
3697
|
+
className: e("flex w-full items-center justify-center py-1.5 text-sm transition-colors", t === c ? "bg-accent/10 font-medium text-accent" : "text-fg hover:bg-bg-tertiary"),
|
|
3698
|
+
onClick: () => o(t),
|
|
3699
|
+
type: "button",
|
|
3700
|
+
children: Q(t)
|
|
3701
|
+
}, t))]
|
|
3702
|
+
})]
|
|
3703
|
+
});
|
|
3704
|
+
}
|
|
3705
|
+
//#endregion
|
|
3706
|
+
//#region src/l4-molecules/time-picker.tsx
|
|
3707
|
+
function $({ open: t }) {
|
|
3708
|
+
return /* @__PURE__ */ O("svg", {
|
|
3709
|
+
className: e("h-3 w-3 text-fg-muted transition-transform", t && "rotate-180"),
|
|
3710
|
+
fill: "none",
|
|
3711
|
+
stroke: "currentColor",
|
|
3712
|
+
strokeLinecap: "round",
|
|
3713
|
+
strokeLinejoin: "round",
|
|
3714
|
+
strokeWidth: 2,
|
|
3715
|
+
viewBox: "0 0 12 12",
|
|
3716
|
+
children: /* @__PURE__ */ O("path", { d: "M3 4.5l3 3 3-3" })
|
|
3717
|
+
});
|
|
3718
|
+
}
|
|
3719
|
+
var bn = x(function({ className: n, disabled: r = !1, error: a = !1, glass: o, minuteStep: s = 15, onChange: c, placeholder: l = "Select time", value: u }, d) {
|
|
3720
|
+
let [f, p] = E(!1), m = T(null), h = d ?? m, g = w(() => Array.from({ length: 24 }, (e, t) => t), []), v = w(() => {
|
|
3721
|
+
let e = Math.max(1, Math.min(60, s)), t = [], n = 0;
|
|
3722
|
+
for (; n < 60;) t.push(n), n += e;
|
|
3723
|
+
return t;
|
|
3724
|
+
}, [s]), y = w(() => {
|
|
3725
|
+
if (u === null) return null;
|
|
3726
|
+
let e = u.split(":");
|
|
3727
|
+
return parseInt(e[0], 10);
|
|
3728
|
+
}, [u]), x = w(() => {
|
|
3729
|
+
if (u === null) return null;
|
|
3730
|
+
let e = u.split(":");
|
|
3731
|
+
return parseInt(e[1], 10);
|
|
3732
|
+
}, [u]), C = S(() => {
|
|
3733
|
+
r || p(!0);
|
|
3734
|
+
}, [r]), D = S(() => {
|
|
3735
|
+
p(!1);
|
|
3736
|
+
}, []), A = S((e) => {
|
|
3737
|
+
let t = x ?? 0;
|
|
3738
|
+
c(`${Q(e)}:${Q(t)}`);
|
|
3739
|
+
}, [x, c]), j = S((e) => {
|
|
3740
|
+
c(`${Q(y ?? 0)}:${Q(e)}`);
|
|
3741
|
+
}, [y, c]);
|
|
3742
|
+
return b(h, f, D), _(f, D), /* @__PURE__ */ k("div", {
|
|
3743
|
+
ref: h,
|
|
3744
|
+
className: e("relative", n),
|
|
3745
|
+
"data-component": "time-picker",
|
|
3746
|
+
"data-state": f ? "open" : "closed",
|
|
3747
|
+
children: [/* @__PURE__ */ k("button", {
|
|
3748
|
+
className: e("flex w-full items-center justify-between gds-h gds-radius-popover gds-pad-x border bg-transparent text-left text-sm text-fg transition-colors", i, !a && "border-border hover:border-fg-muted", a && "border-danger", a && "focus-visible:ring-danger", r && "cursor-not-allowed opacity-50", t(o), o === !0 && "border-white/10 bg-bg/60"),
|
|
3749
|
+
disabled: r,
|
|
3750
|
+
onClick: C,
|
|
3751
|
+
type: "button",
|
|
3752
|
+
children: [/* @__PURE__ */ O("span", {
|
|
3753
|
+
className: e(u === null ? "text-fg-muted" : "text-fg"),
|
|
3754
|
+
children: u ?? l
|
|
3755
|
+
}), /* @__PURE__ */ O($, { open: f })]
|
|
3756
|
+
}), f && /* @__PURE__ */ O(yn, {
|
|
3757
|
+
glass: o,
|
|
3758
|
+
hours: g,
|
|
3759
|
+
minutes: v,
|
|
3760
|
+
onHourClick: A,
|
|
3761
|
+
onMinuteClick: j,
|
|
3762
|
+
selectedHour: y,
|
|
3763
|
+
selectedMinute: x
|
|
3764
|
+
})]
|
|
3765
|
+
});
|
|
3766
|
+
}), xn = {
|
|
3767
|
+
default: "bg-fg-muted/40",
|
|
3768
|
+
success: "bg-success",
|
|
3769
|
+
warning: "bg-warning",
|
|
3770
|
+
danger: "bg-danger"
|
|
3771
|
+
}, Sn = x(function({ children: t, className: n, icon: r, last: i = !1, variant: a = "default", ...o }, s) {
|
|
3772
|
+
return /* @__PURE__ */ k("div", {
|
|
3773
|
+
className: e("relative flex gap-3", n),
|
|
3774
|
+
"data-component": "timeline-entry",
|
|
3775
|
+
ref: s,
|
|
3776
|
+
...o,
|
|
3777
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3778
|
+
className: "flex flex-col items-center",
|
|
3779
|
+
children: [r === void 0 ? /* @__PURE__ */ O("span", { className: e("mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full", xn[a]) }) : /* @__PURE__ */ O("span", {
|
|
3780
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center",
|
|
3781
|
+
children: r
|
|
3782
|
+
}), !i && /* @__PURE__ */ O("span", { className: "mt-1 w-px flex-1 bg-border" })]
|
|
3783
|
+
}), /* @__PURE__ */ O("div", {
|
|
3784
|
+
className: "flex-1 pb-4",
|
|
3785
|
+
children: t
|
|
3786
|
+
})]
|
|
3787
|
+
});
|
|
3788
|
+
}), Cn = x(function({ label: t, description: n, checked: r, onChange: i, disabled: a, className: o, ...s }, c) {
|
|
3789
|
+
return /* @__PURE__ */ k("div", {
|
|
3790
|
+
ref: c,
|
|
3791
|
+
className: e("flex items-center justify-between gap-4", o),
|
|
3792
|
+
"data-component": "toggle-field",
|
|
3793
|
+
...s,
|
|
3794
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3795
|
+
className: "flex flex-col",
|
|
3796
|
+
children: [/* @__PURE__ */ O("span", {
|
|
3797
|
+
className: "select-none gds-text-body text-fg",
|
|
3798
|
+
children: t
|
|
3799
|
+
}), n !== void 0 && /* @__PURE__ */ O("span", {
|
|
3800
|
+
className: "select-none text-xs text-fg-muted",
|
|
3801
|
+
children: n
|
|
3802
|
+
})]
|
|
3803
|
+
}), /* @__PURE__ */ O(m, {
|
|
3804
|
+
checked: r,
|
|
3805
|
+
onChange: i,
|
|
3806
|
+
disabled: a
|
|
3807
|
+
})]
|
|
3808
|
+
});
|
|
3809
|
+
}), wn = x(function({ children: n, variant: r = "default", glass: i, className: a }, o) {
|
|
3810
|
+
return /* @__PURE__ */ O("div", {
|
|
3811
|
+
ref: o,
|
|
3812
|
+
className: e("flex items-center gds-gap px-3 py-2 select-none", r === "floating" ? "gds-radius border border-border bg-surface shadow-md" : "border-b border-border bg-bg", i === !0 && t(i), a),
|
|
3813
|
+
"data-component": "toolbar-generic",
|
|
3814
|
+
"data-variant": r,
|
|
3815
|
+
role: "toolbar",
|
|
3816
|
+
children: n
|
|
3817
|
+
});
|
|
3818
|
+
}), Tn = x(function(e, t) {
|
|
3819
|
+
return /* @__PURE__ */ O("div", {
|
|
3820
|
+
ref: t,
|
|
3821
|
+
className: "h-4 w-px bg-border/50",
|
|
3822
|
+
"data-component": "toolbar-separator"
|
|
3823
|
+
});
|
|
3824
|
+
}), En = x(function({ children: t, className: n, ...r }, i) {
|
|
3825
|
+
return /* @__PURE__ */ O("div", {
|
|
3826
|
+
className: e("inline-flex items-center overflow-hidden rounded-md border border-border", "[&>*]:rounded-none [&>*]:border-0 [&>*]:border-r [&>*]:border-border [&>*:last-child]:border-r-0", n),
|
|
3827
|
+
"data-component": "toolbar-group",
|
|
3828
|
+
ref: i,
|
|
3829
|
+
role: "toolbar",
|
|
3830
|
+
...r,
|
|
3831
|
+
children: t
|
|
3832
|
+
});
|
|
3833
|
+
}), Dn = {
|
|
3834
|
+
away: "bg-warning",
|
|
3835
|
+
busy: "bg-danger",
|
|
3836
|
+
offline: "bg-fg-muted/40",
|
|
3837
|
+
online: "bg-success"
|
|
3838
|
+
}, On = x(function({ name: n, avatar: r, role: i, department: a, email: o, status: s, glass: c, className: l, children: u }, d) {
|
|
3839
|
+
let f = (n ?? "").split(" ").map((e) => e[0]).join("").slice(0, 2).toUpperCase();
|
|
3840
|
+
return /* @__PURE__ */ k("div", {
|
|
3841
|
+
ref: d,
|
|
3842
|
+
className: e("inline-flex items-center gds-gap gds-radius border border-border bg-surface gds-pad select-none", c === !0 && t(c), l),
|
|
3843
|
+
"data-component": "user-card",
|
|
3844
|
+
children: [
|
|
3845
|
+
/* @__PURE__ */ k("div", {
|
|
3846
|
+
className: "relative",
|
|
3847
|
+
children: [r === void 0 ? /* @__PURE__ */ O("div", {
|
|
3848
|
+
className: "flex h-9 w-9 items-center justify-center rounded-full bg-accent/15 text-xs font-medium text-accent",
|
|
3849
|
+
children: f
|
|
3850
|
+
}) : /* @__PURE__ */ O("img", {
|
|
3851
|
+
src: r,
|
|
3852
|
+
alt: n,
|
|
3853
|
+
className: "h-9 w-9 rounded-full object-cover"
|
|
3854
|
+
}), s !== void 0 && /* @__PURE__ */ O("span", { className: e("absolute -bottom-0.5 -right-0.5 h-3 w-3 rounded-full border-2 border-surface", Dn[s]) })]
|
|
3855
|
+
}),
|
|
3856
|
+
/* @__PURE__ */ k("div", {
|
|
3857
|
+
className: "flex min-w-0 flex-col gap-0.5",
|
|
3858
|
+
children: [
|
|
3859
|
+
/* @__PURE__ */ O("span", {
|
|
3860
|
+
className: "truncate text-sm font-medium text-fg",
|
|
3861
|
+
children: n
|
|
3862
|
+
}),
|
|
3863
|
+
(i !== void 0 || a !== void 0) && /* @__PURE__ */ k("span", {
|
|
3864
|
+
className: "flex items-center gap-1 gds-text-body text-fg-muted",
|
|
3865
|
+
children: [
|
|
3866
|
+
i !== void 0 && /* @__PURE__ */ O("span", { children: i }),
|
|
3867
|
+
i !== void 0 && a !== void 0 && /* @__PURE__ */ O("span", {
|
|
3868
|
+
className: "text-fg-muted/40",
|
|
3869
|
+
children: "/"
|
|
3870
|
+
}),
|
|
3871
|
+
a !== void 0 && /* @__PURE__ */ O("span", { children: a })
|
|
3872
|
+
]
|
|
3873
|
+
}),
|
|
3874
|
+
o !== void 0 && /* @__PURE__ */ k("span", {
|
|
3875
|
+
className: "flex items-center gap-1 gds-text-body text-fg-muted/60",
|
|
3876
|
+
children: [/* @__PURE__ */ k("svg", {
|
|
3877
|
+
width: "12",
|
|
3878
|
+
height: "12",
|
|
3879
|
+
viewBox: "0 0 16 16",
|
|
3880
|
+
fill: "none",
|
|
3881
|
+
stroke: "currentColor",
|
|
3882
|
+
strokeWidth: "1.5",
|
|
3883
|
+
strokeLinecap: "round",
|
|
3884
|
+
strokeLinejoin: "round",
|
|
3885
|
+
children: [/* @__PURE__ */ O("rect", {
|
|
3886
|
+
x: "2",
|
|
3887
|
+
y: "3.5",
|
|
3888
|
+
width: "12",
|
|
3889
|
+
height: "9",
|
|
3890
|
+
rx: "1.5"
|
|
3891
|
+
}), /* @__PURE__ */ O("path", { d: "M2 5l6 4 6-4" })]
|
|
3892
|
+
}), /* @__PURE__ */ O("span", {
|
|
3893
|
+
className: "truncate",
|
|
3894
|
+
children: o
|
|
3895
|
+
})]
|
|
3896
|
+
})
|
|
3897
|
+
]
|
|
3898
|
+
}),
|
|
3899
|
+
u
|
|
3900
|
+
]
|
|
3901
|
+
});
|
|
3902
|
+
}), kn = x(function({ avatar: t, className: n, name: r, role: i, size: a = "default", ...o }, s) {
|
|
3903
|
+
let c = a === "sm" ? "sm" : "default", l = a === "sm" ? "text-xs" : "text-sm";
|
|
3904
|
+
return /* @__PURE__ */ k("div", {
|
|
3905
|
+
className: e("inline-flex items-center gap-2 select-none", n),
|
|
3906
|
+
"data-component": "user-info",
|
|
3907
|
+
ref: s,
|
|
3908
|
+
...o,
|
|
3909
|
+
children: [/* @__PURE__ */ O(d, {
|
|
3910
|
+
name: r,
|
|
3911
|
+
size: c,
|
|
3912
|
+
src: t
|
|
3913
|
+
}), /* @__PURE__ */ k("div", {
|
|
3914
|
+
className: "flex flex-col",
|
|
3915
|
+
children: [/* @__PURE__ */ O("span", {
|
|
3916
|
+
className: e("font-medium text-fg leading-tight", l),
|
|
3917
|
+
children: r
|
|
3918
|
+
}), i !== void 0 && /* @__PURE__ */ O("span", {
|
|
3919
|
+
className: e("text-fg-muted leading-tight", a === "sm" ? "text-[10px]" : "text-xs"),
|
|
3920
|
+
children: i
|
|
3921
|
+
})]
|
|
3922
|
+
})]
|
|
3923
|
+
});
|
|
3924
|
+
}), An = x(function({ name: t, avatar: n, role: r, items: i, onSelect: a, className: o }, s) {
|
|
3925
|
+
let [c, l] = E(!1), u = t.split(" ").map((e) => e[0]).join("").slice(0, 2).toUpperCase();
|
|
3926
|
+
return /* @__PURE__ */ k("div", {
|
|
3927
|
+
ref: s,
|
|
3928
|
+
className: e("relative", o),
|
|
3929
|
+
"data-component": "user-menu",
|
|
3930
|
+
children: [/* @__PURE__ */ k("button", {
|
|
3931
|
+
type: "button",
|
|
3932
|
+
className: "flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-bg-tertiary transition-colors select-none",
|
|
3933
|
+
onClick: () => l((e) => !e),
|
|
3934
|
+
"data-testid": "user-menu-trigger",
|
|
3935
|
+
children: [n === void 0 ? /* @__PURE__ */ O("div", {
|
|
3936
|
+
className: "flex h-7 w-7 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent",
|
|
3937
|
+
children: u
|
|
3938
|
+
}) : /* @__PURE__ */ O("img", {
|
|
3939
|
+
src: n,
|
|
3940
|
+
alt: t,
|
|
3941
|
+
className: "h-7 w-7 rounded-full object-cover"
|
|
3942
|
+
}), /* @__PURE__ */ O("span", {
|
|
3943
|
+
className: "text-sm font-medium text-fg",
|
|
3944
|
+
children: t
|
|
3945
|
+
})]
|
|
3946
|
+
}), c && /* @__PURE__ */ k("div", {
|
|
3947
|
+
className: "absolute right-0 top-full z-50 mt-1 min-w-[160px] rounded-lg border border-border bg-surface py-1 shadow-lg animate-popup",
|
|
3948
|
+
"data-testid": "user-menu-dropdown",
|
|
3949
|
+
children: [r !== void 0 && /* @__PURE__ */ O("div", {
|
|
3950
|
+
className: "px-3 py-1.5 text-xs text-fg-muted",
|
|
3951
|
+
children: r
|
|
3952
|
+
}), i.map((t) => /* @__PURE__ */ k("button", {
|
|
3953
|
+
type: "button",
|
|
3954
|
+
className: e("flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-bg-tertiary transition-colors select-none", t.danger === !0 ? "text-danger" : "text-fg"),
|
|
3955
|
+
onClick: () => {
|
|
3956
|
+
a(t.id), l(!1);
|
|
3957
|
+
},
|
|
3958
|
+
children: [t.icon !== void 0 && /* @__PURE__ */ O("span", {
|
|
3959
|
+
className: "shrink-0",
|
|
3960
|
+
children: t.icon
|
|
3961
|
+
}), t.label]
|
|
3962
|
+
}, t.id))]
|
|
3963
|
+
})]
|
|
3964
|
+
});
|
|
3965
|
+
}), jn = x(function({ className: t, latest: n, version: r, ...i }, a) {
|
|
3966
|
+
let o = n !== void 0 && n !== r;
|
|
3967
|
+
return /* @__PURE__ */ k("span", {
|
|
3968
|
+
className: e("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium tabular-nums", o ? "bg-warning/15 text-warning" : "bg-surface text-fg-muted", t),
|
|
3969
|
+
"data-component": "version-badge",
|
|
3970
|
+
"data-has-update": o,
|
|
3971
|
+
ref: a,
|
|
3972
|
+
...i,
|
|
3973
|
+
children: [
|
|
3974
|
+
"v",
|
|
3975
|
+
r,
|
|
3976
|
+
o && /* @__PURE__ */ O("svg", {
|
|
3977
|
+
className: "shrink-0",
|
|
3978
|
+
fill: "currentColor",
|
|
3979
|
+
height: 12,
|
|
3980
|
+
viewBox: "0 0 24 24",
|
|
3981
|
+
width: 12,
|
|
3982
|
+
children: /* @__PURE__ */ O("path", {
|
|
3983
|
+
d: "M12 2L12 16M12 16L7 11M12 16L17 11M5 20H19",
|
|
3984
|
+
fill: "none",
|
|
3985
|
+
stroke: "currentColor",
|
|
3986
|
+
strokeLinecap: "round",
|
|
3987
|
+
strokeLinejoin: "round",
|
|
3988
|
+
strokeWidth: 2
|
|
3989
|
+
})
|
|
3990
|
+
})
|
|
3991
|
+
]
|
|
3992
|
+
});
|
|
3993
|
+
}), Mn = x(function({ children: t, text: n, opacity: r = .1, className: i }, a) {
|
|
3994
|
+
return /* @__PURE__ */ k("div", {
|
|
3995
|
+
ref: a,
|
|
3996
|
+
className: e("relative overflow-hidden", i),
|
|
3997
|
+
"data-component": "watermark",
|
|
3998
|
+
children: [t, /* @__PURE__ */ O("div", {
|
|
3999
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center overflow-hidden select-none",
|
|
4000
|
+
style: { opacity: r },
|
|
4001
|
+
children: /* @__PURE__ */ O("div", {
|
|
4002
|
+
className: "absolute inset-[-50%] flex flex-wrap items-center justify-center gap-16",
|
|
4003
|
+
style: { transform: "rotate(-30deg)" },
|
|
4004
|
+
children: Array.from({ length: 64 }, (e, t) => /* @__PURE__ */ O("span", {
|
|
4005
|
+
className: "text-lg font-bold whitespace-nowrap text-fg",
|
|
4006
|
+
children: n
|
|
4007
|
+
}, t))
|
|
4008
|
+
})
|
|
4009
|
+
})]
|
|
4010
|
+
});
|
|
4011
|
+
}), Nn = x(function({ steps: t, currentStep: n, onStepChange: r, className: i, ...a }, o) {
|
|
4012
|
+
let [s, c] = E(0), l = n ?? s;
|
|
4013
|
+
function u(e) {
|
|
4014
|
+
r === void 0 ? c(e) : r(e);
|
|
4015
|
+
}
|
|
4016
|
+
return /* @__PURE__ */ k("div", {
|
|
4017
|
+
ref: o,
|
|
4018
|
+
className: e("flex flex-col gap-4", i),
|
|
4019
|
+
"data-component": "wizard",
|
|
4020
|
+
...a,
|
|
4021
|
+
children: [
|
|
4022
|
+
/* @__PURE__ */ O("div", {
|
|
4023
|
+
className: "flex items-center gap-0",
|
|
4024
|
+
children: t.map((t, n) => {
|
|
4025
|
+
let r = n < l, i = n === l;
|
|
4026
|
+
return /* @__PURE__ */ k("div", {
|
|
4027
|
+
className: "flex items-center",
|
|
4028
|
+
children: [n > 0 && /* @__PURE__ */ O("div", { className: e("h-px w-8", r ? "bg-accent" : "bg-border") }), /* @__PURE__ */ O("button", {
|
|
4029
|
+
type: "button",
|
|
4030
|
+
className: e("flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium transition-colors", r && "bg-accent text-accent-fg", i && "bg-accent/20 text-accent ring-2 ring-accent", !r && !i && "bg-bg-tertiary text-fg-muted"),
|
|
4031
|
+
onClick: () => u(n),
|
|
4032
|
+
children: n + 1
|
|
4033
|
+
})]
|
|
4034
|
+
}, n);
|
|
4035
|
+
})
|
|
4036
|
+
}),
|
|
4037
|
+
/* @__PURE__ */ O("div", {
|
|
4038
|
+
className: "text-xs font-medium text-fg-muted",
|
|
4039
|
+
children: t[l]?.title
|
|
4040
|
+
}),
|
|
4041
|
+
/* @__PURE__ */ O("div", { children: t[l]?.content })
|
|
4042
|
+
]
|
|
4043
|
+
});
|
|
4044
|
+
});
|
|
4045
|
+
//#endregion
|
|
4046
|
+
export { U as $, Yt as A, Ee as At, At as B, me as Bt, on as C, Ne as Ct, $t as D, ke as Dt, tn as E, Ae as Et, zt as F, _e as Ft, St as G, re as Gt, Et as H, ue as Ht, Rt as I, ge as It, vt as J, N as Jt, bt as K, ne as Kt, It as L, he as Lt, Ut as M, be as Mt, Vt as N, ye as Nt, Qt as O, z as Ot, Bt as P, ve as Pt, pt as Q, Ft as R, de as Rt, sn as S, Ie as St, an as T, je as Tt, wt as U, se as Ut, Ot as V, fe as Vt, Ct as W, ae as Wt, gt as X, A as Xt, _t as Y, M as Yt, ht as Z, pn as _, Ue as _t, kn as a, ct as at, ln as b, Be as bt, wn as c, nt as ct, Sn as d, Ze as dt, ft as et, bn as f, Ye as ft, mn as g, We as gt, Z as h, Ke as ht, An as i, lt as it, qt as j, Ce as jt, Xt as k, De as kt, Tn as l, $e as lt, gn as m, qe as mt, Mn as n, dt as nt, On as o, at as ot, vn as p, Je as pt, yt as q, F as qt, jn as r, ut as rt, En as s, it as st, Nn as t, H as tt, Cn as u, Qe as ut, fn as v, He as vt, q as w, Me as wt, cn as x, Re as xt, dn as y, Ve as yt, Pt as z, pe as zt };
|
|
4047
|
+
|
|
4048
|
+
//# sourceMappingURL=l4-molecules-DCc074MJ.js.map
|