@aziontech/theme 1.1.1 → 1.3.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/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # @aziontech/theme
2
2
 
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.
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
5
  ## Features
6
6
 
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
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
14
  ## Installation
15
15
 
@@ -301,15 +301,17 @@ All semantic tokens are available as CSS variables:
301
301
  ```css
302
302
  /* Automatically generated */
303
303
  :root, [data-theme=light], .azion.azion-light {
304
- --text-textColorBase: #171717;
305
- --background-bgLayer1: #ffffff;
306
- --border-borderBase: #e5e5e5;
304
+ --text-default: #171717;
305
+ --text-muted: #525252;
306
+ --background-surface: #ffffff;
307
+ --border-default: #e5e5e5;
307
308
  }
308
309
 
309
310
  [data-theme=dark], .dark, .azion.azion-dark {
310
- --text-textColorBase: #fafafa;
311
- --background-bgLayer1: #262626;
312
- --border-borderBase: #404040;
311
+ --text-default: #fafafa;
312
+ --text-muted: #a3a3a3;
313
+ --background-surface: #262626;
314
+ --border-default: #404040;
313
315
  }
314
316
  ```
315
317
 
@@ -317,9 +319,9 @@ Use in your CSS:
317
319
 
318
320
  ```css
319
321
  .custom-component {
320
- color: var(--text-textColorBase);
321
- background-color: var(--background-bgLayer1);
322
- border-color: var(--border-borderBase);
322
+ color: var(--text-default);
323
+ background-color: var(--background-surface);
324
+ border-color: var(--border-default);
323
325
  }
324
326
  ```
325
327
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aziontech/theme",
3
3
  "type": "module",
4
- "version": "1.1.1",
4
+ "version": "1.3.0",
5
5
  "author": "aziontech",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -44,7 +44,8 @@
44
44
  "colors-brand.js",
45
45
  "default.js",
46
46
  "tokens.js",
47
- "widget.js"
47
+ "widget.js",
48
+ "tailwind-theme.js"
48
49
  ],
49
50
  "exports": {
50
51
  ".": "./default.js",
@@ -57,6 +58,11 @@
57
58
  "./tokens/semantic/borders": "./tokens.js",
58
59
  "./tokens/build/preset": "./src/tokens/build/preset.js",
59
60
  "./tokens/build/tailwind-helper": "./src/tokens/build/tailwind-helper.js",
60
- "./tokens/build/tailwind-plugin": "./src/tokens/build/tailwind-plugin.js"
61
+ "./tokens/build/tailwind-plugin": "./src/tokens/build/tailwind-plugin.js",
62
+ "./tokens/build/css-vars.js": "./src/tokens/build/css-vars.js",
63
+ "./tailwind/tailwind-theme.js": "./src/tailwind/tailwind-theme.js",
64
+ "./tailwind/semantic-colors-plugin.js": "./src/tailwind/semantic-colors-plugin.js",
65
+ "./tailwind/semantic-texts-plugin.js": "./src/tailwind/semantic-texts-plugin.js",
66
+ "./tailwind/semantic-spacing-plugin.js": "./src/tailwind/semantic-spacing-plugin.js"
61
67
  }
62
68
  }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Tailwind plugin to expose semantic colors at root level.
