@floegence/floe-webapp-core 0.90.1 → 0.90.2

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,22 +1,22 @@
1
- import { createComponent as g, spread as ye, mergeProps as pe, insert as h, effect as I, className as A, setAttribute as f, setStyleProperty as L, memo as Ce, use as ke, template as S, delegateEvents as qe } from "solid-js/web";
2
- import { splitProps as Ie, Show as B, createSignal as z, untrack as Q, createEffect as q, onCleanup as xe } from "solid-js";
1
+ import { createComponent as g, spread as Ce, mergeProps as ke, insert as h, effect as x, className as S, setAttribute as f, setStyleProperty as J, memo as ge, use as me, template as I, delegateEvents as Fe } from "solid-js/web";
2
+ import { splitProps as ye, Show as A, createSignal as N, untrack as Q, createEffect as W, onCleanup as we } from "solid-js";
3
3
  import { cn as b } from "../../utils/cn.js";
4
- import { deferAfterPaint as E } from "../../utils/defer.js";
5
- import { KeyedFor as je } from "./KeyedFor.js";
6
- import { createUIFirstSelection as Ge } from "../../utils/uiFirstSelection.js";
7
- import { useViewActivation as Ue } from "../../context/ViewActivationContext.js";
8
- import { X as Ve, Plus as Xe, ChevronRight as Ke } from "../icons/index.js";
9
- import { createTabReorder as Ye } from "./tabReorder.js";
10
- var Je = /* @__PURE__ */ S('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="m15 18-6-6 6-6">'), Z = /* @__PURE__ */ S("<button type=button data-floe-interactive=icon>"), Qe = /* @__PURE__ */ S("<div>"), Ze = /* @__PURE__ */ S('<button type=button data-floe-interactive=icon aria-label="Add new tab">'), _e = /* @__PURE__ */ S("<div><div role=tablist data-floe-surface=inset data-floe-surface-part=tab-rail aria-orientation=horizontal>"), et = /* @__PURE__ */ S("<span class=flex-shrink-0>"), tt = /* @__PURE__ */ S('<div role=tab data-floe-surface-part=tab data-floe-interactive=item style=user-select:none;-webkit-user-select:none><span class="min-w-0 truncate max-w-32">'), rt = /* @__PURE__ */ S("<div role=tabpanel>");
4
+ import { deferAfterPaint as T } from "../../utils/defer.js";
5
+ import { KeyedFor as Oe } from "./KeyedFor.js";
6
+ import { createUIFirstSelection as We } from "../../utils/uiFirstSelection.js";
7
+ import { useViewActivation as qe } from "../../context/ViewActivationContext.js";
8
+ import { X as je, Plus as Ge, ChevronRight as Ue } from "../icons/index.js";
9
+ import { createTabReorder as Ve } from "./tabReorder.js";
10
+ var Xe = /* @__PURE__ */ I('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="m15 18-6-6 6-6">'), Z = /* @__PURE__ */ I("<button type=button data-floe-interactive=icon>"), Ke = /* @__PURE__ */ I("<div>"), Ye = /* @__PURE__ */ I('<button type=button data-floe-interactive=icon aria-label="Add new tab">'), Je = /* @__PURE__ */ I("<div><div role=tablist data-floe-surface=inset data-floe-surface-part=tab-rail aria-orientation=horizontal>"), Qe = /* @__PURE__ */ I("<span class=flex-shrink-0>"), Ze = /* @__PURE__ */ I('<div role=tab data-floe-surface-part=tab data-floe-interactive=item style=user-select:none;-webkit-user-select:none><span class="min-w-0 truncate max-w-32">'), _e = /* @__PURE__ */ I("<div role=tabpanel>");
11
11
  const _ = {
12
12
  x: 0,
13
13
  width: 0,
14
14
  visible: !1
15
15
  };
