@nibin-org/tokens 1.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.
@@ -0,0 +1,605 @@
1
+ /**
2
+ * figma-token-docs - CSS Styles
3
+ * Beautiful, modern styling for design token documentation
4
+ */
5
+
6
+ /* ========================================
7
+ CSS Custom Properties (Theming)
8
+ ======================================== */
9
+ :root {
10
+ /* Light theme colors */
11
+ --ftd-bg-primary: #ffffff;
12
+ --ftd-bg-secondary: #f8fafc;
13
+ --ftd-bg-tertiary: #f1f5f9;
14
+ --ftd-bg-glass: rgba(255, 255, 255, 0.8);
15
+ --ftd-text-primary: #0f172a;
16
+ --ftd-text-secondary: #475569;
17
+ --ftd-text-tertiary: #94a3b8;
18
+ --ftd-border-primary: #e2e8f0;
19
+ --ftd-border-secondary: #cbd5e1;
20
+ --ftd-accent: #6366f1;
21
+ --ftd-accent-hover: #4f46e5;
22
+ --ftd-success: #10b981;
23
+ --ftd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
24
+ --ftd-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
25
+ --ftd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
26
+ --ftd-shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
27
+ --ftd-radius-sm: 6px;
28
+ --ftd-radius-md: 10px;
29
+ --ftd-radius-lg: 16px;
30
+ --ftd-radius-xl: 24px;
31
+ --ftd-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
32
+ }
33
+
34
+ /* Dark theme */
35
+ [data-theme="dark"] {
36
+ --ftd-bg-primary: #0f172a;
37
+ --ftd-bg-secondary: #1e293b;
38
+ --ftd-bg-tertiary: #334155;
39
+ --ftd-bg-glass: rgba(30, 41, 59, 0.8);
40
+ --ftd-text-primary: #f8fafc;
41
+ --ftd-text-secondary: #cbd5e1;
42
+ --ftd-text-tertiary: #64748b;
43
+ --ftd-border-primary: #334155;
44
+ --ftd-border-secondary: #475569;
45
+ --ftd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
46
+ --ftd-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
47
+ --ftd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
48
+ --ftd-shadow-glow: 0 0 30px rgba(99, 102, 241, 0.25);
49
+ }
50
+
51
+ /* ========================================
52
+ Base Container
53
+ ======================================== */
54
+ .ftd-container {
55
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
56
+ background: var(--ftd-bg-primary);
57
+ color: var(--ftd-text-primary);
58
+ padding: 32px;
59
+ border-radius: var(--ftd-radius-xl);
60
+ min-height: 100vh;
61
+ }
62
+
63
+ /* ========================================
64
+ Header & Navigation
65
+ ======================================== */
66
+ .ftd-header {
67
+ display: flex;
68
+ justify-content: space-between;
69
+ align-items: center;
70
+ margin-bottom: 40px;
71
+ padding-bottom: 24px;
72
+ border-bottom: 1px solid var(--ftd-border-primary);
73
+ }
74
+
75
+ .ftd-title {
76
+ font-size: 2rem;
77
+ font-weight: 700;
78
+ background: linear-gradient(135deg, var(--ftd-accent), #a855f7);
79
+ -webkit-background-clip: text;
80
+ -webkit-text-fill-color: transparent;
81
+ background-clip: text;
82
+ margin: 0;
83
+ }
84
+
85
+ .ftd-subtitle {
86
+ font-size: 1rem;
87
+ color: var(--ftd-text-secondary);
88
+ margin: 8px 0 0;
89
+ }
90
+
91
+ .ftd-theme-toggle {
92
+ display: flex;
93
+ align-items: center;
94
+ gap: 8px;
95
+ padding: 8px 16px;
96
+ background: var(--ftd-bg-secondary);
97
+ border: 1px solid var(--ftd-border-primary);
98
+ border-radius: var(--ftd-radius-md);
99
+ cursor: pointer;
100
+ transition: var(--ftd-transition);
101
+ color: var(--ftd-text-primary);
102
+ font-size: 0.875rem;
103
+ font-weight: 500;
104
+ }
105
+
106
+ .ftd-theme-toggle:hover {
107
+ background: var(--ftd-bg-tertiary);
108
+ border-color: var(--ftd-border-secondary);
109
+ }
110
+
111
+ /* ========================================
112
+ Tabs Navigation
113
+ ======================================== */
114
+ .ftd-tabs {
115
+ display: flex;
116
+ gap: 4px;
117
+ padding: 4px;
118
+ background: var(--ftd-bg-secondary);
119
+ border-radius: var(--ftd-radius-lg);
120
+ margin-bottom: 32px;
121
+ overflow-x: auto;
122
+ }
123
+
124
+ .ftd-tab {
125
+ padding: 12px 24px;
126
+ border: none;
127
+ background: transparent;
128
+ color: var(--ftd-text-secondary);
129
+ font-size: 0.875rem;
130
+ font-weight: 500;
131
+ cursor: pointer;
132
+ border-radius: var(--ftd-radius-md);
133
+ transition: var(--ftd-transition);
134
+ white-space: nowrap;
135
+ }
136
+
137
+ .ftd-tab:hover {
138
+ color: var(--ftd-text-primary);
139
+ background: var(--ftd-bg-glass);
140
+ }
141
+
142
+ .ftd-tab.active {
143
+ background: var(--ftd-bg-primary);
144
+ color: var(--ftd-accent);
145
+ box-shadow: var(--ftd-shadow-sm);
146
+ }
147
+
148
+ /* ========================================
149
+ Section Headers
150
+ ======================================== */
151
+ .ftd-section {
152
+ margin-bottom: 48px;
153
+ }
154
+
155
+ .ftd-section-header {
156
+ display: flex;
157
+ align-items: center;
158
+ gap: 12px;
159
+ margin-bottom: 24px;
160
+ }
161
+
162
+ .ftd-section-icon {
163
+ width: 40px;
164
+ height: 40px;
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: center;
168
+ background: linear-gradient(135deg, var(--ftd-accent), #a855f7);
169
+ border-radius: var(--ftd-radius-md);
170
+ font-size: 1.25rem;
171
+ }
172
+
173
+ .ftd-section-title {
174
+ font-size: 1.5rem;
175
+ font-weight: 600;
176
+ margin: 0;
177
+ }
178
+
179
+ .ftd-section-count {
180
+ font-size: 0.875rem;
181
+ color: var(--ftd-text-tertiary);
182
+ background: var(--ftd-bg-secondary);
183
+ padding: 4px 12px;
184
+ border-radius: 999px;
185
+ }
186
+
187
+ /* ========================================
188
+ Token Cards
189
+ ======================================== */
190
+ .ftd-token-grid {
191
+ display: grid;
192
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
193
+ gap: 16px;
194
+ }
195
+
196
+ .ftd-token-card {
197
+ background: var(--ftd-bg-secondary);
198
+ border: 1px solid var(--ftd-border-primary);
199
+ border-radius: var(--ftd-radius-lg);
200
+ overflow: hidden;
201
+ transition: var(--ftd-transition);
202
+ cursor: pointer;
203
+ }
204
+
205
+ .ftd-token-card:hover {
206
+ transform: translateY(-4px);
207
+ box-shadow: var(--ftd-shadow-lg);
208
+ border-color: var(--ftd-accent);
209
+ }
210
+
211
+ .ftd-token-swatch {
212
+ height: 80px;
213
+ display: flex;
214
+ align-items: flex-end;
215
+ padding: 8px;
216
+ position: relative;
217
+ }
218
+
219
+ .ftd-token-contrast {
220
+ position: absolute;
221
+ top: 8px;
222
+ right: 8px;
223
+ font-size: 0.625rem;
224
+ font-weight: 600;
225
+ padding: 2px 6px;
226
+ border-radius: 4px;
227
+ background: rgba(0, 0, 0, 0.3);
228
+ color: white;
229
+ }
230
+
231
+ .ftd-token-info {
232
+ padding: 12px;
233
+ }
234
+
235
+ .ftd-token-name {
236
+ font-size: 0.875rem;
237
+ font-weight: 600;
238
+ margin: 0 0 4px;
239
+ color: var(--ftd-text-primary);
240
+ }
241
+
242
+ .ftd-token-value {
243
+ font-size: 0.75rem;
244
+ font-family: 'JetBrains Mono', 'Fira Code', monospace;
245
+ color: var(--ftd-text-secondary);
246
+ margin: 0;
247
+ display: flex;
248
+ align-items: center;
249
+ gap: 6px;
250
+ }
251
+
252
+ .ftd-copy-icon {
253
+ opacity: 0;
254
+ transition: var(--ftd-transition);
255
+ }
256
+
257
+ .ftd-token-card:hover .ftd-copy-icon {
258
+ opacity: 1;
259
+ }
260
+
261
+ .ftd-copied-toast {
262
+ position: fixed;
263
+ bottom: 24px;
264
+ left: 50%;
265
+ transform: translateX(-50%);
266
+ background: var(--ftd-success);
267
+ color: white;
268
+ padding: 12px 24px;
269
+ border-radius: var(--ftd-radius-md);
270
+ font-size: 0.875rem;
271
+ font-weight: 500;
272
+ box-shadow: var(--ftd-shadow-lg);
273
+ z-index: 1000;
274
+ animation: ftd-toast-in 0.3s ease;
275
+ }
276
+
277
+ @keyframes ftd-toast-in {
278
+ from {
279
+ opacity: 0;
280
+ transform: translateX(-50%) translateY(10px);
281
+ }
282
+ to {
283
+ opacity: 1;
284
+ transform: translateX(-50%) translateY(0);
285
+ }
286
+ }
287
+
288
+ /* ========================================
289
+ Color Palette Grid
290
+ ======================================== */
291
+ .ftd-color-family {
292
+ margin-bottom: 32px;
293
+ }
294
+
295
+ .ftd-color-family-header {
296
+ display: flex;
297
+ align-items: center;
298
+ gap: 12px;
299
+ margin-bottom: 16px;
300
+ }
301
+
302
+ .ftd-color-family-swatch {
303
+ width: 24px;
304
+ height: 24px;
305
+ border-radius: var(--ftd-radius-sm);
306
+ box-shadow: var(--ftd-shadow-sm);
307
+ }
308
+
309
+ .ftd-color-family-name {
310
+ font-size: 1.125rem;
311
+ font-weight: 600;
312
+ margin: 0;
313
+ text-transform: capitalize;
314
+ }
315
+
316
+ .ftd-color-scale {
317
+ display: flex;
318
+ border-radius: var(--ftd-radius-lg);
319
+ overflow: hidden;
320
+ box-shadow: var(--ftd-shadow-md);
321
+ }
322
+
323
+ .ftd-color-shade {
324
+ flex: 1;
325
+ min-width: 60px;
326
+ height: 100px;
327
+ display: flex;
328
+ flex-direction: column;
329
+ justify-content: flex-end;
330
+ padding: 8px;
331
+ cursor: pointer;
332
+ transition: var(--ftd-transition);
333
+ position: relative;
334
+ }
335
+
336
+ .ftd-color-shade:hover {
337
+ transform: scale(1.05);
338
+ z-index: 10;
339
+ box-shadow: var(--ftd-shadow-lg);
340
+ }
341
+
342
+ .ftd-color-shade-label {
343
+ font-size: 0.625rem;
344
+ font-weight: 600;
345
+ opacity: 0.9;
346
+ }
347
+
348
+ .ftd-color-shade-value {
349
+ font-size: 0.5rem;
350
+ font-family: 'JetBrains Mono', monospace;
351
+ opacity: 0.7;
352
+ }
353
+
354
+ /* ========================================
355
+ Spacing Scale
356
+ ======================================== */
357
+ .ftd-spacing-list {
358
+ display: flex;
359
+ flex-direction: column;
360
+ gap: 16px;
361
+ }
362
+
363
+ .ftd-spacing-item {
364
+ display: flex;
365
+ align-items: center;
366
+ gap: 24px;
367
+ padding: 16px;
368
+ background: var(--ftd-bg-secondary);
369
+ border-radius: var(--ftd-radius-md);
370
+ transition: var(--ftd-transition);
371
+ }
372
+
373
+ .ftd-spacing-item:hover {
374
+ background: var(--ftd-bg-tertiary);
375
+ }
376
+
377
+ .ftd-spacing-label {
378
+ min-width: 100px;
379
+ font-weight: 600;
380
+ font-size: 0.875rem;
381
+ }
382
+
383
+ .ftd-spacing-bar-container {
384
+ flex: 1;
385
+ height: 24px;
386
+ background: var(--ftd-bg-tertiary);
387
+ border-radius: var(--ftd-radius-sm);
388
+ overflow: hidden;
389
+ }
390
+
391
+ .ftd-spacing-bar {
392
+ height: 100%;
393
+ background: linear-gradient(90deg, var(--ftd-accent), #a855f7);
394
+ border-radius: var(--ftd-radius-sm);
395
+ display: flex;
396
+ align-items: center;
397
+ justify-content: flex-end;
398
+ padding-right: 8px;
399
+ min-width: 40px;
400
+ }
401
+
402
+ .ftd-spacing-value {
403
+ font-size: 0.75rem;
404
+ font-family: 'JetBrains Mono', monospace;
405
+ color: var(--ftd-text-secondary);
406
+ min-width: 60px;
407
+ text-align: right;
408
+ }
409
+
410
+ /* ========================================
411
+ Radius Showcase
412
+ ======================================== */
413
+ .ftd-radius-grid {
414
+ display: grid;
415
+ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
416
+ gap: 24px;
417
+ }
418
+
419
+ .ftd-radius-item {
420
+ text-align: center;
421
+ }
422
+
423
+ .ftd-radius-preview {
424
+ width: 100%;
425
+ aspect-ratio: 1;
426
+ background: linear-gradient(135deg, var(--ftd-accent), #a855f7);
427
+ margin-bottom: 12px;
428
+ transition: var(--ftd-transition);
429
+ box-shadow: var(--ftd-shadow-md);
430
+ }
431
+
432
+ .ftd-radius-item:hover .ftd-radius-preview {
433
+ transform: scale(1.05);
434
+ box-shadow: var(--ftd-shadow-glow);
435
+ }
436
+
437
+ .ftd-radius-label {
438
+ font-size: 0.875rem;
439
+ font-weight: 600;
440
+ margin: 0 0 4px;
441
+ }
442
+
443
+ .ftd-radius-value {
444
+ font-size: 0.75rem;
445
+ font-family: 'JetBrains Mono', monospace;
446
+ color: var(--ftd-text-secondary);
447
+ margin: 0;
448
+ }
449
+
450
+ /* ========================================
451
+ Size Scale
452
+ ======================================== */
453
+ .ftd-size-grid {
454
+ display: flex;
455
+ align-items: flex-end;
456
+ gap: 8px;
457
+ padding: 24px;
458
+ background: var(--ftd-bg-secondary);
459
+ border-radius: var(--ftd-radius-lg);
460
+ overflow-x: auto;
461
+ }
462
+
463
+ .ftd-size-item {
464
+ display: flex;
465
+ flex-direction: column;
466
+ align-items: center;
467
+ gap: 8px;
468
+ min-width: 40px;
469
+ }
470
+
471
+ .ftd-size-bar {
472
+ background: linear-gradient(180deg, var(--ftd-accent), #a855f7);
473
+ border-radius: var(--ftd-radius-sm) var(--ftd-radius-sm) 0 0;
474
+ transition: var(--ftd-transition);
475
+ min-height: 4px;
476
+ }
477
+
478
+ .ftd-size-item:hover .ftd-size-bar {
479
+ filter: brightness(1.1);
480
+ box-shadow: var(--ftd-shadow-glow);
481
+ }
482
+
483
+ .ftd-size-label {
484
+ font-size: 0.625rem;
485
+ font-weight: 600;
486
+ color: var(--ftd-text-secondary);
487
+ writing-mode: vertical-rl;
488
+ text-orientation: mixed;
489
+ transform: rotate(180deg);
490
+ }
491
+
492
+ /* ========================================
493
+ Search & Filter
494
+ ======================================== */
495
+ .ftd-search-container {
496
+ margin-bottom: 24px;
497
+ }
498
+
499
+ .ftd-search-input {
500
+ width: 100%;
501
+ max-width: 400px;
502
+ padding: 12px 16px 12px 44px;
503
+ background: var(--ftd-bg-secondary);
504
+ border: 1px solid var(--ftd-border-primary);
505
+ border-radius: var(--ftd-radius-md);
506
+ font-size: 0.875rem;
507
+ color: var(--ftd-text-primary);
508
+ transition: var(--ftd-transition);
509
+ }
510
+
511
+ .ftd-search-input::placeholder {
512
+ color: var(--ftd-text-tertiary);
513
+ }
514
+
515
+ .ftd-search-input:focus {
516
+ outline: none;
517
+ border-color: var(--ftd-accent);
518
+ box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
519
+ }
520
+
521
+ .ftd-search-wrapper {
522
+ position: relative;
523
+ display: inline-block;
524
+ }
525
+
526
+ .ftd-search-icon {
527
+ position: absolute;
528
+ left: 16px;
529
+ top: 50%;
530
+ transform: translateY(-50%);
531
+ color: var(--ftd-text-tertiary);
532
+ }
533
+
534
+ /* ========================================
535
+ Empty State
536
+ ======================================== */
537
+ .ftd-empty {
538
+ text-align: center;
539
+ padding: 64px 24px;
540
+ color: var(--ftd-text-secondary);
541
+ }
542
+
543
+ .ftd-empty-icon {
544
+ font-size: 3rem;
545
+ margin-bottom: 16px;
546
+ opacity: 0.5;
547
+ }
548
+
549
+ .ftd-empty-title {
550
+ font-size: 1.125rem;
551
+ font-weight: 600;
552
+ margin: 0 0 8px;
553
+ }
554
+
555
+ .ftd-empty-text {
556
+ font-size: 0.875rem;
557
+ margin: 0;
558
+ }
559
+
560
+ /* ========================================
561
+ Responsive Design
562
+ ======================================== */
563
+ @media (max-width: 768px) {
564
+ .ftd-container {
565
+ padding: 16px;
566
+ }
567
+
568
+ .ftd-header {
569
+ flex-direction: column;
570
+ align-items: flex-start;
571
+ gap: 16px;
572
+ }
573
+
574
+ .ftd-title {
575
+ font-size: 1.5rem;
576
+ }
577
+
578
+ .ftd-tabs {
579
+ flex-wrap: nowrap;
580
+ overflow-x: auto;
581
+ -webkit-overflow-scrolling: touch;
582
+ }
583
+
584
+ .ftd-tab {
585
+ padding: 10px 16px;
586
+ }
587
+
588
+ .ftd-color-scale {
589
+ flex-wrap: wrap;
590
+ }
591
+
592
+ .ftd-color-shade {
593
+ min-width: 50px;
594
+ height: 60px;
595
+ }
596
+
597
+ .ftd-spacing-item {
598
+ flex-direction: column;
599
+ align-items: flex-start;
600
+ }
601
+
602
+ .ftd-spacing-bar-container {
603
+ width: 100%;
604
+ }
605
+ }
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@nibin-org/tokens",
3
+ "version": "1.0.0",
4
+ "description": "Visual documentation components for Figma design tokens. Easily display color palettes, spacing scales, and typography in your design system documentation.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "sideEffects": [
10
+ "*.css"
11
+ ],
12
+ "publishConfig": {
13
+ "access": "public",
14
+ "registry": "https://registry.npmjs.org/"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/index.cjs",
21
+ "default": "./dist/index.js"
22
+ },
23
+ "./styles.css": {
24
+ "import": "./dist/styles.css",
25
+ "require": "./dist/styles.css",
26
+ "default": "./dist/styles.css"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "README.md"
32
+ ],
33
+ "scripts": {
34
+ "build": "tsup",
35
+ "dev": "tsup --watch",
36
+ "lint": "eslint src --ext .ts,.tsx",
37
+ "typecheck": "tsc --noEmit",
38
+ "prepublishOnly": "npm run build"
39
+ },
40
+ "keywords": [
41
+ "figma",
42
+ "design-tokens",
43
+ "tokens",
44
+ "design-system",
45
+ "storybook",
46
+ "styleguide",
47
+ "react",
48
+ "documentation",
49
+ "style-dictionary",
50
+ "token-studio",
51
+ "figma-tokens",
52
+ "design-tokens-visualizer",
53
+ "ui-tokens",
54
+ "css-variables",
55
+ "design-ops",
56
+ "design-system-docs",
57
+ "color-palette",
58
+ "spacing-scale",
59
+ "tailwind-tokens"
60
+ ],
61
+ "author": "nibinlab99-dev",
62
+ "license": "MIT",
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "https://github.com/nibinlab99-dev/next-storybook"
66
+ },
67
+ "homepage": "https://github.com/nibinlab99-dev/next-storybook#readme",
68
+ "bugs": {
69
+ "url": "https://github.com/nibinlab99-dev/next-storybook/issues"
70
+ },
71
+ "peerDependencies": {
72
+ "react": ">=18.0.0",
73
+ "react-dom": ">=18.0.0"
74
+ },
75
+ "devDependencies": {
76
+ "@types/react": "^19.0.0",
77
+ "@types/react-dom": "^19.0.0",
78
+ "react": "^19.0.0",
79
+ "react-dom": "^19.0.0",
80
+ "tsup": "^8.0.0",
81
+ "typescript": "^5.0.0"
82
+ }
83
+ }