fiboui 2.2.4 → 2.3.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.
@@ -1,302 +0,0 @@
1
- "use client";
2
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
3
- import { useState as a, useEffect as s, createContext as h, useContext as d } from "react";
4
- const b = {
5
- name: "material",
6
- colors: {
7
- primary: "#6750A4",
8
- primaryVariant: "#4F378B",
9
- secondary: "#625B71",
10
- secondaryVariant: "#4A4458",
11
- background: "#FFFBFE",
12
- surface: "#FFFBFE",
13
- error: "#B3261E",
14
- success: "#4CAF50",
15
- warning: "#FF9800",
16
- info: "#2196F3",
17
- onPrimary: "#FFFFFF",
18
- onSecondary: "#000000",
19
- onBackground: "#000000",
20
- onSurface: "#000000",
21
- onError: "#FFFFFF"
22
- },
23
- typography: {
24
- h1: {
25
- fontSize: "96px",
26
- fontWeight: 300,
27
- letterSpacing: "-1.5px"
28
- },
29
- h2: {
30
- fontSize: "60px",
31
- fontWeight: 300,
32
- letterSpacing: "-0.5px"
33
- },
34
- h3: {
35
- fontSize: "48px",
36
- fontWeight: 400
37
- },
38
- h4: {
39
- fontSize: "34px",
40
- fontWeight: 400,
41
- letterSpacing: "0.25px"
42
- },
43
- h5: {
44
- fontSize: "24px",
45
- fontWeight: 400
46
- },
47
- h6: {
48
- fontSize: "20px",
49
- fontWeight: 500,
50
- letterSpacing: "0.15px"
51
- },
52
- body: {
53
- fontSize: "16px",
54
- fontWeight: 400,
55
- letterSpacing: "0.5px"
56
- },
57
- caption: {
58
- fontSize: "12px",
59
- fontWeight: 400,
60
- letterSpacing: "0.4px"
61
- },
62
- label: {
63
- fontSize: "14px",
64
- fontWeight: 500,
65
- letterSpacing: "1.25px"
66
- }
67
- },
68
- spacing: {
69
- xs: "4px",
70
- sm: "8px",
71
- md: "16px",
72
- lg: "24px",
73
- xl: "32px"
74
- },
75
- borderRadius: {
76
- sm: "4px",
77
- md: "8px",
78
- lg: "16px",
79
- full: "9999px"
80
- },
81
- shadows: {
82
- sm: "0 2px 4px rgba(0,0,0,0.1)",
83
- md: "0 4px 8px rgba(0,0,0,0.12)",
84
- lg: "0 8px 16px rgba(0,0,0,0.14)"
85
- },
86
- fontFamily: "Roboto, sans-serif"
87
- }, y = {
88
- name: "cupertino",
89
- colors: {
90
- primary: "#007AFF",
91
- secondary: "#AF52DE",
92
- background: "#FFFFFF",
93
- surface: "#F2F2F7",
94
- error: "#FF3B30",
95
- success: "#34C759",
96
- warning: "#FF9500",
97
- info: "#5AC8FA",
98
- onPrimary: "#FFFFFF",
99
- onSecondary: "#FFFFFF",
100
- onBackground: "#000000",
101
- onSurface: "#000000",
102
- onError: "#FFFFFF"
103
- },
104
- typography: {
105
- h1: {
106
- fontSize: "34px",
107
- fontWeight: 700,
108
- letterSpacing: "0.37px"
109
- },
110
- h2: {
111
- fontSize: "28px",
112
- fontWeight: 700,
113
- letterSpacing: "0.36px"
114
- },
115
- h3: {
116
- fontSize: "22px",
117
- fontWeight: 600,
118
- letterSpacing: "0.35px"
119
- },
120
- h4: {
121
- fontSize: "20px",
122
- fontWeight: 600
123
- },
124
- h5: {
125
- fontSize: "17px",
126
- fontWeight: 600,
127
- letterSpacing: "-0.41px"
128
- },
129
- h6: {
130
- fontSize: "15px",
131
- fontWeight: 600,
132
- letterSpacing: "-0.24px"
133
- },
134
- body: {
135
- fontSize: "17px",
136
- fontWeight: 400,
137
- letterSpacing: "-0.41px"
138
- },
139
- caption: {
140
- fontSize: "13px",
141
- fontWeight: 400,
142
- letterSpacing: "-0.08px"
143
- },
144
- label: {
145
- fontSize: "15px",
146
- fontWeight: 500,
147
- letterSpacing: "-0.24px"
148
- }
149
- },
150
- spacing: {
151
- xs: "4px",
152
- sm: "8px",
153
- md: "12px",
154
- lg: "20px",
155
- xl: "32px"
156
- },
157
- borderRadius: {
158
- sm: "8px",
159
- md: "12px",
160
- lg: "20px",
161
- full: "9999px"
162
- },
163
- shadows: {
164
- sm: "0 1px 3px rgba(0,0,0,0.08)",
165
- md: "0 2px 8px rgba(0,0,0,0.1)",
166
- lg: "0 4px 16px rgba(0,0,0,0.12)"
167
- },
168
- fontFamily: '-apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif'
169
- }, S = {
170
- name: "web",
171
- colors: {
172
- primary: "#3B82F6",
173
- secondary: "#8B5CF6",
174
- background: "#FFFFFF",
175
- surface: "#F9FAFB",
176
- error: "#EF4444",
177
- success: "#10B981",
178
- warning: "#F59E0B",
179
- info: "#06B6D4",
180
- onPrimary: "#FFFFFF",
181
- onSecondary: "#FFFFFF",
182
- onBackground: "#111827",
183
- onSurface: "#374151",
184
- onError: "#FFFFFF"
185
- },
186
- typography: {
187
- h1: {
188
- fontSize: "60px",
189
- fontWeight: 800,
190
- letterSpacing: "-0.02em"
191
- },
192
- h2: {
193
- fontSize: "48px",
194
- fontWeight: 700,
195
- letterSpacing: "-0.01em"
196
- },
197
- h3: {
198
- fontSize: "36px",
199
- fontWeight: 700
200
- },
201
- h4: {
202
- fontSize: "30px",
203
- fontWeight: 600
204
- },
205
- h5: {
206
- fontSize: "24px",
207
- fontWeight: 600
208
- },
209
- h6: {
210
- fontSize: "20px",
211
- fontWeight: 600
212
- },
213
- body: {
214
- fontSize: "16px",
215
- fontWeight: 400,
216
- lineHeight: "1.5"
217
- },
218
- caption: {
219
- fontSize: "14px",
220
- fontWeight: 400,
221
- lineHeight: "1.4"
222
- },
223
- label: {
224
- fontSize: "14px",
225
- fontWeight: 500,
226
- letterSpacing: "0.01em"
227
- }
228
- },
229
- spacing: {
230
- xs: "4px",
231
- sm: "8px",
232
- md: "16px",
233
- lg: "24px",
234
- xl: "32px"
235
- },
236
- borderRadius: {
237
- sm: "6px",
238
- md: "8px",
239
- lg: "12px",
240
- full: "9999px"
241
- },
242
- shadows: {
243
- sm: "0 1px 2px rgba(0,0,0,0.05)",
244
- md: "0 4px 6px rgba(0,0,0,0.07)",
245
- lg: "0 10px 15px rgba(0,0,0,0.1)"
246
- },
247
- fontFamily: "Inter, system-ui, sans-serif"
248
- }, c = h(void 0), f = {
249
- material: b,
250
- cupertino: y,
251
- web: S
252
- };
253
- function W({
254
- theme: o = "material",
255
- children: F
256
- }) {
257
- const [n, i] = a(o), [t, x] = a(f[o]);
258
- s(() => {
259
- i(o);
260
- }, [o]), s(() => {
261
- const r = f[n];
262
- if (x(r), typeof document < "u") {
263
- const e = document.documentElement;
264
- e.classList.remove("fibo-theme-material", "fibo-theme-cupertino", "fibo-theme-web"), e.classList.add(`fibo-theme-${n}`), e.style.setProperty("--fibo-primary", r.colors.primary), e.style.setProperty("--fibo-secondary", r.colors.secondary), e.style.setProperty("--fibo-background", r.colors.background), e.style.setProperty("--fibo-surface", r.colors.surface), e.style.setProperty("--fibo-error", r.colors.error), e.style.setProperty("--fibo-font-family", r.fontFamily);
265
- }
266
- }, [n]);
267
- const g = {
268
- theme: t,
269
- themeName: n,
270
- setTheme: i
271
- }, l = [
272
- `--fibo-primary:${t.colors.primary}`,
273
- `--fibo-secondary:${t.colors.secondary}`,
274
- `--fibo-background:${t.colors.background}`,
275
- `--fibo-surface:${t.colors.surface}`,
276
- `--fibo-error:${t.colors.error}`,
277
- `--fibo-font-family:${t.fontFamily}`
278
- ].join(";");
279
- return /* @__PURE__ */ p(c.Provider, { value: g, children: /* @__PURE__ */ m("div", { className: `fibo-theme-${n}`, "data-fibo-theme": n, children: [
280
- /* @__PURE__ */ p(
281
- "style",
282
- {
283
- "data-fibo-theme-vars": "1",
284
- dangerouslySetInnerHTML: { __html: `:root{${l}}` }
285
- }
286
- ),
287
- F
288
- ] }) });
289
- }
290
- function B() {
291
- const o = d(c);
292
- if (!o)
293
- throw new Error("useFiboTheme must be used within a FiboThemeProvider");
294
- return o;
295
- }
296
- export {
297
- W as F,
298
- y as c,
299
- b as m,
300
- B as u,
301
- S as w
302
- };