@thekestongroup/ui 0.3.0 → 0.5.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 +18 -9
- package/dist/components/AppShell/AppShell.vue.d.ts +4 -2
- package/dist/components/EmptyState/EmptyState.vue.d.ts +55 -0
- package/dist/components/Header/Header.vue.d.ts +9 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts +1 -1
- package/dist/components/Table/Table.vue.d.ts +14 -1
- package/dist/index.d.ts +2 -0
- package/dist/keston-ui.js +260 -156
- package/package.json +5 -1
- package/src/components/AppShell/AppShell.stories.ts +5 -0
- package/src/components/AppShell/AppShell.vue +16 -3
- package/src/components/EmptyState/EmptyState.stories.ts +99 -0
- package/src/components/EmptyState/EmptyState.vue +87 -0
- package/src/components/Header/Header.stories.ts +9 -0
- package/src/components/Header/Header.vue +27 -4
- package/src/components/Notification/NotificationPane.vue +8 -9
- package/src/components/Table/Table.stories.ts +73 -9
- package/src/components/Table/Table.vue +61 -5
- package/src/index.ts +2 -0
package/dist/keston-ui.js
CHANGED
|
@@ -479,6 +479,8 @@ var kn = ["z-50 rounded border border-black/15 bg-white text-black shadow-md out
|
|
|
479
479
|
__name: "Header",
|
|
480
480
|
props: {
|
|
481
481
|
title: {},
|
|
482
|
+
titleTo: {},
|
|
483
|
+
linkComponent: { default: "a" },
|
|
482
484
|
menu: {
|
|
483
485
|
type: Boolean,
|
|
484
486
|
default: !1
|
|
@@ -520,8 +522,11 @@ var kn = ["z-50 rounded border border-black/15 bg-white text-black shadow-md out
|
|
|
520
522
|
"sign-in"
|
|
521
523
|
],
|
|
522
524
|
setup(e, { emit: t }) {
|
|
523
|
-
let n = e, r = t, l = i(() => On(n.user?.name ?? "")), f = i(() => n.user ? n.user.avatar || !l.value ? `Account: ${n.user.name}` : `${l.value}, account: ${n.user.name}` : "")
|
|
524
|
-
|
|
525
|
+
let n = e, r = t, l = i(() => On(n.user?.name ?? "")), f = i(() => n.user ? n.user.avatar || !l.value ? `Account: ${n.user.name}` : `${l.value}, account: ${n.user.name}` : ""), p = i(() => {
|
|
526
|
+
let e = n.titleTo;
|
|
527
|
+
if (e != null && e !== "") return n.linkComponent === "a" ? { href: e } : { to: e };
|
|
528
|
+
}), m = ["-mx-2 rounded px-2 py-1 transition-colors hover:bg-black/10 active:bg-black/15", "outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus forced-colors:not-focus-visible:outline-0"];
|
|
529
|
+
function h(e, t) {
|
|
525
530
|
t(), r(e === "account-settings" ? "account-settings" : e === "switch-account" ? "switch-account" : "log-out");
|
|
526
531
|
}
|
|
527
532
|
return (t, i) => (C(), s("header", { class: v(j(X)("flex h-12 shrink-0 items-center gap-2 border-b border-black/15 bg-white px-4 text-black", e.sticky && "sticky top-0 z-40", n.class)) }, [
|
|
@@ -544,10 +549,10 @@ var kn = ["z-50 rounded border border-black/15 bg-white text-black shadow-md out
|
|
|
544
549
|
"class"
|
|
545
550
|
])) : o("", !0),
|
|
546
551
|
D(t.$slots, "leading"),
|
|
547
|
-
e.title || t.$slots.title ? (C(),
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
},
|
|
552
|
+
e.title || t.$slots.title ? (C(), a(O(p.value ? e.linkComponent : "span"), g({ key: 1 }, p.value, { class: j(X)("min-w-0 truncate text-base font-bold", p.value && m, e.ui?.title) }), {
|
|
553
|
+
default: z(() => [D(t.$slots, "title", {}, () => [u(A(e.title), 1)])]),
|
|
554
|
+
_: 3
|
|
555
|
+
}, 16, ["class"])) : o("", !0),
|
|
551
556
|
c("div", { class: v(j(X)("flex min-w-0 flex-1 items-center", e.ui?.middle)) }, [D(t.$slots, "default")], 2),
|
|
552
557
|
t.$slots.trailing || t.$slots.account || e.user || e.signIn ? (C(), s("div", {
|
|
553
558
|
key: 2,
|
|
@@ -570,7 +575,7 @@ var kn = ["z-50 rounded border border-black/15 bg-white text-black shadow-md out
|
|
|
570
575
|
key: 0,
|
|
571
576
|
size: "sm",
|
|
572
577
|
class: "col-start-2 justify-self-start",
|
|
573
|
-
onClick: (e) =>
|
|
578
|
+
onClick: (e) => h("account-settings", n)
|
|
574
579
|
}, {
|
|
575
580
|
leading: z(() => [d(j(Te))]),
|
|
576
581
|
default: z(() => [i[2] ||= u(" Account settings ", -1)]),
|
|
@@ -580,7 +585,7 @@ var kn = ["z-50 rounded border border-black/15 bg-white text-black shadow-md out
|
|
|
580
585
|
D(t.$slots, "account-menu", { close: n }),
|
|
581
586
|
e.userActions.includes("switch-account") || e.userActions.includes("log-out") ? (C(), s("div", er, [e.userActions.includes("switch-account") ? (C(), a(Z, {
|
|
582
587
|
key: 0,
|
|
583
|
-
onClick: (e) =>
|
|
588
|
+
onClick: (e) => h("switch-account", n)
|
|
584
589
|
}, {
|
|
585
590
|
leading: z(() => [d(j(U))]),
|
|
586
591
|
default: z(() => [i[3] ||= u(" Switch account ", -1)]),
|
|
@@ -588,7 +593,7 @@ var kn = ["z-50 rounded border border-black/15 bg-white text-black shadow-md out
|
|
|
588
593
|
}, 8, ["onClick"])) : o("", !0), e.userActions.includes("log-out") ? (C(), a(Z, {
|
|
589
594
|
key: 1,
|
|
590
595
|
class: "ml-auto",
|
|
591
|
-
onClick: (e) =>
|
|
596
|
+
onClick: (e) => h("log-out", n)
|
|
592
597
|
}, {
|
|
593
598
|
leading: z(() => [d(j(be))]),
|
|
594
599
|
default: z(() => [i[4] ||= u(" Log out ", -1)]),
|
|
@@ -1139,6 +1144,7 @@ var ar = ["data-collapsed"], or = ["aria-label"], sr = ["data-level"], cr = {
|
|
|
1139
1144
|
__name: "AppShell",
|
|
1140
1145
|
props: /*@__PURE__*/ h({
|
|
1141
1146
|
title: {},
|
|
1147
|
+
titleTo: {},
|
|
1142
1148
|
user: {},
|
|
1143
1149
|
userActions: { default: void 0 },
|
|
1144
1150
|
signIn: {
|
|
@@ -1199,6 +1205,8 @@ var ar = ["data-collapsed"], or = ["aria-label"], sr = ["data-level"], cr = {
|
|
|
1199
1205
|
}, " Skip to content ", 8, kr),
|
|
1200
1206
|
d(tr, g(e.header, {
|
|
1201
1207
|
title: e.title,
|
|
1208
|
+
"title-to": e.titleTo,
|
|
1209
|
+
"link-component": e.linkComponent,
|
|
1202
1210
|
menu: "",
|
|
1203
1211
|
sticky: "",
|
|
1204
1212
|
"menu-open": s.value,
|
|
@@ -1248,6 +1256,8 @@ var ar = ["data-collapsed"], or = ["aria-label"], sr = ["data-level"], cr = {
|
|
|
1248
1256
|
} : void 0
|
|
1249
1257
|
]), 1040, [
|
|
1250
1258
|
"title",
|
|
1259
|
+
"title-to",
|
|
1260
|
+
"link-component",
|
|
1251
1261
|
"menu-open",
|
|
1252
1262
|
"user",
|
|
1253
1263
|
"user-actions",
|
|
@@ -1283,7 +1293,7 @@ var ar = ["data-collapsed"], or = ["aria-label"], sr = ["data-level"], cr = {
|
|
|
1283
1293
|
title: e.title || "Menu",
|
|
1284
1294
|
ui: {
|
|
1285
1295
|
content: "max-w-72",
|
|
1286
|
-
header: "h-12
|
|
1296
|
+
header: "h-12 justify-center px-5 py-0",
|
|
1287
1297
|
title: "text-base font-bold",
|
|
1288
1298
|
body: "flex p-0"
|
|
1289
1299
|
}
|
|
@@ -3934,15 +3944,71 @@ var ta = [
|
|
|
3934
3944
|
text: p.value
|
|
3935
3945
|
}, null, 8, ["status", "text"])], 2));
|
|
3936
3946
|
}
|
|
3937
|
-
}), Ha =
|
|
3947
|
+
}), Ha = /* @__PURE__ */ f({
|
|
3948
|
+
__name: "EmptyState",
|
|
3949
|
+
props: {
|
|
3950
|
+
title: {},
|
|
3951
|
+
description: {},
|
|
3952
|
+
icon: {},
|
|
3953
|
+
headingLevel: {},
|
|
3954
|
+
size: { default: "md" },
|
|
3955
|
+
class: { type: [
|
|
3956
|
+
Boolean,
|
|
3957
|
+
null,
|
|
3958
|
+
String,
|
|
3959
|
+
Object,
|
|
3960
|
+
Array
|
|
3961
|
+
] },
|
|
3962
|
+
ui: {}
|
|
3963
|
+
},
|
|
3964
|
+
setup(e) {
|
|
3965
|
+
let t = e, n = {
|
|
3966
|
+
sm: {
|
|
3967
|
+
root: "gap-2 px-4 py-10",
|
|
3968
|
+
icon: "size-6",
|
|
3969
|
+
title: "text-sm",
|
|
3970
|
+
description: "text-sm"
|
|
3971
|
+
},
|
|
3972
|
+
md: {
|
|
3973
|
+
root: "gap-2 px-4 py-12",
|
|
3974
|
+
icon: "size-8",
|
|
3975
|
+
title: "text-base",
|
|
3976
|
+
description: "text-sm"
|
|
3977
|
+
}
|
|
3978
|
+
};
|
|
3979
|
+
return (r, i) => (C(), s("div", { class: v(j(X)("flex flex-col items-center text-center", n[e.size].root, t.class)) }, [
|
|
3980
|
+
e.icon ? (C(), s("div", {
|
|
3981
|
+
key: 0,
|
|
3982
|
+
class: v(j(X)("flex text-black/45", e.size === "md" && "mb-1", e.ui?.icon)),
|
|
3983
|
+
"aria-hidden": "true"
|
|
3984
|
+
}, [(C(), a(O(e.icon), { class: v(n[e.size].icon) }, null, 8, ["class"]))], 2)) : o("", !0),
|
|
3985
|
+
r.$slots.title || e.title ? (C(), a(O(e.headingLevel ? `h${e.headingLevel}` : "p"), {
|
|
3986
|
+
key: 1,
|
|
3987
|
+
class: v(j(X)("font-bold text-black", n[e.size].title, e.ui?.title))
|
|
3988
|
+
}, {
|
|
3989
|
+
default: z(() => [D(r.$slots, "title", {}, () => [u(A(e.title), 1)])]),
|
|
3990
|
+
_: 3
|
|
3991
|
+
}, 8, ["class"])) : o("", !0),
|
|
3992
|
+
r.$slots.description || e.description ? (C(), s("p", {
|
|
3993
|
+
key: 2,
|
|
3994
|
+
class: v(j(X)("max-w-sm text-black/65", n[e.size].description, e.ui?.description))
|
|
3995
|
+
}, [D(r.$slots, "description", {}, () => [u(A(e.description), 1)])], 2)) : o("", !0),
|
|
3996
|
+
D(r.$slots, "default"),
|
|
3997
|
+
r.$slots.actions ? (C(), s("div", {
|
|
3998
|
+
key: 3,
|
|
3999
|
+
class: v(j(X)("mt-2 flex flex-wrap justify-center gap-2", e.ui?.actions))
|
|
4000
|
+
}, [D(r.$slots, "actions")], 2)) : o("", !0)
|
|
4001
|
+
], 2));
|
|
4002
|
+
}
|
|
4003
|
+
}), Ua = new Intl.Collator("en-GB", {
|
|
3938
4004
|
numeric: !0,
|
|
3939
4005
|
sensitivity: "base"
|
|
3940
4006
|
});
|
|
3941
|
-
function
|
|
4007
|
+
function Wa(e, t) {
|
|
3942
4008
|
let n = e == null || e === "", r = t == null || t === "";
|
|
3943
|
-
return n || r ? n === r ? 0 : n ? 1 : -1 : typeof e == "number" && typeof t == "number" ? e - t : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "boolean" && typeof t == "boolean" ? Number(e) - Number(t) :
|
|
4009
|
+
return n || r ? n === r ? 0 : n ? 1 : -1 : typeof e == "number" && typeof t == "number" ? e - t : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "boolean" && typeof t == "boolean" ? Number(e) - Number(t) : Ua.compare(String(e), String(t));
|
|
3944
4010
|
}
|
|
3945
|
-
function
|
|
4011
|
+
function Ga(e, t, n) {
|
|
3946
4012
|
let r = n && t.find((e) => e.key === n.key);
|
|
3947
4013
|
if (!n || !r) return [...e];
|
|
3948
4014
|
let i = r.sortValue ?? ((e) => e[r.key]), a = n.direction === "asc" ? 1 : -1;
|
|
@@ -3952,10 +4018,10 @@ function Wa(e, t, n) {
|
|
|
3952
4018
|
value: i(e)
|
|
3953
4019
|
})).sort((e, t) => {
|
|
3954
4020
|
let n = e.value === null || e.value === void 0 || e.value === "", r = t.value === null || t.value === void 0 || t.value === "";
|
|
3955
|
-
return (n || r ?
|
|
4021
|
+
return (n || r ? Wa(e.value, t.value) : a * Wa(e.value, t.value)) || e.index - t.index;
|
|
3956
4022
|
}).map((e) => e.row);
|
|
3957
4023
|
}
|
|
3958
|
-
function
|
|
4024
|
+
function Ka(e, t) {
|
|
3959
4025
|
return e?.key === t ? e.direction === "asc" ? {
|
|
3960
4026
|
key: t,
|
|
3961
4027
|
direction: "desc"
|
|
@@ -3965,18 +4031,18 @@ function Ga(e, t) {
|
|
|
3965
4031
|
};
|
|
3966
4032
|
}
|
|
3967
4033
|
// src/components/Table/Table.vue?vue&type=script&setup=true&lang.ts
|
|
3968
|
-
var
|
|
4034
|
+
var qa = [
|
|
3969
4035
|
"tabindex",
|
|
3970
4036
|
"role",
|
|
3971
4037
|
"aria-labelledby",
|
|
3972
4038
|
"aria-label"
|
|
3973
|
-
],
|
|
4039
|
+
], Ja = ["aria-busy"], Ya = ["aria-sort"], Xa = {
|
|
3974
4040
|
key: 0,
|
|
3975
4041
|
class: "sr-only"
|
|
3976
|
-
},
|
|
4042
|
+
}, Za = ["onClick"], Qa = { key: 0 }, $a = ["colspan"], eo = {
|
|
3977
4043
|
key: 0,
|
|
3978
4044
|
class: "inline-flex items-center gap-2"
|
|
3979
|
-
},
|
|
4045
|
+
}, to = "outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus forced-colors:not-focus-visible:outline-0", no = "outline-2 -outline-offset-2 outline-transparent focus-visible:outline-focus forced-colors:not-focus-visible:outline-0", ro = /* @__PURE__ */ f({
|
|
3980
4046
|
__name: "Table",
|
|
3981
4047
|
props: /*@__PURE__*/ h({
|
|
3982
4048
|
columns: {},
|
|
@@ -3989,6 +4055,8 @@ var Ka = [
|
|
|
3989
4055
|
size: { default: "md" },
|
|
3990
4056
|
stickyHeader: { type: Boolean },
|
|
3991
4057
|
manualSort: { type: Boolean },
|
|
4058
|
+
rowLink: {},
|
|
4059
|
+
linkComponent: { default: "a" },
|
|
3992
4060
|
class: { type: [
|
|
3993
4061
|
Boolean,
|
|
3994
4062
|
null,
|
|
@@ -4003,32 +4071,45 @@ var Ka = [
|
|
|
4003
4071
|
}),
|
|
4004
4072
|
emits: ["update:sort"],
|
|
4005
4073
|
setup(e) {
|
|
4006
|
-
let t = e, r = P(e, "sort"), l = `${N()}-caption`, f = i(() => t.manualSort ? t.rows :
|
|
4074
|
+
let t = e, r = P(e, "sort"), l = `${N()}-caption`, f = i(() => t.manualSort ? t.rows : Ga(t.rows, t.columns, r.value));
|
|
4007
4075
|
function p(e, n) {
|
|
4008
4076
|
return typeof t.rowKey == "function" ? t.rowKey(e, n) : t.rowKey ? e[t.rowKey] : n;
|
|
4009
4077
|
}
|
|
4010
4078
|
function m(e) {
|
|
4011
4079
|
if (e.sortable) return r.value?.key === e.key ? r.value.direction === "asc" ? "ascending" : "descending" : "none";
|
|
4012
4080
|
}
|
|
4013
|
-
let h = i(() => t.
|
|
4014
|
-
function
|
|
4081
|
+
let h = i(() => (t.columns.find((e) => e.rowHeader) ?? t.columns[0])?.key);
|
|
4082
|
+
function _(e, n) {
|
|
4083
|
+
let r = t.rowLink?.(e, n);
|
|
4084
|
+
if (r != null && r !== "") return t.linkComponent === "a" ? { href: r } : { to: r };
|
|
4085
|
+
}
|
|
4086
|
+
let y = [
|
|
4087
|
+
"text-inherit no-underline outline-none group-hover/row:underline underline-offset-2",
|
|
4088
|
+
"after:absolute after:inset-0 after:outline-2 after:-outline-offset-2 after:outline-transparent",
|
|
4089
|
+
"focus-visible:after:outline-focus forced-colors:not-focus-visible:after:outline-0"
|
|
4090
|
+
], b = [
|
|
4091
|
+
"relative cursor-pointer hover:bg-black/5",
|
|
4092
|
+
"[&_:is(a,button,input,select,textarea,label,[tabindex]):not([data-row-link])]:relative",
|
|
4093
|
+
"[&_:is(a,button,input,select,textarea,label,[tabindex]):not([data-row-link])]:z-1"
|
|
4094
|
+
], w = i(() => t.size === "sm" ? "px-4 py-2" : "px-4 py-3");
|
|
4095
|
+
function k(e) {
|
|
4015
4096
|
return X(e.align === "end" && "text-right", e.nowrap !== !1 && "whitespace-nowrap", e.class);
|
|
4016
4097
|
}
|
|
4017
|
-
let
|
|
4018
|
-
function
|
|
4019
|
-
let e =
|
|
4020
|
-
e && (
|
|
4098
|
+
let M = T(), F = T(!1), I;
|
|
4099
|
+
function L() {
|
|
4100
|
+
let e = M.value;
|
|
4101
|
+
e && (F.value = e.scrollWidth > e.clientWidth + 1 || e.scrollHeight > e.clientHeight + 1);
|
|
4021
4102
|
}
|
|
4022
4103
|
return S(() => {
|
|
4023
|
-
|
|
4024
|
-
}), x(() =>
|
|
4104
|
+
L(), I = new ResizeObserver(L), M.value && (I.observe(M.value), M.value.firstElementChild && I.observe(M.value.firstElementChild));
|
|
4105
|
+
}), x(() => I?.disconnect()), (i, x) => (C(), s("div", {
|
|
4025
4106
|
ref_key: "scroller",
|
|
4026
|
-
ref:
|
|
4027
|
-
class: v(j(X)("relative overflow-auto",
|
|
4028
|
-
tabindex:
|
|
4029
|
-
role:
|
|
4030
|
-
"aria-labelledby":
|
|
4031
|
-
"aria-label":
|
|
4107
|
+
ref: M,
|
|
4108
|
+
class: v(j(X)("relative overflow-auto", F.value && no, t.class)),
|
|
4109
|
+
tabindex: F.value ? 0 : void 0,
|
|
4110
|
+
role: F.value ? "region" : void 0,
|
|
4111
|
+
"aria-labelledby": F.value && (e.caption || i.$slots.caption) ? l : void 0,
|
|
4112
|
+
"aria-label": F.value && !e.caption && !i.$slots.caption ? "Table" : void 0
|
|
4032
4113
|
}, [c("table", {
|
|
4033
4114
|
class: v(j(X)("w-full border-separate border-spacing-0 text-left text-sm text-black", e.ui?.table)),
|
|
4034
4115
|
"aria-busy": e.loading || void 0
|
|
@@ -4042,12 +4123,12 @@ var Ka = [
|
|
|
4042
4123
|
key: e.key,
|
|
4043
4124
|
scope: "col",
|
|
4044
4125
|
"aria-sort": m(e),
|
|
4045
|
-
class: v(j(X)("border-b border-black/15 font-bold text-black/65",
|
|
4046
|
-
}, [D(i.$slots, `header-${e.key}`, { column: e }, () => [e.hideLabel ? (C(), s("span",
|
|
4126
|
+
class: v(j(X)("border-b border-black/15 font-bold text-black/65", w.value, k(e)))
|
|
4127
|
+
}, [D(i.$slots, `header-${e.key}`, { column: e }, () => [e.hideLabel ? (C(), s("span", Xa, A(e.label), 1)) : e.sortable ? (C(), s("button", {
|
|
4047
4128
|
key: 1,
|
|
4048
4129
|
type: "button",
|
|
4049
|
-
class: v(j(X)("-mx-1 inline-flex cursor-pointer items-center gap-1 rounded px-1 font-bold hover:text-black", e.align === "end" && "flex-row-reverse", r.value?.key === e.key && "text-black",
|
|
4050
|
-
onClick: (t) => r.value = j(
|
|
4130
|
+
class: v(j(X)("-mx-1 inline-flex cursor-pointer items-center gap-1 rounded px-1 font-bold hover:text-black", e.align === "end" && "flex-row-reverse", r.value?.key === e.key && "text-black", to)),
|
|
4131
|
+
onClick: (t) => r.value = j(Ka)(r.value, e.key)
|
|
4051
4132
|
}, [u(A(e.label) + " ", 1), r.value?.key === e.key && r.value.direction === "asc" ? (C(), a(j(G), {
|
|
4052
4133
|
key: 0,
|
|
4053
4134
|
class: "size-4 shrink-0",
|
|
@@ -4060,47 +4141,64 @@ var Ka = [
|
|
|
4060
4141
|
key: 2,
|
|
4061
4142
|
class: "size-4 shrink-0 text-black/40",
|
|
4062
4143
|
"aria-hidden": "true"
|
|
4063
|
-
}))], 10,
|
|
4064
|
-
c("tbody", { class: v(j(X)(e.loading && f.value.length && "opacity-50 transition-opacity")) }, [f.value.length ? o("", !0) : (C(), s("tr",
|
|
4144
|
+
}))], 10, Za)) : (C(), s(n, { key: 2 }, [u(A(e.label), 1)], 64))])], 10, Ya))), 128))])], 2),
|
|
4145
|
+
c("tbody", { class: v(j(X)(e.loading && f.value.length && "opacity-50 transition-opacity")) }, [f.value.length ? o("", !0) : (C(), s("tr", Qa, [c("td", {
|
|
4065
4146
|
colspan: e.columns.length,
|
|
4066
4147
|
class: "px-4 py-8 text-center text-black/65"
|
|
4067
|
-
}, [e.loading ? (C(), s("span",
|
|
4148
|
+
}, [e.loading ? (C(), s("span", eo, [d(xn, { size: "sm" }), x[0] ||= u(" Loading… ", -1)])) : D(i.$slots, "empty", {}, () => [d(Ha, {
|
|
4149
|
+
size: "sm",
|
|
4150
|
+
description: e.emptyText,
|
|
4151
|
+
class: "p-0"
|
|
4152
|
+
}, null, 8, ["description"])], void 0, 1)], 8, $a)])), (C(!0), s(n, null, E(f.value, (t, r) => (C(), s("tr", {
|
|
4068
4153
|
key: p(t, r),
|
|
4069
|
-
class: v(j(X)("group/row", e.ui?.row))
|
|
4070
|
-
}, [(C(!0), s(n, null, E(e.columns, (
|
|
4071
|
-
key:
|
|
4072
|
-
scope:
|
|
4073
|
-
class: v(j(X)("border-b border-black/15 align-middle group-last/row:border-b-0",
|
|
4154
|
+
class: v(j(X)("group/row", _(t, r) && b, e.ui?.row))
|
|
4155
|
+
}, [(C(!0), s(n, null, E(e.columns, (n) => (C(), a(O(n.rowHeader ? "th" : "td"), {
|
|
4156
|
+
key: n.key,
|
|
4157
|
+
scope: n.rowHeader ? "row" : void 0,
|
|
4158
|
+
class: v(j(X)("border-b border-black/15 align-middle group-last/row:border-b-0", n.rowHeader ? "font-bold" : "font-normal", n.align === "end" && "tabular-nums", w.value, k(n)))
|
|
4074
4159
|
}, {
|
|
4075
|
-
default: z(() => [
|
|
4160
|
+
default: z(() => [n.key === h.value && _(t, r) ? (C(), a(O(e.linkComponent), g({
|
|
4161
|
+
key: 0,
|
|
4162
|
+
ref_for: !0
|
|
4163
|
+
}, _(t, r), {
|
|
4164
|
+
"data-row-link": "",
|
|
4165
|
+
class: y
|
|
4166
|
+
}), {
|
|
4167
|
+
default: z(() => [D(i.$slots, `cell-${n.key}`, {
|
|
4168
|
+
row: t,
|
|
4169
|
+
value: t[n.key],
|
|
4170
|
+
index: r
|
|
4171
|
+
}, () => [u(A(t[n.key] ?? ""), 1)])]),
|
|
4172
|
+
_: 2
|
|
4173
|
+
}, 1040)) : D(i.$slots, `cell-${n.key}`, {
|
|
4076
4174
|
row: t,
|
|
4077
|
-
value: t[
|
|
4175
|
+
value: t[n.key],
|
|
4078
4176
|
index: r
|
|
4079
|
-
}, () => [u(A(t[
|
|
4177
|
+
}, () => [u(A(t[n.key] ?? ""), 1)], void 0, 1)]),
|
|
4080
4178
|
_: 2
|
|
4081
4179
|
}, 1032, ["scope", "class"]))), 128))], 2))), 128))], 2),
|
|
4082
4180
|
i.$slots.footer ? (C(), s("tfoot", {
|
|
4083
4181
|
key: 1,
|
|
4084
4182
|
class: v(j(X)("font-bold *:*:border-t *:*:border-black/15", e.size === "sm" ? "*:*:px-4 *:*:py-2" : "*:*:px-4 *:*:py-3"))
|
|
4085
4183
|
}, [D(i.$slots, "footer")], 2)) : o("", !0)
|
|
4086
|
-
], 10,
|
|
4184
|
+
], 10, Ja)], 10, qa));
|
|
4087
4185
|
}
|
|
4088
|
-
}),
|
|
4186
|
+
}), io = { class: "flex items-center gap-2 text-sm text-black/65" }, ao = { class: "flex flex-wrap items-baseline gap-x-2 gap-y-1" }, oo = { class: "text-2xl font-bold tabular-nums" }, so = {
|
|
4089
4187
|
key: 1,
|
|
4090
4188
|
class: "sr-only"
|
|
4091
|
-
},
|
|
4189
|
+
}, co = {
|
|
4092
4190
|
key: 2,
|
|
4093
4191
|
class: "font-bold tabular-nums"
|
|
4094
|
-
},
|
|
4192
|
+
}, lo = {
|
|
4095
4193
|
key: 3,
|
|
4096
4194
|
class: "text-black/65"
|
|
4097
|
-
},
|
|
4195
|
+
}, uo = {
|
|
4098
4196
|
key: 0,
|
|
4099
4197
|
class: "text-sm text-black/65"
|
|
4100
|
-
},
|
|
4198
|
+
}, fo = {
|
|
4101
4199
|
key: 1,
|
|
4102
4200
|
class: "mt-2 text-sm"
|
|
4103
|
-
},
|
|
4201
|
+
}, po = /* @__PURE__ */ f({
|
|
4104
4202
|
__name: "StatTile",
|
|
4105
4203
|
props: {
|
|
4106
4204
|
label: {},
|
|
@@ -4135,12 +4233,12 @@ var Ka = [
|
|
|
4135
4233
|
ui: { body: "gap-1" }
|
|
4136
4234
|
}, {
|
|
4137
4235
|
default: z(() => [
|
|
4138
|
-
c("p",
|
|
4236
|
+
c("p", io, [e.icon ? (C(), a(O(e.icon), {
|
|
4139
4237
|
key: 0,
|
|
4140
4238
|
class: "size-4 shrink-0",
|
|
4141
4239
|
"aria-hidden": "true"
|
|
4142
4240
|
})) : o("", !0), u(" " + A(e.label), 1)]),
|
|
4143
|
-
c("div",
|
|
4241
|
+
c("div", ao, [c("p", oo, [D(i.$slots, "value", {}, () => [u(A(e.value ?? "—"), 1)])]), e.change || e.trend ? (C(), s("p", {
|
|
4144
4242
|
key: 0,
|
|
4145
4243
|
class: v(j(X)("inline-flex items-center gap-0.5 text-sm", r[n.value]))
|
|
4146
4244
|
}, [
|
|
@@ -4149,29 +4247,29 @@ var Ka = [
|
|
|
4149
4247
|
class: "size-4 shrink-0",
|
|
4150
4248
|
"aria-hidden": "true"
|
|
4151
4249
|
})) : o("", !0),
|
|
4152
|
-
e.trend ? (C(), s("span",
|
|
4153
|
-
e.change ? (C(), s("span",
|
|
4154
|
-
e.changeLabel ? (C(), s("span",
|
|
4250
|
+
e.trend ? (C(), s("span", so, A(d[e.trend]), 1)) : o("", !0),
|
|
4251
|
+
e.change ? (C(), s("span", co, A(e.change), 1)) : o("", !0),
|
|
4252
|
+
e.changeLabel ? (C(), s("span", lo, "\xA0" + A(e.changeLabel), 1)) : o("", !0)
|
|
4155
4253
|
], 2)) : o("", !0)]),
|
|
4156
|
-
e.description || i.$slots.description ? (C(), s("p",
|
|
4157
|
-
i.$slots.footer ? (C(), s("div",
|
|
4254
|
+
e.description || i.$slots.description ? (C(), s("p", uo, [D(i.$slots, "description", {}, () => [u(A(e.description), 1)])])) : o("", !0),
|
|
4255
|
+
i.$slots.footer ? (C(), s("div", fo, [D(i.$slots, "footer")])) : o("", !0)
|
|
4158
4256
|
]),
|
|
4159
4257
|
_: 3
|
|
4160
4258
|
}, 8, ["class"]));
|
|
4161
4259
|
}
|
|
4162
|
-
}),
|
|
4260
|
+
}), mo = { class: "col-span-2 text-black/65 @sm:col-span-1" }, ho = { class: "sr-only" }, go = {
|
|
4163
4261
|
key: 0,
|
|
4164
4262
|
class: "mt-0.5 block text-black/65"
|
|
4165
|
-
},
|
|
4263
|
+
}, _o = {
|
|
4166
4264
|
key: 0,
|
|
4167
4265
|
class: "justify-self-end"
|
|
4168
|
-
},
|
|
4266
|
+
}, vo = { class: "text-black/65" }, yo = { class: "sr-only" }, bo = {
|
|
4169
4267
|
key: 0,
|
|
4170
4268
|
class: "mt-0.5 block font-normal text-black/65"
|
|
4171
|
-
},
|
|
4269
|
+
}, xo = {
|
|
4172
4270
|
key: 1,
|
|
4173
4271
|
class: "mt-1 block font-normal"
|
|
4174
|
-
},
|
|
4272
|
+
}, So = /* @__PURE__ */ f({
|
|
4175
4273
|
__name: "SummaryList",
|
|
4176
4274
|
props: {
|
|
4177
4275
|
items: {},
|
|
@@ -4196,37 +4294,37 @@ var Ka = [
|
|
|
4196
4294
|
key: t.label,
|
|
4197
4295
|
class: v(j(X)("grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 border-b border-black/15 py-3 first:pt-0 last:border-b-0 last:pb-0", i[e.labelWidth]))
|
|
4198
4296
|
}, [
|
|
4199
|
-
c("dt",
|
|
4297
|
+
c("dt", mo, A(t.label), 1),
|
|
4200
4298
|
c("dd", { class: v(j(X)("min-w-0 break-words", t.emphasis && "font-bold", !a.$slots.action && "col-span-2")) }, [D(a.$slots, "value", {
|
|
4201
4299
|
item: t,
|
|
4202
4300
|
index: d
|
|
4203
4301
|
}, () => [r(t.value) ? (C(), s(n, { key: 1 }, [l[0] ||= c("span", {
|
|
4204
4302
|
class: "text-black/40",
|
|
4205
4303
|
"aria-hidden": "true"
|
|
4206
|
-
}, "—", -1), c("span",
|
|
4207
|
-
a.$slots.action ? (C(), s("dd",
|
|
4304
|
+
}, "—", -1), c("span", ho, A(e.emptyLabel), 1)], 64)) : (C(), s(n, { key: 0 }, [u(A(t.value), 1)], 64))]), t.description ? (C(), s("span", go, A(t.description), 1)) : o("", !0)], 2),
|
|
4305
|
+
a.$slots.action ? (C(), s("dd", _o, [D(a.$slots, "action", {
|
|
4208
4306
|
item: t,
|
|
4209
4307
|
index: d
|
|
4210
4308
|
})])) : o("", !0)
|
|
4211
4309
|
], 2))), 128)) : (C(!0), s(n, { key: 1 }, E(e.items, (t, i) => (C(), s("div", {
|
|
4212
4310
|
key: t.label,
|
|
4213
4311
|
class: v(e.layout === "compact" ? "col-span-2 grid grid-cols-subgrid items-baseline" : "flex min-w-0 flex-col gap-1")
|
|
4214
|
-
}, [c("dt",
|
|
4312
|
+
}, [c("dt", vo, A(t.label), 1), c("dd", { class: v(j(X)("min-w-0 break-words", e.layout === "compact" && "text-right font-bold tabular-nums", t.emphasis && "font-bold")) }, [
|
|
4215
4313
|
D(a.$slots, "value", {
|
|
4216
4314
|
item: t,
|
|
4217
4315
|
index: i
|
|
4218
4316
|
}, () => [r(t.value) ? (C(), s(n, { key: 1 }, [l[1] ||= c("span", {
|
|
4219
4317
|
class: "text-black/40",
|
|
4220
4318
|
"aria-hidden": "true"
|
|
4221
|
-
}, "—", -1), c("span",
|
|
4222
|
-
t.description ? (C(), s("span",
|
|
4223
|
-
a.$slots.action ? (C(), s("span",
|
|
4319
|
+
}, "—", -1), c("span", yo, A(e.emptyLabel), 1)], 64)) : (C(), s(n, { key: 0 }, [u(A(t.value), 1)], 64))]),
|
|
4320
|
+
t.description ? (C(), s("span", bo, A(t.description), 1)) : o("", !0),
|
|
4321
|
+
a.$slots.action ? (C(), s("span", xo, [D(a.$slots, "action", {
|
|
4224
4322
|
item: t,
|
|
4225
4323
|
index: i
|
|
4226
4324
|
})])) : o("", !0)
|
|
4227
4325
|
], 2)], 2))), 128))], 2)], 2));
|
|
4228
4326
|
}
|
|
4229
|
-
}),
|
|
4327
|
+
}), Co = { class: "flex h-5 shrink-0 items-center" }, wo = { class: "sr-only" }, To = /* @__PURE__ */ f({
|
|
4230
4328
|
__name: "Checklist",
|
|
4231
4329
|
props: {
|
|
4232
4330
|
items: {},
|
|
@@ -4243,7 +4341,7 @@ var Ka = [
|
|
|
4243
4341
|
return (r, i) => (C(), s("ul", { class: v(j(X)("flex flex-col gap-2 text-sm", t.class)) }, [(C(!0), s(n, null, E(e.items, (e) => (C(), s("li", {
|
|
4244
4342
|
key: e.label,
|
|
4245
4343
|
class: "flex items-start gap-2"
|
|
4246
|
-
}, [c("span",
|
|
4344
|
+
}, [c("span", Co, [e.done ? (C(), a(j(fe), {
|
|
4247
4345
|
key: 0,
|
|
4248
4346
|
class: "size-4 text-green",
|
|
4249
4347
|
"aria-hidden": "true"
|
|
@@ -4251,11 +4349,11 @@ var Ka = [
|
|
|
4251
4349
|
key: 1,
|
|
4252
4350
|
class: "size-4 text-black/40",
|
|
4253
4351
|
"aria-hidden": "true"
|
|
4254
|
-
}))]), c("span", { class: v(e.done ? "text-black" : "text-black/65") }, [u(A(e.label), 1), c("span",
|
|
4352
|
+
}))]), c("span", { class: v(e.done ? "text-black" : "text-black/65") }, [u(A(e.label), 1), c("span", wo, A(e.done ? " (done)" : " (to do)"), 1)], 2)]))), 128))], 2));
|
|
4255
4353
|
}
|
|
4256
4354
|
});
|
|
4257
4355
|
// src/lib/dates.ts
|
|
4258
|
-
function
|
|
4356
|
+
function Eo(e) {
|
|
4259
4357
|
if (e instanceof Date) return e;
|
|
4260
4358
|
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e)) {
|
|
4261
4359
|
let [t, n, r] = e.split("-").map(Number);
|
|
@@ -4263,59 +4361,59 @@ function To(e) {
|
|
|
4263
4361
|
}
|
|
4264
4362
|
return new Date(e);
|
|
4265
4363
|
}
|
|
4266
|
-
var
|
|
4364
|
+
var Do = [
|
|
4267
4365
|
["year", 31536e3],
|
|
4268
4366
|
["month", 2592e3],
|
|
4269
4367
|
["week", 604800],
|
|
4270
4368
|
["day", 86400],
|
|
4271
4369
|
["hour", 3600],
|
|
4272
4370
|
["minute", 60]
|
|
4273
|
-
],
|
|
4274
|
-
function
|
|
4275
|
-
let n = Math.round((
|
|
4371
|
+
], Oo = new Intl.RelativeTimeFormat("en-GB", { numeric: "auto" });
|
|
4372
|
+
function ko(e, t = /* @__PURE__ */ new Date()) {
|
|
4373
|
+
let n = Math.round((Eo(e).getTime() - t.getTime()) / 1e3);
|
|
4276
4374
|
if (Math.abs(n) < 60) return "Just now";
|
|
4277
|
-
for (let [e, t] of
|
|
4278
|
-
let r =
|
|
4375
|
+
for (let [e, t] of Do) if (Math.abs(n) >= t) {
|
|
4376
|
+
let r = Oo.format(Math.trunc(n / t), e);
|
|
4279
4377
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
4280
4378
|
}
|
|
4281
4379
|
return "Just now";
|
|
4282
4380
|
}
|
|
4283
|
-
function
|
|
4284
|
-
let t =
|
|
4381
|
+
function Ao(e) {
|
|
4382
|
+
let t = Eo(e), n = t.toLocaleDateString("en-GB", { weekday: "long" }), r = t.toLocaleTimeString("en-GB", {
|
|
4285
4383
|
hour: "2-digit",
|
|
4286
4384
|
minute: "2-digit"
|
|
4287
4385
|
});
|
|
4288
|
-
return `${n} ${
|
|
4386
|
+
return `${n} ${jo(t)} at ${r}`;
|
|
4289
4387
|
}
|
|
4290
|
-
function
|
|
4291
|
-
return
|
|
4388
|
+
function jo(e) {
|
|
4389
|
+
return Eo(e).toLocaleDateString("en-GB", {
|
|
4292
4390
|
day: "numeric",
|
|
4293
4391
|
month: "long",
|
|
4294
4392
|
year: "numeric"
|
|
4295
4393
|
});
|
|
4296
4394
|
}
|
|
4297
|
-
function
|
|
4298
|
-
let n =
|
|
4395
|
+
function Mo(e, t = /* @__PURE__ */ new Date()) {
|
|
4396
|
+
let n = Eo(e), r = t.getFullYear() - n.getFullYear(), i = t.getMonth() - n.getMonth();
|
|
4299
4397
|
return (i < 0 || i === 0 && t.getDate() < n.getDate()) && r--, r;
|
|
4300
4398
|
}
|
|
4301
|
-
function
|
|
4302
|
-
let n =
|
|
4399
|
+
function No(e, t = /* @__PURE__ */ new Date()) {
|
|
4400
|
+
let n = Eo(e), r = new Date(t.getFullYear(), t.getMonth(), t.getDate()), i = (e) => {
|
|
4303
4401
|
let t = new Date(e, n.getMonth(), n.getDate());
|
|
4304
4402
|
return t.getMonth() === n.getMonth() ? t : new Date(e, 2, 1);
|
|
4305
4403
|
}, a = i(r.getFullYear());
|
|
4306
4404
|
return a < r && (a = i(r.getFullYear() + 1)), Math.round((a.getTime() - r.getTime()) / 864e5);
|
|
4307
4405
|
}
|
|
4308
4406
|
// src/lib/useNow.ts
|
|
4309
|
-
var
|
|
4310
|
-
function
|
|
4407
|
+
var Po = T(/* @__PURE__ */ new Date()), Fo = 0, Io;
|
|
4408
|
+
function Lo() {
|
|
4311
4409
|
return S(() => {
|
|
4312
|
-
|
|
4410
|
+
Fo++ === 0 && (Po.value = /* @__PURE__ */ new Date(), Io = setInterval(() => Po.value = /* @__PURE__ */ new Date(), 3e4));
|
|
4313
4411
|
}), x(() => {
|
|
4314
|
-
--
|
|
4315
|
-
}),
|
|
4412
|
+
--Fo === 0 && clearInterval(Io);
|
|
4413
|
+
}), Po;
|
|
4316
4414
|
}
|
|
4317
4415
|
// src/components/RelativeTime/RelativeTime.vue?vue&type=script&setup=true&lang.ts
|
|
4318
|
-
var
|
|
4416
|
+
var Ro = ["datetime"], zo = /* @__PURE__ */ f({
|
|
4319
4417
|
__name: "RelativeTime",
|
|
4320
4418
|
props: {
|
|
4321
4419
|
date: {},
|
|
@@ -4330,17 +4428,17 @@ var Lo = ["datetime"], Ro = /* @__PURE__ */ f({
|
|
|
4330
4428
|
] }
|
|
4331
4429
|
},
|
|
4332
4430
|
setup(e) {
|
|
4333
|
-
let t = e, n =
|
|
4431
|
+
let t = e, n = Lo(), r = i(() => Eo(t.date)), o = i(() => ko(r.value, t.now ?? n.value)), s = i(() => t.tooltip ? t.tooltip(r.value) : Ao(r.value));
|
|
4334
4432
|
return (e, n) => (C(), a(ia, { text: s.value }, {
|
|
4335
4433
|
default: z(() => [c("time", {
|
|
4336
4434
|
datetime: r.value.toISOString(),
|
|
4337
4435
|
tabindex: "0",
|
|
4338
4436
|
class: v(j(X)("cursor-default rounded-sm underline decoration-current/40 decoration-dotted underline-offset-2", "outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus forced-colors:not-focus-visible:outline-0", t.class))
|
|
4339
|
-
}, A(o.value), 11,
|
|
4437
|
+
}, A(o.value), 11, Ro)]),
|
|
4340
4438
|
_: 1
|
|
4341
4439
|
}, 8, ["text"]));
|
|
4342
4440
|
}
|
|
4343
|
-
}),
|
|
4441
|
+
}), Bo = ["data-birth-date"], Vo = /* @__PURE__ */ f({
|
|
4344
4442
|
__name: "Age",
|
|
4345
4443
|
props: {
|
|
4346
4444
|
birthDate: {},
|
|
@@ -4355,9 +4453,9 @@ var Lo = ["datetime"], Ro = /* @__PURE__ */ f({
|
|
|
4355
4453
|
] }
|
|
4356
4454
|
},
|
|
4357
4455
|
setup(e) {
|
|
4358
|
-
let t = e, r =
|
|
4359
|
-
let e =
|
|
4360
|
-
return `Born ${
|
|
4456
|
+
let t = e, r = Lo(), l = i(() => Eo(t.birthDate)), d = i(() => t.now ?? r.value), f = i(() => Mo(l.value, d.value)), p = i(() => {
|
|
4457
|
+
let e = No(l.value, d.value), t = e === 0 ? " · Birthday today" : e === 1 ? " · Birthday tomorrow" : e <= 7 ? ` · Birthday in ${e} days` : "";
|
|
4458
|
+
return `Born ${jo(l.value)}${t}`;
|
|
4361
4459
|
}), m = i(() => {
|
|
4362
4460
|
let e = l.value;
|
|
4363
4461
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
@@ -4367,11 +4465,11 @@ var Lo = ["datetime"], Ro = /* @__PURE__ */ f({
|
|
|
4367
4465
|
tabindex: "0",
|
|
4368
4466
|
"data-birth-date": m.value,
|
|
4369
4467
|
class: v(j(X)("cursor-default rounded-sm tabular-nums underline decoration-current/40 decoration-dotted underline-offset-2", "outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus forced-colors:not-focus-visible:outline-0", t.class))
|
|
4370
|
-
}, [u(A(f.value), 1), e.suffix ? (C(), s(n, { key: 0 }, [u("\xA0" + A(e.suffix), 1)], 64)) : o("", !0)], 10,
|
|
4468
|
+
}, [u(A(f.value), 1), e.suffix ? (C(), s(n, { key: 0 }, [u("\xA0" + A(e.suffix), 1)], 64)) : o("", !0)], 10, Bo)]),
|
|
4371
4469
|
_: 1
|
|
4372
4470
|
}, 8, ["text"]));
|
|
4373
4471
|
}
|
|
4374
|
-
}),
|
|
4472
|
+
}), Ho = /* @__PURE__ */ f({
|
|
4375
4473
|
__name: "Link",
|
|
4376
4474
|
props: {
|
|
4377
4475
|
href: {},
|
|
@@ -4416,11 +4514,11 @@ var Lo = ["datetime"], Ro = /* @__PURE__ */ f({
|
|
|
4416
4514
|
"class"
|
|
4417
4515
|
]));
|
|
4418
4516
|
}
|
|
4419
|
-
}),
|
|
4420
|
-
function
|
|
4517
|
+
}), Uo = 0, Wo = () => `notification-${Date.now().toString(36)}-${(Uo++).toString(36)}`;
|
|
4518
|
+
function Go(e, t) {
|
|
4421
4519
|
return t === void 0 ? e.type === "error" ? Infinity : e.action ? e.compact ? 1e4 : Infinity : 6e3 : t;
|
|
4422
4520
|
}
|
|
4423
|
-
function
|
|
4521
|
+
function Ko(e = []) {
|
|
4424
4522
|
let t = w({
|
|
4425
4523
|
items: e.map(n).sort((e, t) => t.createdAt.getTime() - e.createdAt.getTime()),
|
|
4426
4524
|
toasts: [],
|
|
@@ -4430,7 +4528,7 @@ function Go(e = []) {
|
|
|
4430
4528
|
function n(e) {
|
|
4431
4529
|
return {
|
|
4432
4530
|
...e,
|
|
4433
|
-
id: e.id ??
|
|
4531
|
+
id: e.id ?? Wo(),
|
|
4434
4532
|
type: e.type ?? "info",
|
|
4435
4533
|
createdAt: e.createdAt ?? /* @__PURE__ */ new Date(),
|
|
4436
4534
|
read: e.read ?? !1
|
|
@@ -4440,7 +4538,7 @@ function Go(e = []) {
|
|
|
4440
4538
|
let i = n(e);
|
|
4441
4539
|
return t.items = [i, ...t.items.filter((e) => e.id !== i.id)], r.toast !== !1 && !t.paneOpen && (t.toasts = [...t.toasts.filter((e) => e.id !== i.id), {
|
|
4442
4540
|
id: i.id,
|
|
4443
|
-
duration:
|
|
4541
|
+
duration: Go(i, r.duration),
|
|
4444
4542
|
item: i
|
|
4445
4543
|
}]), i.id;
|
|
4446
4544
|
}
|
|
@@ -4489,25 +4587,25 @@ function Go(e = []) {
|
|
|
4489
4587
|
markAllRead: c
|
|
4490
4588
|
};
|
|
4491
4589
|
}
|
|
4492
|
-
var
|
|
4493
|
-
function
|
|
4494
|
-
return
|
|
4590
|
+
var qo;
|
|
4591
|
+
function Jo() {
|
|
4592
|
+
return qo ??= Ko();
|
|
4495
4593
|
}
|
|
4496
4594
|
// src/components/Notification/Notification.vue?vue&type=script&setup=true&lang.ts
|
|
4497
|
-
var
|
|
4595
|
+
var Yo = { class: "sr-only" }, Xo = {
|
|
4498
4596
|
key: 0,
|
|
4499
4597
|
class: "text-black/65 [&_a]:font-bold [&_a]:text-primary [&_a]:underline [&_b]:font-bold [&_b]:text-black [&_strong]:font-bold [&_strong]:text-black"
|
|
4500
|
-
},
|
|
4598
|
+
}, Zo = {
|
|
4501
4599
|
key: 1,
|
|
4502
4600
|
class: "flex items-center gap-1.5 text-xs text-black/65"
|
|
4503
|
-
},
|
|
4601
|
+
}, Qo = {
|
|
4504
4602
|
key: 0,
|
|
4505
4603
|
class: "size-2 shrink-0 rounded-full bg-primary",
|
|
4506
4604
|
"aria-hidden": "true"
|
|
4507
|
-
},
|
|
4605
|
+
}, $o = {
|
|
4508
4606
|
key: 1,
|
|
4509
4607
|
class: "sr-only"
|
|
4510
|
-
},
|
|
4608
|
+
}, es = ["href"], ts = /* @__PURE__ */ f({
|
|
4511
4609
|
__name: "Notification",
|
|
4512
4610
|
props: {
|
|
4513
4611
|
type: { default: "info" },
|
|
@@ -4572,12 +4670,12 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4572
4670
|
c("p", {
|
|
4573
4671
|
id: l,
|
|
4574
4672
|
class: v(j(X)("font-bold", m.value && "min-w-0 flex-1 py-1"))
|
|
4575
|
-
}, [c("span",
|
|
4576
|
-
!m.value && (e.description || t.$slots.default) ? (C(), s("div",
|
|
4577
|
-
e.appearance === "row" && (e.createdAt || e.unread) ? (C(), s("p",
|
|
4578
|
-
e.unread ? (C(), s("span",
|
|
4579
|
-
e.unread ? (C(), s("span",
|
|
4580
|
-
e.createdAt ? (C(), a(
|
|
4673
|
+
}, [c("span", Yo, A(f[e.type].word) + ": ", 1), u(A(e.title), 1)], 2),
|
|
4674
|
+
!m.value && (e.description || t.$slots.default) ? (C(), s("div", Xo, [D(t.$slots, "default", {}, () => [d(p)])])) : o("", !0),
|
|
4675
|
+
e.appearance === "row" && (e.createdAt || e.unread) ? (C(), s("p", Zo, [
|
|
4676
|
+
e.unread ? (C(), s("span", Qo)) : o("", !0),
|
|
4677
|
+
e.unread ? (C(), s("span", $o, "Unread, ")) : o("", !0),
|
|
4678
|
+
e.createdAt ? (C(), a(zo, {
|
|
4581
4679
|
key: 2,
|
|
4582
4680
|
date: e.createdAt,
|
|
4583
4681
|
now: e.now
|
|
@@ -4592,7 +4690,7 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4592
4690
|
"as-child": "",
|
|
4593
4691
|
onClick: h
|
|
4594
4692
|
}, {
|
|
4595
|
-
default: z(() => [c("a", { href: e.action.href }, A(e.action.label), 9,
|
|
4693
|
+
default: z(() => [c("a", { href: e.action.href }, A(e.action.label), 9, es)]),
|
|
4596
4694
|
_: 1
|
|
4597
4695
|
})) : e.action ? (C(), a(Z, {
|
|
4598
4696
|
key: 1,
|
|
@@ -4618,11 +4716,11 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4618
4716
|
}, 8, ["class", "aria-label"])) : o("", !0)
|
|
4619
4717
|
], 2));
|
|
4620
4718
|
}
|
|
4621
|
-
}),
|
|
4719
|
+
}), ns = {
|
|
4622
4720
|
key: 0,
|
|
4623
4721
|
class: "absolute top-1 left-1/2 ml-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red px-1 text-xs leading-none font-bold text-white ring-2 ring-white",
|
|
4624
4722
|
"aria-hidden": "true"
|
|
4625
|
-
},
|
|
4723
|
+
}, rs = { class: "flex h-11 shrink-0 items-center justify-between gap-2 border-b border-black/15 pr-2 pl-4" }, is = ["inert"], as = /* @__PURE__ */ f({
|
|
4626
4724
|
__name: "NotificationPane",
|
|
4627
4725
|
props: /*@__PURE__*/ h({
|
|
4628
4726
|
notifications: {},
|
|
@@ -4638,7 +4736,7 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4638
4736
|
}),
|
|
4639
4737
|
emits: ["update:open"],
|
|
4640
4738
|
setup(e) {
|
|
4641
|
-
let t = e, r = P(e, "open"), l = i(() => t.notifications ??
|
|
4739
|
+
let t = e, r = P(e, "open"), l = i(() => t.notifications ?? Jo()), f = i(() => l.value.items), p = i(() => l.value.unreadCount.value), m = i(() => p.value > 99 ? "99+" : String(p.value)), h = i(() => p.value ? `${t.label}, ${m.value} unread` : t.label), g = `${N()}-heading`, y = T(), b = T();
|
|
4642
4740
|
L(r, (e) => l.value.setPaneOpen(e), { immediate: !0 }), L(() => l.value.paneRequests, async () => {
|
|
4643
4741
|
r.value = !0, await _(), requestAnimationFrame(() => requestAnimationFrame(() => y.value?.focus()));
|
|
4644
4742
|
}), L(r, (e, t) => {
|
|
@@ -4685,7 +4783,7 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4685
4783
|
ref: x,
|
|
4686
4784
|
"aria-labelledby": g,
|
|
4687
4785
|
class: "flex min-h-0 flex-col"
|
|
4688
|
-
}, [c("div",
|
|
4786
|
+
}, [c("div", rs, [c("h2", {
|
|
4689
4787
|
id: g,
|
|
4690
4788
|
ref_key: "heading",
|
|
4691
4789
|
ref: y,
|
|
@@ -4710,7 +4808,7 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4710
4808
|
}, [(C(!0), s(n, null, E(f.value, (e, n) => (C(), s("li", {
|
|
4711
4809
|
key: e.id,
|
|
4712
4810
|
class: "border-b border-black/15 last:border-b-0"
|
|
4713
|
-
}, [d(
|
|
4811
|
+
}, [d(ts, {
|
|
4714
4812
|
appearance: "row",
|
|
4715
4813
|
type: e.type,
|
|
4716
4814
|
title: e.title,
|
|
@@ -4729,26 +4827,32 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4729
4827
|
"unread",
|
|
4730
4828
|
"onDismiss",
|
|
4731
4829
|
"onAction"
|
|
4732
|
-
])]))), 128))], 42,
|
|
4830
|
+
])]))), 128))], 42, is)) : (C(), a(Ha, {
|
|
4733
4831
|
key: 1,
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
"
|
|
4738
|
-
|
|
4832
|
+
size: "sm",
|
|
4833
|
+
icon: j(K),
|
|
4834
|
+
description: e.emptyText,
|
|
4835
|
+
class: v(j(X)(w.value && "motion-safe:animate-empty-in")),
|
|
4836
|
+
ui: { icon: j(X)("origin-top", w.value && "motion-safe:animate-bell-wobble") }
|
|
4837
|
+
}, null, 8, [
|
|
4838
|
+
"icon",
|
|
4839
|
+
"description",
|
|
4840
|
+
"class",
|
|
4841
|
+
"ui"
|
|
4842
|
+
]))], 512)]),
|
|
4739
4843
|
default: z(() => [d(Z, {
|
|
4740
4844
|
variant: "ghost",
|
|
4741
4845
|
square: "",
|
|
4742
4846
|
"aria-label": h.value,
|
|
4743
4847
|
class: v(j(X)("relative overflow-visible", e.ui?.trigger))
|
|
4744
4848
|
}, {
|
|
4745
|
-
default: z(() => [d(j(re)), p.value ? (C(), s("span",
|
|
4849
|
+
default: z(() => [d(j(re)), p.value ? (C(), s("span", ns, A(m.value), 1)) : o("", !0)]),
|
|
4746
4850
|
_: 1
|
|
4747
4851
|
}, 8, ["aria-label", "class"])]),
|
|
4748
4852
|
_: 1
|
|
4749
4853
|
}, 8, ["open", "ui"]));
|
|
4750
4854
|
}
|
|
4751
|
-
}),
|
|
4855
|
+
}), os = { class: "in-data-expanded:hidden" }, ss = { class: "hidden in-data-expanded:inline" }, cs = 8, ls = .5, us = 80, ds = /* @__PURE__ */ f({
|
|
4752
4856
|
__name: "Toaster",
|
|
4753
4857
|
props: {
|
|
4754
4858
|
notifications: {},
|
|
@@ -4765,15 +4869,15 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4765
4869
|
},
|
|
4766
4870
|
emits: ["more"],
|
|
4767
4871
|
setup(e, { emit: t }) {
|
|
4768
|
-
let r = e, l = t, f = i(() => r.notifications ??
|
|
4872
|
+
let r = e, l = t, f = i(() => r.notifications ?? Jo()), p = i(() => r.position === "top-right"), m = T(typeof window > "u" ? 800 : window.innerHeight), h = () => m.value = window.innerHeight;
|
|
4769
4873
|
S(() => window.addEventListener("resize", h)), x(() => window.removeEventListener("resize", h));
|
|
4770
|
-
let g = i(() => Math.max(m.value -
|
|
4771
|
-
let e = f.value.toasts.slice(-r.limit).reverse(), t = (e) => I.get(e.id) ?? y(e.item), n = e.filter((e) => !H.has(e.id)), i = n.reduce((e, n) => e + t(n) +
|
|
4874
|
+
let g = i(() => Math.max(m.value - us, 108)), y = (e) => e.compact ? 42 : e.action ? 116 : e.description ? 78 : 56, D = i(() => {
|
|
4875
|
+
let e = f.value.toasts.slice(-r.limit).reverse(), t = (e) => I.get(e.id) ?? y(e.item), n = e.filter((e) => !H.has(e.id)), i = n.reduce((e, n) => e + t(n) + cs, -8), a = /* @__PURE__ */ new Set();
|
|
4772
4876
|
if (i <= g.value) n.forEach((e) => a.add(e.id));
|
|
4773
4877
|
else {
|
|
4774
4878
|
let e = 44;
|
|
4775
4879
|
for (let r of n) {
|
|
4776
|
-
let n = e + t(r) + (a.size ?
|
|
4880
|
+
let n = e + t(r) + (a.size ? cs : 0);
|
|
4777
4881
|
if (a.size && n > g.value) break;
|
|
4778
4882
|
a.add(r.id), e = n;
|
|
4779
4883
|
}
|
|
@@ -4828,16 +4932,16 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4828
4932
|
}
|
|
4829
4933
|
let G = i(() => {
|
|
4830
4934
|
let e = O.value.filter((e) => !H.has(e.id)), t = /* @__PURE__ */ new Map(), n = [], i = 0;
|
|
4831
|
-
for (let t of e) n.push(i), i += (I.get(t.id) ?? 0) +
|
|
4832
|
-
let a = Math.max(i -
|
|
4935
|
+
for (let t of e) n.push(i), i += (I.get(t.id) ?? 0) + cs;
|
|
4936
|
+
let a = Math.max(i - cs, 0), o = Math.min(r.maxHeight, g.value), s = 0;
|
|
4833
4937
|
for (; s < e.length && (s === 0 || n[s] + (I.get(e[s].id) ?? 0) <= o);) s++;
|
|
4834
|
-
let c = e[s - 1], l = n[s - 1] ?? 0, u = c ? I.get(c.id) ?? 0 : 0, d = l + u +
|
|
4938
|
+
let c = e[s - 1], l = n[s - 1] ?? 0, u = c ? I.get(c.id) ?? 0 : 0, d = l + u + cs;
|
|
4835
4939
|
e.forEach((r, i) => {
|
|
4836
4940
|
let a = i >= s;
|
|
4837
4941
|
t.set(r.id, {
|
|
4838
4942
|
spread: n[i],
|
|
4839
4943
|
stacked: a ? d : n[i],
|
|
4840
|
-
scale: a ?
|
|
4944
|
+
scale: a ? ls : 1,
|
|
4841
4945
|
opacity: +!a,
|
|
4842
4946
|
z: e.length - i
|
|
4843
4947
|
});
|
|
@@ -4848,7 +4952,7 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4848
4952
|
places: t,
|
|
4849
4953
|
spreadHeight: a + (k.value > 0 ? 44 : 0),
|
|
4850
4954
|
stackedHeight: p,
|
|
4851
|
-
moreOffset: a + (a ?
|
|
4955
|
+
moreOffset: a + (a ? cs : 0),
|
|
4852
4956
|
notInView: f,
|
|
4853
4957
|
pillOffset: d
|
|
4854
4958
|
};
|
|
@@ -4857,10 +4961,10 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4857
4961
|
let t = H.has(e) ? U.get(e) : G.value.places.get(e), n = p.value ? 1 : -1, r = (e) => `${n * e}px`, i = {
|
|
4858
4962
|
"--toast-spread": r(G.value.moreOffset),
|
|
4859
4963
|
"--toast-stacked": r(G.value.pillOffset),
|
|
4860
|
-
"--toast-scale":
|
|
4964
|
+
"--toast-scale": ls,
|
|
4861
4965
|
"--toast-opacity": 0,
|
|
4862
4966
|
"--toast-spread-opacity": 0,
|
|
4863
|
-
"--toast-spread-scale":
|
|
4967
|
+
"--toast-spread-scale": ls,
|
|
4864
4968
|
"--toast-z": 0
|
|
4865
4969
|
};
|
|
4866
4970
|
if (!t && M.has(e) || t && !V.has(e) && N.has(e)) return i;
|
|
@@ -4918,7 +5022,7 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4918
5022
|
class: v(j(X)("absolute inset-x-0 z-(--toast-z) list-none rounded", "outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus forced-colors:not-focus-visible:outline-0", p.value ? "top-0 origin-top" : "bottom-0 origin-bottom", "translate-y-(--toast-stacked) scale-(--toast-scale) opacity-(--toast-opacity)", "data-expanded:translate-y-(--toast-spread) data-expanded:scale-(--toast-spread-scale) data-expanded:opacity-(--toast-spread-opacity)", "transition-[translate,scale,opacity] duration-300 ease-out motion-reduce:transition-none", "data-[state=closed]:animate-fade-out", "data-[swipe=move]:translate-x-(--reka-toast-swipe-move-x) data-[swipe=move]:transition-none", "data-[swipe=cancel]:translate-x-0", "data-[swipe=end]:animate-slide-out-right")),
|
|
4919
5023
|
"onUpdate:open": (t) => W(e.id, t)
|
|
4920
5024
|
}, {
|
|
4921
|
-
default: z(() => [d(
|
|
5025
|
+
default: z(() => [d(ts, {
|
|
4922
5026
|
ref_for: !0,
|
|
4923
5027
|
ref: (t) => ee(e.id, t),
|
|
4924
5028
|
type: e.item.type,
|
|
@@ -4961,11 +5065,11 @@ var Jo = { class: "sr-only" }, Yo = {
|
|
|
4961
5065
|
type: "button",
|
|
4962
5066
|
class: v(j(X)("flex cursor-pointer items-center justify-center overflow-hidden border border-black/15 bg-white font-bold whitespace-nowrap text-black shadow-md hover:bg-surface-elevated", "h-7 w-24 rounded-2xl text-xs", k.value && "in-data-expanded:h-9 in-data-expanded:w-full in-data-expanded:rounded in-data-expanded:text-sm", "transition-[width,height,border-radius,font-size,background-color] duration-300 ease-out motion-reduce:transition-none", "outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus forced-colors:not-focus-visible:outline-0")),
|
|
4963
5067
|
onClick: ie
|
|
4964
|
-
}, [k.value ? (C(), s(n, { key: 0 }, [c("span",
|
|
5068
|
+
}, [k.value ? (C(), s(n, { key: 0 }, [c("span", os, "+" + A(G.value.notInView) + " more", 1), c("span", ss, "+" + A(k.value) + " more", 1)], 64)) : (C(), s(n, { key: 1 }, [u("+" + A(G.value.notInView) + " more", 1)], 64)), i[0] ||= c("span", { class: "sr-only" }, "\xA0notifications", -1)], 2)], 6)) : o("", !0)]),
|
|
4965
5069
|
_: 1
|
|
4966
5070
|
}, 8, ["style", "class"])]),
|
|
4967
5071
|
_: 1
|
|
4968
5072
|
}));
|
|
4969
5073
|
}
|
|
4970
5074
|
});
|
|
4971
|
-
export {
|
|
5075
|
+
export { Vo as Age, Mr as AppShell, qn as Avatar, Qr as AvatarGroup, rr as Badge, Vr as Breadcrumb, Z as Button, Pi as Calendar, ni as Card, ja as Checkbox, To as Checklist, ai as Chip, ci as Divider, Ha as EmptyState, bi as FormField, tr as Header, di as InfoTip, Si as Input, ha as InputCode, ra as InputDate, Ti as InputNumber, ua as InputPassword, sa as InputRichText, Ho as Link, ts as Notification, as as NotificationPane, Gr as PageHeader, jn as Popover, br as Progress, Ra as RadioGroup, zo as RelativeTime, ka as Select, _r as Sidebar, Or as Slideover, xn as Spinner, po as StatTile, So as SummaryList, Va as Switch, ro as Table, ds as Toaster, ia as Tooltip, Mo as age, X as cn, Ko as createNotifications, No as daysToBirthday, jo as formatDate, Ao as formatDateTime, ko as relativeTime, ir as sidebarTrail, Ga as sortRows, Eo as toDate, Jo as useNotifications, Lo as useNow };
|