@aziontech/theme 0.1.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 (2) hide show
  1. package/README.md +318 -329
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,466 +1,455 @@
1
- <h1 align="center">azion-theme</h1>
1
+ # @aziontech/theme
2
2
 
3
- ![production](https://github.com/aziontech/azion-theme/actions/workflows/release.yml/badge.svg)
3
+ A comprehensive design token system and theming solution for Azion's web applications. This package provides primitive colors, semantic tokens, brand colors, and seamless integration with Tailwind CSS.
4
4
 
5
- <p align="center">
6
- <img
7
- src="./doc/cover-image.png"
8
- width="1200px"
9
- />
10
- </p>
5
+ ## Features
11
6
 
12
- The Azion Theme repository is focused on sharing our style kit across interfaces and should be used in all company projects, including Azion Console Kit, Azion Site, Landing Pages, and all user interactions with Azion.
7
+ - **Design Tokens**: Primitive and semantic color tokens generated from Figma
8
+ - **Brand Colors**: Azion's official color palette with primary (orange), accent (violet), and surface colors
9
+ - **Theme Support**: Built-in light and dark mode theming
10
+ - **Tailwind Integration**: Plugin and preset for seamless Tailwind CSS integration
11
+ - **CSS Variables**: Automatic CSS variable generation for dynamic theming
12
+ - **Widget Support**: Separate theme variant for embedded widgets
13
13
 
14
- ## 📋 Table of Contents
15
-
16
- - [Installation](#-installation)
17
- - [Usage](#-usage)
18
- - [Development](#-development)
19
- - [Building](#-building)
20
- - [Release Process](#-release-process)
21
- - [Design Tokens](#-design-tokens)
22
- - [Links](#-links)
23
-
24
- ## 🚀 Installation
25
-
26
- To install the `azion-theme` project, you need to follow the command. Choose one of your preferences: npm or yarn:
14
+ ## Installation
27
15
 
28
16
  ```bash
29
- npm install azion-theme --save
17
+ npm install @aziontech/theme
30
18
  # or
31
- yarn add azion-theme
32
- ```
33
-
34
- Alternatively, you can configure the `package.json` file by adding the dependency:
35
-
36
- ```json
37
- {
38
- "dependencies": {
39
- "azion-theme": "^1.4.0"
40
- }
41
- }
19
+ pnpm add @aziontech/theme
20
+ # or
21
+ yarn add @aziontech/theme
42
22
  ```
43
23
 
44
- After updating the `package.json` file, run `npm install` in the root of your project to install the Azion Theme.
24
+ ## Quick Start
45
25
 
46
- ### 🔗 Integration with Front-End Project
26
+ ### Option 1: CSS Import (Recommended for web applications)
47
27
 
48
- To integrate the Azion Theme into your front-end project, you need to import the theme files in your project's entry point file (App.vue, main.js, index.js, etc.):
28
+ Import the main theme stylesheet:
49
29
 
50
30
  ```javascript
51
- import 'azion-theme/dark'
52
- import 'azion-theme/light'
31
+ // Default theme (includes light/dark mode support)
32
+ import '@aziontech/theme';
53
33
  ```
54
34
 
55
- Make sure to include these imports at the top of your entry point file to ensure the styles are applied correctly throughout your application.
35
+ Add the theme class to your root element:
56
36
 
57
- ## 💻 Development
37
+ ```html
38
+ <div class="azion">
39
+ <!-- Your application content -->
40
+ </div>
41
+
42
+ <!-- For dark mode -->
43
+ <div class="azion azion-dark">
44
+ <!-- Your application content -->
45
+ </div>
46
+ ```
58
47
 
59
- To work locally, you should clone both the `azion-theme` repository and the other repository where the theme will be used.
48
+ ### Option 2: Tailwind CSS Integration
60
49
 
61
- ### Example:
50
+ #### Using the Preset
62
51
 
63
- In this example, we will use the [azion-webkit](https://github.com/aziontech/azion-webkit) repository:
52
+ Add the preset to your `tailwind.config.js`:
64
53
 
65
- 1. Clone the `azion-webkit` and `azion-theme` repositories:
54
+ ```javascript
55
+ import { preset } from '@aziontech/theme/tokens';
66
56
 
67
- ```bash
68
- git clone https://github.com/aziontech/azion-webkit.git
69
- git clone https://github.com/aziontech/azion-theme.git
57
+ export default {
58
+ presets: [preset],
59
+ // your config
60
+ };
70
61
  ```
71
62
 
72
- 2. Install dependencies and create the link point:
63
+ #### Using the Plugin
73
64
 
74
- ```bash
75
- cd ./azion-theme && npm i && npm link
76
- ```
65
+ For static utility classes with light/dark mode support:
77
66
 
78
- 3. Link the `azion-theme` to the `azion-webkit` project:
67
+ ```javascript
68
+ import { tokenUtilities } from '@aziontech/theme/tokens';
79
69
 
80
- ```bash
81
- cd ../azion-webkit && npm i && npm link azion-theme
70
+ export default {
71
+ plugins: [
72
+ tokenUtilities({
73
+ darkSelector: '.dark',
74
+ extraDarkSelectors: ['.azion.azion-dark']
75
+ })
76
+ ]
77
+ };
82
78
  ```
83
79
 
84
- Any modifications made to `azion-theme` will be reflected on this development server with hot reload.
85
-
86
- ## 🏗️ Building
80
+ ### Option 3: JavaScript Token Access
87
81
 
88
- This package is built automatically using Semantic Release during the release process. However, you can also build it manually for development purposes.
82
+ Access tokens programmatically:
89
83
 
90
- ### Build Process
91
-
92
- The build process includes the following steps:
93
-
94
- 1. **Validate Theme Tokens** - Ensures all token files are valid and properly formatted
95
- 2. **Clean dist/ Directory** - Removes any previously generated files
96
- 3. **Compile Tokens** - Merges all token definitions into a distributable format
97
- 4. **Generate CSS Files** - Creates CSS files with CSS variables for light/dark themes
98
- 5. **Generate package.json** - Creates a distributable package manifest
99
- 6. **Copy Documentation** - Copies LICENSE and README.md into the dist folder
100
- 7. **Generate Type Definitions** - Creates TypeScript declaration files
101
-
102
- ### Manual Build
84
+ ```javascript
85
+ // Import all tokens
86
+ import {
87
+ primitives,
88
+ brandPrimitives,
89
+ surfacePrimitives,
90
+ textSemantic,
91
+ backgroundSemantic,
92
+ borderSemantic
93
+ } from '@aziontech/theme/tokens';
103
94
 
104
- To build the package manually:
95
+ // Use primitive colors
96
+ const primaryColor = primitives.orange['500']; // '#fe601f'
97
+ const accentColor = primitives.violet['500']; // '#8a84ec'
105
98
 
106
- ```bash
107
- cd packages/theme
108
- npm run build
99
+ // Use semantic tokens (returns token references)
100
+ const textColor = textSemantic.light.textColorBase; // tokenRef('primitives.neutral.900')
109
101
  ```
110
102
 
111
- This will generate the `dist/` directory with all necessary files.
103
+ ### Option 4: CSS Variables Injection
112
104
 
113
- ### Preview Build
105
+ Inject CSS variables dynamically at runtime:
114
106
 
115
- To preview what the build will look like without publishing:
107
+ ```javascript
108
+ import { injectCssVars } from '@aziontech/theme/tokens';
116
109
 
117
- ```bash
118
- npm run pack:dry
110
+ // Injects <style data-azion-tokens> into document.head
111
+ const styleElement = injectCssVars();
119
112
  ```
120
113
 
121
- This will generate a tarball preview using npm pack --dry-run.
114
+ ## Token Structure
122
115
 
123
- ### Clean Build Artifacts
116
+ ### Primitive Colors
124
117
 
125
- To remove all generated files:
118
+ Base color palettes with numeric scales (50-950):
126
119
 
127
- ```bash
128
- npm run clean
129
- ```
130
-
131
- This will remove the `dist/` directory.
132
-
133
- ## 📦 Release Process
120
+ ```javascript
121
+ import { primitives } from '@aziontech/theme/tokens';
134
122
 
135
- This package uses Semantic Release for automated versioning and publishing.
123
+ primitives.orange['500']; // Primary brand color
124
+ primitives.violet['500']; // Accent brand color
125
+ primitives.neutral['900']; // Dark surfaces
126
+ primitives.neutral['50']; // Light surfaces
127
+ ```
136
128
 
137
- ### Automatic Release Workflow
129
+ Available primitives:
130
+ - `base`: White and black
131
+ - `orange`: Primary brand color (11 shades)
132
+ - `violet`: Accent brand color (11 shades)
133
+ - `neutral`: Gray scale for surfaces (11 shades)
134
+ - `gray`, `slate`: Additional gray variants
135
+ - `red`: Semantic danger color
136
+ - `green`: Semantic success color
137
+ - `yellow`: Semantic warning color
138
+ - `blue`: Link colors
138
139
 
139
- 1. Commits following the conventional commit format are analyzed
140
- 2. Version numbers are automatically incremented based on commit type
141
- 3. Release notes are generated automatically
142
- 4. A changelog is updated
143
- 5. The package is built
144
- 6. The package is published to npm with provenance
145
- 7. GitHub release is created
140
+ ### Brand Primitives
146
141
 
147
- ### Commit Convention
142
+ Azion-specific brand colors:
148
143
 
149
- Use this format for conventional commits:
144
+ ```javascript
145
+ import { brandPrimitives } from '@aziontech/theme/tokens';
150
146
 
151
- ```
152
- [#ticket] type: subject
147
+ brandPrimitives.primary['500']; // Orange brand color
148
+ brandPrimitives.accent['500']; // Violet accent color
149
+ brandPrimitives.absolute.white; // Pure white
150
+ brandPrimitives.absolute.black; // Pure black
153
151
  ```
154
152
 
155
- Where:
153
+ ### Surface Primitives
156
154
 
157
- - `[#ticket]` - Optional Jira ticket reference (e.g., `[#AZ-1234]`)
158
- - `type` - One of: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`
159
- - `subject` - Brief description of the change
155
+ Surface color scales for backgrounds:
160
156
 
161
- Examples:
162
-
163
- - `feat(tokens): Add new primary color variants`
164
- - `fix(theme): Update border radius values`
165
- - `chore(build): Update semantic-release configuration`
157
+ ```javascript
158
+ import { surfacePrimitives } from '@aziontech/theme/tokens';
166
159
 
167
- ### Release Types
160
+ surfacePrimitives.surface['0']; // White
161
+ surfacePrimitives.surface['50']; // Lightest gray
162
+ surfacePrimitives.surface['900']; // Very dark gray
163
+ surfacePrimitives.surface['950']; // Almost black
164
+ ```
168
165
 
169
- - **feat (new features)**: **minor** version increment
170
- - **fix (bug fixes)**: **patch** version increment
171
- - **hotfix (emergency fixes)**: **patch** version increment
172
- - **chore, docs, style, refactor**: **patch** version increment
166
+ ### Semantic Tokens
173
167
 
174
- ### CI/CD Workflow
168
+ Context-aware tokens that automatically adapt to light/dark themes:
175
169
 
176
- The workflow is defined in `.github/workflows/package-theme.yml` and runs on pushes to the `main` branch when `packages/theme/**` files change.
170
+ #### Background Tokens
177
171
 
178
- ### Required Secrets
172
+ ```javascript
173
+ import { backgroundSemantic } from '@aziontech/theme/tokens';
179
174
 
180
- To enable automated npm publishing, configure the following GitHub secrets:
175
+ // Light mode
176
+ backgroundSemantic.light.bgLayer1; // Surface 0 (white)
177
+ backgroundSemantic.light.bgLayer2; // Surface 50
178
+ backgroundSemantic.light.bgCanvas; // Surface 100
181
179
 
182
- - `NPM_TOKEN` - Your npm authentication token with publish permissions
180
+ // Dark mode
181
+ backgroundSemantic.dark.bgLayer1; // Surface 800
182
+ backgroundSemantic.dark.bgCanvas; // Surface 950
183
+ ```
183
184
 
184
- Without this token, the build will still complete and generate release notes, but npm publishing will be skipped.
185
+ #### Text Tokens
185
186
 
186
- ### Manual Release
187
+ ```javascript
188
+ import { textSemantic } from '@aziontech/theme/tokens';
187
189
 
188
- You can also trigger a manual release:
190
+ // Light mode
191
+ textSemantic.light.textColorBase; // neutral.900
192
+ textSemantic.light.textColorMuted; // neutral.600
193
+ textSemantic.light.textColorLink; // blue.600
189
194
 
190
- ```bash
191
- npx semantic-release
195
+ // Dark mode
196
+ textSemantic.dark.textColorBase; // neutral.50
197
+ textSemantic.dark.textColorMuted; // neutral.400
198
+ textSemantic.dark.textColorLink; // blue.300
192
199
  ```
193
200
 
194
- This will require the `NPM_TOKEN` to be available in your environment.
195
-
196
- ## 🎨 Design Tokens
197
-
198
- This project includes **primitive color tokens** extracted directly from Figma, ready to be consumed via Tailwind CSS.
199
-
200
- ### 🚀 How to Use the Tokens
201
+ #### Border Tokens
201
202
 
202
203
  ```javascript
203
- // tailwind.config.js
204
- import typography from '@tailwindcss/typography'
205
- import { tokenUtilities } from 'azion-theme/tokens/build/tailwind-plugin'
206
- import colors from 'azion-theme/tokens'
204
+ import { borderSemantic } from '@aziontech/theme/tokens';
207
205
 
208
- export default {
209
- content: ['./src/**/*.{js,ts,jsx,tsx,html}'],
210
- darkMode: ['class', '.dark', '.azion.azion-dark'],
211
- theme: {
212
- extend: {
213
- colors: {
214
- ...colors
215
- }
216
- }
217
- },
218
- plugins: [tokenUtilities(), typography]
219
- }
206
+ borderSemantic.light.borderBase; // surface.200
207
+ borderSemantic.light.borderPrimary; // primary.500
208
+ borderSemantic.light.borderDanger; // red.600
209
+
210
+ borderSemantic.dark.borderBase; // surface.700
211
+ borderSemantic.dark.borderDanger; // red.400
220
212
  ```
221
213
 
222
- #### Token structure overview
214
+ ## Theming
223
215
 
224
- **Global/Primitive tokens** (direct values, use with `dark:` variant):
216
+ ### Light Mode (Default)
225
217
 
226
- ```javascript
227
- // Primitive palettes (all with 50-950 shades)
228
- colors.orange[500] // #fe601f
229
- colors.violet[500] // #8a84ec
230
- colors.neutral[900] // #171717
231
-
232
- // Brand colors
233
- colors.brand.black // #0a0a0a
234
- colors.brand.white // #fafafa
235
- colors.brand.orange // #fe601f
236
-
237
- // Brand primitives (aliases)
238
- colors.primary[500] // orange palette
239
- colors.accent[500] // violet palette
240
-
241
- // Surface primitives (neutral-based)
242
- colors.surface[950] // #0a0a0a
218
+ ```html
219
+ <div class="azion azion-light">
220
+ <!-- Light theme content -->
221
+ </div>
243
222
  ```
244
223
 
245
- **Semantic tokens** (theme-aware, no `dark:` variant needed):
224
+ ### Dark Mode
246
225
 
247
- ```javascript
248
- // Text colors - automatically switches between light/dark
249
- colors.text.base // neutral-900 (light) / neutral-50 (dark)
250
- colors.text.muted // neutral-600 (light) / neutral-400 (dark)
251
- colors.text.accent // accent-500 (both modes)
252
-
253
- // Background colors - theme-aware layers
254
- colors.background.layer1 // surface-0 (light) / surface-800 (dark)
255
- colors.background.layer2 // surface-50 (light) / surface-700 (dark)
256
- colors.background.canvas // surface-100 (light) / surface-950 (dark)
257
-
258
- // Border colors - theme-aware borders
259
- colors.border.base // surface-200 (light) / surface-700 (dark)
260
- colors.border.primary // primary-500 (both modes)
261
- colors.border.accent // accent-500 (both modes)
226
+ ```html
227
+ <div class="azion azion-dark">
228
+ <!-- Dark theme content -->
229
+ </div>
262
230
  ```
263
231
 
264
- #### Usage in HTML/Tailwind Classes
265
-
266
- **Using semantic tokens** (theme-aware, no `dark:` variant needed):
232
+ Or use the standard Tailwind dark mode class:
267
233
 
268
234
  ```html
269
- <!-- Semantic background - automatically switches theme -->
270
- <div class="bg-layer1">Layer 1 background (white in light, dark in dark mode)</div>
271
-
272
- <!-- Semantic text colors -->
273
- <p class="text-base">Base text color (auto-adapts to theme)</p>
235
+ <div class="azion dark">
236
+ <!-- Dark theme content -->
237
+ </div>
238
+ ```
274
239
 
275
- <!-- Semantic borders -->
276
- <div class="border border-base">Border adapts to current theme</div>
240
+ ### Dynamic Theme Switching
277
241
 
278
- <!-- Semantic interactive states -->
279
- <button class="bg-layer1 hover:bg-layer1-hover border border-primary text-primary">
280
- Themed button
281
- </button>
242
+ ```javascript
243
+ // Toggle dark mode
244
+ const root = document.querySelector('.azion');
245
+ root.classList.toggle('azion-dark');
246
+ root.classList.toggle('azion-light');
282
247
  ```
283
248
 
284
- **Using global tokens** (can use `dark:` in this cases):
249
+ ## Tailwind CSS Usage
250
+
251
+ ### With Preset (Dynamic CSS Variables)
285
252
 
286
253
  ```html
287
- <!-- Background with dark variant -->
288
- <div class="bg-neutral-50 dark:bg-neutral-950">Adaptive background</div>
254
+ <!-- Background colors -->
255
+ <div class="bg-layer1">Layer 1 background</div>
256
+ <div class="bg-canvas">Canvas background</div>
257
+ <div class="bg-base">Base background</div>
258
+
259
+ <!-- Text colors -->
260
+ <p class="text-base">Base text</p>
261
+ <p class="text-muted">Muted text</p>
262
+ <a class="text-link">Link text</a>
263
+
264
+ <!-- Border colors -->
265
+ <div class="border border-base">Default border</div>
266
+ <div class="border border-primary">Primary border</div>
267
+ ```
289
268
 
290
- <!-- Text colors with dark variant -->
291
- <p class="text-neutral-900 dark:text-neutral-100">Primary text color</p>
269
+ ### With Plugin (Static Utilities)
292
270
 
293
- <!-- Border colors with dark variant -->
294
- <div class="border border-neutral-200 dark:border-neutral-800">Card with adaptive border</div>
271
+ When using the `tokenUtilities` plugin:
295
272
 
296
- <!-- Using brand colors (no dark variant needed) -->
297
- <button class="bg-orange-500 text-white hover:bg-orange-600">Action Button</button>
273
+ ```html
274
+ <!-- These generate static values for both light and dark -->
275
+ <div class="bg-layer1">Light: white / Dark: surface-800</div>
276
+ <div class="text-base">Light: neutral-900 / Dark: neutral-50</div>
298
277
  ```
299
278
 
300
- **Available token classes:**
301
-
302
- _Global tokens_ (use with `dark:` variant):
279
+ ### Complete Tailwind Config Example
303
280
 
304
- - **Neutrals:** `neutral-50` → `neutral-950` (surface backgrounds, text, borders)
305
- - **Brand:** `orange-50` `orange-950` (primary actions)
306
- - **Accent:** `violet-50` → `violet-950` (secondary highlights)
307
- - **Status:** `red-*`, `green-*`, `yellow-*`, `blue-*` (semantic status colors)
308
-
309
- _Semantic tokens_ (theme-aware, no `dark:` needed):
281
+ ```javascript
282
+ import { preset, tokenUtilities } from '@aziontech/theme/tokens';
310
283
 
311
- - **Text:** `text-base`, `text-muted`, `text-accent`, `text-primary`, `text-link`
312
- - **Background:** `bg-layer1`, `bg-layer2`, `bg-canvas`, `bg-base`
313
- - **Border:** `border-base`, `border-primary`, `border-accent`, `border-warning`, `border-success`, `border-danger`
284
+ export default {
285
+ content: ['./src/**/*.{js,ts,jsx,tsx}'],
286
+ presets: [preset],
287
+ darkMode: 'class',
288
+ plugins: [
289
+ tokenUtilities({
290
+ darkSelector: '.dark',
291
+ extraDarkSelectors: ['.azion.azion-dark']
292
+ })
293
+ ]
294
+ };
295
+ ```
314
296
 
315
- ### Theme Switch Compatibility
297
+ ## CSS Variables
316
298
 
317
- The CSS variable initializer targets both the Tailwind `.dark` class and the existing theme classes used by the SCSS theme:
299
+ All semantic tokens are available as CSS variables:
318
300
 
319
301
  ```css
320
- :root,
321
- [data-theme='light'],
322
- .azion.azion-light {
323
- /* light vars */
302
+ /* Automatically generated */
303
+ :root, [data-theme=light], .azion.azion-light {
304
+ --text-textColorBase: #171717;
305
+ --background-bgLayer1: #ffffff;
306
+ --border-borderBase: #e5e5e5;
324
307
  }
325
- [data-theme='dark'],
326
- .dark,
327
- .azion.azion-dark {
328
- /* dark vars */
308
+
309
+ [data-theme=dark], .dark, .azion.azion-dark {
310
+ --text-textColorBase: #fafafa;
311
+ --background-bgLayer1: #262626;
312
+ --border-borderBase: #404040;
329
313
  }
330
314
  ```
331
315
 
332
- ### Granular Imports (Advanced)
316
+ Use in your CSS:
333
317
 
334
- ```javascript
335
- // Named exports for specific token types
336
- import {
337
- primitives,
338
- brandColors,
339
- brandPrimitives,
340
- surfacePrimitives,
341
- preset,
342
- createTailwindConfig,
343
- tokenUtilities
344
- } from 'azion-theme/tokens'
318
+ ```css
319
+ .custom-component {
320
+ color: var(--text-textColorBase);
321
+ background-color: var(--background-bgLayer1);
322
+ border-color: var(--border-borderBase);
323
+ }
345
324
  ```
346
325
 
347
- ### 🛠️ Sync & Maintenance (With Script)
326
+ ## Widget Theme
348
327
 
349
- #### How to feed new and changed tokens from Figma
328
+ For embedded widgets and iframes, use the widget theme variant:
350
329
 
351
- 1. **Update Figma Variables**
352
- - Ensure **Global** and **Semantic** variables are updated and organized correctly (naming, groups, modes, and values).
330
+ ```javascript
331
+ import '@aziontech/theme/widget';
332
+ ```
353
333
 
354
- 2. **Open the Tokens Studio for Figma plugin**
334
+ The widget theme includes:
335
+ - Compact variable definitions
336
+ - Optimized for isolated contexts
337
+ - Same token structure as main theme
355
338
 
356
- 3. **Import Figma Variables into Tokens Studio**
357
- - Use Tokens Studio’s import-from-variables flow to bring the current Variables state into the token sets.
339
+ ## API Reference
358
340
 
359
- 4. **Export to file/folder**
360
- - Export using **Multiple files**.
341
+ ### Exports
361
342
 
362
- 5. **Copy the exported files into this repo**
363
- - Place them under [`src/tokens/figma-reference-tokens-studio/`](src/tokens/figma-reference-tokens-studio:1) (replace existing contents).
343
+ #### Default Export
344
+ - `@aziontech/theme` - Main CSS theme (default.js)
345
+ - `@aziontech/theme/widget` - Widget CSS theme (widget.js)
346
+ - `@aziontech/theme/tokens` - JavaScript token system (src/tokens/index.js)
364
347
 
365
- 6. **Regenerate the code tokens**
366
- - Run:
348
+ #### Token Exports
367
349
 
368
- ```bash
369
- node ./scripts/figma-sync.js
350
+ ```javascript
351
+ // Primitive tokens
352
+ export { primitives } from './primitives/colors.js';
353
+ export { brandPrimitives, surfacePrimitives } from './primitives/brand.js';
354
+
355
+ // Semantic tokens
356
+ export { textSemantic } from './semantic/text.js';
357
+ export { backgroundSemantic } from './semantic/backgrounds.js';
358
+ export { borderSemantic } from './semantic/borders.js';
359
+
360
+ // Build utilities
361
+ export { tokenRef } from './build/refs.js';
362
+ export { resolveRefsToCssVars } from './build/resolve.js';
363
+ export { createCssVars, cssVarsString, injectCssVars } from './build/css-vars.js';
364
+ export { preset } from './build/preset.js';
365
+ export { tokenUtilities } from './build/tailwind-plugin.js';
370
366
  ```
371
367
 
372
- 7. **Review and commit**
373
- - Inspect the diff in the generated files and validate light/dark semantics before committing.
374
-
375
- Files affected by the script:
376
-
377
- - [`src/tokens/primitives/colors.js`](src/tokens/primitives/colors.js)
378
- - [`src/tokens/primitives/brand.js`](src/tokens/primitives/brand.js)
379
- - [`src/tokens/semantic/text.js`](src/tokens/semantic/text.js)
380
- - [`src/tokens/semantic/backgrounds.js`](src/tokens/semantic/backgrounds.js)
381
- - [`src/tokens/semantic/borders.js`](src/tokens/semantic/borders.js)
382
-
383
- ### 🧰 Manual Maintenance (Without Script)
368
+ ## Token Resolution
384
369
 
385
- When updating or adding tokens manually, edit the files below depending on the token type:
370
+ Tokens use a reference system for maintainability:
386
371
 
387
- - **Primitive palettes:** [`src/tokens/primitives/colors.js`](src/tokens/primitives/colors.js)
388
- - **Brand + surface primitives:** [`src/tokens/primitives/brand.js`](src/tokens/primitives/brand.js)
389
- - **Semantic text (light/dark):** [`src/tokens/semantic/text.js`](src/tokens/semantic/text.js)
390
- - **Semantic backgrounds (light/dark):** [`src/tokens/semantic/backgrounds.js`](src/tokens/semantic/backgrounds.js)
391
- - **Semantic borders (light/dark):** [`src/tokens/semantic/borders.js`](src/tokens/semantic/borders.js)
392
- - **Brand aliases:** [`src/tokens/colors-brand.js`](src/tokens/colors-brand.js)
393
- - **Tailwind mappings (class names):** [`src/tokens/build/preset.js`](src/tokens/build/preset.js)
394
- - **CSS vars output/selectors:** [`src/tokens/build/css-vars.js`](src/tokens/build/css-vars.js)
395
-
396
- Checklist when adding a new token manually:
372
+ ```javascript
373
+ // Define token reference
374
+ const textColor = tokenRef('primitives.neutral.900');
397
375
 
398
- 1. Add/update the primitive or surface scale value (if needed).
399
- 2. Add matching semantic entries for both `light` and `dark`.
400
- 3. Update Tailwind mappings if you want a class for the token.
401
- 4. Regenerate or verify CSS vars output for both themes.
376
+ // Resolve to actual value
377
+ resolveRefsToCssVars({
378
+ primitives,
379
+ textSemantic
380
+ });
381
+ // Output: { '--text-textColorBase': '#171717' }
382
+ ```
402
383
 
403
- ### 🎨 Available Colors
384
+ ## Development
404
385
 
405
- #### Main Palette (Orange)
386
+ ### Prerequisites
406
387
 
407
- - `orange-50` `orange-950`
408
- - **Primary**: `orange-500` (#fe601f)
388
+ - Node.js (LTS version)
389
+ - pnpm (v9+)
409
390
 
410
- #### Brand Palette
391
+ ### Scripts
411
392
 
412
- - `brand-black` (#0a0a0a)
413
- - `brand-white` (#fafafa)
414
- - `brand-dark-gray` (#171717)
415
- - `brand-medium-gray` (#737373)
393
+ ```bash
394
+ # Format code
395
+ pnpm format
416
396
 
417
- #### Other Complete Palettes
397
+ # Dry-run package
398
+ pnpm pack:dry
418
399
 
419
- - **Violet, Slate, Gray, Neutral, Blue, Red, Yellow, Green**
420
- - All with 11 shades (50 → 950)
400
+ # Publish (requires dist build)
401
+ pnpm publish
402
+ ```
421
403
 
422
- #### Semantic Colors
404
+ ### Project Structure
423
405
 
424
- - `primary` (orange-500)
425
- - `success` (green-500)
426
- - `warning` (yellow-500)
427
- - `error` (red-500)
428
- - `info` (blue-500)
406
+ ```
407
+ packages/theme/
408
+ ├── default.js # Main entry point
409
+ ├── widget.js # Widget entry point
410
+ ├── src/
411
+ │ ├── azion/ # CSS theme files
412
+ │ │ ├── theme.scss # Main theme
413
+ │ │ ├── theme-widget.scss
414
+ │ │ ├── _variables.scss
415
+ │ │ ├── _fonts.scss
416
+ │ │ ├── theme-base/ # Base components
417
+ │ │ ├── extended-components/
418
+ │ │ └── custom/
419
+ │ └── tokens/ # JavaScript tokens
420
+ │ ├── index.js # Public API
421
+ │ ├── primitives/ # Base colors
422
+ │ ├── semantic/ # Context-aware tokens
423
+ │ └── build/ # Build utilities
424
+ │ ├── preset.js
425
+ │ ├── css-vars.js
426
+ │ └── tailwind-plugin.js
427
+ └── package.json
428
+ ```
429
429
 
430
- ### ⚠️ Troubleshooting
430
+ ## Browser Support
431
431
 
432
- #### If you get import errors:
432
+ - Modern browsers with CSS Variables support
433
+ - Chrome, Firefox, Safari, Edge (latest versions)
433
434
 
434
- **ES Modules (recommended)**
435
+ ## Versioning
435
436
 
436
- ```javascript
437
- import colors from 'azion-theme/tokens'
438
- ```
437
+ This package follows [Semantic Versioning](https://semver.org/). Version numbers are automatically managed via semantic-release.
439
438
 
440
- **Named exports**
439
+ ## Contributing
441
440
 
442
- ```javascript
443
- import { primitives, brandColors, brandPrimitives, surfacePrimitives } from 'azion-theme/tokens'
444
- ```
441
+ This package is part of the Azion WebKit monorepo. Please see the main repository for contribution guidelines.
445
442
 
446
- **Direct file imports**
443
+ ## License
447
444
 
448
- ```javascript
449
- import { primitives } from 'azion-theme/tokens/primitives/colors.js'
450
- import { brandColors } from 'azion-theme/tokens/colors-brand.js'
451
- ```
445
+ MIT © Azion Technologies
452
446
 
453
- **Configure Vite (if using Vite)**
454
- Add to your `vite.config.js`:
447
+ ## Links
455
448
 
456
- ```javascript
457
- export default {
458
- resolve: {
459
- conditions: ['import', 'module', 'browser', 'default']
460
- }
461
- }
462
- ```
449
+ - [GitHub Repository](https://github.com/aziontech/webkit)
450
+ - [NPM Package](https://www.npmjs.com/package/@aziontech/theme)
451
+ - [Issue Tracker](https://github.com/aziontech/webkit/issues)
463
452
 
464
- ## 🔗 Links
453
+ ## Changelog
465
454
 
466
- - [Figma Global Tokens](https://www.figma.com/design/t97pXRs7xME3SJDs5iZ5RF/Global-Tokens?node-id=0-1)
455
+ See [CHANGELOG.md](./CHANGELOG.md) for release history.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aziontech/theme",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "1.0.1",
5
5
  "author": "aziontech",
6
6
  "license": "MIT",
7
7
  "repository": {