fiboui 2.8.4 → 2.9.0

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/layout.js CHANGED
@@ -1,19 +1,23 @@
1
- import { C as r, a as s, H as e, L as l, b as t, S, Z as n } from "./index-CYMoWJMX.js";
2
- import { C as c, S as f } from "./index-C0qI47Zw.js";
3
- import { aa as m, a7 as b, a8 as d, a9 as p, ab as u } from "./client-DOrZXJAN.js";
1
+ import { C as e, a as o, L as s, b as l, S as t, Z as i } from "./index-FuD1J3Qo.js";
2
+ import { C as d, S as c } from "./index-BLEG6Nql.js";
3
+ import { ad as u, ai as C, ab as f, ah as m, a9 as b, aa as p, ae as w, ac as L, af as R, ag as V } from "./client-3NdKI2xE.js";
4
4
  export {
5
- r as Center,
6
- c as Column,
7
- s as Container,
8
- m as DashboardLayout,
9
- e as Header,
10
- l as Line,
5
+ e as Center,
6
+ d as Column,
7
+ o as Container,
8
+ u as DashboardLayout,
9
+ C as GeometryReader,
10
+ f as Header,
11
+ m as LayoutBuilder,
12
+ s as Line,
11
13
  b as Row,
12
- d as Scaffold,
13
- t as ScrollController,
14
- S as ScrollView,
15
- p as Sidebar,
16
- f as Spacer,
17
- u as VirtualColumn,
18
- n as ZStack
14
+ p as Scaffold,
15
+ l as ScrollController,
16
+ t as ScrollView,
17
+ w as ScrollViewReader,
18
+ L as Sidebar,
19
+ c as Spacer,
20
+ R as VirtualColumn,
21
+ V as VirtualRow,
22
+ i as ZStack
19
23
  };
