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