fiboui 2.2.4 → 2.4.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/theme.js CHANGED
@@ -1,9 +1,19 @@
1
1
  "use client";
2
- import { F as a, c as s, m as i, u as o, w as r } from "./provider-CihtUuRx.js";
2
+ import { F as a, u as m } from "./provider-Muljv62_.js";
3
+ import { F as o, a as t, c as T, e as r, m as i, n as l, r as n, f as u, d as F, t as b, b as c, w as p } from "./themeData-CmTJt3dU.js";
3
4
  export {
5
+ o as FIBO_THEMES,
4
6
  a as FiboThemeProvider,
5
- s as cupertinoTheme,
7
+ t as copyWithTheme,
8
+ T as cupertinoTheme,
9
+ r as extendTheme,
6
10
  i as materialTheme,
7
- o as useFiboTheme,
8
- r as webTheme
11
+ l as noirTheme,
12
+ n as resolveTheme,
13
+ u as themeClassName,
14
+ F as themeToCssRule,
15
+ b as themeToCssVars,
16
+ c as themeToInlineStyle,
17
+ m as useFiboTheme,
18
+ p as webTheme
9
19
  };
@@ -0,0 +1,441 @@
1
+ "use client";
2
+ const f = {
3
+ name: "material",
4
+ colors: {
5
+ primary: "#6750A4",
6
+ primaryVariant: "#4F378B",
7
+ secondary: "#625B71",
8
+ secondaryVariant: "#4A4458",
9
+ background: "#FFFBFE",
10
+ surface: "#FFFBFE",
11
+ error: "#B3261E",
12
+ success: "#4CAF50",
13
+ warning: "#FF9800",
14
+ info: "#2196F3",
15
+ onPrimary: "#FFFFFF",
16
+ onSecondary: "#000000",
17
+ onBackground: "#000000",
18
+ onSurface: "#000000",
19
+ onError: "#FFFFFF"
20
+ },
21
+ typography: {
22
+ h1: {
23
+ fontSize: "96px",
24
+ fontWeight: 300,
25
+ letterSpacing: "-1.5px"
26
+ },
27
+ h2: {
28
+ fontSize: "60px",
29
+ fontWeight: 300,
30
+ letterSpacing: "-0.5px"
31
+ },
32
+ h3: {
33
+ fontSize: "48px",
34
+ fontWeight: 400
35
+ },
36
+ h4: {
37
+ fontSize: "34px",
38
+ fontWeight: 400,
39
+ letterSpacing: "0.25px"
40
+ },
41
+ h5: {
42
+ fontSize: "24px",
43
+ fontWeight: 400
44
+ },
45
+ h6: {
46
+ fontSize: "20px",
47
+ fontWeight: 500,
48
+ letterSpacing: "0.15px"
49
+ },
50
+ body: {
51
+ fontSize: "16px",
52
+ fontWeight: 400,
53
+ letterSpacing: "0.5px"
54
+ },
55
+ caption: {
56
+ fontSize: "12px",
57
+ fontWeight: 400,
58
+ letterSpacing: "0.4px"
59
+ },
60
+ label: {
61
+ fontSize: "14px",
62
+ fontWeight: 500,
63
+ letterSpacing: "1.25px"
64
+ }
65
+ },
66
+ spacing: {
67
+ xs: "4px",
68
+ sm: "8px",
69
+ md: "16px",
70
+ lg: "24px",
71
+ xl: "32px"
72
+ },
73
+ borderRadius: {
74
+ sm: "4px",
75
+ md: "8px",
76
+ lg: "16px",
77
+ full: "9999px"
78
+ },
79
+ shadows: {
80
+ sm: "0 2px 4px rgba(0,0,0,0.1)",
81
+ md: "0 4px 8px rgba(0,0,0,0.12)",
82
+ lg: "0 8px 16px rgba(0,0,0,0.14)"
83
+ },
84
+ fontFamily: "Roboto, sans-serif"
85
+ }, s = {
86
+ name: "cupertino",
87
+ colors: {
88
+ primary: "#007AFF",
89
+ secondary: "#AF52DE",
90
+ background: "#FFFFFF",
91
+ surface: "#F2F2F7",
92
+ error: "#FF3B30",
93
+ success: "#34C759",
94
+ warning: "#FF9500",
95
+ info: "#5AC8FA",
96
+ onPrimary: "#FFFFFF",
97
+ onSecondary: "#FFFFFF",
98
+ onBackground: "#000000",
99
+ onSurface: "#000000",
100
+ onError: "#FFFFFF"
101
+ },
102
+ typography: {
103
+ h1: {
104
+ fontSize: "34px",
105
+ fontWeight: 700,
106
+ letterSpacing: "0.37px"
107
+ },
108
+ h2: {
109
+ fontSize: "28px",
110
+ fontWeight: 700,
111
+ letterSpacing: "0.36px"
112
+ },
113
+ h3: {
114
+ fontSize: "22px",
115
+ fontWeight: 600,
116
+ letterSpacing: "0.35px"
117
+ },
118
+ h4: {
119
+ fontSize: "20px",
120
+ fontWeight: 600
121
+ },
122
+ h5: {
123
+ fontSize: "17px",
124
+ fontWeight: 600,
125
+ letterSpacing: "-0.41px"
126
+ },
127
+ h6: {
128
+ fontSize: "15px",
129
+ fontWeight: 600,
130
+ letterSpacing: "-0.24px"
131
+ },
132
+ body: {
133
+ fontSize: "17px",
134
+ fontWeight: 400,
135
+ letterSpacing: "-0.41px"
136
+ },
137
+ caption: {
138
+ fontSize: "13px",
139
+ fontWeight: 400,
140
+ letterSpacing: "-0.08px"
141
+ },
142
+ label: {
143
+ fontSize: "15px",
144
+ fontWeight: 500,
145
+ letterSpacing: "-0.24px"
146
+ }
147
+ },
148
+ spacing: {
149
+ xs: "4px",
150
+ sm: "8px",
151
+ md: "12px",
152
+ lg: "20px",
153
+ xl: "32px"
154
+ },
155
+ borderRadius: {
156
+ sm: "8px",
157
+ md: "12px",
158
+ lg: "20px",
159
+ full: "9999px"
160
+ },
161
+ shadows: {
162
+ sm: "0 1px 3px rgba(0,0,0,0.08)",
163
+ md: "0 2px 8px rgba(0,0,0,0.1)",
164
+ lg: "0 4px 16px rgba(0,0,0,0.12)"
165
+ },
166
+ fontFamily: '-apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif'
167
+ }, g = {
168
+ name: "web",
169
+ colors: {
170
+ primary: "#3B82F6",
171
+ secondary: "#8B5CF6",
172
+ background: "#FFFFFF",
173
+ surface: "#F9FAFB",
174
+ error: "#EF4444",
175
+ success: "#10B981",
176
+ warning: "#F59E0B",
177
+ info: "#06B6D4",
178
+ onPrimary: "#FFFFFF",
179
+ onSecondary: "#FFFFFF",
180
+ onBackground: "#111827",
181
+ onSurface: "#374151",
182
+ onError: "#FFFFFF"
183
+ },
184
+ typography: {
185
+ h1: {
186
+ fontSize: "60px",
187
+ fontWeight: 800,
188
+ letterSpacing: "-0.02em"
189
+ },
190
+ h2: {
191
+ fontSize: "48px",
192
+ fontWeight: 700,
193
+ letterSpacing: "-0.01em"
194
+ },
195
+ h3: {
196
+ fontSize: "36px",
197
+ fontWeight: 700
198
+ },
199
+ h4: {
200
+ fontSize: "30px",
201
+ fontWeight: 600
202
+ },
203
+ h5: {
204
+ fontSize: "24px",
205
+ fontWeight: 600
206
+ },
207
+ h6: {
208
+ fontSize: "20px",
209
+ fontWeight: 600
210
+ },
211
+ body: {
212
+ fontSize: "16px",
213
+ fontWeight: 400,
214
+ lineHeight: "1.5"
215
+ },
216
+ caption: {
217
+ fontSize: "14px",
218
+ fontWeight: 400,
219
+ lineHeight: "1.4"
220
+ },
221
+ label: {
222
+ fontSize: "14px",
223
+ fontWeight: 500,
224
+ letterSpacing: "0.01em"
225
+ }
226
+ },
227
+ spacing: {
228
+ xs: "4px",
229
+ sm: "8px",
230
+ md: "16px",
231
+ lg: "24px",
232
+ xl: "32px"
233
+ },
234
+ borderRadius: {
235
+ sm: "6px",
236
+ md: "8px",
237
+ lg: "12px",
238
+ full: "9999px"
239
+ },
240
+ shadows: {
241
+ sm: "0 1px 2px rgba(0,0,0,0.05)",
242
+ md: "0 4px 6px rgba(0,0,0,0.07)",
243
+ lg: "0 10px 15px rgba(0,0,0,0.1)"
244
+ },
245
+ fontFamily: "Inter, system-ui, sans-serif"
246
+ }, c = {
247
+ name: "noir",
248
+ colors: {
249
+ primary: "#F4F4F6",
250
+ onPrimary: "#0A0A0B",
251
+ primaryVariant: "#C8C8D0",
252
+ secondary: "#8E8E9A",
253
+ onSecondary: "#F4F4F6",
254
+ secondaryVariant: "#4E4E57",
255
+ background: "#0A0A0B",
256
+ onBackground: "#F4F4F6",
257
+ surface: "#141417",
258
+ onSurface: "#F4F4F6",
259
+ error: "#F87171",
260
+ success: "#34D399",
261
+ warning: "#FBBF24",
262
+ info: "#94A3B8",
263
+ onError: "#0A0A0B",
264
+ outline: "rgba(255, 255, 255, 0.12)"
265
+ },
266
+ typography: {
267
+ h1: {
268
+ fontSize: "clamp(38px, 4.4vw, 60px)",
269
+ fontWeight: 300,
270
+ letterSpacing: "0.03em",
271
+ lineHeight: 1.12,
272
+ color: "var(--fibo-on-background)"
273
+ },
274
+ h2: {
275
+ fontSize: "clamp(28px, 3.2vw, 44px)",
276
+ fontWeight: 300,
277
+ letterSpacing: "0.03em",
278
+ lineHeight: 1.18,
279
+ color: "var(--fibo-on-background)"
280
+ },
281
+ h3: {
282
+ fontSize: "16px",
283
+ fontWeight: 500,
284
+ letterSpacing: "0.01em",
285
+ color: "var(--fibo-on-background)"
286
+ },
287
+ h4: {
288
+ fontSize: "15px",
289
+ fontWeight: 500,
290
+ color: "var(--fibo-on-background)"
291
+ },
292
+ h5: {
293
+ fontSize: "14px",
294
+ fontWeight: 500,
295
+ color: "var(--fibo-on-background)"
296
+ },
297
+ h6: {
298
+ fontSize: "13px",
299
+ fontWeight: 500,
300
+ color: "var(--fibo-on-background)"
301
+ },
302
+ body: {
303
+ fontSize: "13.5px",
304
+ fontWeight: 400,
305
+ lineHeight: 1.7,
306
+ color: "var(--fibo-secondary)"
307
+ },
308
+ caption: {
309
+ fontSize: "12.5px",
310
+ fontWeight: 400,
311
+ lineHeight: 1.4,
312
+ color: "var(--fibo-secondary)"
313
+ },
314
+ label: {
315
+ fontSize: "11.5px",
316
+ fontWeight: 500,
317
+ letterSpacing: "0.02em",
318
+ color: "var(--fibo-secondary)"
319
+ }
320
+ },
321
+ spacing: {
322
+ xs: "4px",
323
+ sm: "8px",
324
+ md: "16px",
325
+ lg: "24px",
326
+ xl: "40px"
327
+ },
328
+ borderRadius: {
329
+ sm: "6px",
330
+ md: "14px",
331
+ lg: "18px",
332
+ full: "9999px"
333
+ },
334
+ shadows: {
335
+ sm: "0 1px 0 rgba(255,255,255,0.04)",
336
+ md: "0 12px 40px rgba(0,0,0,0.45)",
337
+ lg: "0 30px 80px rgba(0,0,0,0.75)"
338
+ },
339
+ fontFamily: 'var(--font-sans-loaded, "Plus Jakarta Sans"), system-ui, -apple-system, sans-serif'
340
+ }, l = {
341
+ material: f,
342
+ cupertino: s,
343
+ web: g,
344
+ noir: c
345
+ };
346
+ function h(o) {
347
+ if (typeof o == "string") {
348
+ const n = l[o];
349
+ if (!n) throw new Error(`Unknown fiboui theme preset: ${o}`);
350
+ return n;
351
+ }
352
+ return o;
353
+ }
354
+ function e(o, n) {
355
+ return n ? { ...o, ...n } : o;
356
+ }
357
+ function x(o, n) {
358
+ return n ? {
359
+ h1: e(o.h1, n.h1),
360
+ h2: e(o.h2, n.h2),
361
+ h3: e(o.h3, n.h3),
362
+ h4: e(o.h4, n.h4),
363
+ h5: e(o.h5, n.h5),
364
+ h6: e(o.h6, n.h6),
365
+ body: e(o.body, n.body),
366
+ caption: e(o.caption, n.caption),
367
+ label: e(o.label, n.label)
368
+ } : o;
369
+ }
370
+ function F(o, n) {
371
+ return {
372
+ name: n.name ?? o.name,
373
+ colors: { ...o.colors, ...n.colors },
374
+ typography: x(o.typography, n.typography),
375
+ spacing: { ...o.spacing, ...n.spacing },
376
+ borderRadius: { ...o.borderRadius, ...n.borderRadius },
377
+ shadows: { ...o.shadows, ...n.shadows },
378
+ fontFamily: n.fontFamily ?? o.fontFamily
379
+ };
380
+ }
381
+ const m = F;
382
+ function d(o) {
383
+ return `--fibo-text-${o}`;
384
+ }
385
+ function p(o) {
386
+ const n = o.colors, r = {
387
+ "--fibo-primary": n.primary,
388
+ "--fibo-on-primary": n.onPrimary,
389
+ "--fibo-secondary": n.secondary,
390
+ "--fibo-on-secondary": n.onSecondary,
391
+ "--fibo-background": n.background,
392
+ "--fibo-on-background": n.onBackground,
393
+ "--fibo-surface": n.surface,
394
+ "--fibo-on-surface": n.onSurface,
395
+ "--fibo-error": n.error,
396
+ "--fibo-font-family": o.fontFamily,
397
+ "--fibo-space-xs": o.spacing.xs,
398
+ "--fibo-space-sm": o.spacing.sm,
399
+ "--fibo-space-md": o.spacing.md,
400
+ "--fibo-space-lg": o.spacing.lg,
401
+ "--fibo-space-xl": o.spacing.xl,
402
+ "--fibo-radius-sm": o.borderRadius.sm,
403
+ "--fibo-radius-md": o.borderRadius.md,
404
+ "--fibo-radius-lg": o.borderRadius.lg,
405
+ "--fibo-radius-full": o.borderRadius.full,
406
+ "--fibo-shadow-sm": o.shadows.sm,
407
+ "--fibo-shadow-md": o.shadows.md,
408
+ "--fibo-shadow-lg": o.shadows.lg
409
+ };
410
+ return n.primaryVariant && (r["--fibo-primary-variant"] = n.primaryVariant), n.secondaryVariant && (r["--fibo-secondary-variant"] = n.secondaryVariant), n.success && (r["--fibo-success"] = n.success), n.warning && (r["--fibo-warning"] = n.warning), n.info && (r["--fibo-info"] = n.info), n.onError && (r["--fibo-on-error"] = n.onError), n.outline && (r["--fibo-outline"] = n.outline), Object.keys(o.typography).forEach((a) => {
411
+ const i = o.typography[a], t = d(a);
412
+ i.fontSize != null && (r[`${t}-size`] = String(i.fontSize)), i.fontWeight != null && (r[`${t}-weight`] = String(i.fontWeight)), i.letterSpacing != null && (r[`${t}-tracking`] = String(i.letterSpacing)), i.lineHeight != null && (r[`${t}-height`] = String(i.lineHeight)), i.color != null && (r[`${t}-color`] = String(i.color));
413
+ }), r;
414
+ }
415
+ function u(o) {
416
+ return p(o);
417
+ }
418
+ function b(o) {
419
+ const n = p(o), r = Object.entries(n).map(([i, t]) => ` ${i}: ${t};`).join(`
420
+ `);
421
+ return `.fibo-theme-${o.name || "custom"} {
422
+ ${r}
423
+ }`;
424
+ }
425
+ function S(o) {
426
+ return `fibo-theme-${o.name || "custom"}`;
427
+ }
428
+ export {
429
+ l as F,
430
+ F as a,
431
+ u as b,
432
+ s as c,
433
+ b as d,
434
+ m as e,
435
+ S as f,
436
+ f as m,
437
+ c as n,
438
+ h as r,
439
+ p as t,
440
+ g as w
441
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiboui",
3
- "version": "2.2.4",
3
+ "version": "2.4.0",
4
4
  "description": "A Flutter/SwiftUI-inspired React UI framework with builder pattern and theme system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",