@floegence/floe-webapp-core 0.87.4 → 0.89.1

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,53 +1,53 @@
1
- import { use as R, insert as f, createComponent as d, effect as _, className as y, setAttribute as v, template as m, Dynamic as j, memo as q, delegateEvents as B } from "solid-js/web";
2
- import { createSignal as E, onMount as z, onCleanup as D, Show as S, For as F } from "solid-js";
3
- import { cn as A } from "../../utils/cn.js";
1
+ import { use as R, insert as u, createComponent as d, effect as _, className as A, setAttribute as v, template as m, Dynamic as j, memo as q, delegateEvents as B } from "solid-js/web";
2
+ import { createSignal as E, onMount as z, onCleanup as D, Show as $, For as F } from "solid-js";
3
+ import { cn as S } from "../../utils/cn.js";
4
4
  import { deferNonBlocking as W } from "../../utils/defer.js";
5
5
  var H = /* @__PURE__ */ m('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), N = /* @__PURE__ */ m('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), T = /* @__PURE__ */ m('<div data-floe-mobile-navigation-actions class="flex shrink-0 border-l border-[var(--floe-line)]">'), P = /* @__PURE__ */ m('<nav data-floe-shell-slot=mobile-tab-bar style=border-top-color:var(--bottom-bar-border)><div class="relative flex h-14"><div class="relative min-w-0 flex-1"><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>'), U = /* @__PURE__ */ m("<span>"), V = /* @__PURE__ */ m('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), G = /* @__PURE__ */ m("<button type=button><div></div><span>");
6
6
  function Y(e) {
7
7
  let a;
8
- const [$, b] = E(!1), [i, h] = E(!1);
9
- let u = null;
8
+ const [w, b] = E(!1), [i, h] = E(!1);
9
+ let f = null;
10
10
  const g = () => {
11
11
  a && (b(a.scrollLeft > 0), h(a.scrollLeft < a.scrollWidth - a.clientWidth - 1));
12
12
  }, t = () => {
13
- if (u === null) {
13
+ if (f === null) {
14
14
  if (typeof requestAnimationFrame > "u") {
15
15
  g();
16
16
  return;
17
17
  }
18
- u = requestAnimationFrame(() => {
19
- u = null, g();
18
+ f = requestAnimationFrame(() => {
19
+ f = null, g();
20
20
  });
21
21
  }
22
- }, o = () => e.items, I = (l) => {
23
- const r = o()[l];
24
- if (r) {
25
- if (r.onClick) {
26
- W(() => r.onClick());
22
+ }, o = () => e.items, I = (r) => {
23
+ const l = o()[r];
24
+ if (l) {
25
+ if (l.onClick) {
26
+ W(() => l.onClick());
27
27
  return;
28
28
  }
29
- e.onSelect(r.id);
29
+ e.onSelect(l.id);
30
30
  }
31
31
  };
32
32
  return z(() => {
33
33
  g();
34
- const l = e.items.findIndex((r) => r.id === e.activeId);
35
- if (l > 0 && a) {
36
- const r = a.scrollWidth / e.items.length;
37
- a.scrollLeft = Math.max(0, r * l - a.clientWidth / 2 + r / 2);
34
+ const r = e.items.findIndex((l) => l.id === e.activeId);
35
+ if (r > 0 && a) {
36
+ const l = a.scrollWidth / e.items.length;
37
+ a.scrollLeft = Math.max(0, l * r - a.clientWidth / 2 + l / 2);
38
38
  }
39
39
  }), D(() => {
40
- u !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(u), u = null);
40
+ f !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(f), f = null);
41
41
  }), (() => {
42
- var l = P(), r = l.firstChild, x = r.firstChild, s = x.firstChild, w = e.ref;
43
- typeof w == "function" ? R(w, l) : e.ref = l, f(x, d(S, {
42
+ var r = P(), l = r.firstChild, x = l.firstChild, s = x.firstChild, C = e.ref;
43
+ typeof C == "function" ? R(C, r) : e.ref = r, u(x, d($, {
44
44
  get when() {
45
- return $();
45
+ return w();
46
46
  },
47
47
  get children() {
48
48
  return H();
49
49
  }
50
- }), s), f(x, d(S, {
50
+ }), s), u(x, d($, {
51
51
  get when() {
52
52
  return i();
53
53
  },
@@ -55,8 +55,8 @@ function Y(e) {
55
55
  return N();
56
56
  }
57
57
  }), s), s.addEventListener("scroll", t);
58
- var C = a;
59
- return typeof C == "function" ? R(C, s) : a = s, f(s, d(F, {
58
+ var y = a;
59
+ return typeof y == "function" ? R(y, s) : a = s, u(s, d(F, {
60
60
  get each() {
61
61
  return e.items;
62
62
  },
@@ -78,13 +78,13 @@ function Y(e) {
78
78
  },
79
79
  onKeyboardSelect: (k) => I(k)
80
80
  })
81
- })), f(r, d(S, {
81
+ })), u(l, d($, {
82
82
  get when() {
83
83
  return e.actions?.length;
84
84
  },
85
85
  get children() {
86
86
  var n = T();
87
- return f(n, d(F, {
87
+ return u(n, d(F, {
88
88
  get each() {
89
89
  return e.actions;
90
90
  },
@@ -101,27 +101,27 @@ function Y(e) {
101
101
  })), n;
102
102
  }
103
103
  }), null), _((n) => {
104
- var c = e.hidden, k = A(
104
+ var c = e.hidden, k = S(
105
105
  // Same safe-area rule as TopBar: keep the visual bar height stable, and
106
106
  // add safe-area padding on an outer wrapper (avoid squeezing content).
107
107
  "relative shrink-0 bg-background border-t border-[var(--floe-line)] safe-bottom safe-left safe-right",
108
108
  e.class
109
109
  ), L = e.ariaLabel;
110
- return c !== n.e && (l.hidden = n.e = c), k !== n.t && y(l, n.t = k), L !== n.a && v(l, "aria-label", n.a = L), n;
110
+ return c !== n.e && (r.hidden = n.e = c), k !== n.t && A(r, n.t = k), L !== n.a && v(r, "aria-label", n.a = L), n;
111
111
  }, {
112
112
  e: void 0,
113
113
  t: void 0,
114
114
  a: void 0
115
- }), l;
115
+ }), r;
116
116
  })();
117
117
  }
118
118
  function M(e) {
119
119
  let a;
120
- const $ = () => typeof e.item.ariaExpanded == "function" ? e.item.ariaExpanded() : e.item.ariaExpanded;
120
+ const w = () => typeof e.item.ariaExpanded == "function" ? e.item.ariaExpanded() : e.item.ariaExpanded;
121
121
  z(() => e.item.buttonRef?.(a ?? null)), D(() => e.item.buttonRef?.(null));
122
122
  const b = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
123
123
  return (() => {
124
- var i = G(), h = i.firstChild, u = h.nextSibling;
124
+ var i = G(), h = i.firstChild, f = h.nextSibling;
125
125
  i.$$keydown = (t) => {
126
126
  if (e.action) return;
127
127
  let o = null;
@@ -146,23 +146,26 @@ function M(e) {
146
146
  t.preventDefault(), e.onKeyboardSelect(o);
147
147
  }, i.$$click = () => e.onClick();
148
148
  var g = a;
149
- return typeof g == "function" ? R(g, i) : a = i, f(h, d(j, {
149
+ return typeof g == "function" ? R(g, i) : a = i, u(h, d(j, {
150
150
  get component() {
151
151
  return e.item.icon;
152
152
  },
153
- class: "w-6 h-6"
154
- }), null), f(h, d(S, {
153
+ class: "w-6 h-6",
154
+ get active() {
155
+ return e.isActive || w() === !0;
156
+ }
157
+ }), null), u(h, d($, {
155
158
  get when() {
156
159
  return b();
157
160
  },
158
161
  get children() {
159
162
  var t = U();
160
- return f(t, (() => {
163
+ return u(t, (() => {
161
164
  var o = q(() => typeof b() == "number" && b() > 99);
162
165
  return () => o() ? "99+" : b();
163
- })()), _(() => y(t, A("absolute -top-1 -right-2 min-w-4 h-4 px-1", "flex items-center justify-center", "text-caption font-medium rounded-full", "bg-primary text-primary-foreground"))), t;
166
+ })()), _(() => A(t, S("absolute -top-1 -right-2 min-w-4 h-4 px-1", "flex items-center justify-center", "text-caption font-medium rounded-full", "bg-primary text-primary-foreground"))), t;
164
167
  }
165
- }), null), f(u, () => e.item.label), f(i, d(S, {
168
+ }), null), u(f, () => e.item.label), u(i, d($, {
166
169
  get when() {
167
170
  return e.isActive;
168
171
  },
@@ -170,8 +173,8 @@ function M(e) {
170
173
  return V();
171
174
  }
172
175
  }), null), _((t) => {
173
- var o = A("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-[color,background-color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "hover:bg-[var(--floe-state-hover)] focus:outline-none focus-visible:bg-[var(--floe-state-press)]", e.action && "w-16 px-1", $() && "bg-[var(--floe-state-selected)] text-foreground", e.isActive ? "text-[var(--floe-accent-ink)]" : "text-[var(--floe-ink-soft)] active:text-foreground"), I = e.item.label, l = e.action ? void 0 : e.isActive, r = $(), x = e.item.ariaControls, s = e.item.ariaHasPopup, w = e.action ? void 0 : "tab", C = e.action || e.isActive ? 0 : -1, n = A("relative transition-transform duration-[var(--floe-duration-fast)]", e.isActive && "scale-110"), c = A("mt-1 text-caption font-medium truncate max-w-full", e.isActive && "font-semibold");
174
- return o !== t.e && y(i, t.e = o), I !== t.t && v(i, "aria-label", t.t = I), l !== t.a && v(i, "aria-selected", t.a = l), r !== t.o && v(i, "aria-expanded", t.o = r), x !== t.i && v(i, "aria-controls", t.i = x), s !== t.n && v(i, "aria-haspopup", t.n = s), w !== t.s && v(i, "role", t.s = w), C !== t.h && v(i, "tabindex", t.h = C), n !== t.r && y(h, t.r = n), c !== t.d && y(u, t.d = c), t;
176
+ var o = S("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-[color,background-color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "hover:bg-[var(--floe-state-hover)] focus:outline-none focus-visible:bg-[var(--floe-state-press)]", e.action && "w-16 px-1", w() && "bg-[var(--floe-state-selected)] text-foreground", e.isActive ? "text-[var(--floe-accent-ink)]" : "text-[var(--floe-ink-soft)] active:text-foreground"), I = e.item.label, r = e.action ? void 0 : e.isActive, l = w(), x = e.item.ariaControls, s = e.item.ariaHasPopup, C = e.action ? void 0 : "tab", y = e.action || e.isActive ? 0 : -1, n = S("relative transition-transform duration-[var(--floe-duration-fast)]", e.isActive && "scale-110"), c = S("mt-1 text-caption font-medium truncate max-w-full", e.isActive && "font-semibold");
177
+ return o !== t.e && A(i, t.e = o), I !== t.t && v(i, "aria-label", t.t = I), r !== t.a && v(i, "aria-selected", t.a = r), l !== t.o && v(i, "aria-expanded", t.o = l), x !== t.i && v(i, "aria-controls", t.i = x), s !== t.n && v(i, "aria-haspopup", t.n = s), C !== t.s && v(i, "role", t.s = C), y !== t.h && v(i, "tabindex", t.h = y), n !== t.r && A(h, t.r = n), c !== t.d && A(f, t.d = c), t;
175
178
  }, {
176
179
  e: void 0,
177
180
  t: void 0,
@@ -10,6 +10,8 @@ export interface FloatingWindowProps {
10
10
  title?: string;
11
11
  /** Decorative identity icon beside the title; excluded from the accessible name. */
12
12
  titleIcon?: JSX.Element;
13
+ /** Interactive identity content replacing the visible title. Keep title set for accessibility. */
14
+ titleContent?: JSX.Element;
13
15
  /** Compact actions at the right of the title bar, before the window controls. */
14
16
  headerActions?: JSX.Element;
15
17
  /** Window content */