react-os-shell 4.55.0 → 4.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/{Browser-WHBSYGLC.js → Browser-SPTNLEMR.js} +5 -5
- package/dist/{Browser-WHBSYGLC.js.map → Browser-SPTNLEMR.js.map} +1 -1
- package/dist/{Calculator-PHKNMRLX.js → Calculator-XMOPPCK3.js} +4 -4
- package/dist/{Calculator-PHKNMRLX.js.map → Calculator-XMOPPCK3.js.map} +1 -1
- package/dist/{CurrencyConverter-MEG7RHEK.js → CurrencyConverter-24HNX6C6.js} +4 -4
- package/dist/{CurrencyConverter-MEG7RHEK.js.map → CurrencyConverter-24HNX6C6.js.map} +1 -1
- package/dist/{Documents-Y32RNCTU.js → Documents-GMRVVCH7.js} +5 -5
- package/dist/{Documents-Y32RNCTU.js.map → Documents-GMRVVCH7.js.map} +1 -1
- package/dist/{Files-LTG2S2KU.js → Files-ITH4SVML.js} +5 -5
- package/dist/{Files-LTG2S2KU.js.map → Files-ITH4SVML.js.map} +1 -1
- package/dist/{Notepad-P7J2OAXD.js → Notepad-GE5P55TL.js} +5 -5
- package/dist/{Notepad-P7J2OAXD.js.map → Notepad-GE5P55TL.js.map} +1 -1
- package/dist/{PomodoroTimer-5B5AFXQH.js → PomodoroTimer-ER5STVKM.js} +4 -4
- package/dist/{PomodoroTimer-5B5AFXQH.js.map → PomodoroTimer-ER5STVKM.js.map} +1 -1
- package/dist/{Preview-XZQ55YGY.js → Preview-UXVDXCDJ.js} +5 -5
- package/dist/{Preview-XZQ55YGY.js.map → Preview-UXVDXCDJ.js.map} +1 -1
- package/dist/{Spreadsheet-KKSLCSIK.js → Spreadsheet-B32JQVX4.js} +5 -5
- package/dist/{Spreadsheet-KKSLCSIK.js.map → Spreadsheet-B32JQVX4.js.map} +1 -1
- package/dist/{Stock-KTWRNBI6.js → Stock-FSFPFDQT.js} +4 -4
- package/dist/{Stock-KTWRNBI6.js.map → Stock-FSFPFDQT.js.map} +1 -1
- package/dist/{Weather-B7MO7N4N.js → Weather-HXOERJJV.js} +4 -4
- package/dist/{Weather-B7MO7N4N.js.map → Weather-HXOERJJV.js.map} +1 -1
- package/dist/{WorldClock-M5MEV74F.js → WorldClock-2FUGLIUZ.js} +4 -4
- package/dist/{WorldClock-M5MEV74F.js.map → WorldClock-2FUGLIUZ.js.map} +1 -1
- package/dist/apps/index.js +15 -15
- package/dist/{chunk-CTTHBTOX.js → chunk-CWA27IGB.js} +499 -95
- package/dist/chunk-CWA27IGB.js.map +1 -0
- package/dist/{chunk-5S65ZC5W.js → chunk-JMESET3G.js} +81 -7
- package/dist/chunk-JMESET3G.js.map +1 -0
- package/dist/{chunk-FHPPPDHL.js → chunk-LYQVLRWQ.js} +3 -3
- package/dist/{chunk-FHPPPDHL.js.map → chunk-LYQVLRWQ.js.map} +1 -1
- package/dist/{chunk-S3ZIBWRY.js → chunk-TO6ZZHJK.js} +4 -4
- package/dist/{chunk-S3ZIBWRY.js.map → chunk-TO6ZZHJK.js.map} +1 -1
- package/dist/chunk-WCGHIJZR.js +7 -0
- package/dist/{chunk-LCLB7YBY.js.map → chunk-WCGHIJZR.js.map} +1 -1
- package/dist/{index-BE0z2D6y.d.ts → index-Ka32s3Ij.d.ts} +135 -2
- package/dist/index.d.ts +29 -8
- package/dist/index.js +56 -18
- package/dist/index.js.map +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-5S65ZC5W.js.map +0 -1
- package/dist/chunk-CTTHBTOX.js.map +0 -1
- package/dist/chunk-LCLB7YBY.js +0 -7
|
@@ -164,7 +164,7 @@ function inputClasses(opts) {
|
|
|
164
164
|
return [shape, opts?.invalid ? INPUT_INVALID : "", INPUT_DISABLED, opts?.className ?? ""].filter(Boolean).join(" ");
|
|
165
165
|
}
|
|
166
166
|
var Input = forwardRef(function Input2({ invalid, leftIcon, rightAdornment, size, className = "", ...rest }, ref) {
|
|
167
|
-
const
|
|
167
|
+
const pad4 = `${leftIcon ? "pl-9" : ""} ${rightAdornment ? "pr-9" : ""}`.trim();
|
|
168
168
|
const field = (
|
|
169
169
|
// `inputMode` needs no plumbing — it rides the native spread onto the
|
|
170
170
|
// <input>, which is how a till sets inputMode="none" to keep the OS
|
|
@@ -174,7 +174,7 @@ var Input = forwardRef(function Input2({ invalid, leftIcon, rightAdornment, size
|
|
|
174
174
|
{
|
|
175
175
|
ref,
|
|
176
176
|
"aria-invalid": invalid || void 0,
|
|
177
|
-
className: inputClasses({ invalid, size, className: [
|
|
177
|
+
className: inputClasses({ invalid, size, className: [pad4, className].filter(Boolean).join(" ") }),
|
|
178
178
|
...rest
|
|
179
179
|
}
|
|
180
180
|
)
|
|
@@ -1500,6 +1500,73 @@ var DatePicker = forwardRef(function DatePicker2({ value, onChange, min, max, in
|
|
|
1500
1500
|
);
|
|
1501
1501
|
});
|
|
1502
1502
|
var DatePicker_default = DatePicker;
|
|
1503
|
+
var TIME = /^\d{2}:\d{2}(:\d{2})?$/;
|
|
1504
|
+
var pad2 = (n) => String(n).padStart(2, "0");
|
|
1505
|
+
function toInputValue2(value, withSeconds) {
|
|
1506
|
+
if (value === null || value === void 0 || value === "") return "";
|
|
1507
|
+
if (value instanceof Date) {
|
|
1508
|
+
if (Number.isNaN(value.getTime())) return "";
|
|
1509
|
+
const base = `${pad2(value.getHours())}:${pad2(value.getMinutes())}`;
|
|
1510
|
+
return withSeconds ? `${base}:${pad2(value.getSeconds())}` : base;
|
|
1511
|
+
}
|
|
1512
|
+
return TIME.test(value) ? value : "";
|
|
1513
|
+
}
|
|
1514
|
+
var TimePicker = forwardRef(function TimePicker2({ value, onChange, min, max, invalid, size, className = "", step, ...rest }, ref) {
|
|
1515
|
+
const withSeconds = step != null && Number(step) < 60;
|
|
1516
|
+
return /* @__PURE__ */ jsx(
|
|
1517
|
+
"input",
|
|
1518
|
+
{
|
|
1519
|
+
ref,
|
|
1520
|
+
type: "time",
|
|
1521
|
+
step,
|
|
1522
|
+
"aria-invalid": invalid || void 0,
|
|
1523
|
+
value: toInputValue2(value, withSeconds),
|
|
1524
|
+
min: toInputValue2(min, withSeconds) || void 0,
|
|
1525
|
+
max: toInputValue2(max, withSeconds) || void 0,
|
|
1526
|
+
onChange: (event) => onChange?.(TIME.test(event.target.value) ? event.target.value : null),
|
|
1527
|
+
className: inputClasses({ invalid, size, className }),
|
|
1528
|
+
...rest
|
|
1529
|
+
}
|
|
1530
|
+
);
|
|
1531
|
+
});
|
|
1532
|
+
var TimePicker_default = TimePicker;
|
|
1533
|
+
var ISO_LOCAL = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/;
|
|
1534
|
+
var pad3 = (n) => String(n).padStart(2, "0");
|
|
1535
|
+
function serialise(date) {
|
|
1536
|
+
return `${date.getFullYear()}-${pad3(date.getMonth() + 1)}-${pad3(date.getDate())}T${pad3(date.getHours())}:${pad3(date.getMinutes())}`;
|
|
1537
|
+
}
|
|
1538
|
+
function toInputValue3(value) {
|
|
1539
|
+
if (value === null || value === void 0 || value === "") return "";
|
|
1540
|
+
if (value instanceof Date) return Number.isNaN(value.getTime()) ? "" : serialise(value);
|
|
1541
|
+
if (ISO_LOCAL.test(value)) return value;
|
|
1542
|
+
return "";
|
|
1543
|
+
}
|
|
1544
|
+
function fromInputValue2(raw) {
|
|
1545
|
+
if (!ISO_LOCAL.test(raw)) return null;
|
|
1546
|
+
const [datePart, timePart] = raw.split("T");
|
|
1547
|
+
const [year, month, day] = datePart.split("-").map(Number);
|
|
1548
|
+
const [hours, minutes, seconds = 0] = timePart.split(":").map(Number);
|
|
1549
|
+
if (hours > 23 || minutes > 59 || seconds > 59) return null;
|
|
1550
|
+
const date = new Date(year, month - 1, day, hours, minutes, seconds);
|
|
1551
|
+
return date.getMonth() === month - 1 && date.getDate() === day ? date : null;
|
|
1552
|
+
}
|
|
1553
|
+
var DateTimePicker = forwardRef(function DateTimePicker2({ value, onChange, min, max, invalid, size, className = "", ...rest }, ref) {
|
|
1554
|
+
return /* @__PURE__ */ jsx(
|
|
1555
|
+
"input",
|
|
1556
|
+
{
|
|
1557
|
+
ref,
|
|
1558
|
+
type: "datetime-local",
|
|
1559
|
+
"aria-invalid": invalid || void 0,
|
|
1560
|
+
value: toInputValue3(value),
|
|
1561
|
+
min: toInputValue3(min) || void 0,
|
|
1562
|
+
max: toInputValue3(max) || void 0,
|
|
1563
|
+
onChange: (event) => onChange?.(fromInputValue2(event.target.value)),
|
|
1564
|
+
className: inputClasses({ invalid, size, className }),
|
|
1565
|
+
...rest
|
|
1566
|
+
}
|
|
1567
|
+
);
|
|
1568
|
+
});
|
|
1569
|
+
var DateTimePicker_default = DateTimePicker;
|
|
1503
1570
|
|
|
1504
1571
|
// src/forms/keypadInput.ts
|
|
1505
1572
|
var MAX_FRACTION_DIGITS = 2;
|
|
@@ -2199,6 +2266,171 @@ function SearchableSelect({
|
|
|
2199
2266
|
)
|
|
2200
2267
|
] });
|
|
2201
2268
|
}
|
|
2269
|
+
function TagInput({
|
|
2270
|
+
value,
|
|
2271
|
+
onChange,
|
|
2272
|
+
options = [],
|
|
2273
|
+
placeholder,
|
|
2274
|
+
allowFreeText = false,
|
|
2275
|
+
invalid,
|
|
2276
|
+
disabled,
|
|
2277
|
+
id,
|
|
2278
|
+
className = ""
|
|
2279
|
+
}) {
|
|
2280
|
+
const [open, setOpen] = useState(false);
|
|
2281
|
+
const [search, setSearch] = useState("");
|
|
2282
|
+
const wrapRef = useRef(null);
|
|
2283
|
+
const inputRef = useRef(null);
|
|
2284
|
+
const menuRef = useRef(null);
|
|
2285
|
+
const menuPos = useDropdownPosition(wrapRef, open);
|
|
2286
|
+
const labelFor = (v) => options.find((o) => o.value === v)?.label ?? v;
|
|
2287
|
+
const available = useMemo(() => {
|
|
2288
|
+
const seen = new Set(value);
|
|
2289
|
+
const out = [];
|
|
2290
|
+
const q = search.trim().toLowerCase();
|
|
2291
|
+
for (const o of options) {
|
|
2292
|
+
if (seen.has(o.value)) continue;
|
|
2293
|
+
seen.add(o.value);
|
|
2294
|
+
if (!q || o.label.toLowerCase().includes(q)) out.push(o);
|
|
2295
|
+
}
|
|
2296
|
+
return out;
|
|
2297
|
+
}, [options, value, search]);
|
|
2298
|
+
const add = (v) => {
|
|
2299
|
+
if (!v || value.includes(v)) {
|
|
2300
|
+
setSearch("");
|
|
2301
|
+
return;
|
|
2302
|
+
}
|
|
2303
|
+
onChange([...value, v]);
|
|
2304
|
+
setSearch("");
|
|
2305
|
+
};
|
|
2306
|
+
const remove = (v) => onChange(value.filter((x) => x !== v));
|
|
2307
|
+
const commitFreeText = () => {
|
|
2308
|
+
const t = search.trim();
|
|
2309
|
+
if (allowFreeText && t) add(t);
|
|
2310
|
+
else setSearch("");
|
|
2311
|
+
};
|
|
2312
|
+
useEffect(() => {
|
|
2313
|
+
if (!open) return;
|
|
2314
|
+
const handler = (e) => {
|
|
2315
|
+
const t = e.target;
|
|
2316
|
+
if (wrapRef.current?.contains(t) || menuRef.current?.contains(t)) return;
|
|
2317
|
+
commitFreeText();
|
|
2318
|
+
setOpen(false);
|
|
2319
|
+
};
|
|
2320
|
+
document.addEventListener("mousedown", handler);
|
|
2321
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
2322
|
+
});
|
|
2323
|
+
const hasMenu = options.length > 0;
|
|
2324
|
+
return /* @__PURE__ */ jsxs("div", { ref: wrapRef, className: "relative", children: [
|
|
2325
|
+
/* @__PURE__ */ jsxs(
|
|
2326
|
+
"div",
|
|
2327
|
+
{
|
|
2328
|
+
onMouseDown: (e) => {
|
|
2329
|
+
if (disabled) return;
|
|
2330
|
+
if (e.target.closest("button")) return;
|
|
2331
|
+
e.preventDefault();
|
|
2332
|
+
inputRef.current?.focus();
|
|
2333
|
+
},
|
|
2334
|
+
className: inputClasses({
|
|
2335
|
+
invalid,
|
|
2336
|
+
className: `flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 focus-within:ring-2 focus-within:ring-blue-400/30 ${disabled ? "bg-gray-50 cursor-not-allowed" : ""} ${className}`
|
|
2337
|
+
}),
|
|
2338
|
+
children: [
|
|
2339
|
+
value.map((v) => /* @__PURE__ */ jsxs("span", { className: "inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-1.5 py-0.5 text-xs font-medium text-blue-700", children: [
|
|
2340
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: labelFor(v) }),
|
|
2341
|
+
!disabled && /* @__PURE__ */ jsx(
|
|
2342
|
+
"button",
|
|
2343
|
+
{
|
|
2344
|
+
type: "button",
|
|
2345
|
+
"aria-label": `Remove ${labelFor(v)}`,
|
|
2346
|
+
onClick: () => remove(v),
|
|
2347
|
+
className: "text-blue-400 hover:text-red-500 focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-500 rounded leading-none",
|
|
2348
|
+
children: "\xD7"
|
|
2349
|
+
}
|
|
2350
|
+
)
|
|
2351
|
+
] }, v)),
|
|
2352
|
+
/* @__PURE__ */ jsx(
|
|
2353
|
+
"input",
|
|
2354
|
+
{
|
|
2355
|
+
id,
|
|
2356
|
+
ref: inputRef,
|
|
2357
|
+
type: "text",
|
|
2358
|
+
autoComplete: "off",
|
|
2359
|
+
role: "combobox",
|
|
2360
|
+
"aria-expanded": open && hasMenu,
|
|
2361
|
+
"aria-invalid": invalid || void 0,
|
|
2362
|
+
disabled,
|
|
2363
|
+
value: search,
|
|
2364
|
+
placeholder: value.length === 0 ? placeholder : void 0,
|
|
2365
|
+
onChange: (e) => {
|
|
2366
|
+
setSearch(e.target.value);
|
|
2367
|
+
setOpen(true);
|
|
2368
|
+
},
|
|
2369
|
+
onFocus: () => {
|
|
2370
|
+
if (!disabled && hasMenu) setOpen(true);
|
|
2371
|
+
},
|
|
2372
|
+
onKeyDown: (e) => {
|
|
2373
|
+
if (e.key === "Enter" || e.key === "," && allowFreeText) {
|
|
2374
|
+
e.preventDefault();
|
|
2375
|
+
const q = search.trim();
|
|
2376
|
+
const matches = q ? available.filter((o) => o.label.toLowerCase().includes(q.toLowerCase())) : [];
|
|
2377
|
+
if (matches.length === 1) add(matches[0].value);
|
|
2378
|
+
else commitFreeText();
|
|
2379
|
+
} else if (e.key === "Backspace" && search === "" && value.length > 0) {
|
|
2380
|
+
remove(value[value.length - 1]);
|
|
2381
|
+
} else if (e.key === "Escape") {
|
|
2382
|
+
setOpen(false);
|
|
2383
|
+
setSearch("");
|
|
2384
|
+
inputRef.current?.blur();
|
|
2385
|
+
} else if (e.key === "Tab") {
|
|
2386
|
+
commitFreeText();
|
|
2387
|
+
setOpen(false);
|
|
2388
|
+
}
|
|
2389
|
+
},
|
|
2390
|
+
className: "min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 focus:outline-none focus:ring-0 disabled:cursor-not-allowed"
|
|
2391
|
+
}
|
|
2392
|
+
)
|
|
2393
|
+
]
|
|
2394
|
+
}
|
|
2395
|
+
),
|
|
2396
|
+
open && hasMenu && createPortal(
|
|
2397
|
+
/* @__PURE__ */ jsx(
|
|
2398
|
+
"div",
|
|
2399
|
+
{
|
|
2400
|
+
ref: menuRef,
|
|
2401
|
+
className: "fixed z-[400] rounded-2xl overflow-hidden",
|
|
2402
|
+
style: {
|
|
2403
|
+
left: menuPos?.left,
|
|
2404
|
+
right: menuPos?.right,
|
|
2405
|
+
top: menuPos?.top,
|
|
2406
|
+
bottom: menuPos?.bottom,
|
|
2407
|
+
minWidth: menuPos?.minWidth,
|
|
2408
|
+
maxWidth: POPUP_MAX_WIDTH,
|
|
2409
|
+
width: "max-content",
|
|
2410
|
+
// Hidden for the first paint until the layout effect measures the
|
|
2411
|
+
// trigger, so the menu never flashes at (0,0).
|
|
2412
|
+
visibility: menuPos ? void 0 : "hidden",
|
|
2413
|
+
...glassStyle()
|
|
2414
|
+
},
|
|
2415
|
+
children: /* @__PURE__ */ jsx("div", { className: "overflow-y-auto", style: { maxHeight: menuPos?.maxHeight ?? MENU_MAX_HEIGHT2 }, children: available.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-3 py-3 text-sm text-gray-400 text-center", children: options.length > 0 && value.length >= options.length ? "All options selected" : "No matches" }) : available.map((o) => /* @__PURE__ */ jsx(
|
|
2416
|
+
"button",
|
|
2417
|
+
{
|
|
2418
|
+
type: "button",
|
|
2419
|
+
onMouseDown: (e) => {
|
|
2420
|
+
e.preventDefault();
|
|
2421
|
+
add(o.value);
|
|
2422
|
+
},
|
|
2423
|
+
className: "w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",
|
|
2424
|
+
children: o.label
|
|
2425
|
+
},
|
|
2426
|
+
o.value
|
|
2427
|
+
)) })
|
|
2428
|
+
}
|
|
2429
|
+
),
|
|
2430
|
+
document.body
|
|
2431
|
+
)
|
|
2432
|
+
] });
|
|
2433
|
+
}
|
|
2202
2434
|
var PADDING = {
|
|
2203
2435
|
none: { body: "", edge: "px-4 py-3" },
|
|
2204
2436
|
sm: { body: "p-3", edge: "px-3 py-2" },
|
|
@@ -2482,23 +2714,23 @@ function DescriptionList({
|
|
|
2482
2714
|
const resolved = typeof columns === "number" ? { base: columns } : columns;
|
|
2483
2715
|
const base = resolved.base ?? 1;
|
|
2484
2716
|
const widest = Math.max(base, resolved.sm ?? 0, resolved.lg ?? 0);
|
|
2485
|
-
const
|
|
2717
|
+
const pad4 = size === "sm" ? "px-3 py-2" : "px-4 py-3";
|
|
2486
2718
|
const text = size === "sm" ? "text-xs" : "text-sm";
|
|
2487
2719
|
return /* @__PURE__ */ jsxs("div", { className: [bordered ? "rounded-lg border border-gray-200 bg-white" : "", className].filter(Boolean).join(" "), children: [
|
|
2488
|
-
title && /* @__PURE__ */ jsx("div", { className: `${
|
|
2720
|
+
title && /* @__PURE__ */ jsx("div", { className: `${pad4} ${bordered ? "border-b border-gray-100" : ""} text-sm font-semibold text-gray-900`.trim(), children: title }),
|
|
2489
2721
|
/* @__PURE__ */ jsx("dl", { className: [
|
|
2490
2722
|
"grid",
|
|
2491
2723
|
COLS2[base],
|
|
2492
2724
|
resolved.sm ? SM[resolved.sm] : "",
|
|
2493
2725
|
resolved.lg ? LG[resolved.lg] : "",
|
|
2494
2726
|
bordered ? "" : "gap-x-6 gap-y-3",
|
|
2495
|
-
bordered ? "" :
|
|
2727
|
+
bordered ? "" : pad4 === "px-4 py-3" ? "py-1" : ""
|
|
2496
2728
|
].filter(Boolean).join(" "), children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
2497
2729
|
"div",
|
|
2498
2730
|
{
|
|
2499
2731
|
className: [
|
|
2500
2732
|
item.span ? SPAN[widest] : "",
|
|
2501
|
-
bordered ? `${
|
|
2733
|
+
bordered ? `${pad4} border-b border-gray-100 last:border-b-0` : ""
|
|
2502
2734
|
].filter(Boolean).join(" "),
|
|
2503
2735
|
children: [
|
|
2504
2736
|
/* @__PURE__ */ jsx("dt", { className: `${text} text-gray-500`, children: item.label }),
|
|
@@ -2867,6 +3099,69 @@ function Tabs({
|
|
|
2867
3099
|
}
|
|
2868
3100
|
);
|
|
2869
3101
|
}
|
|
3102
|
+
var Check = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", fill: "none", className: "h-3.5 w-3.5", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M2.5 6.5L5 9l4.5-5", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
3103
|
+
function Stepper({
|
|
3104
|
+
items,
|
|
3105
|
+
value,
|
|
3106
|
+
onChange,
|
|
3107
|
+
"aria-label": ariaLabel,
|
|
3108
|
+
className = ""
|
|
3109
|
+
}) {
|
|
3110
|
+
const currentIndex = Math.max(0, items.findIndex((s) => s.id === value));
|
|
3111
|
+
return /* @__PURE__ */ jsx("ol", { "aria-label": ariaLabel, className: `flex items-start ${className}`.trim(), children: items.map((step, i) => {
|
|
3112
|
+
const state = i < currentIndex ? "complete" : i === currentIndex ? "current" : "upcoming";
|
|
3113
|
+
const clickable = state === "complete" && !!onChange;
|
|
3114
|
+
const circle = /* @__PURE__ */ jsx(
|
|
3115
|
+
"span",
|
|
3116
|
+
{
|
|
3117
|
+
"aria-hidden": "true",
|
|
3118
|
+
className: [
|
|
3119
|
+
"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors",
|
|
3120
|
+
state === "complete" ? "bg-blue-600 text-white" : "",
|
|
3121
|
+
state === "current" ? "border-2 border-blue-600 bg-white text-blue-600" : "",
|
|
3122
|
+
state === "upcoming" ? "border-2 border-gray-300 bg-white text-gray-400" : ""
|
|
3123
|
+
].filter(Boolean).join(" "),
|
|
3124
|
+
children: state === "complete" ? /* @__PURE__ */ jsx(Check, {}) : i + 1
|
|
3125
|
+
}
|
|
3126
|
+
);
|
|
3127
|
+
const text = /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
3128
|
+
/* @__PURE__ */ jsx("span", { className: `block text-sm font-medium ${state === "upcoming" ? "text-gray-400" : "text-gray-900"}`, children: step.label }),
|
|
3129
|
+
step.description && /* @__PURE__ */ jsx("span", { className: "block text-xs text-gray-500", children: step.description })
|
|
3130
|
+
] });
|
|
3131
|
+
return /* @__PURE__ */ jsxs(
|
|
3132
|
+
"li",
|
|
3133
|
+
{
|
|
3134
|
+
"aria-current": state === "current" ? "step" : void 0,
|
|
3135
|
+
className: `flex items-start gap-2 ${i > 0 ? "flex-1" : ""}`,
|
|
3136
|
+
children: [
|
|
3137
|
+
i > 0 && /* @__PURE__ */ jsx(
|
|
3138
|
+
"span",
|
|
3139
|
+
{
|
|
3140
|
+
"aria-hidden": "true",
|
|
3141
|
+
className: `mt-3.5 h-0.5 flex-1 rounded ${i <= currentIndex ? "bg-blue-600" : "bg-gray-200"}`
|
|
3142
|
+
}
|
|
3143
|
+
),
|
|
3144
|
+
clickable ? /* @__PURE__ */ jsxs(
|
|
3145
|
+
"button",
|
|
3146
|
+
{
|
|
3147
|
+
type: "button",
|
|
3148
|
+
onClick: () => onChange?.(step.id),
|
|
3149
|
+
className: "flex items-start gap-2 text-left rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",
|
|
3150
|
+
children: [
|
|
3151
|
+
circle,
|
|
3152
|
+
text
|
|
3153
|
+
]
|
|
3154
|
+
}
|
|
3155
|
+
) : /* @__PURE__ */ jsxs("span", { className: "flex items-start gap-2", children: [
|
|
3156
|
+
circle,
|
|
3157
|
+
text
|
|
3158
|
+
] })
|
|
3159
|
+
]
|
|
3160
|
+
},
|
|
3161
|
+
step.id
|
|
3162
|
+
);
|
|
3163
|
+
}) });
|
|
3164
|
+
}
|
|
2870
3165
|
function Accordion({
|
|
2871
3166
|
items,
|
|
2872
3167
|
defaultOpenIds = [],
|
|
@@ -3287,8 +3582,8 @@ function formatDate(value) {
|
|
|
3287
3582
|
const dd = String(d).padStart(2, "0");
|
|
3288
3583
|
const mm = String(m).padStart(2, "0");
|
|
3289
3584
|
const yyyy = String(y);
|
|
3290
|
-
const
|
|
3291
|
-
switch (
|
|
3585
|
+
const fmt2 = getUserDateFormat();
|
|
3586
|
+
switch (fmt2) {
|
|
3292
3587
|
case "MM/DD/YYYY":
|
|
3293
3588
|
return `${mm}/${dd}/${yyyy}`;
|
|
3294
3589
|
case "YYYY-MM-DD":
|
|
@@ -4664,9 +4959,28 @@ function DataTable({
|
|
|
4664
4959
|
onRow,
|
|
4665
4960
|
emptyText = "Nothing to show",
|
|
4666
4961
|
footer,
|
|
4962
|
+
virtualized,
|
|
4667
4963
|
className = ""
|
|
4668
4964
|
}) {
|
|
4669
4965
|
const keyOf = (row, i) => typeof rowKey === "function" ? rowKey(row, i) : String(row[rowKey]);
|
|
4966
|
+
const [startRow, setStartRow] = useState(0);
|
|
4967
|
+
const overscan = virtualized?.overscan ?? 6;
|
|
4968
|
+
const onBodyScroll = virtualized ? (e) => {
|
|
4969
|
+
const next = Math.max(0, Math.floor(e.currentTarget.scrollTop / virtualized.rowHeight) - overscan);
|
|
4970
|
+
setStartRow((prev) => prev === next ? prev : next);
|
|
4971
|
+
} : void 0;
|
|
4972
|
+
const windowSize = virtualized ? Math.ceil(virtualized.height / virtualized.rowHeight) + overscan * 2 : data.length;
|
|
4973
|
+
const start = virtualized ? Math.min(startRow, Math.max(0, data.length - windowSize)) : 0;
|
|
4974
|
+
const end = Math.min(data.length, start + windowSize);
|
|
4975
|
+
const topPad = virtualized ? start * virtualized.rowHeight : 0;
|
|
4976
|
+
const bottomPad = virtualized ? (data.length - end) * virtualized.rowHeight : 0;
|
|
4977
|
+
const headRowRef = useRef(null);
|
|
4978
|
+
const [headRowH, setHeadRowH] = useState(0);
|
|
4979
|
+
useLayoutEffect(() => {
|
|
4980
|
+
if (!virtualized) return;
|
|
4981
|
+
const h = headRowRef.current?.offsetHeight ?? 0;
|
|
4982
|
+
setHeadRowH((prev) => prev === h ? prev : h);
|
|
4983
|
+
});
|
|
4670
4984
|
const fieldOf = (col) => col.sortField ?? col.key;
|
|
4671
4985
|
const directionFor = (col) => sort && sort.field === fieldOf(col) ? sort.direction : null;
|
|
4672
4986
|
const toggleSort = (col) => {
|
|
@@ -4682,7 +4996,7 @@ function DataTable({
|
|
|
4682
4996
|
const leaves = columns.flatMap((h) => isGroup(h) ? h.columns : [h]);
|
|
4683
4997
|
const grouped = columns.some(isGroup);
|
|
4684
4998
|
const cellBase = `${PAD[size]} ${size === "sm" ? "text-xs" : "text-sm"}`;
|
|
4685
|
-
const headerCell = (col, ci, rowSpan) => {
|
|
4999
|
+
const headerCell = (col, ci, rowSpan, topOffset = 0) => {
|
|
4686
5000
|
const dir = directionFor(col);
|
|
4687
5001
|
const align = ALIGN2[col.align ?? (col.numeric ? "right" : "left")];
|
|
4688
5002
|
const pinned = col.fixed === "left";
|
|
@@ -4692,13 +5006,20 @@ function DataTable({
|
|
|
4692
5006
|
scope: "col",
|
|
4693
5007
|
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
4694
5008
|
"aria-sort": dir === "asc" ? "ascending" : dir === "desc" ? "descending" : col.sortable && onSortChange ? "none" : void 0,
|
|
4695
|
-
style: {
|
|
5009
|
+
style: {
|
|
5010
|
+
width: col.width,
|
|
5011
|
+
...pinned ? { left: offsets[ci] ?? 0 } : {},
|
|
5012
|
+
// A virtualized header pins to the top of the vertical scroll; one
|
|
5013
|
+
// sticky box can hold both axes, so a pinned column's header corner
|
|
5014
|
+
// stays put in both directions.
|
|
5015
|
+
...virtualized ? { top: topOffset } : {}
|
|
5016
|
+
},
|
|
4696
5017
|
className: [
|
|
4697
5018
|
cellBase,
|
|
4698
5019
|
align,
|
|
4699
5020
|
"font-semibold uppercase tracking-wide text-gray-500",
|
|
4700
5021
|
size === "sm" ? "text-[10px]" : "text-xs",
|
|
4701
|
-
pinned ? "sticky z-10 bg-gray-50" : "",
|
|
5022
|
+
pinned ? virtualized ? "sticky z-20 bg-gray-50" : "sticky z-10 bg-gray-50" : virtualized ? "sticky z-10 bg-gray-50" : "",
|
|
4702
5023
|
col.headerClassName ?? ""
|
|
4703
5024
|
].filter(Boolean).join(" "),
|
|
4704
5025
|
children: col.sortable && onSortChange ? /* @__PURE__ */ jsxs(
|
|
@@ -4725,92 +5046,108 @@ function DataTable({
|
|
|
4725
5046
|
return at;
|
|
4726
5047
|
});
|
|
4727
5048
|
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
4728
|
-
/* @__PURE__ */ jsxs(
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
"
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
const rowProps = onRow?.(row, i);
|
|
4767
|
-
return /* @__PURE__ */ jsx(
|
|
4768
|
-
"tr",
|
|
4769
|
-
{
|
|
4770
|
-
onClick: rowProps?.onClick,
|
|
4771
|
-
...rowProps?.onClick ? {
|
|
4772
|
-
tabIndex: 0,
|
|
4773
|
-
onKeyDown: (e) => {
|
|
4774
|
-
if (e.target !== e.currentTarget) return;
|
|
4775
|
-
if (e.key !== "Enter" && e.key !== " ") return;
|
|
4776
|
-
e.preventDefault();
|
|
4777
|
-
rowProps.onClick?.();
|
|
5049
|
+
/* @__PURE__ */ jsxs(
|
|
5050
|
+
"div",
|
|
5051
|
+
{
|
|
5052
|
+
onScroll: onBodyScroll,
|
|
5053
|
+
style: virtualized ? { maxHeight: virtualized.height } : void 0,
|
|
5054
|
+
className: `relative overflow-x-auto ${virtualized ? "overflow-y-auto" : ""} ${bordered ? "rounded-lg border border-gray-200" : ""}`.trim(),
|
|
5055
|
+
children: [
|
|
5056
|
+
loading && // An overlay rather than replacing the rows: the table keeps its
|
|
5057
|
+
// height and its scroll position, so re-sorting does not throw the
|
|
5058
|
+
// page around under the user.
|
|
5059
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8", role: "status", "aria-live": "polite", children: [
|
|
5060
|
+
/* @__PURE__ */ jsx("span", { className: "h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600" }),
|
|
5061
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading" })
|
|
5062
|
+
] }),
|
|
5063
|
+
/* @__PURE__ */ jsxs("table", { className: "w-full border-collapse tabular-nums", style: minWidth ? { minWidth } : void 0, children: [
|
|
5064
|
+
caption && /* @__PURE__ */ jsx("caption", { className: "sr-only", children: caption }),
|
|
5065
|
+
/* @__PURE__ */ jsxs("thead", { children: [
|
|
5066
|
+
/* @__PURE__ */ jsx("tr", { ref: headRowRef, className: "border-b border-gray-200 bg-gray-50", children: columns.map((h, hi) => {
|
|
5067
|
+
if (isGroup(h)) {
|
|
5068
|
+
return /* @__PURE__ */ jsx(
|
|
5069
|
+
"th",
|
|
5070
|
+
{
|
|
5071
|
+
scope: "colgroup",
|
|
5072
|
+
colSpan: h.columns.length,
|
|
5073
|
+
style: virtualized ? { top: 0 } : void 0,
|
|
5074
|
+
className: [
|
|
5075
|
+
cellBase,
|
|
5076
|
+
"text-center",
|
|
5077
|
+
"font-semibold uppercase tracking-wide text-gray-500",
|
|
5078
|
+
size === "sm" ? "text-[10px]" : "text-xs",
|
|
5079
|
+
"border-b border-gray-200",
|
|
5080
|
+
virtualized ? "sticky z-10 bg-gray-50" : "",
|
|
5081
|
+
h.headerClassName ?? ""
|
|
5082
|
+
].filter(Boolean).join(" "),
|
|
5083
|
+
children: h.title
|
|
5084
|
+
},
|
|
5085
|
+
h.key ?? `group-${hi}`
|
|
5086
|
+
);
|
|
4778
5087
|
}
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
children: leaves.
|
|
4787
|
-
|
|
5088
|
+
return headerCell(h, leaves.indexOf(h), grouped ? 2 : 1);
|
|
5089
|
+
}) }),
|
|
5090
|
+
grouped && /* @__PURE__ */ jsx("tr", { className: "border-b border-gray-200 bg-gray-50", children: columns.flatMap((h) => isGroup(h) ? h.columns : []).map(
|
|
5091
|
+
(col) => headerCell(col, leaves.indexOf(col), 1, headRowH)
|
|
5092
|
+
) })
|
|
5093
|
+
] }),
|
|
5094
|
+
/* @__PURE__ */ jsx("tbody", { children: data.length === 0 && !loading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: leaves.length, className: `${cellBase} py-10 text-center text-gray-500`, children: emptyText }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5095
|
+
topPad > 0 && /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx("td", { colSpan: leaves.length, style: { height: topPad, padding: 0, border: 0 } }) }),
|
|
5096
|
+
data.slice(start, end).map((row, si) => {
|
|
5097
|
+
const i = start + si;
|
|
5098
|
+
const rowProps = onRow?.(row, i);
|
|
4788
5099
|
return /* @__PURE__ */ jsx(
|
|
4789
|
-
"
|
|
5100
|
+
"tr",
|
|
4790
5101
|
{
|
|
4791
|
-
style:
|
|
5102
|
+
style: virtualized ? { height: virtualized.rowHeight } : void 0,
|
|
5103
|
+
onClick: rowProps?.onClick,
|
|
5104
|
+
...rowProps?.onClick ? {
|
|
5105
|
+
tabIndex: 0,
|
|
5106
|
+
onKeyDown: (e) => {
|
|
5107
|
+
if (e.target !== e.currentTarget) return;
|
|
5108
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
5109
|
+
e.preventDefault();
|
|
5110
|
+
rowProps.onClick?.();
|
|
5111
|
+
}
|
|
5112
|
+
} : {},
|
|
4792
5113
|
className: [
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
"
|
|
4797
|
-
col.ellipsis ? "max-w-0 truncate" : "",
|
|
4798
|
-
// A pinned cell needs its own background or the
|
|
4799
|
-
// scrolling columns show through it.
|
|
4800
|
-
pinned ? "sticky z-10 bg-white" : ""
|
|
5114
|
+
"border-b border-gray-100 last:border-b-0",
|
|
5115
|
+
rowProps?.onClick ? "cursor-pointer hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400" : "",
|
|
5116
|
+
rowClassName?.(row, i) ?? "",
|
|
5117
|
+
rowProps?.className ?? ""
|
|
4801
5118
|
].filter(Boolean).join(" "),
|
|
4802
|
-
children:
|
|
5119
|
+
children: leaves.map((col, ci) => {
|
|
5120
|
+
const pinned = col.fixed === "left";
|
|
5121
|
+
return /* @__PURE__ */ jsx(
|
|
5122
|
+
"td",
|
|
5123
|
+
{
|
|
5124
|
+
style: pinned ? { left: offsets[ci] ?? 0 } : void 0,
|
|
5125
|
+
className: [
|
|
5126
|
+
cellBase,
|
|
5127
|
+
ALIGN2[col.align ?? (col.numeric ? "right" : "left")],
|
|
5128
|
+
col.numeric ? "font-mono" : "",
|
|
5129
|
+
"text-gray-900",
|
|
5130
|
+
col.ellipsis ? "max-w-0 truncate" : "",
|
|
5131
|
+
// A pinned cell needs its own background or the
|
|
5132
|
+
// scrolling columns show through it.
|
|
5133
|
+
pinned ? "sticky z-10 bg-white" : ""
|
|
5134
|
+
].filter(Boolean).join(" "),
|
|
5135
|
+
children: col.render ? col.render(row, i) : col.dataIndex ? row[col.dataIndex] : null
|
|
5136
|
+
},
|
|
5137
|
+
col.key
|
|
5138
|
+
);
|
|
5139
|
+
})
|
|
4803
5140
|
},
|
|
4804
|
-
|
|
5141
|
+
keyOf(row, i)
|
|
4805
5142
|
);
|
|
4806
|
-
})
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
)
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
5143
|
+
}),
|
|
5144
|
+
bottomPad > 0 && /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx("td", { colSpan: leaves.length, style: { height: bottomPad, padding: 0, border: 0 } }) })
|
|
5145
|
+
] }) })
|
|
5146
|
+
] }),
|
|
5147
|
+
footer
|
|
5148
|
+
]
|
|
5149
|
+
}
|
|
5150
|
+
),
|
|
4814
5151
|
pagination && pagination.pageCount > 1 && /* @__PURE__ */ jsx("div", { className: "mt-3 flex justify-end", children: /* @__PURE__ */ jsx(
|
|
4815
5152
|
Pagination,
|
|
4816
5153
|
{
|
|
@@ -4867,8 +5204,8 @@ function Sparkline({
|
|
|
4867
5204
|
const max = Math.max(...data);
|
|
4868
5205
|
const min = Math.min(...data);
|
|
4869
5206
|
const span = max - min || 1;
|
|
4870
|
-
const
|
|
4871
|
-
const y = (v) => height -
|
|
5207
|
+
const pad4 = strokeWidth + (showDots ? 2 : 0);
|
|
5208
|
+
const y = (v) => height - pad4 - (v - min) / span * (height - pad4 * 2);
|
|
4872
5209
|
const pts = data.length === 1 ? [[0, height / 2], [width, height / 2]] : data.map((v, i) => [i * width / (data.length - 1), y(v)]);
|
|
4873
5210
|
const line = pts.map(([x, yy], i) => `${i === 0 ? "M" : "L"}${x.toFixed(2)},${yy.toFixed(2)}`).join(" ");
|
|
4874
5211
|
const area = `${line} L${width.toFixed(2)},${height} L0,${height} Z`;
|
|
@@ -4960,6 +5297,73 @@ function DonutChart({ segments, size = 120, thickness = 16, centerLabel, classNa
|
|
|
4960
5297
|
}
|
|
4961
5298
|
);
|
|
4962
5299
|
}
|
|
5300
|
+
function toPoints(data, min, span) {
|
|
5301
|
+
if (data.length === 1) return [[0, 100 - (data[0] - min) / span * 100], [100, 100 - (data[0] - min) / span * 100]];
|
|
5302
|
+
return data.map((v, i) => [i * 100 / (data.length - 1), 100 - (v - min) / span * 100]);
|
|
5303
|
+
}
|
|
5304
|
+
function pathFor(pts) {
|
|
5305
|
+
return pts.map(([x, y], i) => `${i === 0 ? "M" : "L"}${x.toFixed(2)},${y.toFixed(2)}`).join(" ");
|
|
5306
|
+
}
|
|
5307
|
+
var fmt = (v) => Number.isInteger(v) ? String(v) : v.toFixed(1);
|
|
5308
|
+
function LineChart({
|
|
5309
|
+
series,
|
|
5310
|
+
labels,
|
|
5311
|
+
height = 160,
|
|
5312
|
+
strokeWidth = 2,
|
|
5313
|
+
showDots = false,
|
|
5314
|
+
max,
|
|
5315
|
+
min,
|
|
5316
|
+
showScale = false,
|
|
5317
|
+
showLegend = false,
|
|
5318
|
+
className,
|
|
5319
|
+
style
|
|
5320
|
+
}) {
|
|
5321
|
+
const drawn = series.filter((s) => s.data.length > 0);
|
|
5322
|
+
if (drawn.length === 0) return null;
|
|
5323
|
+
const all = drawn.flatMap((s) => s.data);
|
|
5324
|
+
const top = max ?? Math.max(...all);
|
|
5325
|
+
const bottom = min ?? Math.min(...all);
|
|
5326
|
+
const span = top - bottom || 1;
|
|
5327
|
+
const color = (s) => s.color ?? "currentColor";
|
|
5328
|
+
return /* @__PURE__ */ jsxs("div", { className, style, children: [
|
|
5329
|
+
showLegend && drawn.some((s) => s.label) && /* @__PURE__ */ jsx("div", { className: "mb-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5", children: drawn.map((s, i) => s.label && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-xs text-gray-500", children: [
|
|
5330
|
+
/* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full", style: { backgroundColor: color(s) } }),
|
|
5331
|
+
s.label
|
|
5332
|
+
] }, i)) }),
|
|
5333
|
+
/* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
5334
|
+
showScale && /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-between pr-1.5 text-right text-[10px] leading-none text-gray-400", style: { height }, children: [
|
|
5335
|
+
/* @__PURE__ */ jsx("span", { children: fmt(top) }),
|
|
5336
|
+
/* @__PURE__ */ jsx("span", { children: fmt(bottom + span / 2) }),
|
|
5337
|
+
/* @__PURE__ */ jsx("span", { children: fmt(bottom) })
|
|
5338
|
+
] }),
|
|
5339
|
+
/* @__PURE__ */ jsxs(
|
|
5340
|
+
"svg",
|
|
5341
|
+
{
|
|
5342
|
+
className: "min-w-0 flex-1",
|
|
5343
|
+
width: "100%",
|
|
5344
|
+
height,
|
|
5345
|
+
viewBox: "0 0 100 100",
|
|
5346
|
+
preserveAspectRatio: "none",
|
|
5347
|
+
role: "img",
|
|
5348
|
+
"aria-hidden": "true",
|
|
5349
|
+
children: [
|
|
5350
|
+
showScale && [0, 50, 100].map((y) => /* @__PURE__ */ jsx("line", { x1: 0, y1: y, x2: 100, y2: y, stroke: "currentColor", strokeOpacity: 0.12, strokeWidth: 1, vectorEffect: "non-scaling-stroke" }, y)),
|
|
5351
|
+
drawn.map((s, si) => {
|
|
5352
|
+
const pts = toPoints(s.data, bottom, span);
|
|
5353
|
+
const line = pathFor(pts);
|
|
5354
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
5355
|
+
s.fill && /* @__PURE__ */ jsx("path", { d: `${line} L100,100 L0,100 Z`, fill: s.fill, stroke: "none" }),
|
|
5356
|
+
/* @__PURE__ */ jsx("path", { d: line, fill: "none", stroke: color(s), strokeWidth, strokeLinejoin: "round", strokeLinecap: "round", vectorEffect: "non-scaling-stroke" }),
|
|
5357
|
+
showDots && s.data.length > 1 && pts.map(([x, y], i) => /* @__PURE__ */ jsx("path", { d: `M${x.toFixed(2)},${y.toFixed(2)} h0.01`, stroke: color(s), strokeWidth: strokeWidth * 2.5, strokeLinecap: "round", vectorEffect: "non-scaling-stroke", children: /* @__PURE__ */ jsx("title", { children: `${labels?.[i] != null ? `${labels[i]}: ` : ""}${s.label ? `${s.label} ` : ""}${s.data[i]}` }) }, i))
|
|
5358
|
+
] }, si);
|
|
5359
|
+
})
|
|
5360
|
+
]
|
|
5361
|
+
}
|
|
5362
|
+
)
|
|
5363
|
+
] }),
|
|
5364
|
+
labels && /* @__PURE__ */ jsx("div", { className: `mt-1 flex justify-between ${showScale ? "pl-6" : ""}`, children: labels.map((l, i) => /* @__PURE__ */ jsx("div", { className: "truncate text-[10px] text-gray-400", children: l }, i)) })
|
|
5365
|
+
] });
|
|
5366
|
+
}
|
|
4963
5367
|
var STATUS_GROUPS = {
|
|
4964
5368
|
paid: "success",
|
|
4965
5369
|
shipped: "active",
|
|
@@ -5703,6 +6107,6 @@ var ALT_SHIFT_D = isMac ? "\u2325\u21E7D" : "Alt+Shift+D";
|
|
|
5703
6107
|
var ALT_SHIFT_E = isMac ? "\u2325\u21E7E" : "Alt+Shift+E";
|
|
5704
6108
|
var ALT_SHIFT_N = isMac ? "\u2325\u21E7N" : "Alt+Shift+N";
|
|
5705
6109
|
|
|
5706
|
-
export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, Accordion, AuthScreen, Avatar, AvatarGroup, Banner, BarChart, Button_default, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CMD_SHIFT_Z, CMD_Z, Card, ChatTemplate, Checkbox_default, CheckoutTemplate, ColoredBadge, ContainerFillChart, CountBadge, DashboardTemplate, DataTable, DataTablePage, DatePicker_default, DateRangePicker, DescriptionList, Divider, DonutChart, Drawer, DropdownMenu, ENTER, EmailTemplate, EmptyState, ErrorBoundary, ErrorPage, FilePicker, FormField, FormLayoutPage, GROUP_COLORS, GalleryTemplate, GlobalSearch, Grid, HelpCenter, INPUT_BASE, INPUT_SIZES, IconButton_default, Inline, InputNumber_default, Input_default, Kanban, Label, ListFooter, ListLoadError, LoadingSpinner, MAX_FRACTION_DIGITS, MOD, Markdown, MediaUploadField, MediaUploadGrid, MetricBar, MilestoneTimeline, NativeSelect, NumericKeypad, PageHeader, Pagination, Paragraph, Radio_default, Result, SHIFT, SearchableSelect, Segmented, Select_default, SidebarActionButton, SidebarGroupLabel, SidebarNavItem, Skeleton, Sparkline, Stack, StatCard, Statistic, StatusBadge, StatusBadgeProvider, Switch_default, Tabs, Text, Textarea_default, TileButton_default, Title, Tooltip, TopNav, appendKey, applyThemePrefs, backspace, firstEnabledIndex, formatDate, inputClasses, isMac, isSeverityTone, lastEnabledIndex, matchTypeahead, mediaFileName, nextEnabledIndex, resolveTheme, severityOf, tabButtonId, tabPanelId, toISODate, useClickOutside, useTheme };
|
|
5707
|
-
//# sourceMappingURL=chunk-
|
|
5708
|
-
//# sourceMappingURL=chunk-
|
|
6110
|
+
export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, Accordion, AuthScreen, Avatar, AvatarGroup, Banner, BarChart, Button_default, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CMD_SHIFT_Z, CMD_Z, Card, ChatTemplate, Checkbox_default, CheckoutTemplate, ColoredBadge, ContainerFillChart, CountBadge, DashboardTemplate, DataTable, DataTablePage, DatePicker_default, DateRangePicker, DateTimePicker_default, DescriptionList, Divider, DonutChart, Drawer, DropdownMenu, ENTER, EmailTemplate, EmptyState, ErrorBoundary, ErrorPage, FilePicker, FormField, FormLayoutPage, GROUP_COLORS, GalleryTemplate, GlobalSearch, Grid, HelpCenter, INPUT_BASE, INPUT_SIZES, IconButton_default, Inline, InputNumber_default, Input_default, Kanban, Label, LineChart, ListFooter, ListLoadError, LoadingSpinner, MAX_FRACTION_DIGITS, MOD, Markdown, MediaUploadField, MediaUploadGrid, MetricBar, MilestoneTimeline, NativeSelect, NumericKeypad, PageHeader, Pagination, Paragraph, Radio_default, Result, SHIFT, SearchableSelect, Segmented, Select_default, SidebarActionButton, SidebarGroupLabel, SidebarNavItem, Skeleton, Sparkline, Stack, StatCard, Statistic, StatusBadge, StatusBadgeProvider, Stepper, Switch_default, Tabs, TagInput, Text, Textarea_default, TileButton_default, TimePicker_default, Title, Tooltip, TopNav, appendKey, applyThemePrefs, backspace, firstEnabledIndex, formatDate, inputClasses, isMac, isSeverityTone, lastEnabledIndex, matchTypeahead, mediaFileName, nextEnabledIndex, resolveTheme, severityOf, tabButtonId, tabPanelId, toISODate, useClickOutside, useTheme };
|
|
6111
|
+
//# sourceMappingURL=chunk-CWA27IGB.js.map
|
|
6112
|
+
//# sourceMappingURL=chunk-CWA27IGB.js.map
|