fiboui 2.8.3 → 2.8.5

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,19 @@
1
- import { C as r, a as s, H as e, L as l, b as t, S, Z as n } from "./index-CFwY5hCL.js";
2
- import { C as c, S as f } from "./index-C5TPsNMz.js";
3
- import { a6 as m, a3 as d, a4 as p, a5 as u, a7 as b } from "./client-8KCOzRhg.js";
1
+ import { C as r, a as s, H as e, L as l, b as t, S, Z as n } from "./index-Bgt9DiVJ.js";
2
+ import { C as c, S as d } from "./index-DU4n9axe.js";
3
+ import { ac as i, a9 as m, aa as b, ab as p, ad as u } from "./client-BzMPiV64.js";
4
4
  export {
5
5
  r as Center,
6
6
  c as Column,
7
7
  s as Container,
8
- m as DashboardLayout,
8
+ i as DashboardLayout,
9
9
  e as Header,
10
10
  l as Line,
11
- d as Row,
12
- p as Scaffold,
11
+ m as Row,
12
+ b as Scaffold,
13
13
  t as ScrollController,
14
14
  S as ScrollView,
15
- u as Sidebar,
16
- f as Spacer,
17
- b as VirtualColumn,
15
+ p as Sidebar,
16
+ d as Spacer,
17
+ u as VirtualColumn,
18
18
  n as ZStack
19
19
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import { b6 as v, b5 as x, b7 as E, b8 as k, b9 as R, ba as D, bb as O, bc as g, bd as P, be as $, bf as z, aD as A, aE as K } from "./client-8KCOzRhg.js";
2
+ import { b8 as v, b7 as x, b9 as k, ba as E, bb as R, bc as O, bd as P, be as g, bf as $, bg as D, bh as K, aJ as z, aK as A } from "./client-BzMPiV64.js";
3
3
  import { useState as M, useMemo as N, lazy as S, Suspense as B } from "react";
4
4
  function b(e) {
5
5
  const t = (typeof e == "string" ? e.trim() : "").split(/[?#]/, 1)[0];
@@ -14,11 +14,11 @@ function H(e) {
14
14
  }
15
15
  function I(e, n) {
16
16
  const { search: t, hash: r } = H(n), a = R(b(n), e);
17
- return `${D(e, a)}${t}${r}`;
17
+ return `${O(e, a)}${t}${r}`;
18
18
  }
19
19
  function j(e, n, t, r = "") {
20
20
  const a = R(b(n), r), s = b(e);
21
- return a === "/" ? s === "/" : O(s, a, t).match;
21
+ return a === "/" ? s === "/" : P(s, a, t).match;
22
22
  }
23
23
  const W = ({
24
24
  to: e,
@@ -33,7 +33,7 @@ const W = ({
33
33
  rel: h,
34
34
  ...p
35
35
  }) => {
36
- const l = v(), m = x(e), y = !m && E(e), C = m ? void 0 : y ? e.trim() : I((l == null ? void 0 : l.basename) ?? "", e), w = i && String(i).toLowerCase() === "_blank" ? k(h, "noopener noreferrer") : h;
36
+ const l = v(), m = x(e), y = !m && k(e), C = m ? void 0 : y ? e.trim() : I((l == null ? void 0 : l.basename) ?? "", e), w = i && String(i).toLowerCase() === "_blank" ? E(h, "noopener noreferrer") : h;
37
37
  return /* @__PURE__ */ c(
38
38
  "a",
39
39
  {
@@ -56,7 +56,7 @@ const W = ({
56
56
  children: n
57
57
  }
58
58
  );
59
- }, G = ({
59
+ }, V = ({
60
60
  to: e,
61
61
  children: n,
62
62
  className: t = "",
@@ -83,15 +83,15 @@ const W = ({
83
83
  children: n
84
84
  }
85
85
  );
86
- }, J = () => {
86
+ }, G = () => {
87
87
  const e = v(), n = g();
88
88
  if (!e || !n || !n.children || n.children.length === 0)
89
89
  return null;
90
- const { route: t } = P(n.children, e.currentPath);
90
+ const { route: t } = $(n.children, e.currentPath);
91
91
  if (!t)
92
92
  return null;
93
93
  const r = t.component;
94
- return /* @__PURE__ */ c($.Provider, { value: t, children: /* @__PURE__ */ c(r, {}) });
94
+ return /* @__PURE__ */ c(D.Provider, { value: t, children: /* @__PURE__ */ c(r, {}) });
95
95
  }, d = /* @__PURE__ */ new WeakMap();
96
96
  function _(e) {
97
97
  return e instanceof Error ? e : typeof e == "string" && e.trim() ? new Error(e) : new Error("Failed to load route");
@@ -112,10 +112,10 @@ function Q(e, n) {
112
112
  [a]
113
113
  );
114
114
  return /* @__PURE__ */ c(
115
- z,
115
+ K,
116
116
  {
117
117
  fallback: (i) => /* @__PURE__ */ c(
118
- K,
118
+ A,
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(B, { fallback: (n == null ? void 0 : n.loading) ?? /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(f, { ...r }) })
126
+ children: /* @__PURE__ */ c(B, { fallback: (n == null ? void 0 : n.loading) ?? /* @__PURE__ */ c(z, {}), children: /* @__PURE__ */ c(f, { ...r }) })
127
127
  },
128
128
  a
129
129
  );
@@ -139,8 +139,8 @@ function X() {
139
139
  }
140
140
  export {
141
141
  W as L,
142
- G as N,
143
- J as O,
142
+ V as N,
143
+ G as O,
144
144
  Q as l,
145
145
  T as p,
146
146
  X as u
@@ -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,5 +1,5 @@
1
- import { aE as s, aD as u, ax as o, aB as t, az as r, aA as l, aC as L, ay as R } from "./client-8KCOzRhg.js";
2
- import { L as i, N as p, O as m, l as n, p as x, u as y } from "./metadata-BEmm6pe-.js";
1
+ import { aK as s, aJ as u, aD as o, aH as t, aF as r, aG as l, aI as L, aE as R } from "./client-BzMPiV64.js";
2
+ import { L as i, N as p, O as m, l as n, p as D, u as N } from "./metadata-B5v6sx60.js";
3
3
  export {
4
4
  s as DefaultErrorPage,
5
5
  u as DefaultLoader,
@@ -8,11 +8,11 @@ export {
8
8
  m as Outlet,
9
9
  o as Router,
10
10
  n as lazyRoute,
11
- x as preloadRoute,
11
+ D as preloadRoute,
12
12
  t as useLocation,
13
13
  r as useNavigate,
14
14
  l as useParams,
15
15
  L as useQuery,
16
- y as useRouteMeta,
16
+ N as useRouteMeta,
17
17
  R as useRouter
18
18
  };
@@ -0,0 +1,263 @@
1
+ import { bi as z, N as B, S as k, bj as V, bk as q, _ as I, bl as W, bm as _, bn as G } from "./client-BzMPiV64.js";
2
+ import v, { 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 = (l) => e(Number(l));
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 l = Math.abs(n) === 1 ? e : i;
74
+ return `${n} ${l}`;
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
+ }, O = {
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 p, N;
106
+ const i = this.value, n = t;
107
+ if (Y(this), !Q() || X()) {
108
+ this.value = n, (p = e.onComplete) == null || p.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 l = e.duration, o = typeof l == "number" && Number.isFinite(l) && l > 0 ? l : l === void 0 ? 300 : 0;
127
+ if (o === 0) {
128
+ this.value = n, (N = e.onComplete) == null || N.call(e);
129
+ return;
130
+ }
131
+ const A = O[e.curve || "easeOut"] ?? O.easeOut;
132
+ let g = null;
133
+ const m = (y) => {
134
+ var h;
135
+ g || (g = y);
136
+ const d = Math.min((y - g) / o, 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, l = [], o = [], A = V(t.toString());
153
+ let g = 0, m = null, p = -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 < o.length; a++) {
163
+ const f = o[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 < o.length; u++) {
179
+ const a = o[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(o, o.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(v.createElement("title", { key: "fibo-title" }, n.title)), typeof (n == null ? void 0 : n.description) == "string" && n.description.length > 0 && s.push(
201
+ v.createElement("meta", {
202
+ key: "fibo-description",
203
+ name: "description",
204
+ content: n.description
205
+ })
206
+ ), s.push(r), i && s.push(v.createElement(I)), v.createElement(v.Fragment, null, ...s);
207
+ }
208
+ function $() {
209
+ let r;
210
+ const s = W(l, o, () => {
211
+ r = q(t());
212
+ }, A);
213
+ return { tree: r, ...s.outcome };
214
+ }
215
+ function T() {
216
+ g += 1, m = null, p = -1;
217
+ for (const r of h) r();
218
+ }
219
+ function U() {
220
+ if (m && p === g) return m;
221
+ const r = $();
222
+ return m = M(r.tree), p = 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 o)
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, p = -1;
231
+ }
232
+ };
233
+ }
234
+ function j() {
235
+ return g;
236
+ }
237
+ function L() {
238
+ return 0;
239
+ }
240
+ function P() {
241
+ return H(D, j, L), U();
242
+ }
243
+ return P.displayName = "FiboPage", n && (P.meta = n), P;
244
+ }
245
+ const ue = Z;
246
+ function ae(t) {
247
+ return v.createElement(
248
+ v.Fragment,
249
+ null,
250
+ q(t),
251
+ v.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
+ };