16
- function ot(i, t, m) {
17
- const d = i.filter((x) => !x.disabled);
16
+ function et(i, t, m) {
17
+ const d = i.filter((y) => !y.disabled);
18
18
  if (!d.length) return null;
19
- const k = d.findIndex((x) => x.id === t);
19
+ const k = d.findIndex((y) => y.id === t);
20
20
  if (k < 0) return null;
21
21
  let w = null;
22
22
  switch (m) {
@@ -39,10 +39,10 @@ function ot(i, t, m) {
39
39
  }
40
40
  return d[w]?.id ?? null;
41
41
  }
42
- function nt(i) {
42
+ function tt(i) {
43
43
  return i === 1 || i === 2 || i === 3 || i === 4 ? i : 2;
44
44
  }
45
- function at(i) {
45
+ function rt(i) {
46
46
  switch (i) {
47
47
  case 1:
48
48
  return {
@@ -66,7 +66,7 @@ function at(i) {
66
66
  };
67
67
  }
68
68
  }
69
- function st(i) {
69
+ function ot(i) {
70
70
  switch (i) {
71
71
  case "border":
72
72
  return {
@@ -85,11 +85,11 @@ function st(i) {
85
85
  };
86
86
  }
87
87
  }
88
- const lt = (i) => (() => {
89
- var t = Je();
90
- return I(() => f(t, "class", i.class)), t;
88
+ const nt = (i) => (() => {
89
+ var t = Xe();
90
+ return x(() => f(t, "class", i.class)), t;
91
91
  })();
92
- function it(i) {
92
+ function at(i) {
93
93
  const {
94
94
  container: t,
95
95
  tab: m
@@ -100,160 +100,160 @@ function it(i) {
100
100
  width: k,
101
101
  visible: k > 0
102
102
  };
103
- const w = t.getBoundingClientRect(), x = m.getBoundingClientRect(), D = t.offsetWidth || t.clientWidth, M = w.width > 0 && D > 0 ? w.width / D : 1, H = Number.isFinite(M) && M > 0 ? M : 1, P = x.width / H;
103
+ const w = t.getBoundingClientRect(), y = m.getBoundingClientRect(), z = t.offsetWidth || t.clientWidth, R = w.width > 0 && z > 0 ? w.width / z : 1, E = Number.isFinite(R) && R > 0 ? R : 1, D = y.width / E;
104
104
  return {
105
- x: (x.left - w.left + t.scrollLeft) / H,
106
- width: P,
107
- visible: P > 0
105
+ x: (y.left - w.left + t.scrollLeft) / E,
106
+ width: D,
107
+ visible: D > 0
108
108
  };
109
109
  }
110
- function wt(i) {
111
- const [t, m] = Ie(i, ["items", "activeId", "defaultActiveId", "onChange", "onActiveIdChange", "onClose", "onAdd", "onReorder", "showAdd", "closable", "size", "features", "slotClassNames", "ariaLabel", "labels", "class"]), d = () => t.features?.indicator?.mode ?? "activeBorder", k = () => nt(t.features?.indicator?.thicknessPx), w = () => t.features?.indicator?.colorToken ?? "primary", x = () => t.features?.indicator?.animated ?? !0, D = () => t.features?.containerBorder ?? !0, M = () => t.features?.scrollButtons ?? "auto", H = () => t.features?.closeButton?.dangerHover ?? !0, P = () => t.features?.closeButton?.enabledByDefault ?? t.closable ?? !1, Se = () => t.features?.addButton?.enabled ?? t.showAdd ?? !1, ee = () => at(k()), te = () => st(w());
110
+ function bt(i) {
111
+ const [t, m] = ye(i, ["items", "activeId", "defaultActiveId", "onChange", "onActiveIdChange", "onClose", "onAdd", "onReorder", "showAdd", "closable", "size", "features", "slotClassNames", "ariaLabel", "labels", "class"]), d = () => t.features?.indicator?.mode ?? "activeBorder", k = () => tt(t.features?.indicator?.thicknessPx), w = () => t.features?.indicator?.colorToken ?? "primary", y = () => t.features?.indicator?.animated ?? !0, z = () => t.features?.containerBorder ?? !0, R = () => t.features?.scrollButtons ?? "auto", E = () => t.features?.closeButton?.dangerHover ?? !0, D = () => t.features?.closeButton?.enabledByDefault ?? t.closable ?? !1, pe = () => t.features?.addButton?.enabled ?? t.showAdd ?? !1, ee = () => rt(k()), te = () => ot(w());
112
112
  let u;
113
113
  const re = (() => {
114
114
  try {
115
- return Ue();
115
+ return qe();
116
116
  } catch {
117
117
  return null;
118
118
  }
119
- })(), R = () => re ? re.active() : !0;
120
- let j = !1;
121
- const [$, G] = z(_), y = /* @__PURE__ */ new Map(), p = Ye({
119
+ })(), B = () => re ? re.active() : !0;
120
+ let q = !1;
121
+ const [$, j] = N(_), p = /* @__PURE__ */ new Map(), H = Ve({
122
122
  items: () => t.items,
123
123
  onReorder: () => t.onReorder,
124
124
  container: () => u,
125
- elements: y
125
+ elements: p
126
126
  });
127
- let U = !1;
128
- const F = () => d() === "slider", oe = (n) => {
129
- if (!u || !F()) return !1;
130
- const s = y.get(n);
131
- if (!s) return !1;
132
- const l = it({
127
+ let G = !1;
128
+ const P = () => d() === "slider", oe = (n) => {
129
+ if (!u || !P()) return !1;
130
+ const a = p.get(n);
131
+ if (!a) return !1;
132
+ const l = at({
133
133
  container: u,
134
- tab: s
134
+ tab: a
135
135
  });
136
- return G(l), l.visible;
137
- }, Ae = () => {
138
- if (!F()) {
139
- G(_);
136
+ return j(l), l.visible;
137
+ }, xe = () => {
138
+ if (!P()) {
139
+ j(_);
140
140
  return;
141
141
  }
142
- oe(X()) || G(_);
143
- }, O = () => {
144
- U || (U = !0, E(() => {
145
- U = !1, Q(() => {
146
- R() && Ae();
142
+ oe(V()) || j(_);
143
+ }, F = () => {
144
+ G || (G = !0, T(() => {
145
+ G = !1, Q(() => {
146
+ B() && xe();
147
147
  });
148
148
  }));
149
- }, ne = () => t.activeId !== void 0, Be = () => t.onChange ?? t.onActiveIdChange, [Re, Le] = z(Q(() => t.defaultActiveId ?? t.items[0]?.id ?? "")), V = () => ne() ? t.activeId : Re(), ae = Ge({
150
- committed: V,
149
+ }, ne = () => t.activeId !== void 0, Ie = () => t.onChange ?? t.onActiveIdChange, [Se, Ae] = N(Q(() => t.defaultActiveId ?? t.items[0]?.id ?? "")), U = () => ne() ? t.activeId : Se(), ae = We({
150
+ committed: U,
151
151
  commit: (n) => {
152
- ne() || Le(n), Be()?.(n);
152
+ ne() || Ae(n), Ie()?.(n);
153
153
  }
154
- }), X = ae.visual;
155
- q(() => {
156
- R() && (d(), X(), O());
154
+ }), V = ae.visual;
155
+ W(() => {
156
+ B() && (d(), V(), F());
157
157
  });
158
- const [K, Me] = z(!1), [Y, Ne] = z(!1), [Te, ze] = z(!1), se = () => M() === "auto" && Te(), Ee = () => {
158
+ const [X, Be] = N(!1), [K, Re] = N(!1), [Le, Me] = N(!1), se = () => R() === "auto" && Le(), Ne = () => {
159
159
  if (!u) return;
160
160
  const {
161
161
  scrollLeft: n,
162
- scrollWidth: s,
162
+ scrollWidth: a,
163
163
  clientWidth: l
164
- } = u, e = s > l;
165
- ze(e), Me(n > 0), Ne(n + l < s - 1);
166
- }, W = () => {
167
- j || (j = !0, E(() => {
168
- j = !1, R() && Ee();
164
+ } = u, e = a > l;
165
+ Me(e), Be(n > 0), Re(n + l < a - 1);
166
+ }, O = () => {
167
+ q || (q = !0, T(() => {
168
+ q = !1, B() && Ne();
169
169
  }));
170
- }, De = () => {
170
+ }, Te = () => {
171
171
  u && u.scrollBy({
172
172
  left: -150,
173
173
  behavior: "smooth"
174
174
  });
175
- }, He = () => {
175
+ }, ze = () => {
176
176
  u && u.scrollBy({
177
177
  left: 150,
178
178
  behavior: "smooth"
179
179
  });
180
180
  };
181
- q(() => {
182
- if (!u || !R()) return;
183
- W(), O();
184
- const n = () => W();
181
+ W(() => {
182
+ if (!u || !B()) return;
183
+ O(), F();
184
+ const n = () => O();
185
185
  u.addEventListener("scroll", n);
186
- const s = () => {
187
- W(), O();
186
+ const a = () => {
187
+ O(), F();
188
188
  };
189
189
  let l;
190
- typeof ResizeObserver < "u" ? (l = new ResizeObserver(s), l.observe(u)) : typeof window < "u" && window.addEventListener("resize", s), xe(() => {
191
- u?.removeEventListener("scroll", n), l?.disconnect(), typeof window < "u" && window.removeEventListener("resize", s);
190
+ typeof ResizeObserver < "u" ? (l = new ResizeObserver(a), l.observe(u)) : typeof window < "u" && window.addEventListener("resize", a), we(() => {
191
+ u?.removeEventListener("scroll", n), l?.disconnect(), typeof window < "u" && window.removeEventListener("resize", a);
192
192
  });
193
- }), q(() => {
194
- const n = V();
195
- E(() => {
196
- R() && y.get(n)?.scrollIntoView?.({
193
+ }), W(() => {
194
+ const n = U();
195
+ T(() => {
196
+ B() && p.get(n)?.scrollIntoView?.({
197
197
  block: "nearest",
198
198
  inline: "nearest"
199
199
  });
200
200
  });
201
- }), q(() => {
202
- R() && (t.items.length, W(), O());
201
+ }), W(() => {
202
+ B() && (t.items.length, O(), F());
203
203
  });
204
- const J = (n, s) => {
205
- s || (ae.request(n), F() && oe(n));
206
- }, Pe = (n) => {
207
- const s = t.items.find((e) => e.id === n);
208
- if (!s) return;
209
- J(s.id, s.disabled);
210
- const l = y.get(s.id);
204
+ const Y = (n, a) => {
205
+ a || (ae.request(n), P() && oe(n));
206
+ }, Ee = (n) => {
207
+ const a = t.items.find((e) => e.id === n);
208
+ if (!a) return;
209
+ Y(a.id, a.disabled);
210
+ const l = p.get(a.id);
211
211
  l?.focus({
212
212
  preventScroll: !0
213
213
  }), l?.scrollIntoView({
214
214
  block: "nearest",
215
215
  inline: "nearest"
216
216
  });
217
- }, $e = (n, s) => {
218
- const l = ot(t.items, s.id, n.key);
219
- l && (n.preventDefault(), Pe(l));
217
+ }, De = (n, a) => {
218
+ const l = et(t.items, a.id, n.key);
219
+ l && (n.preventDefault(), Ee(l));
220
220
  }, le = (n) => {
221
- const l = !!y.get(n)?.contains(document.activeElement), e = t.items.findIndex((o) => o.id === n);
221
+ const l = !!p.get(n)?.contains(document.activeElement), e = t.items.findIndex((o) => o.id === n);
222
222
  if (t.onClose?.(n), l && !t.items.some((o) => o.id === n)) {
223
- const o = t.items.find((c) => c.id === V()) ?? t.items[Math.min(e, t.items.length - 1)];
224
- o && y.get(o.id)?.focus({
223
+ const o = t.items.find((c) => c.id === U()) ?? t.items[Math.min(e, t.items.length - 1)];
224
+ o && p.get(o.id)?.focus({
225
225
  preventScroll: !0
226
226
  });
227
227
  }
228
- }, Fe = (n, s) => {
228
+ }, $e = (n, a) => {
229
229
  if (n.stopPropagation(), !t.onClose) return;
230
- const e = s;
231
- E(() => Q(() => le(e)));
232
- }, Oe = {
230
+ const e = a;
231
+ T(() => Q(() => le(e)));
232
+ }, He = {
233
233
  sm: "h-[var(--floe-control-height-sm)] px-[var(--floe-control-padding-sm)]",
234
234
  md: "h-[var(--floe-control-height-md)] px-[var(--floe-control-padding-md)]"
235
- }, We = (n, s) => {
236
- const l = b("relative inline-flex items-center gap-1.5 whitespace-nowrap select-none", "text-[length:var(--floe-type-control)] leading-[var(--floe-line-control)]"), e = s ? "cursor-not-allowed opacity-50" : "cursor-pointer", o = () => {
235
+ }, Pe = (n, a) => {
236
+ const l = b("relative inline-flex items-center gap-1.5 whitespace-nowrap select-none", "text-[length:var(--floe-type-control)] leading-[var(--floe-line-control)]"), e = a ? "cursor-not-allowed opacity-50" : "cursor-pointer", o = () => {
237
237
  const c = d();
238
238
  return c === "none" || c === "slider" && $().visible ? "" : b("after:pointer-events-none after:absolute after:bottom-0 after:inset-x-2 after:rounded-full after:content-['']", ee().tabMarkerClass, te().tabMarkerClass);
239
239
  };
240
240
  return b(
241
241
  l,
242
242
  e,
243
- Oe[t.size ?? "md"],
243
+ He[t.size ?? "md"],
244
244
  "rounded-control",
245
245
  "border",
246
246
  /* The selected face is painted by the surface layer (`data-floe-surface`
247
247
  * plus `aria-selected`), which keeps the fill, hairline and first
248
248
  * elevation step identical to every other selected control. */
249
249
  n ? b(o(), "text-foreground", t.slotClassNames?.tabActive) : b("border-transparent text-[var(--floe-ink-soft)]", t.slotClassNames?.tabInactive),
250
- s && "opacity-50",
250
+ a && "opacity-50",
251
251
  t.slotClassNames?.tab
252
252
  );
253
253
  };
254
254
  return (() => {
255
- var n = _e(), s = n.firstChild;
256
- ye(n, pe({
255
+ var n = Je(), a = n.firstChild;
256
+ Ce(n, ke({
257
257
  get class() {
258
258
  return b(
259
259
  /* One strip, one baseline: the rail, the scroll buttons and the add
@@ -263,101 +263,101 @@ function wt(i) {
263
263
  * control. */
264
264
  "relative flex items-stretch",
265
265
  t.size === "sm" ? "min-h-[var(--floe-control-height-sm)]" : "min-h-[var(--floe-control-height-md)]",
266
- D() && "border-b border-[var(--floe-line)]",
266
+ z() && "border-b border-[var(--floe-line)]",
267
267
  t.slotClassNames?.root,
268
268
  t.class
269
269
  );
270
270
  }
271
- }, m), !1, !0), h(n, g(B, {
271
+ }, m), !1, !0), h(n, g(A, {
272
272
  get when() {
273
273
  return se();
274
274
  },
275
275
  get children() {
276
276
  var e = Z();
277
- return e.$$click = De, h(e, g(lt, {
277
+ return e.$$click = Te, h(e, g(nt, {
278
278
  class: "w-4 h-4"
279
- })), I((o) => {
280
- var c = !K(), a = b("flex-shrink-0 flex items-center justify-center", "w-6 rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "transition-opacity duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", K() ? "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] opacity-100" : "opacity-0 pointer-events-none", t.slotClassNames?.scrollButton), v = t.labels?.scrollLeft ?? "Scroll left";
281
- return c !== o.e && (e.disabled = o.e = c), a !== o.t && A(e, o.t = a), v !== o.a && f(e, "aria-label", o.a = v), o;
279
+ })), x((o) => {
280
+ var c = !X(), s = b("flex-shrink-0 flex items-center justify-center", "w-6 rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "transition-opacity duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", X() ? "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] opacity-100" : "opacity-0 pointer-events-none", t.slotClassNames?.scrollButton), v = t.labels?.scrollLeft ?? "Scroll left";
281
+ return c !== o.e && (e.disabled = o.e = c), s !== o.t && S(e, o.t = s), v !== o.a && f(e, "aria-label", o.a = v), o;
282
282
  }, {
283
283
  e: void 0,
284
284
  t: void 0,
285
285
  a: void 0
286
286
  }), e;
287
287
  }
288
- }), s);
288
+ }), a);
289
289
  var l = u;
290
- return typeof l == "function" ? ke(l, s) : u = s, h(s, g(B, {
290
+ return typeof l == "function" ? me(l, a) : u = a, h(a, g(A, {
291
291
  get when() {
292
- return Ce(() => !!F())() && $().visible;
292
+ return ge(() => !!P())() && $().visible;
293
293
  },
294
294
  get children() {
295
- var e = Qe();
296
- return I((o) => {
297
- var c = b("pointer-events-none absolute bottom-0 left-0 z-10", ee().sliderHeightClass, te().sliderBgClass, x() ? "transition-[transform,width] duration-[var(--floe-duration-base)] ease-out motion-reduce:transition-none" : "transition-none", "will-change-transform", t.slotClassNames?.indicator), a = `translate3d(${$().x}px, 0, 0)`, v = `${$().width}px`;
298
- return c !== o.e && A(e, o.e = c), a !== o.t && L(e, "transform", o.t = a), v !== o.a && L(e, "width", o.a = v), o;
295
+ var e = Ke();
296
+ return x((o) => {
297
+ var c = b("pointer-events-none absolute bottom-0 left-0 z-10", ee().sliderHeightClass, te().sliderBgClass, y() ? "transition-[transform,width] duration-[var(--floe-duration-base)] ease-out motion-reduce:transition-none" : "transition-none", "will-change-transform", t.slotClassNames?.indicator), s = `translate3d(${$().x}px, 0, 0)`, v = `${$().width}px`;
298
+ return c !== o.e && S(e, o.e = c), s !== o.t && J(e, "transform", o.t = s), v !== o.a && J(e, "width", o.a = v), o;
299
299
  }, {
300
300
  e: void 0,
301
301
  t: void 0,
302
302
  a: void 0
303
303
  }), e;
304
304
  }
305
- }), null), h(s, g(je, {
305
+ }), null), h(a, g(Oe, {
306
306
  get each() {
307
307
  return t.items;
308
308
  },
309
309
  by: (e) => e.id,
310
310
  children: (e) => {
311
- const o = () => e().id === X(), c = () => e().closable ?? P();
311
+ const o = () => e().id === V(), c = () => e().closable ?? D();
312
312
  return (() => {
313
- var a = tt(), v = a.firstChild;
314
- return a.$$keydown = (r) => {
315
- if (r.target === r.currentTarget && !p.keyDown(r, e())) {
313
+ var s = Ze(), v = s.firstChild;
314
+ return s.$$keydown = (r) => {
315
+ if (r.target === r.currentTarget && !H.keyDown(r, e())) {
316
316
  if (r.key === "Delete" && c() && !e().disabled) {
317
317
  r.preventDefault(), le(e().id);
318
318
  return;
319
319
  }
320
320
  if (r.key === "Enter" || r.key === " ") {
321
- r.preventDefault(), J(e().id, e().disabled);
321
+ r.preventDefault(), Y(e().id, e().disabled);
322
322
  return;
323
323
  }
324
- $e(r, e());
324
+ De(r, e());
325
325
  }
326
- }, a.addEventListener("dragstart", (r) => r.preventDefault()), a.$$pointerdown = (r) => p.start(r, e()), a.$$click = (r) => {
327
- if (p.suppressClick()) {
326
+ }, s.addEventListener("dragstart", (r) => r.preventDefault()), s.$$pointerdown = (r) => H.start(r, e()), s.$$click = (r) => {
327
+ if (H.suppressClick()) {
328
328
  r.preventDefault(), r.stopPropagation();
329
329
  return;
330
330
  }
331
- J(e().id, e().disabled);
332
- }, ke((r) => {
333
- y.set(e().id, r), xe(() => y.delete(e().id));
334
- }, a), h(a, g(B, {
331
+ Y(e().id, e().disabled);
332
+ }, me((r) => {
333
+ p.set(e().id, r), we(() => p.delete(e().id));
334
+ }, s), h(s, g(A, {
335
335
  get when() {
336
336
  return e().icon;
337
337
  },
338
338
  get children() {
339
- var r = et();
339
+ var r = Qe();
340
340
  return h(r, () => e().icon), r;
341
341
  }
342
- }), v), h(v, () => e().label), h(a, g(B, {
342
+ }), v), h(v, () => e().label), h(s, g(A, {
343
343
  get when() {
344
- return Ce(() => !!c())() && !e().disabled;
344
+ return ge(() => !!c())() && !e().disabled;
345
345
  },
346
346
  get children() {
347
347
  var r = Z();
348
- return r.$$click = (C) => Fe(C, e().id), h(r, g(Ve, {
348
+ return r.$$click = (C) => $e(C, e().id), h(r, g(je, {
349
349
  class: "w-3 h-3"
350
- })), I((C) => {
351
- var N = b("flex-shrink-0 flex items-center justify-center", "w-5 h-5 rounded-control cursor-pointer", "bg-transparent text-[var(--floe-ink-quiet)]", H() ? "hover:bg-error hover:text-error-foreground" : "hover:bg-[var(--floe-state-hover)]", "ml-1.5", t.slotClassNames?.closeButton), T = e().closeLabel ?? `Close ${e().label}`;
352
- return N !== C.e && A(r, C.e = N), T !== C.t && f(r, "aria-label", C.t = T), C;
350
+ })), x((C) => {
351
+ var L = b("flex-shrink-0 flex items-center justify-center", "w-5 h-5 rounded-control cursor-pointer", "bg-transparent text-[var(--floe-ink-quiet)]", E() ? "hover:bg-error hover:text-error-foreground" : "hover:bg-[var(--floe-state-hover)]", "ml-1.5", t.slotClassNames?.closeButton), M = e().closeLabel ?? `Close ${e().label}`;
352
+ return L !== C.e && S(r, C.e = L), M !== C.t && f(r, "aria-label", C.t = M), C;
353
353
  }, {
354
354
  e: void 0,
355
355
  t: void 0
356
356
  }), r;
357
357
  }
358
- }), null), I((r) => {
359
- var C = We(o(), e().disabled), N = e().id, T = p.dragging() === e().id ? "true" : void 0, ie = t.onReorder ? "none" : "pan-x", ce = p.dragging() === e().id ? "0.55" : void 0, de = p.dragging() ? "grabbing" : void 0, fe = p.before() === e().id ? "-2px 0 0 var(--floe-accent-ink)" : p.after() === e().id ? "2px 0 0 var(--floe-accent-ink)" : void 0, ue = e().domId, ve = e().panelId, he = e().title, be = o() ? "raised" : "flat", ge = o(), me = e().disabled, we = e().disabled ? -1 : o() ? 0 : -1;
360
- return C !== r.e && A(a, r.e = C), N !== r.t && f(a, "data-floe-tab-id", r.t = N), T !== r.a && f(a, "data-floe-tab-dragging", r.a = T), ie !== r.o && L(a, "touch-action", r.o = ie), ce !== r.i && L(a, "opacity", r.i = ce), de !== r.n && L(a, "cursor", r.n = de), fe !== r.s && L(a, "box-shadow", r.s = fe), ue !== r.h && f(a, "id", r.h = ue), ve !== r.r && f(a, "aria-controls", r.r = ve), he !== r.d && f(a, "title", r.d = he), be !== r.l && f(a, "data-floe-surface", r.l = be), ge !== r.u && f(a, "aria-selected", r.u = ge), me !== r.c && f(a, "aria-disabled", r.c = me), we !== r.w && f(a, "tabindex", r.w = we), r;
358
+ }), null), x((r) => {
359
+ var C = Pe(o(), e().disabled), L = e().id, M = H.dragging() === e().id ? "true" : void 0, ie = t.onReorder ? "none" : "pan-x", ce = e().domId, de = e().panelId, fe = e().title, ue = o() ? "raised" : "flat", ve = o(), he = e().disabled, be = e().disabled ? -1 : o() ? 0 : -1;
360
+ return C !== r.e && S(s, r.e = C), L !== r.t && f(s, "data-floe-tab-id", r.t = L), M !== r.a && f(s, "data-floe-tab-dragging", r.a = M), ie !== r.o && J(s, "touch-action", r.o = ie), ce !== r.i && f(s, "id", r.i = ce), de !== r.n && f(s, "aria-controls", r.n = de), fe !== r.s && f(s, "title", r.s = fe), ue !== r.h && f(s, "data-floe-surface", r.h = ue), ve !== r.r && f(s, "aria-selected", r.r = ve), he !== r.d && f(s, "aria-disabled", r.d = he), be !== r.l && f(s, "tabindex", r.l = be), r;
361
361
  }, {
362
362
  e: void 0,
363
363
  t: void 0,
@@ -369,54 +369,51 @@ function wt(i) {
369
369
  h: void 0,
370
370
  r: void 0,
371
371
  d: void 0,
372
- l: void 0,
373
- u: void 0,
374
- c: void 0,
375
- w: void 0
376
- }), a;
372
+ l: void 0
373
+ }), s;
377
374
  })();
378
375
  }
379
- }), null), h(n, g(B, {
376
+ }), null), h(n, g(A, {
380
377
  get when() {
381
- return Se();
378
+ return pe();
382
379
  },
383
380
  get children() {
384
- var e = Ze();
381
+ var e = Ye();
385
382
  return e.$$click = () => {
386
383
  const o = t.onAdd;
387
- o && E(() => o());
388
- }, h(e, g(Xe, {
384
+ o && T(() => o());
385
+ }, h(e, g(Ge, {
389
386
  get class() {
390
387
  return t.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4";
391
388
  }
392
- })), I(() => A(e, b("flex-shrink-0 flex items-center justify-center", "rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] hover:text-foreground", t.size === "sm" ? "w-7" : "w-8", t.slotClassNames?.addButton))), e;
389
+ })), x(() => S(e, b("flex-shrink-0 flex items-center justify-center", "rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] hover:text-foreground", t.size === "sm" ? "w-7" : "w-8", t.slotClassNames?.addButton))), e;
393
390
  }
394
- }), null), h(n, g(B, {
391
+ }), null), h(n, g(A, {
395
392
  get when() {
396
393
  return se();
397
394
  },
398
395
  get children() {
399
396
  var e = Z();
400
- return e.$$click = He, h(e, g(Ke, {
397
+ return e.$$click = ze, h(e, g(Ue, {
401
398
  class: "w-4 h-4"
402
- })), I((o) => {
403
- var c = !Y(), a = b("flex-shrink-0 flex items-center justify-center", "w-6 rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "transition-opacity duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", Y() ? "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] opacity-100" : "opacity-0 pointer-events-none", t.slotClassNames?.scrollButton), v = t.labels?.scrollRight ?? "Scroll right";
404
- return c !== o.e && (e.disabled = o.e = c), a !== o.t && A(e, o.t = a), v !== o.a && f(e, "aria-label", o.a = v), o;
399
+ })), x((o) => {
400
+ var c = !K(), s = b("flex-shrink-0 flex items-center justify-center", "w-6 rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "transition-opacity duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", K() ? "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] opacity-100" : "opacity-0 pointer-events-none", t.slotClassNames?.scrollButton), v = t.labels?.scrollRight ?? "Scroll right";
401
+ return c !== o.e && (e.disabled = o.e = c), s !== o.t && S(e, o.t = s), v !== o.a && f(e, "aria-label", o.a = v), o;
405
402
  }, {
406
403
  e: void 0,
407
404
  t: void 0,
408
405
  a: void 0
409
406
  }), e;
410
407
  }
411
- }), null), I((e) => {
408
+ }), null), x((e) => {
412
409
  var o = b(
413
410
  "relative flex-1 flex items-center gap-0.5 overflow-x-auto",
414
411
  "scrollbar-none",
415
412
  // Hide scrollbar for all browsers
416
413
  "[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",
417
414
  t.slotClassNames?.scrollContainer
418
- ), c = K() ? "" : void 0, a = Y() ? "" : void 0, v = t.ariaLabel;
419
- return o !== e.e && A(s, e.e = o), c !== e.t && f(s, "data-floe-overflow-start", e.t = c), a !== e.a && f(s, "data-floe-overflow-end", e.a = a), v !== e.o && f(s, "aria-label", e.o = v), e;
415
+ ), c = X() ? "" : void 0, s = K() ? "" : void 0, v = t.ariaLabel;
416
+ return o !== e.e && S(a, e.e = o), c !== e.t && f(a, "data-floe-overflow-start", e.t = c), s !== e.a && f(a, "data-floe-overflow-end", e.a = s), v !== e.o && f(a, "aria-label", e.o = v), e;
420
417
  }, {
421
418
  e: void 0,
422
419
  t: void 0,
@@ -425,15 +422,15 @@ function wt(i) {
425
422
  }), n;
426
423
  })();
427
424
  }
428
- function Ct(i) {
429
- const [t, m] = Ie(i, ["active", "keepMounted", "labelledBy", "class", "children"]);
430
- return g(B, {
425
+ function gt(i) {
426
+ const [t, m] = ye(i, ["active", "keepMounted", "labelledBy", "class", "children"]);
427
+ return g(A, {
431
428
  get when() {
432
429
  return t.keepMounted || t.active;
433
430
  },
434
431
  get children() {
435
- var d = rt();
436
- return ye(d, pe({
432
+ var d = _e();
433
+ return Ce(d, ke({
437
434
  get "aria-labelledby"() {
438
435
  return t.labelledBy;
439
436
  },
@@ -450,9 +447,9 @@ function Ct(i) {
450
447
  }
451
448
  });
452
449
  }
453
- qe(["click", "pointerdown", "keydown"]);
450
+ Fe(["click", "pointerdown", "keydown"]);
454
451
  export {
455
- Ct as TabPanel,
456
- wt as Tabs,
457
- ot as resolveTabNavigationTargetId
452
+ gt as TabPanel,
453
+ bt as Tabs,
454
+ et as resolveTabNavigationTargetId
458
455
  };
@@ -2,7 +2,7 @@ type Item = {
2
2
  id: string;
3
3
  disabled?: boolean;
4
4
  };
5
- /** A drag proposes an insertion; only a completed drop changes host-owned order. */
5
+ /** Preview order with transforms; only a completed drop changes host-owned order. */
6
6
  export declare function createTabReorder(options: {
7
7
  items: () => Item[];
8
8
  onReorder: () => ((ids: string[]) => void) | undefined;
@@ -12,8 +12,6 @@ export declare function createTabReorder(options: {
12
12
  start: (event: PointerEvent, item: Item) => void;
13
13
  keyDown: (event: KeyboardEvent, item: Item) => boolean;
14
14
  dragging: import("solid-js").Accessor<string | undefined>;
15
- before: import("solid-js").Accessor<string | undefined>;
16
- after: import("solid-js").Accessor<string | undefined>;
17
15
  suppressClick: () => boolean;
18
16
  };
19
17
  export {};