@rainersoft/design-tokens 1.0.4 → 2.0.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/index.cjs DELETED
@@ -1,1190 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- BACKGROUND: () => BACKGROUND,
24
- GRADIENTS: () => GRADIENTS,
25
- GRADIENT_DIRECTIONS: () => GRADIENT_DIRECTIONS,
26
- darkTheme: () => darkTheme,
27
- darkThemeColors: () => darkThemeColors,
28
- getContrast: () => getContrast,
29
- getContrastInfo: () => getContrastInfo,
30
- getLuminance: () => getLuminance,
31
- hexToRgb: () => hexToRgb,
32
- lightTheme: () => lightTheme,
33
- lightThemeColors: () => lightThemeColors,
34
- meetsWCAGAA: () => meetsWCAGAA,
35
- meetsWCAGAAA: () => meetsWCAGAAA,
36
- radiusTokens: () => radiusTokens,
37
- shadowTokens: () => shadowTokens,
38
- spacingTokens: () => spacingTokens,
39
- themes: () => themes_default,
40
- tokens: () => tokens_default,
41
- typographyTokens: () => typographyTokens,
42
- validateContrast: () => validateContrast
43
- });
44
- module.exports = __toCommonJS(index_exports);
45
-
46
- // tokens/colors/light.json
47
- var light_default = {
48
- $schema: "https://json.schemastore.org/theme.json",
49
- $description: "Light theme color palette - Modern and professional design with WCAG AA compliance",
50
- colors: {
51
- primary: {
52
- base: "#0891b2",
53
- hover: "#0e7490",
54
- active: "#155e75",
55
- disabled: "#d4d4d4",
56
- focus: "#0891b2",
57
- background: "#ecfeff",
58
- backgroundHover: "#cffafe",
59
- backgroundActive: "#a5f3fc",
60
- border: "#0891b2",
61
- borderHover: "#0e7490",
62
- borderFocus: "#06b6d4",
63
- text: "#ffffff",
64
- textHover: "#ffffff",
65
- textDisabled: "#a3a3a3"
66
- },
67
- secondary: {
68
- base: "#9333ea",
69
- hover: "#7e22ce",
70
- active: "#6b21a8",
71
- disabled: "#d4d4d4",
72
- focus: "#9333ea",
73
- background: "#faf5ff",
74
- backgroundHover: "#f3e8ff",
75
- backgroundActive: "#e9d5ff",
76
- border: "#9333ea",
77
- borderHover: "#7e22ce",
78
- borderFocus: "#a855f7",
79
- text: "#ffffff",
80
- textHover: "#ffffff",
81
- textDisabled: "#a3a3a3"
82
- },
83
- accent: {
84
- base: "#db2777",
85
- hover: "#be185d",
86
- active: "#9f1239",
87
- disabled: "#d4d4d4",
88
- focus: "#db2777",
89
- background: "#fdf2f8",
90
- backgroundHover: "#fce7f3",
91
- backgroundActive: "#fbcfe8",
92
- border: "#db2777",
93
- borderHover: "#be185d",
94
- borderFocus: "#ec4899",
95
- text: "#ffffff",
96
- textHover: "#ffffff",
97
- textDisabled: "#a3a3a3"
98
- },
99
- background: {
100
- primary: "#ffffff",
101
- secondary: "#fafafa",
102
- tertiary: "#f5f5f5",
103
- inverse: "#0a0a0f",
104
- overlay: "rgba(0, 0, 0, 0.5)",
105
- muted: "#f9fafb"
106
- },
107
- surface: {
108
- primary: "#ffffff",
109
- secondary: "#fafafa",
110
- tertiary: "#f5f5f5",
111
- elevated: "#ffffff",
112
- overlay: "rgba(0, 0, 0, 0.5)",
113
- hover: "#f9fafb",
114
- active: "#f3f4f6"
115
- },
116
- text: {
117
- primary: "#171717",
118
- secondary: "#404040",
119
- tertiary: "#737373",
120
- inverse: "#ffffff",
121
- disabled: "#a3a3a3",
122
- link: "#0891b2",
123
- linkHover: "#0e7490",
124
- linkActive: "#155e75",
125
- linkVisited: "#7e22ce",
126
- onPrimary: "#ffffff",
127
- onSecondary: "#ffffff",
128
- onAccent: "#ffffff",
129
- onBackground: "#171717",
130
- onSurface: "#171717"
131
- },
132
- border: {
133
- primary: "#e5e5e5",
134
- secondary: "#d4d4d4",
135
- tertiary: "#a3a3a3",
136
- focus: "#0891b2",
137
- focusRing: "#06b6d4",
138
- inverse: "#404040",
139
- hover: "#d4d4d4",
140
- active: "#a3a3a3",
141
- disabled: "#e5e5e5"
142
- },
143
- status: {
144
- success: {
145
- base: "#22c55e",
146
- hover: "#16a34a",
147
- active: "#15803d",
148
- background: "#f0fdf4",
149
- backgroundHover: "#dcfce7",
150
- border: "#86efac",
151
- text: "#ffffff",
152
- textOnBackground: "#166534"
153
- },
154
- warning: {
155
- base: "#f59e0b",
156
- hover: "#d97706",
157
- active: "#b45309",
158
- background: "#fffbeb",
159
- backgroundHover: "#fef3c7",
160
- border: "#fcd34d",
161
- text: "#ffffff",
162
- textOnBackground: "#92400e"
163
- },
164
- error: {
165
- base: "#ef4444",
166
- hover: "#dc2626",
167
- active: "#b91c1c",
168
- background: "#fef2f2",
169
- backgroundHover: "#fee2e2",
170
- border: "#fca5a5",
171
- text: "#ffffff",
172
- textOnBackground: "#991b1b"
173
- },
174
- info: {
175
- base: "#3b82f6",
176
- hover: "#2563eb",
177
- active: "#1d4ed8",
178
- background: "#eff6ff",
179
- backgroundHover: "#dbeafe",
180
- border: "#93c5fd",
181
- text: "#ffffff",
182
- textOnBackground: "#1e40af"
183
- }
184
- },
185
- interactive: {
186
- default: "#0891b2",
187
- hover: "#0e7490",
188
- active: "#155e75",
189
- disabled: "#d4d4d4",
190
- disabledText: "#a3a3a3",
191
- focus: "#0891b2",
192
- focusRing: "#06b6d4"
193
- },
194
- primitive: {
195
- cyan: {
196
- "50": "#ecfeff",
197
- "100": "#cffafe",
198
- "200": "#a5f3fc",
199
- "300": "#67e8f9",
200
- "400": "#22d3ee",
201
- "500": "#06b6d4",
202
- "600": "#0891b2",
203
- "700": "#0e7490",
204
- "800": "#155e75",
205
- "900": "#164e63"
206
- },
207
- purple: {
208
- "50": "#faf5ff",
209
- "100": "#f3e8ff",
210
- "200": "#e9d5ff",
211
- "300": "#d8b4fe",
212
- "400": "#c084fc",
213
- "500": "#a855f7",
214
- "600": "#9333ea",
215
- "700": "#7e22ce",
216
- "800": "#6b21a8",
217
- "900": "#581c87"
218
- },
219
- pink: {
220
- "50": "#fdf2f8",
221
- "100": "#fce7f3",
222
- "200": "#fbcfe8",
223
- "300": "#f9a8d4",
224
- "400": "#f472b6",
225
- "500": "#ec4899",
226
- "600": "#db2777",
227
- "700": "#be185d",
228
- "800": "#9f1239",
229
- "900": "#831843"
230
- },
231
- blue: {
232
- "50": "#eff6ff",
233
- "100": "#dbeafe",
234
- "200": "#bfdbfe",
235
- "300": "#93c5fd",
236
- "400": "#60a5fa",
237
- "500": "#3b82f6",
238
- "600": "#2563eb",
239
- "700": "#1d4ed8",
240
- "800": "#1e40af",
241
- "900": "#1e3a8a"
242
- },
243
- green: {
244
- "50": "#f0fdf4",
245
- "100": "#dcfce7",
246
- "200": "#bbf7d0",
247
- "300": "#86efac",
248
- "400": "#4ade80",
249
- "500": "#22c55e",
250
- "600": "#16a34a",
251
- "700": "#15803d",
252
- "800": "#166534",
253
- "900": "#14532d"
254
- },
255
- orange: {
256
- "50": "#fff7ed",
257
- "100": "#ffedd5",
258
- "200": "#fed7aa",
259
- "300": "#fdba74",
260
- "400": "#fb923c",
261
- "500": "#f97316",
262
- "600": "#ea580c",
263
- "700": "#c2410c",
264
- "800": "#9a3412",
265
- "900": "#7c2d12"
266
- },
267
- red: {
268
- "50": "#fef2f2",
269
- "100": "#fee2e2",
270
- "200": "#fecaca",
271
- "300": "#fca5a5",
272
- "400": "#f87171",
273
- "500": "#ef4444",
274
- "600": "#dc2626",
275
- "700": "#b91c1c",
276
- "800": "#991b1b",
277
- "900": "#7f1d1d"
278
- },
279
- amber: {
280
- "50": "#fffbeb",
281
- "100": "#fef3c7",
282
- "200": "#fde68a",
283
- "300": "#fcd34d",
284
- "400": "#fbbf24",
285
- "500": "#f59e0b",
286
- "600": "#d97706",
287
- "700": "#b45309",
288
- "800": "#92400e",
289
- "900": "#78350f"
290
- },
291
- emerald: {
292
- "50": "#ecfdf5",
293
- "100": "#d1fae5",
294
- "200": "#a7f3d0",
295
- "300": "#6ee7b7",
296
- "400": "#34d399",
297
- "500": "#10b981",
298
- "600": "#059669",
299
- "700": "#047857",
300
- "800": "#065f46",
301
- "900": "#064e3b"
302
- },
303
- neutral: {
304
- "50": "#fafafa",
305
- "100": "#f5f5f5",
306
- "200": "#e5e5e5",
307
- "300": "#d4d4d4",
308
- "400": "#a3a3a3",
309
- "500": "#737373",
310
- "600": "#525252",
311
- "700": "#404040",
312
- "800": "#262626",
313
- "900": "#171717",
314
- "950": "#0a0a0f"
315
- }
316
- }
317
- }
318
- };
319
-
320
- // tokens/colors/dark.json
321
- var dark_default = {
322
- $schema: "https://json.schemastore.org/theme.json",
323
- $description: "Dark theme color palette - Cyberpunk neon style with WCAG AA compliance",
324
- colors: {
325
- primary: {
326
- base: "#00e6ff",
327
- hover: "#1affff",
328
- active: "#4dffff",
329
- disabled: "#404040",
330
- focus: "#00e6ff",
331
- background: "rgba(0, 230, 255, 0.1)",
332
- backgroundHover: "rgba(0, 230, 255, 0.15)",
333
- backgroundActive: "rgba(0, 230, 255, 0.2)",
334
- border: "#00e6ff",
335
- borderHover: "#1affff",
336
- borderFocus: "#4dffff",
337
- text: "#0a0a0f",
338
- textHover: "#0a0a0f",
339
- textDisabled: "#525252"
340
- },
341
- secondary: {
342
- base: "#7d00ff",
343
- hover: "#941aff",
344
- active: "#ab4dff",
345
- disabled: "#404040",
346
- focus: "#7d00ff",
347
- background: "rgba(125, 0, 255, 0.1)",
348
- backgroundHover: "rgba(125, 0, 255, 0.15)",
349
- backgroundActive: "rgba(125, 0, 255, 0.2)",
350
- border: "#7d00ff",
351
- borderHover: "#941aff",
352
- borderFocus: "#ab4dff",
353
- text: "#ffffff",
354
- textHover: "#ffffff",
355
- textDisabled: "#525252"
356
- },
357
- accent: {
358
- base: "#ff00ff",
359
- hover: "#ff1aff",
360
- active: "#ff4dff",
361
- disabled: "#404040",
362
- focus: "#ff00ff",
363
- background: "rgba(255, 0, 255, 0.1)",
364
- backgroundHover: "rgba(255, 0, 255, 0.15)",
365
- backgroundActive: "rgba(255, 0, 255, 0.2)",
366
- border: "#ff00ff",
367
- borderHover: "#ff1aff",
368
- borderFocus: "#ff4dff",
369
- text: "#0a0a0f",
370
- textHover: "#0a0a0f",
371
- textDisabled: "#525252"
372
- },
373
- background: {
374
- primary: "#0a0a0f",
375
- secondary: "#0f0f1a",
376
- tertiary: "#171717",
377
- inverse: "#ffffff",
378
- overlay: "rgba(0, 0, 0, 0.8)",
379
- muted: "#0f0f1a"
380
- },
381
- surface: {
382
- primary: "#171717",
383
- secondary: "#262626",
384
- tertiary: "#404040",
385
- elevated: "#262626",
386
- overlay: "rgba(0, 0, 0, 0.8)",
387
- glass: "rgba(15, 15, 26, 0.7)",
388
- glassHover: "rgba(15, 15, 26, 0.85)",
389
- hover: "#262626",
390
- active: "#404040"
391
- },
392
- text: {
393
- primary: "#b3ffff",
394
- secondary: "#4dffff",
395
- tertiary: "#00e6ff",
396
- inverse: "#0a0a0f",
397
- disabled: "#525252",
398
- link: "#1affff",
399
- linkHover: "#4dffff",
400
- linkActive: "#80ffff",
401
- linkVisited: "#941aff",
402
- onPrimary: "#0a0a0f",
403
- onSecondary: "#ffffff",
404
- onAccent: "#0a0a0f",
405
- onBackground: "#b3ffff",
406
- onSurface: "#b3ffff",
407
- glow: "#00e6ff",
408
- neonCyan: "#00e6ff",
409
- neonPink: "#ff00ff",
410
- neonPurple: "#7d00ff",
411
- neonGreen: "#00ff00"
412
- },
413
- border: {
414
- primary: "#262626",
415
- secondary: "#404040",
416
- tertiary: "#525252",
417
- focus: "#00e6ff",
418
- focusRing: "#1affff",
419
- inverse: "#e5e5e5",
420
- neon: "#00e6ff",
421
- neonGlow: "rgba(0, 230, 255, 0.3)",
422
- hover: "#404040",
423
- active: "#525252",
424
- disabled: "#262626"
425
- },
426
- status: {
427
- success: {
428
- base: "#00ff00",
429
- hover: "#4dff4d",
430
- active: "#80ff80",
431
- background: "rgba(0, 255, 0, 0.1)",
432
- backgroundHover: "rgba(0, 255, 0, 0.15)",
433
- border: "#4dff4d",
434
- text: "#0a0a0f",
435
- textOnBackground: "#4dff4d"
436
- },
437
- warning: {
438
- base: "#ff7d00",
439
- hover: "#ffab4d",
440
- active: "#ffc880",
441
- background: "rgba(255, 125, 0, 0.1)",
442
- backgroundHover: "rgba(255, 125, 0, 0.15)",
443
- border: "#ffab4d",
444
- text: "#0a0a0f",
445
- textOnBackground: "#ffab4d"
446
- },
447
- error: {
448
- base: "#f87171",
449
- hover: "#fca5a5",
450
- active: "#fecaca",
451
- background: "rgba(239, 68, 68, 0.1)",
452
- backgroundHover: "rgba(239, 68, 68, 0.15)",
453
- border: "#fca5a5",
454
- text: "#ffffff",
455
- textOnBackground: "#fca5a5"
456
- },
457
- info: {
458
- base: "#007dff",
459
- hover: "#4dabff",
460
- active: "#80c7ff",
461
- background: "rgba(0, 125, 255, 0.1)",
462
- backgroundHover: "rgba(0, 125, 255, 0.15)",
463
- border: "#4dabff",
464
- text: "#ffffff",
465
- textOnBackground: "#4dabff"
466
- }
467
- },
468
- interactive: {
469
- default: "#00e6ff",
470
- hover: "#1affff",
471
- active: "#4dffff",
472
- disabled: "#404040",
473
- disabledText: "#525252",
474
- focus: "#00e6ff",
475
- focusRing: "#1affff"
476
- },
477
- effects: {
478
- glowCyan: "0 0 20px rgba(0, 230, 255, 0.5), 0 0 40px rgba(0, 230, 255, 0.3)",
479
- glowPink: "0 0 20px rgba(255, 0, 255, 0.5), 0 0 40px rgba(255, 0, 255, 0.3)",
480
- glowPurple: "0 0 20px rgba(125, 0, 255, 0.5), 0 0 40px rgba(125, 0, 255, 0.3)",
481
- glowGreen: "0 0 20px rgba(0, 255, 0, 0.5), 0 0 40px rgba(0, 255, 0, 0.3)",
482
- shadowSm: "0 1px 2px 0 rgba(0, 0, 0, 0.5)",
483
- shadowMd: "0 4px 6px -1px rgba(0, 0, 0, 0.5)",
484
- shadowLg: "0 10px 15px -3px rgba(0, 0, 0, 0.5)"
485
- },
486
- gradients: {
487
- primary: "linear-gradient(135deg, #00e6ff 0%, #7d00ff 100%)",
488
- secondary: "linear-gradient(135deg, #ff00ff 0%, #00e6ff 100%)",
489
- accent: "linear-gradient(135deg, #ff7d00 0%, #ff00ff 100%)",
490
- background: "linear-gradient(180deg, #0a0a0f 0%, #0f0f1a 100%)"
491
- },
492
- primitive: {
493
- cyan: {
494
- "50": "rgba(0, 230, 255, 0.1)",
495
- "100": "rgba(0, 230, 255, 0.15)",
496
- "200": "rgba(0, 230, 255, 0.2)",
497
- "300": "#4dffff",
498
- "400": "#1affff",
499
- "500": "#00e6ff",
500
- "600": "#00b8cc",
501
- "700": "#008a99",
502
- "800": "#005c66",
503
- "900": "#003d44"
504
- },
505
- purple: {
506
- "50": "rgba(125, 0, 255, 0.1)",
507
- "100": "rgba(125, 0, 255, 0.15)",
508
- "200": "rgba(125, 0, 255, 0.2)",
509
- "300": "#ab4dff",
510
- "400": "#941aff",
511
- "500": "#7d00ff",
512
- "600": "#6400cc",
513
- "700": "#4b0099",
514
- "800": "#320066",
515
- "900": "#190033"
516
- },
517
- pink: {
518
- "50": "rgba(255, 0, 255, 0.1)",
519
- "100": "rgba(255, 0, 255, 0.15)",
520
- "200": "rgba(255, 0, 255, 0.2)",
521
- "300": "#ff4dff",
522
- "400": "#ff1aff",
523
- "500": "#ff00ff",
524
- "600": "#cc00cc",
525
- "700": "#990099",
526
- "800": "#660066",
527
- "900": "#330033"
528
- },
529
- blue: {
530
- "50": "rgba(0, 125, 255, 0.1)",
531
- "100": "rgba(0, 125, 255, 0.15)",
532
- "200": "rgba(0, 125, 255, 0.2)",
533
- "300": "#80c7ff",
534
- "400": "#4dabff",
535
- "500": "#007dff",
536
- "600": "#0064cc",
537
- "700": "#004b99",
538
- "800": "#003266",
539
- "900": "#001933"
540
- },
541
- green: {
542
- "50": "rgba(0, 255, 0, 0.1)",
543
- "100": "rgba(0, 255, 0, 0.15)",
544
- "200": "rgba(0, 255, 0, 0.2)",
545
- "300": "#80ff80",
546
- "400": "#4dff4d",
547
- "500": "#00ff00",
548
- "600": "#00cc00",
549
- "700": "#009900",
550
- "800": "#006600",
551
- "900": "#003300"
552
- },
553
- orange: {
554
- "50": "rgba(255, 125, 0, 0.1)",
555
- "100": "rgba(255, 125, 0, 0.15)",
556
- "200": "rgba(255, 125, 0, 0.2)",
557
- "300": "#ffc880",
558
- "400": "#ffab4d",
559
- "500": "#ff7d00",
560
- "600": "#cc6400",
561
- "700": "#994b00",
562
- "800": "#663200",
563
- "900": "#331900"
564
- },
565
- red: {
566
- "50": "rgba(239, 68, 68, 0.1)",
567
- "100": "rgba(239, 68, 68, 0.15)",
568
- "200": "rgba(239, 68, 68, 0.2)",
569
- "300": "#fecaca",
570
- "400": "#fca5a5",
571
- "500": "#f87171",
572
- "600": "#c55a5a",
573
- "700": "#924343",
574
- "800": "#5f2c2c",
575
- "900": "#2c1515"
576
- },
577
- amber: {
578
- "50": "rgba(255, 125, 0, 0.1)",
579
- "100": "rgba(255, 125, 0, 0.15)",
580
- "200": "rgba(255, 125, 0, 0.2)",
581
- "300": "#ffc880",
582
- "400": "#ffab4d",
583
- "500": "#ff7d00",
584
- "600": "#cc6400",
585
- "700": "#994b00",
586
- "800": "#663200",
587
- "900": "#331900"
588
- },
589
- emerald: {
590
- "50": "rgba(0, 255, 0, 0.1)",
591
- "100": "rgba(0, 255, 0, 0.15)",
592
- "200": "rgba(0, 255, 0, 0.2)",
593
- "300": "#80ff80",
594
- "400": "#4dff4d",
595
- "500": "#00ff00",
596
- "600": "#00cc00",
597
- "700": "#009900",
598
- "800": "#006600",
599
- "900": "#003300"
600
- },
601
- neutral: {
602
- "50": "#0f0f1a",
603
- "100": "#171717",
604
- "200": "#262626",
605
- "300": "#404040",
606
- "400": "#525252",
607
- "500": "#737373",
608
- "600": "#a3a3a3",
609
- "700": "#d4d4d4",
610
- "800": "#e5e5e5",
611
- "900": "#f5f5f5",
612
- "950": "#ffffff"
613
- }
614
- }
615
- }
616
- };
617
-
618
- // tokens/typography.json
619
- var typography_default = {
620
- $schema: "https://json.schemastore.org/theme.json",
621
- $description: "Typography tokens - Complete typographic scale with semantic hierarchy (H1-H6, subtitles, body, captions)",
622
- typography: {
623
- fontFamily: {
624
- sans: "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
625
- serif: "ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif",
626
- mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
627
- display: "var(--font-orbitron, ui-sans-serif)",
628
- body: "var(--font-inter, ui-sans-serif)",
629
- code: "var(--font-rajdhani, ui-monospace)"
630
- },
631
- fontSize: {
632
- xs: "0.75rem",
633
- sm: "0.875rem",
634
- base: "1rem",
635
- lg: "1.125rem",
636
- xl: "1.25rem",
637
- "2xl": "1.5rem",
638
- "3xl": "1.875rem",
639
- "4xl": "2.25rem",
640
- "5xl": "3rem",
641
- "6xl": "3.75rem",
642
- "7xl": "4.5rem",
643
- "8xl": "6rem",
644
- "9xl": "8rem"
645
- },
646
- fontWeight: {
647
- thin: "100",
648
- extralight: "200",
649
- light: "300",
650
- normal: "400",
651
- medium: "500",
652
- semibold: "600",
653
- bold: "700",
654
- extrabold: "800",
655
- black: "900"
656
- },
657
- lineHeight: {
658
- none: "1",
659
- tight: "1.25",
660
- snug: "1.375",
661
- normal: "1.5",
662
- relaxed: "1.625",
663
- loose: "2"
664
- },
665
- letterSpacing: {
666
- tighter: "-0.05em",
667
- tight: "-0.025em",
668
- normal: "0em",
669
- wide: "0.025em",
670
- wider: "0.05em",
671
- widest: "0.1em"
672
- },
673
- headings: {
674
- h1: {
675
- fontFamily: "var(--font-display, ui-sans-serif)",
676
- fontSize: "clamp(2.25rem, 5vw + 1rem, 4.5rem)",
677
- fontSizeMobile: "2.25rem",
678
- fontSizeTablet: "3rem",
679
- fontSizeDesktop: "4.5rem",
680
- fontWeight: "900",
681
- lineHeight: "1.1",
682
- letterSpacing: "-0.02em",
683
- marginBottom: "1rem"
684
- },
685
- h2: {
686
- fontFamily: "var(--font-display, ui-sans-serif)",
687
- fontSize: "clamp(1.875rem, 4vw + 0.75rem, 3.75rem)",
688
- fontSizeMobile: "1.875rem",
689
- fontSizeTablet: "2.5rem",
690
- fontSizeDesktop: "3.75rem",
691
- fontWeight: "800",
692
- lineHeight: "1.15",
693
- letterSpacing: "-0.015em",
694
- marginBottom: "0.875rem"
695
- },
696
- h3: {
697
- fontFamily: "var(--font-display, ui-sans-serif)",
698
- fontSize: "clamp(1.5rem, 3vw + 0.5rem, 3rem)",
699
- fontSizeMobile: "1.5rem",
700
- fontSizeTablet: "2rem",
701
- fontSizeDesktop: "3rem",
702
- fontWeight: "700",
703
- lineHeight: "1.2",
704
- letterSpacing: "-0.01em",
705
- marginBottom: "0.75rem"
706
- },
707
- h4: {
708
- fontFamily: "var(--font-body, ui-sans-serif)",
709
- fontSize: "clamp(1.25rem, 2.5vw + 0.5rem, 2.25rem)",
710
- fontSizeMobile: "1.25rem",
711
- fontSizeTablet: "1.75rem",
712
- fontSizeDesktop: "2.25rem",
713
- fontWeight: "700",
714
- lineHeight: "1.25",
715
- letterSpacing: "0em",
716
- marginBottom: "0.625rem"
717
- },
718
- h5: {
719
- fontFamily: "var(--font-body, ui-sans-serif)",
720
- fontSize: "clamp(1.125rem, 2vw + 0.25rem, 1.875rem)",
721
- fontSizeMobile: "1.125rem",
722
- fontSizeTablet: "1.5rem",
723
- fontSizeDesktop: "1.875rem",
724
- fontWeight: "600",
725
- lineHeight: "1.3",
726
- letterSpacing: "0em",
727
- marginBottom: "0.5rem"
728
- },
729
- h6: {
730
- fontFamily: "var(--font-body, ui-sans-serif)",
731
- fontSize: "clamp(1rem, 1.5vw + 0.25rem, 1.5rem)",
732
- fontSizeMobile: "1rem",
733
- fontSizeTablet: "1.25rem",
734
- fontSizeDesktop: "1.5rem",
735
- fontWeight: "600",
736
- lineHeight: "1.35",
737
- letterSpacing: "0.01em",
738
- marginBottom: "0.5rem"
739
- }
740
- },
741
- subtitle: {
742
- large: {
743
- fontFamily: "var(--font-body, ui-sans-serif)",
744
- fontSize: "clamp(1.25rem, 2vw + 0.5rem, 2rem)",
745
- fontSizeMobile: "1.25rem",
746
- fontSizeTablet: "1.5rem",
747
- fontSizeDesktop: "2rem",
748
- fontWeight: "500",
749
- lineHeight: "1.4",
750
- letterSpacing: "0em",
751
- marginBottom: "0.5rem"
752
- },
753
- medium: {
754
- fontFamily: "var(--font-body, ui-sans-serif)",
755
- fontSize: "clamp(1.125rem, 1.5vw + 0.25rem, 1.5rem)",
756
- fontSizeMobile: "1.125rem",
757
- fontSizeTablet: "1.25rem",
758
- fontSizeDesktop: "1.5rem",
759
- fontWeight: "500",
760
- lineHeight: "1.4",
761
- letterSpacing: "0em",
762
- marginBottom: "0.5rem"
763
- },
764
- small: {
765
- fontFamily: "var(--font-body, ui-sans-serif)",
766
- fontSize: "1rem",
767
- fontWeight: "500",
768
- lineHeight: "1.4",
769
- letterSpacing: "0em",
770
- marginBottom: "0.375rem"
771
- }
772
- },
773
- body: {
774
- large: {
775
- fontFamily: "var(--font-body, ui-sans-serif)",
776
- fontSize: "1.125rem",
777
- fontWeight: "400",
778
- lineHeight: "1.625",
779
- letterSpacing: "0em"
780
- },
781
- medium: {
782
- fontFamily: "var(--font-body, ui-sans-serif)",
783
- fontSize: "1rem",
784
- fontWeight: "400",
785
- lineHeight: "1.5",
786
- letterSpacing: "0em"
787
- },
788
- small: {
789
- fontFamily: "var(--font-body, ui-sans-serif)",
790
- fontSize: "0.875rem",
791
- fontWeight: "400",
792
- lineHeight: "1.5",
793
- letterSpacing: "0em"
794
- }
795
- },
796
- caption: {
797
- large: {
798
- fontFamily: "var(--font-body, ui-sans-serif)",
799
- fontSize: "0.875rem",
800
- fontWeight: "400",
801
- lineHeight: "1.4",
802
- letterSpacing: "0.01em"
803
- },
804
- medium: {
805
- fontFamily: "var(--font-body, ui-sans-serif)",
806
- fontSize: "0.75rem",
807
- fontWeight: "400",
808
- lineHeight: "1.4",
809
- letterSpacing: "0.01em"
810
- },
811
- small: {
812
- fontFamily: "var(--font-body, ui-sans-serif)",
813
- fontSize: "0.625rem",
814
- fontWeight: "400",
815
- lineHeight: "1.3",
816
- letterSpacing: "0.02em"
817
- }
818
- },
819
- button: {
820
- large: {
821
- fontFamily: "var(--font-body, ui-sans-serif)",
822
- fontSize: "1.125rem",
823
- fontWeight: "600",
824
- lineHeight: "1.5",
825
- letterSpacing: "0.01em"
826
- },
827
- medium: {
828
- fontFamily: "var(--font-body, ui-sans-serif)",
829
- fontSize: "1rem",
830
- fontWeight: "600",
831
- lineHeight: "1.5",
832
- letterSpacing: "0.01em"
833
- },
834
- small: {
835
- fontFamily: "var(--font-body, ui-sans-serif)",
836
- fontSize: "0.875rem",
837
- fontWeight: "600",
838
- lineHeight: "1.4",
839
- letterSpacing: "0.01em"
840
- }
841
- },
842
- label: {
843
- large: {
844
- fontFamily: "var(--font-body, ui-sans-serif)",
845
- fontSize: "0.875rem",
846
- fontWeight: "600",
847
- lineHeight: "1.4",
848
- letterSpacing: "0.01em"
849
- },
850
- medium: {
851
- fontFamily: "var(--font-body, ui-sans-serif)",
852
- fontSize: "0.75rem",
853
- fontWeight: "600",
854
- lineHeight: "1.4",
855
- letterSpacing: "0.01em"
856
- },
857
- small: {
858
- fontFamily: "var(--font-body, ui-sans-serif)",
859
- fontSize: "0.625rem",
860
- fontWeight: "600",
861
- lineHeight: "1.3",
862
- letterSpacing: "0.02em"
863
- }
864
- },
865
- code: {
866
- inline: {
867
- fontFamily: "var(--font-code, ui-monospace)",
868
- fontSize: "0.875em",
869
- fontWeight: "400",
870
- lineHeight: "1.5",
871
- letterSpacing: "0em"
872
- },
873
- block: {
874
- fontFamily: "var(--font-code, ui-monospace)",
875
- fontSize: "0.875rem",
876
- fontWeight: "400",
877
- lineHeight: "1.6",
878
- letterSpacing: "0em"
879
- }
880
- }
881
- }
882
- };
883
-
884
- // tokens/spacing.json
885
- var spacing_default = {
886
- $schema: "https://json.schemastore.org/theme.json",
887
- $description: "Spacing tokens - Consistent spacing scale based on 8pt grid",
888
- spacing: {
889
- "0": "0px",
890
- px: "1px",
891
- "0.5": "0.125rem",
892
- "1": "0.25rem",
893
- "1.5": "0.375rem",
894
- "2": "0.5rem",
895
- "2.5": "0.625rem",
896
- "3": "0.75rem",
897
- "3.5": "0.875rem",
898
- "4": "1rem",
899
- "5": "1.25rem",
900
- "6": "1.5rem",
901
- "7": "1.75rem",
902
- "8": "2rem",
903
- "9": "2.25rem",
904
- "10": "2.5rem",
905
- "11": "2.75rem",
906
- "12": "3rem",
907
- "14": "3.5rem",
908
- "16": "4rem",
909
- "20": "5rem",
910
- "24": "6rem",
911
- "28": "7rem",
912
- "32": "8rem",
913
- "36": "9rem",
914
- "40": "10rem",
915
- "44": "11rem",
916
- "48": "12rem",
917
- "52": "13rem",
918
- "56": "14rem",
919
- "60": "15rem",
920
- "64": "16rem",
921
- "72": "18rem",
922
- "80": "20rem",
923
- "96": "24rem"
924
- }
925
- };
926
-
927
- // tokens/radius.json
928
- var radius_default = {
929
- $schema: "https://json.schemastore.org/theme.json",
930
- $description: "Border radius tokens - Consistent corner rounding",
931
- radius: {
932
- none: "0px",
933
- sm: "0.125rem",
934
- base: "0.25rem",
935
- md: "0.375rem",
936
- lg: "0.5rem",
937
- xl: "0.75rem",
938
- "2xl": "1rem",
939
- "3xl": "1.5rem",
940
- full: "9999px"
941
- }
942
- };
943
-
944
- // tokens/shadows.json
945
- var shadows_default = {
946
- $schema: "https://json.schemastore.org/theme.json",
947
- $description: "Shadow tokens - Elevation and depth",
948
- shadows: {
949
- light: {
950
- xs: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
951
- sm: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)",
952
- base: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
953
- md: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
954
- lg: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
955
- xl: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
956
- "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
957
- inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)"
958
- },
959
- dark: {
960
- xs: "0 1px 2px 0 rgba(0, 0, 0, 0.5)",
961
- sm: "0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px -1px rgba(0, 0, 0, 0.5)",
962
- base: "0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5)",
963
- md: "0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5)",
964
- lg: "0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5)",
965
- xl: "0 25px 50px -12px rgba(0, 0, 0, 0.75)",
966
- "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.75)",
967
- inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.5)",
968
- glow: {
969
- cyan: "0 0 20px rgba(0, 230, 255, 0.5), 0 0 40px rgba(0, 230, 255, 0.3)",
970
- pink: "0 0 20px rgba(255, 0, 255, 0.5), 0 0 40px rgba(255, 0, 255, 0.3)",
971
- purple: "0 0 20px rgba(125, 0, 255, 0.5), 0 0 40px rgba(125, 0, 255, 0.3)",
972
- green: "0 0 20px rgba(0, 255, 0, 0.5), 0 0 40px rgba(0, 255, 0, 0.3)"
973
- }
974
- }
975
- }
976
- };
977
-
978
- // tokens/utilities.ts
979
- var GRADIENT_DIRECTIONS = {
980
- TO_TOP: "bg-gradient-to-t",
981
- TO_BOTTOM: "bg-gradient-to-b",
982
- TO_LEFT: "bg-gradient-to-l",
983
- TO_RIGHT: "bg-gradient-to-r",
984
- TO_TL: "bg-gradient-to-tl",
985
- TO_TR: "bg-gradient-to-tr",
986
- TO_BL: "bg-gradient-to-bl",
987
- TO_BR: "bg-gradient-to-br"
988
- };
989
- var GRADIENTS = {
990
- // Gradientes de texto usando tokens CSS
991
- TEXT_PRIMARY: "bg-linear-to-r from-[var(--color-primary-base)] via-[var(--color-secondary-base)] to-[var(--color-accent-base)] bg-clip-text text-transparent",
992
- // Gradientes decorativos usando tokens CSS
993
- DECORATIVE_PRIMARY: "bg-linear-to-br from-[var(--color-primary-base)] via-[var(--color-secondary-base)] to-[var(--color-accent-base)]",
994
- DECORATIVE_CYAN_PURPLE: "bg-linear-to-r from-[var(--color-primary-base)] to-[var(--color-secondary-base)]",
995
- DECORATIVE_GREEN_EMERALD: "bg-linear-to-br from-[var(--color-status-success)] to-[var(--color-accent-base)]",
996
- // Gradientes de botões usando tokens CSS
997
- BUTTON_CYAN_BLUE: "bg-linear-to-r from-[var(--color-primary-base)] to-[var(--color-primary-hover)]",
998
- BUTTON_PURPLE_PINK: "bg-linear-to-r from-[var(--color-secondary-base)] to-[var(--color-accent-base)]"
999
- };
1000
- var BACKGROUND = {
1001
- // Background completo usando token CSS
1002
- FULL: "bg-[var(--color-background-primary)]",
1003
- // Overlay de gradiente usando tokens CSS
1004
- GRADIENT_OVERLAY: "bg-linear-to-br from-[var(--color-primary-base)]/10 via-[var(--color-secondary-base)]/10 to-[var(--color-accent-base)]/10",
1005
- // Divisores premium usando tokens CSS
1006
- PREMIUM_DIVIDER_CONTAINER: "bg-linear-to-b from-transparent via-[var(--color-primary-base)]/5 to-transparent",
1007
- PREMIUM_DIVIDER_LINE: "bg-linear-to-r from-transparent via-[var(--color-primary-base)]/50 to-transparent",
1008
- // Backgrounds de seção usando tokens CSS
1009
- SECTION_CYAN: "bg-linear-to-br from-[var(--color-primary-base)]/5 via-[var(--color-primary-base)]/3 to-transparent",
1010
- SECTION_CYAN_VIA: "bg-linear-to-br from-transparent via-[var(--color-primary-base)]/5 to-transparent",
1011
- SECTION_PURPLE_VIA: "bg-linear-to-br from-transparent via-[var(--color-secondary-base)]/5 to-transparent",
1012
- SECTION_PINK_VIA: "bg-linear-to-br from-transparent via-[var(--color-accent-base)]/5 to-transparent"
1013
- };
1014
-
1015
- // tokens/accessibility.ts
1016
- function hexToRgb(hex) {
1017
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
1018
- if (!result) {
1019
- throw new Error(`Invalid hex color: ${hex}`);
1020
- }
1021
- return {
1022
- r: parseInt(result[1], 16),
1023
- g: parseInt(result[2], 16),
1024
- b: parseInt(result[3], 16)
1025
- };
1026
- }
1027
- function getLuminance(r, g, b) {
1028
- const [rs, gs, bs] = [r, g, b].map((val) => {
1029
- const v = val / 255;
1030
- return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
1031
- });
1032
- return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
1033
- }
1034
- function getContrast(color1, color2) {
1035
- const rgb1 = hexToRgb(color1);
1036
- const rgb2 = hexToRgb(color2);
1037
- const lum1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);
1038
- const lum2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);
1039
- const lighter = Math.max(lum1, lum2);
1040
- const darker = Math.min(lum1, lum2);
1041
- return (lighter + 0.05) / (darker + 0.05);
1042
- }
1043
- function meetsWCAGAA(foreground, background, largeText = false) {
1044
- const contrast = getContrast(foreground, background);
1045
- return largeText ? contrast >= 3 : contrast >= 4.5;
1046
- }
1047
- function meetsWCAGAAA(foreground, background, largeText = false) {
1048
- const contrast = getContrast(foreground, background);
1049
- return largeText ? contrast >= 4.5 : contrast >= 7;
1050
- }
1051
- function getContrastInfo(foreground, background) {
1052
- const contrast = getContrast(foreground, background);
1053
- const meetsAA = contrast >= 4.5;
1054
- const meetsAALarge = contrast >= 3;
1055
- const meetsAAA = contrast >= 7;
1056
- const meetsAAALarge = contrast >= 4.5;
1057
- let level = "Fail";
1058
- if (meetsAAA) {
1059
- level = "AAA";
1060
- } else if (meetsAAALarge) {
1061
- level = "AAA Large";
1062
- } else if (meetsAA) {
1063
- level = "AA";
1064
- } else if (meetsAALarge) {
1065
- level = "AA Large";
1066
- }
1067
- return {
1068
- contrast,
1069
- meetsAA,
1070
- meetsAALarge,
1071
- meetsAAA,
1072
- meetsAAALarge,
1073
- level
1074
- };
1075
- }
1076
- function validateContrast(foreground, background, options = {}) {
1077
- const { requireAAA = false, largeText = false } = options;
1078
- const info = getContrastInfo(foreground, background);
1079
- let valid = false;
1080
- let message = "";
1081
- if (requireAAA) {
1082
- valid = largeText ? info.meetsAAALarge : info.meetsAAA;
1083
- message = valid ? `Contraste v\xE1lido (WCAG AAA${largeText ? " - Texto Grande" : ""})` : `Contraste insuficiente para WCAG AAA${largeText ? " - Texto Grande" : ""}. Requerido: ${largeText ? "4.5:1" : "7:1"}, atual: ${info.contrast.toFixed(2)}:1`;
1084
- } else {
1085
- valid = largeText ? info.meetsAALarge : info.meetsAA;
1086
- message = valid ? `Contraste v\xE1lido (WCAG AA${largeText ? " - Texto Grande" : ""})` : `Contraste insuficiente para WCAG AA${largeText ? " - Texto Grande" : ""}. Requerido: ${largeText ? "3:1" : "4.5:1"}, atual: ${info.contrast.toFixed(2)}:1`;
1087
- }
1088
- return {
1089
- valid,
1090
- level: info.level,
1091
- contrast: info.contrast,
1092
- message
1093
- };
1094
- }
1095
-
1096
- // tokens/index.ts
1097
- var tokens = {
1098
- colors: {
1099
- light: light_default.colors,
1100
- dark: dark_default.colors
1101
- },
1102
- typography: typography_default.typography,
1103
- spacing: spacing_default.spacing,
1104
- radius: radius_default.radius,
1105
- shadows: shadows_default.shadows
1106
- };
1107
- var lightThemeColors = light_default.colors;
1108
- var darkThemeColors = dark_default.colors;
1109
- var typographyTokens = typography_default.typography;
1110
- var spacingTokens = spacing_default.spacing;
1111
- var radiusTokens = radius_default.radius;
1112
- var shadowTokens = shadows_default.shadows;
1113
- var tokens_default = tokens;
1114
-
1115
- // themes/light.ts
1116
- var lightTheme = {
1117
- colors: tokens.colors.light,
1118
- typography: tokens.typography,
1119
- spacing: tokens.spacing,
1120
- radius: tokens.radius,
1121
- shadows: tokens.shadows.light
1122
- };
1123
-
1124
- // themes/dark.ts
1125
- var darkTheme = {
1126
- colors: tokens.colors.dark,
1127
- typography: tokens.typography,
1128
- spacing: tokens.spacing,
1129
- radius: tokens.radius,
1130
- shadows: tokens.shadows.dark
1131
- };
1132
-
1133
- // themes/index.ts
1134
- var themes = {
1135
- light: lightTheme,
1136
- dark: darkTheme
1137
- };
1138
- var themes_default = themes;
1139
- // Annotate the CommonJS export names for ESM import in node:
1140
- 0 && (module.exports = {
1141
- BACKGROUND,
1142
- GRADIENTS,
1143
- GRADIENT_DIRECTIONS,
1144
- darkTheme,
1145
- darkThemeColors,
1146
- getContrast,
1147
- getContrastInfo,
1148
- getLuminance,
1149
- hexToRgb,
1150
- lightTheme,
1151
- lightThemeColors,
1152
- meetsWCAGAA,
1153
- meetsWCAGAAA,
1154
- radiusTokens,
1155
- shadowTokens,
1156
- spacingTokens,
1157
- themes,
1158
- tokens,
1159
- typographyTokens,
1160
- validateContrast
1161
- });
1162
- /**
1163
- * @fileoverview Ponto de entrada principal da biblioteca @rainersoft/design-tokens
1164
- *
1165
- * @description
1166
- * Biblioteca enterprise-grade de design tokens para sistemas de design modernos.
1167
- * Tecnologicamente agnóstica, escalável e pronta para produção.
1168
- *
1169
- * Esta biblioteca fornece tokens de design estruturados que podem ser utilizados
1170
- * em qualquer framework ou tecnologia, garantindo consistência visual em toda
1171
- * a aplicação.
1172
- *
1173
- * @module @rainersoft/design-tokens
1174
- * @version 4.0.0
1175
- * @author Rainer Teixeira
1176
- * @license MIT
1177
- * @since 1.0.0
1178
- *
1179
- * @example
1180
- * ```typescript
1181
- * import { tokens, themes, lightTheme, darkTheme } from '@rainersoft/design-tokens';
1182
- *
1183
- * // Usar tokens diretamente
1184
- * const primaryColor = tokens.colors.light.brand.primary;
1185
- *
1186
- * // Usar temas completos
1187
- * const theme = lightTheme;
1188
- * ```
1189
- */
1190
- //# sourceMappingURL=index.cjs.map