@nextworks/blocks-core 0.2.0-alpha.0 → 0.2.0-alpha.2

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.
Files changed (37) hide show
  1. package/dist/components/AppProviders.client.d.ts +12 -0
  2. package/dist/components/AppProviders.client.d.ts.map +1 -0
  3. package/dist/components/AppProviders.client.js +12 -0
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +1 -0
  7. package/dist-cjs/components/AppProviders.client.cjs +15 -0
  8. package/dist-cjs/components/AppProviders.server.cjs +10 -0
  9. package/dist-cjs/components/enhanced-theme-provider.cjs +142 -0
  10. package/dist-cjs/components/theme-provider.cjs +9 -0
  11. package/dist-cjs/index.cjs +51 -0
  12. package/dist-cjs/lib/themes.cjs +399 -0
  13. package/dist-cjs/lib/utils.cjs +8 -0
  14. package/dist-cjs/providers/BlocksAppProviders.cjs +14 -0
  15. package/dist-cjs/server/theme-vars.cjs +47 -0
  16. package/dist-cjs/server.cjs +10 -0
  17. package/dist-cjs/ui/alert-dialog.cjs +105 -0
  18. package/dist-cjs/ui/brand-node.cjs +46 -0
  19. package/dist-cjs/ui/button.cjs +108 -0
  20. package/dist-cjs/ui/card.cjs +54 -0
  21. package/dist-cjs/ui/checkbox.cjs +60 -0
  22. package/dist-cjs/ui/cta-button.cjs +53 -0
  23. package/dist-cjs/ui/dropdown-menu.cjs +122 -0
  24. package/dist-cjs/ui/feature-card.cjs +20 -0
  25. package/dist-cjs/ui/input.cjs +60 -0
  26. package/dist-cjs/ui/label.cjs +61 -0
  27. package/dist-cjs/ui/pricing-card.cjs +28 -0
  28. package/dist-cjs/ui/select.cjs +56 -0
  29. package/dist-cjs/ui/skeleton.cjs +20 -0
  30. package/dist-cjs/ui/switch.cjs +60 -0
  31. package/dist-cjs/ui/table.cjs +48 -0
  32. package/dist-cjs/ui/testimonial-card.cjs +39 -0
  33. package/dist-cjs/ui/textarea.cjs +60 -0
  34. package/dist-cjs/ui/theme-selector.cjs +92 -0
  35. package/dist-cjs/ui/theme-toggle.cjs +22 -0
  36. package/dist-cjs/ui/toaster.cjs +9 -0
  37. package/package.json +19 -6
