@febkosq8/arc 0.8.3 → 0.8.5
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/arc.js +163 -152
- package/dist/components/input-timestamp.d.ts +2 -1
- package/dist/components/table.d.ts +50 -8
- package/dist/utilities/date-handler.d.ts +7 -3
- package/dist/utilities/index.d.ts +1 -0
- package/package.json +25 -13
package/dist/arc.js
CHANGED
|
@@ -11,8 +11,8 @@ import { FiChevronDown as N, FiChevronRight as P, FiMonitor as F, FiMoon as I, F
|
|
|
11
11
|
import { Dialog as R } from "@base-ui/react/dialog";
|
|
12
12
|
import { RxCross1 as z } from "react-icons/rx";
|
|
13
13
|
import { Select as B } from "@base-ui/react/select";
|
|
14
|
-
import { rankItem as
|
|
15
|
-
import { columnFilteringFeature as
|
|
14
|
+
import { rankItem as ee } from "@tanstack/match-sorter-utils";
|
|
15
|
+
import { columnFilteringFeature as te, columnResizingFeature as ne, columnSizingFeature as re, columnVisibilityFeature as ie, createFilteredRowModel as ae, createPaginatedRowModel as oe, createSortedRowModel as se, filterFn_includesString as ce, globalFilteringFeature as le, rowPaginationFeature as ue, rowSortingFeature as de, sortFn_alphanumeric as fe, sortFn_alphanumericCaseSensitive as pe, sortFn_basic as me, sortFn_datetime as he, sortFn_text as ge, sortFn_textCaseSensitive as _e, tableFeatures as ve, useTable as ye } from "@tanstack/react-table";
|
|
16
16
|
import { Switch as be } from "@base-ui/react/switch";
|
|
17
17
|
// components/button-group.tsx
|
|
18
18
|
var xe = ({ className: e, orientation: r = "horizontal", selectedVariant: o, children: s, ...c }) => /* @__PURE__ */ f("div", {
|
|
@@ -53,7 +53,7 @@ var xe = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
|
|
|
53
53
|
variant: "primary",
|
|
54
54
|
size: "md"
|
|
55
55
|
}
|
|
56
|
-
}),
|
|
56
|
+
}), V = Object.assign(({ className: e, variant: n, size: r, ...i }) => /* @__PURE__ */ f("button", {
|
|
57
57
|
className: t("arc-button", Se({
|
|
58
58
|
variant: n,
|
|
59
59
|
size: r,
|
|
@@ -88,7 +88,7 @@ var xe = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
|
|
|
88
88
|
"aria-hidden": !g,
|
|
89
89
|
children: w
|
|
90
90
|
})]
|
|
91
|
-
}), E = /* @__PURE__ */ f(
|
|
91
|
+
}), E = /* @__PURE__ */ f(V, {
|
|
92
92
|
...h,
|
|
93
93
|
children: T,
|
|
94
94
|
className: t(d),
|
|
@@ -155,7 +155,7 @@ var xe = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
|
|
|
155
155
|
return /* @__PURE__ */ p("span", {
|
|
156
156
|
className: "arc-long-press-button relative inline-flex w-fit",
|
|
157
157
|
"data-long-press-state": y ? "pressing" : void 0,
|
|
158
|
-
children: [/* @__PURE__ */ f(
|
|
158
|
+
children: [/* @__PURE__ */ f(V, {
|
|
159
159
|
...m,
|
|
160
160
|
children: E,
|
|
161
161
|
variant: c,
|
|
@@ -311,7 +311,7 @@ var xe = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
|
|
|
311
311
|
}) })]
|
|
312
312
|
})
|
|
313
313
|
});
|
|
314
|
-
},
|
|
314
|
+
}, H = ({ data: e, className: n, ...r }) => {
|
|
315
315
|
let i = Array.isArray(e) ? e.join(", ") : typeof e == "string" ? e : null;
|
|
316
316
|
return /* @__PURE__ */ f("em", {
|
|
317
317
|
role: "alert",
|
|
@@ -321,18 +321,18 @@ var xe = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
|
|
|
321
321
|
children: i
|
|
322
322
|
});
|
|
323
323
|
}, Ae = /* @__PURE__ */ "*.+.×.÷.=.~.!.?.@.#.%.&.§.¶.※.◇.◆.○.●.△.▽.□.■.♠.♣.♦.♤.♧.♢.♪.♫.∴.∵".split(".");
|
|
324
|
-
function
|
|
324
|
+
function U(e, t, n) {
|
|
325
325
|
let r = Math.sin((e + 1) * 12.9898 + t * 78.233 + n * 37.719) * 43758.5453;
|
|
326
326
|
return r - Math.floor(r);
|
|
327
327
|
}
|
|
328
|
-
var
|
|
328
|
+
var je = [
|
|
329
329
|
"circle",
|
|
330
330
|
"square",
|
|
331
331
|
"diamond",
|
|
332
332
|
"star",
|
|
333
333
|
"heart",
|
|
334
334
|
"hexagon"
|
|
335
|
-
],
|
|
335
|
+
], Me = e("arc-grid-loader__cell grid aspect-square w-full place-items-center overflow-hidden text-center leading-none break-all", {
|
|
336
336
|
variants: { shape: {
|
|
337
337
|
circle: "rounded-full",
|
|
338
338
|
square: "rounded-md",
|
|
@@ -342,8 +342,8 @@ var G = [
|
|
|
342
342
|
hexagon: "arc-grid-loader__cell--hexagon"
|
|
343
343
|
} },
|
|
344
344
|
defaultVariants: { shape: "circle" }
|
|
345
|
-
}),
|
|
346
|
-
let [_, v] = u([]), [y, b] = u([]), [x, S] = u([]), C = c.length > 0 ? c :
|
|
345
|
+
}), Ne = ({ className: e, rows: n = 3, columns: r = 3, size: i = 120, maxSize: a = 24, shape: s = "circle", shapes: c = je, colors: l = [], label: d = "Loading", symbols: p = Ae, title: m, style: h, ...g }) => {
|
|
346
|
+
let [_, v] = u([]), [y, b] = u([]), [x, S] = u([]), C = c.length > 0 ? c : je, [w, T] = u(() => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
347
347
|
if (o(() => {
|
|
348
348
|
s === "mixed" && b(Array.from({ length: n * r }, () => C[Math.floor(Math.random() * C.length)]));
|
|
349
349
|
}, [
|
|
@@ -386,10 +386,10 @@ var G = [
|
|
|
386
386
|
gridTemplateRows: `repeat(${n}, minmax(0, 1fr))`
|
|
387
387
|
},
|
|
388
388
|
children: Array.from({ length: n * r }, (e, o) => /* @__PURE__ */ f("span", {
|
|
389
|
-
className: t(
|
|
389
|
+
className: t(Me({ shape: s === "mixed" ? y[o] ?? C[Math.floor(U(o, n, r) * C.length)] : s })),
|
|
390
390
|
onAnimationIteration: () => {
|
|
391
391
|
s === "mixed" && b((e) => {
|
|
392
|
-
let t = [...e], i = t[o] ?? C[Math.floor(
|
|
392
|
+
let t = [...e], i = t[o] ?? C[Math.floor(U(o, n, r) * C.length)], a = C.filter((e) => e !== i);
|
|
393
393
|
return t[o] = a.length > 0 ? a[Math.floor(Math.random() * a.length)] : i, t;
|
|
394
394
|
}), l.length > 1 && S((e) => {
|
|
395
395
|
let t = [...e];
|
|
@@ -400,8 +400,8 @@ var G = [
|
|
|
400
400
|
});
|
|
401
401
|
},
|
|
402
402
|
style: {
|
|
403
|
-
animationDelay: l.length > 1 ? `${o / (n * r) * 1200}ms` : `${-
|
|
404
|
-
animationDuration: l.length > 1 ? "1200ms" : `${900 +
|
|
403
|
+
animationDelay: l.length > 1 ? `${o / (n * r) * 1200}ms` : `${-U(o, n, r) * 1200}ms`,
|
|
404
|
+
animationDuration: l.length > 1 ? "1200ms" : `${900 + U(o, n, r) * 600}ms`,
|
|
405
405
|
backgroundColor: l.length > 0 ? l[(o + (x[o] ?? 0)) % l.length] : void 0,
|
|
406
406
|
fontSize: `${Math.min(i / Math.max(n, r), a) * .4}px`,
|
|
407
407
|
maxWidth: a,
|
|
@@ -414,7 +414,7 @@ var G = [
|
|
|
414
414
|
}, o))
|
|
415
415
|
})
|
|
416
416
|
});
|
|
417
|
-
},
|
|
417
|
+
}, W = ({ cardContent: e, children: n, trigger: r = "hover", triggerRender: i, side: a = "bottom", align: o = "center", className: s, open: c, onOpenChange: l }) => /* @__PURE__ */ p(A.Root, {
|
|
418
418
|
open: c,
|
|
419
419
|
onOpenChange: l,
|
|
420
420
|
children: [/* @__PURE__ */ f(A.Trigger, {
|
|
@@ -432,7 +432,7 @@ var G = [
|
|
|
432
432
|
children: [/* @__PURE__ */ f(A.Arrow, { className: t("border-border bg-popover h-3 w-3 rotate-45", "data-[side=bottom]:-top-1.5 data-[side=bottom]:border-t data-[side=bottom]:border-l", "data-[side=top]:-bottom-1.5 data-[side=top]:border-r data-[side=top]:border-b", "data-[side=left]:-right-1.5 data-[side=left]:border-t data-[side=left]:border-r", "data-[side=right]:-left-1.5 data-[side=right]:border-b data-[side=right]:border-l") }), e]
|
|
433
433
|
})
|
|
434
434
|
}) })]
|
|
435
|
-
}),
|
|
435
|
+
}), Pe = ({ id: e, label: n, help: r, errors: i, className: a, ...o }) => {
|
|
436
436
|
let s = Array.isArray(i) ? i.map((e) => e == null ? "" : String(e)) : typeof i == "string" ? i : null;
|
|
437
437
|
return /* @__PURE__ */ p("div", {
|
|
438
438
|
...o,
|
|
@@ -444,7 +444,7 @@ var G = [
|
|
|
444
444
|
htmlFor: e,
|
|
445
445
|
children: n
|
|
446
446
|
}),
|
|
447
|
-
r != null && r !== !1 && /* @__PURE__ */ f(
|
|
447
|
+
r != null && r !== !1 && /* @__PURE__ */ f(W, {
|
|
448
448
|
trigger: "hover",
|
|
449
449
|
triggerRender: /* @__PURE__ */ f("button", {
|
|
450
450
|
type: "button",
|
|
@@ -460,10 +460,10 @@ var G = [
|
|
|
460
460
|
"aria-hidden": "true"
|
|
461
461
|
})
|
|
462
462
|
}),
|
|
463
|
-
s && (Array.isArray(s) ? s.length > 0 && /* @__PURE__ */ f(
|
|
463
|
+
s && (Array.isArray(s) ? s.length > 0 && /* @__PURE__ */ f(H, { data: s }) : /* @__PURE__ */ f(H, { data: s }))
|
|
464
464
|
]
|
|
465
465
|
});
|
|
466
|
-
},
|
|
466
|
+
}, Fe = e("arc-input rounded border text-foreground placeholder:text-muted-foreground focus:border-transparent focus:outline-hidden focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:border-muted disabled:bg-muted", {
|
|
467
467
|
variants: {
|
|
468
468
|
variant: {
|
|
469
469
|
default: "border-border bg-background",
|
|
@@ -478,8 +478,8 @@ var G = [
|
|
|
478
478
|
variant: "default",
|
|
479
479
|
as: "input"
|
|
480
480
|
}
|
|
481
|
-
}),
|
|
482
|
-
let a = t(
|
|
481
|
+
}), G = ({ as: e = "input", className: n, variant: r, ...i }) => {
|
|
482
|
+
let a = t(Fe({
|
|
483
483
|
as: e,
|
|
484
484
|
variant: r
|
|
485
485
|
}), n);
|
|
@@ -488,7 +488,7 @@ var G = [
|
|
|
488
488
|
autoComplete: "off",
|
|
489
489
|
className: a
|
|
490
490
|
});
|
|
491
|
-
},
|
|
491
|
+
}, Ie = e("arc-card group relative rounded-lg border border-foreground/40 bg-card/90 p-3 shadow-xs", {
|
|
492
492
|
variants: { variant: {
|
|
493
493
|
primary: "border-primary bg-primary text-primary-foreground",
|
|
494
494
|
secondary: "border-secondary bg-secondary text-secondary-foreground",
|
|
@@ -500,10 +500,10 @@ var G = [
|
|
|
500
500
|
"outline-warning": "border-warning bg-background text-warning"
|
|
501
501
|
} },
|
|
502
502
|
defaultVariants: { variant: "outline-secondary" }
|
|
503
|
-
}),
|
|
503
|
+
}), K = (e) => {
|
|
504
504
|
let { className: n, variant: r, hoverable: i = !0, hoverLift: a = !0, hoverBorder: o = !0, hoverGradient: s = !0, postHeaderBorder: c = !0, preFooterBorder: l = !0, onPointerMove: u, ...d } = e, p = i && a, m = i && o, h = i && s;
|
|
505
505
|
return /* @__PURE__ */ f("div", {
|
|
506
|
-
className: t(
|
|
506
|
+
className: t(Ie({ variant: r }), h && "arc-card-cursor-border", c && "[&_.arc-card-header]:border-b", !c && "[&_.arc-card-header]:border-b-0", l && "[&_.arc-card-footer]:border-t", !l && "[&_.arc-card-footer]:border-t-0", (p || m) && "transition-[border-color,transform] duration-300 ease-out", p && "hover:-translate-y-1", m && "hover:border-primary", n),
|
|
507
507
|
onPointerMove: h ? (e) => {
|
|
508
508
|
if (u?.(e), !h) return;
|
|
509
509
|
let t = e.currentTarget.getBoundingClientRect();
|
|
@@ -512,19 +512,19 @@ var G = [
|
|
|
512
512
|
...d
|
|
513
513
|
});
|
|
514
514
|
};
|
|
515
|
-
|
|
515
|
+
K.Header = (e) => {
|
|
516
516
|
let { className: n, ...r } = e;
|
|
517
517
|
return /* @__PURE__ */ f("h2", {
|
|
518
518
|
className: t("arc-card-header flex w-full typography-heading-3 flex-col border-foreground/40 px-0 pb-1", n),
|
|
519
519
|
...r
|
|
520
520
|
});
|
|
521
|
-
},
|
|
521
|
+
}, K.Content = (e) => {
|
|
522
522
|
let { className: n, ...r } = e;
|
|
523
523
|
return /* @__PURE__ */ f("div", {
|
|
524
524
|
className: t("arc-card-content typography-paragraph mt-0! w-full justify-between px-0 py-1 whitespace-pre-wrap", n),
|
|
525
525
|
...r
|
|
526
526
|
});
|
|
527
|
-
},
|
|
527
|
+
}, K.Footer = (e) => {
|
|
528
528
|
let { className: n, ...r } = e;
|
|
529
529
|
return /* @__PURE__ */ f("div", {
|
|
530
530
|
className: t("arc-card-footer typography-muted mt-auto mb-0 flex w-full items-end justify-start border-foreground/40 px-0 pt-1", n),
|
|
@@ -532,7 +532,7 @@ J.Header = (e) => {
|
|
|
532
532
|
});
|
|
533
533
|
};
|
|
534
534
|
// utilities/date-handler.ts
|
|
535
|
-
var
|
|
535
|
+
var Le = class e {
|
|
536
536
|
static toDateTime(e) {
|
|
537
537
|
if (e == null || e === "") return j.invalid("missing date");
|
|
538
538
|
if (e instanceof Date) return j.fromJSDate(e);
|
|
@@ -590,9 +590,9 @@ var Ie = class e {
|
|
|
590
590
|
let r = e.getDateTime(t), i = e.getRelativeTime(t);
|
|
591
591
|
return n.replace("$ISO$", r).replace("$RELATIVE$", i);
|
|
592
592
|
}
|
|
593
|
-
},
|
|
594
|
-
let r = c(() => e ?
|
|
595
|
-
return /* @__PURE__ */ f(
|
|
593
|
+
}, Re = ({ value: e, format: t = "$ISO$ ($RELATIVE$)", ...n }) => {
|
|
594
|
+
let r = c(() => e ? Le.getFormattedTime(e, t) : "", [e, t]);
|
|
595
|
+
return /* @__PURE__ */ f(G, {
|
|
596
596
|
type: "text",
|
|
597
597
|
disabled: !0,
|
|
598
598
|
readOnly: !0,
|
|
@@ -600,7 +600,7 @@ var Ie = class e {
|
|
|
600
600
|
size: Math.max(r.length, 1),
|
|
601
601
|
...n
|
|
602
602
|
});
|
|
603
|
-
},
|
|
603
|
+
}, ze = e("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", {
|
|
604
604
|
variants: {
|
|
605
605
|
variant: {
|
|
606
606
|
pill: "arc-pill-link min-w-fit border border-transparent text-base text-muted-foreground! transition hover:text-primary! hover:outline-none hover:ring-0 focus:outline-none focus-visible:ring-opacity-75",
|
|
@@ -632,8 +632,8 @@ var Ie = class e {
|
|
|
632
632
|
variant: "pill",
|
|
633
633
|
size: "md"
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
636
|
-
className: t(
|
|
635
|
+
}), Be = ({ active: e = !1, className: n, size: r = "md", variant: i = "pill", ...a }) => /* @__PURE__ */ f("a", {
|
|
636
|
+
className: t(ze({
|
|
637
637
|
variant: i,
|
|
638
638
|
size: r
|
|
639
639
|
}), e && {
|
|
@@ -654,15 +654,15 @@ var Ie = class e {
|
|
|
654
654
|
}[i], n),
|
|
655
655
|
"aria-current": e ? "page" : void 0,
|
|
656
656
|
...a
|
|
657
|
-
}),
|
|
657
|
+
}), q = ({ active: e = !1, className: n, ...r }) => /* @__PURE__ */ f("button", {
|
|
658
658
|
type: "button",
|
|
659
659
|
className: t("arc-pill", "inline-flex h-10 pointer-coarse:h-11 w-full items-center justify-center whitespace-nowrap rounded-md border border-transparent px-3 py-2 text-base font-medium text-foreground transition hover:text-primary hover:outline-none hover:ring-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-opacity-75", e ? "text-primary!" : "text-muted-foreground", n),
|
|
660
660
|
"aria-pressed": e,
|
|
661
661
|
...r
|
|
662
|
-
}),
|
|
662
|
+
}), Ve = ({ children: e }) => n.toArray(e).map((e, t) => /* @__PURE__ */ p(r, { children: [t > 0 && /* @__PURE__ */ f(M.Separator, { className: "mx-2 h-px bg-border" }), e] }, t)), J = Object.assign(({ className: e, contentClassName: n, active: r, activeClassName: i, buttonText: a, children: o }) => /* @__PURE__ */ p(M.Root, {
|
|
663
663
|
loopFocus: !0,
|
|
664
664
|
children: [/* @__PURE__ */ p(M.Trigger, {
|
|
665
|
-
render: /* @__PURE__ */ f(
|
|
665
|
+
render: /* @__PURE__ */ f(q, {
|
|
666
666
|
active: r,
|
|
667
667
|
className: t("w-fit", r && i, e)
|
|
668
668
|
}),
|
|
@@ -676,7 +676,7 @@ var Ie = class e {
|
|
|
676
676
|
collisionPadding: 8,
|
|
677
677
|
children: /* @__PURE__ */ f(M.Popup, {
|
|
678
678
|
className: t("arc-menu-content z-50 flex bg-popover w-fit min-w-40 max-w-[calc(100vw-1rem)] origin-top-right flex-col overflow-hidden rounded-md border border-border text-foreground shadow-lg ring-1 ring-foreground/10 focus:outline-none", n),
|
|
679
|
-
children: /* @__PURE__ */ f(
|
|
679
|
+
children: /* @__PURE__ */ f(Ve, { children: o })
|
|
680
680
|
})
|
|
681
681
|
}) })]
|
|
682
682
|
}), {
|
|
@@ -717,12 +717,12 @@ var Ie = class e {
|
|
|
717
717
|
collisionPadding: 8,
|
|
718
718
|
children: /* @__PURE__ */ f(M.Popup, {
|
|
719
719
|
className: "arc-menu-content z-50 flex bg-popover w-fit min-w-40 max-w-[calc(100vw-1rem)] origin-top-right flex-col overflow-hidden rounded-md border border-border text-foreground shadow-lg ring-1 ring-foreground/10 focus:outline-none",
|
|
720
|
-
children: /* @__PURE__ */ f(
|
|
720
|
+
children: /* @__PURE__ */ f(Ve, { children: i })
|
|
721
721
|
})
|
|
722
722
|
}) })]
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
|
-
}),
|
|
725
|
+
}), He = ({ open: e = !1, setOpen: n, children: r, initialFocus: i, headerContent: a, footerContent: s, width: c, height: l, className: u, customKeyHandler: d }) => (o(() => {
|
|
726
726
|
if (!e) return;
|
|
727
727
|
let t = (e) => {
|
|
728
728
|
let t = e.key === "Escape" ? "esc" : (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "s" ? "ctrl+s" : null;
|
|
@@ -761,7 +761,7 @@ var Ie = class e {
|
|
|
761
761
|
]
|
|
762
762
|
})
|
|
763
763
|
})] })
|
|
764
|
-
})),
|
|
764
|
+
})), Ue = ({ id: e, items: n, value: r, onChange: i, className: a, placeholder: o = "Select options", disabled: s, name: c, preventEmpty: l = !1, "data-name": u, "data-required": d }) => {
|
|
765
765
|
let h = n.filter((e) => r?.includes(String(e.key)));
|
|
766
766
|
return /* @__PURE__ */ f(m.Root, {
|
|
767
767
|
multiple: !0,
|
|
@@ -841,7 +841,7 @@ var Ie = class e {
|
|
|
841
841
|
}) })]
|
|
842
842
|
})
|
|
843
843
|
});
|
|
844
|
-
},
|
|
844
|
+
}, Y = ({ id: e, value: n, onChange: r, data: i, className: a, disabled: o, placeholder: s, ...c }) => /* @__PURE__ */ p(B.Root, {
|
|
845
845
|
value: n,
|
|
846
846
|
onValueChange: (e) => {
|
|
847
847
|
e !== null && r(e);
|
|
@@ -893,7 +893,7 @@ var Ie = class e {
|
|
|
893
893
|
})
|
|
894
894
|
})
|
|
895
895
|
}) })]
|
|
896
|
-
}),
|
|
896
|
+
}), We = e("arc-tag inline-flex w-fit items-center rounded-full border border-transparent font-bold", {
|
|
897
897
|
variants: {
|
|
898
898
|
variant: {
|
|
899
899
|
primary: "bg-primary text-primary-foreground",
|
|
@@ -917,29 +917,29 @@ var Ie = class e {
|
|
|
917
917
|
variant: "primary",
|
|
918
918
|
size: "xs"
|
|
919
919
|
}
|
|
920
|
-
}),
|
|
921
|
-
className: t(
|
|
920
|
+
}), Ge = ({ className: e, variant: n, size: r, ...i }) => /* @__PURE__ */ f("div", {
|
|
921
|
+
className: t(We({
|
|
922
922
|
variant: n,
|
|
923
923
|
size: r,
|
|
924
924
|
className: e
|
|
925
925
|
})),
|
|
926
926
|
...i
|
|
927
|
-
}),
|
|
928
|
-
let i = e.getValue(t), a =
|
|
927
|
+
}), Ke = (e, t, n, r) => {
|
|
928
|
+
let i = e.getValue(t), a = ee(i, n);
|
|
929
929
|
return r({ itemRank: a }), a.passed;
|
|
930
|
-
},
|
|
931
|
-
fuzzy:
|
|
930
|
+
}, X = {
|
|
931
|
+
fuzzy: Ke,
|
|
932
932
|
includesString: ce,
|
|
933
933
|
select: (e, t, n) => {
|
|
934
934
|
let r = e.getValue(t);
|
|
935
935
|
return Array.isArray(r) ? r.some((e) => String(e) === String(n)) : typeof r == "string" && r.includes(",") ? r.split(",").map((e) => e.trim()).includes(String(n)) : String(r) === String(n);
|
|
936
936
|
}
|
|
937
|
-
},
|
|
937
|
+
}, qe = ve({
|
|
938
938
|
columnMeta: {},
|
|
939
|
-
columnFilteringFeature:
|
|
940
|
-
columnResizingFeature:
|
|
941
|
-
columnSizingFeature:
|
|
942
|
-
columnVisibilityFeature:
|
|
939
|
+
columnFilteringFeature: te,
|
|
940
|
+
columnResizingFeature: ne,
|
|
941
|
+
columnSizingFeature: re,
|
|
942
|
+
columnVisibilityFeature: ie,
|
|
943
943
|
globalFilteringFeature: le,
|
|
944
944
|
rowPaginationFeature: ue,
|
|
945
945
|
rowSortingFeature: de,
|
|
@@ -954,60 +954,71 @@ var Ie = class e {
|
|
|
954
954
|
text: ge,
|
|
955
955
|
textCaseSensitive: _e
|
|
956
956
|
},
|
|
957
|
-
filterFns:
|
|
957
|
+
filterFns: X
|
|
958
958
|
});
|
|
959
|
-
function
|
|
960
|
-
return Object.prototype.hasOwnProperty.call(
|
|
959
|
+
function Je(e) {
|
|
960
|
+
return Object.prototype.hasOwnProperty.call(X, e);
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function Ye(e, t) {
|
|
963
963
|
if (e !== !1) {
|
|
964
964
|
if (e === void 0) return t ? "select" : void 0;
|
|
965
|
-
if (typeof e == "function" || e === "auto" ||
|
|
966
|
-
throw Error(`Unsupported table filterFn "${e}". Use "auto" or one of: ${Object.keys(
|
|
965
|
+
if (typeof e == "function" || e === "auto" || Je(e)) return e;
|
|
966
|
+
throw Error(`Unsupported table filterFn "${e}". Use "auto" or one of: ${Object.keys(X).join(", ")}.`);
|
|
967
967
|
}
|
|
968
968
|
}
|
|
969
|
-
var
|
|
969
|
+
var Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, showHeader: a = !0, showFilters: o = !0, showSorting: l = !0 }) => {
|
|
970
970
|
let d = s(), [m, b] = u({
|
|
971
971
|
pageIndex: 0,
|
|
972
972
|
pageSize: r
|
|
973
|
-
}), [x, w] = u([]), [T, D] = u(""), [O, k] = u([]), [A, j] = u({}), M = x.length > 0 || T !== "", N = c(() => n?.map((e) =>
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
973
|
+
}), [x, w] = u([]), [T, D] = u(""), [O, k] = u([]), [A, j] = u({}), M = x.length > 0 || T !== "", N = c(() => n?.map((e) => {
|
|
974
|
+
if (e.accessorFn !== void 0 && !e.id) throw Error("Table columns with accessorFn require a non-empty id.");
|
|
975
|
+
let n = {
|
|
976
|
+
enableResizing: e.enableResizing,
|
|
977
|
+
enableColumnFilter: e.filterFn !== !1 && e.enableColumnFilter,
|
|
978
|
+
enableSorting: e.enableSorting,
|
|
979
|
+
enableHiding: e.enableHiding ?? !0,
|
|
980
|
+
size: e.size,
|
|
981
|
+
minSize: e.minSize ?? 50,
|
|
982
|
+
maxSize: e.maxSize ?? 1e3,
|
|
983
|
+
filterFn: Ye(e.filterFn, e.filterSelectOptions),
|
|
984
|
+
meta: {
|
|
985
|
+
headerLabel: e.header,
|
|
986
|
+
filterSelectOptions: e.filterSelectOptions,
|
|
987
|
+
mobileFullWidth: e.mobileFullWidth
|
|
988
|
+
},
|
|
989
|
+
header: (n) => {
|
|
990
|
+
let r = n.column.getIsSorted(), i = n.column.getCanSort();
|
|
991
|
+
return /* @__PURE__ */ f("div", {
|
|
992
|
+
className: "flex flex-col gap-1.5",
|
|
993
|
+
children: /* @__PURE__ */ p("div", {
|
|
994
|
+
className: t("flex items-center gap-1.5", l && i && "cursor-pointer select-none"),
|
|
995
|
+
onClick: l && i ? n.column.getToggleSortingHandler() : void 0,
|
|
996
|
+
children: [/* @__PURE__ */ f("span", {
|
|
997
|
+
className: "min-w-0 truncate text-sm font-semibold tracking-wide",
|
|
998
|
+
children: e.header
|
|
999
|
+
}), l && i && /* @__PURE__ */ p("span", {
|
|
1000
|
+
className: "text-muted-foreground ml-auto shrink-0 text-xs",
|
|
1001
|
+
children: [
|
|
1002
|
+
r === "asc" && /* @__PURE__ */ f(v, { className: "text-primary h-3.5 w-3.5" }),
|
|
1003
|
+
r === "desc" && /* @__PURE__ */ f(_, { className: "text-primary h-3.5 w-3.5" }),
|
|
1004
|
+
r === !1 && /* @__PURE__ */ f(y, { className: "h-3 w-3 opacity-60" })
|
|
1005
|
+
]
|
|
1006
|
+
})]
|
|
1007
|
+
})
|
|
1008
|
+
});
|
|
1009
|
+
},
|
|
1010
|
+
cell: e.cell ?? ((e) => e.getValue())
|
|
1011
|
+
};
|
|
1012
|
+
return e.accessorFn === void 0 ? {
|
|
1013
|
+
...n,
|
|
1014
|
+
...e.id === void 0 ? {} : { id: e.id },
|
|
1015
|
+
accessorKey: e.accessorKey
|
|
1016
|
+
} : {
|
|
1017
|
+
...n,
|
|
1018
|
+
id: e.id,
|
|
1019
|
+
accessorFn: e.accessorFn
|
|
1020
|
+
};
|
|
1021
|
+
}), [n]), P = ye({
|
|
1011
1022
|
data: e,
|
|
1012
1023
|
columns: N,
|
|
1013
1024
|
state: {
|
|
@@ -1023,8 +1034,8 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1023
1034
|
onSortingChange: k,
|
|
1024
1035
|
onColumnFiltersChange: w,
|
|
1025
1036
|
onGlobalFilterChange: D,
|
|
1026
|
-
globalFilterFn:
|
|
1027
|
-
features:
|
|
1037
|
+
globalFilterFn: Ke,
|
|
1038
|
+
features: qe,
|
|
1028
1039
|
defaultColumn: {
|
|
1029
1040
|
size: 200,
|
|
1030
1041
|
minSize: 50,
|
|
@@ -1039,7 +1050,7 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1039
1050
|
children: [
|
|
1040
1051
|
/* @__PURE__ */ p("div", {
|
|
1041
1052
|
className: "flex items-center gap-2",
|
|
1042
|
-
children: [/* @__PURE__ */ p(
|
|
1053
|
+
children: [/* @__PURE__ */ p(V, {
|
|
1043
1054
|
variant: "outline-secondary",
|
|
1044
1055
|
size: "sm",
|
|
1045
1056
|
disabled: !M && O.length === 0,
|
|
@@ -1057,7 +1068,7 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1057
1068
|
children: [
|
|
1058
1069
|
/* @__PURE__ */ p("div", {
|
|
1059
1070
|
className: "flex items-center gap-1",
|
|
1060
|
-
children: [/* @__PURE__ */ f(
|
|
1071
|
+
children: [/* @__PURE__ */ f(V, {
|
|
1061
1072
|
variant: "outline-secondary",
|
|
1062
1073
|
size: "icon-md",
|
|
1063
1074
|
className: "h-10 w-10 sm:h-8 sm:w-8",
|
|
@@ -1073,7 +1084,7 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1073
1084
|
"aria-hidden": "true",
|
|
1074
1085
|
className: "h-3.5 w-3.5"
|
|
1075
1086
|
})
|
|
1076
|
-
}), /* @__PURE__ */ f(
|
|
1087
|
+
}), /* @__PURE__ */ f(V, {
|
|
1077
1088
|
variant: "outline-secondary",
|
|
1078
1089
|
size: "icon-md",
|
|
1079
1090
|
className: "h-10 w-10 sm:h-8 sm:w-8",
|
|
@@ -1119,7 +1130,7 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1119
1130
|
}),
|
|
1120
1131
|
/* @__PURE__ */ p("div", {
|
|
1121
1132
|
className: "flex items-center gap-1",
|
|
1122
|
-
children: [/* @__PURE__ */ f(
|
|
1133
|
+
children: [/* @__PURE__ */ f(V, {
|
|
1123
1134
|
variant: "outline-secondary",
|
|
1124
1135
|
size: "icon-md",
|
|
1125
1136
|
className: "h-10 w-10 sm:h-8 sm:w-8",
|
|
@@ -1135,7 +1146,7 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1135
1146
|
"aria-hidden": "true",
|
|
1136
1147
|
className: "h-3.5 w-3.5"
|
|
1137
1148
|
})
|
|
1138
|
-
}), /* @__PURE__ */ f(
|
|
1149
|
+
}), /* @__PURE__ */ f(V, {
|
|
1139
1150
|
variant: "outline-secondary",
|
|
1140
1151
|
size: "icon-md",
|
|
1141
1152
|
className: "h-10 w-10 sm:h-8 sm:w-8",
|
|
@@ -1158,7 +1169,7 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1158
1169
|
/* @__PURE__ */ p("label", {
|
|
1159
1170
|
htmlFor: `${d}-page-size`,
|
|
1160
1171
|
className: "text-muted-foreground flex w-full items-center justify-between gap-2 text-xs md:w-auto",
|
|
1161
|
-
children: ["Rows per page", /* @__PURE__ */ f(
|
|
1172
|
+
children: ["Rows per page", /* @__PURE__ */ f(Y, {
|
|
1162
1173
|
id: `${d}-page-size`,
|
|
1163
1174
|
value: P.state.pagination.pageSize.toString(),
|
|
1164
1175
|
onChange: (e) => {
|
|
@@ -1197,7 +1208,7 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1197
1208
|
htmlFor: `${d}-sort`,
|
|
1198
1209
|
className: "text-muted-foreground mb-1 block text-xs font-medium",
|
|
1199
1210
|
children: "Sort by"
|
|
1200
|
-
}), /* @__PURE__ */ f(
|
|
1211
|
+
}), /* @__PURE__ */ f(Y, {
|
|
1201
1212
|
id: `${d}-sort`,
|
|
1202
1213
|
value: O[0]?.id ?? "__none__",
|
|
1203
1214
|
onChange: (e) => {
|
|
@@ -1214,7 +1225,7 @@ var Ye = ie(), Xe = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
|
|
|
1214
1225
|
label: e.columnDef.meta?.headerLabel ?? e.id
|
|
1215
1226
|
}))]
|
|
1216
1227
|
})]
|
|
1217
|
-
}), /* @__PURE__ */ f(
|
|
1228
|
+
}), /* @__PURE__ */ f(V, {
|
|
1218
1229
|
variant: "outline-secondary",
|
|
1219
1230
|
size: "icon-sm",
|
|
1220
1231
|
disabled: O.length === 0,
|
|
@@ -1324,7 +1335,7 @@ function Ze({ value: e, onChange: t, debounce: n = 500, ...r }) {
|
|
|
1324
1335
|
i,
|
|
1325
1336
|
n,
|
|
1326
1337
|
t
|
|
1327
|
-
]), /* @__PURE__ */ f(
|
|
1338
|
+
]), /* @__PURE__ */ f(G, {
|
|
1328
1339
|
...r,
|
|
1329
1340
|
value: i,
|
|
1330
1341
|
onChange: (e) => a(e.target.value),
|
|
@@ -1339,7 +1350,7 @@ function Qe({ column: e, idPrefix: t = "" }) {
|
|
|
1339
1350
|
equals: "Equals",
|
|
1340
1351
|
fuzzy: "Fuzzy"
|
|
1341
1352
|
}, i = e.getFilterValue(), a = e.columnDef.meta?.filterSelectOptions;
|
|
1342
|
-
return a ? /* @__PURE__ */ f(
|
|
1353
|
+
return a ? /* @__PURE__ */ f(Y, {
|
|
1343
1354
|
id: n,
|
|
1344
1355
|
value: i ?? "__all__",
|
|
1345
1356
|
onChange: (t) => e.setFilterValue(t === "__all__" ? void 0 : t),
|
|
@@ -1363,9 +1374,9 @@ function Qe({ column: e, idPrefix: t = "" }) {
|
|
|
1363
1374
|
});
|
|
1364
1375
|
}
|
|
1365
1376
|
function $e({ table: e }) {
|
|
1366
|
-
return /* @__PURE__ */ p(
|
|
1377
|
+
return /* @__PURE__ */ p(W, {
|
|
1367
1378
|
trigger: "click",
|
|
1368
|
-
triggerRender: /* @__PURE__ */ f(
|
|
1379
|
+
triggerRender: /* @__PURE__ */ f(V, {
|
|
1369
1380
|
variant: "outline-secondary",
|
|
1370
1381
|
size: "sm",
|
|
1371
1382
|
title: "Toggle columns",
|
|
@@ -1378,7 +1389,7 @@ function $e({ table: e }) {
|
|
|
1378
1389
|
className: "flex flex-col",
|
|
1379
1390
|
children: e.getAllLeafColumns().map((e) => {
|
|
1380
1391
|
let n = e.columnDef.meta?.headerLabel ?? e.id, r = e.getCanHide(), i = e.getIsVisible();
|
|
1381
|
-
return /* @__PURE__ */ p(
|
|
1392
|
+
return /* @__PURE__ */ p(V, {
|
|
1382
1393
|
variant: "ghost",
|
|
1383
1394
|
size: "sm",
|
|
1384
1395
|
disabled: !r,
|
|
@@ -1521,53 +1532,53 @@ var et = ({ className: e, href: n, text: r, target: i = "_blank", rel: a, ...o }
|
|
|
1521
1532
|
className: "border-success bg-success/70"
|
|
1522
1533
|
}
|
|
1523
1534
|
]
|
|
1524
|
-
}),
|
|
1535
|
+
}), Z = {
|
|
1525
1536
|
light: L,
|
|
1526
1537
|
dark: I,
|
|
1527
1538
|
system: F
|
|
1528
|
-
},
|
|
1539
|
+
}, Q = {
|
|
1529
1540
|
light: "Light",
|
|
1530
1541
|
dark: "Dark",
|
|
1531
1542
|
system: "System"
|
|
1532
|
-
},
|
|
1543
|
+
}, it = "theme", at = (e) => e === "dark" || e === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches, ot = () => {
|
|
1533
1544
|
if (typeof window > "u") return "system";
|
|
1534
|
-
let e = window.localStorage.getItem(
|
|
1545
|
+
let e = window.localStorage.getItem(it);
|
|
1535
1546
|
return e === "light" || e === "dark" || e === "system" ? e : "system";
|
|
1536
|
-
},
|
|
1537
|
-
function
|
|
1538
|
-
let [r, i] = u(
|
|
1547
|
+
}, st = (e) => e === "system" ? "light" : e === "light" ? "dark" : "system";
|
|
1548
|
+
function ct({ variant: e = "dropdown", showLabel: n = !1 }) {
|
|
1549
|
+
let [r, i] = u(ot);
|
|
1539
1550
|
o(() => {
|
|
1540
|
-
typeof window < "u" && (document.documentElement.classList.toggle("dark",
|
|
1551
|
+
typeof window < "u" && (document.documentElement.classList.toggle("dark", at(r)), window.localStorage.setItem(it, r));
|
|
1541
1552
|
}, [r]);
|
|
1542
1553
|
let a = () => {
|
|
1543
|
-
i(
|
|
1554
|
+
i(st(r));
|
|
1544
1555
|
};
|
|
1545
1556
|
if (e === "toggle") {
|
|
1546
|
-
let e =
|
|
1557
|
+
let e = Z[r], t = st(r);
|
|
1547
1558
|
return /* @__PURE__ */ f("div", {
|
|
1548
1559
|
className: "arc-theme-switcher",
|
|
1549
|
-
children: /* @__PURE__ */ p(
|
|
1550
|
-
active:
|
|
1560
|
+
children: /* @__PURE__ */ p(q, {
|
|
1561
|
+
active: at(r),
|
|
1551
1562
|
"aria-label": `Switch to ${t} theme`,
|
|
1552
1563
|
title: `Switch to ${t} theme`,
|
|
1553
1564
|
onClick: a,
|
|
1554
1565
|
className: "w-fit gap-3",
|
|
1555
|
-
children: [/* @__PURE__ */ f(e, { "aria-hidden": "true" }), n &&
|
|
1566
|
+
children: [/* @__PURE__ */ f(e, { "aria-hidden": "true" }), n && Q[r]]
|
|
1556
1567
|
})
|
|
1557
1568
|
});
|
|
1558
1569
|
}
|
|
1559
|
-
let s =
|
|
1570
|
+
let s = Z[r];
|
|
1560
1571
|
return /* @__PURE__ */ f("div", {
|
|
1561
1572
|
className: "arc-theme-switcher",
|
|
1562
|
-
children: /* @__PURE__ */ p(
|
|
1573
|
+
children: /* @__PURE__ */ p(J, {
|
|
1563
1574
|
className: "gap-3",
|
|
1564
1575
|
contentClassName: "min-w-(--anchor-width)",
|
|
1565
|
-
buttonText: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(s, { "aria-hidden": "true" }), n &&
|
|
1576
|
+
buttonText: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(s, { "aria-hidden": "true" }), n && Q[r]] }),
|
|
1566
1577
|
children: [
|
|
1567
|
-
/* @__PURE__ */ f(
|
|
1578
|
+
/* @__PURE__ */ f(J.Item, {
|
|
1568
1579
|
asChild: !0,
|
|
1569
1580
|
className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
|
|
1570
|
-
children: /* @__PURE__ */ p(
|
|
1581
|
+
children: /* @__PURE__ */ p(q, {
|
|
1571
1582
|
active: r === "system",
|
|
1572
1583
|
title: "System Theme",
|
|
1573
1584
|
onClick: () => {
|
|
@@ -1577,13 +1588,13 @@ function lt({ variant: e = "dropdown", showLabel: n = !1 }) {
|
|
|
1577
1588
|
children: [/* @__PURE__ */ f(F, {
|
|
1578
1589
|
className: "size-4",
|
|
1579
1590
|
"aria-hidden": "true"
|
|
1580
|
-
}), n &&
|
|
1591
|
+
}), n && Q.system]
|
|
1581
1592
|
})
|
|
1582
1593
|
}),
|
|
1583
|
-
/* @__PURE__ */ f(
|
|
1594
|
+
/* @__PURE__ */ f(J.Item, {
|
|
1584
1595
|
asChild: !0,
|
|
1585
1596
|
className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
|
|
1586
|
-
children: /* @__PURE__ */ p(
|
|
1597
|
+
children: /* @__PURE__ */ p(q, {
|
|
1587
1598
|
active: r === "light",
|
|
1588
1599
|
title: "Light Theme",
|
|
1589
1600
|
onClick: () => {
|
|
@@ -1593,13 +1604,13 @@ function lt({ variant: e = "dropdown", showLabel: n = !1 }) {
|
|
|
1593
1604
|
children: [/* @__PURE__ */ f(L, {
|
|
1594
1605
|
className: "size-4",
|
|
1595
1606
|
"aria-hidden": "true"
|
|
1596
|
-
}), n &&
|
|
1607
|
+
}), n && Q.light]
|
|
1597
1608
|
})
|
|
1598
1609
|
}),
|
|
1599
|
-
/* @__PURE__ */ f(
|
|
1610
|
+
/* @__PURE__ */ f(J.Item, {
|
|
1600
1611
|
asChild: !0,
|
|
1601
1612
|
className: t("border-0! focus-visible:outline-none", n ? "px-3!" : "justify-center! p-0!"),
|
|
1602
|
-
children: /* @__PURE__ */ p(
|
|
1613
|
+
children: /* @__PURE__ */ p(q, {
|
|
1603
1614
|
active: r === "dark",
|
|
1604
1615
|
title: "Dark Theme",
|
|
1605
1616
|
onClick: () => {
|
|
@@ -1609,7 +1620,7 @@ function lt({ variant: e = "dropdown", showLabel: n = !1 }) {
|
|
|
1609
1620
|
children: [/* @__PURE__ */ f(I, {
|
|
1610
1621
|
className: "size-4",
|
|
1611
1622
|
"aria-hidden": "true"
|
|
1612
|
-
}), n &&
|
|
1623
|
+
}), n && Q.dark]
|
|
1613
1624
|
})
|
|
1614
1625
|
})
|
|
1615
1626
|
]
|
|
@@ -1617,16 +1628,16 @@ function lt({ variant: e = "dropdown", showLabel: n = !1 }) {
|
|
|
1617
1628
|
});
|
|
1618
1629
|
}
|
|
1619
1630
|
// components/typing-animation.tsx
|
|
1620
|
-
function
|
|
1631
|
+
function lt(e) {
|
|
1621
1632
|
return e === "newline" ? "\n" : e === "comma" ? ", " : "";
|
|
1622
1633
|
}
|
|
1623
|
-
function
|
|
1634
|
+
function ut(e, t, n, r, i) {
|
|
1624
1635
|
if (r === "character") return Math.max(0, Math.min(e.length, t + n * i));
|
|
1625
1636
|
let a = [...e.matchAll(/\S+\s*/g)].map((e) => e.index + e[0].length), o = t;
|
|
1626
1637
|
for (let t = 0; t < n; t += 1) o = i === 1 ? a.find((e) => e > o) ?? e.length : [...a].reverse().find((e) => e < o) ?? 0;
|
|
1627
1638
|
return o;
|
|
1628
1639
|
}
|
|
1629
|
-
function
|
|
1640
|
+
function dt({ strings: e, placeholder: t, perTick: n = {
|
|
1630
1641
|
amount: 1,
|
|
1631
1642
|
unit: "character"
|
|
1632
1643
|
}, msDelay: r = {
|
|
@@ -1671,9 +1682,9 @@ function ft({ strings: e, placeholder: t, perTick: n = {
|
|
|
1671
1682
|
T([]), C(""), N.current += 1, P.current = 0, t = setTimeout(r, _);
|
|
1672
1683
|
return;
|
|
1673
1684
|
}
|
|
1674
|
-
if (L.current) P.current =
|
|
1685
|
+
if (L.current) P.current = ut(i, P.current, b, x, -1), C(i.slice(0, P.current)), P.current === 0 && (L.current = !1, N.current = (N.current + 1) % e.length);
|
|
1675
1686
|
else {
|
|
1676
|
-
if (P.current =
|
|
1687
|
+
if (P.current = ut(i, P.current, b, x, 1), C(i.slice(0, P.current)), L.current = !n && P.current === i.length && (s || N.current < e.length - 1), !n && P.current === i.length && !L.current && !s) {
|
|
1677
1688
|
k(!0);
|
|
1678
1689
|
return;
|
|
1679
1690
|
}
|
|
@@ -1706,13 +1717,13 @@ function ft({ strings: e, placeholder: t, perTick: n = {
|
|
|
1706
1717
|
O,
|
|
1707
1718
|
v
|
|
1708
1719
|
]);
|
|
1709
|
-
let R = A ? "." : "", z = d !== "clear", B =
|
|
1720
|
+
let R = A ? "." : "", z = d !== "clear", B = lt(d), ee = w.reduce((e, t) => e + t.split("\n").length, 0);
|
|
1710
1721
|
return z ? /* @__PURE__ */ f("div", {
|
|
1711
1722
|
ref: (e) => {
|
|
1712
1723
|
M.current = e;
|
|
1713
1724
|
},
|
|
1714
1725
|
className: "arc-typing-animation overflow-hidden",
|
|
1715
|
-
style: { "--typing-roll-offset":
|
|
1726
|
+
style: { "--typing-roll-offset": ee },
|
|
1716
1727
|
children: /* @__PURE__ */ p("div", {
|
|
1717
1728
|
className: "whitespace-pre-line",
|
|
1718
1729
|
children: [
|
|
@@ -1737,7 +1748,7 @@ function ft({ strings: e, placeholder: t, perTick: n = {
|
|
|
1737
1748
|
});
|
|
1738
1749
|
}
|
|
1739
1750
|
// utilities/hash-navigation.ts
|
|
1740
|
-
function
|
|
1751
|
+
function $({ intervalMs: e = 500, maxAttempts: t = 20, behavior: n = "smooth", block: r } = {}) {
|
|
1741
1752
|
if (typeof window > "u") return () => {};
|
|
1742
1753
|
let i = 0, a = setInterval(() => {
|
|
1743
1754
|
i += 1;
|
|
@@ -1755,10 +1766,10 @@ function pt({ intervalMs: e = 500, maxAttempts: t = 20, behavior: n = "smooth",
|
|
|
1755
1766
|
}, e);
|
|
1756
1767
|
return () => clearInterval(a);
|
|
1757
1768
|
}
|
|
1758
|
-
function
|
|
1759
|
-
o(() =>
|
|
1769
|
+
function ft(e) {
|
|
1770
|
+
o(() => $(e), []);
|
|
1760
1771
|
}
|
|
1761
|
-
function
|
|
1772
|
+
function pt({ container: e, sectionIds: t, hashFirstSection: n = !0, onActiveChange: r }) {
|
|
1762
1773
|
let i = t.map((e) => document.getElementById(e)).filter((e) => e !== null), a = window.location.hash.toLowerCase().slice(1) || null, o = () => {
|
|
1763
1774
|
let t = e.getBoundingClientRect(), o = t.top + t.height / 2, s = i.find((e) => {
|
|
1764
1775
|
let t = e.getBoundingClientRect();
|
|
@@ -1770,4 +1781,4 @@ function ht({ container: e, sectionIds: t, hashFirstSection: n = !0, onActiveCha
|
|
|
1770
1781
|
};
|
|
1771
1782
|
return o(), e.addEventListener("scroll", o, { passive: !0 }), () => e.removeEventListener("scroll", o);
|
|
1772
1783
|
}
|
|
1773
|
-
export { De as Avatar,
|
|
1784
|
+
export { De as Avatar, V as Button, xe as ButtonGroup, K as Card, Le as DateHandler, Oe as Divider, Ce as DoubleClickButton, ke as Dropdown, H as ErrorText, Ne as GridLoader, G as Input, Re as InputTimestamp, Pe as LabelField, we as LongPressButton, J as Menu, He as Modal, Ue as MultiDropdown, q as Pill, Be as PillLink, W as PreviewCard, Y as Select, tt as Switch, Xe as Table, Ge as Tag, et as TextLink, ct as ThemeSwitcher, dt as TypingAnimation, $ as navigateToHashOnLoad, pt as updateHashOnScroll, ft as useHashNavigationOnLoad };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { FormattedTimeTemplate } from '../utilities/date-handler';
|
|
2
3
|
export interface InputTimestampProps extends Omit<ComponentPropsWithoutRef<"input">, "value"> {
|
|
3
4
|
value?: unknown;
|
|
4
|
-
format?:
|
|
5
|
+
format?: FormattedTimeTemplate;
|
|
5
6
|
}
|
|
6
7
|
declare const InputTimestamp: ({ value, format, ...rest }: InputTimestampProps) => import('react').JSX.Element;
|
|
7
8
|
export default InputTimestamp;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { DeepKeys, CellContext } from '@tanstack/react-table';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
type TableColumnMeta = {
|
|
4
|
+
headerLabel?: string;
|
|
5
|
+
filterSelectOptions?: {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
mobileFullWidth?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type TableColumnDef<TData extends object = Record<string, unknown>, TValue = unknown> = {
|
|
3
12
|
header: string;
|
|
4
13
|
id?: string;
|
|
5
14
|
enableResizing?: boolean;
|
|
@@ -15,16 +24,49 @@ export type TableColumnDef = {
|
|
|
15
24
|
label: string;
|
|
16
25
|
}[];
|
|
17
26
|
mobileFullWidth?: boolean;
|
|
18
|
-
cell?:
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
cell?: (context: CellContext<typeof features, TData, TValue>) => ReactNode;
|
|
28
|
+
} & ({
|
|
29
|
+
accessorKey: DeepKeys<TData>;
|
|
30
|
+
accessorFn?: never;
|
|
31
|
+
} | {
|
|
32
|
+
accessorKey?: never;
|
|
33
|
+
accessorFn: (row: TData) => TValue;
|
|
34
|
+
id: string;
|
|
35
|
+
});
|
|
36
|
+
export type TableProps<TData extends object = Record<string, unknown>> = {
|
|
37
|
+
data: TData[];
|
|
38
|
+
columnDef: TableColumnDef<TData, any>[];
|
|
23
39
|
pageSize?: number;
|
|
24
40
|
className?: string;
|
|
25
41
|
showHeader?: boolean;
|
|
26
42
|
showFilters?: boolean;
|
|
27
43
|
showSorting?: boolean;
|
|
28
44
|
};
|
|
29
|
-
declare const
|
|
45
|
+
declare const features: {
|
|
46
|
+
columnMeta: TableColumnMeta;
|
|
47
|
+
columnFilteringFeature: import('@tanstack/react-table').TableFeature;
|
|
48
|
+
columnResizingFeature: import('@tanstack/react-table').TableFeature;
|
|
49
|
+
columnSizingFeature: import('@tanstack/react-table').TableFeature;
|
|
50
|
+
columnVisibilityFeature: import('@tanstack/react-table').TableFeature;
|
|
51
|
+
globalFilteringFeature: import('@tanstack/react-table').TableFeature;
|
|
52
|
+
rowPaginationFeature: import('@tanstack/react-table').TableFeature;
|
|
53
|
+
rowSortingFeature: import('@tanstack/react-table').TableFeature;
|
|
54
|
+
filteredRowModel: (table: import('@tanstack/react-table').Table<any, any>) => () => import('@tanstack/react-table').RowModel<any, any>;
|
|
55
|
+
paginatedRowModel: (table: import('@tanstack/react-table').Table<any, any>) => () => import('@tanstack/react-table').RowModel<any, any>;
|
|
56
|
+
sortedRowModel: (table: import('@tanstack/react-table').Table<any, any>) => () => import('@tanstack/react-table').RowModel<any, any>;
|
|
57
|
+
sortFns: {
|
|
58
|
+
alphanumeric: import('@tanstack/react-table').CreatedSortFn<any, any>;
|
|
59
|
+
alphanumericCaseSensitive: import('@tanstack/react-table').CreatedSortFn<any, any>;
|
|
60
|
+
basic: import('@tanstack/react-table').CreatedSortFn<any, any>;
|
|
61
|
+
datetime: import('@tanstack/react-table').CreatedSortFn<any, any>;
|
|
62
|
+
text: import('@tanstack/react-table').CreatedSortFn<any, any>;
|
|
63
|
+
textCaseSensitive: import('@tanstack/react-table').CreatedSortFn<any, any>;
|
|
64
|
+
};
|
|
65
|
+
filterFns: {
|
|
66
|
+
fuzzy: (row: any, columnId: any, value: any, addMeta: any) => boolean;
|
|
67
|
+
includesString: import('@tanstack/react-table').CreatedFilterFn<any, any>;
|
|
68
|
+
select: (row: any, columnId: any, filterValue: any) => boolean;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
declare const Table: <TData extends object = Record<string, unknown>>({ data, columnDef, pageSize, className, showHeader, showFilters, showSorting, }: TableProps<TData>) => import('react').JSX.Element;
|
|
30
72
|
export default Table;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { DurationLike, ToRelativeOptions } from 'luxon';
|
|
2
|
+
/** Any Luxon format string; common values are listed for editor suggestions. */
|
|
3
|
+
export type DateTimeFormat = (string & {}) | "dd/MMM/yyyy hh:mm:ss a" | "dd/MM/yyyy" | "MMM d, yyyy" | "yyyy-MM-dd" | "yyyy-MM-dd'T'HH:mm:ss" | "HH:mm:ss" | "hh:mm a" | "cccc, dd LLLL yyyy 'at' hh:mm a" | "D" | "DD" | "DDD" | "t" | "T" | "f" | "F";
|
|
4
|
+
/** Any template string; the listed placeholders are replaced with formatted date values. */
|
|
5
|
+
export type FormattedTimeTemplate = (string & {}) | "$ISO$ ($RELATIVE$)" | "$ISO$" | "$RELATIVE$" | "$ISO$ - $RELATIVE$" | "$RELATIVE$ - $ISO$";
|
|
2
6
|
export declare class DateHandler {
|
|
3
7
|
private static toDateTime;
|
|
4
|
-
static getDateTime(date: unknown, format?:
|
|
8
|
+
static getDateTime(date: unknown, format?: DateTimeFormat): string;
|
|
5
9
|
static getRelativeTime(date: unknown, options?: ToRelativeOptions): string;
|
|
6
10
|
static getTimeDiff(date: unknown): string | null;
|
|
7
11
|
static generateOffsetDateTime({ offset, future, format, }: {
|
|
8
12
|
offset: DurationLike;
|
|
9
13
|
future?: boolean;
|
|
10
|
-
format?:
|
|
14
|
+
format?: DateTimeFormat | null;
|
|
11
15
|
}): string;
|
|
12
|
-
static getFormattedTime(date: unknown, format?:
|
|
16
|
+
static getFormattedTime(date: unknown, format?: FormattedTimeTemplate): string;
|
|
13
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { DateHandler } from './date-handler';
|
|
2
|
+
export type { DateTimeFormat, FormattedTimeTemplate } from './date-handler';
|
|
2
3
|
export { navigateToHashOnLoad, updateHashOnScroll, useHashNavigationOnLoad } from './hash-navigation';
|
|
3
4
|
export type { HashNavigationOptions, UpdateHashOnScrollOptions } from './hash-navigation';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@febkosq8/arc",
|
|
3
3
|
"description": "A React components library for febkosq8",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.5",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/arc.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
@@ -17,9 +17,21 @@
|
|
|
17
17
|
"dist",
|
|
18
18
|
"components/index.css"
|
|
19
19
|
],
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Febkosq8",
|
|
22
|
+
"email": "contact@febkosq8.me",
|
|
23
|
+
"url": "https://febkosq8.me"
|
|
24
|
+
},
|
|
25
|
+
"license": "CC-BY-NC-4.0",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=26.13.0"
|
|
28
|
+
},
|
|
20
29
|
"homepage": "https://www.npmjs.com/package/@febkosq8/arc",
|
|
21
|
-
"repository":
|
|
22
|
-
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/febkosq8/arc.git"
|
|
33
|
+
},
|
|
34
|
+
"packageManager": "pnpm@12.18.0",
|
|
23
35
|
"scripts": {
|
|
24
36
|
"build": "vite build",
|
|
25
37
|
"storybook": "storybook dev -p 6006",
|
|
@@ -34,23 +46,23 @@
|
|
|
34
46
|
},
|
|
35
47
|
"dependencies": {
|
|
36
48
|
"@base-ui/react": "1.9.0",
|
|
37
|
-
"@rinzai/zen": "0.
|
|
49
|
+
"@rinzai/zen": "0.17.0",
|
|
38
50
|
"@tanstack/match-sorter-utils": "9.2.6",
|
|
39
51
|
"@tanstack/react-table": "9.3.1",
|
|
40
52
|
"luxon": "3.7.2",
|
|
41
53
|
"react-icons": "5.7.0"
|
|
42
54
|
},
|
|
43
55
|
"devDependencies": {
|
|
44
|
-
"@storybook/addon-docs": "10.6.
|
|
45
|
-
"@storybook/react-vite": "10.6.
|
|
46
|
-
"@tailwindcss/
|
|
56
|
+
"@storybook/addon-docs": "10.6.6",
|
|
57
|
+
"@storybook/react-vite": "10.6.6",
|
|
58
|
+
"@tailwindcss/vite": "4.3.4",
|
|
47
59
|
"@types/luxon": "3.7.6",
|
|
48
|
-
"@types/node": "26.6.
|
|
60
|
+
"@types/node": "26.6.6",
|
|
49
61
|
"@types/react": "19.3.0",
|
|
50
62
|
"@types/react-dom": "19.3.0",
|
|
51
63
|
"@typescript/typescript6": "6.0.2",
|
|
52
|
-
"@vitejs/plugin-react": "6.1
|
|
53
|
-
"eslint": "10.
|
|
64
|
+
"@vitejs/plugin-react": "6.2.1",
|
|
65
|
+
"eslint": "10.14.0",
|
|
54
66
|
"prettier": "3.9.10",
|
|
55
67
|
"prettier-plugin-css-order": "2.2.0",
|
|
56
68
|
"prettier-plugin-organize-attributes": "1.0.0",
|
|
@@ -58,10 +70,10 @@
|
|
|
58
70
|
"prettier-plugin-tailwindcss": "0.8.1",
|
|
59
71
|
"react": "19.3.1",
|
|
60
72
|
"react-dom": "19.3.1",
|
|
61
|
-
"storybook": "10.6.
|
|
62
|
-
"tailwindcss": "4.3.
|
|
73
|
+
"storybook": "10.6.6",
|
|
74
|
+
"tailwindcss": "4.3.4",
|
|
63
75
|
"typescript": "7.0.2",
|
|
64
76
|
"unplugin-dts": "1.1.2",
|
|
65
|
-
"vite": "8.3.
|
|
77
|
+
"vite": "8.3.6"
|
|
66
78
|
}
|
|
67
79
|
}
|