@ttoss/fsl-theme 1.1.16 → 1.1.18
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/{baseBundle-DxvXyhGa.mjs → baseBundle-BLvD8XVS.mjs} +2 -2
- package/dist/{baseBundle-iEFf5nqT.cjs → baseBundle-BXvPJYzj.cjs} +2 -2
- package/dist/{createTheme-BLNYztZU.mjs → createTheme-DzLnsknT.mjs} +6 -6
- package/dist/{createTheme-Cv6RP9D6.cjs → createTheme-JOu16Shb.cjs} +6 -6
- package/dist/css.cjs +3 -3
- package/dist/css.mjs +3 -3
- package/dist/dataviz/index.cjs +3 -3
- package/dist/dataviz/index.mjs +2 -2
- package/dist/dtcg.cjs +8 -8
- package/dist/dtcg.mjs +8 -8
- package/dist/{helpers-4p4-QVt_.cjs → helpers-C29fy-Ad.cjs} +11 -11
- package/dist/{helpers-CaswNJMy.mjs → helpers-CA4Qkxct.mjs} +11 -11
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{react-EUwpdvY7.cjs → react-CoWIQYx_.cjs} +16 -16
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +16 -16
- package/dist/runtime-entry.cjs +1 -1
- package/dist/runtime-entry.mjs +1 -1
- package/dist/{ssrScript-D3kGPQpi.mjs → ssrScript-CoRE6jjq.mjs} +9 -9
- package/dist/{ssrScript-CRfrN8Pm.cjs → ssrScript-DOpLExaG.cjs} +9 -9
- package/dist/themes/bruttal.cjs +5 -5
- package/dist/themes/bruttal.mjs +5 -5
- package/dist/themes/corporate.cjs +4 -4
- package/dist/themes/corporate.mjs +4 -4
- package/dist/themes/oca.cjs +4 -4
- package/dist/themes/oca.mjs +4 -4
- package/dist/themes/ventures.cjs +4 -4
- package/dist/themes/ventures.mjs +4 -4
- package/dist/{toCssVars-CYZCe-on.mjs → toCssVars-BHRiSykR.mjs} +18 -18
- package/dist/{toCssVars-DudHKvt2.cjs → toCssVars-CUiqx2kh.cjs} +18 -18
- package/dist/{tokenRegistry-OhaJ9sPJ.cjs → tokenRegistry-B9zMRjpL.cjs} +3 -3
- package/dist/{tokenRegistry-DjgSN3oU.mjs → tokenRegistry-DolhB5Vf.mjs} +3 -3
- package/dist/vars.cjs +5 -5
- package/dist/vars.mjs +5 -5
- package/dist/{withDataviz-B4pVsOwV.cjs → withDataviz-BlJcYhcw.cjs} +4 -4
- package/dist/{withDataviz-DY5s7R51.mjs → withDataviz-DYV1S_xr.mjs} +4 -4
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
const require_helpers = require('./helpers-
|
|
3
|
-
const require_tokenRegistry = require('./tokenRegistry-
|
|
2
|
+
const require_helpers = require('./helpers-C29fy-Ad.cjs');
|
|
3
|
+
const require_tokenRegistry = require('./tokenRegistry-B9zMRjpL.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/roots/toCssVars.ts
|
|
6
6
|
/**
|
|
@@ -9,7 +9,7 @@ const require_tokenRegistry = require('./tokenRegistry-OhaJ9sPJ.cjs');
|
|
|
9
9
|
* `core.colors.brand.500` → `--tt-core-colors-brand-500`
|
|
10
10
|
* `semantic.colors.action.primary.background.default` → `--tt-colors-action-primary-background-default`
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
var toCssVarName = tokenPath => {
|
|
13
13
|
for (const [prefix, cssPrefix] of require_tokenRegistry.CSS_PATH_PREFIXES) if (tokenPath.startsWith(prefix)) return `${cssPrefix}${tokenPath.slice(prefix.length).replace(/\./g, "-")}`;
|
|
14
14
|
return `--tt-${tokenPath.replace(/\./g, "-")}`;
|
|
15
15
|
};
|
|
@@ -20,7 +20,7 @@ const toCssVarName = tokenPath => {
|
|
|
20
20
|
* `clamp({core.spacing.4}, {core.spacing.6}, {core.spacing.12})`
|
|
21
21
|
* → `clamp(var(--tt-core-spacing-4), var(--tt-core-spacing-6), var(--tt-core-spacing-12))`
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
var inlineRefsToVars = value => {
|
|
24
24
|
return value.replace(require_helpers.COMPOUND_REF_RE, (_match, path) => {
|
|
25
25
|
return `var(${toCssVarName(path)})`;
|
|
26
26
|
});
|
|
@@ -31,7 +31,7 @@ const inlineRefsToVars = value => {
|
|
|
31
31
|
* Core tokens get raw values. Semantic tokens get `var()` references
|
|
32
32
|
* to preserve the cascade relationship at runtime.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
var buildCssVars = theme => {
|
|
35
35
|
const vars = {};
|
|
36
36
|
const {
|
|
37
37
|
core: coreFlat,
|
|
@@ -44,11 +44,11 @@ const buildCssVars = theme => {
|
|
|
44
44
|
}
|
|
45
45
|
return vars;
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
var sanitizeId = value => {
|
|
48
48
|
if (!require_helpers.SAFE_ID_RE.test(value)) throw new Error(`Invalid themeId "${value}". Only alphanumeric characters, hyphens, and underscores are allowed.`);
|
|
49
49
|
return value;
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
var buildSelector = ({
|
|
52
52
|
themeId,
|
|
53
53
|
mode,
|
|
54
54
|
selector
|
|
@@ -60,9 +60,9 @@ const buildSelector = ({
|
|
|
60
60
|
return s;
|
|
61
61
|
};
|
|
62
62
|
/** Matches container query length units: cqi, cqb, cqw, cqh, cqmin, cqmax */
|
|
63
|
-
|
|
63
|
+
var CQ_UNIT_RE = /cq(?:i|b|w|h|min|max)(?![a-z])/i;
|
|
64
64
|
/** Check if a CSS value contains container query units. */
|
|
65
|
-
|
|
65
|
+
var hasCqUnits = value => {
|
|
66
66
|
return typeof value === "string" && CQ_UNIT_RE.test(value);
|
|
67
67
|
};
|
|
68
68
|
/**
|
|
@@ -70,13 +70,13 @@ const hasCqUnits = value => {
|
|
|
70
70
|
*
|
|
71
71
|
* cqi → vw, cqb → vh, cqw → vw, cqh → vh, cqmin → vmin, cqmax → vmax
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
var toViewportFallback = value => {
|
|
74
74
|
return value.replace(/cqmin(?![a-z])/gi, "vmin").replace(/cqmax(?![a-z])/gi, "vmax").replace(/cqi(?![a-z])/gi, "vw").replace(/cqb(?![a-z])/gi, "vh").replace(/cqw(?![a-z])/gi, "vw").replace(/cqh(?![a-z])/gi, "vh");
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
77
|
* Extract entries from a CSS vars record whose values contain CQ units.
|
|
78
78
|
*/
|
|
79
|
-
|
|
79
|
+
var extractContainerQueryVars = vars => {
|
|
80
80
|
const cqVars = {};
|
|
81
81
|
for (const [name, value] of Object.entries(vars)) if (hasCqUnits(value)) cqVars[name] = value;
|
|
82
82
|
return cqVars;
|
|
@@ -91,7 +91,7 @@ const extractContainerQueryVars = vars => {
|
|
|
91
91
|
* Sets all semantic motion duration vars to `var(--tt-core-motion-duration-none)` (0ms).
|
|
92
92
|
* Emitted inside `@media (prefers-reduced-motion: reduce)`.
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
var buildReducedMotionVars = theme => {
|
|
95
95
|
const noneVar = `var(${toCssVarName("core.motion.duration.none")})`;
|
|
96
96
|
const flat = require_helpers.flattenObject(theme.semantic.motion, "semantic.motion");
|
|
97
97
|
const vars = {};
|
|
@@ -108,7 +108,7 @@ const buildReducedMotionVars = theme => {
|
|
|
108
108
|
* Derives every `*.coarse.*` path from `core.sizing.hit.coarse` dynamically,
|
|
109
109
|
* so adding a new step to `CoreSizeHitScale` never silently omits it here.
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
var buildCoarseHitVars = theme => {
|
|
112
112
|
const vars = {};
|
|
113
113
|
for (const [key, value] of Object.entries(theme.core.sizing.hit.coarse)) if (typeof value === "string") vars[toCssVarName(`semantic.sizing.hit.${key}`)] = value;
|
|
114
114
|
return vars;
|
|
@@ -120,7 +120,7 @@ const buildCoarseHitVars = theme => {
|
|
|
120
120
|
* coarse-pointer `@media` block, and reduced-motion `@media` block.
|
|
121
121
|
* This is the single implementation shared by `toCssVars` and `bundleToCssVars`.
|
|
122
122
|
*/
|
|
123
|
-
|
|
123
|
+
var buildCssBlock = ({
|
|
124
124
|
selector,
|
|
125
125
|
vars,
|
|
126
126
|
containerQueryVars,
|
|
@@ -153,7 +153,7 @@ const buildCssBlock = ({
|
|
|
153
153
|
* Internal: convert a single `ThemeTokens` into CSS custom properties.
|
|
154
154
|
* Use the public overloaded `toCssVars()` instead.
|
|
155
155
|
*/
|
|
156
|
-
|
|
156
|
+
var toCssVarsBase = (theme, options = {}) => {
|
|
157
157
|
const cssVars = buildCssVars(theme);
|
|
158
158
|
const coarseHitVars = buildCoarseHitVars(theme);
|
|
159
159
|
const reducedMotionVars = buildReducedMotionVars(theme);
|
|
@@ -183,13 +183,13 @@ const toCssVarsBase = (theme, options = {}) => {
|
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
/** Type guard: checks if the input is a ThemeBundle. */
|
|
186
|
-
|
|
186
|
+
var isThemeBundle = input => {
|
|
187
187
|
return "baseMode" in input && "base" in input;
|
|
188
188
|
};
|
|
189
189
|
/**
|
|
190
190
|
* Compute a diff record: only entries in `full` whose values differ from `base`.
|
|
191
191
|
*/
|
|
192
|
-
|
|
192
|
+
var diffCssVars = ({
|
|
193
193
|
base,
|
|
194
194
|
full
|
|
195
195
|
}) => {
|
|
@@ -211,7 +211,7 @@ const diffCssVars = ({
|
|
|
211
211
|
* // → base block (all vars) + dark block (only changed vars) + coarse block
|
|
212
212
|
* ```
|
|
213
213
|
*/
|
|
214
|
-
|
|
214
|
+
var bundleToCssVars = (bundle, options) => {
|
|
215
215
|
const {
|
|
216
216
|
themeId
|
|
217
217
|
} = options;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Longer (more specific) prefixes come first so that consumers using
|
|
11
11
|
* first-match lookup get the correct result.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
var TOKEN_PATH_REGISTRY = [{
|
|
14
14
|
path: "core.dataviz.color.",
|
|
15
15
|
cssPrefix: "--tt-core-dataviz-color-",
|
|
16
16
|
dtcgType: "color"
|
|
@@ -176,11 +176,11 @@ const TOKEN_PATH_REGISTRY = [{
|
|
|
176
176
|
dtcgType: "number"
|
|
177
177
|
}];
|
|
178
178
|
/** Derived lookup table: `[path, cssPrefix]` pairs. */
|
|
179
|
-
|
|
179
|
+
var CSS_PATH_PREFIXES = TOKEN_PATH_REGISTRY.map(e => {
|
|
180
180
|
return [e.path, e.cssPrefix];
|
|
181
181
|
});
|
|
182
182
|
/** Derived lookup table: `[path, dtcgType]` pairs. */
|
|
183
|
-
|
|
183
|
+
var DTCG_TYPE_PREFIXES = TOKEN_PATH_REGISTRY.map(e => {
|
|
184
184
|
return [e.path, e.dtcgType];
|
|
185
185
|
});
|
|
186
186
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Longer (more specific) prefixes come first so that consumers using
|
|
11
11
|
* first-match lookup get the correct result.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
var TOKEN_PATH_REGISTRY = [{
|
|
14
14
|
path: "core.dataviz.color.",
|
|
15
15
|
cssPrefix: "--tt-core-dataviz-color-",
|
|
16
16
|
dtcgType: "color"
|
|
@@ -176,11 +176,11 @@ const TOKEN_PATH_REGISTRY = [{
|
|
|
176
176
|
dtcgType: "number"
|
|
177
177
|
}];
|
|
178
178
|
/** Derived lookup table: `[path, cssPrefix]` pairs. */
|
|
179
|
-
|
|
179
|
+
var CSS_PATH_PREFIXES = TOKEN_PATH_REGISTRY.map(e => {
|
|
180
180
|
return [e.path, e.cssPrefix];
|
|
181
181
|
});
|
|
182
182
|
/** Derived lookup table: `[path, dtcgType]` pairs. */
|
|
183
|
-
|
|
183
|
+
var DTCG_TYPE_PREFIXES = TOKEN_PATH_REGISTRY.map(e => {
|
|
184
184
|
return [e.path, e.dtcgType];
|
|
185
185
|
});
|
|
186
186
|
|
package/dist/vars.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
3
3
|
value: 'Module'
|
|
4
4
|
});
|
|
5
|
-
const require_helpers = require('./helpers-
|
|
6
|
-
const require_baseBundle = require('./baseBundle-
|
|
7
|
-
const require_toCssVars = require('./toCssVars-
|
|
5
|
+
const require_helpers = require('./helpers-C29fy-Ad.cjs');
|
|
6
|
+
const require_baseBundle = require('./baseBundle-BXvPJYzj.cjs');
|
|
7
|
+
const require_toCssVars = require('./toCssVars-CUiqx2kh.cjs');
|
|
8
8
|
|
|
9
9
|
//#region src/roots/toVars.ts
|
|
10
10
|
/**
|
|
@@ -26,7 +26,7 @@ const require_toCssVars = require('./toCssVars-DudHKvt2.cjs');
|
|
|
26
26
|
* // → 'var(--tt-action-primary-background-default)'
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
var buildVarsMap = theme => {
|
|
30
30
|
const walk = (obj, prefix) => {
|
|
31
31
|
const result = {};
|
|
32
32
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -120,7 +120,7 @@ const buildVarsMap = theme => {
|
|
|
120
120
|
* @see {@link toCssVarName} — for raw CSS property names (without `var()`)
|
|
121
121
|
* @see {@link useResolvedTokens} — for resolved raw values in non-CSS environments (React Native, canvas, PDF)
|
|
122
122
|
*/
|
|
123
|
-
|
|
123
|
+
var vars = buildVarsMap(require_baseBundle.baseBundle.base);
|
|
124
124
|
|
|
125
125
|
//#endregion
|
|
126
126
|
exports.buildVarsMap = buildVarsMap;
|
package/dist/vars.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { o as isPlainObject } from "./helpers-
|
|
3
|
-
import { t as baseBundle } from "./baseBundle-
|
|
4
|
-
import { t as toCssVarName } from "./toCssVars-
|
|
2
|
+
import { o as isPlainObject } from "./helpers-CA4Qkxct.mjs";
|
|
3
|
+
import { t as baseBundle } from "./baseBundle-BLvD8XVS.mjs";
|
|
4
|
+
import { t as toCssVarName } from "./toCssVars-BHRiSykR.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/roots/toVars.ts
|
|
7
7
|
/**
|
|
@@ -23,7 +23,7 @@ import { t as toCssVarName } from "./toCssVars-CYZCe-on.mjs";
|
|
|
23
23
|
* // → 'var(--tt-action-primary-background-default)'
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
var buildVarsMap = theme => {
|
|
27
27
|
const walk = (obj, prefix) => {
|
|
28
28
|
const result = {};
|
|
29
29
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -117,7 +117,7 @@ const buildVarsMap = theme => {
|
|
|
117
117
|
* @see {@link toCssVarName} — for raw CSS property names (without `var()`)
|
|
118
118
|
* @see {@link useResolvedTokens} — for resolved raw values in non-CSS environments (React Native, canvas, PDF)
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
var vars = buildVarsMap(baseBundle.base);
|
|
121
121
|
|
|
122
122
|
//#endregion
|
|
123
123
|
export { buildVarsMap, vars };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
const require_createTheme = require('./createTheme-
|
|
2
|
+
const require_createTheme = require('./createTheme-JOu16Shb.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/dataviz/baseTheme.ts
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ const require_createTheme = require('./createTheme-Cv6RP9D6.cjs');
|
|
|
7
7
|
*
|
|
8
8
|
* Analytical color comes from `core.colors.*` — see `semanticDataviz` below.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
var coreDataviz = {
|
|
11
11
|
shape: {
|
|
12
12
|
1: "circle",
|
|
13
13
|
2: "square",
|
|
@@ -37,7 +37,7 @@ const coreDataviz = {
|
|
|
37
37
|
uncertainty: .25
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
var semanticDataviz = {
|
|
41
41
|
color: {
|
|
42
42
|
series: {
|
|
43
43
|
1: "{core.colors.brand.500}",
|
|
@@ -154,7 +154,7 @@ const semanticDataviz = {
|
|
|
154
154
|
* }));
|
|
155
155
|
* ```
|
|
156
156
|
*/
|
|
157
|
-
|
|
157
|
+
var withDataviz = bundle => {
|
|
158
158
|
return {
|
|
159
159
|
...bundle,
|
|
160
160
|
base: require_createTheme.buildTheme({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { t as buildTheme } from "./createTheme-
|
|
2
|
+
import { t as buildTheme } from "./createTheme-DzLnsknT.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/dataviz/baseTheme.ts
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import { t as buildTheme } from "./createTheme-BLNYztZU.mjs";
|
|
|
7
7
|
*
|
|
8
8
|
* Analytical color comes from `core.colors.*` — see `semanticDataviz` below.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
var coreDataviz = {
|
|
11
11
|
shape: {
|
|
12
12
|
1: "circle",
|
|
13
13
|
2: "square",
|
|
@@ -37,7 +37,7 @@ const coreDataviz = {
|
|
|
37
37
|
uncertainty: .25
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
var semanticDataviz = {
|
|
41
41
|
color: {
|
|
42
42
|
series: {
|
|
43
43
|
1: "{core.colors.brand.500}",
|
|
@@ -154,7 +154,7 @@ const semanticDataviz = {
|
|
|
154
154
|
* }));
|
|
155
155
|
* ```
|
|
156
156
|
*/
|
|
157
|
-
|
|
157
|
+
var withDataviz = bundle => {
|
|
158
158
|
return {
|
|
159
159
|
...bundle,
|
|
160
160
|
base: buildTheme({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/fsl-theme",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
4
4
|
"description": "ttoss theme provider for UI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css-variables",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
],
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@testing-library/react": "^16.3.2",
|
|
63
|
-
"jest": "^30.
|
|
63
|
+
"jest": "^30.4.2",
|
|
64
64
|
"react": "^19.2.6",
|
|
65
65
|
"ts-morph": "^28.0.0",
|
|
66
|
-
"tsdown": "^0.22.
|
|
66
|
+
"tsdown": "^0.22.2",
|
|
67
67
|
"tsx": "^4.21.0",
|
|
68
|
-
"@ttoss/config": "^1.37.
|
|
69
|
-
"@ttoss/test-utils": "^4.2.
|
|
68
|
+
"@ttoss/config": "^1.37.16",
|
|
69
|
+
"@ttoss/test-utils": "^4.2.16"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"react": ">=18"
|