@@ -0,0 +1,399 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.darkThemes = exports.themes = void 0;
4
+ exports.themes = {
5
+ default: {
6
+ name: "Default",
7
+ colors: {
8
+ primary: "oklch(0.205 0 0)",
9
+ primaryForeground: "oklch(0.985 0 0)",
10
+ secondary: "oklch(0.97 0 0)",
11
+ secondaryForeground: "oklch(0.205 0 0)",
12
+ accent: "oklch(0.97 0 0)",
13
+ accentForeground: "oklch(0.205 0 0)",
14
+ background: "oklch(1 0 0)",
15
+ foreground: "oklch(0.145 0 0)",
16
+ card: "oklch(1 0 0)",
17
+ cardForeground: "oklch(0.145 0 0)",
18
+ popover: "oklch(1 0 0)",
19
+ popoverForeground: "oklch(0.145 0 0)",
20
+ muted: "oklch(0.97 0 0)",
21
+ mutedForeground: "oklch(0.556 0 0)",
22
+ border: "oklch(0.922 0 0)",
23
+ input: "oklch(0.922 0 0)",
24
+ ring: "oklch(0.708 0 0)",
25
+ destructive: "oklch(0.577 0.245 27.325)",
26
+ chart1: "oklch(0.646 0.222 41.116)",
27
+ chart2: "oklch(0.6 0.118 184.704)",
28
+ chart3: "oklch(0.398 0.07 227.392)",
29
+ chart4: "oklch(0.828 0.189 84.429)",
30
+ chart5: "oklch(0.769 0.188 70.08)",
31
+ },
32
+ },
33
+ monochrome: {
34
+ name: "Monochrome",
35
+ colors: {
36
+ primary: "oklch(0.2 0 0)",
37
+ primaryForeground: "oklch(0.98 0 0)",
38
+ secondary: "oklch(0.95 0 0)",
39
+ secondaryForeground: "oklch(0.2 0 0)",
40
+ accent: "oklch(0.9 0 0)",
41
+ accentForeground: "oklch(0.2 0 0)",
42
+ background: "oklch(1 0 0)",
43
+ foreground: "oklch(0.1 0 0)",
44
+ card: "oklch(0.99 0 0)",
45
+ cardForeground: "oklch(0.1 0 0)",
46
+ popover: "oklch(0.99 0 0)",
47
+ popoverForeground: "oklch(0.1 0 0)",
48
+ muted: "oklch(0.95 0 0)",
49
+ mutedForeground: "oklch(0.5 0 0)",
50
+ border: "oklch(0.9 0 0)",
51
+ input: "oklch(0.9 0 0)",
52
+ ring: "oklch(0.7 0 0)",
53
+ destructive: "oklch(0.4 0 0)",
54
+ chart1: "oklch(0.2 0 0)",
55
+ chart2: "oklch(0.4 0 0)",
56
+ chart3: "oklch(0.6 0 0)",
57
+ chart4: "oklch(0.8 0 0)",
58
+ chart5: "oklch(0.3 0 0)",
59
+ },
60
+ },
61
+ blue: {
62
+ name: "Blue",
63
+ colors: {
64
+ primary: "oklch(0.5 0.2 240)",
65
+ primaryForeground: "oklch(0.98 0 0)",
66
+ secondary: "oklch(0.95 0.05 240)",
67
+ secondaryForeground: "oklch(0.2 0.1 240)",
68
+ accent: "oklch(0.9 0.1 240)",
69
+ accentForeground: "oklch(0.2 0.1 240)",
70
+ background: "oklch(1 0 0)",
71
+ foreground: "oklch(0.1 0 0)",
72
+ card: "oklch(0.99 0 0)",
73
+ cardForeground: "oklch(0.1 0 0)",
74
+ popover: "oklch(0.99 0 0)",
75
+ popoverForeground: "oklch(0.1 0 0)",
76
+ muted: "oklch(0.95 0.02 240)",
77
+ mutedForeground: "oklch(0.5 0.05 240)",
78
+ border: "oklch(0.9 0.05 240)",
79
+ input: "oklch(0.9 0.05 240)",
80
+ ring: "oklch(0.5 0.2 240)",
81
+ destructive: "oklch(0.6 0.2 0)",
82
+ chart1: "oklch(0.5 0.2 240)",
83
+ chart2: "oklch(0.6 0.15 200)",
84
+ chart3: "oklch(0.7 0.1 180)",
85
+ chart4: "oklch(0.4 0.2 280)",
86
+ chart5: "oklch(0.8 0.1 220)",
87
+ },
88
+ },
89
+ green: {
90
+ name: "Green",
91
+ colors: {
92
+ primary: "oklch(0.5 0.2 140)",
93
+ primaryForeground: "oklch(0.98 0 0)",
94
+ secondary: "oklch(0.95 0.05 140)",
95
+ secondaryForeground: "oklch(0.2 0.1 140)",
96
+ accent: "oklch(0.9 0.1 140)",
97
+ accentForeground: "oklch(0.2 0.1 140)",
98
+ background: "oklch(1 0 0)",
99
+ foreground: "oklch(0.1 0 0)",
100
+ card: "oklch(0.99 0 0)",
101
+ cardForeground: "oklch(0.1 0 0)",
102
+ popover: "oklch(0.99 0 0)",
103
+ popoverForeground: "oklch(0.1 0 0)",
104
+ muted: "oklch(0.95 0.02 140)",
105
+ mutedForeground: "oklch(0.5 0.05 140)",
106
+ border: "oklch(0.9 0.05 140)",
107
+ input: "oklch(0.9 0.05 140)",
108
+ ring: "oklch(0.5 0.2 140)",
109
+ destructive: "oklch(0.6 0.2 0)",
110
+ chart1: "oklch(0.5 0.2 140)",
111
+ chart2: "oklch(0.6 0.15 120)",
112
+ chart3: "oklch(0.7 0.1 100)",
113
+ chart4: "oklch(0.4 0.2 160)",
114
+ chart5: "oklch(0.8 0.1 130)",
115
+ },
116
+ },
117
+ purple: {
118
+ name: "Purple",
119
+ colors: {
120
+ primary: "oklch(0.5 0.2 300)",
121
+ primaryForeground: "oklch(0.98 0 0)",
122
+ secondary: "oklch(0.95 0.05 300)",
123
+ secondaryForeground: "oklch(0.2 0.1 300)",
124
+ accent: "oklch(0.9 0.1 300)",
125
+ accentForeground: "oklch(0.2 0.1 300)",
126
+ background: "oklch(1 0 0)",
127
+ foreground: "oklch(0.1 0 0)",
128
+ card: "oklch(0.99 0 0)",
129
+ cardForeground: "oklch(0.1 0 0)",
130
+ popover: "oklch(0.99 0 0)",
131
+ popoverForeground: "oklch(0.1 0 0)",
132
+ muted: "oklch(0.95 0.02 300)",
133
+ mutedForeground: "oklch(0.5 0.05 300)",
134
+ border: "oklch(0.9 0.05 300)",
135
+ input: "oklch(0.9 0.05 300)",
136
+ ring: "oklch(0.5 0.2 300)",
137
+ destructive: "oklch(0.6 0.2 0)",
138
+ chart1: "oklch(0.5 0.2 300)",
139
+ chart2: "oklch(0.6 0.15 280)",
140
+ chart3: "oklch(0.7 0.1 260)",
141
+ chart4: "oklch(0.4 0.2 320)",
142
+ chart5: "oklch(0.8 0.1 290)",
143
+ },
144
+ },
145
+ orange: {
146
+ name: "Orange",
147
+ colors: {
148
+ primary: "oklch(0.6 0.2 40)",
149
+ primaryForeground: "oklch(0.98 0 0)",
150
+ secondary: "oklch(0.95 0.05 40)",
151
+ secondaryForeground: "oklch(0.2 0.1 40)",
152
+ accent: "oklch(0.9 0.1 40)",
153
+ accentForeground: "oklch(0.2 0.1 40)",
154
+ background: "oklch(1 0 0)",
155
+ foreground: "oklch(0.1 0 0)",
156
+ card: "oklch(0.99 0 0)",
157
+ cardForeground: "oklch(0.1 0 0)",
158
+ popover: "oklch(0.99 0 0)",
159
+ popoverForeground: "oklch(0.1 0 0)",
160
+ muted: "oklch(0.95 0.02 40)",
161
+ mutedForeground: "oklch(0.5 0.05 40)",
162
+ border: "oklch(0.9 0.05 40)",
163
+ input: "oklch(0.9 0.05 40)",
164
+ ring: "oklch(0.6 0.2 40)",
165
+ destructive: "oklch(0.6 0.2 0)",
166
+ chart1: "oklch(0.6 0.2 40)",
167
+ chart2: "oklch(0.7 0.15 20)",
168
+ chart3: "oklch(0.8 0.1 0)",
169
+ chart4: "oklch(0.5 0.2 60)",
170
+ chart5: "oklch(0.9 0.1 30)",
171
+ },
172
+ },
173
+ custom: {
174
+ name: "Custom",
175
+ colors: {
176
+ primary: "oklch(0.205 0 0)",
177
+ primaryForeground: "oklch(0.985 0 0)",
178
+ secondary: "oklch(0.97 0 0)",
179
+ secondaryForeground: "oklch(0.205 0 0)",
180
+ accent: "oklch(0.97 0 0)",
181
+ accentForeground: "oklch(0.205 0 0)",
182
+ background: "oklch(1 0 0)",
183
+ foreground: "oklch(0.145 0 0)",
184
+ card: "oklch(1 0 0)",
185
+ cardForeground: "oklch(0.145 0 0)",
186
+ popover: "oklch(1 0 0)",
187
+ popoverForeground: "oklch(0.145 0 0)",
188
+ muted: "oklch(0.97 0 0)",
189
+ mutedForeground: "oklch(0.556 0 0)",
190
+ border: "oklch(0.922 0 0)",
191
+ input: "oklch(0.922 0 0)",
192
+ ring: "oklch(0.708 0 0)",
193
+ destructive: "oklch(0.577 0.245 27.325)",
194
+ chart1: "oklch(0.646 0.222 41.116)",
195
+ chart2: "oklch(0.6 0.118 184.704)",
196
+ chart3: "oklch(0.398 0.07 227.392)",
197
+ chart4: "oklch(0.828 0.189 84.429)",
198
+ chart5: "oklch(0.769 0.188 70.08)",
199
+ },
200
+ },
201
+ };
202
+ exports.darkThemes = {
203
+ default: {
204
+ name: "Default Dark",
205
+ colors: {
206
+ primary: "oklch(0.922 0 0)",
207
+ primaryForeground: "oklch(0.205 0 0)",
208
+ secondary: "oklch(0.269 0 0)",
209
+ secondaryForeground: "oklch(0.985 0 0)",
210
+ accent: "oklch(0.269 0 0)",
211
+ accentForeground: "oklch(0.985 0 0)",
212
+ background: "oklch(0.145 0 0)",
213
+ foreground: "oklch(0.985 0 0)",
214
+ card: "oklch(0.205 0 0)",
215
+ cardForeground: "oklch(0.985 0 0)",
216
+ popover: "oklch(0.205 0 0)",
217
+ popoverForeground: "oklch(0.985 0 0)",
218
+ muted: "oklch(0.269 0 0)",
219
+ mutedForeground: "oklch(0.708 0 0)",
220
+ border: "oklch(1 0 0 / 10%)",
221
+ input: "oklch(1 0 0 / 15%)",
222
+ ring: "oklch(0.556 0 0)",
223
+ destructive: "oklch(0.704 0.191 22.216)",
224
+ chart1: "oklch(0.488 0.243 264.376)",
225
+ chart2: "oklch(0.696 0.17 162.48)",
226
+ chart3: "oklch(0.769 0.188 70.08)",
227
+ chart4: "oklch(0.627 0.265 303.9)",
228
+ chart5: "oklch(0.645 0.246 16.439)",
229
+ },
230
+ },
231
+ monochrome: {
232
+ name: "Monochrome Dark",
233
+ colors: {
234
+ primary: "oklch(0.8 0 0)",
235
+ primaryForeground: "oklch(0.2 0 0)",
236
+ secondary: "oklch(0.3 0 0)",
237
+ secondaryForeground: "oklch(0.9 0 0)",
238
+ accent: "oklch(0.3 0 0)",
239
+ accentForeground: "oklch(0.9 0 0)",
240
+ background: "oklch(0.1 0 0)",
241
+ foreground: "oklch(0.9 0 0)",
242
+ card: "oklch(0.15 0 0)",
243
+ cardForeground: "oklch(0.9 0 0)",
244
+ popover: "oklch(0.15 0 0)",
245
+ popoverForeground: "oklch(0.9 0 0)",
246
+ muted: "oklch(0.3 0 0)",
247
+ mutedForeground: "oklch(0.6 0 0)",
248
+ border: "oklch(0.2 0 0)",
249
+ input: "oklch(0.2 0 0)",
250
+ ring: "oklch(0.5 0 0)",
251
+ destructive: "oklch(0.6 0 0)",
252
+ chart1: "oklch(0.8 0 0)",
253
+ chart2: "oklch(0.6 0 0)",
254
+ chart3: "oklch(0.4 0 0)",
255
+ chart4: "oklch(0.7 0 0)",
256
+ chart5: "oklch(0.5 0 0)",
257
+ },
258
+ },
259
+ blue: {
260
+ name: "Blue Dark",
261
+ colors: {
262
+ primary: "oklch(0.7 0.2 240)",
263
+ primaryForeground: "oklch(0.1 0 0)",
264
+ secondary: "oklch(0.3 0.1 240)",
265
+ secondaryForeground: "oklch(0.9 0 0)",
266
+ accent: "oklch(0.3 0.1 240)",
267
+ accentForeground: "oklch(0.9 0 0)",
268
+ background: "oklch(0.1 0 0)",
269
+ foreground: "oklch(0.9 0 0)",
270
+ card: "oklch(0.15 0.05 240)",
271
+ cardForeground: "oklch(0.9 0 0)",
272
+ popover: "oklch(0.15 0.05 240)",
273
+ popoverForeground: "oklch(0.9 0 0)",
274
+ muted: "oklch(0.3 0.05 240)",
275
+ mutedForeground: "oklch(0.6 0.05 240)",
276
+ border: "oklch(0.2 0.1 240)",
277
+ input: "oklch(0.2 0.1 240)",
278
+ ring: "oklch(0.7 0.2 240)",
279
+ destructive: "oklch(0.6 0.2 0)",
280
+ chart1: "oklch(0.7 0.2 240)",
281
+ chart2: "oklch(0.6 0.15 200)",
282
+ chart3: "oklch(0.5 0.1 180)",
283
+ chart4: "oklch(0.8 0.2 280)",
284
+ chart5: "oklch(0.4 0.1 220)",
285
+ },
286
+ },
287
+ green: {
288
+ name: "Green Dark",
289
+ colors: {
290
+ primary: "oklch(0.7 0.2 140)",
291
+ primaryForeground: "oklch(0.1 0 0)",
292
+ secondary: "oklch(0.3 0.1 140)",
293
+ secondaryForeground: "oklch(0.9 0 0)",
294
+ accent: "oklch(0.3 0.1 140)",
295
+ accentForeground: "oklch(0.9 0 0)",
296
+ background: "oklch(0.1 0 0)",
297
+ foreground: "oklch(0.9 0 0)",
298
+ card: "oklch(0.15 0.05 140)",
299
+ cardForeground: "oklch(0.9 0 0)",
300
+ popover: "oklch(0.15 0.05 140)",
301
+ popoverForeground: "oklch(0.9 0 0)",
302
+ muted: "oklch(0.3 0.05 140)",
303
+ mutedForeground: "oklch(0.6 0.05 140)",
304
+ border: "oklch(0.2 0.1 140)",
305
+ input: "oklch(0.2 0.1 140)",
306
+ ring: "oklch(0.7 0.2 140)",
307
+ destructive: "oklch(0.6 0.2 0)",
308
+ chart1: "oklch(0.7 0.2 140)",
309
+ chart2: "oklch(0.6 0.15 120)",
310
+ chart3: "oklch(0.5 0.1 100)",
311
+ chart4: "oklch(0.8 0.2 160)",
312
+ chart5: "oklch(0.4 0.1 130)",
313
+ },
314
+ },
315
+ purple: {
316
+ name: "Purple Dark",
317
+ colors: {
318
+ primary: "oklch(0.7 0.2 300)",
319
+ primaryForeground: "oklch(0.1 0 0)",
320
+ secondary: "oklch(0.3 0.1 300)",
321
+ secondaryForeground: "oklch(0.9 0 0)",
322
+ accent: "oklch(0.3 0.1 300)",
323
+ accentForeground: "oklch(0.9 0 0)",
324
+ background: "oklch(0.1 0 0)",
325
+ foreground: "oklch(0.9 0 0)",
326
+ card: "oklch(0.15 0.05 300)",
327
+ cardForeground: "oklch(0.9 0 0)",
328
+ popover: "oklch(0.15 0.05 300)",
329
+ popoverForeground: "oklch(0.9 0 0)",
330
+ muted: "oklch(0.3 0.05 300)",
331
+ mutedForeground: "oklch(0.6 0.05 300)",
332
+ border: "oklch(0.2 0.1 300)",
333
+ input: "oklch(0.2 0.1 300)",
334
+ ring: "oklch(0.7 0.2 300)",
335
+ destructive: "oklch(0.6 0.2 0)",
336
+ chart1: "oklch(0.7 0.2 300)",
337
+ chart2: "oklch(0.6 0.15 280)",
338
+ chart3: "oklch(0.5 0.1 260)",
339
+ chart4: "oklch(0.8 0.2 320)",
340
+ chart5: "oklch(0.4 0.1 290)",
341
+ },
342
+ },
343
+ orange: {
344
+ name: "Orange Dark",
345
+ colors: {
346
+ primary: "oklch(0.8 0.2 40)",
347
+ primaryForeground: "oklch(0.1 0 0)",
348
+ secondary: "oklch(0.3 0.1 40)",
349
+ secondaryForeground: "oklch(0.9 0 0)",
350
+ accent: "oklch(0.3 0.1 40)",
351
+ accentForeground: "oklch(0.9 0 0)",
352
+ background: "oklch(0.1 0 0)",
353
+ foreground: "oklch(0.9 0 0)",
354
+ card: "oklch(0.15 0.05 40)",
355
+ cardForeground: "oklch(0.9 0 0)",
356
+ popover: "oklch(0.15 0.05 40)",
357
+ popoverForeground: "oklch(0.9 0 0)",
358
+ muted: "oklch(0.3 0.05 40)",
359
+ mutedForeground: "oklch(0.6 0.05 40)",
360
+ border: "oklch(0.2 0.1 40)",
361
+ input: "oklch(0.2 0.1 40)",
362
+ ring: "oklch(0.8 0.2 40)",
363
+ destructive: "oklch(0.6 0.2 0)",
364
+ chart1: "oklch(0.8 0.2 40)",
365
+ chart2: "oklch(0.7 0.15 20)",
366
+ chart3: "oklch(0.6 0.1 0)",
367
+ chart4: "oklch(0.9 0.2 60)",
368
+ chart5: "oklch(0.5 0.1 30)",
369
+ },
370
+ },
371
+ custom: {
372
+ name: "Custom Dark",
373
+ colors: {
374
+ primary: "oklch(0.922 0 0)",
375
+ primaryForeground: "oklch(0.205 0 0)",
376
+ secondary: "oklch(0.269 0 0)",
377
+ secondaryForeground: "oklch(0.985 0 0)",
378
+ accent: "oklch(0.269 0 0)",
379
+ accentForeground: "oklch(0.985 0 0)",
380
+ background: "oklch(0.145 0 0)",
381
+ foreground: "oklch(0.985 0 0)",
382
+ card: "oklch(0.205 0 0)",
383
+ cardForeground: "oklch(0.985 0 0)",
384
+ popover: "oklch(0.205 0 0)",
385
+ popoverForeground: "oklch(0.985 0 0)",
386
+ muted: "oklch(0.269 0 0)",
387
+ mutedForeground: "oklch(0.708 0 0)",
388
+ border: "oklch(1 0 0 / 10%)",
389
+ input: "oklch(1 0 0 / 15%)",
390
+ ring: "oklch(0.556 0 0)",
391
+ destructive: "oklch(0.704 0.191 22.216)",
392
+ chart1: "oklch(0.488 0.243 264.376)",
393
+ chart2: "oklch(0.696 0.17 162.48)",
394
+ chart3: "oklch(0.769 0.188 70.08)",
395
+ chart4: "oklch(0.627 0.265 303.9)",
396
+ chart5: "oklch(0.645 0.246 16.439)",
397
+ },
398
+ },
399
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cn = cn;
4
+ const clsx_1 = require("clsx");
5
+ const tailwind_merge_1 = require("tailwind-merge");
6
+ function cn(...inputs) {
7
+ return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
8
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.BlocksAppProviders = BlocksAppProviders;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const enhanced_theme_provider_1 = require("../components/enhanced-theme-provider");
7
+ /**
8
+ * Client-safe provider wrapper for Nextworks blocks.
9
+ *
10
+ * This file intentionally contains no next/* imports.
11
+ */
12
+ function BlocksAppProviders({ children, defaultThemeVariant = "monochrome", }) {
13
+ return ((0, jsx_runtime_1.jsx)(enhanced_theme_provider_1.EnhancedThemeProvider, { defaultThemeVariant: defaultThemeVariant, children: children }));
14
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getInitialThemeFromCookies = getInitialThemeFromCookies;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const headers_1 = require("next/headers");
6
+ const themes_1 = require("../lib/themes");
7
+ function toCssVars(colors) {
8
+ return Object.entries(colors)
9
+ .map(([key, value]) => `--${key.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${value};`)
10
+ .join("");
11
+ }
12
+ function safeParseCustomTokens(value) {
13
+ if (!value)
14
+ return null;
15
+ try {
16
+ return JSON.parse(decodeURIComponent(value));
17
+ }
18
+ catch (_a) {
19
+ return null;
20
+ }
21
+ }
22
+ /**
23
+ * Server-only: reads cookies and returns initial theme variant + a <style> tag
24
+ * that sets CSS variables for :root and .dark.
25
+ *
26
+ * No next/font usage here (Turbopack-safe).
27
+ */
28
+ async function getInitialThemeFromCookies() {
29
+ var _a, _b;
30
+ const cookieStore = await (0, headers_1.cookies)();
31
+ const cookieVariant = (_a = cookieStore.get("theme-variant")) === null || _a === void 0 ? void 0 : _a.value;
32
+ const variant = cookieVariant && cookieVariant in themes_1.themes ? cookieVariant : "default";
33
+ const cookieCustom = variant === "custom"
34
+ ? safeParseCustomTokens((_b = cookieStore.get("theme-custom")) === null || _b === void 0 ? void 0 : _b.value)
35
+ : null;
36
+ const baseLight = themes_1.themes[variant].colors;
37
+ const baseDark = themes_1.darkThemes[variant].colors;
38
+ const lightMerged = cookieCustom ? Object.assign(Object.assign({}, baseLight), cookieCustom) : baseLight;
39
+ const darkMerged = cookieCustom ? Object.assign(Object.assign({}, baseDark), cookieCustom) : baseDark;
40
+ const lightVars = toCssVars(lightMerged);
41
+ const darkVars = toCssVars(darkMerged);
42
+ const inlineThemeCss = `:root{${lightVars}}.dark{${darkVars}}`;
43
+ return {
44
+ variant,
45
+ styleTag: ((0, jsx_runtime_1.jsx)("style", { id: "theme-variant-vars", dangerouslySetInnerHTML: { __html: inlineThemeCss } })),
46
+ };
47
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // Server-only exports for @nextworks/blocks-core
3
+ // Use this entry for components that must only run on the server.
4
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AppProviders = void 0;
9
+ var AppProviders_server_1 = require("./components/AppProviders.server.cjs");
10
+ Object.defineProperty(exports, "AppProviders", { enumerable: true, get: function () { return __importDefault(AppProviders_server_1).default; } });
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ "use client";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __rest = (this && this.__rest) || function (s, e) {
37
+ var t = {};
38
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
39
+ t[p] = s[p];
40
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
41
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
42
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
43
+ t[p[i]] = s[p[i]];
44
+ }
45
+ return t;
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.AlertDialogTrigger = exports.AlertDialogTitle = exports.AlertDialogPortal = exports.AlertDialogOverlay = exports.AlertDialogDescription = exports.AlertDialogContent = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialog = void 0;
49
+ exports.AlertDialogFooter = AlertDialogFooter;
50
+ exports.AlertDialogHeader = AlertDialogHeader;
51
+ const jsx_runtime_1 = require("react/jsx-runtime");
52
+ const React = __importStar(require("react"));
53
+ const AlertDialogPrimitive = __importStar(require("@radix-ui/react-alert-dialog"));
54
+ const utils_1 = require("../lib/utils");
55
+ const AlertDialog = AlertDialogPrimitive.Root;
56
+ exports.AlertDialog = AlertDialog;
57
+ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
58
+ exports.AlertDialogTrigger = AlertDialogTrigger;
59
+ const AlertDialogPortal = AlertDialogPrimitive.Portal;
60
+ exports.AlertDialogPortal = AlertDialogPortal;
61
+ const AlertDialogOverlay = React.forwardRef((_a, ref) => {
62
+ var { className } = _a, props = __rest(_a, ["className"]);
63
+ return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Overlay, Object.assign({ ref: ref, className: (0, utils_1.cn)("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm", className) }, props)));
64
+ });
65
+ exports.AlertDialogOverlay = AlertDialogOverlay;
66
+ AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
67
+ const AlertDialogContent = React.forwardRef((_a, ref) => {
68
+ var { className } = _a, props = __rest(_a, ["className"]);
69
+ return ((0, jsx_runtime_1.jsxs)(AlertDialogPortal, { children: [(0, jsx_runtime_1.jsx)(AlertDialogOverlay, {}), (0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Content, Object.assign({ ref: ref, className: (0, utils_1.cn)("bg-background fixed top-1/2 left-1/2 z-50 grid w-full max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg", className) }, props))] }));
70
+ });
71
+ exports.AlertDialogContent = AlertDialogContent;
72
+ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
73
+ function AlertDialogHeader(_a) {
74
+ var { className } = _a, props = __rest(_a, ["className"]);
75
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, utils_1.cn)("flex flex-col space-y-1 text-center", className) }, props)));
76
+ }
77
+ function AlertDialogFooter(_a) {
78
+ var { className } = _a, props = __rest(_a, ["className"]);
79
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, utils_1.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className) }, props)));
80
+ }
81
+ const AlertDialogTitle = React.forwardRef((_a, ref) => {
82
+ var { className } = _a, props = __rest(_a, ["className"]);
83
+ return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Title, Object.assign({ ref: ref, className: (0, utils_1.cn)("text-lg font-semibold", className) }, props)));
84
+ });
85
+ exports.AlertDialogTitle = AlertDialogTitle;
86
+ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
87
+ const AlertDialogDescription = React.forwardRef((_a, ref) => {
88
+ var { className } = _a, props = __rest(_a, ["className"]);
89
+ return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Description, Object.assign({ ref: ref, className: (0, utils_1.cn)("text-muted-foreground text-sm", className) }, props)));
90
+ });
91
+ exports.AlertDialogDescription = AlertDialogDescription;
92
+ AlertDialogDescription.displayName =
93
+ AlertDialogPrimitive.Description.displayName;
94
+ const AlertDialogAction = React.forwardRef((_a, ref) => {
95
+ var { className } = _a, props = __rest(_a, ["className"]);
96
+ return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Action, Object.assign({ ref: ref, className: (0, utils_1.cn)("bg-destructive text-destructive-foreground inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium shadow transition-colors hover:opacity-90 focus:outline-none", className) }, props)));
97
+ });
98
+ exports.AlertDialogAction = AlertDialogAction;
99
+ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
100
+ const AlertDialogCancel = React.forwardRef((_a, ref) => {
101
+ var { className } = _a, props = __rest(_a, ["className"]);
102
+ return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Cancel, Object.assign({ ref: ref, className: (0, utils_1.cn)("bg-background hover:bg-muted inline-flex h-9 items-center justify-center rounded-md border px-4 text-sm font-medium shadow focus:outline-none", className) }, props)));
103
+ });
104
+ exports.AlertDialogCancel = AlertDialogCancel;
105
+ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.BrandNodes = void 0;
5
+ exports.BrandNodeIconBadge = BrandNodeIconBadge;
6
+ exports.BrandNodeGradientRing = BrandNodeGradientRing;
7
+ exports.BrandNodeGeometricMark = BrandNodeGeometricMark;
8
+ exports.BrandNodeEmojiBadge = BrandNodeEmojiBadge;
9
+ exports.BrandNodeDiagonalAppIcon = BrandNodeDiagonalAppIcon;
10
+ exports.BrandNodeCubeOutline = BrandNodeCubeOutline;
11
+ const jsx_runtime_1 = require("react/jsx-runtime");
12
+ const lucide_react_1 = require("lucide-react");
13
+ const utils_1 = require("../lib/utils");
14
+ function BrandNodeIconBadge({ className, icon: Icon = lucide_react_1.Sparkles, iconClassName = "h-4 w-4", }) {
15
+ const base = "grid h-8 w-8 place-items-center rounded-md bg-primary/10 ring-1 ring-primary/30 text-primary";
16
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)(base, className), "aria-label": "Brand icon badge", children: (0, jsx_runtime_1.jsx)(Icon, { className: iconClassName }) }));
17
+ }
18
+ function BrandNodeGradientRing({ className, gradient = "conic-gradient(hsl(var(--primary)), hsl(var(--accent)), hsl(var(--primary)))", innerBgClassName = "h-full w-full rounded-full bg-background", }) {
19
+ const base = "relative h-8 w-8";
20
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)(base, className), "aria-label": "Brand gradient ring", children: (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 rounded-full p-[2px]", style: { background: gradient }, children: (0, jsx_runtime_1.jsx)("div", { className: innerBgClassName }) }) }));
21
+ }
22
+ function BrandNodeGeometricMark({ className }) {
23
+ const base = "grid h-8 w-8 place-items-center rounded-md bg-gradient-to-br from-primary/10 to-accent/10 ring-1 ring-border";
24
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)(base, className), "aria-label": "Brand geometric mark", children: (0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 24 24", className: "fill-primary h-4 w-4", children: (0, jsx_runtime_1.jsx)("path", { d: "M12 4l8 14H4l8-14z" }) }) }));
25
+ }
26
+ function BrandNodeEmojiBadge({ className, emoji = "⚡", }) {
27
+ const base = "grid h-8 w-8 place-items-center rounded-md bg-card/60 backdrop-blur ring-1 ring-border";
28
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)(base, className), "aria-label": "Brand emoji badge", children: (0, jsx_runtime_1.jsx)("span", { className: "text-base", "aria-hidden": true, children: emoji }) }));
29
+ }
30
+ function BrandNodeDiagonalAppIcon({ className, baseColorClass = "bg-primary", overlayColorClass = "bg-accent", }) {
31
+ const base = "relative h-8 w-8 overflow-hidden rounded-md ring-1 ring-black/5 dark:ring-white/10";
32
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)(base, className), "aria-label": "Brand diagonal app icon", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("absolute inset-0", baseColorClass) }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("absolute inset-0 translate-y-1/3 -skew-y-12", overlayColorClass) })] }));
33
+ }
34
+ function BrandNodeCubeOutline({ className }) {
35
+ const base = "grid h-8 w-8 place-items-center rounded-md bg-foreground text-background ring-1 ring-border";
36
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)(base, className), "aria-label": "Brand cube outline", children: (0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 2l8 4.5v9L12 20 4 15.5v-9L12 2z", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 20v-9M4 6l8 5 8-5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" })] }) }));
37
+ }
38
+ /** Registry for quick swapping by name */
39
+ exports.BrandNodes = {
40
+ IconBadge: BrandNodeIconBadge,
41
+ GradientRing: BrandNodeGradientRing,
42
+ GeometricMark: BrandNodeGeometricMark,
43
+ EmojiBadge: BrandNodeEmojiBadge,
44
+ DiagonalAppIcon: BrandNodeDiagonalAppIcon,
45
+ CubeOutline: BrandNodeCubeOutline,
46
+ };