@teton/smith-ui 0.2.194 → 0.2.196
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/index.js +277 -263
- package/dist/state-timeline.d.ts +7 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { X as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Link as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { X as T, ChevronRight as k, MoreHorizontal as I, Loader2 as z, ArrowLeft as K, ChevronDown as P, Search as U, Check as X } from "lucide-react";
|
|
3
|
+
import { useState as E, useRef as j, useEffect as D } from "react";
|
|
4
|
+
import { Link as v } from "react-router";
|
|
5
|
+
const H = {
|
|
6
6
|
gray: "bg-gray-100 text-gray-700",
|
|
7
7
|
blue: "bg-blue-100 text-blue-700",
|
|
8
8
|
green: "bg-green-100 text-green-700",
|
|
@@ -11,7 +11,7 @@ const K = {
|
|
|
11
11
|
purple: "bg-purple-100 text-purple-700",
|
|
12
12
|
orange: "bg-orange-100 text-orange-700"
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function ne({
|
|
15
15
|
variant: r = "gray",
|
|
16
16
|
pill: t = !1,
|
|
17
17
|
className: n = "",
|
|
@@ -20,12 +20,12 @@ function W({
|
|
|
20
20
|
return /* @__PURE__ */ e(
|
|
21
21
|
"span",
|
|
22
22
|
{
|
|
23
|
-
className: `px-1.5 py-0.5 text-xs font-medium ${t ? "rounded-full" : "rounded"} ${
|
|
23
|
+
className: `px-1.5 py-0.5 text-xs font-medium ${t ? "rounded-full" : "rounded"} ${H[r]} ${n}`,
|
|
24
24
|
children: a
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function ae({
|
|
29
29
|
name: r,
|
|
30
30
|
value: t,
|
|
31
31
|
onClick: n,
|
|
@@ -33,7 +33,7 @@ function ee({
|
|
|
33
33
|
active: o = !1,
|
|
34
34
|
title: u
|
|
35
35
|
}) {
|
|
36
|
-
const
|
|
36
|
+
const l = /* @__PURE__ */ i(N, { children: [
|
|
37
37
|
/* @__PURE__ */ e(
|
|
38
38
|
"span",
|
|
39
39
|
{
|
|
@@ -48,9 +48,9 @@ function ee({
|
|
|
48
48
|
children: t
|
|
49
49
|
}
|
|
50
50
|
)
|
|
51
|
-
] }),
|
|
52
|
-
return a ? /* @__PURE__ */
|
|
53
|
-
|
|
51
|
+
] }), c = `inline-flex items-center overflow-hidden rounded-md border text-xs ${o ? "border-blue-300" : "border-gray-200"}`;
|
|
52
|
+
return a ? /* @__PURE__ */ i("span", { className: c, children: [
|
|
53
|
+
l,
|
|
54
54
|
/* @__PURE__ */ e(
|
|
55
55
|
"button",
|
|
56
56
|
{
|
|
@@ -59,7 +59,7 @@ function ee({
|
|
|
59
59
|
title: u,
|
|
60
60
|
"aria-label": `Remove ${t !== void 0 ? `${r}=${t}` : r}`,
|
|
61
61
|
className: `flex items-center px-1.5 py-1 border-l cursor-pointer transition-colors ${o ? "bg-blue-100 border-blue-200 text-blue-500 hover:bg-blue-200 hover:text-blue-700" : "border-gray-200 text-gray-400 hover:bg-gray-100 hover:text-gray-600"}`,
|
|
62
|
-
children: /* @__PURE__ */ e(
|
|
62
|
+
children: /* @__PURE__ */ e(T, { className: "w-3 h-3" })
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
] }) : n ? /* @__PURE__ */ e(
|
|
@@ -68,70 +68,70 @@ function ee({
|
|
|
68
68
|
type: "button",
|
|
69
69
|
onClick: n,
|
|
70
70
|
title: u,
|
|
71
|
-
className: `${
|
|
72
|
-
children:
|
|
71
|
+
className: `${c} cursor-pointer transition-colors ${o ? "" : "hover:border-gray-300"}`,
|
|
72
|
+
children: l
|
|
73
73
|
}
|
|
74
|
-
) : /* @__PURE__ */ e("span", { className:
|
|
74
|
+
) : /* @__PURE__ */ e("span", { className: c, children: l });
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function oe({
|
|
77
77
|
segments: r,
|
|
78
78
|
onNavigate: t,
|
|
79
79
|
maxVisible: n = 5,
|
|
80
80
|
className: a = ""
|
|
81
81
|
}) {
|
|
82
|
-
const [o, u] =
|
|
82
|
+
const [o, u] = E(!1), l = !o && r.length > n, c = l ? r.slice(0, 1) : [], m = l ? r.length - n : 0, b = l ? r.slice(1 + m) : r, x = l ? 1 + m : 0, d = (s, g) => g === r.length - 1 ? /* @__PURE__ */ e(
|
|
83
83
|
"span",
|
|
84
84
|
{
|
|
85
85
|
"aria-current": "page",
|
|
86
86
|
className: "px-1.5 py-0.5 font-medium text-gray-900 truncate max-w-[16rem]",
|
|
87
|
-
children:
|
|
87
|
+
children: s.label
|
|
88
88
|
},
|
|
89
|
-
|
|
89
|
+
s.key
|
|
90
90
|
) : /* @__PURE__ */ e(
|
|
91
91
|
"button",
|
|
92
92
|
{
|
|
93
93
|
type: "button",
|
|
94
|
-
onClick: () => t(
|
|
94
|
+
onClick: () => t(g),
|
|
95
95
|
className: "px-1.5 py-0.5 rounded text-gray-500 hover:text-gray-900 hover:bg-gray-100 transition-colors cursor-pointer truncate max-w-[12rem]",
|
|
96
|
-
children:
|
|
96
|
+
children: s.label
|
|
97
97
|
},
|
|
98
|
-
|
|
98
|
+
s.key
|
|
99
99
|
);
|
|
100
|
-
return /* @__PURE__ */
|
|
100
|
+
return /* @__PURE__ */ i(
|
|
101
101
|
"nav",
|
|
102
102
|
{
|
|
103
103
|
"aria-label": "Breadcrumb",
|
|
104
104
|
className: `flex items-center gap-0.5 text-sm min-w-0 overflow-hidden ${a}`,
|
|
105
105
|
children: [
|
|
106
|
-
|
|
107
|
-
d(
|
|
108
|
-
/* @__PURE__ */ e(
|
|
109
|
-
] },
|
|
110
|
-
|
|
106
|
+
c.map((s, g) => /* @__PURE__ */ i("span", { className: "flex items-center gap-0.5 min-w-0", children: [
|
|
107
|
+
d(s, g),
|
|
108
|
+
/* @__PURE__ */ e(k, { className: "w-3.5 h-3.5 text-gray-300 flex-shrink-0" })
|
|
109
|
+
] }, s.key)),
|
|
110
|
+
l && /* @__PURE__ */ i("span", { className: "flex items-center gap-0.5 flex-shrink-0", children: [
|
|
111
111
|
/* @__PURE__ */ e(
|
|
112
112
|
"button",
|
|
113
113
|
{
|
|
114
114
|
type: "button",
|
|
115
115
|
onClick: () => u(!0),
|
|
116
|
-
title: `Show ${
|
|
116
|
+
title: `Show ${m} hidden ${m === 1 ? "folder" : "folders"}`,
|
|
117
117
|
className: "px-1 py-0.5 rounded text-gray-400 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer",
|
|
118
|
-
children: /* @__PURE__ */ e(
|
|
118
|
+
children: /* @__PURE__ */ e(I, { className: "w-4 h-4" })
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
/* @__PURE__ */ e(
|
|
121
|
+
/* @__PURE__ */ e(k, { className: "w-3.5 h-3.5 text-gray-300" })
|
|
122
122
|
] }),
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
d(
|
|
127
|
-
|
|
128
|
-
] },
|
|
123
|
+
b.map((s, g) => {
|
|
124
|
+
const h = x + g;
|
|
125
|
+
return /* @__PURE__ */ i("span", { className: "flex items-center gap-0.5 min-w-0", children: [
|
|
126
|
+
d(s, h),
|
|
127
|
+
h < r.length - 1 && /* @__PURE__ */ e(k, { className: "w-3.5 h-3.5 text-gray-300 flex-shrink-0" })
|
|
128
|
+
] }, s.key);
|
|
129
129
|
})
|
|
130
130
|
]
|
|
131
131
|
}
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const V = {
|
|
135
135
|
solid: {
|
|
136
136
|
blue: "bg-blue-600 text-white hover:bg-blue-700",
|
|
137
137
|
purple: "bg-purple-600 text-white hover:bg-purple-700",
|
|
@@ -156,57 +156,57 @@ const P = {
|
|
|
156
156
|
orange: "text-orange-600 hover:bg-orange-50",
|
|
157
157
|
gray: "text-gray-600 hover:bg-gray-100"
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, Y = {
|
|
160
160
|
sm: "px-2.5 py-1.5 text-xs gap-1.5",
|
|
161
161
|
md: "px-3 py-2 text-sm gap-2"
|
|
162
|
-
},
|
|
162
|
+
}, G = {
|
|
163
163
|
solid: "shadow-sm hover:shadow-md",
|
|
164
164
|
soft: "shadow-sm hover:shadow",
|
|
165
165
|
ghost: ""
|
|
166
166
|
};
|
|
167
|
-
function
|
|
167
|
+
function Z({
|
|
168
168
|
variant: r = "soft",
|
|
169
169
|
tone: t = "blue",
|
|
170
170
|
size: n = "md",
|
|
171
171
|
icon: a,
|
|
172
172
|
loading: o = !1,
|
|
173
173
|
disabled: u = !1,
|
|
174
|
-
type:
|
|
175
|
-
title:
|
|
176
|
-
onClick:
|
|
177
|
-
to:
|
|
178
|
-
href:
|
|
174
|
+
type: l = "button",
|
|
175
|
+
title: c,
|
|
176
|
+
onClick: m,
|
|
177
|
+
to: b,
|
|
178
|
+
href: x,
|
|
179
179
|
target: d,
|
|
180
|
-
className:
|
|
181
|
-
children:
|
|
180
|
+
className: s = "",
|
|
181
|
+
children: g
|
|
182
182
|
}) {
|
|
183
|
-
const
|
|
184
|
-
o ? /* @__PURE__ */ e(
|
|
185
|
-
|
|
183
|
+
const h = `inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-100 cursor-pointer active:scale-[.98] ${Y[n]} ${G[r]} ${V[r][t]} ${s}`, p = /* @__PURE__ */ i(N, { children: [
|
|
184
|
+
o ? /* @__PURE__ */ e(z, { className: "w-4 h-4 animate-spin" }) : a,
|
|
185
|
+
g
|
|
186
186
|
] });
|
|
187
|
-
return
|
|
187
|
+
return b ? /* @__PURE__ */ e(v, { to: b, className: h, title: c, children: p }) : x ? /* @__PURE__ */ e(
|
|
188
188
|
"a",
|
|
189
189
|
{
|
|
190
|
-
href:
|
|
190
|
+
href: x,
|
|
191
191
|
target: d,
|
|
192
192
|
rel: d === "_blank" ? "noopener noreferrer" : void 0,
|
|
193
|
-
className:
|
|
194
|
-
title:
|
|
195
|
-
children:
|
|
193
|
+
className: h,
|
|
194
|
+
title: c,
|
|
195
|
+
children: p
|
|
196
196
|
}
|
|
197
197
|
) : /* @__PURE__ */ e(
|
|
198
198
|
"button",
|
|
199
199
|
{
|
|
200
|
-
type:
|
|
201
|
-
onClick:
|
|
200
|
+
type: l,
|
|
201
|
+
onClick: m,
|
|
202
202
|
disabled: u || o,
|
|
203
|
-
title:
|
|
204
|
-
className: `${
|
|
205
|
-
children:
|
|
203
|
+
title: c,
|
|
204
|
+
className: `${h} disabled:opacity-50 disabled:cursor-not-allowed`,
|
|
205
|
+
children: p
|
|
206
206
|
}
|
|
207
207
|
);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function L({
|
|
210
210
|
className: r = "",
|
|
211
211
|
children: t
|
|
212
212
|
}) {
|
|
@@ -218,27 +218,27 @@ function T({
|
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function se({
|
|
222
222
|
icon: r,
|
|
223
223
|
title: t,
|
|
224
224
|
theme: n,
|
|
225
225
|
count: a,
|
|
226
226
|
actions: o,
|
|
227
227
|
bodyClassName: u = "p-5",
|
|
228
|
-
className:
|
|
229
|
-
children:
|
|
228
|
+
className: l = "",
|
|
229
|
+
children: c
|
|
230
230
|
}) {
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ i(L, { className: `overflow-hidden ${l}`, children: [
|
|
232
|
+
/* @__PURE__ */ i(
|
|
233
233
|
"div",
|
|
234
234
|
{
|
|
235
235
|
className: `px-4 py-3 flex items-center justify-between border-b border-black/5 ${n.header}`,
|
|
236
236
|
children: [
|
|
237
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ i("h4", { className: "text-sm font-semibold flex items-center", children: [
|
|
238
238
|
r && /* @__PURE__ */ e(r, { className: "w-4 h-4 mr-2" }),
|
|
239
239
|
t
|
|
240
240
|
] }),
|
|
241
|
-
(o || a !== void 0) && /* @__PURE__ */
|
|
241
|
+
(o || a !== void 0) && /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
242
242
|
o,
|
|
243
243
|
a !== void 0 && /* @__PURE__ */ e(
|
|
244
244
|
"span",
|
|
@@ -251,29 +251,29 @@ function te({
|
|
|
251
251
|
]
|
|
252
252
|
}
|
|
253
253
|
),
|
|
254
|
-
/* @__PURE__ */ e("div", { className: u, children:
|
|
254
|
+
/* @__PURE__ */ e("div", { className: u, children: c })
|
|
255
255
|
] });
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const q = {
|
|
258
258
|
red: { accent: "border-l-red-500", chip: "bg-red-50 text-red-600" },
|
|
259
259
|
amber: { accent: "border-l-amber-500", chip: "bg-amber-50 text-amber-700" }
|
|
260
260
|
};
|
|
261
|
-
function
|
|
261
|
+
function le({
|
|
262
262
|
tone: r = "red",
|
|
263
263
|
title: t,
|
|
264
264
|
severity: n,
|
|
265
265
|
action: a,
|
|
266
266
|
children: o
|
|
267
267
|
}) {
|
|
268
|
-
const { accent: u, chip:
|
|
269
|
-
return /* @__PURE__ */ e(
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
268
|
+
const { accent: u, chip: l } = q[r];
|
|
269
|
+
return /* @__PURE__ */ e(L, { className: `border-l-4 ${u} px-5 py-4`, children: /* @__PURE__ */ i("div", { className: "flex items-start justify-between gap-4", children: [
|
|
270
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
271
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2.5 flex-wrap", children: [
|
|
272
272
|
/* @__PURE__ */ e("h4", { className: "text-base font-semibold text-gray-900", children: t }),
|
|
273
273
|
n && /* @__PURE__ */ e(
|
|
274
274
|
"span",
|
|
275
275
|
{
|
|
276
|
-
className: `text-[11px] font-bold uppercase tracking-wide px-1.5 py-0.5 rounded ${
|
|
276
|
+
className: `text-[11px] font-bold uppercase tracking-wide px-1.5 py-0.5 rounded ${l}`,
|
|
277
277
|
children: n
|
|
278
278
|
}
|
|
279
279
|
)
|
|
@@ -283,26 +283,26 @@ function ne({
|
|
|
283
283
|
a && /* @__PURE__ */ e("div", { className: "shrink-0 text-sm", children: a })
|
|
284
284
|
] }) });
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function ie({
|
|
287
287
|
icon: r,
|
|
288
288
|
title: t,
|
|
289
289
|
count: n,
|
|
290
290
|
theme: a,
|
|
291
291
|
actions: o,
|
|
292
292
|
footer: u,
|
|
293
|
-
children:
|
|
293
|
+
children: l
|
|
294
294
|
}) {
|
|
295
|
-
return /* @__PURE__ */
|
|
296
|
-
/* @__PURE__ */
|
|
295
|
+
return /* @__PURE__ */ i(L, { className: "overflow-hidden flex flex-col", children: [
|
|
296
|
+
/* @__PURE__ */ i(
|
|
297
297
|
"div",
|
|
298
298
|
{
|
|
299
299
|
className: `px-4 py-3 flex items-center justify-between border-b border-black/5 ${a.header}`,
|
|
300
300
|
children: [
|
|
301
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ i("h4", { className: "text-sm font-semibold flex items-center", children: [
|
|
302
302
|
r && /* @__PURE__ */ e(r, { className: "w-4 h-4 mr-2" }),
|
|
303
303
|
t
|
|
304
304
|
] }),
|
|
305
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
306
306
|
o,
|
|
307
307
|
n !== void 0 && /* @__PURE__ */ e(
|
|
308
308
|
"span",
|
|
@@ -315,35 +315,35 @@ function ae({
|
|
|
315
315
|
]
|
|
316
316
|
}
|
|
317
317
|
),
|
|
318
|
-
/* @__PURE__ */ e("div", { className: "divide-y divide-gray-100", children:
|
|
318
|
+
/* @__PURE__ */ e("div", { className: "divide-y divide-gray-100", children: l }),
|
|
319
319
|
u
|
|
320
320
|
] });
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function de({
|
|
323
323
|
to: r,
|
|
324
324
|
onClick: t,
|
|
325
325
|
hover: n = "hover:bg-gray-50",
|
|
326
326
|
className: a = "",
|
|
327
327
|
children: o
|
|
328
328
|
}) {
|
|
329
|
-
const
|
|
330
|
-
return r ? /* @__PURE__ */ e(
|
|
329
|
+
const l = `flex items-center justify-between px-4 py-3 transition-colors ${n} ${!!(r || t) ? "cursor-pointer" : ""} ${a}`;
|
|
330
|
+
return r ? /* @__PURE__ */ e(v, { to: r, className: l, children: o }) : t ? /* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
332
332
|
{
|
|
333
333
|
type: "button",
|
|
334
334
|
onClick: t,
|
|
335
|
-
className: `w-full text-left ${
|
|
335
|
+
className: `w-full text-left ${l}`,
|
|
336
336
|
children: o
|
|
337
337
|
}
|
|
338
|
-
) : /* @__PURE__ */ e("div", { className:
|
|
338
|
+
) : /* @__PURE__ */ e("div", { className: l, children: o });
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function ce({
|
|
341
341
|
to: r,
|
|
342
342
|
count: t,
|
|
343
343
|
noun: n = "items"
|
|
344
344
|
}) {
|
|
345
|
-
return /* @__PURE__ */
|
|
346
|
-
|
|
345
|
+
return /* @__PURE__ */ i(
|
|
346
|
+
v,
|
|
347
347
|
{
|
|
348
348
|
to: r,
|
|
349
349
|
className: "block px-4 py-2.5 text-sm font-medium text-blue-600 hover:text-blue-700 hover:bg-gray-50 transition-colors",
|
|
@@ -357,15 +357,15 @@ function se({
|
|
|
357
357
|
}
|
|
358
358
|
);
|
|
359
359
|
}
|
|
360
|
-
const
|
|
361
|
-
function
|
|
360
|
+
const J = (r) => `https://flagicons.lipis.dev/flags/4x3/${r.toLowerCase()}.svg`;
|
|
361
|
+
function ge({
|
|
362
362
|
countryCode: r,
|
|
363
363
|
country: t
|
|
364
364
|
}) {
|
|
365
365
|
return r ? /* @__PURE__ */ e(
|
|
366
366
|
"img",
|
|
367
367
|
{
|
|
368
|
-
src:
|
|
368
|
+
src: J(r),
|
|
369
369
|
alt: t || "Country flag",
|
|
370
370
|
className: "w-4 h-3 flex-shrink-0 rounded-sm ring-1 ring-black/5",
|
|
371
371
|
onError: (n) => {
|
|
@@ -374,26 +374,26 @@ function le({
|
|
|
374
374
|
}
|
|
375
375
|
) : null;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function ue({
|
|
378
378
|
to: r,
|
|
379
379
|
onClick: t,
|
|
380
380
|
children: n
|
|
381
381
|
}) {
|
|
382
|
-
const a = "inline-flex items-center gap-2 text-sm font-medium text-gray-600 hover:text-gray-900 transition-colors cursor-pointer", o = /* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */ e(
|
|
382
|
+
const a = "inline-flex items-center gap-2 text-sm font-medium text-gray-600 hover:text-gray-900 transition-colors cursor-pointer", o = /* @__PURE__ */ i(N, { children: [
|
|
383
|
+
/* @__PURE__ */ e(K, { className: "w-4 h-4" }),
|
|
384
384
|
/* @__PURE__ */ e("span", { children: n })
|
|
385
385
|
] });
|
|
386
|
-
return r ? /* @__PURE__ */ e(
|
|
386
|
+
return r ? /* @__PURE__ */ e(v, { to: r, className: a, children: o }) : /* @__PURE__ */ e("button", { type: "button", onClick: t, className: a, children: o });
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function be({
|
|
389
389
|
items: r,
|
|
390
390
|
actions: t
|
|
391
391
|
}) {
|
|
392
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ i("div", { className: "border-b border-gray-200 flex items-end justify-between gap-4", children: [
|
|
393
393
|
/* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: r.map((n) => {
|
|
394
394
|
const a = n.active ? "py-2 px-1 border-b-2 border-blue-500 text-blue-600 font-medium text-sm" : "py-2 px-1 border-b-2 border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 font-medium text-sm transition-colors cursor-pointer";
|
|
395
395
|
return n.to && !n.active ? /* @__PURE__ */ e(
|
|
396
|
-
|
|
396
|
+
v,
|
|
397
397
|
{
|
|
398
398
|
to: n.to,
|
|
399
399
|
state: n.state,
|
|
@@ -406,9 +406,9 @@ function de({
|
|
|
406
406
|
t && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 pb-1.5", children: t })
|
|
407
407
|
] });
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function me({ items: r }) {
|
|
410
410
|
return /* @__PURE__ */ e("nav", { className: "space-y-1", children: r.map((t) => {
|
|
411
|
-
const n = t.icon, a = `group/side relative flex items-center gap-3 h-10 rounded-md px-3 text-sm transition-all duration-200 cursor-pointer ${t.active ? "bg-blue-50 text-blue-700 font-medium" : "text-gray-600 hover:bg-gray-100 hover:text-gray-900"}`, o = /* @__PURE__ */
|
|
411
|
+
const n = t.icon, a = `group/side relative flex items-center gap-3 h-10 rounded-md px-3 text-sm transition-all duration-200 cursor-pointer ${t.active ? "bg-blue-50 text-blue-700 font-medium" : "text-gray-600 hover:bg-gray-100 hover:text-gray-900"}`, o = /* @__PURE__ */ i(N, { children: [
|
|
412
412
|
/* @__PURE__ */ e(
|
|
413
413
|
"span",
|
|
414
414
|
{
|
|
@@ -418,87 +418,87 @@ function ce({ items: r }) {
|
|
|
418
418
|
n && /* @__PURE__ */ e(n, { className: "w-[18px] h-[18px] shrink-0 transition-transform duration-200 group-hover/side:scale-110" }),
|
|
419
419
|
/* @__PURE__ */ e("span", { className: "truncate", children: t.label })
|
|
420
420
|
] });
|
|
421
|
-
return t.active ? /* @__PURE__ */ e("span", { className: a, "aria-current": "page", children: o }, t.to) : /* @__PURE__ */ e(
|
|
421
|
+
return t.active ? /* @__PURE__ */ e("span", { className: a, "aria-current": "page", children: o }, t.to) : /* @__PURE__ */ e(v, { to: t.to, className: a, children: o }, t.to);
|
|
422
422
|
}) });
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function he({
|
|
425
425
|
label: r,
|
|
426
426
|
icon: t,
|
|
427
427
|
iconClassName: n = "text-gray-400",
|
|
428
428
|
children: a
|
|
429
429
|
}) {
|
|
430
|
-
return /* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-4", children: [
|
|
431
|
+
/* @__PURE__ */ i("span", { className: "text-gray-700 flex items-center flex-shrink-0", children: [
|
|
432
432
|
t && /* @__PURE__ */ e(t, { className: `w-4 h-4 mr-2 ${n}` }),
|
|
433
433
|
r
|
|
434
434
|
] }),
|
|
435
435
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-900 text-right min-w-0", children: a })
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
|
-
const
|
|
438
|
+
const Q = {
|
|
439
439
|
blue: "text-blue-600",
|
|
440
440
|
purple: "text-purple-600",
|
|
441
441
|
red: "text-red-600",
|
|
442
442
|
green: "text-green-600",
|
|
443
443
|
orange: "text-orange-600",
|
|
444
444
|
gray: "text-gray-500"
|
|
445
|
-
},
|
|
446
|
-
function
|
|
445
|
+
}, A = "w-full flex items-start gap-3 px-3 py-2 text-left transition-colors hover:bg-gray-50 cursor-pointer";
|
|
446
|
+
function pe({
|
|
447
447
|
label: r,
|
|
448
448
|
items: t,
|
|
449
449
|
icon: n,
|
|
450
450
|
variant: a = "soft",
|
|
451
451
|
tone: o = "gray",
|
|
452
452
|
size: u = "md",
|
|
453
|
-
align:
|
|
454
|
-
className:
|
|
453
|
+
align: l = "right",
|
|
454
|
+
className: c = ""
|
|
455
455
|
}) {
|
|
456
|
-
const [
|
|
457
|
-
return
|
|
458
|
-
if (!
|
|
459
|
-
const d = (
|
|
460
|
-
var
|
|
461
|
-
(
|
|
462
|
-
},
|
|
463
|
-
|
|
456
|
+
const [m, b] = E(!1), x = j(null);
|
|
457
|
+
return D(() => {
|
|
458
|
+
if (!m) return;
|
|
459
|
+
const d = (g) => {
|
|
460
|
+
var h;
|
|
461
|
+
(h = x.current) != null && h.contains(g.target) || b(!1);
|
|
462
|
+
}, s = (g) => {
|
|
463
|
+
g.key === "Escape" && b(!1);
|
|
464
464
|
};
|
|
465
|
-
return document.addEventListener("mousedown", d), document.addEventListener("keydown",
|
|
466
|
-
document.removeEventListener("mousedown", d), document.removeEventListener("keydown",
|
|
465
|
+
return document.addEventListener("mousedown", d), document.addEventListener("keydown", s), () => {
|
|
466
|
+
document.removeEventListener("mousedown", d), document.removeEventListener("keydown", s);
|
|
467
467
|
};
|
|
468
|
-
}, [
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
-
|
|
468
|
+
}, [m]), /* @__PURE__ */ i("div", { className: `relative ${c}`, ref: x, children: [
|
|
469
|
+
/* @__PURE__ */ i(
|
|
470
|
+
Z,
|
|
471
471
|
{
|
|
472
472
|
variant: a,
|
|
473
473
|
tone: o,
|
|
474
474
|
size: u,
|
|
475
475
|
icon: n,
|
|
476
|
-
onClick: () =>
|
|
476
|
+
onClick: () => b((d) => !d),
|
|
477
477
|
children: [
|
|
478
478
|
r,
|
|
479
479
|
/* @__PURE__ */ e(
|
|
480
|
-
|
|
480
|
+
P,
|
|
481
481
|
{
|
|
482
|
-
className: `w-4 h-4 transition-transform duration-200 ${
|
|
482
|
+
className: `w-4 h-4 transition-transform duration-200 ${m ? "rotate-180" : ""}`
|
|
483
483
|
}
|
|
484
484
|
)
|
|
485
485
|
]
|
|
486
486
|
}
|
|
487
487
|
),
|
|
488
|
-
|
|
488
|
+
m && /* @__PURE__ */ e(
|
|
489
489
|
"div",
|
|
490
490
|
{
|
|
491
|
-
className: `absolute ${
|
|
492
|
-
children: t.map((d,
|
|
493
|
-
const
|
|
491
|
+
className: `absolute ${l === "right" ? "right-0" : "left-0"} mt-2 w-64 py-1 bg-white rounded-lg shadow-lg border border-gray-200 z-50 animate-dropdown-in`,
|
|
492
|
+
children: t.map((d, s) => {
|
|
493
|
+
const g = Q[d.tone ?? "gray"], h = /* @__PURE__ */ i(N, { children: [
|
|
494
494
|
d.icon && /* @__PURE__ */ e(
|
|
495
495
|
"span",
|
|
496
496
|
{
|
|
497
|
-
className: `flex items-center gap-1 mt-0.5 flex-shrink-0 ${
|
|
497
|
+
className: `flex items-center gap-1 mt-0.5 flex-shrink-0 ${g}`,
|
|
498
498
|
children: d.icon
|
|
499
499
|
}
|
|
500
500
|
),
|
|
501
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ i("span", { className: "min-w-0", children: [
|
|
502
502
|
/* @__PURE__ */ e("span", { className: "block text-sm font-medium text-gray-900", children: d.label }),
|
|
503
503
|
d.description && /* @__PURE__ */ e("span", { className: "block text-xs text-gray-500 mt-0.5 break-all", children: d.description })
|
|
504
504
|
] })
|
|
@@ -509,31 +509,31 @@ function ue({
|
|
|
509
509
|
href: d.href,
|
|
510
510
|
target: d.target,
|
|
511
511
|
rel: d.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
512
|
-
className:
|
|
513
|
-
onClick: () =>
|
|
514
|
-
children:
|
|
512
|
+
className: A,
|
|
513
|
+
onClick: () => b(!1),
|
|
514
|
+
children: h
|
|
515
515
|
},
|
|
516
|
-
|
|
516
|
+
s
|
|
517
517
|
) : /* @__PURE__ */ e(
|
|
518
518
|
"button",
|
|
519
519
|
{
|
|
520
520
|
type: "button",
|
|
521
521
|
disabled: d.disabled,
|
|
522
522
|
onClick: () => {
|
|
523
|
-
var
|
|
524
|
-
d.keepOpen ||
|
|
523
|
+
var p;
|
|
524
|
+
d.keepOpen || b(!1), (p = d.onClick) == null || p.call(d);
|
|
525
525
|
},
|
|
526
|
-
className: `${
|
|
527
|
-
children:
|
|
526
|
+
className: `${A} disabled:opacity-50 disabled:cursor-not-allowed`,
|
|
527
|
+
children: h
|
|
528
528
|
},
|
|
529
|
-
|
|
529
|
+
s
|
|
530
530
|
);
|
|
531
531
|
})
|
|
532
532
|
}
|
|
533
533
|
)
|
|
534
534
|
] });
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function xe({
|
|
537
537
|
className: r = "space-y-6",
|
|
538
538
|
children: t
|
|
539
539
|
}) {
|
|
@@ -545,32 +545,32 @@ function be({
|
|
|
545
545
|
}
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function fe({
|
|
549
549
|
value: r,
|
|
550
550
|
onChange: t,
|
|
551
551
|
placeholder: n = "Search...",
|
|
552
552
|
className: a = "w-full",
|
|
553
553
|
slashToFocus: o = !1
|
|
554
554
|
}) {
|
|
555
|
-
const u =
|
|
556
|
-
return
|
|
555
|
+
const u = j(null);
|
|
556
|
+
return D(() => {
|
|
557
557
|
if (!o) return;
|
|
558
|
-
function
|
|
559
|
-
var
|
|
560
|
-
if (
|
|
561
|
-
const
|
|
562
|
-
|
|
558
|
+
function l(c) {
|
|
559
|
+
var b;
|
|
560
|
+
if (c.key !== "/" || c.ctrlKey || c.metaKey || c.altKey) return;
|
|
561
|
+
const m = c.target;
|
|
562
|
+
m.tagName === "INPUT" || m.tagName === "TEXTAREA" || m.tagName === "SELECT" || m.isContentEditable || (c.preventDefault(), (b = u.current) == null || b.focus());
|
|
563
563
|
}
|
|
564
|
-
return document.addEventListener("keydown",
|
|
565
|
-
}, [o]), /* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */ e(
|
|
564
|
+
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
565
|
+
}, [o]), /* @__PURE__ */ i("div", { className: `relative ${a}`, children: [
|
|
566
|
+
/* @__PURE__ */ e(U, { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 w-4 h-4 pointer-events-none" }),
|
|
567
567
|
/* @__PURE__ */ e(
|
|
568
568
|
"input",
|
|
569
569
|
{
|
|
570
570
|
ref: u,
|
|
571
571
|
type: "text",
|
|
572
572
|
value: r,
|
|
573
|
-
onChange: (
|
|
573
|
+
onChange: (l) => t(l.target.value),
|
|
574
574
|
placeholder: n,
|
|
575
575
|
className: "w-full pl-10 pr-10 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm text-gray-900 placeholder-gray-400"
|
|
576
576
|
}
|
|
@@ -578,7 +578,7 @@ function me({
|
|
|
578
578
|
o && !r && /* @__PURE__ */ e("kbd", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 text-xs border border-gray-300 rounded px-1 py-0.5 font-mono leading-none pointer-events-none", children: "/" })
|
|
579
579
|
] });
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function ye({
|
|
582
582
|
value: r,
|
|
583
583
|
onChange: t,
|
|
584
584
|
children: n,
|
|
@@ -591,14 +591,14 @@ function pe({
|
|
|
591
591
|
{
|
|
592
592
|
id: a,
|
|
593
593
|
value: r,
|
|
594
|
-
onChange: (
|
|
594
|
+
onChange: (l) => t(l.target.value),
|
|
595
595
|
disabled: u,
|
|
596
596
|
className: `px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 text-sm disabled:opacity-50 ${o}`,
|
|
597
597
|
children: n
|
|
598
598
|
}
|
|
599
599
|
);
|
|
600
600
|
}
|
|
601
|
-
const
|
|
601
|
+
const W = {
|
|
602
602
|
neutral: { badge: "bg-gray-100", icon: "text-gray-400" },
|
|
603
603
|
green: { badge: "bg-green-100", icon: "text-green-600" },
|
|
604
604
|
blue: { badge: "bg-blue-100", icon: "text-blue-600" },
|
|
@@ -606,14 +606,14 @@ const G = {
|
|
|
606
606
|
red: { badge: "bg-red-100", icon: "text-red-600" },
|
|
607
607
|
purple: { badge: "bg-purple-100", icon: "text-purple-600" }
|
|
608
608
|
};
|
|
609
|
-
function
|
|
609
|
+
function ve({
|
|
610
610
|
icon: r,
|
|
611
611
|
label: t,
|
|
612
612
|
value: n,
|
|
613
613
|
tone: a = "neutral"
|
|
614
614
|
}) {
|
|
615
|
-
const o =
|
|
616
|
-
return /* @__PURE__ */
|
|
615
|
+
const o = W[a];
|
|
616
|
+
return /* @__PURE__ */ i("div", { className: "flex items-center gap-4", children: [
|
|
617
617
|
/* @__PURE__ */ e(
|
|
618
618
|
"div",
|
|
619
619
|
{
|
|
@@ -621,148 +621,162 @@ function he({
|
|
|
621
621
|
children: /* @__PURE__ */ e(r, { className: `w-6 h-6 ${o.icon}` })
|
|
622
622
|
}
|
|
623
623
|
),
|
|
624
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ i("div", { children: [
|
|
625
625
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-500", children: t }),
|
|
626
626
|
/* @__PURE__ */ e("p", { className: "text-3xl font-bold text-gray-900 tabular-nums", children: n })
|
|
627
627
|
] })
|
|
628
628
|
] });
|
|
629
629
|
}
|
|
630
|
-
const
|
|
630
|
+
const O = {
|
|
631
631
|
ok: "bg-green-500",
|
|
632
632
|
down: "bg-red-500",
|
|
633
633
|
unknown: "bg-gray-300"
|
|
634
|
-
},
|
|
635
|
-
function
|
|
634
|
+
}, R = (r) => `${(r * 100).toFixed(4)}%`;
|
|
635
|
+
function Ne({
|
|
636
636
|
from: r,
|
|
637
637
|
to: t,
|
|
638
638
|
spans: n,
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
639
|
+
coverageFrom: a,
|
|
640
|
+
buckets: o = 48,
|
|
641
|
+
height: u = "1.75rem",
|
|
642
|
+
renderTooltip: l
|
|
642
643
|
}) {
|
|
643
|
-
const [
|
|
644
|
-
if (!(
|
|
645
|
-
const
|
|
646
|
-
const
|
|
647
|
-
let
|
|
648
|
-
for (const
|
|
649
|
-
const
|
|
650
|
-
|
|
644
|
+
const [c, m] = E(null), b = r.getTime(), x = t.getTime() - b;
|
|
645
|
+
if (!(x > 0)) return null;
|
|
646
|
+
const d = a == null ? void 0 : a.getTime(), s = x / o, g = Array.from({ length: o }, (p, f) => {
|
|
647
|
+
const y = b + f * s, w = y + s, M = d !== void 0 ? Math.max(0, Math.min(w, d) - y) : 0;
|
|
648
|
+
let $ = 0;
|
|
649
|
+
for (const C of n) {
|
|
650
|
+
const S = Math.max(C.start.getTime(), y), _ = Math.min(C.end.getTime(), w);
|
|
651
|
+
_ > S && ($ += _ - S);
|
|
651
652
|
}
|
|
653
|
+
const B = Math.max(1, s - M);
|
|
652
654
|
return {
|
|
653
|
-
start: new Date(
|
|
654
|
-
end: new Date(
|
|
655
|
-
downMs:
|
|
656
|
-
|
|
655
|
+
start: new Date(y),
|
|
656
|
+
end: new Date(w),
|
|
657
|
+
downMs: $,
|
|
658
|
+
unknownMs: M,
|
|
659
|
+
ratio: 1 - $ / B
|
|
657
660
|
};
|
|
658
661
|
});
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
|
|
662
|
+
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
663
|
+
c !== null && l && /* @__PURE__ */ e(
|
|
661
664
|
"div",
|
|
662
665
|
{
|
|
663
666
|
className: "pointer-events-none absolute bottom-full z-10 mb-2 whitespace-nowrap rounded-md bg-gray-900 px-2 py-1.5 text-[11px] leading-tight text-white shadow-lg",
|
|
664
|
-
style: ((
|
|
665
|
-
const
|
|
666
|
-
return
|
|
667
|
-
})(
|
|
668
|
-
children:
|
|
667
|
+
style: ((p) => {
|
|
668
|
+
const f = (p + 0.5) / o;
|
|
669
|
+
return f < 0.15 ? { left: 0 } : f > 0.85 ? { right: 0 } : { left: `${f * 100}%`, transform: "translateX(-50%)" };
|
|
670
|
+
})(c),
|
|
671
|
+
children: l(g[c])
|
|
669
672
|
}
|
|
670
673
|
),
|
|
671
674
|
/* @__PURE__ */ e(
|
|
672
675
|
"div",
|
|
673
676
|
{
|
|
674
677
|
className: "flex items-stretch gap-[2px]",
|
|
675
|
-
style: { height:
|
|
676
|
-
onMouseLeave: () =>
|
|
677
|
-
children:
|
|
678
|
+
style: { height: u },
|
|
679
|
+
onMouseLeave: () => m(null),
|
|
680
|
+
children: g.map((p, f) => /* @__PURE__ */ i(
|
|
678
681
|
"div",
|
|
679
682
|
{
|
|
680
|
-
onMouseEnter: () =>
|
|
681
|
-
className: `relative z-10 min-w-[2px] flex-1 cursor-pointer overflow-hidden rounded-[2px] bg-emerald-500 transition-opacity ${
|
|
682
|
-
children:
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
683
|
+
onMouseEnter: () => m(f),
|
|
684
|
+
className: `relative z-10 min-w-[2px] flex-1 cursor-pointer overflow-hidden rounded-[2px] bg-emerald-500 transition-opacity ${c === f ? "opacity-60" : ""}`,
|
|
685
|
+
children: [
|
|
686
|
+
p.unknownMs > 0 && /* @__PURE__ */ e(
|
|
687
|
+
"div",
|
|
688
|
+
{
|
|
689
|
+
className: "absolute inset-y-0 left-0 bg-gray-300",
|
|
690
|
+
style: { width: `${p.unknownMs / s * 100}%` }
|
|
691
|
+
}
|
|
692
|
+
),
|
|
693
|
+
p.downMs > 0 && /* @__PURE__ */ e(
|
|
694
|
+
"div",
|
|
695
|
+
{
|
|
696
|
+
className: "absolute inset-x-0 bottom-0 bg-red-500",
|
|
697
|
+
style: {
|
|
698
|
+
height: `max(3px, ${p.downMs / s * 100}%)`
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
)
|
|
702
|
+
]
|
|
689
703
|
},
|
|
690
|
-
|
|
704
|
+
p.start.getTime()
|
|
691
705
|
))
|
|
692
706
|
}
|
|
693
707
|
)
|
|
694
708
|
] });
|
|
695
709
|
}
|
|
696
|
-
function
|
|
710
|
+
function we({
|
|
697
711
|
from: r,
|
|
698
712
|
to: t,
|
|
699
713
|
lanes: n,
|
|
700
714
|
baseline: a = "ok",
|
|
701
715
|
ticks: o = 5,
|
|
702
|
-
formatTick: u = (
|
|
703
|
-
labelWidth:
|
|
704
|
-
rowHeight:
|
|
705
|
-
emptyLabel:
|
|
716
|
+
formatTick: u = (b) => b.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }),
|
|
717
|
+
labelWidth: l = "8rem",
|
|
718
|
+
rowHeight: c = "1.25rem",
|
|
719
|
+
emptyLabel: m = "No data"
|
|
706
720
|
}) {
|
|
707
|
-
const
|
|
708
|
-
if (!(
|
|
709
|
-
return /* @__PURE__ */ e("div", { className: "py-8 text-center text-sm text-gray-500", children:
|
|
721
|
+
const b = r.getTime(), x = t.getTime() - b;
|
|
722
|
+
if (!(x > 0) || n.length === 0)
|
|
723
|
+
return /* @__PURE__ */ e("div", { className: "py-8 text-center text-sm text-gray-500", children: m });
|
|
710
724
|
const d = Array.from(
|
|
711
725
|
{ length: Math.max(2, o) },
|
|
712
|
-
(
|
|
726
|
+
(s, g) => new Date(b + x * g / (Math.max(2, o) - 1))
|
|
713
727
|
);
|
|
714
|
-
return /* @__PURE__ */
|
|
715
|
-
n.map((
|
|
728
|
+
return /* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
729
|
+
n.map((s) => /* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
716
730
|
/* @__PURE__ */ e(
|
|
717
731
|
"div",
|
|
718
732
|
{
|
|
719
733
|
className: "shrink-0 truncate font-mono text-xs text-gray-600",
|
|
720
|
-
style: { width:
|
|
721
|
-
title:
|
|
722
|
-
children:
|
|
734
|
+
style: { width: l },
|
|
735
|
+
title: s.name,
|
|
736
|
+
children: s.label ?? s.name
|
|
723
737
|
}
|
|
724
738
|
),
|
|
725
739
|
/* @__PURE__ */ e(
|
|
726
740
|
"div",
|
|
727
741
|
{
|
|
728
|
-
className: `relative flex-1 overflow-hidden rounded-sm ${
|
|
729
|
-
style: { height:
|
|
730
|
-
children:
|
|
731
|
-
const
|
|
732
|
-
if (
|
|
733
|
-
const
|
|
742
|
+
className: `relative flex-1 overflow-hidden rounded-sm ${O[a]}`,
|
|
743
|
+
style: { height: c },
|
|
744
|
+
children: s.spans.map((g) => {
|
|
745
|
+
const h = Math.max(g.start.getTime(), b), p = Math.min(g.end.getTime(), b + x);
|
|
746
|
+
if (p <= h) return null;
|
|
747
|
+
const f = (h - b) / x, y = (p - h) / x;
|
|
734
748
|
return /* @__PURE__ */ e(
|
|
735
749
|
"div",
|
|
736
750
|
{
|
|
737
|
-
className: `absolute inset-y-0 ${
|
|
751
|
+
className: `absolute inset-y-0 ${O[g.tone]}`,
|
|
738
752
|
style: {
|
|
739
|
-
left:
|
|
740
|
-
width: `max(2px, ${
|
|
753
|
+
left: R(f),
|
|
754
|
+
width: `max(2px, ${R(y)})`
|
|
741
755
|
},
|
|
742
|
-
title:
|
|
756
|
+
title: g.label
|
|
743
757
|
},
|
|
744
|
-
`${
|
|
758
|
+
`${g.start.getTime()}-${g.end.getTime()}`
|
|
745
759
|
);
|
|
746
760
|
})
|
|
747
761
|
}
|
|
748
762
|
),
|
|
749
|
-
|
|
750
|
-
] },
|
|
763
|
+
s.trailing !== void 0 && /* @__PURE__ */ e("div", { className: "w-16 shrink-0 text-right font-mono text-xs tabular-nums text-gray-600", children: s.trailing })
|
|
764
|
+
] }, s.name)),
|
|
751
765
|
/* @__PURE__ */ e(
|
|
752
766
|
"div",
|
|
753
767
|
{
|
|
754
768
|
className: "flex justify-between pt-1 text-[11px] tabular-nums text-gray-400",
|
|
755
769
|
style: {
|
|
756
|
-
marginLeft:
|
|
770
|
+
marginLeft: l,
|
|
757
771
|
paddingLeft: "0.75rem",
|
|
758
|
-
marginRight: n.some((
|
|
772
|
+
marginRight: n.some((s) => s.trailing !== void 0) ? "4rem" : void 0
|
|
759
773
|
},
|
|
760
|
-
children: d.map((
|
|
774
|
+
children: d.map((s) => /* @__PURE__ */ e("span", { children: u(s) }, s.getTime()))
|
|
761
775
|
}
|
|
762
776
|
)
|
|
763
777
|
] });
|
|
764
778
|
}
|
|
765
|
-
const
|
|
779
|
+
const $e = {
|
|
766
780
|
blue: {
|
|
767
781
|
header: "bg-blue-50 text-blue-800",
|
|
768
782
|
hover: "hover:bg-blue-50",
|
|
@@ -804,7 +818,7 @@ const ye = {
|
|
|
804
818
|
badge: "bg-gray-200 text-gray-700"
|
|
805
819
|
}
|
|
806
820
|
};
|
|
807
|
-
function
|
|
821
|
+
function ke({
|
|
808
822
|
toast: r,
|
|
809
823
|
onClose: t
|
|
810
824
|
}) {
|
|
@@ -812,8 +826,8 @@ function ve({
|
|
|
812
826
|
"div",
|
|
813
827
|
{
|
|
814
828
|
className: `fixed top-4 right-4 z-50 p-4 rounded-lg shadow-lg border transition-all duration-300 ease-in-out ${r.type === "success" ? "bg-green-50 text-green-800 border-green-200" : "bg-red-50 text-red-800 border-red-200"}`,
|
|
815
|
-
children: /* @__PURE__ */
|
|
816
|
-
r.type === "success" ? /* @__PURE__ */ e(
|
|
829
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
830
|
+
r.type === "success" ? /* @__PURE__ */ e(X, { className: "w-5 h-5 text-green-600" }) : /* @__PURE__ */ e(T, { className: "w-5 h-5 text-red-600" }),
|
|
817
831
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: r.message }),
|
|
818
832
|
/* @__PURE__ */ e(
|
|
819
833
|
"button",
|
|
@@ -821,7 +835,7 @@ function ve({
|
|
|
821
835
|
type: "button",
|
|
822
836
|
onClick: t,
|
|
823
837
|
className: "ml-2 text-gray-400 hover:text-gray-600 cursor-pointer",
|
|
824
|
-
children: /* @__PURE__ */ e(
|
|
838
|
+
children: /* @__PURE__ */ e(T, { className: "w-4 h-4" })
|
|
825
839
|
}
|
|
826
840
|
)
|
|
827
841
|
] })
|
|
@@ -829,29 +843,29 @@ function ve({
|
|
|
829
843
|
) : null;
|
|
830
844
|
}
|
|
831
845
|
export {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
846
|
+
le as AlertBanner,
|
|
847
|
+
H as BADGE_COLORS,
|
|
848
|
+
ue as BackLink,
|
|
849
|
+
ne as Badge,
|
|
850
|
+
oe as Breadcrumbs,
|
|
851
|
+
Z as Button,
|
|
852
|
+
L as Card,
|
|
853
|
+
ge as CountryFlag,
|
|
854
|
+
pe as DropdownMenu,
|
|
855
|
+
he as InfoRow,
|
|
856
|
+
ae as LabelChip,
|
|
857
|
+
de as ListRow,
|
|
858
|
+
xe as PageContainer,
|
|
859
|
+
se as Panel,
|
|
860
|
+
$e as SECTION_THEMES,
|
|
861
|
+
fe as SearchInput,
|
|
862
|
+
ie as SectionCard,
|
|
863
|
+
ye as Select,
|
|
864
|
+
me as SideNav,
|
|
865
|
+
ve as StatCard,
|
|
866
|
+
we as StateTimeline,
|
|
867
|
+
be as TabNav,
|
|
868
|
+
ke as Toast,
|
|
869
|
+
Ne as UptimeBars,
|
|
870
|
+
ce as ViewAllFooter
|
|
857
871
|
};
|
package/dist/state-timeline.d.ts
CHANGED
|
@@ -23,7 +23,9 @@ export interface UptimeBucket {
|
|
|
23
23
|
end: Date;
|
|
24
24
|
/** Downtime inside this bucket, in ms. */
|
|
25
25
|
downMs: number;
|
|
26
|
-
/**
|
|
26
|
+
/** Unobserved time inside this bucket (before `coverageFrom`), in ms. */
|
|
27
|
+
unknownMs: number;
|
|
28
|
+
/** Fraction of the *observed* part of the bucket spent up, 0..1. */
|
|
27
29
|
ratio: number;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
@@ -35,11 +37,14 @@ export interface UptimeBucket {
|
|
|
35
37
|
* "briefly down", a full red bar as "down the whole time", with no intermediate
|
|
36
38
|
* colour whose meaning has to be guessed.
|
|
37
39
|
*/
|
|
38
|
-
export declare function UptimeBars({ from, to, spans, buckets, height, renderTooltip, }: {
|
|
40
|
+
export declare function UptimeBars({ from, to, spans, coverageFrom, buckets, height, renderTooltip, }: {
|
|
39
41
|
from: Date;
|
|
40
42
|
to: Date;
|
|
41
43
|
/** Down intervals in absolute time; clipped to the window. */
|
|
42
44
|
spans: TimelineSpan[];
|
|
45
|
+
/** Start of observed time. Anything before this, within the window, is drawn
|
|
46
|
+
* as unknown rather than up — omit when the whole window is observed. */
|
|
47
|
+
coverageFrom?: Date;
|
|
43
48
|
buckets?: number;
|
|
44
49
|
height?: string;
|
|
45
50
|
/** Hover card contents for a bucket. No tooltip is shown when omitted. */
|