@floegence/floe-webapp-core 0.35.21 → 0.35.22

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.
@@ -1,106 +1,106 @@
1
- import { insert as R, createComponent as a, memo as A, effect as b, className as x, template as W, use as H, delegateEvents as P } from "solid-js/web";
2
- import { createSignal as y, onMount as B, createMemo as M, For as O, Show as T, onCleanup as F } from "solid-js";
3
- import { cn as C } from "../../utils/cn.js";
1
+ import { insert as E, createComponent as a, memo as $, effect as D, className as L, template as b, use as H, delegateEvents as P } from "solid-js/web";
2
+ import { createSignal as B, onMount as y, createMemo as I, For as O, Show as k, onCleanup as F } from "solid-js";
3
+ import { cn as x } from "../../utils/cn.js";
4
4
  import { useFileBrowser as G } from "./FileBrowserContext.js";
5
- import { ChevronRight as E } from "../icons/index.js";
5
+ import { ChevronRight as M } from "../icons/index.js";
6
6
  import { Dropdown as z } from "../ui/Dropdown.js";
7
- var X = /* @__PURE__ */ W("<nav aria-label=Breadcrumb>"), j = /* @__PURE__ */ W('<button type=button title="Show hidden path segments">…'), q = /* @__PURE__ */ W('<button type=button><span class="truncate max-w-[120px] block">');
8
- const p = 16, J = 28, D = 12, K = 7, Q = 120, U = 100;
9
- function V(r) {
10
- const n = r.length * K;
11
- return Math.min(n + D, Q + D);
7
+ var X = /* @__PURE__ */ b("<nav aria-label=Breadcrumb>"), j = /* @__PURE__ */ b("<span>…"), q = /* @__PURE__ */ b('<button type=button><span class="truncate max-w-[120px] block">');
8
+ const p = 16, J = 28, T = 12, K = 7, Q = 120, U = 100;
9
+ function V(n) {
10
+ const t = n.length * K;
11
+ return Math.min(t + T, Q + T);
12
12
  }
13
- function ce(r) {
14
- const n = G();
15
- let s;
16
- const [t, c] = y(0);
17
- B(() => {
18
- if (!s) return;
13
+ function ce(n) {
14
+ const t = G();
15
+ let o;
16
+ const [r, c] = B(0);
17
+ y(() => {
18
+ if (!o) return;
19
19
  const e = () => {
20
- s && c(s.offsetWidth);
20
+ o && c(o.offsetWidth);
21
21
  };
22
22
  e();
23
- const o = new ResizeObserver(e);
24
- o.observe(s), F(() => o.disconnect());
23
+ const s = new ResizeObserver(e);
24
+ s.observe(o), F(() => s.disconnect());
25
25
  });
26
- const d = M(() => {
27
- const e = n.currentPath(), o = n.homeLabel();
26
+ const h = I(() => {
27
+ const e = t.currentPath(), s = t.homeLabel();
28
28
  if (e === "/" || e === "")
29
29
  return [{
30
- name: o,
30
+ name: s,
31
31
  path: "/"
32
32
  }];
33
33
  const l = e.split("/").filter(Boolean), i = [{
34
- name: o,
34
+ name: s,
35
35
  path: "/"
36
36
  }];
37
- let f = "";
38
- for (const g of l)
39
- f += "/" + g, i.push({
40
- name: g,
41
- path: f
37
+ let g = "";
38
+ for (const f of l)
39
+ g += "/" + f, i.push({
40
+ name: f,
41
+ path: g
42
42
  });
43
43
  return i;
44
- }), m = M(() => {
45
- const e = d(), o = t();
46
- if (o < U || e.length <= 2)
44
+ }), m = I(() => {
45
+ const e = h(), s = r();
46
+ if (s < U || e.length <= 2)
47
47
  return {
48
48
  collapsed: [],
49
49
  visible: e,
50
50
  shouldCollapse: !1
51
51
  };
52
- const l = e.map((u) => V(u.name)), i = l[0], f = l[e.length - 1], g = p, $ = e.length > 1 ? p : 0, _ = i + f + g + $;
53
- if (_ > o && e.length > 2)
52
+ const l = e.map((d) => V(d.name)), i = l[0], g = l[e.length - 1], f = p, R = e.length > 1 ? p : 0, C = i + g + f + R;
53
+ if (C > s && e.length > 2)
54
54
  return {
55
55
  collapsed: e.slice(1, -1),
56
56
  visible: [e[0], e[e.length - 1]],
57
57
  shouldCollapse: !0
58
58
  };
59
- const h = e.slice(1, -1), v = [];
60
- let w = o - _;
61
- const L = h.length > 0 ? J + p : 0;
62
- for (let u = h.length - 1; u >= 0; u--) {
63
- const k = l[u + 1] + p, N = u > 0 ? L : 0;
64
- if (w - N >= k)
65
- v.unshift(h[u]), w -= k;
59
+ const u = e.slice(1, -1), v = [];
60
+ let S = s - C;
61
+ const A = u.length > 0 ? J + p : 0;
62
+ for (let d = u.length - 1; d >= 0; d--) {
63
+ const _ = l[d + 1] + p, N = d > 0 ? A : 0;
64
+ if (S - N >= _)
65
+ v.unshift(u[d]), S -= _;
66
66
  else
67
67
  break;
68
68
  }
69
- const I = h.slice(0, h.length - v.length);
69
+ const w = u.slice(0, u.length - v.length);
70
70
  return {
71
- collapsed: I,
71
+ collapsed: w,
72
72
  visible: [e[0], ...v, e[e.length - 1]],
73
- shouldCollapse: I.length > 0
73
+ shouldCollapse: w.length > 0
74
74
  };
75
- }), S = (e) => {
76
- n.setCurrentPath(e.path);
75
+ }), W = (e) => {
76
+ t.setCurrentPath(e.path);
77
77
  };
78
78
  return (() => {
79
- var e = X(), o = s;
80
- return typeof o == "function" ? H(o, e) : s = e, R(e, a(O, {
79
+ var e = X(), s = o;
80
+ return typeof s == "function" ? H(s, e) : o = e, E(e, a(O, {
81
81
  get each() {
82
82
  return m().visible;
83
83
  },
84
- children: (l, i) => [a(T, {
84
+ children: (l, i) => [a(k, {
85
85
  get when() {
86
86
  return i() > 0;
87
87
  },
88
88
  get children() {
89
- return a(E, {
89
+ return a(M, {
90
90
  class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
91
91
  });
92
92
  }
93
- }), a(T, {
93
+ }), a(k, {
94
94
  get when() {
95
- return A(() => !!m().shouldCollapse)() && i() === 1;
95
+ return $(() => !!m().shouldCollapse)() && i() === 1;
96
96
  },
97
97
  get children() {
98
98
  return [a(Y, {
99
99
  get segments() {
100
100
  return m().collapsed;
101
101
  },
102
- onSelect: S
103
- }), a(E, {
102
+ onSelect: W
103
+ }), a(M, {
104
104
  class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
105
105
  })];
106
106
  }
@@ -109,43 +109,44 @@ function ce(r) {
109
109
  get isLast() {
110
110
  return i() === m().visible.length - 1;
111
111
  },
112
- onClick: () => S(l)
112
+ onClick: () => W(l)
113
113
  })]
114
- })), b(() => x(e, C("flex items-center gap-1 min-w-0 overflow-hidden", r.class))), e;
114
+ })), D(() => L(e, x("flex items-center gap-1 min-w-0 overflow-hidden", n.class))), e;
115
115
  })();
116
116
  }
117
- function Y(r) {
118
- const n = () => r.segments.map((t) => ({
119
- id: t.path,
120
- label: t.name
117
+ function Y(n) {
118
+ const t = () => n.segments.map((r) => ({
119
+ id: r.path,
120
+ label: r.name
121
121
  }));
122
122
  return a(z, {
123
123
  get trigger() {
124
- return (() => {
125
- var t = j();
126
- return b(() => x(t, C("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "text-muted-foreground hover:text-foreground hover:bg-muted/50", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"))), t;
127
- })();
124
+ return j();
128
125
  },
126
+ get triggerClass() {
127
+ return x("inline-flex items-center text-xs px-1.5 py-0.5 rounded flex-shrink-0", "transition-all duration-100", "text-muted-foreground hover:text-foreground hover:bg-muted/50");
128
+ },
129
+ triggerAriaLabel: "Show hidden path segments",
129
130
  get items() {
130
- return n();
131
+ return t();
131
132
  },
132
- onSelect: (t) => {
133
- const c = r.segments.find((d) => d.path === t);
134
- c && r.onSelect(c);
133
+ onSelect: (r) => {
134
+ const c = n.segments.find((h) => h.path === r);
135
+ c && n.onSelect(c);
135
136
  },
136
137
  align: "start"
137
138
  });
138
139
  }
139
- function Z(r) {
140
+ function Z(n) {
140
141
  return (() => {
141
- var n = q(), s = n.firstChild;
142
- return n.$$click = () => r.onClick(), R(s, () => r.segment.name), b((t) => {
143
- var c = r.isLast, d = C("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", r.isLast ? "font-medium text-foreground cursor-default" : "text-muted-foreground hover:text-foreground hover:bg-muted/50");
144
- return c !== t.e && (n.disabled = t.e = c), d !== t.t && x(n, t.t = d), t;
142
+ var t = q(), o = t.firstChild;
143
+ return t.$$click = () => n.onClick(), E(o, () => n.segment.name), D((r) => {
144
+ var c = n.isLast, h = x("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", n.isLast ? "font-medium text-foreground cursor-default" : "text-muted-foreground hover:text-foreground hover:bg-muted/50");
145
+ return c !== r.e && (t.disabled = r.e = c), h !== r.t && L(t, r.t = h), r;
145
146
  }, {
146
147
  e: void 0,
147
148
  t: void 0
148
- }), n;
149
+ }), t;
149
150
  })();
150
151
  }
151
152
  P(["click"]);
@@ -25,6 +25,7 @@ export interface ActivityBarProps {
25
25
  }) => void;
26
26
  collapsed?: boolean;
27
27
  onCollapsedChange?: (collapsed: boolean) => void;
28
+ ariaLabel?: string;
28
29
  class?: string;
29
30
  }
30
31
  /**
@@ -1,104 +1,110 @@
1
- import { insert as a, createComponent as l, effect as f, className as b, template as s, Dynamic as A, memo as k, setAttribute as y, delegateEvents as w } from "solid-js/web";
2
- import { createMemo as v, For as x, Show as g } from "solid-js";
3
- import { cn as m } from "../../utils/cn.js";
4
- import { deferNonBlocking as I } from "../../utils/defer.js";
5
- import { Tooltip as $ } from "../ui/Tooltip.js";
1
+ import { insert as c, createComponent as a, effect as f, className as g, setAttribute as m, template as s, Dynamic as k, memo as w, delegateEvents as I } from "solid-js/web";
2
+ import { createMemo as b, For as C, Show as h } from "solid-js";
3
+ import { cn as y } from "../../utils/cn.js";
4
+ import { deferNonBlocking as $ } from "../../utils/defer.js";
5
+ import { Tooltip as B } from "../ui/Tooltip.js";
6
6
  import { resolveActivityBarClick as _ } from "./activityBarBehavior.js";
7
- var B = /* @__PURE__ */ s('<div class="flex flex-col">'), p = /* @__PURE__ */ s('<div data-floe-shell-slot=activity-bar style=border-right-color:var(--activity-bar-border)><div class="flex flex-col">'), S = /* @__PURE__ */ s('<div class="absolute left-0 top-0 w-1 h-full bg-primary rounded-r">'), j = /* @__PURE__ */ s("<span>"), N = /* @__PURE__ */ s("<button type=button>");
8
- function V(e) {
9
- const o = v(() => e.activeId), r = v(() => e.collapsed ?? !1), t = v(() => e.onActiveChange), c = v(() => e.onCollapsedChange), u = (i) => {
7
+ var S = /* @__PURE__ */ s('<div class="flex flex-col">'), j = /* @__PURE__ */ s('<nav data-floe-shell-slot=activity-bar style=border-right-color:var(--activity-bar-border)><div class="flex flex-col">'), N = /* @__PURE__ */ s('<div class="absolute left-0 top-0 w-1 h-full bg-primary rounded-r">'), q = /* @__PURE__ */ s("<span>"), D = /* @__PURE__ */ s("<button type=button>");
8
+ function z(e) {
9
+ const o = b(() => e.activeId), n = b(() => e.collapsed ?? !1), t = b(() => e.onActiveChange), d = b(() => e.onCollapsedChange), v = (i) => {
10
10
  if (i.onClick) {
11
- I(() => i.onClick());
11
+ $(() => i.onClick());
12
12
  return;
13
13
  }
14
- const n = _({
14
+ const l = _({
15
15
  clickedId: i.id,
16
16
  activeId: o(),
17
- collapsed: r(),
17
+ collapsed: n(),
18
18
  behavior: i.collapseBehavior
19
19
  });
20
- n.nextActiveId !== o() && (typeof n.openSidebar == "boolean" ? t()(n.nextActiveId, {
21
- openSidebar: n.openSidebar
22
- }) : t()(n.nextActiveId)), typeof n.nextCollapsed == "boolean" && c()?.(n.nextCollapsed);
20
+ l.nextActiveId !== o() && (typeof l.openSidebar == "boolean" ? t()(l.nextActiveId, {
21
+ openSidebar: l.openSidebar
22
+ }) : t()(l.nextActiveId)), typeof l.nextCollapsed == "boolean" && d()?.(l.nextCollapsed);
23
23
  };
24
24
  return (() => {
25
- var i = p(), n = i.firstChild;
26
- return a(n, l(x, {
25
+ var i = j(), l = i.firstChild;
26
+ return c(l, a(C, {
27
27
  get each() {
28
28
  return e.items;
29
29
  },
30
- children: (d) => l(C, {
31
- item: d,
30
+ children: (r) => a(A, {
31
+ item: r,
32
32
  get isActive() {
33
- return o() === d.id;
33
+ return o() === r.id;
34
34
  },
35
- onClick: () => u(d)
35
+ onClick: () => v(r)
36
36
  })
37
- })), a(i, l(g, {
37
+ })), c(i, a(h, {
38
38
  get when() {
39
39
  return e.bottomItems?.length;
40
40
  },
41
41
  get children() {
42
- var d = B();
43
- return a(d, l(x, {
42
+ var r = S();
43
+ return c(r, a(C, {
44
44
  get each() {
45
45
  return e.bottomItems;
46
46
  },
47
- children: (h) => l(C, {
48
- item: h,
47
+ children: (u) => a(A, {
48
+ item: u,
49
49
  isActive: !1,
50
- onClick: () => u(h)
50
+ onClick: () => v(u)
51
51
  })
52
- })), d;
52
+ })), r;
53
53
  }
54
- }), null), f(() => b(i, m("w-10 md:w-12 flex flex-col justify-between shrink-0 min-h-0", "bg-activity-bar border-r border-border", e.class))), i;
54
+ }), null), f((r) => {
55
+ var u = y("w-10 md:w-12 flex flex-col justify-between shrink-0 min-h-0", "bg-activity-bar border-r border-border", e.class), x = e.ariaLabel;
56
+ return u !== r.e && g(i, r.e = u), x !== r.t && m(i, "aria-label", r.t = x), r;
57
+ }, {
58
+ e: void 0,
59
+ t: void 0
60
+ }), i;
55
61
  })();
56
62
  }
57
- function C(e) {
63
+ function A(e) {
58
64
  const o = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
59
- return l($, {
65
+ return a(B, {
60
66
  get content() {
61
67
  return e.item.label;
62
68
  },
63
69
  placement: "right",
64
70
  delay: 0,
65
71
  get children() {
66
- var r = N();
67
- return r.$$click = () => e.onClick(), a(r, l(g, {
72
+ var n = D();
73
+ return n.$$click = () => e.onClick(), c(n, a(h, {
68
74
  get when() {
69
75
  return e.isActive;
70
76
  },
71
77
  get children() {
72
- return S();
78
+ return N();
73
79
  }
74
- }), null), a(r, l(A, {
80
+ }), null), c(n, a(k, {
75
81
  get component() {
76
82
  return e.item.icon;
77
83
  },
78
84
  class: "w-5 h-5"
79
- }), null), a(r, l(g, {
85
+ }), null), c(n, a(h, {
80
86
  get when() {
81
87
  return o();
82
88
  },
83
89
  get children() {
84
- var t = j();
85
- return a(t, (() => {
86
- var c = k(() => typeof o() == "number" && o() > 99);
87
- return () => c() ? "99+" : o();
88
- })()), f(() => b(t, m("absolute top-0.5 right-0.5 min-w-3.5 h-3.5 px-1", "flex items-center justify-center", "text-[9px] font-medium rounded-full", "bg-activity-bar-badge text-activity-bar-badge-foreground"))), t;
90
+ var t = q();
91
+ return c(t, (() => {
92
+ var d = w(() => typeof o() == "number" && o() > 99);
93
+ return () => d() ? "99+" : o();
94
+ })()), f(() => g(t, y("absolute top-0.5 right-0.5 min-w-3.5 h-3.5 px-1", "flex items-center justify-center", "text-[9px] font-medium rounded-full", "bg-activity-bar-badge text-activity-bar-badge-foreground"))), t;
89
95
  }
90
96
  }), null), f((t) => {
91
- var c = m("relative w-full aspect-square flex items-center justify-center cursor-pointer", "transition-[color,background-color] duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset", e.isActive ? "text-activity-bar-foreground-active bg-accent/80" : "text-activity-bar-foreground hover:text-activity-bar-foreground-active hover:bg-accent/40"), u = e.item.label, i = e.isActive;
92
- return c !== t.e && b(r, t.e = c), u !== t.t && y(r, "aria-label", t.t = u), i !== t.a && y(r, "aria-pressed", t.a = i), t;
97
+ var d = y("relative w-full aspect-square flex items-center justify-center cursor-pointer", "transition-[color,background-color] duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset", e.isActive ? "text-activity-bar-foreground-active bg-accent/80" : "text-activity-bar-foreground hover:text-activity-bar-foreground-active hover:bg-accent/40"), v = e.item.label, i = e.isActive;
98
+ return d !== t.e && g(n, t.e = d), v !== t.t && m(n, "aria-label", t.t = v), i !== t.a && m(n, "aria-pressed", t.a = i), t;
93
99
  }, {
94
100
  e: void 0,
95
101
  t: void 0,
96
102
  a: void 0
97
- }), r;
103
+ }), n;
98
104
  }
99
105
  });
100
106
  }
101
- w(["click"]);
107
+ I(["click"]);
102
108
  export {
103
- V as ActivityBar
109
+ z as ActivityBar
104
110
  };
@@ -13,6 +13,7 @@ export interface MobileTabBarProps {
13
13
  items: MobileTabBarItem[];
14
14
  activeId: string;
15
15
  onSelect: (id: string) => void;
16
+ ariaLabel?: string;
16
17
  class?: string;
17
18
  }
18
19
  /**
@@ -1,115 +1,159 @@
1
- import { insert as a, createComponent as c, effect as k, className as v, template as f, Dynamic as _, memo as I, setAttribute as w, use as L, delegateEvents as F } from "solid-js/web";
2
- import { createSignal as C, onMount as W, onCleanup as M, Show as x, For as R } from "solid-js";
3
- import { cn as b } from "../../utils/cn.js";
4
- import { deferNonBlocking as j } from "../../utils/defer.js";
5
- var q = /* @__PURE__ */ f('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), z = /* @__PURE__ */ f('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), B = /* @__PURE__ */ f('<nav data-floe-shell-slot=mobile-tab-bar style=border-top-color:var(--bottom-bar-border)><div class="relative h-14"><div class="h-full flex items-center overflow-x-auto scrollbar-hide snap-x snap-mandatory"style=-webkit-overflow-scrolling:touch>'), E = /* @__PURE__ */ f("<span>"), N = /* @__PURE__ */ f('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), T = /* @__PURE__ */ f("<button type=button role=tab><div></div><span>");
6
- function K(e) {
7
- let n;
8
- const [i, s] = C(!1), [g, t] = C(!1);
9
- let r = null;
10
- const d = () => {
11
- n && (s(n.scrollLeft > 0), t(n.scrollLeft < n.scrollWidth - n.clientWidth - 1));
12
- }, h = () => {
13
- if (r === null) {
1
+ import { insert as c, createComponent as d, effect as S, className as v, setAttribute as C, template as b, Dynamic as W, memo as M, use as R, delegateEvents as z } from "solid-js/web";
2
+ import { createSignal as I, onMount as D, onCleanup as E, Show as A, For as j } from "solid-js";
3
+ import { cn as g } from "../../utils/cn.js";
4
+ import { deferNonBlocking as L } from "../../utils/defer.js";
5
+ var q = /* @__PURE__ */ b('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), B = /* @__PURE__ */ b('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), K = /* @__PURE__ */ b('<nav data-floe-shell-slot=mobile-tab-bar style=border-top-color:var(--bottom-bar-border)><div class="relative h-14"><div class="h-full flex items-center overflow-x-auto scrollbar-hide snap-x snap-mandatory"role=tablist aria-orientation=horizontal style=-webkit-overflow-scrolling:touch>'), N = /* @__PURE__ */ b("<span>"), T = /* @__PURE__ */ b('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), H = /* @__PURE__ */ b("<button type=button role=tab><div></div><span>");
6
+ function P(e) {
7
+ let i;
8
+ const [o, u] = I(!1), [h, t] = I(!1);
9
+ let n = null;
10
+ const s = () => {
11
+ i && (u(i.scrollLeft > 0), t(i.scrollLeft < i.scrollWidth - i.clientWidth - 1));
12
+ }, x = () => {
13
+ if (n === null) {
14
14
  if (typeof requestAnimationFrame > "u") {
15
- d();
15
+ s();
16
16
  return;
17
17
  }
18
- r = requestAnimationFrame(() => {
19
- r = null, d();
18
+ n = requestAnimationFrame(() => {
19
+ n = null, s();
20
20
  });
21
21
  }
22
+ }, k = () => e.items, w = (l) => {
23
+ const r = k()[l];
24
+ if (r) {
25
+ if (r.onClick) {
26
+ L(() => r.onClick());
27
+ return;
28
+ }
29
+ e.onSelect(r.id);
30
+ }
22
31
  };
23
- return W(() => {
24
- d();
25
- const o = e.items.findIndex((l) => l.id === e.activeId);
26
- if (o > 0 && n) {
27
- const l = n.scrollWidth / e.items.length;
28
- n.scrollLeft = Math.max(0, l * o - n.clientWidth / 2 + l / 2);
32
+ return D(() => {
33
+ s();
34
+ const l = e.items.findIndex((r) => r.id === e.activeId);
35
+ if (l > 0 && i) {
36
+ const r = i.scrollWidth / e.items.length;
37
+ i.scrollLeft = Math.max(0, r * l - i.clientWidth / 2 + r / 2);
29
38
  }
30
- }), M(() => {
31
- r !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(r), r = null);
39
+ }), E(() => {
40
+ n !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(n), n = null);
32
41
  }), (() => {
33
- var o = B(), l = o.firstChild, u = l.firstChild;
34
- a(l, c(x, {
42
+ var l = K(), r = l.firstChild, m = r.firstChild;
43
+ c(r, d(A, {
35
44
  get when() {
36
- return i();
45
+ return o();
37
46
  },
38
47
  get children() {
39
48
  return q();
40
49
  }
41
- }), u), a(l, c(x, {
50
+ }), m), c(r, d(A, {
42
51
  get when() {
43
- return g();
52
+ return h();
44
53
  },
45
54
  get children() {
46
- return z();
55
+ return B();
47
56
  }
48
- }), u), u.addEventListener("scroll", h);
49
- var y = n;
50
- return typeof y == "function" ? L(y, u) : n = u, a(u, c(R, {
57
+ }), m), m.addEventListener("scroll", x);
58
+ var $ = i;
59
+ return typeof $ == "function" ? R($, m) : i = m, c(m, d(j, {
51
60
  get each() {
52
61
  return e.items;
53
62
  },
54
- children: (m) => c(D, {
55
- item: m,
63
+ children: (a, y) => d(U, {
64
+ item: a,
56
65
  get isActive() {
57
- return e.activeId === m.id;
66
+ return e.activeId === a.id;
67
+ },
68
+ get index() {
69
+ return y();
70
+ },
71
+ get itemCount() {
72
+ return e.items.length;
58
73
  },
59
74
  onClick: () => {
60
75
  "vibrate" in navigator && navigator.vibrate(10);
61
- const $ = m.onClick, A = e.onSelect, S = m.id;
62
- m.onClick ? j(() => $()) : A(S);
63
- }
76
+ const f = a.onClick, _ = e.onSelect, F = a.id;
77
+ a.onClick ? L(() => f()) : _(F);
78
+ },
79
+ onKeyboardSelect: (f) => w(f)
64
80
  })
65
- })), k(() => v(o, b(
66
- // Same safe-area rule as TopBar: keep the visual bar height stable, and
67
- // add safe-area padding on an outer wrapper (avoid squeezing content).
68
- "relative shrink-0 bg-background border-t border-border safe-bottom safe-left safe-right",
69
- e.class
70
- ))), o;
81
+ })), S((a) => {
82
+ var y = g(
83
+ // Same safe-area rule as TopBar: keep the visual bar height stable, and
84
+ // add safe-area padding on an outer wrapper (avoid squeezing content).
85
+ "relative shrink-0 bg-background border-t border-border safe-bottom safe-left safe-right",
86
+ e.class
87
+ ), f = e.ariaLabel;
88
+ return y !== a.e && v(l, a.e = y), f !== a.t && C(l, "aria-label", a.t = f), a;
89
+ }, {
90
+ e: void 0,
91
+ t: void 0
92
+ }), l;
71
93
  })();
72
94
  }
73
- function D(e) {
74
- const n = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
95
+ function U(e) {
96
+ const i = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
75
97
  return (() => {
76
- var i = T(), s = i.firstChild, g = s.nextSibling;
77
- return i.$$click = () => e.onClick(), a(s, c(_, {
98
+ var o = H(), u = o.firstChild, h = u.nextSibling;
99
+ return o.$$keydown = (t) => {
100
+ let n = null;
101
+ switch (t.key) {
102
+ case "ArrowRight":
103
+ case "ArrowDown":
104
+ n = (e.index + 1) % e.itemCount;
105
+ break;
106
+ case "ArrowLeft":
107
+ case "ArrowUp":
108
+ n = (e.index - 1 + e.itemCount) % e.itemCount;
109
+ break;
110
+ case "Home":
111
+ n = 0;
112
+ break;
113
+ case "End":
114
+ n = e.itemCount - 1;
115
+ break;
116
+ default:
117
+ return;
118
+ }
119
+ t.preventDefault(), e.onKeyboardSelect(n);
120
+ }, o.$$click = () => e.onClick(), c(u, d(W, {
78
121
  get component() {
79
122
  return e.item.icon;
80
123
  },
81
124
  class: "w-6 h-6"
82
- }), null), a(s, c(x, {
125
+ }), null), c(u, d(A, {
83
126
  get when() {
84
- return n();
127
+ return i();
85
128
  },
86
129
  get children() {
87
- var t = E();
88
- return a(t, (() => {
89
- var r = I(() => typeof n() == "number" && n() > 99);
90
- return () => r() ? "99+" : n();
91
- })()), k(() => v(t, b("absolute -top-1 -right-2 min-w-4 h-4 px-1", "flex items-center justify-center", "text-[10px] font-medium rounded-full", "bg-primary text-primary-foreground"))), t;
130
+ var t = N();
131
+ return c(t, (() => {
132
+ var n = M(() => typeof i() == "number" && i() > 99);
133
+ return () => n() ? "99+" : i();
134
+ })()), S(() => v(t, g("absolute -top-1 -right-2 min-w-4 h-4 px-1", "flex items-center justify-center", "text-[10px] font-medium rounded-full", "bg-primary text-primary-foreground"))), t;
92
135
  }
93
- }), null), a(g, () => e.item.label), a(i, c(x, {
136
+ }), null), c(h, () => e.item.label), c(o, d(A, {
94
137
  get when() {
95
138
  return e.isActive;
96
139
  },
97
140
  get children() {
98
- return N();
141
+ return T();
99
142
  }
100
- }), null), k((t) => {
101
- var r = b("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-[color] duration-150", "focus:outline-none focus-visible:bg-muted", e.isActive ? "text-primary" : "text-muted-foreground active:text-foreground"), d = e.item.label, h = e.isActive, o = b("relative transition-transform duration-150", e.isActive && "scale-110"), l = b("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
102
- return r !== t.e && v(i, t.e = r), d !== t.t && w(i, "aria-label", t.t = d), h !== t.a && w(i, "aria-selected", t.a = h), o !== t.o && v(s, t.o = o), l !== t.i && v(g, t.i = l), t;
143
+ }), null), S((t) => {
144
+ var n = g("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-[color] duration-150", "focus:outline-none focus-visible:bg-muted", e.isActive ? "text-primary" : "text-muted-foreground active:text-foreground"), s = e.item.label, x = e.isActive, k = e.isActive ? 0 : -1, w = g("relative transition-transform duration-150", e.isActive && "scale-110"), l = g("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
145
+ return n !== t.e && v(o, t.e = n), s !== t.t && C(o, "aria-label", t.t = s), x !== t.a && C(o, "aria-selected", t.a = x), k !== t.o && C(o, "tabindex", t.o = k), w !== t.i && v(u, t.i = w), l !== t.n && v(h, t.n = l), t;
103
146
  }, {
104
147
  e: void 0,
105
148
  t: void 0,
106
149
  a: void 0,
107
150
  o: void 0,
108
- i: void 0
109
- }), i;
151
+ i: void 0,
152
+ n: void 0
153
+ }), o;
110
154
  })();
111
155
  }
112
- F(["click"]);
156
+ z(["click", "keydown"]);
113
157
  export {
114
- K as MobileTabBar
158
+ P as MobileTabBar
115
159
  };