3
+ *
4
+ * This allows using classes like `text-muted` instead of `text-text-muted`.
5
+ *
6
+ * Usage in tailwind.config.js:
7
+ * ```javascript
8
+ * import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
9
+ * import semanticColors from '@aziontech/theme/tailwind/semantic-colors-plugin.js';
10
+ *
11
+ * export default {
12
+ * theme,
13
+ * plugins: [semanticColors()],
14
+ * };
15
+ * ```
16
+ */
17
+
18
+ // Lazy-require to avoid hard dependency for consumers
19
+ const plugin = (() => {
20
+ try {
21
+ return require('tailwindcss/plugin');
22
+ } catch {
23
+ return (handler) => handler;
24
+ }
25
+ })();
26
+
27
+ /**
28
+ * Generate semantic color utilities
29
+ * @returns {import('tailwindcss/plugin').Plugin}
30
+ */
31
+ export const semanticColors = () => {
32
+ return plugin(({ addUtilities }) => {
33
+ const textColors = {
34
+ '.text-default': { color: 'var(--text-default)' },
35
+ '.text-muted': { color: 'var(--text-muted)' },
36
+ '.text-link': { color: 'var(--text-link)' },
37
+ '.text-linkHover': { color: 'var(--text-linkHover)' },
38
+ '.text-code': { color: 'var(--text-code)' },
39
+ '.text-primary': { color: 'var(--text-primary)' },
40
+ '.text-primaryHover': { color: 'var(--text-primaryHover)' },
41
+ '.text-accent': { color: 'var(--text-accent)' },
42
+ '.text-accentHover': { color: 'var(--text-accentHover)' },
43
+ '.text-danger': { color: 'var(--text-danger)' },
44
+ '.text-dangerHover': { color: 'var(--text-dangerHover)' },
45
+ '.text-warning': { color: 'var(--text-warning)' },
46
+ '.text-warningHover': { color: 'var(--text-warningHover)' },
47
+ '.text-success': { color: 'var(--text-success)' },
48
+ '.text-successHover': { color: 'var(--text-successHover)' },
49
+ };
50
+
51
+ const bgColors = {
52
+ '.bg-surfaceRaised': { 'background-color': 'var(--background-surfaceRaised)' },
53
+ '.bg-surfaceOverlay': { 'background-color': 'var(--background-surfaceOverlay)' },
54
+ '.bg-surface': { 'background-color': 'var(--background-surface)' },
55
+ '.bg-canvas': { 'background-color': 'var(--background-canvas)' },
56
+ '.bg-danger': { 'background-color': 'var(--background-danger)' },
57
+ '.bg-dangerHover': { 'background-color': 'var(--background-dangerHover)' },
58
+ '.bg-warning': { 'background-color': 'var(--background-warning)' },
59
+ '.bg-warningHover': { 'background-color': 'var(--background-warningHover)' },
60
+ '.bg-success': { 'background-color': 'var(--background-success)' },
61
+ '.bg-successHover': { 'background-color': 'var(--background-successHover)' },
62
+ '.bg-backdrop': { 'background-color': 'var(--background-backdrop)' },
63
+ '.bg-primary': { 'background-color': 'var(--background-primary)' },
64
+ '.bg-primaryHover': { 'background-color': 'var(--background-primaryHover)' },
65
+ };
66
+
67
+ const borderColors = {
68
+ '.border-default': { 'border-color': 'var(--border-default)' },
69
+ '.border-strong': { 'border-color': 'var(--border-strong)' },
70
+ '.border-subtle': { 'border-color': 'var(--border-subtle)' },
71
+ '.border-warning': { 'border-color': 'var(--border-warning)' },
72
+ '.border-warningHover': { 'border-color': 'var(--border-warningHover)' },
73
+ '.border-success': { 'border-color': 'var(--border-success)' },
74
+ '.border-successHover': { 'border-color': 'var(--border-successHover)' },
75
+ '.border-danger': { 'border-color': 'var(--border-danger)' },
76
+ '.border-dangerHover': { 'border-color': 'var(--border-dangerHover)' },
77
+ '.border-primary': { 'border-color': 'var(--border-primary)' },
78
+ '.border-primaryHover': { 'border-color': 'var(--border-primaryHover)' },
79
+ '.border-accent': { 'border-color': 'var(--border-accent)' },
80
+ '.border-accentHover': { 'border-color': 'var(--border-accentHover)' },
81
+ };
82
+
83
+ addUtilities(textColors, ['responsive', 'hover', 'dark']);
84
+ addUtilities(bgColors, ['responsive', 'hover', 'dark']);
85
+ addUtilities(borderColors, ['responsive', 'hover', 'dark']);
86
+ });
87
+ };
88
+
89
+ export default semanticColors;
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Tailwind plugin to expose semantic spacing styles.
3
+ *
4
+ * This adds spacing components for container, padding, and gap utilities.
5
+ *
6
+ * Usage in tailwind.config.js:
7
+ * ```javascript
8
+ * import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
9
+ * import semanticSpacing from '@aziontech/theme/tailwind/semantic-spacing-plugin.js';
10
+ *
11
+ * export default {
12
+ * theme,
13
+ * plugins: [semanticSpacing()],
14
+ * };
15
+ * ```
16
+ */
17
+
18
+ // Lazy-require to avoid hard dependency for consumers
19
+ const plugin = (() => {
20
+ try {
21
+ return require('tailwindcss/plugin');
22
+ } catch {
23
+ return (handler) => handler;
24
+ }
25
+ })();
26
+
27
+ /**
28
+ * Generate semantic spacing style components
29
+ * @returns {import('tailwindcss/plugin').Plugin}
30
+ */
31
+ export const semanticSpacing = () => {
32
+ return plugin(({ addComponents, theme }) => {
33
+ const spacing = {
34
+ // Container
35
+ '.max-container-width': {
36
+ maxWidth: '1280px',
37
+ },
38
+ '.px-container': {
39
+ paddingLeft: '0px',
40
+ paddingRight: '0px',
41
+ },
42
+ '.py-container': {
43
+ paddingTop: '48px',
44
+ paddingBottom: '48px',
45
+ },
46
+
47
+ // Padding elements
48
+ '.p-elements-confortable': {
49
+ padding: '24px',
50
+ },
51
+ '.p-elements-base': {
52
+ padding: '12px',
53
+ },
54
+ '.p-elements-compact': {
55
+ padding: '6px',
56
+ },
57
+
58
+ // Gap elements
59
+ '.gap-elements-confortable': {
60
+ gap: '24px',
61
+ },
62
+ '.gap-elements-base': {
63
+ gap: '12px',
64
+ },
65
+ '.gap-elements-compact': {
66
+ gap: '6px',
67
+ },
68
+
69
+ // Gap sections
70
+ '.gap-sections': {
71
+ gap: '48px',
72
+ },
73
+ };
74
+
75
+ const responsiveSpacing = {
76
+ [`@media (max-width: ${theme('screens.md', '768px')})`]: {
77
+ '.max-container-width': {
78
+ maxWidth: '1024px',
79
+ },
80
+ '.px-container': {
81
+ paddingLeft: '10px',
82
+ paddingRight: '10px',
83
+ },
84
+ '.py-container': {
85
+ paddingTop: '32px',
86
+ paddingBottom: '32px',
87
+ },
88
+ '.p-elements-confortable': {
89
+ padding: '16px',
90
+ },
91
+ '.p-elements-base': {
92
+ padding: '8px',
93
+ },
94
+ '.p-elements-compact': {
95
+ padding: '5px',
96
+ },
97
+ '.gap-elements-confortable': {
98
+ gap: '16px',
99
+ },
100
+ '.gap-elements-base': {
101
+ gap: '8px',
102
+ },
103
+ '.gap-elements-compact': {
104
+ gap: '6px',
105
+ },
106
+ '.gap-sections': {
107
+ gap: '40px',
108
+ },
109
+ },
110
+ [`@media (max-width: ${theme('screens.sm', '640px')})`]: {
111
+ '.max-container-width': {
112
+ maxWidth: '414px',
113
+ },
114
+ '.px-container': {
115
+ paddingLeft: '4px',
116
+ paddingRight: '4px',
117
+ },
118
+ '.py-container': {
119
+ paddingTop: '16px',
120
+ paddingBottom: '16px',
121
+ },
122
+ '.p-elements-confortable': {
123
+ padding: '8px',
124
+ },
125
+ '.p-elements-base': {
126
+ padding: '6px',
127
+ },
128
+ '.p-elements-compact': {
129
+ padding: '4px',
130
+ },
131
+ '.gap-elements-confortable': {
132
+ gap: '8px',
133
+ },
134
+ '.gap-elements-base': {
135
+ gap: '6px',
136
+ },
137
+ '.gap-elements-compact': {
138
+ gap: '4px',
139
+ },
140
+ '.gap-sections': {
141
+ gap: '20px',
142
+ },
143
+ },
144
+ };
145
+
146
+ addComponents(spacing);
147
+ addComponents(responsiveSpacing);
148
+ });
149
+ };
150
+
151
+ export default semanticSpacing;
@@ -0,0 +1,278 @@
1
+ /**
2
+ * Tailwind plugin to expose semantic text styles (typography).
3
+ *
4
+ * This adds typography components like display-1, body-1, etc.
5
+ *
6
+ * Usage in tailwind.config.js:
7
+ * ```javascript
8
+ * import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
9
+ * import semanticTexts from '@aziontech/theme/tailwind/semantic-texts-plugin.js';
10
+ *
11
+ * export default {
12
+ * theme,
13
+ * plugins: [semanticTexts()],
14
+ * };
15
+ * ```
16
+ */
17
+
18
+ // Lazy-require to avoid hard dependency for consumers
19
+ const plugin = (() => {
20
+ try {
21
+ return require('tailwindcss/plugin');
22
+ } catch {
23
+ return (handler) => handler;
24
+ }
25
+ })();
26
+
27
+ /**
28
+ * Generate semantic text style components
29
+ * @returns {import('tailwindcss/plugin').Plugin}
30
+ */
31
+ export const semanticTexts = () => {
32
+ return plugin(({ addComponents, theme }) => {
33
+ const deprecatedTexts = {
34
+ // Display styles - Desktop
35
+ '.display-1': {
36
+ fontSize: '3rem',
37
+ lineHeight: '1.10',
38
+ fontFamily: 'Sora',
39
+ letterSpacing: '-.05rem',
40
+ },
41
+ '.display-2': {
42
+ fontSize: '2rem',
43
+ lineHeight: '1.2',
44
+ fontFamily: 'Sora',
45
+ letterSpacing: '-.05rem',
46
+ },
47
+ '.display-3': {
48
+ fontSize: '1.75rem',
49
+ lineHeight: '1.25',
50
+ fontFamily: 'Sora',
51
+ letterSpacing: '-.05rem',
52
+ },
53
+ '.display-4': {
54
+ fontSize: '1.5rem',
55
+ lineHeight: '1.3',
56
+ fontFamily: 'Sora',
57
+ letterSpacing: '-.05rem',
58
+ },
59
+ '.display-5': {
60
+ fontSize: '1.25rem',
61
+ lineHeight: '1.4',
62
+ fontFamily: 'Sora',
63
+ letterSpacing: '-.05rem',
64
+ },
65
+
66
+ // Display styles - Mobile
67
+ '.display-1-mobile': {
68
+ fontSize: '2.5rem',
69
+ lineHeight: '1.15',
70
+ fontFamily: 'Sora',
71
+ letterSpacing: '-.05rem',
72
+ },
73
+ '.display-2-mobile': {
74
+ fontSize: '1.875rem',
75
+ lineHeight: '1.20',
76
+ fontFamily: 'Sora',
77
+ letterSpacing: '-.05rem',
78
+ },
79
+ '.display-3-mobile': {
80
+ fontSize: '1.375rem',
81
+ lineHeight: '1.3',
82
+ fontFamily: 'Sora',
83
+ letterSpacing: '-.05rem',
84
+ },
85
+ '.display-4-mobile': {
86
+ fontSize: '1.25rem',
87
+ lineHeight: '1.35',
88
+ fontFamily: 'Sora',
89
+ letterSpacing: '-.05rem',
90
+ },
91
+ '.display-5-mobile': {
92
+ fontSize: '1.125rem',
93
+ lineHeight: '1.35',
94
+ fontFamily: 'Sora',
95
+ letterSpacing: '-.05rem',
96
+ },
97
+
98
+ // Body styles
99
+ '.body-1': {
100
+ fontSize: '1rem',
101
+ lineHeight: '1.4rem',
102
+ fontFamily: 'Sora',
103
+ letterSpacing: '-.05rem',
104
+ },
105
+ '.body-2': {
106
+ fontSize: '.875rem',
107
+ lineHeight: '1.4rem',
108
+ fontFamily: 'Sora',
109
+ letterSpacing: '-.05rem',
110
+ },
111
+ };
112
+
113
+ const texts = {
114
+ '.text-big-number-md': {
115
+ fontSize: '4.5rem', // 7xl
116
+ lineHeight: '1.20',
117
+ },
118
+ '.text-heading-2xl': {
119
+ fontSize: '3.75rem', // text-6xl
120
+ lineHeight: '1.2',
121
+ },
122
+ '.text-heading-xl': {
123
+ fontSize: '2.25rem', // text-4xl
124
+ lineHeight: '1.2',
125
+ },
126
+ '.text-heading-lg': {
127
+ fontSize: '1.875rem', // text-3xl
128
+ lineHeight: '1.2',
129
+ },
130
+ '.text-heading-md': {
131
+ fontSize: '1.5rem', // text-2xl
132
+ lineHeight: '1.2',
133
+ },
134
+ '.text-heading-sm': {
135
+ fontSize: '1.125rem', // text-lg
136
+ lineHeight: '1.2',
137
+ },
138
+ '.text-body-lg': {
139
+ fontSize: '18px', // text-lg
140
+ lineHeight: '1.5',
141
+ },
142
+ '.text-body-md': {
143
+ fontSize: '16px', // text-base
144
+ lineHeight: '1.5',
145
+ },
146
+ '.text-body-sm': {
147
+ fontSize: '14px', // text-sm
148
+ lineHeight: '1.5',
149
+ },
150
+ '.text-body-xs': {
151
+ fontSize: '12px', // text-xs
152
+ lineHeight: '1.5',
153
+ },
154
+ '.text-body-xss': {
155
+ fontSize: '10px',
156
+ lineHeight: '1.5',
157
+ },
158
+ '.text-overline-md': {
159
+ fontSize: '14px', // text-sm
160
+ lineHeight: '1.4',
161
+ letterSpacing: '0.08em',
162
+ textTransform: 'uppercase',
163
+ },
164
+ '.text-overline-sm': {
165
+ fontSize: '12px', // text-xs
166
+ lineHeight: '1.4',
167
+ letterSpacing: '0.08em',
168
+ textTransform: 'uppercase',
169
+ },
170
+ '.text-overline-xs': {
171
+ fontSize: '10px',
172
+ lineHeight: '1.4',
173
+ letterSpacing: '0.08em',
174
+ textTransform: 'uppercase',
175
+ },
176
+ };
177
+
178
+ const responsiveTexts = {
179
+ [`@media (max-width: ${theme('screens.md', '768px')})`]: {
180
+ '.text-big-number-md': {
181
+ fontSize: '3rem',
182
+ lineHeight: '1.20',
183
+ },
184
+ '.text-heading-2xl': {
185
+ fontSize: '3rem', // text-5xl
186
+ },
187
+ '.text-heading-xl': {
188
+ fontSize: '1.875rem', // text-3xl
189
+ },
190
+ '.text-heading-lg': {
191
+ fontSize: '1.125rem', // text-lg
192
+ },
193
+ '.text-heading-md': {
194
+ fontSize: '1.25rem', // text-xl
195
+ },
196
+ '.text-heading-sm': {
197
+ fontSize: '1rem', // text-base
198
+ },
199
+ '.text-body-lg': {
200
+ fontSize: '16px', // text-base
201
+ },
202
+ '.text-body-md': {
203
+ fontSize: '16px', // mantém
204
+ },
205
+ '.text-body-sm': {
206
+ fontSize: '14px',
207
+ },
208
+ '.text-body-xs': {
209
+ fontSize: '12px',
210
+ },
211
+ '.text-body-xss': {
212
+ fontSize: '10px',
213
+ },
214
+ '.text-overline-md': {
215
+ fontSize: '14px',
216
+ },
217
+ '.text-overline-sm': {
218
+ fontSize: '12px',
219
+ },
220
+ '.text-overline-xs': {
221
+ fontSize: '10px',
222
+ },
223
+ },
224
+ [`@media (max-width: ${theme('screens.sm', '640px')})`]: {
225
+ '.text-big-number-md': {
226
+ fontSize: '4.5rem',
227
+ lineHeight: '1.20',
228
+ },
229
+ '.text-heading-2xl': {
230
+ fontSize: '1.875rem',
231
+ },
232
+ '.text-heading-xl': {
233
+ fontSize: '1.25rem',
234
+ },
235
+ '.text-heading-lg': {
236
+ fontSize: '1.125rem',
237
+ },
238
+ '.text-heading-md': {
239
+ fontSize: '1rem',
240
+ },
241
+ '.text-heading-sm': {
242
+ fontSize: '0.875rem',
243
+ },
244
+ '.text-body-lg': {
245
+ fontSize: '16px',
246
+ },
247
+ '.text-body-md': {
248
+ fontSize: '16px',
249
+ },
250
+ '.text-body-sm': {
251
+ fontSize: '14px',
252
+ },
253
+ '.text-body-xs': {
254
+ fontSize: '12px',
255
+ },
256
+ '.text-body-xss': {
257
+ fontSize: '10px',
258
+ },
259
+ '.text-overline-md': {
260
+ fontSize: '14px',
261
+ },
262
+ '.text-overline-sm': {
263
+ fontSize: '12px',
264
+ },
265
+ '.text-overline-xs': {
266
+ fontSize: '10px',
267
+ },
268
+ },
269
+
270
+ };
271
+
272
+ addComponents(deprecatedTexts);
273
+ addComponents(texts);
274
+ addComponents(responsiveTexts);
275
+ });
276
+ };
277
+
278
+ export default semanticTexts;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Tailwind CSS Configuration for @aziontech/theme
3
+ *
4
+ * This file exports a Tailwind config with all design tokens from the token system.
5
+ * Uses CSS variables for semantic tokens, enabling automatic theme switching.
6
+ *
7
+ * Usage:
8
+ * ```javascript
9
+ * // tailwind.config.js
10
+ * import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
11
+ * import flatColorsPlugin from '@aziontech/theme/tailwind/tailwind-flat-colors.js';
12
+ *
13
+ * export default {
14
+ * theme,
15
+ * plugins: [flatColorsPlugin],
16
+ * };
17
+ * ```
18
+ *
19
+ * For theme switching to work, ensure CSS variables are injected:
20
+ * ```javascript
21
+ * import { injectCssVars } from '@aziontech/theme/tokens';
22
+ * injectCssVars();
23
+ * ```
24
+ */
25
+
26
+ import { primitives } from '../tokens/primitives/colors.js';
27
+ import { brandPrimitives, surfacePrimitives } from '../tokens/primitives/brand.js';
28
+
29
+ export const theme = {
30
+ extend: {
31
+ colors: {
32
+ base: {
33
+ white: primitives.base.white,
34
+ black: primitives.base.black,
35
+ },
36
+ brand: {
37
+ primary: brandPrimitives.primary,
38
+ accent: brandPrimitives.accent,
39
+ },
40
+ surface: surfacePrimitives.surface,
41
+ orange: primitives.orange,
42
+ violet: primitives.violet,
43
+ neutral: primitives.neutral,
44
+ gray: primitives.gray,
45
+ slate: primitives.slate,
46
+ red: primitives.red,
47
+ green: primitives.green,
48
+ yellow: primitives.yellow,
49
+ blue: primitives.blue,
50
+ },
51
+ },
52
+ };
53
+
54
+ export default { theme };
@@ -7,51 +7,51 @@ export const preset = {
7
7
  extend: {
8
8
  colors: {
9
9
  text: {
10
- default: 'var(--text-textDefault)',
11
- muted: 'var(--text-textMuted)',
12
- link: 'var(--text-textLink)',
13
- linkHover: 'var(--text-textLinkHover)',
14
- code: 'var(--text-textCode)',
15
- primary: 'var(--text-textPrimary)',
16
- primaryHover: 'var(--text-textPrimaryHover)',
17
- accent: 'var(--text-textAccent)',
18
- accentHover: 'var(--text-textAccentHover)',
19
- danger: 'var(--text-textDanger)',
20
- dangerHover: 'var(--text-textDangerHover)',
21
- warning: 'var(--text-textWarning)',
22
- warningHover: 'var(--text-textWarningHover)',
23
- success: 'var(--text-textSuccess)',
24
- successHover: 'var(--text-textSuccessHover)',
10
+ default: 'var(--text-default)',
11
+ muted: 'var(--text-muted)',
12
+ link: 'var(--text-link)',
13
+ linkHover: 'var(--text-linkHover)',
14
+ code: 'var(--text-code)',
15
+ primary: 'var(--text-primary)',
16
+ primaryHover: 'var(--text-primaryHover)',
17
+ accent: 'var(--text-accent)',
18
+ accentHover: 'var(--text-accentHover)',
19
+ danger: 'var(--text-danger)',
20
+ dangerHover: 'var(--text-dangerHover)',
21
+ warning: 'var(--text-warning)',
22
+ warningHover: 'var(--text-warningHover)',
23
+ success: 'var(--text-success)',
24
+ successHover: 'var(--text-successHover)',
25
25
  },
26
26
  background: {
27
- surfaceRaised: 'var(--background-bgSurfaceRaised)',
28
- surfaceOverlay: 'var(--background-bgSurfaceOverlay)',
29
- surface: 'var(--background-bgSurface)',
30
- canvas: 'var(--background-bgCanvas)',
31
- danger: 'var(--background-bgDanger)',
32
- dangerHover: 'var(--background-bgDangerHover)',
33
- warning: 'var(--background-bgWarning)',
34
- warningHover: 'var(--background-bgWarningHover)',
35
- success: 'var(--background-bgSuccess)',
36
- successHover: 'var(--background-bgSuccessHover)',
37
- backdrop: 'var(--background-bgBackdrop)',
38
- primary: 'var(--background-bgPrimary)',
39
- primaryHover: 'var(--background-bgPrimaryHover)',
27
+ surfaceRaised: 'var(--background-surfaceRaised)',
28
+ surfaceOverlay: 'var(--background-surfaceOverlay)',
29
+ surface: 'var(--background-surface)',
30
+ canvas: 'var(--background-canvas)',
31
+ danger: 'var(--background-danger)',
32
+ dangerHover: 'var(--background-dangerHover)',
33
+ warning: 'var(--background-warning)',
34
+ warningHover: 'var(--background-warningHover)',
35
+ success: 'var(--background-success)',
36
+ successHover: 'var(--background-successHover)',
37
+ backdrop: 'var(--background-backdrop)',
38
+ primary: 'var(--background-primary)',
39
+ primaryHover: 'var(--background-primaryHover)',
40
40
  },
41
41
  border: {
42
- default: 'var(--border-borderDefault)',
43
- strong: 'var(--border-borderStrong)',
44
- subtle: 'var(--border-borderSubtle)',
45
- warning: 'var(--border-borderWarning)',
46
- warningHover: 'var(--border-borderWarningHover)',
47
- success: 'var(--border-borderSuccess)',
48
- successHover: 'var(--border-borderSuccessHover)',
49
- danger: 'var(--border-borderDanger)',
50
- dangerHover: 'var(--border-borderDangerHover)',
51
- primary: 'var(--border-borderPrimary)',
52
- primaryHover: 'var(--border-borderPrimaryHover)',
53
- accent: 'var(--border-borderAccent)',
54
- accentHover: 'var(--border-borderAccentHover)',
42
+ default: 'var(--border-default)',
43
+ strong: 'var(--border-strong)',
44
+ subtle: 'var(--border-subtle)',
45
+ warning: 'var(--border-warning)',
46
+ warningHover: 'var(--border-warningHover)',
47
+ success: 'var(--border-success)',
48
+ successHover: 'var(--border-successHover)',
49
+ danger: 'var(--border-danger)',
50
+ dangerHover: 'var(--border-dangerHover)',
51
+ primary: 'var(--border-primary)',
52
+ primaryHover: 'var(--border-primaryHover)',
53
+ accent: 'var(--border-accent)',
54
+ accentHover: 'var(--border-accentHover)',
55
55
  },
56
56
  },
57
57
  },
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Tailwind plugin to expose semantic colors at root level.
3
+ *
4
+ * This allows using classes like `text-muted` instead of `text-text-muted`.
5
+ *
6
+ * Usage in tailwind.config.js:
7
+ * ```javascript
8
+ * import { flatColorsPlugin } from '@aziontech/theme/tokens/build/tailwind-flat-colors.js';
9
+ *
10
+ * export default {
11
+ * plugins: [flatColorsPlugin],
12
+ * };
13
+ * ```
14
+ */
15
+
16
+ import plugin from 'tailwindcss/plugin.js';
17
+
18
+ export const flatColorsPlugin = plugin(({ addUtilities, addBase, theme }) => {
19
+ // Add semantic text colors as root-level utilities
20
+ const textColors = {
21
+ '.text-default': { color: 'var(--text-default)' },
22
+ '.text-muted': { color: 'var(--text-muted)' },
23
+ '.text-link': { color: 'var(--text-link)' },
24
+ '.text-linkHover': { color: 'var(--text-linkHover)' },
25
+ '.text-code': { color: 'var(--text-code)' },
26
+ '.text-primary': { color: 'var(--text-primary)' },
27
+ '.text-primaryHover': { color: 'var(--text-primaryHover)' },
28
+ '.text-accent': { color: 'var(--text-accent)' },
29
+ '.text-accentHover': { color: 'var(--text-accentHover)' },
30
+ '.text-danger': { color: 'var(--text-danger)' },
31
+ '.text-dangerHover': { color: 'var(--text-dangerHover)' },
32
+ '.text-warning': { color: 'var(--text-warning)' },
33
+ '.text-warningHover': { color: 'var(--text-warningHover)' },
34
+ '.text-success': { color: 'var(--text-success)' },
35
+ '.text-successHover': { color: 'var(--text-successHover)' },
36
+ };
37
+
38
+ const bgColors = {
39
+ '.bg-surfaceRaised': { 'background-color': 'var(--background-surfaceRaised)' },
40
+ '.bg-surfaceOverlay': { 'background-color': 'var(--background-surfaceOverlay)' },
41
+ '.bg-surface': { 'background-color': 'var(--background-surface)' },
42
+ '.bg-canvas': { 'background-color': 'var(--background-canvas)' },
43
+ '.bg-danger': { 'background-color': 'var(--background-danger)' },
44
+ '.bg-dangerHover': { 'background-color': 'var(--background-dangerHover)' },
45
+ '.bg-warning': { 'background-color': 'var(--background-warning)' },
46
+ '.bg-warningHover': { 'background-color': 'var(--background-warningHover)' },
47
+ '.bg-success': { 'background-color': 'var(--background-success)' },
48
+ '.bg-successHover': { 'background-color': 'var(--background-successHover)' },
49
+ '.bg-backdrop': { 'background-color': 'var(--background-backdrop)' },
50
+ '.bg-primary': { 'background-color': 'var(--background-primary)' },
51
+ '.bg-primaryHover': { 'background-color': 'var(--background-primaryHover)' },
52
+ };
53
+
54
+ const borderColors = {
55
+ '.border-default': { 'border-color': 'var(--border-default)' },
56
+ '.border-strong': { 'border-color': 'var(--border-strong)' },
57
+ '.border-subtle': { 'border-color': 'var(--border-subtle)' },
58
+ '.border-warning': { 'border-color': 'var(--border-warning)' },
59
+ '.border-warningHover': { 'border-color': 'var(--border-warningHover)' },
60
+ '.border-success': { 'border-color': 'var(--border-success)' },
61
+ '.border-successHover': { 'border-color': 'var(--border-successHover)' },
62
+ '.border-danger': { 'border-color': 'var(--border-danger)' },
63
+ '.border-dangerHover': { 'border-color': 'var(--border-dangerHover)' },
64
+ '.border-primary': { 'border-color': 'var(--border-primary)' },
65
+ '.border-primaryHover': { 'border-color': 'var(--border-primaryHover)' },
66
+ '.border-accent': { 'border-color': 'var(--border-accent)' },
67
+ '.border-accentHover': { 'border-color': 'var(--border-accentHover)' },
68
+ };
69
+
70
+ addUtilities(textColors, ['responsive', 'hover', 'dark']);
71
+ addUtilities(bgColors, ['responsive', 'hover', 'dark']);
72
+ addUtilities(borderColors, ['responsive', 'hover', 'dark']);
73
+ });
74
+
75
+ export default flatColorsPlugin;
@@ -8,34 +8,34 @@ import { tokenRef } from '../build/refs.js';
8
8
 
9
9
  export const backgroundSemantic = {
10
10
  light: {
11
- bgSurfaceRaised: tokenRef('brand.surfaces.surface-0'),
12
- bgSurfaceOverlay: tokenRef('brand.surfaces.surface-50'),
13
- bgSurface: tokenRef('brand.surfaces.surface-0'),
14
- bgCanvas: tokenRef('brand.surfaces.surface-100'),
15
- bgDangerHover: tokenRef('primitives.red.400'),
16
- bgWarningHover: tokenRef('primitives.yellow.400'),
17
- bgSuccessHover: tokenRef('primitives.green.400'),
18
- bgSuccess: tokenRef('primitives.green.200'),
19
- bgDanger: tokenRef('primitives.red.200'),
20
- bgWarning: tokenRef('primitives.yellow.200'),
21
- bgBackdrop: tokenRef('#00000040'),
22
- bgPrimaryHover: tokenRef('brand.primary.primary-600'),
23
- bgPrimary: tokenRef('brand.primary.primary-500')
11
+ surfaceRaised: tokenRef('brand.surfaces.surface-0'),
12
+ surfaceOverlay: tokenRef('brand.surfaces.surface-50'),
13
+ surface: tokenRef('brand.surfaces.surface-0'),
14
+ canvas: tokenRef('brand.surfaces.surface-100'),
15
+ dangerHover: tokenRef('primitives.red.400'),
16
+ warningHover: tokenRef('primitives.yellow.400'),
17
+ successHover: tokenRef('primitives.green.400'),
18
+ success: tokenRef('primitives.green.200'),
19
+ danger: tokenRef('primitives.red.200'),
20
+ warning: tokenRef('primitives.yellow.200'),
21
+ backdrop: tokenRef('#00000040'),
22
+ primaryHover: tokenRef('brand.primary.primary-600'),
23
+ primary: tokenRef('brand.primary.primary-500')
24
24
  },
25
25
  dark: {
26
- bgSurfaceRaised: tokenRef('brand.surfaces.surface-800'),
27
- bgSurfaceOverlay: tokenRef('brand.surfaces.surface-700'),
28
- bgSurface: tokenRef('brand.surfaces.surface-900'),
29
- bgCanvas: tokenRef('brand.surfaces.surface-950'),
30
- bgDangerHover: tokenRef('primitives.red.600'),
31
- bgWarningHover: tokenRef('primitives.yellow.600'),
32
- bgSuccessHover: tokenRef('primitives.green.600'),
33
- bgSuccess: tokenRef('primitives.green.800'),
34
- bgDanger: tokenRef('primitives.red.800'),
35
- bgWarning: tokenRef('primitives.yellow.800'),
36
- bgBackdrop: tokenRef('#00000040'),
37
- bgPrimaryHover: tokenRef('brand.primary.primary-400'),
38
- bgPrimary: tokenRef('brand.primary.primary-500')
26
+ surfaceRaised: tokenRef('brand.surfaces.surface-800'),
27
+ surfaceOverlay: tokenRef('brand.surfaces.surface-700'),
28
+ surface: tokenRef('brand.surfaces.surface-900'),
29
+ canvas: tokenRef('brand.surfaces.surface-950'),
30
+ dangerHover: tokenRef('primitives.red.600'),
31
+ warningHover: tokenRef('primitives.yellow.600'),
32
+ successHover: tokenRef('primitives.green.600'),
33
+ success: tokenRef('primitives.green.800'),
34
+ danger: tokenRef('primitives.red.800'),
35
+ warning: tokenRef('primitives.yellow.800'),
36
+ backdrop: tokenRef('#00000040'),
37
+ primaryHover: tokenRef('brand.primary.primary-400'),
38
+ primary: tokenRef('brand.primary.primary-500')
39
39
  },
40
40
  };
41
41
 
@@ -8,34 +8,34 @@ import { tokenRef } from '../build/refs.js';
8
8
 
9
9
  export const borderSemantic = {
10
10
  light: {
11
- borderDefault: tokenRef('brand.surfaces.surface-100'),
12
- borderStrong: tokenRef('primitives.base.black'),
13
- borderWarning: tokenRef('primitives.yellow.600'),
14
- borderSuccess: tokenRef('primitives.green.600'),
15
- borderDanger: tokenRef('primitives.red.600'),
16
- borderPrimary: tokenRef('brand.primary.primary-500'),
17
- borderAccent: tokenRef('brand.accent.accent-500'),
18
- borderWarningHover: tokenRef('primitives.yellow.500'),
19
- borderSuccessHover: tokenRef('primitives.green.500'),
20
- borderDangerHover: tokenRef('primitives.red.500'),
21
- borderPrimaryHover: tokenRef('brand.primary.primary-600'),
22
- borderAccentHover: tokenRef('brand.accent.accent-600'),
23
- borderSubtle: tokenRef('brand.surfaces.surface-200')
11
+ default: tokenRef('brand.surfaces.surface-100'),
12
+ strong: tokenRef('primitives.base.black'),
13
+ warning: tokenRef('primitives.yellow.600'),
14
+ success: tokenRef('primitives.green.600'),
15
+ danger: tokenRef('primitives.red.600'),
16
+ primary: tokenRef('brand.primary.primary-500'),
17
+ accent: tokenRef('brand.accent.accent-500'),
18
+ warningHover: tokenRef('primitives.yellow.500'),
19
+ successHover: tokenRef('primitives.green.500'),
20
+ dangerHover: tokenRef('primitives.red.500'),
21
+ primaryHover: tokenRef('brand.primary.primary-600'),
22
+ accentHover: tokenRef('brand.accent.accent-600'),
23
+ subtle: tokenRef('brand.surfaces.surface-200')
24
24
  },
25
25
  dark: {
26
- borderDefault: tokenRef('brand.surfaces.surface-800'),
27
- borderStrong: tokenRef('primitives.base.white'),
28
- borderWarning: tokenRef('primitives.yellow.400'),
29
- borderSuccess: tokenRef('primitives.green.400'),
30
- borderDanger: tokenRef('primitives.red.400'),
31
- borderPrimary: tokenRef('brand.primary.primary-500'),
32
- borderAccent: tokenRef('brand.accent.accent-500'),
33
- borderWarningHover: tokenRef('primitives.yellow.500'),
34
- borderSuccessHover: tokenRef('primitives.green.500'),
35
- borderDangerHover: tokenRef('primitives.red.500'),
36
- borderPrimaryHover: tokenRef('brand.primary.primary-400'),
37
- borderAccentHover: tokenRef('brand.accent.accent-400'),
38
- borderSubtle: tokenRef('brand.surfaces.surface-700')
26
+ default: tokenRef('brand.surfaces.surface-800'),
27
+ strong: tokenRef('primitives.base.white'),
28
+ warning: tokenRef('primitives.yellow.400'),
29
+ success: tokenRef('primitives.green.400'),
30
+ danger: tokenRef('primitives.red.400'),
31
+ primary: tokenRef('brand.primary.primary-500'),
32
+ accent: tokenRef('brand.accent.accent-500'),
33
+ warningHover: tokenRef('primitives.yellow.500'),
34
+ successHover: tokenRef('primitives.green.500'),
35
+ dangerHover: tokenRef('primitives.red.500'),
36
+ primaryHover: tokenRef('brand.primary.primary-400'),
37
+ accentHover: tokenRef('brand.accent.accent-400'),
38
+ subtle: tokenRef('brand.surfaces.surface-700')
39
39
  },
40
40
  };
41
41
 
@@ -8,38 +8,38 @@ import { tokenRef } from '../build/refs.js';
8
8
 
9
9
  export const textSemantic = {
10
10
  light: {
11
- textDefault: tokenRef('primitives.neutral.900'),
12
- textMuted: tokenRef('primitives.neutral.600'),
13
- textLink: tokenRef('primitives.blue.600'),
14
- textCode: tokenRef('primitives.neutral.600'),
15
- textLinkHover: tokenRef('primitives.blue.700'),
16
- textPrimary: tokenRef('brand.primary.primary-500'),
17
- textPrimaryHover: tokenRef('brand.primary.primary-600'),
18
- textAccent: tokenRef('brand.accent.accent-500'),
19
- textAccentHover: tokenRef('brand.accent.accent-600'),
20
- textDangerHover: tokenRef('primitives.red.500'),
21
- textWarningHover: tokenRef('primitives.yellow.500'),
22
- textSuccessHover: tokenRef('primitives.green.500'),
23
- textSuccess: tokenRef('primitives.green.600'),
24
- textDanger: tokenRef('primitives.red.600'),
25
- textWarning: tokenRef('primitives.yellow.600')
11
+ default: tokenRef('primitives.neutral.900'),
12
+ muted: tokenRef('primitives.neutral.600'),
13
+ link: tokenRef('primitives.blue.600'),
14
+ code: tokenRef('primitives.neutral.600'),
15
+ linkHover: tokenRef('primitives.blue.700'),
16
+ primary: tokenRef('brand.primary.primary-500'),
17
+ primaryHover: tokenRef('brand.primary.primary-600'),
18
+ accent: tokenRef('brand.accent.accent-500'),
19
+ accentHover: tokenRef('brand.accent.accent-600'),
20
+ dangerHover: tokenRef('primitives.red.500'),
21
+ warningHover: tokenRef('primitives.yellow.500'),
22
+ successHover: tokenRef('primitives.green.500'),
23
+ success: tokenRef('primitives.green.600'),
24
+ danger: tokenRef('primitives.red.600'),
25
+ warning: tokenRef('primitives.yellow.600')
26
26
  },
27
27
  dark: {
28
- textDefault: tokenRef('primitives.neutral.50'),
29
- textMuted: tokenRef('primitives.neutral.400'),
30
- textLink: tokenRef('primitives.blue.400'),
31
- textCode: tokenRef('primitives.neutral.400'),
32
- textLinkHover: tokenRef('primitives.blue.300'),
33
- textPrimary: tokenRef('brand.primary.primary-500'),
34
- textPrimaryHover: tokenRef('brand.primary.primary-400'),
35
- textAccent: tokenRef('brand.accent.accent-500'),
36
- textAccentHover: tokenRef('brand.accent.accent-400'),
37
- textDangerHover: tokenRef('primitives.red.500'),
38
- textWarningHover: tokenRef('primitives.yellow.500'),
39
- textSuccessHover: tokenRef('primitives.green.500'),
40
- textSuccess: tokenRef('primitives.green.400'),
41
- textDanger: tokenRef('primitives.red.400'),
42
- textWarning: tokenRef('primitives.yellow.400'),
28
+ default: tokenRef('primitives.neutral.50'),
29
+ muted: tokenRef('primitives.neutral.400'),
30
+ link: tokenRef('primitives.blue.400'),
31
+ code: tokenRef('primitives.neutral.400'),
32
+ linkHover: tokenRef('primitives.blue.300'),
33
+ primary: tokenRef('brand.primary.primary-500'),
34
+ primaryHover: tokenRef('brand.primary.primary-400'),
35
+ accent: tokenRef('brand.accent.accent-500'),
36
+ accentHover: tokenRef('brand.accent.accent-400'),
37
+ dangerHover: tokenRef('primitives.red.500'),
38
+ warningHover: tokenRef('primitives.yellow.500'),
39
+ successHover: tokenRef('primitives.green.500'),
40
+ success: tokenRef('primitives.green.400'),
41
+ danger: tokenRef('primitives.red.400'),
42
+ warning: tokenRef('primitives.yellow.400'),
43
43
  }
44
44
  };
45
45