@yuva-devlab/tokens 0.1.0 → 0.1.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @yuva-devlab/tokens@0.1.0 build /home/runner/work/yuva-devlab-workspace/yuva-devlab-workspace/packages/tokens
2
+ > @yuva-devlab/tokens@0.1.2 build /home/runner/work/yuva-devlab-design-system/yuva-devlab-design-system/packages/tokens
3
3
  > vite build
4
4
 
5
5
  vite v7.2.4 building client environment for production...
@@ -11,8 +11,8 @@ rendering chunks...
11
11
  computing gzip size...
12
12
  dist/tokens.css 9.42 kB │ gzip: 2.19 kB
13
13
  dist/index.js 7.43 kB │ gzip: 1.55 kB
14
- [vite:dts] Declaration files built in 1050ms.
14
+ [vite:dts] Declaration files built in 998ms.
15
15
 
16
16
  dist/tokens.css 9.42 kB │ gzip: 2.19 kB
17
17
  dist/index.cjs 6.95 kB │ gzip: 1.59 kB
18
- ✓ built in 1.41s
18
+ ✓ built in 1.37s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @yuva-devlab/tokens
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 38c0267: Migrate CLI to ESM, replace StyleX with Vanilla Extract, and
8
+ standardize documentation
9
+
10
+ CLI now uses ES modules for better compatibility with modern tools like Chalk
11
+ v5. Component templates have been updated to use Vanilla Extract instead of
12
+ StyleX, matching the actual project implementation. All package READMEs now
13
+ show consistent examples for npm, yarn, and pnpm.
14
+
15
+ Breaking: CLI requires Node.js 18+ for ESM support
16
+
17
+ ## 0.1.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 2cc8dcf: Complete documentation rewrite with comprehensive examples and API
22
+ reference
23
+
3
24
  ## 0.1.0
4
25
 
5
26
  ### Minor Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yuva Devlab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,56 +1,214 @@
1
1
  # 🎨 @yuva-devlab/tokens
2
2
 
