@ttoss/fsl-theme 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Types-a_sfpbha.d.cts → Types-8o6d09ll.d.cts} +23 -24
- package/dist/{Types-a_sfpbha.d.mts → Types-8o6d09ll.d.mts} +23 -24
- package/dist/{baseBundle-CXdxj_re.mjs → baseBundle-C6RP-2Qb.mjs} +1 -1
- package/dist/{baseBundle-a9LDsqYy.cjs → baseBundle-C6yVk4x0.cjs} +1 -1
- package/dist/{createTheme-B7H0xSVp.cjs → createTheme-BzlJdFAG.cjs} +18 -18
- package/dist/{createTheme-Bm9LVQ4w.mjs → createTheme-gTjIryKH.mjs} +18 -18
- package/dist/css-BVePVvTJ.mjs +96 -0
- package/dist/css-CKvOE4mT.cjs +113 -0
- package/dist/css.cjs +5 -41
- package/dist/css.d.cts +22 -2
- package/dist/css.d.mts +22 -2
- package/dist/css.mjs +3 -41
- package/dist/dataviz/index.cjs +2 -2
- package/dist/dataviz/index.d.cts +1 -1
- package/dist/dataviz/index.d.mts +1 -1
- package/dist/dataviz/index.mjs +1 -1
- package/dist/dtcg.cjs +11 -16
- package/dist/dtcg.d.cts +3 -3
- package/dist/dtcg.d.mts +3 -3
- package/dist/dtcg.mjs +11 -16
- package/dist/{index-BmZQVd3G.d.cts → index-CIkVRaGC.d.cts} +1 -1
- package/dist/{index-XZsRrMTF.d.mts → index-OP4B-9hU.d.mts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{react-DQErMGJz.cjs → react-C1WRCOFF.cjs} +43 -9
- package/dist/{react-BwnHHvJj.d.mts → react-C9QSshf3.d.mts} +30 -3
- package/dist/{react-2D_CNVF2.d.cts → react-CZDLBN6v.d.cts} +30 -3
- package/dist/react.cjs +2 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.mts +2 -2
- package/dist/react.mjs +38 -10
- package/dist/themes/bruttal.cjs +2 -2
- package/dist/themes/bruttal.d.cts +1 -1
- package/dist/themes/bruttal.d.mts +1 -1
- package/dist/themes/bruttal.mjs +2 -2
- package/dist/{toCssVars-CWTlp9St.mjs → toCssVars-CTGqZ_t3.mjs} +5 -5
- package/dist/{toCssVars-D0BR23cP.cjs → toCssVars-NGi4K2Oc.cjs} +5 -5
- package/dist/vars.cjs +2 -2
- package/dist/vars.d.cts +1 -1
- package/dist/vars.d.mts +1 -1
- package/dist/vars.mjs +2 -2
- package/dist/{withDataviz-DrUtw8cc.cjs → withDataviz-B-XQ1MDT.cjs} +1 -1
- package/dist/{withDataviz-Ln3sEwb7.mjs → withDataviz-B3mEhBPh.mjs} +1 -1
- package/llms.txt +10 -10
- package/package.json +1 -1
package/dist/css.mjs
CHANGED
|
@@ -1,43 +1,5 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
2
|
import { s as toFlatTokens } from "./helpers-BXaKe2s3.mjs";
|
|
3
|
-
import { n as toCssVars, t as toCssVarName } from "./toCssVars-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns the full CSS string for a theme bundle — all `--tt-*` custom
|
|
8
|
-
* properties, coarse-pointer overrides, reduced-motion overrides, and
|
|
9
|
-
* container query progressive enhancement — ready to inject into a
|
|
10
|
-
* `<style>` tag or serve as a static `.css` file.
|
|
11
|
-
*
|
|
12
|
-
* Symmetric counterpart to `getThemeScriptContent()` for CSS.
|
|
13
|
-
* Use `<ThemeStyles>` from `@ttoss/fsl-theme/react` for React apps.
|
|
14
|
-
*
|
|
15
|
-
* When `themeId` is omitted (canonical 1-theme model), CSS targets `:root` and
|
|
16
|
-
* the alternate mode selector becomes `:root[data-tt-mode="dark"]`. Pass
|
|
17
|
-
* `themeId` only for multi-theme scenarios (Storybook, micro-frontends).
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* // Canonical: no themeId needed (CSS goes to :root)
|
|
22
|
-
* import { createTheme } from '@ttoss/fsl-theme';
|
|
23
|
-
* import { getThemeStylesContent } from '@ttoss/fsl-theme/css';
|
|
24
|
-
*
|
|
25
|
-
* const myBundle = createTheme();
|
|
26
|
-
*
|
|
27
|
-
* app.get('/theme.css', (_, res) => {
|
|
28
|
-
* res.type('text/css').send(getThemeStylesContent(myBundle));
|
|
29
|
-
* });
|
|
30
|
-
*
|
|
31
|
-
* // Multi-theme: explicit themeId for scoping
|
|
32
|
-
* res.type('text/css').send(getThemeStylesContent(myBundle, 'myTheme'));
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
var getThemeStylesContent = (bundle, themeId, options) => {
|
|
36
|
-
return toCssVars(bundle, {
|
|
37
|
-
themeId,
|
|
38
|
-
systemModeFallback: options?.systemModeFallback
|
|
39
|
-
}).toCssString();
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
export { getThemeStylesContent, toCssVarName, toCssVars, toFlatTokens };
|
|
3
|
+
import { n as toCssVars, t as toCssVarName } from "./toCssVars-CTGqZ_t3.mjs";
|
|
4
|
+
import { n as PREFLIGHT_CSS, r as getPreflightStyles, t as getThemeStylesContent } from "./css-BVePVvTJ.mjs";
|
|
5
|
+
export { PREFLIGHT_CSS, getPreflightStyles, getThemeStylesContent, toCssVarName, toCssVars, toFlatTokens };
|
package/dist/dataviz/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
3
3
|
value: 'Module'
|
|
4
4
|
});
|
|
5
|
-
const require_react = require('../react-
|
|
6
|
-
const require_withDataviz = require('../withDataviz-
|
|
5
|
+
const require_react = require('../react-C1WRCOFF.cjs');
|
|
6
|
+
const require_withDataviz = require('../withDataviz-B-XQ1MDT.cjs');
|
|
7
7
|
|
|
8
8
|
//#region src/dataviz/useDatavizTokens.ts
|
|
9
9
|
/**
|
package/dist/dataviz/index.d.cts
CHANGED
package/dist/dataviz/index.d.mts
CHANGED
package/dist/dataviz/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { n as coreDataviz, r as semanticDataviz, t as withDataviz } from "../withDataviz-
|
|
2
|
+
import { n as coreDataviz, r as semanticDataviz, t as withDataviz } from "../withDataviz-B3mEhBPh.mjs";
|
|
3
3
|
import { useTokens } from "../react.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/dataviz/useDatavizTokens.ts
|
package/dist/dtcg.cjs
CHANGED
|
@@ -55,23 +55,21 @@ var setNestedValue = (root, path, value) => {
|
|
|
55
55
|
}
|
|
56
56
|
current[segments[segments.length - 1]] = value;
|
|
57
57
|
};
|
|
58
|
-
/** Semantic hit token
|
|
59
|
-
var
|
|
58
|
+
/** Semantic hit token path that carries the coarse-pointer override. */
|
|
59
|
+
var SEMANTIC_HIT_PATH = "semantic.sizing.hit";
|
|
60
60
|
/**
|
|
61
|
-
* Build the `$extensions` metadata for
|
|
61
|
+
* Build the `$extensions` metadata for the semantic hit token.
|
|
62
62
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
63
|
+
* `semantic.sizing.hit` defaults to the fine-pointer value. The extension
|
|
64
|
+
* declares the coarse-pointer raw value (`core.sizing.hit.coarse`) so that
|
|
65
65
|
* non-CSS consumers (React Native, design tool pipelines) can locate and
|
|
66
|
-
* apply touch-target
|
|
66
|
+
* apply the touch-target override without reading `toCssVars` source code.
|
|
67
67
|
*/
|
|
68
|
-
var buildHitExtension =
|
|
69
|
-
const coarseValue = theme.core.sizing.hit.coarse[step];
|
|
70
|
-
if (coarseValue === void 0) return void 0;
|
|
68
|
+
var buildHitExtension = theme => {
|
|
71
69
|
return {
|
|
72
70
|
"com.ttoss.pointer-override": {
|
|
73
71
|
condition: "any-pointer: coarse",
|
|
74
|
-
value:
|
|
72
|
+
value: theme.core.sizing.hit.coarse
|
|
75
73
|
}
|
|
76
74
|
};
|
|
77
75
|
};
|
|
@@ -90,8 +88,8 @@ var buildHitExtension = (step, theme) => {
|
|
|
90
88
|
* alias-preserving / composite output is a deferred enhancement (see
|
|
91
89
|
* CONTRIBUTING.md ADR-013).
|
|
92
90
|
*
|
|
93
|
-
*
|
|
94
|
-
* field declaring
|
|
91
|
+
* The semantic hit token (`semantic.sizing.hit`) includes a `$extensions`
|
|
92
|
+
* field declaring its coarse-pointer override value, so non-CSS consumers
|
|
95
93
|
* can apply touch-target ergonomics without reading the CSS emitter source.
|
|
96
94
|
*
|
|
97
95
|
* This is the interchange format for design tools (Tokens Studio, Figma,
|
|
@@ -119,10 +117,7 @@ var toDTCG = theme => {
|
|
|
119
117
|
$value: value
|
|
120
118
|
};
|
|
121
119
|
if (dtcgType !== void 0) token.$type = dtcgType;
|
|
122
|
-
if (path
|
|
123
|
-
const ext = buildHitExtension(path.slice(20), theme);
|
|
124
|
-
if (ext) token.$extensions = ext;
|
|
125
|
-
}
|
|
120
|
+
if (path === SEMANTIC_HIT_PATH) token.$extensions = buildHitExtension(theme);
|
|
126
121
|
setNestedValue(tree, path, token);
|
|
127
122
|
}
|
|
128
123
|
return tree;
|
package/dist/dtcg.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as ThemeTokens } from "./Types-
|
|
2
|
+
import { a as ThemeTokens } from "./Types-8o6d09ll.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/roots/toDTCG.d.ts
|
|
5
5
|
/**
|
|
@@ -39,8 +39,8 @@ type DTCGTokenTree = DTCGToken | {
|
|
|
39
39
|
* alias-preserving / composite output is a deferred enhancement (see
|
|
40
40
|
* CONTRIBUTING.md ADR-013).
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
* field declaring
|
|
42
|
+
* The semantic hit token (`semantic.sizing.hit`) includes a `$extensions`
|
|
43
|
+
* field declaring its coarse-pointer override value, so non-CSS consumers
|
|
44
44
|
* can apply touch-target ergonomics without reading the CSS emitter source.
|
|
45
45
|
*
|
|
46
46
|
* This is the interchange format for design tools (Tokens Studio, Figma,
|
package/dist/dtcg.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as ThemeTokens } from "./Types-
|
|
2
|
+
import { a as ThemeTokens } from "./Types-8o6d09ll.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/roots/toDTCG.d.ts
|
|
5
5
|
/**
|
|
@@ -39,8 +39,8 @@ type DTCGTokenTree = DTCGToken | {
|
|
|
39
39
|
* alias-preserving / composite output is a deferred enhancement (see
|
|
40
40
|
* CONTRIBUTING.md ADR-013).
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
* field declaring
|
|
42
|
+
* The semantic hit token (`semantic.sizing.hit`) includes a `$extensions`
|
|
43
|
+
* field declaring its coarse-pointer override value, so non-CSS consumers
|
|
44
44
|
* can apply touch-target ergonomics without reading the CSS emitter source.
|
|
45
45
|
*
|
|
46
46
|
* This is the interchange format for design tools (Tokens Studio, Figma,
|
package/dist/dtcg.mjs
CHANGED
|
@@ -52,23 +52,21 @@ var setNestedValue = (root, path, value) => {
|
|
|
52
52
|
}
|
|
53
53
|
current[segments[segments.length - 1]] = value;
|
|
54
54
|
};
|
|
55
|
-
/** Semantic hit token
|
|
56
|
-
var
|
|
55
|
+
/** Semantic hit token path that carries the coarse-pointer override. */
|
|
56
|
+
var SEMANTIC_HIT_PATH = "semantic.sizing.hit";
|
|
57
57
|
/**
|
|
58
|
-
* Build the `$extensions` metadata for
|
|
58
|
+
* Build the `$extensions` metadata for the semantic hit token.
|
|
59
59
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* `semantic.sizing.hit` defaults to the fine-pointer value. The extension
|
|
61
|
+
* declares the coarse-pointer raw value (`core.sizing.hit.coarse`) so that
|
|
62
62
|
* non-CSS consumers (React Native, design tool pipelines) can locate and
|
|
63
|
-
* apply touch-target
|
|
63
|
+
* apply the touch-target override without reading `toCssVars` source code.
|
|
64
64
|
*/
|
|
65
|
-
var buildHitExtension =
|
|
66
|
-
const coarseValue = theme.core.sizing.hit.coarse[step];
|
|
67
|
-
if (coarseValue === void 0) return void 0;
|
|
65
|
+
var buildHitExtension = theme => {
|
|
68
66
|
return {
|
|
69
67
|
"com.ttoss.pointer-override": {
|
|
70
68
|
condition: "any-pointer: coarse",
|
|
71
|
-
value:
|
|
69
|
+
value: theme.core.sizing.hit.coarse
|
|
72
70
|
}
|
|
73
71
|
};
|
|
74
72
|
};
|
|
@@ -87,8 +85,8 @@ var buildHitExtension = (step, theme) => {
|
|
|
87
85
|
* alias-preserving / composite output is a deferred enhancement (see
|
|
88
86
|
* CONTRIBUTING.md ADR-013).
|
|
89
87
|
*
|
|
90
|
-
*
|
|
91
|
-
* field declaring
|
|
88
|
+
* The semantic hit token (`semantic.sizing.hit`) includes a `$extensions`
|
|
89
|
+
* field declaring its coarse-pointer override value, so non-CSS consumers
|
|
92
90
|
* can apply touch-target ergonomics without reading the CSS emitter source.
|
|
93
91
|
*
|
|
94
92
|
* This is the interchange format for design tools (Tokens Studio, Figma,
|
|
@@ -116,10 +114,7 @@ var toDTCG = theme => {
|
|
|
116
114
|
$value: value
|
|
117
115
|
};
|
|
118
116
|
if (dtcgType !== void 0) token.$type = dtcgType;
|
|
119
|
-
if (path
|
|
120
|
-
const ext = buildHitExtension(path.slice(20), theme);
|
|
121
|
-
if (ext) token.$extensions = ext;
|
|
122
|
-
}
|
|
117
|
+
if (path === SEMANTIC_HIT_PATH) token.$extensions = buildHitExtension(theme);
|
|
123
118
|
setNestedValue(tree, path, token);
|
|
124
119
|
}
|
|
125
120
|
return tree;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as ThemeTokens, i as ThemeBundle, o as DeepPartial, r as ThemeBrief, t as ModeOverride } from "./Types-
|
|
2
|
+
import { a as ThemeTokens, i as ThemeBundle, o as DeepPartial, r as ThemeBrief, t as ModeOverride } from "./Types-8o6d09ll.cjs";
|
|
3
3
|
//#region src/baseTheme.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* **Foundation** — Neutral baseline theme.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as ThemeTokens, i as ThemeBundle, o as DeepPartial, r as ThemeBrief, t as ModeOverride } from "./Types-
|
|
2
|
+
import { a as ThemeTokens, i as ThemeBundle, o as DeepPartial, r as ThemeBrief, t as ModeOverride } from "./Types-8o6d09ll.mjs";
|
|
3
3
|
//#region src/baseTheme.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* **Foundation** — Neutral baseline theme.
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
3
3
|
value: 'Module'
|
|
4
4
|
});
|
|
5
|
-
const require_createTheme = require('./createTheme-
|
|
5
|
+
const require_createTheme = require('./createTheme-BzlJdFAG.cjs');
|
|
6
6
|
const require_themes_bruttal = require('./themes/bruttal.cjs');
|
|
7
7
|
exports.baseTheme = require_createTheme.baseTheme;
|
|
8
8
|
exports.bruttal = require_themes_bruttal.bruttal;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as ThemeTokens, i as ThemeBundle, n as SemanticTokens, o as DeepPartial, r as ThemeBrief, t as ModeOverride } from "./Types-
|
|
3
|
-
import { i as darkAlternate, n as createTheme, r as baseTheme, t as bruttal } from "./index-
|
|
2
|
+
import { a as ThemeTokens, i as ThemeBundle, n as SemanticTokens, o as DeepPartial, r as ThemeBrief, t as ModeOverride } from "./Types-8o6d09ll.cjs";
|
|
3
|
+
import { i as darkAlternate, n as createTheme, r as baseTheme, t as bruttal } from "./index-CIkVRaGC.cjs";
|
|
4
4
|
import { o as ThemeMode } from "./ssrScript-BVysxDws.cjs";
|
|
5
|
-
import {
|
|
5
|
+
import { n as ThemeHeadProps, u as ThemeStylesProps } from "./react-CZDLBN6v.cjs";
|
|
6
6
|
export { type DeepPartial, type ModeOverride, type SemanticTokens, type ThemeBrief, type ThemeBundle, type ThemeHeadProps, type ThemeMode, type ThemeStylesProps, type ThemeTokens, baseTheme, bruttal, createTheme, darkAlternate };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as ThemeTokens, i as ThemeBundle, n as SemanticTokens, o as DeepPartial, r as ThemeBrief, t as ModeOverride } from "./Types-
|
|
3
|
-
import { i as darkAlternate, n as createTheme, r as baseTheme, t as bruttal } from "./index-
|
|
2
|
+
import { a as ThemeTokens, i as ThemeBundle, n as SemanticTokens, o as DeepPartial, r as ThemeBrief, t as ModeOverride } from "./Types-8o6d09ll.mjs";
|
|
3
|
+
import { i as darkAlternate, n as createTheme, r as baseTheme, t as bruttal } from "./index-OP4B-9hU.mjs";
|
|
4
4
|
import { o as ThemeMode } from "./ssrScript-BVysxDws.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { n as ThemeHeadProps, u as ThemeStylesProps } from "./react-C9QSshf3.mjs";
|
|
6
6
|
export { type DeepPartial, type ModeOverride, type SemanticTokens, type ThemeBrief, type ThemeBundle, type ThemeHeadProps, type ThemeMode, type ThemeStylesProps, type ThemeTokens, baseTheme, bruttal, createTheme, darkAlternate };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { a as darkAlternate, i as baseTheme, n as createTheme } from "./createTheme-
|
|
2
|
+
import { a as darkAlternate, i as baseTheme, n as createTheme } from "./createTheme-gTjIryKH.mjs";
|
|
3
3
|
import { bruttal } from "./themes/bruttal.mjs";
|
|
4
4
|
export { baseTheme, bruttal, createTheme, darkAlternate };
|
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
const require_helpers = require('./helpers-BU40JvFA.cjs');
|
|
30
|
-
const require_css = require('./css.cjs');
|
|
30
|
+
const require_css = require('./css-CKvOE4mT.cjs');
|
|
31
31
|
const require_ssrScript = require('./ssrScript-D73WcrCM.cjs');
|
|
32
32
|
let react = require("react");
|
|
33
33
|
react = __toESM(react);
|
|
@@ -122,19 +122,18 @@ var useCoarsePointer = () => {
|
|
|
122
122
|
/**
|
|
123
123
|
* Apply coarse-pointer hit target overrides to a resolved token map.
|
|
124
124
|
*
|
|
125
|
-
* When `isCoarse` is true, replaces `semantic.sizing.hit
|
|
126
|
-
*
|
|
127
|
-
*
|
|
125
|
+
* When `isCoarse` is true, replaces the `semantic.sizing.hit` value with the
|
|
126
|
+
* raw coarse value from `core.sizing.hit.coarse`. This mirrors the
|
|
127
|
+
* `@media (any-pointer: coarse)` block that `toCssVars` emits for CSS
|
|
128
128
|
* consumers — ensuring non-CSS consumers (React Native, canvas) get
|
|
129
129
|
* touch-appropriate hit targets.
|
|
130
130
|
*/
|
|
131
131
|
var applyCoarseHitOverrides = (tokens, theme, isCoarse) => {
|
|
132
132
|
if (!isCoarse) return tokens;
|
|
133
|
-
|
|
134
|
-
...tokens
|
|
133
|
+
return {
|
|
134
|
+
...tokens,
|
|
135
|
+
"semantic.sizing.hit": theme.core.sizing.hit.coarse
|
|
135
136
|
};
|
|
136
|
-
for (const [key, value] of Object.entries(theme.core.sizing.hit.coarse)) if (typeof value === "string") overrides[`semantic.sizing.hit.${key}`] = value;
|
|
137
|
-
return overrides;
|
|
138
137
|
};
|
|
139
138
|
var SemanticTokensCtx = react.createContext(null);
|
|
140
139
|
/**
|
|
@@ -345,7 +344,7 @@ var useTokens = () => {
|
|
|
345
344
|
*
|
|
346
345
|
* ### ⚠ CSS-coupled tokens stay unresolved
|
|
347
346
|
* A registered set of dimensional tokens (model.md §8 — spacing steps, fluid
|
|
348
|
-
* `text.*.fontSize`, `sizing.hit
|
|
347
|
+
* `text.*.fontSize`, `sizing.hit`, `sizing.viewport.*`, `sizing.measure.reading`,
|
|
349
348
|
* `spacing.gutter.*`) carry CSS-only constructs (`var()`, `calc()`, `clamp()`,
|
|
350
349
|
* `cqi`, `dvh`, `ch`). This hook returns those **as-is** — they are not usable
|
|
351
350
|
* outside a CSS engine. Colors, opacity, z-index, font weights/leading and
|
|
@@ -474,6 +473,35 @@ var ThemeStyles = ({
|
|
|
474
473
|
});
|
|
475
474
|
};
|
|
476
475
|
/**
|
|
476
|
+
* Injects the theme's base stylesheet (the {@link PREFLIGHT_CSS} preflight):
|
|
477
|
+
* a box-sizing reset, the document body's default typography and colour drawn
|
|
478
|
+
* from the semantic tokens, and the global reduced-motion guard. Render it
|
|
479
|
+
* once at the app root, alongside `<ThemeProvider>` / `<ThemeStyles>` — so the
|
|
480
|
+
* base layer is the theme's responsibility, not hand-written per app.
|
|
481
|
+
*
|
|
482
|
+
* It sets no widths, heights, or component styling (those belong to
|
|
483
|
+
* `@ttoss/fsl-ui` and the app). Requires the `--tt-*` custom properties to be
|
|
484
|
+
* present on the page.
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* ```tsx
|
|
488
|
+
* <ThemeProvider theme={theme}>
|
|
489
|
+
* <ThemeReset />
|
|
490
|
+
* <App />
|
|
491
|
+
* </ThemeProvider>
|
|
492
|
+
* ```
|
|
493
|
+
*/
|
|
494
|
+
var ThemeReset = ({
|
|
495
|
+
nonce
|
|
496
|
+
} = {}) => {
|
|
497
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)("style", {
|
|
498
|
+
nonce,
|
|
499
|
+
dangerouslySetInnerHTML: {
|
|
500
|
+
__html: require_css.PREFLIGHT_CSS
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
};
|
|
504
|
+
/**
|
|
477
505
|
* Convenience component that renders both `<ThemeScript>` and `<ThemeStyles>`
|
|
478
506
|
* in a single line — the complete SSR `<head>` setup for flash-free theming.
|
|
479
507
|
*
|
|
@@ -551,6 +579,12 @@ Object.defineProperty(exports, 'ThemeProvider', {
|
|
|
551
579
|
return ThemeProvider;
|
|
552
580
|
}
|
|
553
581
|
});
|
|
582
|
+
Object.defineProperty(exports, 'ThemeReset', {
|
|
583
|
+
enumerable: true,
|
|
584
|
+
get: function () {
|
|
585
|
+
return ThemeReset;
|
|
586
|
+
}
|
|
587
|
+
});
|
|
554
588
|
Object.defineProperty(exports, 'ThemeScript', {
|
|
555
589
|
enumerable: true,
|
|
556
590
|
get: function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { i as ThemeBundle, n as SemanticTokens } from "./Types-
|
|
2
|
+
import { i as ThemeBundle, n as SemanticTokens } from "./Types-8o6d09ll.mjs";
|
|
3
3
|
import { a as ResolvedMode, o as ThemeMode, t as ThemeScriptConfig } from "./ssrScript-BVysxDws.mjs";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
|
|
@@ -242,7 +242,7 @@ declare const useTokens: () => SemanticTokens;
|
|
|
242
242
|
*
|
|
243
243
|
* ### ⚠ CSS-coupled tokens stay unresolved
|
|
244
244
|
* A registered set of dimensional tokens (model.md §8 — spacing steps, fluid
|
|
245
|
-
* `text.*.fontSize`, `sizing.hit
|
|
245
|
+
* `text.*.fontSize`, `sizing.hit`, `sizing.viewport.*`, `sizing.measure.reading`,
|
|
246
246
|
* `spacing.gutter.*`) carry CSS-only constructs (`var()`, `calc()`, `clamp()`,
|
|
247
247
|
* `cqi`, `dvh`, `ch`). This hook returns those **as-is** — they are not usable
|
|
248
248
|
* outside a CSS engine. Colors, opacity, z-index, font weights/leading and
|
|
@@ -379,6 +379,33 @@ declare const ThemeStyles: ({
|
|
|
379
379
|
nonce,
|
|
380
380
|
systemModeFallback
|
|
381
381
|
}: ThemeStylesProps) => import("react/jsx-runtime").JSX.Element;
|
|
382
|
+
/** Props for the `ThemeReset` component. */
|
|
383
|
+
interface ThemeResetProps {
|
|
384
|
+
/** CSP nonce forwarded to the injected `<style>` element. */
|
|
385
|
+
nonce?: string;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Injects the theme's base stylesheet (the {@link PREFLIGHT_CSS} preflight):
|
|
389
|
+
* a box-sizing reset, the document body's default typography and colour drawn
|
|
390
|
+
* from the semantic tokens, and the global reduced-motion guard. Render it
|
|
391
|
+
* once at the app root, alongside `<ThemeProvider>` / `<ThemeStyles>` — so the
|
|
392
|
+
* base layer is the theme's responsibility, not hand-written per app.
|
|
393
|
+
*
|
|
394
|
+
* It sets no widths, heights, or component styling (those belong to
|
|
395
|
+
* `@ttoss/fsl-ui` and the app). Requires the `--tt-*` custom properties to be
|
|
396
|
+
* present on the page.
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```tsx
|
|
400
|
+
* <ThemeProvider theme={theme}>
|
|
401
|
+
* <ThemeReset />
|
|
402
|
+
* <App />
|
|
403
|
+
* </ThemeProvider>
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
declare const ThemeReset: ({
|
|
407
|
+
nonce
|
|
408
|
+
}?: ThemeResetProps) => import("react/jsx-runtime").JSX.Element;
|
|
382
409
|
/**
|
|
383
410
|
* Props for the `ThemeHead` component.
|
|
384
411
|
*/
|
|
@@ -439,4 +466,4 @@ declare const ThemeHead: ({
|
|
|
439
466
|
storageKey
|
|
440
467
|
}: ThemeHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
441
468
|
//#endregion
|
|
442
|
-
export {
|
|
469
|
+
export { ThemeReset as a, ThemeScriptProps as c, UseColorModeResult as d, useColorMode as f, ThemeProviderProps as i, ThemeStyles as l, useTokens as m, ThemeHeadProps as n, ThemeResetProps as o, useResolvedTokens as p, ThemeProvider as r, ThemeScript as s, ThemeHead as t, ThemeStylesProps as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { i as ThemeBundle, n as SemanticTokens } from "./Types-
|
|
2
|
+
import { i as ThemeBundle, n as SemanticTokens } from "./Types-8o6d09ll.cjs";
|
|
3
3
|
import { a as ResolvedMode, o as ThemeMode, t as ThemeScriptConfig } from "./ssrScript-BVysxDws.cjs";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
|
|
@@ -242,7 +242,7 @@ declare const useTokens: () => SemanticTokens;
|
|
|
242
242
|
*
|
|
243
243
|
* ### ⚠ CSS-coupled tokens stay unresolved
|
|
244
244
|
* A registered set of dimensional tokens (model.md §8 — spacing steps, fluid
|
|
245
|
-
* `text.*.fontSize`, `sizing.hit
|
|
245
|
+
* `text.*.fontSize`, `sizing.hit`, `sizing.viewport.*`, `sizing.measure.reading`,
|
|
246
246
|
* `spacing.gutter.*`) carry CSS-only constructs (`var()`, `calc()`, `clamp()`,
|
|
247
247
|
* `cqi`, `dvh`, `ch`). This hook returns those **as-is** — they are not usable
|
|
248
248
|
* outside a CSS engine. Colors, opacity, z-index, font weights/leading and
|
|
@@ -379,6 +379,33 @@ declare const ThemeStyles: ({
|
|
|
379
379
|
nonce,
|
|
380
380
|
systemModeFallback
|
|
381
381
|
}: ThemeStylesProps) => import("react/jsx-runtime").JSX.Element;
|
|
382
|
+
/** Props for the `ThemeReset` component. */
|
|
383
|
+
interface ThemeResetProps {
|
|
384
|
+
/** CSP nonce forwarded to the injected `<style>` element. */
|
|
385
|
+
nonce?: string;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Injects the theme's base stylesheet (the {@link PREFLIGHT_CSS} preflight):
|
|
389
|
+
* a box-sizing reset, the document body's default typography and colour drawn
|
|
390
|
+
* from the semantic tokens, and the global reduced-motion guard. Render it
|
|
391
|
+
* once at the app root, alongside `<ThemeProvider>` / `<ThemeStyles>` — so the
|
|
392
|
+
* base layer is the theme's responsibility, not hand-written per app.
|
|
393
|
+
*
|
|
394
|
+
* It sets no widths, heights, or component styling (those belong to
|
|
395
|
+
* `@ttoss/fsl-ui` and the app). Requires the `--tt-*` custom properties to be
|
|
396
|
+
* present on the page.
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```tsx
|
|
400
|
+
* <ThemeProvider theme={theme}>
|
|
401
|
+
* <ThemeReset />
|
|
402
|
+
* <App />
|
|
403
|
+
* </ThemeProvider>
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
declare const ThemeReset: ({
|
|
407
|
+
nonce
|
|
408
|
+
}?: ThemeResetProps) => import("react/jsx-runtime").JSX.Element;
|
|
382
409
|
/**
|
|
383
410
|
* Props for the `ThemeHead` component.
|
|
384
411
|
*/
|
|
@@ -439,4 +466,4 @@ declare const ThemeHead: ({
|
|
|
439
466
|
storageKey
|
|
440
467
|
}: ThemeHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
441
468
|
//#endregion
|
|
442
|
-
export {
|
|
469
|
+
export { ThemeReset as a, ThemeScriptProps as c, UseColorModeResult as d, useColorMode as f, ThemeProviderProps as i, ThemeStyles as l, useTokens as m, ThemeHeadProps as n, ThemeResetProps as o, useResolvedTokens as p, ThemeProvider as r, ThemeScript as s, ThemeHead as t, ThemeStylesProps as u };
|
package/dist/react.cjs
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
5
5
|
value: 'Module'
|
|
6
6
|
});
|
|
7
|
-
const require_react = require('./react-
|
|
7
|
+
const require_react = require('./react-C1WRCOFF.cjs');
|
|
8
8
|
exports.ThemeHead = require_react.ThemeHead;
|
|
9
9
|
exports.ThemeProvider = require_react.ThemeProvider;
|
|
10
|
+
exports.ThemeReset = require_react.ThemeReset;
|
|
10
11
|
exports.ThemeScript = require_react.ThemeScript;
|
|
11
12
|
exports.ThemeStyles = require_react.ThemeStyles;
|
|
12
13
|
exports.useColorMode = require_react.useColorMode;
|
package/dist/react.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
2
|
import { a as ResolvedMode, o as ThemeMode } from "./ssrScript-BVysxDws.cjs";
|
|
3
|
-
import { a as
|
|
4
|
-
export { type ResolvedMode, ThemeHead, ThemeHeadProps, type ThemeMode, ThemeProvider, ThemeProviderProps, ThemeScript, ThemeScriptProps, ThemeStyles, ThemeStylesProps, UseColorModeResult, useColorMode, useResolvedTokens, useTokens };
|
|
3
|
+
import { a as ThemeReset, c as ThemeScriptProps, d as UseColorModeResult, f as useColorMode, i as ThemeProviderProps, l as ThemeStyles, m as useTokens, n as ThemeHeadProps, o as ThemeResetProps, p as useResolvedTokens, r as ThemeProvider, s as ThemeScript, t as ThemeHead, u as ThemeStylesProps } from "./react-CZDLBN6v.cjs";
|
|
4
|
+
export { type ResolvedMode, ThemeHead, ThemeHeadProps, type ThemeMode, ThemeProvider, ThemeProviderProps, ThemeReset, ThemeResetProps, ThemeScript, ThemeScriptProps, ThemeStyles, ThemeStylesProps, UseColorModeResult, useColorMode, useResolvedTokens, useTokens };
|
package/dist/react.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
2
|
import { a as ResolvedMode, o as ThemeMode } from "./ssrScript-BVysxDws.mjs";
|
|
3
|
-
import { a as
|
|
4
|
-
export { type ResolvedMode, ThemeHead, ThemeHeadProps, type ThemeMode, ThemeProvider, ThemeProviderProps, ThemeScript, ThemeScriptProps, ThemeStyles, ThemeStylesProps, UseColorModeResult, useColorMode, useResolvedTokens, useTokens };
|
|
3
|
+
import { a as ThemeReset, c as ThemeScriptProps, d as UseColorModeResult, f as useColorMode, i as ThemeProviderProps, l as ThemeStyles, m as useTokens, n as ThemeHeadProps, o as ThemeResetProps, p as useResolvedTokens, r as ThemeProvider, s as ThemeScript, t as ThemeHead, u as ThemeStylesProps } from "./react-C9QSshf3.mjs";
|
|
4
|
+
export { type ResolvedMode, ThemeHead, ThemeHeadProps, type ThemeMode, ThemeProvider, ThemeProviderProps, ThemeReset, ThemeResetProps, ThemeScript, ThemeScriptProps, ThemeStyles, ThemeStylesProps, UseColorModeResult, useColorMode, useResolvedTokens, useTokens };
|
package/dist/react.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
4
|
import { r as deepMerge, s as toFlatTokens } from "./helpers-BXaKe2s3.mjs";
|
|
5
|
-
import { getThemeStylesContent } from "./css.mjs";
|
|
5
|
+
import { n as PREFLIGHT_CSS, t as getThemeStylesContent } from "./css-BVePVvTJ.mjs";
|
|
6
6
|
import { i as createThemeRuntime, t as getThemeScriptContent } from "./ssrScript-zDK1dqXr.mjs";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -96,19 +96,18 @@ var useCoarsePointer = () => {
|
|
|
96
96
|
/**
|
|
97
97
|
* Apply coarse-pointer hit target overrides to a resolved token map.
|
|
98
98
|
*
|
|
99
|
-
* When `isCoarse` is true, replaces `semantic.sizing.hit
|
|
100
|
-
*
|
|
101
|
-
*
|
|
99
|
+
* When `isCoarse` is true, replaces the `semantic.sizing.hit` value with the
|
|
100
|
+
* raw coarse value from `core.sizing.hit.coarse`. This mirrors the
|
|
101
|
+
* `@media (any-pointer: coarse)` block that `toCssVars` emits for CSS
|
|
102
102
|
* consumers — ensuring non-CSS consumers (React Native, canvas) get
|
|
103
103
|
* touch-appropriate hit targets.
|
|
104
104
|
*/
|
|
105
105
|
var applyCoarseHitOverrides = (tokens, theme, isCoarse) => {
|
|
106
106
|
if (!isCoarse) return tokens;
|
|
107
|
-
|
|
108
|
-
...tokens
|
|
107
|
+
return {
|
|
108
|
+
...tokens,
|
|
109
|
+
"semantic.sizing.hit": theme.core.sizing.hit.coarse
|
|
109
110
|
};
|
|
110
|
-
for (const [key, value] of Object.entries(theme.core.sizing.hit.coarse)) if (typeof value === "string") overrides[`semantic.sizing.hit.${key}`] = value;
|
|
111
|
-
return overrides;
|
|
112
111
|
};
|
|
113
112
|
var SemanticTokensCtx = React.createContext(null);
|
|
114
113
|
/**
|
|
@@ -319,7 +318,7 @@ var useTokens = () => {
|
|
|
319
318
|
*
|
|
320
319
|
* ### ⚠ CSS-coupled tokens stay unresolved
|
|
321
320
|
* A registered set of dimensional tokens (model.md §8 — spacing steps, fluid
|
|
322
|
-
* `text.*.fontSize`, `sizing.hit
|
|
321
|
+
* `text.*.fontSize`, `sizing.hit`, `sizing.viewport.*`, `sizing.measure.reading`,
|
|
323
322
|
* `spacing.gutter.*`) carry CSS-only constructs (`var()`, `calc()`, `clamp()`,
|
|
324
323
|
* `cqi`, `dvh`, `ch`). This hook returns those **as-is** — they are not usable
|
|
325
324
|
* outside a CSS engine. Colors, opacity, z-index, font weights/leading and
|
|
@@ -448,6 +447,35 @@ var ThemeStyles = ({
|
|
|
448
447
|
});
|
|
449
448
|
};
|
|
450
449
|
/**
|
|
450
|
+
* Injects the theme's base stylesheet (the {@link PREFLIGHT_CSS} preflight):
|
|
451
|
+
* a box-sizing reset, the document body's default typography and colour drawn
|
|
452
|
+
* from the semantic tokens, and the global reduced-motion guard. Render it
|
|
453
|
+
* once at the app root, alongside `<ThemeProvider>` / `<ThemeStyles>` — so the
|
|
454
|
+
* base layer is the theme's responsibility, not hand-written per app.
|
|
455
|
+
*
|
|
456
|
+
* It sets no widths, heights, or component styling (those belong to
|
|
457
|
+
* `@ttoss/fsl-ui` and the app). Requires the `--tt-*` custom properties to be
|
|
458
|
+
* present on the page.
|
|
459
|
+
*
|
|
460
|
+
* @example
|
|
461
|
+
* ```tsx
|
|
462
|
+
* <ThemeProvider theme={theme}>
|
|
463
|
+
* <ThemeReset />
|
|
464
|
+
* <App />
|
|
465
|
+
* </ThemeProvider>
|
|
466
|
+
* ```
|
|
467
|
+
*/
|
|
468
|
+
var ThemeReset = ({
|
|
469
|
+
nonce
|
|
470
|
+
} = {}) => {
|
|
471
|
+
return /* @__PURE__ */jsx("style", {
|
|
472
|
+
nonce,
|
|
473
|
+
dangerouslySetInnerHTML: {
|
|
474
|
+
__html: PREFLIGHT_CSS
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
451
479
|
* Convenience component that renders both `<ThemeScript>` and `<ThemeStyles>`
|
|
452
480
|
* in a single line — the complete SSR `<head>` setup for flash-free theming.
|
|
453
481
|
*
|
|
@@ -513,4 +541,4 @@ var ThemeHead = ({
|
|
|
513
541
|
};
|
|
514
542
|
|
|
515
543
|
//#endregion
|
|
516
|
-
export { ThemeHead, ThemeProvider, ThemeScript, ThemeStyles, useColorMode, useResolvedTokens, useTokens };
|
|
544
|
+
export { ThemeHead, ThemeProvider, ThemeReset, ThemeScript, ThemeStyles, useColorMode, useResolvedTokens, useTokens };
|
package/dist/themes/bruttal.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
3
3
|
value: 'Module'
|
|
4
4
|
});
|
|
5
|
-
const require_createTheme = require('../createTheme-
|
|
5
|
+
const require_createTheme = require('../createTheme-BzlJdFAG.cjs');
|
|
6
6
|
const require_helpers = require('../helpers-BU40JvFA.cjs');
|
|
7
|
-
const require_withDataviz = require('../withDataviz-
|
|
7
|
+
const require_withDataviz = require('../withDataviz-B-XQ1MDT.cjs');
|
|
8
8
|
|
|
9
9
|
//#region src/themes/bruttal.ts
|
|
10
10
|
/**
|