@owocow/saber-ui 0.1.12 → 0.1.13

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.
@@ -0,0 +1,418 @@
1
+ import Oe from "@nuxt/ui/components/Button.vue";
2
+ import $e from "@nuxt/ui/components/Drawer.vue";
3
+ import { getCurrentInstance as se, getCurrentScope as Be, hasInjectionContext as ue, inject as De, watch as z, shallowRef as T, watchEffect as Me, toValue as M, computed as u, onMounted as Le, unref as Ue, defineComponent as je, useSlots as Fe, useModel as te, ref as ae, useId as Ie, nextTick as ze, openBlock as x, createElementBlock as S, normalizeStyle as A, normalizeClass as d, renderSlot as h, normalizeProps as $, guardReactiveProps as B, Fragment as H, createCommentVNode as D, createVNode as G, withCtx as ne, createElementVNode as f, toDisplayString as oe, createBlock as Te, mergeModels as le } from "vue";
4
+ import { tv as R } from "tailwind-variants";
5
+ import { providePageHeader as Ne } from "./composables/use-page-header.mjs";
6
+ import { _ as Ee } from "./SaberNavigationSearch.vue_vue_type_script_setup_true_lang-Bj96kMla.js";
7
+ const V = /* @__PURE__ */ new WeakMap(), Pe = /* @__NO_SIDE_EFFECTS__ */ (...t) => {
8
+ var r;
9
+ const e = t[0], l = (r = se()) === null || r === void 0 ? void 0 : r.proxy, n = l ?? Be();
10
+ if (n == null && !ue()) throw new Error("injectLocal must be called in setup");
11
+ return n && V.has(n) && e in V.get(n) ? V.get(n)[e] : De(...t);
12
+ }, Ae = typeof window < "u" && typeof document < "u";
13
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
14
+ const He = Object.prototype.toString, Ge = (t) => He.call(t) === "[object Object]";
15
+ function ie(t) {
16
+ return t.endsWith("rem") ? Number.parseFloat(t) * 16 : Number.parseFloat(t);
17
+ }
18
+ function K(t) {
19
+ return Array.isArray(t) ? t : [t];
20
+ }
21
+ function Re(t, r, e) {
22
+ return z(t, r, {
23
+ ...e,
24
+ immediate: !0
25
+ });
26
+ }
27
+ const de = Ae ? window : void 0;
28
+ function Ve(t) {
29
+ var r;
30
+ const e = M(t);
31
+ return (r = e == null ? void 0 : e.$el) !== null && r !== void 0 ? r : e;
32
+ }
33
+ function Ke(...t) {
34
+ const r = (l, n, c, o) => (l.addEventListener(n, c, o), () => l.removeEventListener(n, c, o)), e = u(() => {
35
+ const l = K(M(t[0])).filter((n) => n != null);
36
+ return l.every((n) => typeof n != "string") ? l : void 0;
37
+ });
38
+ return Re(() => {
39
+ var l, n;
40
+ return [
41
+ (l = (n = e.value) === null || n === void 0 ? void 0 : n.map((c) => Ve(c))) !== null && l !== void 0 ? l : [de].filter((c) => c != null),
42
+ K(M(e.value ? t[1] : t[0])),
43
+ K(Ue(e.value ? t[2] : t[1])),
44
+ M(e.value ? t[3] : t[2])
45
+ ];
46
+ }, ([l, n, c, o], b, L) => {
47
+ if (!(l != null && l.length) || !(n != null && n.length) || !(c != null && c.length)) return;
48
+ const k = Ge(o) ? { ...o } : o, p = l.flatMap((g) => n.flatMap((i) => c.map((w) => r(g, i, w, k))));
49
+ L(() => {
50
+ p.forEach((g) => g());
51
+ });
52
+ }, { flush: "post" });
53
+ }
54
+ // @__NO_SIDE_EFFECTS__
55
+ function Qe() {
56
+ const t = T(!1), r = se();
57
+ return r && Le(() => {
58
+ t.value = !0;
59
+ }, r), t;
60
+ }
61
+ // @__NO_SIDE_EFFECTS__
62
+ function Je(t) {
63
+ const r = /* @__PURE__ */ Qe();
64
+ return u(() => (r.value, !!t()));
65
+ }
66
+ const Xe = Symbol("vueuse-ssr-width");
67
+ // @__NO_SIDE_EFFECTS__
68
+ function Ye() {
69
+ const t = ue() ? /* @__PURE__ */ Pe(Xe, null) : null;
70
+ return typeof t == "number" ? t : void 0;
71
+ }
72
+ function re(t, r = {}) {
73
+ const { window: e = de, ssrWidth: l = /* @__PURE__ */ Ye() } = r, n = /* @__PURE__ */ Je(() => e && "matchMedia" in e && typeof e.matchMedia == "function"), c = T(typeof l == "number"), o = T(), b = T(!1), L = (k) => {
74
+ b.value = k.matches;
75
+ };
76
+ return Me(() => {
77
+ if (c.value) {
78
+ c.value = !n.value;
79
+ const k = M(t).split(",");
80
+ b.value = k.some((p) => {
81
+ const g = p.includes("not all"), i = p.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), w = p.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
82
+ let y = !!(i || w);
83
+ return i && y && (y = l >= ie(i[1])), w && y && (y = l <= ie(w[1])), g ? !y : y;
84
+ });
85
+ return;
86
+ }
87
+ n.value && (o.value = e.matchMedia(M(t)), b.value = o.value.matches);
88
+ }), Ke(o, "change", L, { passive: !0 }), u(() => b.value);
89
+ }
90
+ const nt = /* @__PURE__ */ je({
91
+ name: "SaberAppLayout",
92
+ __name: "SaberAppLayout",
93
+ props: /* @__PURE__ */ le({
94
+ title: { default: void 0 },
95
+ description: { default: void 0 },
96
+ maxWidth: { type: [Number, String, Boolean], default: void 0 },
97
+ navigationKey: { default: void 0 },
98
+ sidebarWidth: { default: 240 },
99
+ phoneBreakpoint: { default: 768 },
100
+ padBreakpoint: { default: 1024 },
101
+ searchGroups: { default: () => [] },
102
+ searchShortcut: { default: "meta_k" },
103
+ searchLabel: { default: "搜索" },
104
+ menuOpenLabel: { default: "菜单" },
105
+ menuCloseLabel: { default: "关闭" },
106
+ menuOpenIcon: { default: "solar:hamburger-menu-linear" },
107
+ menuCloseIcon: { default: "solar:close-circle-linear" },
108
+ ui: { default: () => ({}) }
109
+ }, {
110
+ drawerOpen: { type: Boolean, default: !1 },
111
+ drawerOpenModifiers: {},
112
+ searchOpen: { type: Boolean, default: !1 },
113
+ searchOpenModifiers: {}
114
+ }),
115
+ emits: /* @__PURE__ */ le(["searchSelect"], ["update:drawerOpen", "update:searchOpen"]),
116
+ setup(t, { emit: r }) {
117
+ const e = t, l = r, n = Fe(), c = R({
118
+ slots: {
119
+ root: "flex h-dvh items-start gap-2 overflow-hidden p-1.5 text-default",
120
+ desktopSidebar: "sticky top-0 h-full shrink-0 self-start",
121
+ main: "relative flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-y-auto rounded-lg border border-default bg-default",
122
+ header: "sticky top-0 z-10 mx-auto flex w-full shrink-0 items-center justify-between gap-4 overflow-hidden bg-default/70 backdrop-blur-md",
123
+ headerHeading: "min-w-0",
124
+ title: "truncate text-xl",
125
+ description: "mt-1 text-sm text-muted",
126
+ headerSuffix: "flex shrink-0 items-center gap-2",
127
+ pageHeaderSuffixTarget: "contents",
128
+ content: "mx-auto w-full flex-1",
129
+ phoneDrawerContent: "h-full min-h-0 w-full min-w-0 p-2",
130
+ phoneSidebarFrame: "h-full min-h-0 w-full",
131
+ padDrawerContent: "h-full min-h-0 w-full min-w-0 p-2",
132
+ padSidebarFrame: "mx-auto h-full min-h-0",
133
+ overlay: "fixed inset-0 z-40 border-0 bg-black/35 p-0 backdrop-blur-[1px]",
134
+ dock: "fixed bottom-[calc(0.75rem+env(safe-area-inset-bottom))] left-1/2 z-60 flex w-42 -translate-x-1/2 items-center gap-1 rounded-2xl border border-default bg-default/95 p-1 shadow-lg backdrop-blur-md"
135
+ },
136
+ variants: {
137
+ mode: {
138
+ phone: {
139
+ root: "p-1.5",
140
+ header: "p-4",
141
+ title: "text-xl",
142
+ content: "px-3 pb-[calc(6rem+env(safe-area-inset-bottom))]"
143
+ },
144
+ pad: {
145
+ root: "p-1.5",
146
+ header: "p-4",
147
+ title: "text-2xl",
148
+ content: "px-4 pb-[calc(6rem+env(safe-area-inset-bottom))]"
149
+ },
150
+ desktop: {
151
+ root: "p-2",
152
+ header: "px-6 py-4.5 min-[1441px]:px-8 min-[1441px]:py-6",
153
+ title: "text-2xl",
154
+ content: "px-6 pb-0 min-[1441px]:px-8"
155
+ }
156
+ }
157
+ }
158
+ }), o = te(t, "drawerOpen"), b = te(t, "searchOpen"), L = re(`(max-width: ${e.phoneBreakpoint}px)`), k = re(`(max-width: ${e.padBreakpoint}px)`), p = u(() => L.value ? "phone" : k.value ? "pad" : "desktop"), g = u(() => p.value !== "desktop"), i = u(() => c({ mode: p.value })), w = ae(null), y = Ne(w), N = u(() => y.title ?? e.title), E = u(() => y.description ?? e.description), Q = u(() => {
159
+ if (typeof e.maxWidth == "number")
160
+ return Number.isFinite(e.maxWidth) && e.maxWidth > 0 ? `${e.maxWidth}px` : void 0;
161
+ if (!(e.maxWidth === "full" || e.maxWidth === !1 || e.maxWidth === void 0))
162
+ return e.maxWidth.trim() || void 0;
163
+ }), ce = u(
164
+ () => e.maxWidth === void 0 || typeof e.maxWidth == "number" && (!Number.isFinite(e.maxWidth) || e.maxWidth <= 0)
165
+ ), J = u(
166
+ () => Q.value ? { maxWidth: Q.value } : void 0
167
+ ), X = u(() => ce.value ? "min-[1921px]:max-w-[1620px]" : void 0), pe = u(() => typeof e.sidebarWidth == "number" ? Number.isFinite(e.sidebarWidth) && e.sidebarWidth > 0 ? `${e.sidebarWidth}px` : "240px" : e.sidebarWidth.trim() || "240px"), fe = u(() => ({ "--saber-app-layout-sidebar-width": pe.value })), me = { width: "var(--saber-app-layout-sidebar-width)" }, ve = { width: "var(--saber-app-layout-sidebar-width)" }, P = `saber-app-layout-navigation-${Ie().replaceAll(":", "")}`, Y = ae(null);
168
+ function F(a) {
169
+ return typeof a == "object" && a !== null && !Array.isArray(a);
170
+ }
171
+ function he(a) {
172
+ return F(a) && Object.values(a).every((s) => typeof s == "boolean");
173
+ }
174
+ function be(a) {
175
+ return typeof a == "function";
176
+ }
177
+ function ye(a, s) {
178
+ return s === void 0 ? a : be(s) ? (m) => s(R({ base: m })({ class: a })) : R({ base: a })({ class: s });
179
+ }
180
+ function U(a, s) {
181
+ const m = {}, O = /* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(s ?? {})]);
182
+ for (const v of O) {
183
+ const j = a[v], I = s == null ? void 0 : s[v], _ = F(I) && !he(I);
184
+ if (F(j) || j === void 0 && _)
185
+ m[v] = U(
186
+ F(j) ? j : {},
187
+ _ ? I : void 0
188
+ );
189
+ else {
190
+ const ee = ye(j, I);
191
+ ee !== void 0 && (m[v] = ee);
192
+ }
193
+ }
194
+ return m;
195
+ }
196
+ const xe = {
197
+ root: "mb-0 min-w-0 flex-1",
198
+ button: {
199
+ base: "h-10 w-20 rounded-full border-0 bg-transparent px-3 shadow-none",
200
+ trailing: "hidden",
201
+ label: "text-(--ui-text) text-sm",
202
+ leadingIcon: "text-(--ui-text)"
203
+ }
204
+ }, ge = {
205
+ base: "h-10 shrink-0 rounded-full px-3 font-normal"
206
+ }, we = u(
207
+ () => U(
208
+ { content: "z-50 h-[calc(100dvh-4rem)] max-h-none rounded-t-lg bg-default" },
209
+ e.ui.phoneDrawer
210
+ )
211
+ ), Se = u(
212
+ () => U(
213
+ { content: "z-50 h-dvh max-w-none rounded-r-lg bg-default" },
214
+ e.ui.padDrawer
215
+ )
216
+ ), ke = u(
217
+ () => U(xe, e.ui.search)
218
+ ), We = u(
219
+ () => U(ge, e.ui.menuButton)
220
+ );
221
+ function Z() {
222
+ g.value && (o.value = !0);
223
+ }
224
+ function W() {
225
+ o.value = !1;
226
+ }
227
+ function q() {
228
+ o.value ? W() : Z();
229
+ }
230
+ function Ce(a) {
231
+ l("searchSelect", a), b.value = !1, W();
232
+ }
233
+ z(() => e.navigationKey, W), z(p, W), z(o, async (a, s) => {
234
+ var m, O;
235
+ a || !s || (await ze(), (O = (m = Y.value) == null ? void 0 : m.$el) == null || O.focus());
236
+ });
237
+ const C = u(() => ({
238
+ mode: p.value,
239
+ drawerOpen: o.value,
240
+ openDrawer: Z,
241
+ closeDrawer: W,
242
+ toggleDrawer: q
243
+ }));
244
+ return (a, s) => {
245
+ const m = $e, O = Oe;
246
+ return x(), S("div", {
247
+ "data-testid": "app-layout",
248
+ class: d(i.value.root({ class: e.ui.root })),
249
+ style: A(fe.value)
250
+ }, [
251
+ p.value === "desktop" ? (x(), S("aside", {
252
+ key: 0,
253
+ "data-testid": "desktop-sidebar",
254
+ class: d(i.value.desktopSidebar({ class: e.ui.desktopSidebar })),
255
+ style: me
256
+ }, [
257
+ h(a.$slots, "sidebar", $(B(C.value)))
258
+ ], 2)) : p.value === "phone" ? (x(), S(H, { key: 1 }, [
259
+ o.value ? (x(), S("button", {
260
+ key: 0,
261
+ "data-testid": "compact-nav-overlay",
262
+ type: "button",
263
+ tabindex: "-1",
264
+ "aria-label": "关闭导航",
265
+ class: d(i.value.overlay({ class: e.ui.overlay })),
266
+ onClick: W
267
+ }, null, 2)) : D("", !0),
268
+ G(m, {
269
+ open: o.value,
270
+ "onUpdate:open": s[0] || (s[0] = (v) => o.value = v),
271
+ direction: "bottom",
272
+ modal: !1,
273
+ overlay: !1,
274
+ handle: !0,
275
+ title: t.menuOpenLabel,
276
+ ui: we.value
277
+ }, {
278
+ content: ne(() => [
279
+ f("div", {
280
+ id: P,
281
+ "data-testid": "phone-drawer-content",
282
+ class: d(i.value.phoneDrawerContent({ class: e.ui.phoneDrawerContent }))
283
+ }, [
284
+ f("div", {
285
+ "data-testid": "phone-sidebar-frame",
286
+ class: d(i.value.phoneSidebarFrame({ class: e.ui.phoneSidebarFrame }))
287
+ }, [
288
+ n["phone-sidebar"] ? h(a.$slots, "phone-sidebar", $(B(C.value)), void 0, void 0, 0) : h(a.$slots, "sidebar", $(B(C.value)), void 0, void 0, 1)
289
+ ], 2)
290
+ ], 2)
291
+ ]),
292
+ _: 3
293
+ }, 8, ["open", "title", "ui"])
294
+ ], 64)) : (x(), S(H, { key: 2 }, [
295
+ o.value ? (x(), S("button", {
296
+ key: 0,
297
+ "data-testid": "compact-nav-overlay",
298
+ type: "button",
299
+ tabindex: "-1",
300
+ "aria-label": "关闭导航",
301
+ class: d(i.value.overlay({ class: e.ui.overlay })),
302
+ onClick: W
303
+ }, null, 2)) : D("", !0),
304
+ G(m, {
305
+ open: o.value,
306
+ "onUpdate:open": s[1] || (s[1] = (v) => o.value = v),
307
+ direction: "left",
308
+ modal: !1,
309
+ overlay: !1,
310
+ handle: !1,
311
+ title: t.menuOpenLabel,
312
+ ui: Se.value
313
+ }, {
314
+ content: ne(() => [
315
+ f("div", {
316
+ id: P,
317
+ "data-testid": "pad-drawer-content",
318
+ class: d(i.value.padDrawerContent({ class: e.ui.padDrawerContent }))
319
+ }, [
320
+ f("div", {
321
+ "data-testid": "pad-sidebar-frame",
322
+ class: d(i.value.padSidebarFrame({ class: e.ui.padSidebarFrame })),
323
+ style: ve
324
+ }, [
325
+ n["pad-sidebar"] ? h(a.$slots, "pad-sidebar", $(B(C.value)), void 0, void 0, 0) : h(a.$slots, "sidebar", $(B(C.value)), void 0, void 0, 1)
326
+ ], 2)
327
+ ], 2)
328
+ ]),
329
+ _: 3
330
+ }, 8, ["open", "title", "ui"])
331
+ ], 64)),
332
+ f("main", {
333
+ "data-testid": "app-layout-main",
334
+ class: d(i.value.main({ class: e.ui.main }))
335
+ }, [
336
+ f("header", {
337
+ "data-testid": "app-layout-header",
338
+ class: d([i.value.header({ class: e.ui.header }), X.value]),
339
+ style: A(J.value)
340
+ }, [
341
+ f("div", {
342
+ "data-testid": "app-layout-header-heading",
343
+ class: d(i.value.headerHeading({ class: e.ui.headerHeading }))
344
+ }, [
345
+ N.value ? h(a.$slots, "header-title", { title: N.value }, () => [
346
+ f("h1", {
347
+ "data-testid": "app-layout-title",
348
+ class: d(i.value.title({ class: e.ui.title }))
349
+ }, oe(N.value), 3)
350
+ ], void 0, 0) : D("", !0),
351
+ E.value ? h(a.$slots, "header-description", { description: E.value }, () => [
352
+ f("p", {
353
+ "data-testid": "app-layout-description",
354
+ class: d(i.value.description({ class: e.ui.description }))
355
+ }, oe(E.value), 3)
356
+ ], void 0, 1) : D("", !0)
357
+ ], 2),
358
+ f("div", {
359
+ "data-testid": "app-layout-header-suffix",
360
+ class: d(i.value.headerSuffix({ class: e.ui.headerSuffix }))
361
+ }, [
362
+ h(a.$slots, "header-suffix"),
363
+ f("div", {
364
+ ref_key: "suffixTarget",
365
+ ref: w,
366
+ "data-testid": "app-layout-suffix-target",
367
+ class: d(i.value.pageHeaderSuffixTarget({ class: e.ui.pageHeaderSuffixTarget }))
368
+ }, null, 2)
369
+ ], 2)
370
+ ], 6),
371
+ f("div", {
372
+ "data-testid": "app-layout-content",
373
+ class: d([i.value.content({ class: e.ui.content }), X.value]),
374
+ style: A(J.value)
375
+ }, [
376
+ h(a.$slots, "default")
377
+ ], 6)
378
+ ], 2),
379
+ g.value ? (x(), S("div", {
380
+ key: 3,
381
+ "data-testid": "compact-nav-dock",
382
+ class: d(i.value.dock({ class: e.ui.dock }))
383
+ }, [
384
+ n.dock ? h(a.$slots, "dock", $(B(C.value)), void 0, void 0, 0) : (x(), S(H, { key: 1 }, [
385
+ t.searchGroups.length ? (x(), Te(Ee, {
386
+ key: 0,
387
+ open: b.value,
388
+ "onUpdate:open": s[2] || (s[2] = (v) => b.value = v),
389
+ groups: t.searchGroups,
390
+ label: t.searchLabel,
391
+ shortcut: t.searchShortcut,
392
+ kbds: [],
393
+ ui: ke.value,
394
+ onSelect: Ce
395
+ }, null, 8, ["open", "groups", "label", "shortcut", "ui"])) : D("", !0),
396
+ G(O, {
397
+ ref_key: "menuButton",
398
+ ref: Y,
399
+ "data-testid": "compact-menu-button",
400
+ color: "neutral",
401
+ variant: "ghost",
402
+ icon: o.value ? t.menuCloseIcon : t.menuOpenIcon,
403
+ label: o.value ? t.menuCloseLabel : t.menuOpenLabel,
404
+ "aria-controls": P,
405
+ "aria-expanded": o.value,
406
+ "aria-haspopup": "dialog",
407
+ ui: We.value,
408
+ onClick: q
409
+ }, null, 8, ["icon", "label", "aria-expanded", "ui"])
410
+ ], 64))
411
+ ], 2)) : D("", !0)
412
+ ], 6);
413
+ };
414
+ }
415
+ });
416
+ export {
417
+ nt as _
418
+ };
@@ -1,12 +1,12 @@
1
- import le from "@nuxt/ui/components/Button.vue";
1
+ import oe from "@nuxt/ui/components/Button.vue";
2
2
  import ne from "@nuxt/ui/runtime/vue/components/Icon.vue";
3
- import { defineComponent as ie, useModel as oe, ref as ce, computed as W, openBlock as c, createElementBlock as g, normalizeClass as s, unref as l, createElementVNode as h, renderSlot as M, createBlock as _, withCtx as C, normalizeProps as re, guardReactiveProps as ue, createCommentVNode as A, createVNode as G, Transition as de, toDisplayString as K, Fragment as H, renderList as N, mergeModels as X } from "vue";
4
- import { tv as me } from "tailwind-variants";
5
- import { _ as ve } from "./SaberNavigationSearch.vue_vue_type_script_setup_true_lang-Bj96kMla.js";
3
+ import { defineComponent as ie, useModel as ce, ref as re, computed as X, openBlock as c, createElementBlock as x, normalizeClass as s, unref as l, createElementVNode as h, renderSlot as T, createBlock as w, withCtx as $, normalizeProps as ue, guardReactiveProps as de, createCommentVNode as _, createVNode as G, Transition as me, toDisplayString as K, Fragment as H, renderList as N, mergeModels as Y } from "vue";
4
+ import { tv as ve } from "tailwind-variants";
5
+ import { _ as fe } from "./SaberNavigationSearch.vue_vue_type_script_setup_true_lang-Bj96kMla.js";
6
6
  const xe = /* @__PURE__ */ ie({
7
7
  name: "SaberAppSidebar",
8
8
  __name: "SaberAppSidebar",
9
- props: /* @__PURE__ */ X({
9
+ props: /* @__PURE__ */ Y({
10
10
  sections: {},
11
11
  searchGroups: { default: () => [] },
12
12
  activeKey: {},
@@ -16,9 +16,9 @@ const xe = /* @__PURE__ */ ie({
16
16
  activeSection: { default: void 0 },
17
17
  activeSectionModifiers: {}
18
18
  }),
19
- emits: /* @__PURE__ */ X(["select", "section-select"], ["update:activeSection"]),
20
- setup(V, { emit: Y }) {
21
- const e = V, $ = Y, F = oe(V, "activeSection"), T = ce(!1), w = W(() => e.sections.find((t) => t.key === F.value)), a = me({
19
+ emits: /* @__PURE__ */ Y(["select", "section-select"], ["update:activeSection"]),
20
+ setup(V, { emit: Z }) {
21
+ const e = V, A = Z, E = ce(V, "activeSection"), F = re(!1), B = X(() => e.sections.find((t) => t.key === E.value)), a = ve({
22
22
  slots: {
23
23
  root: "flex h-full min-h-0 flex-col overflow-hidden",
24
24
  header: "shrink-0",
@@ -26,6 +26,7 @@ const xe = /* @__PURE__ */ ie({
26
26
  viewport: "min-h-0 flex-1 overflow-y-auto",
27
27
  panel: "flex min-h-full flex-col gap-1.5",
28
28
  sectionList: "flex flex-col",
29
+ rootFooter: "shrink-0",
29
30
  group: "flex flex-col",
30
31
  groupLabel: "px-2 py-2 text-[11px] uppercase tracking-wider text-muted/70",
31
32
  childList: "flex flex-col",
@@ -35,62 +36,62 @@ const xe = /* @__PURE__ */ ie({
35
36
  sectionItemLeadingIcon: "size-4.5 shrink-0",
36
37
  sectionItemLabel: "min-w-0 flex-1 truncate text-left",
37
38
  sectionItemTrailingIcon: "size-4 shrink-0",
38
- childItem: "flex w-full items-center rounded-md px-2 py-1.5 font-normal text-sm mb-0.5 gap-2 text-left transition",
39
+ childItem: "flex w-full items-center rounded-md px-2 py-2 font-normal text-sm mb-0.5 gap-2 text-left transition",
39
40
  childItemLeadingIcon: "size-4 shrink-0",
40
41
  childItemLabel: "min-w-0 flex-1 truncate text-left",
41
- backButton: "flex w-full items-center rounded-md px-2 py-2 gap-2 text-left transition",
42
- backButtonIcon: "size-4.5 shrink-0",
43
- backButtonLabel: "truncate text-sm font-medium flex-1 text-center pr-10"
42
+ backButton: "flex w-full items-center rounded-md h-9 px-2 gap-2 text-left transition ",
43
+ backButtonIcon: "size-4 shrink-0",
44
+ backButtonLabel: "truncate text-sm font-normal flex-1 text-center"
44
45
  }
45
- })(), z = W(() => {
46
- var t, i, o, r, u, d, m, v, f, p, b, B;
46
+ })(), z = X(() => {
47
+ var t, o, i, r, u, d, m, v, f, p, b, S;
47
48
  return {
48
- enterActive: ((i = (t = e.ui) == null ? void 0 : t.transition) == null ? void 0 : i.enterActive) ?? "transition duration-200 ease-out",
49
- leaveActive: ((r = (o = e.ui) == null ? void 0 : o.transition) == null ? void 0 : r.leaveActive) ?? "transition duration-200 ease-out pointer-events-none",
50
- enterFrom: T.value ? ((d = (u = e.ui) == null ? void 0 : u.transition) == null ? void 0 : d.backwardEnterFrom) ?? "-translate-x-2 opacity-0 blur-[2px]" : ((v = (m = e.ui) == null ? void 0 : m.transition) == null ? void 0 : v.forwardEnterFrom) ?? "translate-x-2 opacity-0 blur-[2px]",
51
- leaveTo: T.value ? ((p = (f = e.ui) == null ? void 0 : f.transition) == null ? void 0 : p.backwardLeaveTo) ?? "translate-x-2 opacity-0 blur-[2px]" : ((B = (b = e.ui) == null ? void 0 : b.transition) == null ? void 0 : B.forwardLeaveTo) ?? "-translate-x-2 opacity-0 blur-[2px]"
49
+ enterActive: ((o = (t = e.ui) == null ? void 0 : t.transition) == null ? void 0 : o.enterActive) ?? "transition duration-100 ease-out",
50
+ leaveActive: ((r = (i = e.ui) == null ? void 0 : i.transition) == null ? void 0 : r.leaveActive) ?? "transition duration-100 ease-out pointer-events-none",
51
+ enterFrom: F.value ? ((d = (u = e.ui) == null ? void 0 : u.transition) == null ? void 0 : d.backwardEnterFrom) ?? "-translate-x-2 opacity-0 blur-[2px]" : ((v = (m = e.ui) == null ? void 0 : m.transition) == null ? void 0 : v.forwardEnterFrom) ?? "translate-x-2 opacity-0 blur-[2px]",
52
+ leaveTo: F.value ? ((p = (f = e.ui) == null ? void 0 : f.transition) == null ? void 0 : p.backwardLeaveTo) ?? "translate-x-2 opacity-0 blur-[2px]" : ((S = (b = e.ui) == null ? void 0 : b.transition) == null ? void 0 : S.forwardLeaveTo) ?? "-translate-x-2 opacity-0 blur-[2px]"
52
53
  };
53
54
  });
54
- function E(t) {
55
- return t.groups.flatMap((i) => i.items);
55
+ function M(t) {
56
+ return t.groups.flatMap((o) => o.items);
56
57
  }
57
58
  function P(t) {
58
- return E(t).some((i) => i.key === e.activeKey);
59
- }
60
- function Z(t) {
61
- var o, r, u, d, m, v, f, p;
62
- const i = P(t) ? ["font-medium", (r = (o = e.ui) == null ? void 0 : o.sectionItem) == null ? void 0 : r.active] : ["text-default", (d = (u = e.ui) == null ? void 0 : u.sectionItem) == null ? void 0 : d.inactive];
63
- return a.sectionItem({ class: [(v = (m = e.ui) == null ? void 0 : m.sectionItem) == null ? void 0 : v.base, i, (p = (f = e.ui) == null ? void 0 : f.sectionItem) == null ? void 0 : p.hover] });
59
+ return M(t).some((o) => o.key === e.activeKey);
64
60
  }
65
61
  function ee(t) {
66
- var o, r, u, d, m, v, f, p;
67
- const i = t.key === e.activeKey ? ["font-medium", (r = (o = e.ui) == null ? void 0 : o.childItem) == null ? void 0 : r.active] : ["text-default", (d = (u = e.ui) == null ? void 0 : u.childItem) == null ? void 0 : d.inactive];
68
- return a.childItem({ class: [(v = (m = e.ui) == null ? void 0 : m.childItem) == null ? void 0 : v.base, i, (p = (f = e.ui) == null ? void 0 : f.childItem) == null ? void 0 : p.hover] });
62
+ var i, r, u, d, m, v, f, p;
63
+ const o = P(t) ? ["font-medium", (r = (i = e.ui) == null ? void 0 : i.sectionItem) == null ? void 0 : r.active] : ["text-default", (d = (u = e.ui) == null ? void 0 : u.sectionItem) == null ? void 0 : d.inactive];
64
+ return a.sectionItem({ class: [(v = (m = e.ui) == null ? void 0 : m.sectionItem) == null ? void 0 : v.base, o, (p = (f = e.ui) == null ? void 0 : f.sectionItem) == null ? void 0 : p.hover] });
69
65
  }
70
66
  function te(t) {
71
- var o;
72
- const i = E(t);
73
- if (i.length === 1) {
74
- $("select", {
67
+ var i, r, u, d, m, v, f, p;
68
+ const o = t.key === e.activeKey ? ["font-medium", (r = (i = e.ui) == null ? void 0 : i.childItem) == null ? void 0 : r.active] : ["text-default", (d = (u = e.ui) == null ? void 0 : u.childItem) == null ? void 0 : d.inactive];
69
+ return a.childItem({ class: [(v = (m = e.ui) == null ? void 0 : m.childItem) == null ? void 0 : v.base, o, (p = (f = e.ui) == null ? void 0 : f.childItem) == null ? void 0 : p.hover] });
70
+ }
71
+ function ae(t) {
72
+ var i;
73
+ const o = M(t);
74
+ if (o.length === 1) {
75
+ A("select", {
75
76
  source: "direct",
76
- item: i[0],
77
+ item: o[0],
77
78
  sectionKey: t.key,
78
- groupKey: (o = t.groups[0]) == null ? void 0 : o.key
79
+ groupKey: (i = t.groups[0]) == null ? void 0 : i.key
79
80
  });
80
81
  return;
81
82
  }
82
- T.value = !1, F.value = t.key, $("section-select", t);
83
+ F.value = !1, E.value = t.key, A("section-select", t);
83
84
  }
84
- function ae() {
85
- T.value = !0, F.value = void 0;
85
+ function se() {
86
+ F.value = !0, E.value = void 0;
86
87
  }
87
- function se(t, i, o) {
88
- $("select", { source: "item", item: t, sectionKey: i, groupKey: o });
88
+ function le(t, o, i) {
89
+ A("select", { source: "item", item: t, sectionKey: o, groupKey: i });
89
90
  }
90
- return (t, i) => {
91
+ return (t, o) => {
91
92
  var u, d, m, v, f, p;
92
- const o = ne, r = le;
93
- return c(), g("aside", {
93
+ const i = ne, r = oe;
94
+ return c(), x("aside", {
94
95
  class: s(l(a).root({ class: (u = e.ui) == null ? void 0 : u.root }))
95
96
  }, [
96
97
  h("header", {
@@ -99,95 +100,96 @@ const xe = /* @__PURE__ */ ie({
99
100
  h("div", {
100
101
  class: s(l(a).logo({ class: (m = e.ui) == null ? void 0 : m.logo }))
101
102
  }, [
102
- M(t.$slots, "logo")
103
+ T(t.$slots, "logo")
103
104
  ], 2),
104
- e.searchGroups.length ? (c(), _(ve, {
105
+ e.searchGroups.length ? (c(), w(fe, {
105
106
  key: 0,
106
107
  groups: e.searchGroups,
107
108
  shortcut: e.shortcut,
108
109
  ui: (v = e.ui) == null ? void 0 : v.search,
109
- onSelect: i[0] || (i[0] = (b) => $("select", b))
110
+ onSelect: o[0] || (o[0] = (b) => A("select", b))
110
111
  }, {
111
- empty: C((b) => [
112
- M(t.$slots, "search-empty", re(ue(b)))
112
+ empty: $((b) => [
113
+ T(t.$slots, "search-empty", ue(de(b)))
113
114
  ]),
114
115
  _: 3
115
- }, 8, ["groups", "shortcut", "ui"])) : A("", !0)
116
+ }, 8, ["groups", "shortcut", "ui"])) : _("", !0)
116
117
  ], 2),
117
118
  h("nav", {
118
119
  class: s(l(a).viewport({ class: (f = e.ui) == null ? void 0 : f.viewport }))
119
120
  }, [
120
- G(de, {
121
+ G(me, {
121
122
  mode: "out-in",
122
123
  "enter-active-class": z.value.enterActive,
123
124
  "leave-active-class": z.value.leaveActive,
124
125
  "enter-from-class": z.value.enterFrom,
125
126
  "leave-to-class": z.value.leaveTo
126
127
  }, {
127
- default: C(() => {
128
- var b, B, U, D, R, j, q, J;
128
+ default: $(() => {
129
+ var b, S, U, D, R, j, q, J, O;
129
130
  return [
130
- w.value ? (c(), g("div", {
131
- key: w.value.key,
131
+ B.value ? (c(), x("div", {
132
+ key: B.value.key,
132
133
  class: s(l(a).panel({ class: (b = e.ui) == null ? void 0 : b.panel }))
133
134
  }, [
134
135
  h("div", {
135
- class: s(l(a).nestedHeader({ class: (B = e.ui) == null ? void 0 : B.nestedHeader }))
136
+ class: s(l(a).nestedHeader({ class: (S = e.ui) == null ? void 0 : S.nestedHeader }))
136
137
  }, [
137
138
  G(r, {
138
139
  "data-testid": "back-button",
139
140
  color: "neutral",
140
141
  variant: "ghost",
141
142
  class: s(l(a).backButton({ class: [(D = (U = e.ui) == null ? void 0 : U.backButton) == null ? void 0 : D.base, (j = (R = e.ui) == null ? void 0 : R.backButton) == null ? void 0 : j.hover] })),
142
- onClick: ae
143
+ onClick: se
143
144
  }, {
144
- default: C(() => {
145
- var n, x, y, I;
145
+ default: $(() => {
146
+ var n, y, I, g;
146
147
  return [
147
- G(o, {
148
+ G(i, {
148
149
  name: "solar:alt-arrow-left-linear",
149
- class: s(l(a).backButtonIcon({ class: (x = (n = e.ui) == null ? void 0 : n.backButton) == null ? void 0 : x.icon }))
150
+ class: s(l(a).backButtonIcon({ class: (y = (n = e.ui) == null ? void 0 : n.backButton) == null ? void 0 : y.icon }))
150
151
  }, null, 8, ["class"]),
151
152
  h("span", {
152
- class: s(l(a).backButtonLabel({ class: (I = (y = e.ui) == null ? void 0 : y.backButton) == null ? void 0 : I.label }))
153
- }, K(w.value.label), 3)
153
+ class: s(l(a).backButtonLabel({ class: (g = (I = e.ui) == null ? void 0 : I.backButton) == null ? void 0 : g.label }))
154
+ }, K(B.value.label), 3),
155
+ o[1] || (o[1] = h("span", { class: "size-4.5 shrink-0" }, null, -1))
154
156
  ];
155
157
  }),
156
158
  _: 1
157
159
  }, 8, ["class"])
158
160
  ], 2),
159
- (c(!0), g(H, null, N(w.value.groups, (n) => {
160
- var x, y, I;
161
- return c(), g("div", {
161
+ (c(!0), x(H, null, N(B.value.groups, (n) => {
162
+ var y, I, g;
163
+ return c(), x("div", {
162
164
  key: n.key,
163
- class: s(l(a).group({ class: (x = e.ui) == null ? void 0 : x.group }))
165
+ class: s(l(a).group({ class: (y = e.ui) == null ? void 0 : y.group }))
164
166
  }, [
165
- n.label ? (c(), g("p", {
167
+ n.label ? (c(), x("p", {
166
168
  key: 0,
167
- class: s(l(a).groupLabel({ class: (y = e.ui) == null ? void 0 : y.groupLabel }))
168
- }, K(n.label), 3)) : A("", !0),
169
+ class: s(l(a).groupLabel({ class: (I = e.ui) == null ? void 0 : I.groupLabel }))
170
+ }, K(n.label), 3)) : _("", !0),
169
171
  h("div", {
170
- class: s(l(a).childList({ class: (I = e.ui) == null ? void 0 : I.childList }))
172
+ class: s(l(a).childList({ class: (g = e.ui) == null ? void 0 : g.childList }))
171
173
  }, [
172
- (c(!0), g(H, null, N(n.items, (k) => (c(), _(r, {
174
+ (c(!0), x(H, null, N(n.items, (k) => (c(), w(r, {
173
175
  key: k.key,
174
176
  "data-testid": `item-${k.key}`,
175
177
  "data-active": k.key === e.activeKey,
176
178
  color: "neutral",
177
179
  variant: "ghost",
178
- class: s(ee(k)),
179
- onClick: (L) => se(k, w.value.key, n.key)
180
+ class: s(te(k)),
181
+ onClick: (L) => le(k, B.value.key, n.key)
180
182
  }, {
181
- default: C(() => {
182
- var L, S, O, Q;
183
+ default: $(() => {
184
+ var L, C, Q, W;
183
185
  return [
184
- k.icon ? (c(), _(o, {
186
+ k.icon ? (c(), w(i, {
185
187
  key: 0,
186
188
  name: k.icon,
187
- class: s(l(a).childItemLeadingIcon({ class: (S = (L = e.ui) == null ? void 0 : L.childItem) == null ? void 0 : S.leadingIcon }))
188
- }, null, 8, ["name", "class"])) : A("", !0),
189
+ class: s(l(a).childItemLeadingIcon({ class: (C = (L = e.ui) == null ? void 0 : L.childItem) == null ? void 0 : C.leadingIcon }))
190
+ }, null, 8, ["name", "class"])) : _("", !0),
189
191
  h("span", {
190
- class: s(l(a).childItemLabel({ class: (Q = (O = e.ui) == null ? void 0 : O.childItem) == null ? void 0 : Q.label }))
192
+ class: s(l(a).childItemLabel({ class: (W = (Q = e.ui) == null ? void 0 : Q.childItem) == null ? void 0 : W.label }))
191
193
  }, K(k.label), 3)
192
194
  ];
193
195
  }),
@@ -196,54 +198,61 @@ const xe = /* @__PURE__ */ ie({
196
198
  ], 2)
197
199
  ], 2);
198
200
  }), 128))
199
- ], 2)) : (c(), g("div", {
201
+ ], 2)) : (c(), x("div", {
200
202
  key: "root",
201
203
  class: s(l(a).panel({ class: (q = e.ui) == null ? void 0 : q.panel }))
202
204
  }, [
203
205
  h("div", {
204
206
  class: s(l(a).sectionList({ class: (J = e.ui) == null ? void 0 : J.sectionList }))
205
207
  }, [
206
- (c(!0), g(H, null, N(e.sections, (n) => (c(), _(r, {
208
+ (c(!0), x(H, null, N(e.sections, (n) => (c(), w(r, {
207
209
  key: n.key,
208
210
  "data-testid": `section-${n.key}`,
209
211
  "data-section": n.key,
210
212
  "data-active": P(n),
211
213
  color: "neutral",
212
214
  variant: "ghost",
213
- class: s(Z(n)),
214
- onClick: (x) => te(n)
215
+ class: s(ee(n)),
216
+ onClick: (y) => ae(n)
215
217
  }, {
216
- default: C(() => {
217
- var x, y, I, k, L, S;
218
+ default: $(() => {
219
+ var y, I, g, k, L, C;
218
220
  return [
219
- n.icon ? (c(), _(o, {
221
+ n.icon ? (c(), w(i, {
220
222
  key: 0,
221
223
  name: n.icon,
222
- class: s(l(a).sectionItemLeadingIcon({ class: (y = (x = e.ui) == null ? void 0 : x.sectionItem) == null ? void 0 : y.leadingIcon }))
223
- }, null, 8, ["name", "class"])) : A("", !0),
224
+ class: s(l(a).sectionItemLeadingIcon({ class: (I = (y = e.ui) == null ? void 0 : y.sectionItem) == null ? void 0 : I.leadingIcon }))
225
+ }, null, 8, ["name", "class"])) : _("", !0),
224
226
  h("span", {
225
- class: s(l(a).sectionItemLabel({ class: (k = (I = e.ui) == null ? void 0 : I.sectionItem) == null ? void 0 : k.label }))
227
+ class: s(l(a).sectionItemLabel({ class: (k = (g = e.ui) == null ? void 0 : g.sectionItem) == null ? void 0 : k.label }))
226
228
  }, K(n.label), 3),
227
- E(n).length > 1 ? (c(), _(o, {
229
+ M(n).length > 1 ? (c(), w(i, {
228
230
  key: 1,
229
231
  name: "solar:alt-arrow-right-linear",
230
- class: s(l(a).sectionItemTrailingIcon({ class: (S = (L = e.ui) == null ? void 0 : L.sectionItem) == null ? void 0 : S.trailingIcon }))
231
- }, null, 8, ["class"])) : A("", !0)
232
+ class: s(l(a).sectionItemTrailingIcon({ class: (C = (L = e.ui) == null ? void 0 : L.sectionItem) == null ? void 0 : C.trailingIcon }))
233
+ }, null, 8, ["class"])) : _("", !0)
232
234
  ];
233
235
  }),
234
236
  _: 2
235
237
  }, 1032, ["data-testid", "data-section", "data-active", "class", "onClick"]))), 128))
236
- ], 2)
238
+ ], 2),
239
+ t.$slots["root-footer"] ? (c(), x("div", {
240
+ key: 0,
241
+ "data-testid": "root-footer",
242
+ class: s(l(a).rootFooter({ class: (O = e.ui) == null ? void 0 : O.rootFooter }))
243
+ }, [
244
+ T(t.$slots, "root-footer")
245
+ ], 2)) : _("", !0)
237
246
  ], 2))
238
247
  ];
239
248
  }),
240
- _: 1
249
+ _: 3
241
250
  }, 8, ["enter-active-class", "leave-active-class", "enter-from-class", "leave-to-class"])
242
251
  ], 2),
243
252
  h("footer", {
244
253
  class: s(l(a).footer({ class: (p = e.ui) == null ? void 0 : p.footer }))
245
254
  }, [
246
- M(t.$slots, "footer")
255
+ T(t.$slots, "footer")
247
256
  ], 2)
248
257
  ], 2);
249
258
  };
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "../SaberAppLayout.vue_vue_type_script_setup_true_lang-R7F5K7kj.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "../SaberAppSidebar.vue_vue_type_script_setup_true_lang-HXyIXiau.js";
1
+ import { _ as f } from "../SaberAppSidebar.vue_vue_type_script_setup_true_lang-Cwuj9VNi.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1,51 @@
1
+ import { ButtonProps } from '@nuxt/ui/components/Button.vue';
2
+ import { DrawerProps } from '@nuxt/ui/components/Drawer.vue';
3
+ import { SaberNavigationSearchGroup, SaberNavigationSearchUI } from '../navigation/SaberAppSidebar.types';
4
+ export type SaberAppLayoutMode = 'phone' | 'pad' | 'desktop';
5
+ export type SaberAppLayoutMaxWidth = number | string | 'full' | false;
6
+ export interface SaberAppLayoutProps {
7
+ title?: string;
8
+ description?: string;
9
+ maxWidth?: SaberAppLayoutMaxWidth;
10
+ navigationKey?: string | number;
11
+ sidebarWidth?: number | string;
12
+ phoneBreakpoint?: number;
13
+ padBreakpoint?: number;
14
+ searchGroups?: SaberNavigationSearchGroup[];
15
+ searchShortcut?: string;
16
+ searchLabel?: string;
17
+ menuOpenLabel?: string;
18
+ menuCloseLabel?: string;
19
+ menuOpenIcon?: string;
20
+ menuCloseIcon?: string;
21
+ ui?: SaberAppLayoutUI;
22
+ }
23
+ export interface SaberAppLayoutNavigationSlotContext {
24
+ mode: SaberAppLayoutMode;
25
+ drawerOpen: boolean;
26
+ openDrawer: () => void;
27
+ closeDrawer: () => void;
28
+ toggleDrawer: () => void;
29
+ }
30
+ export interface SaberAppLayoutUI {
31
+ root?: string;
32
+ desktopSidebar?: string;
33
+ main?: string;
34
+ header?: string;
35
+ headerHeading?: string;
36
+ title?: string;
37
+ description?: string;
38
+ headerSuffix?: string;
39
+ pageHeaderSuffixTarget?: string;
40
+ content?: string;
41
+ phoneDrawer?: DrawerProps['ui'];
42
+ phoneDrawerContent?: string;
43
+ phoneSidebarFrame?: string;
44
+ padDrawer?: DrawerProps['ui'];
45
+ padDrawerContent?: string;
46
+ padSidebarFrame?: string;
47
+ overlay?: string;
48
+ dock?: string;
49
+ search?: SaberNavigationSearchUI;
50
+ menuButton?: ButtonProps['ui'];
51
+ }
@@ -0,0 +1,78 @@
1
+ import { SaberNavigationSelectPayload } from '../navigation/SaberAppSidebar.types';
2
+ import { SaberAppLayoutNavigationSlotContext, SaberAppLayoutProps } from './SaberAppLayout.types';
3
+ type __VLS_Props = SaberAppLayoutProps;
4
+ type __VLS_PublicProps = {
5
+ 'drawerOpen'?: boolean;
6
+ 'searchOpen'?: boolean;
7
+ } & __VLS_Props;
8
+ declare function __VLS_template(): {
9
+ attrs: Partial<{}>;
10
+ slots: Readonly<{
11
+ default?: () => unknown;
12
+ sidebar?: (props: SaberAppLayoutNavigationSlotContext) => unknown;
13
+ 'phone-sidebar'?: (props: SaberAppLayoutNavigationSlotContext) => unknown;
14
+ 'pad-sidebar'?: (props: SaberAppLayoutNavigationSlotContext) => unknown;
15
+ 'header-title'?: (props: {
16
+ title?: string;
17
+ }) => unknown;
18
+ 'header-description'?: (props: {
19
+ description?: string;
20
+ }) => unknown;
21
+ 'header-suffix'?: () => unknown;
22
+ dock?: (props: SaberAppLayoutNavigationSlotContext) => unknown;
23
+ }> & {
24
+ default?: () => unknown;
25
+ sidebar?: (props: SaberAppLayoutNavigationSlotContext) => unknown;
26
+ 'phone-sidebar'?: (props: SaberAppLayoutNavigationSlotContext) => unknown;
27
+ 'pad-sidebar'?: (props: SaberAppLayoutNavigationSlotContext) => unknown;
28
+ 'header-title'?: (props: {
29
+ title?: string;
30
+ }) => unknown;
31
+ 'header-description'?: (props: {
32
+ description?: string;
33
+ }) => unknown;
34
+ 'header-suffix'?: () => unknown;
35
+ dock?: (props: SaberAppLayoutNavigationSlotContext) => unknown;
36
+ };
37
+ refs: {
38
+ suffixTarget: HTMLDivElement;
39
+ menuButton: unknown;
40
+ };
41
+ rootEl: HTMLDivElement;
42
+ };
43
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
44
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
45
+ searchSelect: (payload: SaberNavigationSelectPayload) => any;
46
+ "update:drawerOpen": (value: boolean) => any;
47
+ "update:searchOpen": (value: boolean) => any;
48
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
49
+ onSearchSelect?: ((payload: SaberNavigationSelectPayload) => any) | undefined;
50
+ "onUpdate:drawerOpen"?: ((value: boolean) => any) | undefined;
51
+ "onUpdate:searchOpen"?: ((value: boolean) => any) | undefined;
52
+ }>, {
53
+ title: string;
54
+ description: string;
55
+ ui: import('./SaberAppLayout.types').SaberAppLayoutUI;
56
+ maxWidth: import('./SaberAppLayout.types').SaberAppLayoutMaxWidth;
57
+ navigationKey: string | number;
58
+ sidebarWidth: number | string;
59
+ phoneBreakpoint: number;
60
+ padBreakpoint: number;
61
+ searchGroups: import('../..').SaberNavigationSearchGroup[];
62
+ searchShortcut: string;
63
+ searchLabel: string;
64
+ menuOpenLabel: string;
65
+ menuCloseLabel: string;
66
+ menuOpenIcon: string;
67
+ menuCloseIcon: string;
68
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
69
+ suffixTarget: HTMLDivElement;
70
+ menuButton: unknown;
71
+ }, HTMLDivElement>;
72
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
73
+ export default _default;
74
+ type __VLS_WithTemplateSlots<T, S> = T & {
75
+ new (): {
76
+ $slots: S;
77
+ };
78
+ };
@@ -49,6 +49,7 @@ export interface SaberAppSidebarUI {
49
49
  viewport?: string;
50
50
  panel?: string;
51
51
  sectionList?: string;
52
+ rootFooter?: string;
52
53
  group?: string;
53
54
  groupLabel?: string;
54
55
  childList?: string;
@@ -16,6 +16,7 @@ declare function __VLS_template(): {
16
16
  'search-empty'?(_: {
17
17
  searchTerm: string;
18
18
  }): any;
19
+ 'root-footer'?(_: {}): any;
19
20
  footer?(_: {}): any;
20
21
  };
21
22
  refs: {};
@@ -1,19 +1,21 @@
1
- import { reactive as c, provide as i, inject as o, watchEffect as d, toValue as r, onBeforeUnmount as s, ref as u } from "vue";
2
- const n = Symbol("saber-page-header-state"), a = Symbol("saber-page-header-suffix-target");
1
+ import { reactive as c, provide as o, inject as r, watchEffect as u, toValue as i, onBeforeUnmount as d, ref as f } from "vue";
2
+ const n = Symbol.for("@owocow/saber-ui:page-header-state"), a = Symbol.for(
3
+ "@owocow/saber-ui:page-header-suffix-target"
4
+ );
3
5
  function l(t) {
4
6
  const e = c({ title: void 0, description: void 0 });
5
- return i(n, e), i(a, t), e;
7
+ return o(n, e), o(a, t), e;
6
8
  }
7
9
  function E(t) {
8
- const e = o(n, null);
9
- e && (d(() => {
10
- e.title = r(t.title), e.description = r(t.description);
11
- }), s(() => {
10
+ const e = r(n, null);
11
+ e && (u(() => {
12
+ e.title = i(t.title), e.description = i(t.description);
13
+ }), d(() => {
12
14
  e.title = void 0, e.description = void 0;
13
15
  }));
14
16
  }
15
17
  function p() {
16
- return o(a, u(null));
18
+ return r(a, f(null));
17
19
  }
18
20
  export {
19
21
  l as providePageHeader,
@@ -17,8 +17,8 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
17
17
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
18
18
  }>, {
19
19
  placeholder: string;
20
- multiple: boolean;
21
20
  disabled: boolean;
21
+ multiple: boolean;
22
22
  clearable: boolean;
23
23
  items: PopSelectOption[];
24
24
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -102,9 +102,9 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
102
102
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
103
103
  onRemoveError?: ((error: Error, value: any) => any) | undefined;
104
104
  }>, {
105
- multiple: boolean;
106
- disabled: boolean;
107
105
  size: string;
106
+ disabled: boolean;
107
+ multiple: boolean;
108
108
  dataSource: UploadImageDataSource<any>;
109
109
  max: number;
110
110
  maxSize: number;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import { default as SaberInfoProvider } from './components/SaberInfoProvider.vue
8
8
  import { default as SaberModalWithMobile } from './components/SaberModalWithMobile.vue';
9
9
  import { default as SaberStatus } from './components/SaberStatus.vue';
10
10
  import { default as SaberSwitchBar } from './components/SaberSwitchBar.vue';
11
+ import { default as SaberAppLayout } from './components/layout/SaberAppLayout.vue';
11
12
  import { default as SaberAppSidebar } from './components/navigation/SaberAppSidebar.vue';
12
13
  import { default as SaberNavigationSearch } from './components/navigation/SaberNavigationSearch.vue';
13
14
  import { default as SaberFilterBar } from './forms/components/SaberFilterBar.vue';
@@ -33,10 +34,11 @@ export { BadgeStatus as SaberBadgeStatus };
33
34
  export type { BadgeStatusProps } from './BadgeStatus.types';
34
35
  export { SaberNoData };
35
36
  export type { SaberNoDataProps } from './SaberNoData.types';
36
- export { SaberConfirmModal, SaberConfirmProvider, SaberInfo, SaberInfoProvider, SaberModalWithMobile, SaberAppSidebar, SaberNavigationSearch, SaberStatus, SaberSwitchBar, };
37
+ export { SaberConfirmModal, SaberConfirmProvider, SaberInfo, SaberInfoProvider, SaberModalWithMobile, SaberAppLayout, SaberAppSidebar, SaberNavigationSearch, SaberStatus, SaberSwitchBar, };
37
38
  export type { SaberInfoContext, SaberInfoMode, SaberInfoProps, SaberInfoVariant } from './components/SaberInfo.types';
38
39
  export type { SaberStatusType } from './components/SaberStatus.types';
39
40
  export type { SaberSwitchBarItem, SaberSwitchBarUI, SaberSwitchBarValue } from './components/SaberSwitchBar.types';
41
+ export type { SaberAppLayoutMaxWidth, SaberAppLayoutMode, SaberAppLayoutNavigationSlotContext, SaberAppLayoutProps, SaberAppLayoutUI, } from './components/layout/SaberAppLayout.types';
40
42
  export type { SaberAppSidebarUI, SaberNavigationGroup, SaberNavigationItem, SaberNavigationSearchGroup, SaberNavigationSearchUI, SaberNavigationSection, SaberNavigationSelectPayload, SaberNavigationSelectSource, } from './components/navigation/SaberAppSidebar.types';
41
43
  export { SaberFilterBar, SaberFormModal, SaberDictCheckbox, SaberDictRadio, SaberDictSelect, SaberDistrictSelect, SaberInput, SaberInputNumber, SaberModal, SaberPopSelect, SaberRadioGroup, SaberSelect, SaberTextarea, };
42
44
  export { installSaberForms, type SaberFormsOptions } from './forms/plugin';
@@ -55,6 +57,7 @@ declare module 'vue' {
55
57
  SaberSwitchBar: typeof SaberSwitchBar;
56
58
  SaberAppSidebar: typeof SaberAppSidebar;
57
59
  SaberNavigationSearch: typeof SaberNavigationSearch;
60
+ SaberAppLayout: typeof SaberAppLayout;
58
61
  SaberFilterBar: typeof SaberFilterBar;
59
62
  SaberFormModal: typeof SaberFormModal;
60
63
  SaberModal: typeof SaberModal;
package/dist/index.mjs CHANGED
@@ -1,25 +1,26 @@
1
1
  import h from "@nuxt/ui/vue-plugin";
2
2
  import y from "@nuxt/ui/components/Badge.vue";
3
- import { defineComponent as _, computed as f, openBlock as s, createBlock as $, normalizeStyle as v, withCtx as C, createTextVNode as k, toDisplayString as d, createElementBlock as i, normalizeClass as B, createElementVNode as l, createVNode as I, createCommentVNode as m, renderSlot as u } from "vue";
3
+ import { defineComponent as _, computed as f, openBlock as s, createBlock as $, normalizeStyle as v, withCtx as C, createTextVNode as k, toDisplayString as b, createElementBlock as i, normalizeClass as B, createElementVNode as l, createVNode as I, createCommentVNode as m, renderSlot as u } from "vue";
4
4
  import N from "@nuxt/ui/runtime/vue/components/Icon.vue";
5
5
  import { _ as D } from "./SaberConfirmModal.vue_vue_type_script_setup_true_lang-Cqp9krYl.js";
6
6
  import { _ as M } from "./SaberConfirmProvider.vue_vue_type_script_setup_true_lang-DUJ6ftNJ.js";
7
7
  import { _ as w } from "./SaberInfo.vue_vue_type_script_setup_true_lang-B3W5VsGR.js";
8
- import { _ as P } from "./SaberInfoProvider.vue_vue_type_script_setup_true_lang-3rF6bSCn.js";
9
- import { _ as z } from "./SaberModalWithMobile.vue_vue_type_script_setup_true_lang-aQlToncY.js";
10
- import { _ as A } from "./SaberStatus.vue_vue_type_script_setup_true_lang-D9aRVCow.js";
8
+ import { _ as A } from "./SaberInfoProvider.vue_vue_type_script_setup_true_lang-3rF6bSCn.js";
9
+ import { _ as P } from "./SaberModalWithMobile.vue_vue_type_script_setup_true_lang-aQlToncY.js";
10
+ import { _ as z } from "./SaberStatus.vue_vue_type_script_setup_true_lang-D9aRVCow.js";
11
11
  import { _ as F } from "./SaberSwitchBar.vue_vue_type_script_setup_true_lang-CDx3Dcas.js";
12
- import { _ as U } from "./SaberAppSidebar.vue_vue_type_script_setup_true_lang-HXyIXiau.js";
12
+ import { _ as L } from "./SaberAppLayout.vue_vue_type_script_setup_true_lang-R7F5K7kj.js";
13
+ import { _ as U } from "./SaberAppSidebar.vue_vue_type_script_setup_true_lang-Cwuj9VNi.js";
13
14
  import { _ as V } from "./SaberNavigationSearch.vue_vue_type_script_setup_true_lang-Bj96kMla.js";
14
15
  import { k as W } from "./plugin-Dr3z0YFg.js";
15
- import { _ as be, a as fe, b as ue, c as Se, d as _e, e as pe } from "./plugin-Dr3z0YFg.js";
16
- import { _ as xe } from "./SaberModal.vue_vue_type_script_setup_true_lang-DJno3jA3.js";
17
- import { _ as ye } from "./SaberDictCheckbox.vue_vue_type_script_setup_true_lang-DUbzy_C6.js";
18
- import { _ as ve, a as Ce } from "./SaberDictRadio.vue_vue_type_script_setup_true_lang-DR6-jSID.js";
19
- import { _ as Be } from "./SaberDictSelect.vue_vue_type_script_setup_true_lang-B8PTKNKX.js";
20
- import { _ as Ne } from "./SaberDistrictSelect.vue_vue_type_script_setup_true_lang-BX8nLC35.js";
21
- import { _ as Me } from "./SaberPopSelect.vue_vue_type_script_setup_true_lang-BcS27NXI.js";
22
- const b = {
16
+ import { _ as ue, a as Se, b as _e, c as pe, d as ge, e as xe } from "./plugin-Dr3z0YFg.js";
17
+ import { _ as ye } from "./SaberModal.vue_vue_type_script_setup_true_lang-DJno3jA3.js";
18
+ import { _ as ve } from "./SaberDictCheckbox.vue_vue_type_script_setup_true_lang-DUbzy_C6.js";
19
+ import { _ as ke, a as Be } from "./SaberDictRadio.vue_vue_type_script_setup_true_lang-DR6-jSID.js";
20
+ import { _ as Ne } from "./SaberDictSelect.vue_vue_type_script_setup_true_lang-B8PTKNKX.js";
21
+ import { _ as Me } from "./SaberDistrictSelect.vue_vue_type_script_setup_true_lang-BX8nLC35.js";
22
+ import { _ as Ae } from "./SaberPopSelect.vue_vue_type_script_setup_true_lang-BcS27NXI.js";
23
+ const d = {
23
24
  red: { 500: "#ef4444", 600: "#dc2626" },
24
25
  orange: { 500: "#f97316", 600: "#ea580c" },
25
26
  amber: { 500: "#f59e0b", 600: "#d97706" },
@@ -42,10 +43,10 @@ const b = {
42
43
  zinc: { 500: "#71717a", 600: "#52525b" },
43
44
  neutral: { 500: "#737373", 600: "#525252" },
44
45
  stone: { 500: "#78716c", 600: "#57534e" }
45
- }, H = b.gray;
46
+ }, H = d.gray;
46
47
  function S(e, t) {
47
48
  var o, a;
48
- return ((o = b[e]) == null ? void 0 : o[t]) ?? ((a = b[e]) == null ? void 0 : a[500]) ?? H[500];
49
+ return ((o = d[e]) == null ? void 0 : o[t]) ?? ((a = d[e]) == null ? void 0 : a[500]) ?? H[500];
49
50
  }
50
51
  function R(e, t) {
51
52
  const o = parseInt(e.slice(1, 3), 16), a = parseInt(e.slice(3, 5), 16), r = parseInt(e.slice(5, 7), 16);
@@ -84,16 +85,16 @@ const T = /* @__PURE__ */ _({
84
85
  class: "inline-flex items-center rounded-full border-0 pt-0.75 pb-0.75 px-2 text-xs font-medium"
85
86
  }, {
86
87
  default: C(() => [
87
- k(d(o.value.label), 1)
88
+ k(b(o.value.label), 1)
88
89
  ]),
89
90
  _: 1
90
91
  }, 8, ["style"]);
91
92
  };
92
93
  }
93
- }), E = { class: "rounded-md border border-accented p-3" }, L = { class: "flex flex-col gap-1" }, O = { class: "text-base font-semibold mb-2 text-highlighted w-60" }, j = {
94
+ }), E = { class: "rounded-md border border-accented p-3" }, O = { class: "flex flex-col gap-1" }, j = { class: "text-base font-semibold mb-2 text-highlighted w-60" }, G = {
94
95
  key: 0,
95
96
  class: "text-sm text-muted w-60"
96
- }, G = { key: 0 }, K = { key: 1 }, q = /* @__PURE__ */ _({
97
+ }, K = { key: 0 }, q = { key: 1 }, J = /* @__PURE__ */ _({
97
98
  name: "SaberNoData",
98
99
  __name: "SaberNoData",
99
100
  props: {
@@ -119,49 +120,50 @@ const T = /* @__PURE__ */ _({
119
120
  class: "size-5"
120
121
  }, null, 8, ["name"])
121
122
  ]),
122
- l("div", L, [
123
- l("h4", O, d(e.title), 1),
124
- e.description ? (s(), i("p", j, d(e.description), 1)) : m("", !0)
123
+ l("div", O, [
124
+ l("h4", j, b(e.title), 1),
125
+ e.description ? (s(), i("p", G, b(e.description), 1)) : m("", !0)
125
126
  ]),
126
- t.$slots.default ? (s(), i("div", G, [
127
+ t.$slots.default ? (s(), i("div", K, [
127
128
  u(t.$slots, "default")
128
129
  ])) : m("", !0),
129
- t.$slots.extra ? (s(), i("p", K, [
130
+ t.$slots.extra ? (s(), i("p", q, [
130
131
  u(t.$slots, "extra")
131
132
  ])) : m("", !0)
132
133
  ], 2);
133
134
  };
134
135
  }
135
- }), le = {
136
+ }), be = {
136
137
  install(e, t = {}) {
137
- e.use(h), e.component("SaberBadgeStatus", T), e.component("SaberNoData", q), e.component("SaberConfirmModal", D), e.component("SaberConfirmProvider", M), e.component("SaberInfo", w), e.component("SaberInfoProvider", P), e.component("SaberModalWithMobile", z), e.component("SaberStatus", A), e.component("SaberSwitchBar", F), e.component("SaberAppSidebar", U), e.component("SaberNavigationSearch", V), W(e, t.forms);
138
+ e.use(h), e.component("SaberBadgeStatus", T), e.component("SaberNoData", J), e.component("SaberConfirmModal", D), e.component("SaberConfirmProvider", M), e.component("SaberInfo", w), e.component("SaberInfoProvider", A), e.component("SaberModalWithMobile", P), e.component("SaberStatus", z), e.component("SaberSwitchBar", F), e.component("SaberAppSidebar", U), e.component("SaberNavigationSearch", V), e.component("SaberAppLayout", L), W(e, t.forms);
138
139
  }
139
140
  };
140
141
  export {
142
+ L as SaberAppLayout,
141
143
  U as SaberAppSidebar,
142
144
  T as SaberBadgeStatus,
143
145
  D as SaberConfirmModal,
144
146
  M as SaberConfirmProvider,
145
- ye as SaberDictCheckbox,
146
- ve as SaberDictRadio,
147
- Be as SaberDictSelect,
148
- Ne as SaberDistrictSelect,
149
- be as SaberFilterBar,
150
- fe as SaberFormModal,
147
+ ve as SaberDictCheckbox,
148
+ ke as SaberDictRadio,
149
+ Ne as SaberDictSelect,
150
+ Me as SaberDistrictSelect,
151
+ ue as SaberFilterBar,
152
+ Se as SaberFormModal,
151
153
  w as SaberInfo,
152
- P as SaberInfoProvider,
153
- ue as SaberInput,
154
- Se as SaberInputNumber,
155
- xe as SaberModal,
156
- z as SaberModalWithMobile,
154
+ A as SaberInfoProvider,
155
+ _e as SaberInput,
156
+ pe as SaberInputNumber,
157
+ ye as SaberModal,
158
+ P as SaberModalWithMobile,
157
159
  V as SaberNavigationSearch,
158
- q as SaberNoData,
159
- Me as SaberPopSelect,
160
- Ce as SaberRadioGroup,
161
- _e as SaberSelect,
162
- A as SaberStatus,
160
+ J as SaberNoData,
161
+ Ae as SaberPopSelect,
162
+ Be as SaberRadioGroup,
163
+ ge as SaberSelect,
164
+ z as SaberStatus,
163
165
  F as SaberSwitchBar,
164
- pe as SaberTextarea,
165
- le as default,
166
+ xe as SaberTextarea,
167
+ be as default,
166
168
  W as installSaberForms
167
169
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owocow/saber-ui",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Saber application foundation for Vue 3 projects built on Nuxt UI",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -100,6 +100,10 @@
100
100
  "types": "./dist/components/SaberSwitchBar.vue.d.ts",
101
101
  "import": "./dist/components/SaberSwitchBar.mjs"
102
102
  },
103
+ "./components/SaberAppLayout": {
104
+ "types": "./dist/components/layout/SaberAppLayout.vue.d.ts",
105
+ "import": "./dist/components/SaberAppLayout.mjs"
106
+ },
103
107
  "./components/SaberAppSidebar": {
104
108
  "types": "./dist/components/navigation/SaberAppSidebar.vue.d.ts",
105
109
  "import": "./dist/components/SaberAppSidebar.mjs"
@@ -195,6 +199,7 @@
195
199
  "prepublishOnly": "npm run build"
196
200
  },
197
201
  "dependencies": {
202
+ "@vueuse/core": "^14.2.1",
198
203
  "crypto-js": "^4.2.0",
199
204
  "jsencrypt": "^3.5.4",
200
205
  "klona": "^2.0.6",