3
- Design system tokens implemented using **Vanilla Extract**.
3
+ [![npm version](https://img.shields.io/npm/v/@yuva-devlab/tokens.svg)](https://www.npmjs.com/package/@yuva-devlab/tokens)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
4
5
 
5
- These tokens power:
6
+ > Design system tokens built with Vanilla Extract, providing a comprehensive
7
+ > foundation for consistent UI development.
6
8
 
7
- - Tonal Palettes (Automated generation)
8
- - Semantic Colors (Natural / Organic theme)
9
- - Spacing (Systemic 2xs-5xl scales)
10
- - Typography (Scale-based)
11
- - Radii & Shadows
12
- - Breakpoints & Z-indices
9
+ ## Features
13
10
 
14
- ---
11
+ - 🎨 **Automated Tonal Palettes** - Material Design 3 inspired color generation
12
+ - 🌓 **Light/Dark Themes** - Semantic color tokens that adapt to theme
13
+ - 📏 **Systematic Spacing** - Consistent scale from 2xs to 5xl
14
+ - 📝 **Typography Scale** - Harmonious type system
15
+ - 🎯 **Zero Runtime** - All tokens compiled to CSS variables at build time
16
+ - 🔒 **Type-Safe** - Full TypeScript autocomplete for all tokens
15
17
 
16
- ## 📁 Folder Structure
18
+ ## Installation
17
19
 
18
20
  ```bash
19
- packages/tokens/
20
- ├── src/
21
- │ ├── utils/ # Token generation logic
22
- │ ├── palettes.css.ts # Global tonal palettes
23
- │ ├── themes.css.ts # Semantic light/dark mappings
24
- │ ├── spacing.css.ts # Spacing scales
25
- │ ├── typography.css.ts # Type scales
26
- │ └── index.ts # Entry point
27
- └── README.md
21
+ # npm
22
+ npm install @yuva-devlab/tokens
23
+
24
+ # yarn
25
+ yarn add @yuva-devlab/tokens
26
+
27
+ # pnpm
28
+ pnpm add @yuva-devlab/tokens
28
29
  ```
29
30
 
30
- ---
31
+ **Zero runtime dependencies** - All tokens are compiled to static CSS at build
32
+ time.
33
+
34
+ ## Token Categories
35
+
36
+ ### Colors
31
37
 
32
- ## 🚀 Key Technical Features
38
+ - **Tonal Palettes** - 13-shade palettes for primary, secondary, tertiary,
39
+ neutral, and error
40
+ - **Semantic Colors** - Theme-aware tokens (background, surface, primary, etc.)
41
+ - **State Colors** - Hover, active, and disabled states
33
42
 
34
- ### 1. Automated Tonal Palettes
43
+ ### Spacing
35
44
 
36
- We use a single source of truth (`SEEDS`) to generate mathematically consistent
37
- MD3 tonal palettes.
45
+ - **Scale**: `2xs`, `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl`, `5xl`
46
+ - **Values**: 4px to 96px in systematic increments
38
47
 
39
- ### 2. Zero-Runtime CSS
48
+ ### Typography
40
49
 
41
- Vanilla Extract compiles these tokens into static CSS variables at build time,
42
- ensuring maximum performance with type-safety.
50
+ - **Sizes**: `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl`, `5xl`
51
+ - **Weights**: `light`, `regular`, `medium`, `semibold`, `bold`
52
+ - **Line Heights**: Optimized for readability
43
53
 
44
- ---
54
+ ### Other Tokens
45
55
 
46
- ## How UI library uses tokens
56
+ - **Border Radius**: `sm`, `md`, `lg`, `xl`, `full`
57
+ - **Shadows**: `sm`, `md`, `lg`, `xl`
58
+ - **Z-Index**: Layered system for overlays, modals, tooltips
59
+ - **Breakpoints**: Responsive design breakpoints
60
+
61
+ ## Usage
62
+
63
+ ### In Vanilla Extract
47
64
 
48
65
  ```ts
49
66
  import { vars } from "@yuva-devlab/tokens";
50
67
  import { style } from "@vanilla-extract/css";
51
68
 
52
- export const componentStyle = style({
53
- backgroundColor: vars.colors.primary,
54
- padding: vars.spacing.md,
69
+ export const card = style({
70
+ backgroundColor: vars.colors.surface,
71
+ padding: vars.spacing.lg,
72
+ borderRadius: vars.radii.md,
73
+ boxShadow: vars.shadows.sm,
74
+
75
+ // Typography
76
+ fontSize: vars.typography.size.md,
77
+ lineHeight: vars.typography.lineHeight.md,
78
+
79
+ // Responsive
80
+ "@media": {
81
+ [vars.breakpoints.md]: {
82
+ padding: vars.spacing.xl,
83
+ },
84
+ },
55
85
  });
56
86
  ```
87
+
88
+ ### Importing CSS
89
+
90
+ ```tsx
91
+ // Import compiled CSS in your app entry point
92
+ import "@yuva-devlab/tokens/tokens.css";
93
+ ```
94
+
95
+ ### Using CSS Variables Directly
96
+
97
+ ```css
98
+ .my-component {
99
+ background-color: var(--colors-surface);
100
+ padding: var(--spacing-md);
101
+ border-radius: var(--radii-md);
102
+ }
103
+ ```
104
+
105
+ ## Color System
106
+
107
+ ### Tonal Palettes
108
+
109
+ Each color has 13 shades (0-100 in increments of 10):
110
+
111
+ ```ts
112
+ import { vars } from "@yuva-devlab/tokens";
113
+
114
+ // Primary palette
115
+ vars.palettes.primary[0]; // Lightest
116
+ vars.palettes.primary[50]; // Mid-tone
117
+ vars.palettes.primary[100]; // Darkest
118
+
119
+ // Available palettes:
120
+ // - primary (Natural green)
121
+ // - secondary
122
+ // - tertiary
123
+ // - neutral
124
+ // - neutralVariant
125
+ // - error
126
+ ```
127
+
128
+ ### Semantic Colors
129
+
130
+ Theme-aware tokens that automatically adapt:
131
+
132
+ ```ts
133
+ vars.colors.background; // Page background
134
+ vars.colors.surface; // Card/panel background
135
+ vars.colors.primary; // Primary brand color
136
+ vars.colors.onPrimary; // Text on primary
137
+ vars.colors.secondary; // Secondary color
138
+ vars.colors.error; // Error state
139
+ vars.colors.outline; // Borders
140
+ ```
141
+
142
+ ## Spacing System
143
+
144
+ ```ts
145
+ import { vars } from "@yuva-devlab/tokens";
146
+
147
+ vars.spacing["2xs"]; // 4px
148
+ vars.spacing.xs; // 8px
149
+ vars.spacing.sm; // 12px
150
+ vars.spacing.md; // 16px
151
+ vars.spacing.lg; // 24px
152
+ vars.spacing.xl; // 32px
153
+ vars.spacing["2xl"]; // 48px
154
+ vars.spacing["3xl"]; // 64px
155
+ vars.spacing["4xl"]; // 80px
156
+ vars.spacing["5xl"]; // 96px
157
+ ```
158
+
159
+ ## Typography
160
+
161
+ ```ts
162
+ import { vars } from "@yuva-devlab/tokens";
163
+
164
+ // Sizes
165
+ vars.typography.size.xs; // 12px
166
+ vars.typography.size.sm; // 14px
167
+ vars.typography.size.md; // 16px
168
+ vars.typography.size.lg; // 18px
169
+ vars.typography.size.xl; // 20px
170
+ vars.typography.size["2xl"]; // 24px
171
+ vars.typography.size["3xl"]; // 30px
172
+ vars.typography.size["4xl"]; // 36px
173
+ vars.typography.size["5xl"]; // 48px
174
+
175
+ // Weights
176
+ vars.typography.weight.light; // 300
177
+ vars.typography.weight.regular; // 400
178
+ vars.typography.weight.medium; // 500
179
+ vars.typography.weight.semibold; // 600
180
+ vars.typography.weight.bold; // 700
181
+ ```
182
+
183
+ ## Development
184
+
185
+ ```bash
186
+ # Build tokens
187
+ pnpm --filter @yuva-devlab/tokens build
188
+
189
+ # Watch mode
190
+ pnpm --filter @yuva-devlab/tokens dev
191
+ ```
192
+
193
+ ## Architecture
194
+
195
+ ```
196
+ Color Seeds (HSL)
197
+ ↓
198
+ Tonal Palette Generation (MD3 algorithm)
199
+ ↓
200
+ Semantic Token Mapping (Light/Dark)
201
+ ↓
202
+ CSS Variables (Compiled by Vanilla Extract)
203
+ ↓
204
+ Your Components
205
+ ```
206
+
207
+ ## Related Packages
208
+
209
+ - [@yuva-devlab/colors](../colors) - Palette generation utility
210
+ - [@yuva-devlab/ui](../ui) - Components using these tokens
211
+
212
+ ## License
213
+
214
+ MIT © Yuva Devlab
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuva-devlab/tokens",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -23,10 +23,10 @@
23
23
  "@vanilla-extract/vite-plugin": "^5.1.1",
24
24
  "vite": "^7.2.4",
25
25
  "vite-plugin-dts": "^4.5.4",
26
- "@yuva-devlab/eslint-config": "0.1.0",
27
- "@yuva-devlab/colors": "0.1.0",
28
- "@yuva-devlab/prettier-config": "0.1.0",
29
- "@yuva-devlab/typescript-config": "0.1.0"
26
+ "@yuva-devlab/colors": "0.1.2",
27
+ "@yuva-devlab/eslint-config": "0.1.1",
28
+ "@yuva-devlab/prettier-config": "0.1.1",
29
+ "@yuva-devlab/typescript-config": "0.1.1"
30
30
  },
31
31
  "dependencies": {
32
32
  "@vanilla-extract/css": "^1.17.4"