@nibin-org/tokens 1.0.0 โ†’ 1.0.1

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 (3) hide show
  1. package/README.md +472 -85
  2. package/dist/styles.css +766 -230
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,22 +1,79 @@
1
1
  # @nibin-org/tokens
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/@nibin-org/tokens.svg?style=flat-square)](https://www.npmjs.com/package/@nibin-org/tokens)
4
- [![npm downloads](https://img.shields.io/npm/dm/@nibin-org/tokens.svg?style=flat-square)](https://www.npmjs.com/package/@nibin-org/tokens)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
6
- [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square)](https://www.typescriptlang.org/)
3
+ <div align="center">
7
4
 
8
- > ๐ŸŽจ Beautiful, interactive visual documentation for Figma design tokens โ€” **the missing UI layer that Style Dictionary doesn't provide.**
5
+ ![npm version](https://img.shields.io/npm/v/@nibin-org/tokens.svg?style=for-the-badge&colorA=000000&colorB=5b47fb)
6
+ ![npm downloads](https://img.shields.io/npm/dm/@nibin-org/tokens.svg?style=for-the-badge&colorA=000000&colorB=5b47fb)
7
+ ![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge&colorA=000000&colorB=5b47fb)
8
+ ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=for-the-badge&colorA=000000&colorB=5b47fb)
9
9
 
10
- ## โœจ Features
10
+ ### ๐ŸŽจ Beautiful, Interactive Visual Documentation for Design Tokens
11
11
 
12
- - **๐ŸŽจ Rich Color Visualization** โ€” Base palettes with shade scales + semantic tokens (fill, stroke, text)
13
- - **๐Ÿ“ Spacing & Size Scales** โ€” Visual bar charts with proportional representation
14
- - **โฌœ Radius Showcase** โ€” Actual rounded boxes demonstrating each radius value
15
- - **๐ŸŒ™ Dark Mode** โ€” Built-in light/dark theme toggle
16
- - **๐Ÿ“‹ Copy-to-Clipboard** โ€” Click any token to copy its value instantly
17
- - **๐Ÿ” Search** โ€” Filter tokens quickly (coming soon)
18
- - **๐Ÿ“ฑ Responsive** โ€” Works beautifully on any screen size
19
- - **๐Ÿ”Œ Zero Config** โ€” Just pass your tokens.json and go!
12
+ **The missing UI layer that Style Dictionary doesn't provide**
13
+
14
+ [View Demo](https://your-demo-url.com) ยท [Report Bug](https://github.com/nibinlab99-dev/next-storybook/issues) ยท [Request Feature](https://github.com/nibinlab99-dev/next-storybook/issues)
15
+
16
+ </div>
17
+
18
+ ---
19
+
20
+ ## โœจ Why @nibin-org/tokens?
21
+
22
+ Transform your static design tokens into **living, interactive documentation** that designers and developers will actually love using.
23
+
24
+ ```tsx
25
+ import { TokenDocumentation } from '@nibin-org/tokens';
26
+ import '@nibin-org/tokens/styles.css';
27
+
28
+ <TokenDocumentation tokens={yourTokens} />
29
+ ```
30
+
31
+ That's it. Beautiful documentation in one line.
32
+
33
+ ## ๐ŸŽฏ Features
34
+
35
+ <table>
36
+ <tr>
37
+ <td width="50%">
38
+ <h3>๐ŸŽจ Rich Color Visualization</h3>
39
+ <p>Base palettes with shade scales + semantic tokens (fill, stroke, text) displayed with contrast ratios</p>
40
+ </td>
41
+ <td width="50%">
42
+ <h3>๐Ÿ“ Spacing & Size Scales</h3>
43
+ <p>Visual bar charts with proportional representation and real measurements</p>
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td width="50%">
48
+ <h3>โฌœ Radius Showcase</h3>
49
+ <p>Actual rounded boxes demonstrating each radius value in action</p>
50
+ </td>
51
+ <td width="50%">
52
+ <h3>๐ŸŒ™ Dark Mode</h3>
53
+ <p>Built-in light/dark theme toggle with smooth transitions</p>
54
+ </td>
55
+ </tr>
56
+ <tr>
57
+ <td width="50%">
58
+ <h3>๐Ÿ“‹ Copy-to-Clipboard</h3>
59
+ <p>Click any token to copy its value instantly with visual feedback</p>
60
+ </td>
61
+ <td width="50%">
62
+ <h3>๐Ÿ” Search & Filter</h3>
63
+ <p>Quickly find tokens with real-time search</p>
64
+ </td>
65
+ </tr>
66
+ <tr>
67
+ <td width="50%">
68
+ <h3>๐Ÿ“ฑ Fully Responsive</h3>
69
+ <p>Works beautifully on any screen size, from mobile to 4K displays</p>
70
+ </td>
71
+ <td width="50%">
72
+ <h3>๐Ÿ”Œ Zero Config</h3>
73
+ <p>Just pass your tokens.json and go - no complex setup required</p>
74
+ </td>
75
+ </tr>
76
+ </table>
20
77
 
21
78
  ## ๐Ÿš€ Quick Start
22
79
 
@@ -30,7 +87,7 @@ yarn add @nibin-org/tokens
30
87
  pnpm add @nibin-org/tokens
31
88
  ```
32
89
 
33
- ### Usage
90
+ ### Basic Usage
34
91
 
35
92
  ```tsx
36
93
  import { TokenDocumentation } from '@nibin-org/tokens';
@@ -48,36 +105,212 @@ export default function DesignTokensPage() {
48
105
  }
49
106
  ```
50
107
 
51
- ## ๐Ÿ“Š Token Structure
108
+ ### Next.js Setup (Required)
109
+
110
+ For Next.js projects, add the package to `transpilePackages` in `next.config.js`:
111
+
112
+ ```js
113
+ /** @type {import('next').NextConfig} */
114
+ const nextConfig = {
115
+ transpilePackages: ['@nibin-org/tokens'],
116
+ };
117
+
118
+ export default nextConfig;
119
+ ```
120
+
121
+ > **๐Ÿ’ก Tip**: If you experience issues with Next.js 16+ Turbopack during local development with linked packages, use `next dev --webpack` as a workaround.
52
122
 
53
- This library works with tokens exported from [Figma Tokens Studio](https://tokens.studio/). The expected structure is:
123
+ ## ๐Ÿ“– Complete Guide
124
+
125
+ ### Token Structure
126
+
127
+ This library works seamlessly with tokens exported from [Figma Tokens Studio](https://tokens.studio/). Here's the expected structure:
54
128
 
55
129
  ```json
56
130
  {
57
131
  "Colors/Value": {
58
- "base": { "blue": { "50": { "value": "#1369e9", "type": "color" } } },
59
- "fill": { "primary": { "value": "{base.blue.50}", "type": "color" } },
60
- "stroke": { "default": { "value": "{base.gray.30}", "type": "color" } },
61
- "text": { "default": { "value": "{base.gray.90}", "type": "color" } }
132
+ "base": {
133
+ "blue": {
134
+ "50": { "value": "#e6f0ff", "type": "color" },
135
+ "100": { "value": "#cce1ff", "type": "color" },
136
+ "500": { "value": "#1369e9", "type": "color" }
137
+ }
138
+ },
139
+ "fill": {
140
+ "primary": { "value": "{base.blue.500}", "type": "color" }
141
+ },
142
+ "stroke": {
143
+ "default": { "value": "{base.gray.30}", "type": "color" }
144
+ },
145
+ "text": {
146
+ "default": { "value": "{base.gray.90}", "type": "color" }
147
+ }
62
148
  },
63
149
  "Spacing/Mode 1": {
150
+ "space-xs": { "value": "4px", "type": "dimension" },
64
151
  "space-sm": { "value": "8px", "type": "dimension" }
65
152
  },
66
153
  "Size/Mode 1": {
154
+ "size-sm": { "value": "12px", "type": "dimension" },
67
155
  "size-lg": { "value": "16px", "type": "dimension" }
68
156
  },
69
157
  "Radius/Mode 1": {
158
+ "radius-sm": { "value": "4px", "type": "dimension" },
70
159
  "radius-md": { "value": "6px", "type": "dimension" }
71
160
  }
72
161
  }
73
162
  ```
74
163
 
75
- ## ๐Ÿ”„ Figma-to-Code Workflow
164
+ ### Full API Reference
165
+
166
+ #### `<TokenDocumentation />` - Main Component
167
+
168
+ The all-in-one solution for displaying all your tokens.
169
+
170
+ ```tsx
171
+ <TokenDocumentation
172
+ tokens={tokens} // Required: Your tokens.json content
173
+ title="Design Tokens" // Optional: Page title
174
+ subtitle="v1.0.0" // Optional: Subtitle text
175
+ defaultTab="colors" // Optional: Initial tab
176
+ showSearch={true} // Optional: Show search input
177
+ darkMode={false} // Optional: Start in dark mode
178
+ onTokenClick={(token) => { // Optional: Callback when token clicked
179
+ console.log('Clicked:', token);
180
+ }}
181
+ />
182
+ ```
183
+
184
+ **Props:**
185
+
186
+ | Prop | Type | Default | Description |
187
+ |------|------|---------|-------------|
188
+ | `tokens` | `FigmaTokens` | **required** | Your tokens.json content |
189
+ | `title` | `string` | `"Design Tokens"` | Page title |
190
+ | `subtitle` | `string` | `"View and copy design tokens"` | Subtitle text |
191
+ | `defaultTab` | `'colors' \| 'spacing' \| 'sizes' \| 'radius'` | `'colors'` | Initial active tab |
192
+ | `showSearch` | `boolean` | `true` | Show/hide search input |
193
+ | `darkMode` | `boolean` | `false` | Start in dark mode |
194
+ | `onTokenClick` | `(token) => void` | `undefined` | Callback when token is clicked |
195
+
196
+ ### Individual Components
197
+
198
+ For custom layouts, use components individually:
199
+
200
+ #### ColorGrid
201
+
202
+ ```tsx
203
+ import { ColorGrid } from '@nibin-org/tokens';
204
+
205
+ <ColorGrid
206
+ baseColors={tokens['Colors/Value'].base}
207
+ fillColors={tokens['Colors/Value'].fill}
208
+ strokeColors={tokens['Colors/Value'].stroke}
209
+ textColors={tokens['Colors/Value'].text}
210
+ onColorClick={(color) => console.log(color)}
211
+ />
212
+ ```
213
+
214
+ #### SpacingScale
215
+
216
+ ```tsx
217
+ import { SpacingScale } from '@nibin-org/tokens';
218
+
219
+ <SpacingScale
220
+ tokens={tokens['Spacing/Mode 1']}
221
+ onTokenClick={(token) => console.log(token)}
222
+ />
223
+ ```
224
+
225
+ #### RadiusShowcase
226
+
227
+ ```tsx
228
+ import { RadiusShowcase } from '@nibin-org/tokens';
229
+
230
+ <RadiusShowcase
231
+ tokens={tokens['Radius/Mode 1']}
232
+ onTokenClick={(token) => console.log(token)}
233
+ />
234
+ ```
235
+
236
+ #### SizeScale
237
+
238
+ ```tsx
239
+ import { SizeScale } from '@nibin-org/tokens';
240
+
241
+ <SizeScale
242
+ tokens={tokens['Size/Mode 1']}
243
+ onTokenClick={(token) => console.log(token)}
244
+ />
245
+ ```
246
+
247
+ ## ๐ŸŽจ Theming & Customization
248
+
249
+ The styles use CSS custom properties, making customization simple:
250
+
251
+ ```css
252
+ :root {
253
+ /* Primary accent color */
254
+ --ftd-accent-primary: #6366f1;
255
+ --ftd-accent-primary-hover: #4f46e5;
256
+
257
+ /* Background colors */
258
+ --ftd-bg-canvas: #fafbfc;
259
+ --ftd-bg-primary: #ffffff;
260
+ --ftd-bg-secondary: #f6f8fa;
261
+
262
+ /* Text colors */
263
+ --ftd-text-primary: #0d1117;
264
+ --ftd-text-secondary: #57606a;
265
+
266
+ /* Border radius */
267
+ --ftd-radius-lg: 16px;
268
+ --ftd-radius-xl: 24px;
269
+
270
+ /* Shadows */
271
+ --ftd-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
272
+ --ftd-shadow-glow: 0 0 24px rgba(91, 71, 251, 0.2);
273
+
274
+ /* Transitions */
275
+ --ftd-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
276
+ }
277
+
278
+ /* Dark theme */
279
+ [data-theme="dark"] {
280
+ --ftd-bg-canvas: #0d1117;
281
+ --ftd-bg-primary: #161b22;
282
+ --ftd-text-primary: #e6edf3;
283
+ /* ... customize more */
284
+ }
285
+ ```
286
+
287
+ ### Advanced Customization Example
288
+
289
+ ```css
290
+ /* Custom gradient for your brand */
291
+ :root {
292
+ --ftd-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
293
+ }
294
+
295
+ /* Custom card hover effect */
296
+ .ftd-token-card:hover {
297
+ transform: translateY(-8px) rotate(2deg);
298
+ }
299
+
300
+ /* Custom color scale height */
301
+ .ftd-color-shade {
302
+ height: 150px;
303
+ }
304
+ ```
305
+
306
+ ## ๐Ÿ“Š Workflow Integration
307
+
308
+ ### Figma-to-Code Pipeline
76
309
 
77
310
  ```
78
311
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
79
312
  โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
80
- โ”‚ Figma + โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ tokens.json โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ CSS + Docs โ”‚
313
+ โ”‚ Figma + โ”‚โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ tokens.json โ”‚โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ CSS + Docs โ”‚
81
314
  โ”‚ Token Studio โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
82
315
  โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
83
316
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
@@ -90,106 +323,260 @@ This library works with tokens exported from [Figma Tokens Studio](https://token
90
323
  ### Recommended Setup
91
324
 
92
325
  1. **Design Phase**: Use [Figma Tokens Studio](https://tokens.studio/) to manage tokens in Figma
93
- 2. **Sync Phase**: Export tokens.json to your repo (manual or GitHub sync)
94
- 3. **Build Phase**: Run your token build script to generate CSS
95
- 4. **Document Phase**: Use this library to display beautiful token documentation
326
+ 2. **Sync Phase**: Export `tokens.json` to your repo (manual or automated via GitHub sync)
327
+ 3. **Build Phase**: Run your token build script to generate CSS variables
328
+ 4. **Document Phase**: Use `@nibin-org/tokens` to display beautiful, interactive documentation
96
329
 
97
- ### Next.js Configuration
330
+ ### Example Build Script
98
331
 
99
- For Next.js projects (especially Next.js 15+), add the package to `transpilePackages` in your `next.config.ts`:
332
+ ```js
333
+ // scripts/build-tokens.js
334
+ const fs = require('fs');
335
+ const tokens = require('./tokens.json');
100
336
 
101
- ```typescript
102
- const nextConfig = {
103
- transpilePackages: ['@nibin-org/tokens'],
104
- };
337
+ // Generate CSS variables
338
+ const css = generateCSSVariables(tokens);
339
+ fs.writeFileSync('src/styles/tokens.css', css);
105
340
 
106
- export default nextConfig;
107
- ```
341
+ // Generate documentation page
342
+ const docs = `
343
+ import { TokenDocumentation } from '@nibin-org/tokens';
344
+ import tokens from '../tokens.json';
108
345
 
109
- > **Note**: If you experience module resolution issues with Next.js 16+ Turbopack during local development with linked packages, you can use `next dev --webpack` as a workaround.
346
+ export default function TokensPage() {
347
+ return <TokenDocumentation tokens={tokens} />;
348
+ }
349
+ `;
350
+ fs.writeFileSync('src/pages/tokens.tsx', docs);
351
+ ```
110
352
 
111
- ## ๐Ÿ“ฆ Components
353
+ ## ๐Ÿ†š Comparison with Style Dictionary
112
354
 
113
- ### `<TokenDocumentation />` โ€” Main Component
355
+ | Feature | Style Dictionary | @nibin-org/tokens |
356
+ |---------|-----------------|------------------|
357
+ | **Token Transformation** | โœ… Excellent | โŒ Not included |
358
+ | **Multi-platform Output** (iOS, Android, Web) | โœ… Yes | โŒ No |
359
+ | **Visual Documentation** | โŒ None | โœ… Beautiful interactive UI |
360
+ | **Interactive Exploration** | โŒ No | โœ… Click, search, copy |
361
+ | **Copy-to-Clipboard** | โŒ No | โœ… Yes |
362
+ | **Dark Mode Support** | โŒ No | โœ… Yes |
363
+ | **Real-time Search** | โŒ No | โœ… Yes |
114
364
 
115
- The all-in-one solution for displaying all your tokens.
365
+ ### Use Both Together! ๐Ÿค
116
366
 
117
- | Prop | Type | Default | Description |
118
- |------|------|---------|-------------|
119
- | `tokens` | `FigmaTokens` | required | Your tokens.json content |
120
- | `title` | `string` | `"Design Tokens"` | Page title |
121
- | `subtitle` | `string` | `"..."` | Subtitle text |
122
- | `defaultTab` | `'colors' \| 'spacing' \| 'sizes' \| 'radius'` | `'colors'` | Initial tab |
123
- | `showSearch` | `boolean` | `true` | Show search input |
124
- | `darkMode` | `boolean` | `false` | Start in dark mode |
125
- | `onTokenClick` | `(token) => void` | - | Callback when token is clicked |
367
+ **Best Practice**: Use **Style Dictionary** for token transformation and multi-platform output, and **@nibin-org/tokens** for beautiful documentation.
126
368
 
127
- ### Individual Components
369
+ ```bash
370
+ # 1. Transform tokens with Style Dictionary
371
+ npx style-dictionary build
128
372
 
129
- For custom layouts, use components individually:
373
+ # 2. Document tokens with @nibin-org/tokens
374
+ # Import in your docs site
375
+ ```
130
376
 
131
- ```tsx
132
- import { ColorGrid, SpacingScale, RadiusShowcase, SizeScale } from '@nibin-org/tokens';
377
+ ## ๐ŸŽฏ Real-World Examples
133
378
 
134
- <ColorGrid
135
- baseColors={tokens['Colors/Value'].base}
136
- fillColors={tokens['Colors/Value'].fill}
137
- />
379
+ ### Storybook Integration
138
380
 
139
- <SpacingScale tokens={tokens['Spacing/Mode 1']} />
381
+ ```tsx
382
+ // .storybook/preview.tsx
383
+ import { TokenDocumentation } from '@nibin-org/tokens';
384
+ import '@nibin-org/tokens/styles.css';
385
+ import tokens from '../design-tokens/tokens.json';
140
386
 
141
- <RadiusShowcase tokens={tokens['Radius/Mode 1']} />
387
+ export default {
388
+ title: 'Design System/Tokens',
389
+ component: TokenDocumentation,
390
+ };
142
391
 
143
- <SizeScale tokens={tokens['Size/Mode 1']} />
392
+ export const AllTokens = () => (
393
+ <TokenDocumentation
394
+ tokens={tokens}
395
+ title="Design System Tokens"
396
+ subtitle="Version 2.0 - Updated Jan 2025"
397
+ />
398
+ );
144
399
  ```
145
400
 
146
- ## ๐ŸŽจ Theming
401
+ ### Documentation Site (Docusaurus, VitePress, etc.)
147
402
 
148
- The styles use CSS custom properties, making it easy to customize:
403
+ ```tsx
404
+ // docs/design-tokens.tsx
405
+ import { TokenDocumentation } from '@nibin-org/tokens';
406
+ import '@nibin-org/tokens/styles.css';
407
+ import tokens from './tokens.json';
149
408
 
150
- ```css
151
- :root {
152
- --ftd-accent: #6366f1; /* Primary accent color */
153
- --ftd-bg-primary: #ffffff; /* Main background */
154
- --ftd-text-primary: #0f172a; /* Main text color */
155
- --ftd-radius-lg: 16px; /* Card border radius */
409
+ export default function DesignTokensPage() {
410
+ return (
411
+ <div className="container">
412
+ <TokenDocumentation
413
+ tokens={tokens}
414
+ defaultTab="colors"
415
+ onTokenClick={(token) => {
416
+ // Track analytics
417
+ analytics.track('token_copied', { name: token.name });
418
+ }}
419
+ />
420
+ </div>
421
+ );
156
422
  }
157
423
  ```
158
424
 
159
- ## ๐Ÿ†š Why Not Just Style Dictionary?
425
+ ### Custom Integration
160
426
 
161
- | Feature | Style Dictionary | @nibin-org/tokens |
162
- |---------|-----------------|------------------|
163
- | Token Transformation | โœ… Excellent | โŒ Not included |
164
- | Multi-platform Output | โœ… Yes | โŒ No |
165
- | **Visual Documentation** | โŒ None | โœ… Beautiful UI |
166
- | **Interactive Exploration** | โŒ No | โœ… Yes |
167
- | **Copy-to-Clipboard** | โŒ No | โœ… Yes |
168
- | **Dark Mode** | โŒ No | โœ… Yes |
427
+ ```tsx
428
+ import {
429
+ ColorGrid,
430
+ SpacingScale,
431
+ parseBaseColors,
432
+ copyToClipboard
433
+ } from '@nibin-org/tokens';
434
+ import '@nibin-org/tokens/styles.css';
169
435
 
170
- **Use both together!** Style Dictionary for transformation, @nibin-org/tokens for documentation.
436
+ function CustomTokenDocs() {
437
+ const colorFamilies = parseBaseColors(tokens['Colors/Value'].base);
438
+
439
+ return (
440
+ <div>
441
+ <h1>Our Brand Colors</h1>
442
+ <ColorGrid
443
+ baseColors={tokens['Colors/Value'].base}
444
+ onColorClick={(color) => {
445
+ copyToClipboard(color.value);
446
+ toast.success(`Copied ${color.value}`);
447
+ }}
448
+ />
449
+
450
+ <h2>Spacing System</h2>
451
+ <SpacingScale tokens={tokens['Spacing/Mode 1']} />
452
+ </div>
453
+ );
454
+ }
455
+ ```
456
+
457
+ ## ๐Ÿ› ๏ธ Development
171
458
 
172
- ## ๐Ÿ›  Development
459
+ ### Local Development
173
460
 
174
461
  ```bash
175
- # Clone and install
462
+ # Clone the repository
176
463
  git clone https://github.com/nibinlab99-dev/next-storybook.git
177
- cd next-storybook
464
+ cd next-storybook/packages/tokens
465
+
466
+ # Install dependencies
178
467
  npm install
179
468
 
180
- # Build tokens
181
- npm run tokens:build
469
+ # Build the package
470
+ npm run build
182
471
 
183
- # Run dev server
472
+ # Run in watch mode
184
473
  npm run dev
474
+
475
+ # Type checking
476
+ npm run typecheck
477
+
478
+ # Linting
479
+ npm run lint
480
+ ```
481
+
482
+ ### Project Structure
483
+
484
+ ```
485
+ @nibin-org/tokens/
486
+ โ”œโ”€โ”€ src/
487
+ โ”‚ โ”œโ”€โ”€ components/
488
+ โ”‚ โ”‚ โ”œโ”€โ”€ TokenDocumentation.tsx
489
+ โ”‚ โ”‚ โ”œโ”€โ”€ ColorGrid.tsx
490
+ โ”‚ โ”‚ โ”œโ”€โ”€ SpacingScale.tsx
491
+ โ”‚ โ”‚ โ”œโ”€โ”€ RadiusShowcase.tsx
492
+ โ”‚ โ”‚ โ””โ”€โ”€ SizeScale.tsx
493
+ โ”‚ โ”œโ”€โ”€ types.ts
494
+ โ”‚ โ”œโ”€โ”€ utils.ts
495
+ โ”‚ โ”œโ”€โ”€ index.ts
496
+ โ”‚ โ””โ”€โ”€ styles.css
497
+ โ”œโ”€โ”€ dist/ # Built files (generated)
498
+ โ”œโ”€โ”€ package.json
499
+ โ”œโ”€โ”€ tsconfig.json
500
+ โ”œโ”€โ”€ tsup.config.ts
501
+ โ””โ”€โ”€ README.md
502
+ ```
503
+
504
+ ### Building
505
+
506
+ The package uses [tsup](https://tsup.egoist.dev/) for fast, zero-config bundling:
507
+
508
+ ```bash
509
+ npm run build
510
+ ```
511
+
512
+ This generates:
513
+ - `dist/index.js` - ESM bundle
514
+ - `dist/index.cjs` - CommonJS bundle
515
+ - `dist/index.d.ts` - TypeScript definitions
516
+ - `dist/styles.css` - Compiled styles
517
+
518
+ ## ๐Ÿ“ TypeScript Support
519
+
520
+ Full TypeScript support with comprehensive type definitions:
521
+
522
+ ```tsx
523
+ import type {
524
+ TokenDocumentationProps,
525
+ FigmaTokens,
526
+ ParsedColorToken,
527
+ ParsedSpacingToken,
528
+ ColorFamily
529
+ } from '@nibin-org/tokens';
530
+
531
+ const tokens: FigmaTokens = {
532
+ 'Colors/Value': {
533
+ base: { /* ... */ }
534
+ }
535
+ };
536
+
537
+ const handleTokenClick = (token: ParsedColorToken) => {
538
+ console.log(token.cssVariable); // Type-safe!
539
+ };
185
540
  ```
186
541
 
542
+ ## ๐Ÿค Contributing
543
+
544
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
545
+
546
+ ### Development Workflow
547
+
548
+ 1. Fork the repository
549
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
550
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
551
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
552
+ 5. Open a Pull Request
553
+
187
554
  ## ๐Ÿ“„ License
188
555
 
189
556
  MIT ยฉ [nibinlab99-dev](https://github.com/nibinlab99-dev)
190
557
 
558
+ See [LICENSE](LICENSE) for more information.
559
+
560
+ ## ๐Ÿ™ Acknowledgments
561
+
562
+ - Built with โค๏ธ for design systems teams
563
+ - Inspired by [Figma Tokens Studio](https://tokens.studio/)
564
+ - Compatible with [Style Dictionary](https://amzn.github.io/style-dictionary/)
565
+ - Typography powered by [DM Sans](https://fonts.google.com/specimen/DM+Sans) and [Fraunces](https://fonts.google.com/specimen/Fraunces)
566
+
567
+ ## ๐Ÿ“ฌ Support
568
+
569
+ - ๐Ÿ“ง Email: support@nibin.org
570
+ - ๐Ÿ’ฌ [GitHub Discussions](https://github.com/nibinlab99-dev/next-storybook/discussions)
571
+ - ๐Ÿ› [Issue Tracker](https://github.com/nibinlab99-dev/next-storybook/issues)
572
+ - ๐Ÿ“– [Documentation](https://docs.nibin.org)
573
+
191
574
  ---
192
575
 
193
- <p align="center">
194
- Made with โค๏ธ for design systems
195
- </p>
576
+ <div align="center">
577
+
578
+ **[โฌ† back to top](#nibin-orgtokens)**
579
+
580
+ Made with โค๏ธ for design systems
581
+
582
+ </div>