@@ -1,24 +1,24 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import { bb as v, ba as w, bc as x, bd as E, be as R, bf as O, bg as P, bh as g, bi as $, bj as D, bk as z, aH as A, aI as H } from "./client-DOrZXJAN.js";
3
- import { useState as I, useMemo as K, lazy as M, Suspense as N } from "react";
2
+ import { be as v, bc as w, bf as x, bg as O, bh as R, bi as P, bj as E, bk as g, bl as $, bm as D, bn as z, aO as A, aP as K } from "./client-3NdKI2xE.js";
3
+ import { useState as M, useMemo as N, lazy as S, Suspense as j } from "react";
4
4
  function b(e) {
5
5
  const t = (typeof e == "string" ? e.trim() : "").split(/[?#]/, 1)[0];
6
6
  return !t || t === "/" ? "/" : t.startsWith("/") ? t : `/${t}`;
7
7
  }
8
- function S(e) {
8
+ function B(e) {
9
9
  let t = typeof e == "string" ? e.trim() : "", r = "";
10
10
  const a = t.indexOf("#");
11
11
  a >= 0 && (r = t.slice(a), t = t.slice(0, a));
12
12
  const s = t.indexOf("?");
13
13
  return { search: s >= 0 ? t.slice(s) : "", hash: r };
14
14
  }
15
- function j(e, n) {
16
- const { search: t, hash: r } = S(n), a = R(b(n), e);
17
- return `${O(e, a)}${t}${r}`;
15
+ function H(e, n) {
16
+ const { search: t, hash: r } = B(n), a = R(b(n), e);
17
+ return `${P(e, a)}${t}${r}`;
18
18
  }
19
- function B(e, n, t, r = "") {
19
+ function I(e, n, t, r = "") {
20
20
  const a = R(b(n), r), s = b(e);
21
- return a === "/" ? s === "/" : P(s, a, t).match;
21
+ return a === "/" ? s === "/" : E(s, a, t).match;
22
22
  }
23
23
  const W = ({
24
24
  to: e,
@@ -31,17 +31,17 @@ const W = ({
31
31
  target: i,
32
32
  download: o,
33
33
  rel: h,
34
- ...p
34
+ ...m
35
35
  }) => {
36
- const l = v(), m = w(e), y = !m && x(e), C = m ? void 0 : y ? e.trim() : j((l == null ? void 0 : l.basename) ?? "", e), k = i && String(i).toLowerCase() === "_blank" ? E(h, "noopener noreferrer") : h;
36
+ const l = v(), p = w(e), y = !p && x(e), C = p ? void 0 : y ? e.trim() : H((l == null ? void 0 : l.basename) ?? "", e), k = i && String(i).toLowerCase() === "_blank" ? O(h, "noopener noreferrer") : h;
37
37
  return /* @__PURE__ */ c(
38
38
  "a",
39
39
  {
40
- ...p,
40
+ ...m,
41
41
  href: C,
42
42
  onClick: (u) => {
43
43
  if (f == null || f(u), !u.defaultPrevented) {
44
- if (m) {
44
+ if (p) {
45
45
  u.preventDefault();
46
46
  return;
47
47
  }
@@ -66,17 +66,17 @@ const W = ({
66
66
  exact: f = !1,
67
67
  ...i
68
68
  }) => {
69
- const o = v(), h = !!o && B(
69
+ const o = v(), h = !!o && I(
70
70
  o.currentPath,
71
71
  e,
72
72
  f,
73
73
  o.basename
74
- ), p = h ? `${t} ${a}`.trim() : t, l = h ? { ...r, ...s } : r;
74
+ ), m = h ? `${t} ${a}`.trim() : t, l = h ? { ...r, ...s } : r;
75
75
  return /* @__PURE__ */ c(
76
76
  W,
77
77
  {
78
78
  to: e,
79
- className: p,
79
+ className: m,
80
80
  style: l,
81
81
  ...i,
82
82
  "aria-current": h ? "page" : void 0,
@@ -107,15 +107,15 @@ function L(e) {
107
107
  }
108
108
  function Q(e, n) {
109
109
  function t(r) {
110
- const [a, s] = I(0), f = K(
111
- () => M(() => L(e)),
110
+ const [a, s] = M(0), f = N(
111
+ () => S(() => L(e)),
112
112
  [a]
113
113
  );
114
114
  return /* @__PURE__ */ c(
115
115
  z,
116
116
  {
117
117
  fallback: (i) => /* @__PURE__ */ c(
118
- H,
118
+ K,
119
119
  {
120
120
  error: i,
121
121
  onReset: () => {
@@ -123,7 +123,7 @@ function Q(e, n) {
123
123
  }
124
124
  }
125
125
  ),
126
- children: /* @__PURE__ */ c(N, { fallback: (n == null ? void 0 : n.loading) ?? /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(f, { ...r }) })
126
+ children: /* @__PURE__ */ c(j, { fallback: (n == null ? void 0 : n.loading) ?? /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(f, { ...r }) })
127
127
  },
128
128
  a
129
129
  );
@@ -1 +1,88 @@
1
- export { Router, Link, NavLink, useRouter, useNavigate, useParams, useLocation, useQuery, Outlet, lazyRoute, preloadRoute, useRouteMeta, DefaultLoader, DefaultErrorPage } from './index.js';
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import React$1 from 'react';
4
+ import { ComponentType, ErrorInfo, ReactNode } from 'react';
5
+
6
+ type RouteGuard = (to: Route, from: Route | null) => boolean | string | Promise<boolean | string>;
7
+ interface Route {
8
+ path: string;
9
+ component: React$1.ComponentType<any>;
10
+ children?: Route[];
11
+ exact?: boolean;
12
+ meta?: Record<string, any>;
13
+ beforeEnter?: RouteGuard;
14
+ beforeLeave?: RouteGuard;
15
+ }
16
+ interface RouterContextValue {
17
+ currentPath: string;
18
+ basename: string;
19
+ navigate: (path: string, options?: NavigateOptions) => void;
20
+ goBack: () => void;
21
+ replace: (path: string) => void;
22
+ params: Record<string, string>;
23
+ query: URLSearchParams;
24
+ hash: string;
25
+ }
26
+ interface NavigateOptions {
27
+ replace?: boolean;
28
+ state?: any;
29
+ }
30
+ export declare function useRouter(): RouterContextValue;
31
+ export declare function useNavigate(): (path: string, options?: NavigateOptions) => void;
32
+ export declare function useParams<T extends Record<string, string> = Record<string, string>>(): T;
33
+ export declare function useQuery(): URLSearchParams;
34
+ export declare function useLocation(): {
35
+ pathname: string;
36
+ search: string;
37
+ hash: string;
38
+ };
39
+ interface RouterProps {
40
+ routes: Route[];
41
+ fallback?: React$1.ComponentType;
42
+ loading?: React$1.ReactNode;
43
+ basename?: string;
44
+ /** Request path for SSR. First client render uses this (or `/`), then window after mount. */
45
+ initialPath?: string;
46
+ /** Request search string (`?a=1` or `a=1`) for SSR. */
47
+ initialSearch?: string;
48
+ /** Request hash (`#section` or `section`) for SSR. */
49
+ initialHash?: string;
50
+ errorBoundary?: React$1.ReactNode | ((error: Error, errorInfo: React$1.ErrorInfo) => React$1.ReactNode);
51
+ onError?: (error: Error, errorInfo: React$1.ErrorInfo) => void;
52
+ }
53
+ export declare const Router: React$1.FC<RouterProps>;
54
+ interface LinkProps extends Omit<React$1.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {
55
+ to: string;
56
+ children: React$1.ReactNode;
57
+ replace?: boolean;
58
+ state?: any;
59
+ }
60
+ export declare const Link: React$1.FC<LinkProps>;
61
+ interface NavLinkProps extends LinkProps {
62
+ activeClassName?: string;
63
+ activeStyle?: React$1.CSSProperties;
64
+ exact?: boolean;
65
+ }
66
+ export declare const NavLink: React$1.FC<NavLinkProps>;
67
+ export declare const Outlet: React$1.FC;
68
+ interface DefaultErrorPageProps {
69
+ error?: Error;
70
+ onReset?: () => void;
71
+ }
72
+ export declare const DefaultErrorPage: React$1.FC<DefaultErrorPageProps>;
73
+ interface LazyRouteOptions {
74
+ loading?: React$1.ReactNode;
75
+ }
76
+ export declare function lazyRoute<T extends React$1.ComponentType<any>>(loader: () => Promise<{
77
+ default: T;
78
+ }>, options?: LazyRouteOptions): React$1.ComponentType;
79
+ export declare function preloadRoute(loader: () => Promise<{
80
+ default: React$1.ComponentType<any>;
81
+ }>): void;
82
+ interface DefaultLoaderProps {
83
+ message?: string;
84
+ }
85
+ export declare const DefaultLoader: React$1.FC<DefaultLoaderProps>;
86
+ export declare function useRouteMeta<T = Record<string, any>>(): T | undefined;
87
+
88
+ export {};
@@ -1,18 +1,18 @@
1
- import { aI as s, aH as u, aB as o, aF as t, aD as r, aE as l, aG as L, aC as R } from "./client-DOrZXJAN.js";
2
- import { L as i, N as p, O as m, l as n, p as D, u as N } from "./metadata-9Bpw89m2.js";
1
+ import { aP as s, aO as u, aI as o, aM as t, aK as r, aL as l, aN as L, aJ as R } from "./client-3NdKI2xE.js";
2
+ import { L as i, N as p, O as N, l as m, p as n, u as O } from "./metadata-B2MRlDTz.js";
3
3
  export {
4
4
  s as DefaultErrorPage,
5
5
  u as DefaultLoader,
6
6
  i as Link,
7
7
  p as NavLink,
8
- m as Outlet,
8
+ N as Outlet,
9
9
  o as Router,
10
- n as lazyRoute,
11
- D as preloadRoute,
10
+ m as lazyRoute,
11
+ n as preloadRoute,
12
12
  t as useLocation,
13
13
  r as useNavigate,
14
14
  l as useParams,
15
15
  L as useQuery,
16
- N as useRouteMeta,
16
+ O as useRouteMeta,
17
17
  R as useRouter
18
18
  };
@@ -0,0 +1,263 @@
1
+ import { bo as z, N as B, S as k, bp as V, bq as O, _ as I, br as W, bs as _, bt as G } from "./client-3NdKI2xE.js";
2
+ import p, { useSyncExternalStore as H } from "react";
3
+ function J(t) {
4
+ return typeof t == "number" ? t : t != null && typeof t == "object" && "value" in t ? Number(t.value) : Number(t);
5
+ }
6
+ function c(t, e) {
7
+ const i = J(t), n = (o) => e(Number(o));
8
+ return z(n), n(i);
9
+ }
10
+ const R = {
11
+ /** Decimals — default 2: `Format.fixed(price)` → `"12.50"`. */
12
+ fixed(t, e = 2) {
13
+ return c(t, (i) => i.toFixed(e));
14
+ },
15
+ /** Whole number, no decimals: `Format.integer(n)` → `"12"`. */
16
+ integer(t) {
17
+ return c(t, (e) => String(Math.round(e)));
18
+ },
19
+ /** `Format.euro(price)` → `"€ 12.50"`. */
20
+ euro(t, e = 2) {
21
+ return `€ ${R.fixed(t, e)}`;
22
+ },
23
+ /**
24
+ * Locale currency. Default `EUR` / `es-ES`.
25
+ * `Format.currency(price, 'USD', 'en-US')` → `"$12.50"`.
26
+ */
27
+ currency(t, e = "EUR", i = "es-ES") {
28
+ return c(
29
+ t,
30
+ (n) => new Intl.NumberFormat(i, { style: "currency", currency: e }).format(n)
31
+ );
32
+ },
33
+ /** `Format.percent(rate)` with rate `0–1` → `"12%"` (default 0 decimals). */
34
+ percent(t, e = 0) {
35
+ return c(t, (i) => `${(i * 100).toFixed(e)}%`);
36
+ },
37
+ /** Compact: `1200` → `"1.2K"` (en). */
38
+ compact(t, e = "en") {
39
+ return c(
40
+ t,
41
+ (i) => new Intl.NumberFormat(e, {
42
+ notation: "compact",
43
+ maximumFractionDigits: 1
44
+ }).format(i)
45
+ );
46
+ }
47
+ }, ne = R, re = {
48
+ px(t) {
49
+ return c(t, (e) => `${e}px`);
50
+ },
51
+ rem(t) {
52
+ return c(t, (e) => `${e}rem`);
53
+ },
54
+ em(t) {
55
+ return c(t, (e) => `${e}em`);
56
+ },
57
+ /** `Unit.percent(50)` → `"50%"`. */
58
+ percent(t) {
59
+ return c(t, (e) => `${e}%`);
60
+ },
61
+ vh(t) {
62
+ return c(t, (e) => `${e}vh`);
63
+ },
64
+ vw(t) {
65
+ return c(t, (e) => `${e}vw`);
66
+ }
67
+ }, se = {
68
+ /**
69
+ * `"N word"` — uses `one` when the absolute count is 1, otherwise `many`.
70
+ */
71
+ of(t, e, i) {
72
+ return c(t, (n) => {
73
+ const o = Math.abs(n) === 1 ? e : i;
74
+ return `${n} ${o}`;
75
+ });
76
+ },
77
+ /** Only the word: `Plural.word(count, 'item', 'items')` → `"items"`. */
78
+ word(t, e, i) {
79
+ return c(t, (n) => Math.abs(n) === 1 ? e : i);
80
+ }
81
+ }, q = {
82
+ linear: (t) => t,
83
+ easeIn: (t) => t * t,
84
+ easeOut: (t) => t * (2 - t),
85
+ easeInOut: (t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t
86
+ };
87
+ function K(t, e, i) {
88
+ return t + (e - t) * i;
89
+ }
90
+ const b = /* @__PURE__ */ new WeakMap();
91
+ function Q() {
92
+ return typeof requestAnimationFrame == "function";
93
+ }
94
+ function X() {
95
+ return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
96
+ }
97
+ function Y(t) {
98
+ const e = b.get(t);
99
+ e != null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(e), b.delete(t);
100
+ }
101
+ k.prototype.spring = function(t, e = {}) {
102
+ this.animate(t, { ...e, curve: "spring", damping: e.damping ?? 26, stiffness: e.stiffness ?? 170 });
103
+ };
104
+ k.prototype.animate = function(t, e = {}) {
105
+ var v, N;
106
+ const i = this.value, n = t;
107
+ if (Y(this), !Q() || X()) {
108
+ this.value = n, (v = e.onComplete) == null || v.call(e);
109
+ return;
110
+ }
111
+ if (e.curve === "spring") {
112
+ const y = typeof e.stiffness == "number" && Number.isFinite(e.stiffness) && e.stiffness > 0 ? e.stiffness : 170, d = typeof e.damping == "number" && Number.isFinite(e.damping) && e.damping >= 0 ? e.damping : 26, h = typeof e.mass == "number" && Number.isFinite(e.mass) && e.mass > 0 ? e.mass : 1;
113
+ let F = i, w = typeof e.velocity == "number" && Number.isFinite(e.velocity) ? e.velocity : 0;
114
+ const E = 1 / 60, x = () => {
115
+ var M, $;
116
+ const C = -y * (F - n) - d * w;
117
+ if (w += C / h * E, F += w * E, !Number.isFinite(F) || !Number.isFinite(w)) {
118
+ this.value = n, b.delete(this), (M = e.onComplete) == null || M.call(e);
119
+ return;
120
+ }
121
+ this.value = F, Math.abs(F - n) > 0.01 || Math.abs(w) > 0.01 ? b.set(this, requestAnimationFrame(x)) : (this.value = n, b.delete(this), ($ = e.onComplete) == null || $.call(e));
122
+ };
123
+ b.set(this, requestAnimationFrame(x));
124
+ return;
125
+ }
126
+ const o = e.duration, l = typeof o == "number" && Number.isFinite(o) && o > 0 ? o : o === void 0 ? 300 : 0;
127
+ if (l === 0) {
128
+ this.value = n, (N = e.onComplete) == null || N.call(e);
129
+ return;
130
+ }
131
+ const A = q[e.curve || "easeOut"] ?? q.easeOut;
132
+ let g = null;
133
+ const m = (y) => {
134
+ var h;
135
+ g || (g = y);
136
+ const d = Math.min((y - g) / l, 1);
137
+ this.value = K(i, n, A(d)), d < 1 ? b.set(this, requestAnimationFrame(m)) : (b.delete(this), (h = e.onComplete) == null || h.call(e));
138
+ };
139
+ b.set(this, requestAnimationFrame(m));
140
+ };
141
+ k.prototype.snapTo = function(t, e = {}) {
142
+ this.animate(t, { duration: 300, curve: "easeOut", ...e });
143
+ };
144
+ function ie(t = {}) {
145
+ return B(t.curve ?? "easeOut", {
146
+ stiffness: t.stiffness,
147
+ damping: t.damping,
148
+ mass: t.mass
149
+ });
150
+ }
151
+ function Z(t, e = {}) {
152
+ const { styles: i = !0, meta: n } = e, o = [], l = [], A = V(t.toString());
153
+ let g = 0, m = null, v = -1, N = !1, y = [], d = [];
154
+ const h = /* @__PURE__ */ new Set();
155
+ function F(r, s) {
156
+ if (r.length !== s.length) return !1;
157
+ for (let u = 0; u < r.length; u++) if (r[u] !== s[u]) return !1;
158
+ return !0;
159
+ }
160
+ function w(r) {
161
+ var s, u;
162
+ for (let a = 0; a < l.length; a++) {
163
+ const f = l[a];
164
+ if (f) {
165
+ if (a >= r) {
166
+ (s = f.unsubs) == null || s.forEach((S) => S()), f.unsubs = [], f.wired = void 0;
167
+ continue;
168
+ }
169
+ f.wired && F(f.wired, f.signals) || ((u = f.unsubs) == null || u.forEach((S) => S()), f.unsubs = f.signals.map((S) => S.subscribe(() => C(S))), f.wired = f.signals);
170
+ }
171
+ }
172
+ }
173
+ function E(r) {
174
+ F(y, r) || (d.forEach((s) => s()), d = r.map((s) => s.subscribe(() => C())), y = r);
175
+ }
176
+ function x(r) {
177
+ let s = !1;
178
+ for (let u = 0; u < l.length; u++) {
179
+ const a = l[u];
180
+ if (a != null && a.signals.includes(r)) {
181
+ if (s = !0, !a.parts || !a.node) return !1;
182
+ a.next = _(a.parts);
183
+ }
184
+ }
185
+ return s ? G(l, l.length) : !1;
186
+ }
187
+ function C(r) {
188
+ if (!N) {
189
+ N = !0;
190
+ try {
191
+ if (r && x(r)) return;
192
+ T();
193
+ } finally {
194
+ N = !1;
195
+ }
196
+ }
197
+ }
198
+ function M(r) {
199
+ const s = [];
200
+ return typeof (n == null ? void 0 : n.title) == "string" && n.title.length > 0 && s.push(p.createElement("title", { key: "fibo-title" }, n.title)), typeof (n == null ? void 0 : n.description) == "string" && n.description.length > 0 && s.push(
201
+ p.createElement("meta", {
202
+ key: "fibo-description",
203
+ name: "description",
204
+ content: n.description
205
+ })
206
+ ), s.push(r), i && s.push(p.createElement(I)), p.createElement(p.Fragment, null, ...s);
207
+ }
208
+ function $() {
209
+ let r;
210
+ const s = W(o, l, () => {
211
+ r = O(t());
212
+ }, A);
213
+ return { tree: r, ...s.outcome };
214
+ }
215
+ function T() {
216
+ g += 1, m = null, v = -1;
217
+ for (const r of h) r();
218
+ }
219
+ function U() {
220
+ if (m && v === g) return m;
221
+ const r = $();
222
+ return m = M(r.tree), v = g, w(r.slotCount), E(r.roots), m;
223
+ }
224
+ function D(r) {
225
+ return h.add(r), () => {
226
+ var s;
227
+ if (h.delete(r), h.size === 0) {
228
+ for (const u of l)
229
+ (s = u == null ? void 0 : u.unsubs) == null || s.forEach((a) => a()), u && (u.unsubs = [], u.wired = void 0);
230
+ d.forEach((u) => u()), d = [], y = [], m = null, v = -1;
231
+ }
232
+ };
233
+ }
234
+ function L() {
235
+ return g;
236
+ }
237
+ function j() {
238
+ return 0;
239
+ }
240
+ function P() {
241
+ return H(D, L, j), U();
242
+ }
243
+ return P.displayName = "FiboPage", n && (P.meta = n), P;
244
+ }
245
+ const ue = Z;
246
+ function ae(t) {
247
+ return p.createElement(
248
+ p.Fragment,
249
+ null,
250
+ O(t),
251
+ p.createElement(I)
252
+ );
253
+ }
254
+ export {
255
+ R as F,
256
+ se as P,
257
+ ne as T,
258
+ re as U,
259
+ ue as a,
260
+ ie as c,
261
+ Z as p,
262
+ ae as w
263
+ };