fiboui 2.8.2 → 2.8.4

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.
package/dist/structure.js CHANGED
@@ -1,5 +1,5 @@
1
- import { au as r, aw as e, av as o } from "./client-BISJTJUX.js";
2
- import { A as C, B as d, C as i, c as l, d as n, G as T, b as f, L as m, P as p, T as x, a as B } from "./index-C2EZ1rgJ.js";
1
+ import { ay as r, aA as e, az as o } from "./client-DOrZXJAN.js";
2
+ import { A as C, B as d, C as i, c as l, d as n, G as T, b as f, L as m, P as p, T as x, a as A } from "./index-uks8jtfK.js";
3
3
  export {
4
4
  C as AssetCard,
5
5
  d as Banner,
@@ -14,5 +14,5 @@ export {
14
14
  m as ListTile,
15
15
  p as ProfileCard,
16
16
  x as Table,
17
- B as Tags
17
+ A as Tags
18
18
  };
package/dist/theme.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aL as s, aF as m, aN as h, aI as T, aO as o, aH as t, aK as r, aM as i, aS as l, aR as n, aP as F, aQ as b, aG as p, aJ as u } from "./client-BISJTJUX.js";
1
+ import { aP as s, aJ as m, aR as h, aM as T, aS as o, aL as t, aO as r, aQ as i, aW as l, aV as n, aT as b, aU as p, aK as u, aN as C } from "./client-DOrZXJAN.js";
2
2
  export {
3
3
  s as FIBO_THEMES,
4
4
  m as FiboThemeProvider,
@@ -10,8 +10,8 @@ export {
10
10
  i as resolveTheme,
11
11
  l as themeClassName,
12
12
  n as themeToCssRule,
13
- F as themeToCssVars,
14
- b as themeToInlineStyle,
15
- p as useFiboTheme,
16
- u as webTheme
13
+ b as themeToCssVars,
14
+ p as themeToInlineStyle,
15
+ u as useFiboTheme,
16
+ C as webTheme
17
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiboui",
3
- "version": "2.8.2",
3
+ "version": "2.8.4",
4
4
  "description": "Flutter/SwiftUI-inspired React UI — fluent builders, signals, and themes. https://fiboui.vercel.app",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,302 +0,0 @@
1
- var O = Object.defineProperty;
2
- var L = (e, t, n) => t in e ? O(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var w = (e, t, n) => L(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { S as C, c as $, i as U, H as D, b1 as I, U as k, b2 as P, b3 as T, b4 as B } from "./client-BISJTJUX.js";
5
- import m, { useSyncExternalStore as V } from "react";
6
- function j() {
7
- return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `lst_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
8
- }
9
- function N(e) {
10
- return typeof e._id == "string" && e._id.length > 0;
11
- }
12
- function F(e) {
13
- return N(e) ? e : { ...e, _id: j() };
14
- }
15
- function M(e, t, n) {
16
- if (typeof n == "function")
17
- return n(e, t);
18
- if (e != null && typeof e == "object") {
19
- const r = e;
20
- return r._id != null && r._id === n || r.id != null && r.id === n;
21
- }
22
- return e === n;
23
- }
24
- function R(e, t) {
25
- if (typeof t == "function")
26
- return F({ ...t(e), _id: e._id });
27
- const { _id: n, ...r } = t;
28
- return { ...e, ...r, _id: e._id };
29
- }
30
- function W(e, t, n) {
31
- const r = e;
32
- return (n && n.length > 0 ? n.map((i) => r[i]) : Object.entries(r).filter(([i]) => i !== "_id").map(([, i]) => i)).some((i) => i == null ? !1 : typeof i == "string" || typeof i == "number" || typeof i == "boolean" ? String(i).toLowerCase().includes(t) : !1);
33
- }
34
- class z extends C {
35
- constructor(n = []) {
36
- const r = (Array.isArray(n) ? n : []).map((s) => F(s));
37
- super(r);
38
- w(this, "_$length");
39
- /** Full list. `.value` is this array, or a filtered slice while a view/filter is set. */
40
- w(this, "_source");
41
- w(this, "_query", "");
42
- w(this, "_keys");
43
- w(this, "_predicate");
44
- this._source = r, this.publish();
45
- }
46
- get value() {
47
- return super.value;
48
- }
49
- /**
50
- * Replaces the full list, then reapplies the current view.
51
- * In-place mutation of this array (`push` / `splice`) does not notify
52
- * and does not write the stored list — assign a new array or use
53
- * `add` / `update` / `remove`.
54
- */
55
- set value(n) {
56
- this._source = n.map((r) => F(r)), this.publish();
57
- }
58
- /** Push the visible rows. Always a copy so `.value.splice` cannot write `_source`. */
59
- publish() {
60
- const r = !!this._query || !!this._predicate ? this._source.filter((s, i) => !(this._query && !W(s, this._query, this._keys) || this._predicate && !this._predicate(s, i))) : this._source.slice();
61
- super.value = r;
62
- }
63
- get length() {
64
- return this.value.length;
65
- }
66
- /**
67
- * Reactive length for plain templates:
68
- * `Text(\`Total todos: ${todos.$length}\`)`
69
- *
70
- * Embeds a marker via `interp()`; `Text` resolves it on each update.
71
- * (`todos.length` is a plain number and still freezes — use `$length`.)
72
- */
73
- get $length() {
74
- return this._$length || (this._$length = $(() => this.value.length)), U(this._$length);
75
- }
76
- /** Replace the whole array (missing `_id`s are generated). */
77
- set(n) {
78
- return this.value = n.map((r) => F(r)), this;
79
- }
80
- clear() {
81
- return this.value = [], this;
82
- }
83
- /** Append items — each gets `_id` if not already set. Writes the full list. */
84
- add(...n) {
85
- return n.length === 0 ? this : (this.value = [...this._source, ...n.map((r) => F(r))], this);
86
- }
87
- /** Insert at index (clamped) in the full list. */
88
- insert(n, r) {
89
- const s = [...this._source], i = Math.max(0, Math.min(n, s.length));
90
- return s.splice(i, 0, F(r)), this.value = s, this;
91
- }
92
- /**
93
- * Patch by `_id` / `id` / predicate.
94
- * `patch` can be a partial object or a mapper.
95
- */
96
- update(n, r) {
97
- let s = !1;
98
- const i = this._source.map((a, c) => M(a, c, n) ? (s = !0, R(a, r)) : a);
99
- return s && (this.value = i), this;
100
- }
101
- /** Replace the first match (keeps original `_id` unless `item` already has one). */
102
- replace(n, r) {
103
- const s = this._source.findIndex((c, l) => M(c, l, n));
104
- if (s < 0) return this;
105
- const i = this._source[s], a = [...this._source];
106
- return a[s] = N(r) ? r : { ...r, _id: i._id }, this.value = a, this;
107
- }
108
- /** Remove by `_id` / `id` / predicate. Alias: `delete`. */
109
- remove(n) {
110
- const r = this._source.filter((s, i) => !M(s, i, n));
111
- return r.length !== this._source.length && (this.value = r), this;
112
- }
113
- delete(n) {
114
- return this.remove(n);
115
- }
116
- find(n) {
117
- return this._source.find((r, s) => M(r, s, n));
118
- }
119
- /**
120
- * Show only rows that match `query`. The full list stays stored.
121
- * `view('')` or `view()` shows every item again (does not clear `viewWhere`).
122
- * `keys` limits the match to those fields (`['text']`).
123
- */
124
- view(n = "", r) {
125
- return this._query = n.trim().toLowerCase(), this._keys = r, this.publish(), this;
126
- }
127
- /**
128
- * Live predicate on `publish()` (AND with `view`/`search` query).
129
- * `viewWhere()` with no fn (or `null`) clears it.
130
- */
131
- viewWhere(n) {
132
- return this._predicate = typeof n == "function" ? n : void 0, this.publish(), this;
133
- }
134
- /**
135
- * Same live view as `view()`, plus a copy of the visible rows.
136
- * Bound List/Table update; `const hits = todos.search('x')` still works.
137
- */
138
- search(n, r) {
139
- return this.view(n, r), [...this.value];
140
- }
141
- /**
142
- * One-shot snapshot of `_source` (Array.filter). Does not change `.value`.
143
- * Safe inside `computed(() => todos.filter(fn))`.
144
- * `todos.set(todos.filter(fn))` replaces the full list (clearDone).
145
- */
146
- filter(n) {
147
- return this._source.filter(n);
148
- }
149
- map(n) {
150
- return this._source.map(n);
151
- }
152
- move(n, r) {
153
- const s = [...this._source];
154
- if (n < 0 || n >= s.length) return this;
155
- const i = Math.max(0, Math.min(r, s.length - 1));
156
- if (n === i) return this;
157
- const [a] = s.splice(n, 1);
158
- return s.splice(i, 0, a), this.value = s, this;
159
- }
160
- }
161
- function H(e = []) {
162
- return new z(e);
163
- }
164
- const te = H, A = {
165
- linear: (e) => e,
166
- easeIn: (e) => e * e,
167
- easeOut: (e) => e * (2 - e),
168
- easeInOut: (e) => e < 0.5 ? 2 * e * e : -1 + (4 - 2 * e) * e
169
- };
170
- function G(e, t, n) {
171
- return e + (t - e) * n;
172
- }
173
- const h = /* @__PURE__ */ new WeakMap();
174
- function J() {
175
- return typeof requestAnimationFrame == "function";
176
- }
177
- function K() {
178
- return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
179
- }
180
- function Q(e) {
181
- const t = h.get(e);
182
- t != null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(t), h.delete(e);
183
- }
184
- C.prototype.spring = function(e, t = {}) {
185
- this.animate(e, { ...t, curve: "spring", damping: t.damping ?? 26, stiffness: t.stiffness ?? 170 });
186
- };
187
- C.prototype.animate = function(e, t = {}) {
188
- var p, f;
189
- const n = this.value, r = e;
190
- if (Q(this), !J() || K()) {
191
- this.value = r, (p = t.onComplete) == null || p.call(t);
192
- return;
193
- }
194
- if (t.curve === "spring") {
195
- const o = typeof t.stiffness == "number" && Number.isFinite(t.stiffness) && t.stiffness > 0 ? t.stiffness : 170, g = typeof t.damping == "number" && Number.isFinite(t.damping) && t.damping >= 0 ? t.damping : 26, _ = typeof t.mass == "number" && Number.isFinite(t.mass) && t.mass > 0 ? t.mass : 1;
196
- let y = n, v = typeof t.velocity == "number" && Number.isFinite(t.velocity) ? t.velocity : 0;
197
- const S = 1 / 60, x = () => {
198
- var b, u;
199
- const q = -o * (y - r) - g * v;
200
- if (v += q / _ * S, y += v * S, !Number.isFinite(y) || !Number.isFinite(v)) {
201
- this.value = r, h.delete(this), (b = t.onComplete) == null || b.call(t);
202
- return;
203
- }
204
- this.value = y, Math.abs(y - r) > 0.01 || Math.abs(v) > 0.01 ? h.set(this, requestAnimationFrame(x)) : (this.value = r, h.delete(this), (u = t.onComplete) == null || u.call(t));
205
- };
206
- h.set(this, requestAnimationFrame(x));
207
- return;
208
- }
209
- const s = t.duration, i = typeof s == "number" && Number.isFinite(s) && s > 0 ? s : s === void 0 ? 300 : 0;
210
- if (i === 0) {
211
- this.value = r, (f = t.onComplete) == null || f.call(t);
212
- return;
213
- }
214
- const a = A[t.curve || "easeOut"] ?? A.easeOut;
215
- let c = null;
216
- const l = (o) => {
217
- var _;
218
- c || (c = o);
219
- const g = Math.min((o - c) / i, 1);
220
- this.value = G(n, r, a(g)), g < 1 ? h.set(this, requestAnimationFrame(l)) : (h.delete(this), (_ = t.onComplete) == null || _.call(t));
221
- };
222
- h.set(this, requestAnimationFrame(l));
223
- };
224
- C.prototype.snapTo = function(e, t = {}) {
225
- this.animate(e, { duration: 300, curve: "easeOut", ...t });
226
- };
227
- function ne(e = {}) {
228
- return D(e.curve ?? "easeOut", {
229
- stiffness: e.stiffness,
230
- damping: e.damping,
231
- mass: e.mass
232
- });
233
- }
234
- function X(e, t = {}) {
235
- const { styles: n = !0, meta: r } = t, s = [], i = [];
236
- let a = "", c = 0, l = null, p = -1, f = null;
237
- const o = /* @__PURE__ */ new Set();
238
- function g(u) {
239
- const d = [];
240
- return typeof (r == null ? void 0 : r.title) == "string" && r.title.length > 0 && d.push(m.createElement("title", { key: "fibo-title" }, r.title)), typeof (r == null ? void 0 : r.description) == "string" && r.description.length > 0 && d.push(
241
- m.createElement("meta", {
242
- key: "fibo-description",
243
- name: "description",
244
- content: r.description
245
- })
246
- ), d.push(u), n && d.push(m.createElement(k)), m.createElement(m.Fragment, null, ...d);
247
- }
248
- function _() {
249
- f || (f = new P(y));
250
- let u;
251
- const d = T(s, i, () => {
252
- u = f.execute(() => I(e()));
253
- });
254
- return { tree: u, ...d.outcome };
255
- }
256
- function y() {
257
- const u = _();
258
- if (!(u.shape === a && !u.layout && B(i, u.slotCount))) {
259
- a = u.shape, c += 1, l = g(u.tree), p = c;
260
- for (const E of o) E();
261
- }
262
- }
263
- function v() {
264
- if (l && p === c) return l;
265
- const u = _();
266
- return a = u.shape, l = g(u.tree), p = c, l;
267
- }
268
- function S(u) {
269
- return o.add(u), () => {
270
- o.delete(u), o.size === 0 && f && (f.dispose(), f = null, l = null, p = -1);
271
- };
272
- }
273
- function x() {
274
- return c;
275
- }
276
- function q() {
277
- return 0;
278
- }
279
- function b() {
280
- return V(S, x, q), v();
281
- }
282
- return b.displayName = "FiboPage", r && (b.meta = r), b;
283
- }
284
- const re = X;
285
- function se(e) {
286
- return m.createElement(
287
- m.Fragment,
288
- null,
289
- I(e),
290
- m.createElement(k)
291
- );
292
- }
293
- export {
294
- z as L,
295
- ne as a,
296
- re as b,
297
- te as c,
298
- F as e,
299
- H as l,
300
- X as p,
301
- se as w
302
- };