@aziontech/theme 2.3.0 → 2.3.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.
- package/dist/v3/globals.css +11 -0
- package/dist/v3/globals.scss +11 -0
- package/dist/v4/globals.css +11 -0
- package/dist/v4/globals.scss +11 -0
- package/package.json +3 -1
- package/src/scripts/build-tokens.mjs +27 -1
- package/src/tests/tokens.html +3 -0
- package/src/tokens/README.md +17 -0
- package/src/tokens/index.d.ts +1 -0
- package/src/tokens/index.js +1 -0
- package/src/tokens/semantic/texts.data.d.ts +18 -0
- package/src/tokens/semantic/texts.data.d.ts.map +1 -1
- package/src/tokens/semantic/texts.data.js +21 -0
package/dist/v3/globals.css
CHANGED
|
@@ -534,6 +534,11 @@
|
|
|
534
534
|
--text-button-md-font-weight: 600;
|
|
535
535
|
--text-button-md-line-height: 1;
|
|
536
536
|
--text-button-md-letter-spacing: 0;
|
|
537
|
+
--text-link-font-size: inherit;
|
|
538
|
+
--text-link-line-height: inherit;
|
|
539
|
+
--text-link-color: var(--text-link);
|
|
540
|
+
--text-link-border-radius: var(--shape-elements);
|
|
541
|
+
--text-link-transition: all 110ms cubic-bezier(0.39, 0.57, 0.56, 1);
|
|
537
542
|
|
|
538
543
|
/* ── Semantic colors ── */
|
|
539
544
|
--text-default: #141414;
|
|
@@ -835,4 +840,10 @@
|
|
|
835
840
|
.text-overline-xs { font-family: var(--text-overline-xs-font-family); font-size: var(--text-overline-xs-font-size); line-height: var(--text-overline-xs-line-height); letter-spacing: var(--text-overline-xs-letter-spacing); text-transform: var(--text-overline-xs-text-transform); }
|
|
836
841
|
.text-button-lg { font-family: var(--text-button-lg-font-family); font-size: var(--text-button-lg-font-size); font-weight: var(--text-button-lg-font-weight); line-height: var(--text-button-lg-line-height); letter-spacing: var(--text-button-lg-letter-spacing); }
|
|
837
842
|
.text-button-md { font-family: var(--text-button-md-font-family); font-size: var(--text-button-md-font-size); font-weight: var(--text-button-md-font-weight); line-height: var(--text-button-md-line-height); letter-spacing: var(--text-button-md-letter-spacing); }
|
|
843
|
+
.text-link { font-size: var(--text-link-font-size); line-height: var(--text-link-line-height); color: var(--text-link-color); border-radius: var(--text-link-border-radius); transition: var(--text-link-transition); }
|
|
844
|
+
.text-link:hover { color: var(--text-link-hover); text-decoration: underline; }
|
|
845
|
+
.text-link:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 2px; }
|
|
846
|
+
@media (prefers-reduced-motion: reduce) {
|
|
847
|
+
.text-link { transition: none; }
|
|
848
|
+
}
|
|
838
849
|
}
|
package/dist/v3/globals.scss
CHANGED
|
@@ -534,6 +534,11 @@
|
|
|
534
534
|
--text-button-md-font-weight: 600;
|
|
535
535
|
--text-button-md-line-height: 1;
|
|
536
536
|
--text-button-md-letter-spacing: 0;
|
|
537
|
+
--text-link-font-size: inherit;
|
|
538
|
+
--text-link-line-height: inherit;
|
|
539
|
+
--text-link-color: var(--text-link);
|
|
540
|
+
--text-link-border-radius: var(--shape-elements);
|
|
541
|
+
--text-link-transition: all 110ms cubic-bezier(0.39, 0.57, 0.56, 1);
|
|
537
542
|
|
|
538
543
|
/* ── Semantic colors ── */
|
|
539
544
|
--text-default: #141414;
|
|
@@ -835,4 +840,10 @@
|
|
|
835
840
|
.text-overline-xs { font-family: var(--text-overline-xs-font-family); font-size: var(--text-overline-xs-font-size); line-height: var(--text-overline-xs-line-height); letter-spacing: var(--text-overline-xs-letter-spacing); text-transform: var(--text-overline-xs-text-transform); }
|
|
836
841
|
.text-button-lg { font-family: var(--text-button-lg-font-family); font-size: var(--text-button-lg-font-size); font-weight: var(--text-button-lg-font-weight); line-height: var(--text-button-lg-line-height); letter-spacing: var(--text-button-lg-letter-spacing); }
|
|
837
842
|
.text-button-md { font-family: var(--text-button-md-font-family); font-size: var(--text-button-md-font-size); font-weight: var(--text-button-md-font-weight); line-height: var(--text-button-md-line-height); letter-spacing: var(--text-button-md-letter-spacing); }
|
|
843
|
+
.text-link { font-size: var(--text-link-font-size); line-height: var(--text-link-line-height); color: var(--text-link-color); border-radius: var(--text-link-border-radius); transition: var(--text-link-transition); }
|
|
844
|
+
.text-link:hover { color: var(--text-link-hover); text-decoration: underline; }
|
|
845
|
+
.text-link:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 2px; }
|
|
846
|
+
@media (prefers-reduced-motion: reduce) {
|
|
847
|
+
.text-link { transition: none; }
|
|
848
|
+
}
|
|
838
849
|
}
|
package/dist/v4/globals.css
CHANGED
|
@@ -529,6 +529,11 @@
|
|
|
529
529
|
--text-button-md-font-weight: 600;
|
|
530
530
|
--text-button-md-line-height: 1;
|
|
531
531
|
--text-button-md-letter-spacing: 0;
|
|
532
|
+
--text-link-font-size: inherit;
|
|
533
|
+
--text-link-line-height: inherit;
|
|
534
|
+
--text-link-color: var(--text-link);
|
|
535
|
+
--text-link-border-radius: var(--shape-elements);
|
|
536
|
+
--text-link-transition: all 110ms cubic-bezier(0.39, 0.57, 0.56, 1);
|
|
532
537
|
|
|
533
538
|
@media (min-width: 640px) {
|
|
534
539
|
--container-px: 2.5rem;
|
|
@@ -613,4 +618,10 @@
|
|
|
613
618
|
.text-overline-xs { font-family: var(--text-overline-xs-font-family); font-size: var(--text-overline-xs-font-size); line-height: var(--text-overline-xs-line-height); letter-spacing: var(--text-overline-xs-letter-spacing); text-transform: var(--text-overline-xs-text-transform); }
|
|
614
619
|
.text-button-lg { font-family: var(--text-button-lg-font-family); font-size: var(--text-button-lg-font-size); font-weight: var(--text-button-lg-font-weight); line-height: var(--text-button-lg-line-height); letter-spacing: var(--text-button-lg-letter-spacing); }
|
|
615
620
|
.text-button-md { font-family: var(--text-button-md-font-family); font-size: var(--text-button-md-font-size); font-weight: var(--text-button-md-font-weight); line-height: var(--text-button-md-line-height); letter-spacing: var(--text-button-md-letter-spacing); }
|
|
621
|
+
.text-link { font-size: var(--text-link-font-size); line-height: var(--text-link-line-height); color: var(--text-link-color); border-radius: var(--text-link-border-radius); transition: var(--text-link-transition); }
|
|
622
|
+
.text-link:hover { color: var(--text-link-hover); text-decoration: underline; }
|
|
623
|
+
.text-link:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 2px; }
|
|
624
|
+
@media (prefers-reduced-motion: reduce) {
|
|
625
|
+
.text-link { transition: none; }
|
|
626
|
+
}
|
|
616
627
|
}
|
package/dist/v4/globals.scss
CHANGED
|
@@ -529,6 +529,11 @@
|
|
|
529
529
|
--text-button-md-font-weight: 600;
|
|
530
530
|
--text-button-md-line-height: 1;
|
|
531
531
|
--text-button-md-letter-spacing: 0;
|
|
532
|
+
--text-link-font-size: inherit;
|
|
533
|
+
--text-link-line-height: inherit;
|
|
534
|
+
--text-link-color: var(--text-link);
|
|
535
|
+
--text-link-border-radius: var(--shape-elements);
|
|
536
|
+
--text-link-transition: all 110ms cubic-bezier(0.39, 0.57, 0.56, 1);
|
|
532
537
|
|
|
533
538
|
@media (min-width: 640px) {
|
|
534
539
|
--container-px: 2.5rem;
|
|
@@ -613,4 +618,10 @@
|
|
|
613
618
|
.text-overline-xs { font-family: var(--text-overline-xs-font-family); font-size: var(--text-overline-xs-font-size); line-height: var(--text-overline-xs-line-height); letter-spacing: var(--text-overline-xs-letter-spacing); text-transform: var(--text-overline-xs-text-transform); }
|
|
614
619
|
.text-button-lg { font-family: var(--text-button-lg-font-family); font-size: var(--text-button-lg-font-size); font-weight: var(--text-button-lg-font-weight); line-height: var(--text-button-lg-line-height); letter-spacing: var(--text-button-lg-letter-spacing); }
|
|
615
620
|
.text-button-md { font-family: var(--text-button-md-font-family); font-size: var(--text-button-md-font-size); font-weight: var(--text-button-md-font-weight); line-height: var(--text-button-md-line-height); letter-spacing: var(--text-button-md-letter-spacing); }
|
|
621
|
+
.text-link { font-size: var(--text-link-font-size); line-height: var(--text-link-line-height); color: var(--text-link-color); border-radius: var(--text-link-border-radius); transition: var(--text-link-transition); }
|
|
622
|
+
.text-link:hover { color: var(--text-link-hover); text-decoration: underline; }
|
|
623
|
+
.text-link:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 2px; }
|
|
624
|
+
@media (prefers-reduced-motion: reduce) {
|
|
625
|
+
.text-link { transition: none; }
|
|
626
|
+
}
|
|
616
627
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aziontech/theme",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.2",
|
|
5
5
|
"author": "aziontech",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -60,6 +60,8 @@
|
|
|
60
60
|
"exports": {
|
|
61
61
|
".": "./default.js",
|
|
62
62
|
"./animations": "./src/tokens/primitives/animations/animate.js",
|
|
63
|
+
"./colors": "./src/tokens/primitives/colors/colors.js",
|
|
64
|
+
"./texts": "./src/tokens/semantic/texts.data.js",
|
|
63
65
|
"./tailwind-preset": "./dist/v3/tailwind-preset.js",
|
|
64
66
|
"./tailwind-preset/v3": "./dist/v3/tailwind-preset.js",
|
|
65
67
|
"./tailwind/semantic-spacings-plugin": "./src/tokens/semantic/spacings.js",
|
|
@@ -70,6 +70,7 @@ const flattenBundle = (data) => {
|
|
|
70
70
|
const byBp = {};
|
|
71
71
|
for (const [key, bundle] of Object.entries(data)) {
|
|
72
72
|
for (const [prop, val] of Object.entries(bundle)) {
|
|
73
|
+
if (prop === 'states') continue;
|
|
73
74
|
const varName = `--${key}-${kebab(prop)}`;
|
|
74
75
|
for (const [bp, v] of Object.entries(splitResponsive(val))) {
|
|
75
76
|
(byBp[bp] ||= {})[varName] = v;
|
|
@@ -79,6 +80,16 @@ const flattenBundle = (data) => {
|
|
|
79
80
|
return byBp;
|
|
80
81
|
};
|
|
81
82
|
|
|
83
|
+
const pseudoClassName = (key) => {
|
|
84
|
+
if (key === 'focusVisible') return 'focus-visible';
|
|
85
|
+
return key;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const formatStateDecls = (rules) =>
|
|
89
|
+
Object.entries(rules)
|
|
90
|
+
.map(([prop, val]) => `${kebab(prop)}: ${val}`)
|
|
91
|
+
.join('; ');
|
|
92
|
+
|
|
82
93
|
const SEMANTIC_PREFIXES = ['--text-', '--background-', '--border-'];
|
|
83
94
|
const isSemanticVar = (key) => SEMANTIC_PREFIXES.some((p) => key.startsWith(p));
|
|
84
95
|
const pickSemantic = (vars) =>
|
|
@@ -122,10 +133,24 @@ const emitComponentClasses = (indent = ' ') => {
|
|
|
122
133
|
lines.push('');
|
|
123
134
|
lines.push(`${indent}/* ── Texts ── */`);
|
|
124
135
|
for (const [key, bundle] of Object.entries(textsData)) {
|
|
125
|
-
const
|
|
136
|
+
const baseProps = Object.keys(bundle).filter((prop) => prop !== 'states');
|
|
137
|
+
const decls = baseProps
|
|
126
138
|
.map((prop) => `${kebab(prop)}: var(--${key}-${kebab(prop)});`)
|
|
127
139
|
.join(' ');
|
|
128
140
|
lines.push(`${indent}.${key} { ${decls} }`);
|
|
141
|
+
|
|
142
|
+
if (bundle.states) {
|
|
143
|
+
for (const [pseudo, rules] of Object.entries(bundle.states)) {
|
|
144
|
+
const pseudoSuffix = pseudoClassName(pseudo);
|
|
145
|
+
lines.push(`${indent}.${key}:${pseudoSuffix} { ${formatStateDecls(rules)}; }`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (bundle.transition) {
|
|
150
|
+
lines.push(`${indent}@media (prefers-reduced-motion: reduce) {`);
|
|
151
|
+
lines.push(`${indent} .${key} { transition: none; }`);
|
|
152
|
+
lines.push(`${indent}}`);
|
|
153
|
+
}
|
|
129
154
|
}
|
|
130
155
|
|
|
131
156
|
return lines.join('\n');
|
|
@@ -227,6 +252,7 @@ const buildPresetData = () => {
|
|
|
227
252
|
const fontSize = {};
|
|
228
253
|
for (const [key, bundle] of Object.entries(textsData)) {
|
|
229
254
|
if (!('fontSize' in bundle)) continue;
|
|
255
|
+
if (bundle.fontSize === 'inherit') continue;
|
|
230
256
|
const meta = {};
|
|
231
257
|
if ('lineHeight' in bundle) meta.lineHeight = `var(--${key}-line-height)`;
|
|
232
258
|
if ('letterSpacing' in bundle) meta.letterSpacing = `var(--${key}-letter-spacing)`;
|
package/src/tests/tokens.html
CHANGED
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
<p class="text-heading-sm">heading-sm — responsive</p>
|
|
38
38
|
<p class="text-body-lg">body-lg — sm only at md</p>
|
|
39
39
|
<p class="text-body-md">body-md — static</p>
|
|
40
|
+
<p class="text-body-md">
|
|
41
|
+
body-md with <a href="#" class="text-link">inline text-link</a>
|
|
42
|
+
</p>
|
|
40
43
|
<p class="text-overline-md">overline-md — sm only at sm</p>
|
|
41
44
|
</section>
|
|
42
45
|
|
package/src/tokens/README.md
CHANGED
|
@@ -310,6 +310,23 @@ Only useful if you can't precompile and import `globals.css` — production usag
|
|
|
310
310
|
|
|
311
311
|
2. Rebuild. `build-tokens.mjs` emits the base var in `:root`, per-breakpoint `@media` overrides, **and** a matching `.gap-2xl { gap: var(--gap-2xl) }` utility.
|
|
312
312
|
|
|
313
|
+
For typography bundles that need hover/focus without Tailwind utilities, add an optional `states` object (not flattened to CSS vars). Example — inline prose links in `texts.data.js`:
|
|
314
|
+
|
|
315
|
+
```js
|
|
316
|
+
'text-link': {
|
|
317
|
+
fontSize: 'inherit',
|
|
318
|
+
lineHeight: 'inherit',
|
|
319
|
+
color: 'var(--text-link)',
|
|
320
|
+
transition: 'color 150ms ease-out',
|
|
321
|
+
states: {
|
|
322
|
+
hover: { color: 'var(--text-link-hover)', textDecoration: 'underline' },
|
|
323
|
+
'focus-visible': { outline: '2px solid var(--ring-color)', outlineOffset: '2px' },
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Bundles with `fontSize: 'inherit'` are omitted from the Tailwind `fontSize` preset (avoids clashing with `textColor.link` → class `text-link`). Interaction styles are emitted under `@layer components` as `.text-link:hover`, etc.
|
|
329
|
+
|
|
313
330
|
---
|
|
314
331
|
|
|
315
332
|
## 🔗 Token references (`tokenRef`)
|
package/src/tokens/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./primitives/colors/colors.js";
|
|
2
2
|
export * from "./semantic/colors.js";
|
|
3
3
|
export * from "./theme.js";
|
|
4
|
+
export { textsData } from "./semantic/texts.data.js";
|
|
4
5
|
export { createCssVars, cssVarsString, injectCssVars } from "../scripts/css-vars.js";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/src/tokens/index.js
CHANGED
|
@@ -150,6 +150,24 @@ export const textsData: {
|
|
|
150
150
|
lineHeight: string;
|
|
151
151
|
letterSpacing: string;
|
|
152
152
|
};
|
|
153
|
+
/** Inline `<a>` in body/heading — inherits parent size; not the navigation Link component. */
|
|
154
|
+
'text-link': {
|
|
155
|
+
fontSize: string;
|
|
156
|
+
lineHeight: string;
|
|
157
|
+
color: string;
|
|
158
|
+
borderRadius: string;
|
|
159
|
+
transition: string;
|
|
160
|
+
states: {
|
|
161
|
+
hover: {
|
|
162
|
+
color: string;
|
|
163
|
+
textDecoration: string;
|
|
164
|
+
};
|
|
165
|
+
'focus-visible': {
|
|
166
|
+
outline: string;
|
|
167
|
+
outlineOffset: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
153
171
|
};
|
|
154
172
|
declare namespace _default {
|
|
155
173
|
export { textsData };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texts.data.d.ts","sourceRoot":"","sources":["texts.data.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"texts.data.d.ts","sourceRoot":"","sources":["texts.data.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoHE,8FAA8F;;;;;;;;;;;;;;;;;;EAkB/F"}
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* from the legacy `texts.js` plugin — direction inverted from desktop-first
|
|
7
7
|
* (max-width) to mobile-first (min-width).
|
|
8
8
|
*
|
|
9
|
+
* Optional `states` emits pseudo-class rules (e.g. `.text-link:hover`). Bundles
|
|
10
|
+
* with `fontSize: 'inherit'` are omitted from the Tailwind `fontSize` preset.
|
|
11
|
+
*
|
|
9
12
|
* Mapping used during the port:
|
|
10
13
|
* old `large` (≤640) → `_`
|
|
11
14
|
* old `medium` (≤768) → `sm` (≥640)
|
|
@@ -129,6 +132,24 @@ export const textsData = {
|
|
|
129
132
|
fontWeight: '600',
|
|
130
133
|
lineHeight: '1',
|
|
131
134
|
letterSpacing: '0'
|
|
135
|
+
},
|
|
136
|
+
/** Inline `<a>` in body/heading — inherits parent size; not the navigation Link component. */
|
|
137
|
+
'text-link': {
|
|
138
|
+
fontSize: 'inherit',
|
|
139
|
+
lineHeight: 'inherit',
|
|
140
|
+
color: 'var(--text-link)',
|
|
141
|
+
borderRadius: 'var(--shape-elements)',
|
|
142
|
+
transition: 'all 110ms cubic-bezier(0.39, 0.57, 0.56, 1)',
|
|
143
|
+
states: {
|
|
144
|
+
hover: {
|
|
145
|
+
color: 'var(--text-link-hover)',
|
|
146
|
+
textDecoration: 'underline'
|
|
147
|
+
},
|
|
148
|
+
'focus-visible': {
|
|
149
|
+
outline: '2px solid var(--ring-color)',
|
|
150
|
+
outlineOffset: '2px'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
132
153
|
}
|
|
133
154
|
}
|
|
134
155
|
|